Index: COMPILE =================================================================== diff -u -N --- COMPILE (revision 0) +++ COMPILE (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,125 @@ +$Id: COMPILE,v 1.2 2004/08/17 10:12:54 neumann Exp $ +******************************************************** +XOTcl Compilation Guide (Unix) +******************************************************** + +Note, that there is a file "COMPILE.win" describing Windows compilation. +Read this file, if you plan to build XOTcl under Windows. + +First, you have to get the necessary sources: + - Before you can start, you have to get the full sources of + XOTcl. These are packed in a tar.gz file, like xotcl-XXXXX.tar.gz, + and they are available from: + + http://www.xotcl.org + + - To compile XOTcl the sources of Tcl (and optionally Tk) are + needed. Tcl (and optionally Tk) must be installed properly. You get + the Tcl/tk sources from: + + www.tcl.tk + + The best is to unpack and compile Tcl (and optionally Tk) in the + same directory as XOTcl, so that XOTcl's configure can find it + automatically. For compilation instruction see Tcl's documentation. + + +The following steps have to be performed in order to +build XOTcl: + + 1) untar XOTcl in a directory of your choice by using one of: + + gunzip < xotcl-XXXXX.tar.gz | tar -xvf - + + or on some systems: + + tar xvfz xotcl-XXXXX.tar.gz + + + 2) run configure by issuing in the unix directory: + + cd xotcl* + ./configure + + on some platforms (e.g. under Windows Environment with + CygWin) you may have to type in "sh configure" explicitly. + + If you have Tcl, Tk, and XOTcl built in your home directory + and you want to install in standard locations, a simple configure + without arguments should be sufficient. You + can avoid searching/override the settings with + the follwoing switches: + + --prefix=DIR Place where lib/packages are + to be installed (default: /usr/local) + --exec-prefix=DIR Place where xotclsh/xowish + are to be installed (default: /usr/local) + --with-actiweb Build Actiweb packages as well (sdbm, expat) + (per default deactivated) + --with-xotclsh Build xotclsh (per default deactivated) + --with-xwish Build xowish (per default deactivated) + --with-gdbm=GDBM_INCLUDE_DIR,GDBM_LIB_DIR + absolute path to gdbm.h and optionally + the path to the gdbm library. The directory infos + may be omitted + --with-tcl=DIR Where to find a compiled Tcl version, i.e. + where to find tclConfig.sh + Note that you need a source built of + Tcl (including generic/tclInt.h)! + --with-tk=DIR Where to find a Tk version, i.e. + where to find tkConfig.sh. An installed + version is sufficient. It must be the same + Tk version as the version of the used Tcl. + --with-tk-include=DIR directory containing the public Tk header files + --with-all Turns on all options (actiweb, gdbm, + xotclsh, xowish) + + NOTE: the directories specified by DIR should not be addressed relatively: + be sure to use only absolute path names + (those starting with "/") only. + + NOTE: Tcl (and Tk if you build xowish) have to be installed. You + require a Tcl source build (of the same version as installed) + as well. + + Example: + + ./configure --prefix=/usr --exec-prefix=/usr --with-all --enable-threads + + 3) now you can make XOTcl and the configured packages with + + make + + which should be actually a GNU make (sometimes called gmake). + + There are a couple of compiler options, that can make the compiled + binary faster. On a Pentium 4 PC under Linux, i would recommend + to compile with + + make CFLAGS_DEFAULT='-O3 -mcpu=i686 -Wall -fomit-frame-pointer' + + 4) install with: + + make install + + + If you only want to build/install xotcl/xowish without packages + you can switch to xotcl-XXX directory and do there: + + ./configure + make + make install + + You can test XOTcl by switching to the src directory and by running: + + make test + + +Good Luck! + +Please report bugs and problems to the authors under one of these +mail adresses: + + uwe.zdun@wu-wien.ac.at, zdun@xotcl.org + gustaf.neumann@wu-wien.ac.at, neumann@xotcl.org + Index: COMPILE.win =================================================================== diff -u -N --- COMPILE.win (revision 0) +++ COMPILE.win (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,77 @@ +$Id: COMPILE.win,v 1.1 2004/05/23 22:50:39 neumann Exp $ +******************************** +XOTcl Windows compilation guide: +******************************** + +- Consider to get a binary distribution of XOTcl from: + + http://www.xotcl.org + +- XOTcl compiles with the Visual CC Compiler + +Visual CC Compilation: +********************** + +In order to compile with VCC the following steps have to be performed: + +1) Get tcl/tk sources, compile tcl and/or tk, and install them properly. + To compile XOTcl the sources of Tcl (and optionally Tk) are + needed. Tcl (and optionally Tk) must be installed properly. You get + the Tcl/tk sources from: + + www.tcl.tk + + For compilation instruction see Tcl's documentation. + +2) Set the PATH environment to the Tcl binary directory. For instance + in the DOS box you may write something like: + SET PATH=c:\Progra~1\Tcl\bin;%PATH% + where "c:\Progra~1\Tcl\bin" is the Tcl binary directory. + +3) Before you can start, you have to get the full sources of + XOTcl. These are packed in a tar.gz file, like xotcl-XXXXX.tar.gz, + and they are available from: + + http://www.xotcl.org + + Untar the xotcl source. You can do it using a program like Winzip + or with the tar command (e.g. in the cygwin distrbution). + + Change into the win directory. + + cd win + + Open the file "configs.vc". Edit the + first lines with the path information for your system, i.e., where + to find tcl and tk sources and where to find the VCC compiler, and + where tcl/tk binaries are installed. + +4) In the 'win' directory, invoke: + + nmake -f makefile.vc + + to compile xotcl.dll, XOTclSdbm, and Expat. + Moreover, package information and XOTcl documentation will be built. + + You can build the xotclsh/xowish (per defaul deactivated), if you + need them: + + nmake -f makefile.vc xotclshells + + +5) Optionally, you may test the XOTcl build: + + nmake -f makefile.vc test + +6) Now you can install XOTcl with: + + tclsh83 installWin.tcl + + More installation notes can be found in the README file. + + +Please report bugs and problems to the authors under one of these +mail adresses: + + uwe.zdun@wu-wien.ac.at, zdun@xotcl.org + gustaf.neumann@wu-wien.ac.at, neumann@xotcl.org Index: COPYRIGHT =================================================================== diff -u -N --- COPYRIGHT (revision 0) +++ COPYRIGHT (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + * XOTcl - Extended OTcl + * + * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) + * + * (a) Vienna University of Economics and Business Administration + * Dept. of Information Systems / New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + Index: ChangeLog =================================================================== diff -u -N --- ChangeLog (revision 0) +++ ChangeLog (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,3334 @@ + +2007-10-12: + * Release of XOTcl 1.5.6 + +2007-10-09: + * More fixes for treating gobal volatile objects + during shutdown: + - do not allow to create new objects during shutdown + - do not allow objects to be set volatile during shutdown + - handle cases, where application level destroy methods + fail (this could lead to remaining tcl traces pointing + to destroyed objects) + - handle namespaced variables helding deletion traces + for volatile objects + Guess, it would be much simpler to use Tcl-level + unset traces than C-level unset traces... + +2007-10-04: + + * Revise fix below. The problem was apparently that change of a + call of Tcl_FindCommand to Tcl_GetCommandFromObj(), where the + latter one had bad side-effects when it is called during + deletion. Although the fix below fixed the symptoms, the new + approach is better since it is apparently not required any more + to fetch the cmd during PrimitiveODestroy to ensure it is not + called twice. The problem appeared in XOTcl between 1.5.3 and + 1.5.4 and happens only in 8.4.* Tcl. + + * Improve debugging code to make it easier to trace + problems with Tcl_Objs. + + * Serializer: Added dependency rule in serializer to ensure slots of + superclasses are listed before subclasses. (Thanks to Stefan + Sobernig for reporting the problem) + + * Serializer: moved deactivation of traces into "Serializer all" + to get simpler results on "o serialize". + + * Regression tests: extended tests to address + the newly identified and fixed problem cases. + +2007-09-29: + * Fix for Tcl 8.4.16 (and maybe some other recent tcl 8.4.* + versions, 8.5 is fine) for situations, where Tcl variable + contain references to deleted XOTcl objects. The fix added a + epoch increment to CallStackDoDestroy(). + +2007-09-29: + * Fix for cases, where volatile objects are + deleted before the corrsoponding trace variable. + +2007-09-18: + * Release of XOTcl 1.5.5 + +2007-09-18: + * Fix rpm build (most probably due to TEA 3.6) + +2007-09-13: + * Use AssocData instead of the clientdata of the + global namespace to store the XOTcl interpreter's + +2007-09-13: + * Upgrade to TEA 3.6 + +2007-09-10: + * Make forward option -earlybinding more robust, when + forwards are done to Tcl procs + +2007-08-16: + * Fix introspection problem for copied objects and classes + (remove superfluous ::xotcl::initProcNS) + Must have been a bug from before XOTcl 1.0 + + * Allow to load XOTcl compiled for Tcl 8.4 to be loaded + into a tclsh8.5 (again, substantial change). + The behavior can be turned off by setting + FORWARD_COMPATIBLE to 0 + + One can now test now 4 versions: + a) a native version for Tcl 8.4 (without compatibility layer) + b) a native version for Tcl 8.5 + c) a version compiled for Tcl 8.4 with compatibility layer in tclsh8.4 + d) a version compiled for Tcl 8.4 with compatibility layer in tclsh8.5 + + Tests showed that the overhead is for the compatibility + layer is between 1.1% and 2.3%, the difference between + tcl8.5 and tcl8.4 is much larger. + +2007-08-10: + * Release of XOTcl 1.5.4 + +2007-08-10: + * fixed regression test in rdf-tests (introduced + due to autoname changes in 1.4.0) + +2007-08-10: + * Fixing bugs introduced by VarReform + * Extending regression test to handle the cases + +2007-08-07: + * More work on Tcl 8.5 and VarReform + Compiles now with stock Tcl 8.5 from CVS + * Make more use faster Tcl_Obj based interfaces + (Many thanks to Miguel Sofer for the suggestions and patch) + +2007-08-06: + * Changed all references to /tmp to [::xotcl::tmpdir] to honor + TMPDIR TEMP TMP if set + + * Handling of variable traces in serializer: + traces might require a different topological sort, + which is hard to handle. Similar as with filters, + we deactivate the variable traces during initialization. + This happens by + (1) replacing the XOTcl's trace method by a no-op + (2) collecting variable traces through collect-var-traces + (3) re-activating the traces after variable initialization + + (Many thanks to Stefan Sobernig for the help!) + +2007-08-05: + * Changes to compile xotcl with the new Var structures in the + head version of Tcl 8.5. This is a rather large change, + the patch is more than 800 lines. + + (Many thanks to Miguel Sofer for the help!) + + From the Tcl Changelog + + *** POTENTIAL INCOMPATIBILITY *** (tclInt.h and tclCompile.h) + Extensions that access internals defined in tclInt.h and/or + tclCompile.h may lose both binary and source compatibility. The + relevant changes are: + + 1. 'struct Var' is completely changed, all acceses to its + internals (either direct or via the TclSetVar* and TclIsVar* + macros) will malfunction. Var flag values and semantics + changed too. + + 2. 'struct Bytecode' has an additional field that has to be + initialised to NULL + + 3. 'struct Namespace' is larger, as the varTable is now one + pointer larger than a Tcl_HashTable. Direct access to its + fields will malfunction. + + 4. 'struct CallFrame' grew one more field (the second such + growth with respect to Tcl8.4). + + 5. api change for the functions TclFindCompiledLocal, + TclDeleteVars and many internal functions in tclVar.c + +2007-07-27: + * fixed a compile problem with a superfluous semicolon in a macro + (Many thanks for Andreas Kupries for reporting and sending a patch) + * fixed two compiler warnings in gcc 4.1.2 + +2007-07-23 + * Pre-Release of XOTcl 1.5.4 + +2007-07-23: + * fixed a bug with empty argument names + (Many thanks for Stefan Sobernig for reporting the bug) + +2007-07-03: + * allow to call methods from the class to be called + from slot objects (Many thanks for + Nico L'INSALATA for noting this problem). + +2007-06-05: + * Fixed spelling mistakes in the tutorial + (Many thanks to Robert Hicks for reporting) + +2007-05-27: + * Fixed potential error with default values for parameters + starting with a "-". (Many thanks to Shishir Ramam + for reporting) + +2007-03-16: + * fixed a bug where a Tcl call adds a namespace to an object, + but xotcl did not notice it. (Many thanks for Stefan Sobernig + for reporting the bug) + +2007-01-14: + * fixing error message propagation for methods called via + configure. (Many thanks for Kristoffer Lawson + for reporting the bug) + +2006-12-12 + * changing "test == " to "test =" as required by FreeBSD + (many thanks to Martin Matuska for providing + the patch) + +2006-12-07 + * MinGW patches + (many thanks to Martin Matuska for providing + the patch) + +2006-11-25 + * Release of XOTcl 1.5.3 + +2006-11-24 + * provided compatibility with Tcl 8.5 + (checking callframe level instead of empty varframe for toplevel + frames) + + * provided compatibility with Tcl 8.4.14 + proc->cmdPtr was used in prior releases only to determine the + namespace in which the proc is executed (documented in + tclInt.h). Starting with Tcl 8.4.14, this cmdPtr is used as + well for updating the client data of a cmd, in case the proc is + recompiled. Since XOTcl used the cmdPtr to control the + namespace, this code had to be rewritten differently. The new + version is faster, but uses for filters or mixins slightly more + storage. + + * reduced calling overhead of methods with nonpositional arguments + by about 10 percent by avoiding shimmering. + + * fixed handling of "return -code break" from xotcl methods + (thanks to Artur Trzewik for the bug report) + + * library/comm/Access.xotcl: fixed handling of chunked encoding + +2006-09-29 , Uwe Zdun + * Release of XOTcl 1.5.2 + +2006-09-28 + * Extended regression test for nested contains + * fix potential bug in copy-command with c-level client data + (don't copy commands with client data for the time being, rely on + introspection) + +2006-09-27 + * Fixed memory corruption (accessing feed memory) in the + invalidation of transitive mixins (many thanks to Don Porter for + reporting it and providing suggestions, how to trigger the bug + via Tcl memory debug) + * Removed c++ style comments (many thanks to Andreas Kupries for + reporting) + * package xotcl::trace: allow to trace objects with "Trace add + trace " not only classes as before (many thanks to jima for + suggesting this) + * fix for nested -contains with new (many thanks to Stefan + Sobernig for pointing this out) + * Added a target test-nohttp for automated regression tests + on machines with firewalls (used for FreeBSD build system) + +2006-09-26 + * xotcl.c: improved portability for 64bit AMD on FreeBSD (and + maybe on other 64bit platforms as well) all vararg lists are now + terminated by ..., (char *) NULL Previously, some were + terminated by an integer typed zero-value, which can lead to + problems when sizeof(int) != sizeof(char *) + * The vararg interface is used by the following API calls in the + XOTcl code: Tcl_AppendResult(), Tcl_AppendStringsToObj(), + Tcl_VarEval(), XOTclVarErrMsg(). all occurrences are fixed. + * All occurrences of Tcl_AppendResult() removed form xotcl.c + +2006-09-24 + * xotcl.c: make sure, that no + Tcl_SetIntObj(Tcl_GetObjResult(interp), 1); + happens on shared objects. + +2006-09-22 , Uwe Zdun + * Release of XOTcl 1.5.1 + +2006-09-22 + * XOTclNextCmd() exported to external (stub) interface, to allow + applications to call next without going through a Tcl_Eval() + (Many thanks to Scott Gargash for the constructive discussions) + * removed XOTclGetSelfObj() again from the external interface + since the object/class is passed anyhow. + * some minor cleanups and additions to tutorial. + * added small fix mentioned in c.l.t for a more backwards + compatible old parameter interface. + +2006-09-21 + * Changed interface of XOTclCallMethodWithArgs to contain the + specified number of elements in objv[] rather than the absolute + number. Changed name from XOTclCallMethodWithArg to + XOTclCallMethodWithArgs + * Added XOTclCallMethodWithArgs() to he external interface to + allow C applications faster invocation of XOTcl methods + * Simplified and standardized calling conventions for + C-implemented methods. ClientData receives always the + XOTcl_Object, no matter, what client data was specified during + registration (e.g. XOTCL_NONLEAF_METHOD). Users + can rely on using ClientData for Objects + * Some performance improvements in invocation of XOTcl methods + +2006-09-20 + * added XOTclGetSelfObj() to he external interface to obtain the + current object from a C application from the callstack + * fixed genstubs target in Makefile.in regenerated all stub files + * removed a few more compiler warnings for the power64 bit + architecture + +2006-09-19 + * added XOTCL_NONLEAF_METHOD: This constant + must be used fwhen registering C-implemented methods + that call "::xotcl::next" to push the XOTcl activation record. + + Example: + XOTclAddIMethod( interp, MyClass, "mymethod", MyMethod, + XOTCL_NONLEAF_METHOD, 0 ); + +2006-09-18 + * fixed a bug in parsing nonpositional arguments, when + e.g. square brackets are used in type declarations for + parameters. + Class C + C instproc foo {{-q:mult[2],optional 1} -x:boolean,optional args} {puts hu} + Tcl lists add another layer of braces + ... foo {{{-q:mult[2],optional} 1} -x:boolean,optional args} .... + which have to be removed at the definition time of the parameters. + * fixed a 64-bit problem for POWER5+ machines + * fixed serializer to handle deeper stratification layers + * fixed an autoname crash under NT + (Many thanks to Mark Jannsen for the patch) + +2006-09-17 + * fixed a bug in deprecated part, when -setter is used in parameter + options. + +2006-09-15 + * Changed "test -e" to "test -f" in Makefile.in, since + the standard test command in Solaris does not understand "test -e" + (Many thanks to Andreas Kupries for reporting) + +2006-09-14 , Uwe Zdun + * Release of XOTcl 1.5.0 + +2006-09-13 Uwe Zdun + * Update of build files for windows + +2006-09-10 + * added method "contains" to create objects aggregated into + other objects (essentially a value added back-port of the OpenACS + version). + * based method "slots" on method "contains" for improved orthogonality + * rearranging sections in the tutorial + * deleted obsolete sections from the tutorial + * serializer: when an object is defined as exported, export the whole + object tree (no need to specify export of all slots for exported objects) + +2006-09-08 + * added -verbose to forward options + * added subst to the tcl-impored methods + * fixed a bug with .... -slots {Attribute new -name a1} + (Many thanks to neophytos for reporting} + * provide method serialize (for Object), when the serializer package is loaded + +2006-09-07 + * provided Tcl 8.5a4 compatibility + * spellechecking langref, make terminology more consistent + (naming of arguments like .e.g methodName) + +2006-09-04 + * update of tcl.m4 for newest TEA from CVS + +2006-09-03 + * "mixin|filter|instmixin|instfilter set ..." deprecated, use + "mixin|filter|instmixin|instfilter assign ..." instead + +2006-09-01 + * fixed a bug in the xotcl trace module (many thanks to jima for reporting) + * extended procsearch to report parametercmd and instparametercmd + +2006-08-30 + * extended procsearch to report as well [inst]parametercmd + +2006-08-26 + * extended procsearch to report as well [inst]forward and [inst]cmd + +2006-08-25 + * new subcommand "info slots" + * implemented backwards bug-compatible "info parameter", deprecated + +2006-08-23 + * added system slots and attribute slots (see documentation) + +2006-08-21 + * changed the implementation of the configure command + and setrelation command to use Tcl_GetIndexFromObj(); + * added the subcommand "class" and "superclass" to the + the setrelation command. + +2006-08-22 + * fixed a bug with nonpositional arguments, some + positional arguments and "args" + * fixed a bug in nonpositional arguments when called without + arguments + * improved error messages in connection with nonpositional arguments + * extended interface of XOTclErrBadVal() to provide better error messages + (this changes the stub interface, so we have to change the version number) + +2006-08-21 + * new command for registering predefined C-implemented Tcl commands + as methods + ::xotcl::alias | \ + ?-objscope? ?-per-object? + "-objscope" has the same meaning as for forwarder, + "-per-object" has the same meaning as for the method "method", + This command is somewhat similar to "[inst]forward -earlybinding", + but can be used to bootstrap xotcl (when e.g. no methods are + available). + +2006-07-20 + * Documentation bug: method volatile was documented + as a method of class, but is documented as a method of object + (Many thanks to Kristoffer for reporting) + +2006-05-22 + * package.xotcl: evaluating calls to "tcl_package" in the + global namespace instead of the current. This fixes problem of + xotcl 1.4.* with xotclide. Many thanks to + Bill Paulsen and Artur Trzewik for identifying the problem and + suggesting a fix. + +2006-04-20 + * xotcl.c: new option for the argument substitution. When the argument + list of the forward command contains "%argclindex {a b c}", then + depending of the number of arguments at invocation "a", "b" + or "c" is substituted. + * New option for forwarder: The option -earlybinding can be used to look + up the function pointer of the called Tcl command at + definition time of the forwarder instead of invocation time. + This option should only be used for calling C-implemented Tcl commands) + +2006-03-22 + * deprecated command filterappend, instfilterappend, mixinappend, + instmixinappend, tclcmd, insttclcmd deleted + +2006-03-20 + * allow single colons in method names (fix in xotcl.c, NSTail()) + +2006-02-17 , Uwe Zdun + * release of 1.4.0 + +2006-02-17 + * fixed a bug with nonpositional arguments in connection with "args" + (Many thanks for Kurt Stoll pointing this out) + * added more regression tests + * fixed dependencies created for rpm binaries + * mak compile cleaner for gcc 4.* under linux + +2006-02-08 Uwe Zdun + * fixed a bug with transitive mixins + +2006-02-02 + * Upgrade to TEA 3.5 + +2006-01-10 + * fixing exit behavior with variable traces in multi-threaded + environments (volatile objects could be demalloced twice before) + +2006-01-08 + * allowing tcl commands and variables as default values for parameters; previously, + only one-word commands were allowed. + +2006-01-07 + * ::xotcl::configure options can be called with one (for query) + and two (for setting) arguments (similar to set) + * new option: ::xotcl::configure softrecreate on|off + if softrecreate is set, class relations (superclass, subclass, class, instances) + are not affected by a recreate; this allows files with class definitions + more easily to reload + * don't destroy namespace imported child objects + +2006-01-06 + * unsetting the global variable "cmd" from predefined.xotcl + (Many thanks to Koen Danckaert for reporting) + +2006-01-05 , Uwe Zdun + * fixing incorrect state in filters after next + * extended regression test + +2006-01-02 + * info children returns true children, no namespace imported objects/classes + * extended regression test + +2005-12-20 + * upgrading configure scripts of subcomponents to TEA 3.4 + +2005-12-17 + * fixing missing omitted message for unknown subcommand to self + +2005-12-07 , Uwe Zdun + * release of 1.3.9 + +2005-12-06 + * fixed bug with error propagation when gett/setter methods are + used for parameters (many thanks to Manfred Stelzhammer for + pointing this out) + +2005-12-04 + * Upgraded TEA to 3.4 + * updated rpm build (many thanks to Ildiko Schmidt and Alexander Bergolth) + +2005-11-28 + * new command ::xotcl::__qualify: convert an relative name + into an command name (exactly as create does it, ignoring + namespaces from transparent interceptors) + +2005-11-26 + * require automatically a namespace when a childobject is added + +2005-11-18 + * new switch -nocomplain for "mixin|instmixin|filter|instfilter delete" + to avoid error messages when deleting entries not there (similar unset) + +2005-11-10 + * " info vars" does not trigger read traces anymore + * fixing version numbers for package require + (many thanks to Andreas Kupries for the report) + * Serializer: exportMethods accepts forwards/instforwards now + as well + +2005-11-02 + * new subcommand of self: [self args] return the full argument list + of the current call + +2005-10-02 , Uwe Zdun + * release of 1.3.8 + +2005-10-01 + * fixed a bug concering __unknown called via mixin method + (many thanks to Zoran for the report) + * fixed a memory leak in isMetaClass() in connection with + instmixins (many thanks to Ben Thomasson for the report) + +2005-09-28 + * fixed bug in instvar (many thanks to Koen Danckaert for the report) + extended regression test + +2005-09-27 , Uwe Zdun + * release of distribution XOTcl 1.3.7 + +2005-09-26 + * new check option "switch" for non positional arguments. + If .... -somearg:switch is specified in the definition + of a method, this behaves like "boolean", except that + no additional argument is specified during invocation. + A default value of "off" can be turned on, as well as the + default value "on" can be turned off by specifying the switch + in an invocation. + +2005-09-25 + * defined an experimental method named "method" + * new global command "::xotcl::configure filter on|off" + to deactivate all filters for an interpreter. This is + needed for serializing code with active filters. + * Changed xotcl serializer to use "::xotcl::configure" + +2005-09-14 + * Fixing serializer to enforce methods on ::xotcl::Object or ::xotcl::Class + before other objects and classes + +2005-09-13 + * adding two package require into library files + (many thanks to Andreas Kupries for the report) + +2005-09-09 + * fixing various namespace issues in library files to make + regression test working again. + +2005-09-08 + * documentation and regressiontest for "self isnextcall" added + * added further regression tests, documentation improvements + * Httpd: changed classes + AccessControl BasicAccessControl + DigestAccessControl Responder + to Httpd::AccessControl ... Httpd::Responder + in order to reduce namespace pollution; applications + refering to these must use now these names + +2005-09-07 + * fixed callstack information for expr; old code could + believe (in connection with forward) to be in an uplevel when + a forward to expr was called. This could result in a wrong + result for [self].... + + * merged first bunch of files from Andreas Kupries to + make libraries more namespace clean. fixed a few namespace iusses + in the libraries. Many thanks to Andreas Kupries! + + * fixed refrence resolving in istype; the following works now the same + way: + C create c1 + c1 istype ::C + c1 istype C + +2005-09-02 + * code cleanup: removed ifdefs for TCLCMD + +2005-08-04 + * fixed instvar implementation when variable names + are empty strings (many thanks to Zoran for reporting this) + +2005-07-13 Uwe.Zdun@wu-wien.ac.at> + * new subcommand for self: [self isnextcall] + is true, if the current method was called via next. + This fixes the abstact method. + +2005-05-04 + * prevent new from overwriting an existing object + (increment further until unused name is found) + +2005-07-04 Jeff Hobbs + * providing update for configure + +2005-04-04 + * allow xotcl to be used in safe safe interpreters + + ~rlwrap /usr/bin/tclsh + % package req XOTcl + 1.3.7 + % interp create -safe slave + slave + % load "" xotcl slave + % slave eval ::xotcl::Object o1 + ::o1 + +2005-03-24 + * implemented resolving for references to classnames not + in the current namespace such that the following works + namespace eval foo { + Class M -superclass Class + } + without the need of specifying "-superclass ::Class" + + * implemented resolving for references to imported class names + such that the following works + namespace eval foo { + namespace import ::bar::A + Class M -superclass A + } + +2005-03-17 , Uwe Zdun + * release of distribution XOTcl 1.3.6 + +2005-03-16 + * extended semantics of meta class definitions: + old: + a meta class is either ::xotcl::Class or one of its + direct subclasses + new: + a meta class is either ::xotcl::Class or a class + inheriting from ::xotcl::Class + The subtle difference is that with the new definition + every class can be made to a superclass by adding an instmixin + of Class (or one of its subtypes) to it. Before this change + it was necessary to alter the Class hierary explicitely. + In order to define that every class should be a metaclass, + one can use now + Object instmixin Class + instead of the rather complicated solution i posted on the + xotcl mailing list not long ago. + + * new info subcommand: info precedence + * fixed possible crashes of objects are called with class methods + (e.g. due to instmixins) + * fixed bug when instmixins are defined recursively + (e.g. Class instmixin Class) + * code refactoring, fixed erroneous documentation of c code + * improved documentation in tutorial, als syntactically + such that htmldoc 1.8.24 works with it + * extended regression test, reduced dependency on tests + +2005-03-11 + * fixed bug noted by Kristoffer Lawson: + - Don't allow an object to be changed to a class via "o class Class" + - Don't allow an object to be recreated (without alloc) to a Class + * fixing the following command + namespace eval foo { + Class m + Object o -mixin m + } + such that m is resolved from the foo namespace. + The ::xotcl:: namespace is now skipped, since a + helper method that calles the primitive setting command + is defined there + +2005-03-01 + * improved documentation of next in langRef + +2005-02-23 + * fixed passing of error code from init methods + (thanks to Fabrice Pardo for noting it) + * returning PACKAGE_VERSION after a package require + (e.g. 'package req XOTcl' returns now 1.3.6) + +2005-01-15 , Uwe Zdun + * release of distribution XOTcl 1.3.5 + +2005-01-10 + * added instproc for ::xotcl::Class allinstances + to return all instances for the actual class + +2005-01-07 + * code cleanup for nonpos args + * new methods for Serialzer: + - Serializer methodSerialize (to serialize methods) + - Serializer exportMethods (to export methods from the + xotcl namespace via ::Serializer all + - Serializer exportObjects (to export Objects from ::xotcl::*) + * put Serializer into a namespace (::Serializer is auto-exported) + * fix for serializer, when xotcl is not imported globally + * aolserver: support for namespaced objects in xotcl.tcl + +2005-01-06 + * made introspection options for methods with nonpos args + compatible with Tcl + * adding functionality to allow nonpos args and positional args + to be specified in the same argument list (still supporting + the syntax with separate lists) + +2005-01-05 Uwe Zdun + * Added support for defaults + non-pos args in info args, + default, instargs, instdefault + * fixed bug: Check Boolean in non-pos args crashed with 2 args + +2004-12-15 + * fixed crash for empty arguments + (thanks to Gerald Stermsek for reporting this bug) + +2004-12-02 , Uwe Zdun + * release of distribution XOTcl 1.3.4 + +2004-12-02 + * changed metadata analyser from recursive to iterative + +2004-11-30 + * various fixes to improve portability + +2004-11-27 , Uwe Zdun + * release of distribution XOTcl 1.3.3 + +2004-11-20 + * fixed [self callinglevel] in nested uplevel loops + in the presence of filters, extended regression test + +2004-11-19 Uwe Zdun + * fixed bug: empty non-pos args, double dash alone. + Thanks to Bryan Schofield for reporting this bug. + Added tests. + +2004-11-18 + * changed internal communication between end-of-filterchanin + and "unknown" to flag instead of return code XOTCL_UNKNOWN + * fixed [self callinglevel] in nested uplevel loops + (many thanks to MichaelL@frogware.com for reporting the problem) + +2004-11-14 + * fixed yet another free memory read + (many thanks for Zoran for help with purify) + +2004-11-13 + * fixed entries for aolserver in configure.in + (many thanks for Zoran reporting this problem) + * fixed --enable symbols (many thanks for Zoran reporting this problem) + * fixed free memory read in namespace deletes + +2004-10-30 + * added error message when someone tries to delete a + non-existing proc/instproc + * using less memory for objects and classes with procs/instprocs, + when they do not use assertions (saving 14%) + * prettified langref with css + * documented deletions of object procs and instproc through + proc/instproc with empty args and empty body + +2004-10-13 + * make namespace handling code more orthogonal + * using resolver for exists method (might be used in future for + other methods as well) + * cleanup of dead code + +2004-10-09 + * fixed recreation bug in connection with namespace eval + * fixed exists for objects with own namespaces + +2004-09-20 + * Fixed bin-tar target to include sdbm+gdbm+expat + * Improved documentation (tutorial and langref) for forwarding options + * using $prefix in install-aol, provided a README.aol file + * more general fix for namespace handling; still possible problem + with shared Tcl_Objs of type XOTclObject, when referred to from + different namespaces. + +2004-09-15 Uwe Zdun + * fixed bug: non-pos args did not work correctly with default + values. Thanks to Bryan Schofield for reporting this bug. + Added tests for non-pos args + default values. + +2004-09-09 Uwe Zdun + * fixed possible accesses to object namespaces that got already + destroyed by TCL, by checking for ((Namespace + *)nsPtr)->deleteProc is not NULL, ie. it is still set to + XOTcl's Namespace Delete Proc, and not invalidated by + TclTeardownNamespace yet. add test for this to testx. Thanks + to Kristoffer Lawson for reporting this bug. + * fixed mis-formating in tutorial (only visible in browsers + other than Mozilla) + +2004-09-02 Uwe Zdun + * temporary fix for alloc behavior to deal with explicit namespace changes + by user, thanks to michael.heca@email.cz for reporting the + bug. Added a test for this change. + +2004-08-26 , Uwe Zdun + * release of distribution XOTcl 1.3.1 + +2004-08-26 + * removed dependencies on TclGetInterpProc(), added define + USE_INTERP_PROC if someone needs this. If nobody complains, + we will remove this in the future + +2004-08-22 + * fixed nonposargs, when used with checker procs and + spaces in arguments + * auto-generating docs in build tree (instead in + source tree) + * cleanup and documentation of somewhat confusing declations + in xotcl.h and xotclInt.h (XOTcl_Object and + XOTclObject) + * make tar makes distclean first + +2004-08-19 + * if configure is run outside the src tree the directory + structure is now built on the fly. All binary + output files are now placed in the built-tree. + +2004-08-18 + * added a regresion test for serialzer + * fixed a "last minute" bug in serializer + * configure changes: made subdirs relative to $srcdir, + set XOTCL_SRC_DIR to $srcdir to make build succeed + from outside dir + +2004-08-17 , Uwe Zdun + * release of distribution XOTcl 1.3.0 + +2004-08-17 + * fixing make for rpm + * tweaking configures stuff to work with rpm + +2004-08-16 + * adding two sections to tutorial, updated langref.xotcl + +2004-08-15 + * Adding non positional arguments to serializer + +2004-08-12 + * fixed a possible core dump when 'my' was called without + args (many thanks to Bryan Schofield for noting) + * some code generalization and cleanup + +2004-08-01 + * changes to forward and instforward: + providing positional arguments for the + forwarder. It is now possible to prefix the + arguments with "%@POS ", where POS can be a + positive or negative number or "end". A negative + offset can be used to address relative to the end + +2004-08-01 + * xotcl.c: calling __unknown when an object with an unknown + parent namespace is called (for handling nested object + classes in Zoran's ttrace package) + +2004-08-01 + * yet another fixed access to freed memory (when the configure + method returned a non numerical value, which was tried to be + converted into a number; setting refcounts properly helped. + (thanks to Zoran for his help with Purify ) + * minor code cleanup + * test with tcl 8.4.7 + +2004-07-29 + * changes to forward and instforward: + + %some-command executes some-command at invocation time and + substitutes result + + substitution extended to all arguments (also on callee) + +2004-07-28 + * yet another fixed access to freed memory + (thanks to Zoran for his help with Purify ) + +2004-07-26 + * fixed bug in filters in connection with instmixin; + inactive tcl callstack frame was dereferenced. This fixed as well + a potential uplevel bug + * fixed access to freed memory (thanks to Zoran for his help with Purify ) + +2004-07-23 + * implemented experimental next method for delegating same-named procs + to different objects + +2004-07-20 + * fixed a potential crash when a instmixin was registered on itself + +2004-07-19 Uwe Zdun + * added checkoptions to non pos args + * added tests & documentation of non pos args + +2004-07-18 jim@jam.sessionsnet.org + * Added file autogen.sh, to generate all configure files + * Added file autoclean.sh, to clean whole source tree, incl. configure + +2004-07-18 + * added removal of autom4te.cache to distclean + * make doc added to "all" target + * auto-generated html docs are removed in a make clean + * remove all *~ files in directory tree via find (ok with TEA3?) + +2004-07-11 jim@jam.sessionsnet.org + * revamped configure recursion + * added "--with-xotcl=" to child configure.ins + * arranged for root configure to call child configures specifying path + * located and fixed bug where parts of the build cannot find xotcl.h + if xotcl was not "make install"ed (bug implies build always finds + old includes) + * ensured "make clean" and "make distclean" still worked + * TODO: clean should remove emacs backup files + distclean should remove autom4te.cache + docs should be built during make, installed during make install + and removed from the build dir during make clean. + +2004-07-03 + * extended commands filter, mixin, instfilter, instmixin: + These commands are changed in a backward compatible manner. They + can be used as follows + + obj mixin same as: obj info mixin + obj mixin {C1 C2} same as: obj mixin set {C1 C2} + obj mixin set {C1 C2} sets the mixins for obj + obj mixin get same as: obj info mixin + obj mixin add C3 adds a mixin on front of the mixin list + obj mixin add C3 end adds a mixin at the end the mixin list + obj mixin add C3 3 adds a mixin at the 3rd position + obj mixin delete ::C3 removes the mixin from the mixin list + + The same semantics are available as well for filter, instmixin + and instfilter. + The implementation uses the forwarder and is extensible, new + subcommands can be added. As a side effect, the c-code was reduced + by 50 lines. + * the commands mixinappend, filterappend, instmixinappend and + instfilterappend were marked as deprecated and will be removed + in future versions + +2004-07-02 Uwe Zdun + * integrated support for non-positional arguments for procs + and instprocs + +2004-07-02 + * rename forward option -inscope to -objscope + * xotcl.c: added current namespace prefix, when a forwarder is + defined with -objscope and no namespace prefix was specified + * optimized forward/instforward such it reaches practically + same speed as tclcmd/insttclcmd. + * removed tclcmd/insttclcmd + * added tests for forward to regression test suite + * applied and fixed the config improvements by Jim Lynch + +2004-07-01 + * xotcl.c: allow literal %self, %proc, %1 etc. as arguments of the forwarder: + arguments in the definition of a forwarder proc + starting with two %-characters are changed into arguments starting + with one % + * xotcl.c: forced options to be placed in forward definition after + before + * xotcl.c: new info option for Object and Class: + info forward ?-definition? ?pattern? + list the defined forwarder for the class/object. + * Serializer.xotcl; Added handling of the forwarders to the serializer. + Therefore forwarders are kept in the serialized state. + +2004-06-29 + * changed name of delegator methods to forward/instforward + * removed most of the switches of the forwarder. We have now + + obj forward ?options? ?arglist? + where arglist might contain + * %self for inserting the forwarding object + * %proc for inserting the forwarding method + * %1 for using the first argument of the invocation + options might contain: + -inscope: evalute method in obj scope + -methodprefix: prefix, to be added in front of called method + (to avoid name clashes with methods like "set", "mixin" etc.) + -default list-of-methods: to be used in connection with %1, when there + are not enough arguments in the actual call. + +2004-06-24 + * fixed coredump for delegation to object without method specified + (many thanks for Bryan Schofield for the bug report) + +2004-06-20 + * removed inclusion of + * second version of delegator methods cmd and instcmd + + A delegator method is defined via + Class instcmd method COMMAND ARGS + a call to the defined method with some args + obj method arg1 arg2 arg3... + is mapped to + COMMAND ARGS arg1 INSERTTOKENS arg2 arg3... + + Class instcmd \ + ?-nocaller? \ + ?-nomethod? \ + ?-inscope? \ + ?-skip nr_of_tokens? \ + ?-insert tokens? + ?-prefix string? \ + ?-defaultmethod subcommand? \ + + where + methodname: name of an instcommand for the class + to be registered, + commandname: command that receives delegation + -nomethod: don't insert the callers method + -nocaller: don't insert caller after method + -inscope: evalute method in obj scope + -skip: skip n arguments from the call. "-skip 1" + means that not the "method" from the invocation is + used as the method call, but the first argument + -prefix: prefix, to be added in front of + called method (to avoid name clashes + with "set", etc.) + -insert: tokens to be inserted after the caller + + -defaultmethod: when number of arguments is not sufficient + to determine the called method, use the specified + value to be used as method name (only useful when + -skip is used and the arguments run out) + (e.g. [$obj info] be mapped to COMMAND showInfoOptions) + + +2004-06-18 + * added *.a to CLEANFILES in configure.in to rm stublibfile + on a "make clean" + * added subdir traversal for distclean + +2004-06-13 jim@jam.sessionsnet.org + * fixed make distclean target + factored list of configure output files into macro made sure + value of output files got through to make distclean target + +2004-06-12 + * changed namespace treatment in procs/instprocs + in provious versions, methods were evaluated in the + namespace where they are invoked. This has the problem that + either the xotcl primitives (next,my,self) have to be + prefixed in methods by ::xotcl::, or ::xotcl::* has to be + imported globally. Now, the instprocs are evaluated in the + namespace where they are defined. + * computing default prefixes in insttclcmd/tcllcmd for + not fully qualified commands + +2004-05-29 + * first version of instdelegatecommand + + * defined metaclass ::xotcl:.SelfApplicableClass to allow + for instprocs of this class to be applicable for itself + (useful for delegation objects) + + * first version of ::xotcl::relations + (for relations between objects and classes and for + inter-class-relations) + +2004-05-22 + * fixed path for installing files in Makefile.in + (many thanks to Jeffrey Hobbs) + * fixed path searching in xotcl.m4 + +2004-05-07 + * fixed compile problems under HPUX + (with the help of Attila Dona') + * fixed some compiler warnings in tcl-expat showing up + (some are still missing) + with -Wall -Wconversion -Wno-implicit-int + +2004-04-30 + * removed duplicates from results from [obj info methods] + * fixed GENERIC_HDRS in configure.in and Makefile.in + * fixed documentation bugs for "info children" and + "info classchildren" + * fixed an incorrect error message, when method called + from a mixin was not found. + +2004-04-25 + * alloc returns name of created object + * On an "Object create ::o1 -noinit" the noinit option + deactivates the search for default values + (as used in the serializer) + * TEA3 changes: + - re-included xotclConfig.sh file in xotcl dependent + libraries + - fixed variable contents in xotclConfig.sh file + - passing of include and spec file for gdbm + +2004-04-10 + * start to move to TEA3 + * moved tcl scripts xotclsh and xowish into apps/utils + * made minimal build independent from tclsh; + new target libraries-pkgindex, fulldoc, doc removed + from default targets + * at least for the time being, no static shells + +2004-03-23 + * added a flag --with-aolserver3 to configure and removed + the checking of the current directory to determine whether + or not to compile an AOLserver 3.* module. Thanks to Jim + Lynch to suggestion it. + +2004-03-03 + * fixed a potential crash in procSearch method (Thanks to + Artur Trzewik for the good error report) + +2004-02-29 + * callMethod* calls DoDispatch instead of ObjDispatch + * adding a callStackPush() for XOTclOEvalMethod() such that + 'o eval self' returns '::o' + +2004-02-21 + * added link to XOTcl wiki to xotcl homepage. + +2004-02-20 , Uwe Zdun + * release of distribution XOTcl 1.2.0 + +2004-02-17 Uwe Zdun + * fixed a Tcl_Obj ref count free that was called too early. + * fixed support for Visual CC debugger + * fixed Win version info + +2004-02-16 + * fixed a reference to a structure of a destroyed object + +2004-02-16 Uwe Zdun + * added self class and self proc context to GuardCall + * removed guardedScope and info guardedlevel completely + from the code + -> use parameters instead (see tutorial) + * rewritten the tutorial text for mixin/filter guards completely + * added new files to Win makefile.vc + +2004-02-14 + * experimental new command "self guardedlevel" as replacement + for getGuardedScope + * added documentation for self callinglevel, self + activelevel and the methods upvar and uplevel + * used a bold font for predefined Tcl and XOTcl words + in the HTML version of the tutorial + +2004-02-13 + * xotcl.c more code cleanup: + - some minor performance improvement + - used the same idiom for iterating over a class + hierarchy consistently + - simplified the usage of ComputeOrder() and let + the optimizer do more work + +2003-02-04 Uwe Zdun + * xotcl: removed MixinRemoveFromMixinStack, + MixinRemoveFromCmdPtr, MixinRemoveOnObjFromCmdPtr, + FilterRemoveFromFilterStack, + FilterRemoveFromCmdPtr, FilterRemoveOnObjFromCmdPtr ... and + replaced with simple forward stepping in cmd list. + * made the mem count work with multi, single-threaded interpreters + +2003-02-03 Uwe Zdun + * testx: tests for CmdListReplaceCmd, MixinRemoveFromMixinStack, + MixinRemoveFromCmdPtr, MixinRemoveOnObjFromCmdPtr, + XOTclOGetGuardedScopeMethod, XOTcl_InterpObjCmd, + XOTclOVwaitMethod, + * xotcl: removed XOTclAssertionRename, + simplified XOTcl_RenameObjCmd + * corrected mistakes in tutorial code for filterguards. + +2004-01-31 + * performed coverage analysis of regression test + * changed unsuccessful branches into asserts + * extended testx.xotcl for better coverage + +2004-01-28 + * Streamlined code; removed mixinChainOn from mixinStack and + filterChainOn from filterStack and use callstack + frameTypes instead. + * some performance improvements + +2004-01-27 + * implemented uplevel method + (uses [self callinglevel] when no level specified) + * fixed a bug in next, when methods on the same object are called + from within a mixin class and filters are defined + * some performance improvements + +2004-01-19 + * added more test cases, + * upvar method fully functional + * simplified CallFrame management on XOTcl stack + (wish, CallFrame had ClientData !!!) + * Reduced size of XOTclCallStackContent + * modularized xotcl more (new file xotclShadow.c; all shadowing + of Tcl commands and access of global tcl obj commands is + treated there) + * included a fix from Zoran for thread exit handlers. + +2004-01-16 + * defined upvar method (uses [self callinglevel] when no level + specified) + * simplified stringIncrement method and added a couple of + assert(). + +2004-01-15 + * allow volatile to be called from toplevel + * decrementing refcount of global objects as needed + (some had a high increment) + +2004-01-14 + * method 'new' now uses stringIncrement, which replaces the name + generation based on numbers by a name generation based on + strings. The strings are constructed by small and capital + letters plus digits and correspond to a number of a number + system with the basis of 26+26+10=62. These strings can grow + up to memory size. XOTcl can run as a server practically + infinitely long generating objects with 'new'. + + * new package xotcl::upvar-compat + This package provides backward compatibility with earlier + versions of xotcl that redefined upvar/uplevel such that + these commands ignore inactive filter and mixin frames + (upvar behaves the same whether or not a filter is + installed). Newer scripts should use + upvar/uplevel [self callinglevel] var/command + instead. This package can be used via + + package require xotcl::upvar-compat + + * moved resetting of shadowed tcl commands after the deletion + of object (as suggested by Zoran) + +2004-01-11 + * all occurrences of uplevel/upvar equipped with + [self callinglevel] such that library works with standard + uplevel/upvar + * faster version of 'new' method (more than 20% faster, + using c-variable, faster long to ascii conversion) + * objinst (of oo-bench) about 17% faster + +2004-01-10 + * polished macros XOTcl_FrameDecls, XOTcl_PushFrame, + XOTcl_PopFrame (2 versions, slower version with less + dependencies on tclInt.h) + * removed mixinCalls and filterCalls from interpreter state. + * removed unneeded macros + +2004-01-08 + * fixed bug on exit, when no threads are enabled + (different cleanup strategy in threads) + * fixed crash on deleted Tcl_Cmd, when xotcl debugging output + is turned on + * some more code cleanup + +2004-01-07 + * removed varFramePtr from xotcl callstack + * removed unneeded variables from runtime state + * resetting of csc->callsNext after a next call + * added "methods" to info info + +2004-01-06 + * cutting of callframes removed completely + * 2 new subcommands for self: + - self callinglevel: returns the tcl stack level to address + the invocation of the actual method + - self activelevel: returns the topmost active stack entry + from the xotcl stack + Both commands return the absolute level number (syntax #n) + if called from an xotcl method or 1 if called from a tcl + proc. These subcommands are designed to be used in the form + of "upvar [self callinglevel] a b" + * Replaced C implementation of uplevel and upvar + (with callstack manipulation) by a simple Tcl proc that uses + [self callinglevel] as default level (if is was not called + with an explicit level). + * Extended test suite + * Changed all variables of type "Interp *" to "Tcl_Interp *" + and defined macros Tcl_Interp_XXXX to access component XXXX + * Changed all variables of type "CallFrame *" to + "Tcl_CallFrame *" and defined macros Tcl_CallFrame_XXXX to + access component XXXX + +2004-01-04 + * callstack manipulation reduced significantly + * speedup on xoRDF.test about 7% + * self callingobject/callingclass/.... refers always to + last invocation (ignoring next-chain) + * consequence: mixins and filters are transparent on the + callstack + * possible extension "self previous ?n?" similar to "self next" + to obtain information about next chain + * possible extension "self level ?n?" similar to + "info level ?n?" to obtain information about call stack + +2004-01-02 + * Changed all variables of type "Namespace *" to + "Tcl_Namespace *" and defined macros Tcl_Namespace_XXXX to + access component XXXX + * generalized invocation on callProcCheck and + handling of calldata in new function DoCallProcCheck + * overall code cleanup + * extended test suite with tclmd and insttclcmd + +2004-01-01 + * fixed loop on invocation of methods registered by + the tclcmd method + * allowed to register fully qualified commands via + tclcmd or insttclcmd + * made insttclcmd to work from mixin or instmixclasses + * renamed "next" method to "__next" + * restored old behavior of defaultmethod + +2003-12-31 + * Changed all variables of type "Command *" to "Tcl_Command" + and defined macros Tcl_Command_XXXX to access component XXXX + * new predefined method self: [ self] returns fully + qualified name of object + * potential incompatibility: + calling an object without name does not return fully + qualified name, use "self" method (see above) instead. + To keep backward compatibility, define + Object instproc defaultmethod {} {return [my self]} + * New method " next" can be used to invoke next + on the last recent invocation of a method on . + must be on the callstack, otherwise an error message + is generated + * The new defaultmethod calls next on parent object to + prohibit shadowing of methods through sub-objects + +2003-12-28 + * new functions: CallStackUseActiveFrames()/CallStackRestoreSavedFrames() + to to avoid walking through and modifying the whole stack + when locating an active frame to set variables (using in + -volatile, instvar, info defaults) callstackcutframes still + used in info level, uplevel, upvar, info callingproc, + callingclass, callingobject + +2003-12-25 + * update of various library functions (such as Httpd) to + use sub-objects as methods (avoids calls of [self]::objname) + +2003-12-19 + * xotcl.c: allow to call sub-objects as methods via "my" + +2003-12-16 + * added logdir as parameter for Place (HttpPlace) + * fixed handling of content-length == 0 in Httpd.xotcl + to avoid Problem with microsoft explorer's WebDav queries + +2003-11-13 , Uwe Zdun + * release of distribution XOTcl 1.1.1 + +2003-12-13 + * Removed dependency that certain variable references in + tclConfig.sh (such as + TCL_SHARED_LIB_SUFFIX='${VERSION}${DBGX}.so'); There was a + problem on freebsd systems that use hardcoded "84" instead + of version in this definition, which leads to a problem when + the SHARED_LIB_SUFFIX is used with different VERSIONs (such + as in XOTcl). We set now the suffixes as follows + + eval "SHARED_LIB_SUFFIX=${VERSION}${TCL_DBGX}${TCL_SHLIB_SUFFIX}" + eval "UNSHARED_LIB_SUFFIX=${VERSION}${TCL_DBGX}.a" + + and pass it through xtoclConfig.sh to the c based + c-components (sdbm, gdbm, expat) + +2003-12-08 + * Some cleanup in tclexpat.c to make it compile on freebsd + * configure: made --with_gdbm configurable such that + include path and library path can be configured + * Httpd.xotcl: added simple redirects, can be used like e.g. + Httpd h2 -port 9086 -root /tmp \ + -redirect {^(mailman|pipermail|cgi-bin) + http://alice.wu-wien.ac.at>:80} + +2003-12-07 + * incorporated more fixes for build system suggested by Daniel + Steffen + * changed version number to 1.1.1 + * further cleanup in Makefiles, reduced redundancy in + distro by using symbolic links + * used everywhere for SHLIB_LD_LIBS XOTCL_BUILD_STUB_LIB_SPEC + instead of XOTCL_STUB_LIB_SPEC + +2003-12-06 + * httpd.xotcl: fixed return format in HTTP reply header + parameters Allow: and Public: for HTTP OPTIONS method + * library/store/XOTclGdbm/: fixed initialization of + xotcl stubs, usage of ck{free,alloc} vs. {free,malloc}. + * library/store/XOTclSdbm/: fixed handling of O_SYNC on + system that do not have it + * Configure can run now as well from outside of xotcl sources; + One can use now for example the following commands to + compile and install XOTcl + + % mkdir -p /tmp/xotcl/unix + % cd /tmp/xotcl/unix + % ~/xotcl-1.1.1/unix/configure --with-all + % make + % make test + % make install DESTDIR=/tmp + +2003-12-05 + * incorporated changes as suggested by Daniel Steffen + - using consequently DESTDIR for all directory references + - made procs in predefined.xotcl independent + from namespace import ::xotcl::* + - make references relative to $(srcdir) in all Makefile.in + +2003-12-02 + * added "--with-tkinclude" + * fixed "--with-tclinclude" to set TCL_INCLUDES (for all + subdirs) + +2003-11-29 , Uwe Zdun + * release of distribution XOTcl 1.1.0 + +2003-11-29 + * moved tcl command hooks into thread local storage + to fix a bug, when xotcl is loaded into a thread + * fixed various documentation bugs, added style files for + XOTcl tutorial, made presentation more uniform, made + distinction between literals and placeholders visible + * fixed a few issues with purify and mt (many thanks to Zoran!) + * some Makefile improvements (removed the need to generate + documentation on each run of make) + * Fixed compilation issues of expat with tcl 8.3 or younger + +2003-11-28 + * fixed include path for actiweb components (sdbm and expat) + * extended transparent mixins for upvar, uplevel + * extended regression test + +2003-11-27 Uwe Zdun + * added new version of Klaus' securePlaceDemo, some minor + corrections for new XOTcl version + * installed XOTcl library into lib directory under + windows instead of bin + +2003-11-26 + * removed ::xotcl::lib from predefined variables and from man + page + * added namespace require to xotclsh + * added transparent mixins for instvar + +2003-11-25 + * xotcl.c: further generalization of call stack entry + skipping; cutFrames can skip now over filters and/or mixins + * "Class new -volatile" works now through filters and mixins + * regression test updated + * reduced size of xotcl distro + * fixed various typos in language reference + +2003-11-22 + * xotcl.c: generalized cutting of call stack entries to + skip either filters or mixins + * "Class new -volatile" works now through mixins for create + * added test to regression test (testx) + * xotcl.c: some cleanup and speedup + * updated aol-xotcl.tcl (for loading xotcl into aolserver 4.0) + +2003-11-20 Uwe Zdun + * updated documentation: + - added a section "Integrating XOTcl Programs with C Extensions + (such as TK)" to the tutorial + - updated tutorial, readme, compile, compile.win + +2003-11-16 + * Httpd.xotcl: forced HTTP/1.1 requests over SSL + to use HTTP/1.0 due to a problem between OpenSSL + and certain incarnations of IE. + * Documenting requireNamespace in more detail. + +2003-11-13 Uwe Zdun + * various changes to support conditional shell building with + stubs + * various changes to build libxotcl/xotclsh with tcl 8.0 + (stub dependencies) + * Httpd.xotcl: added parameter to web server to + configure timeout for persistent connections + * eliminated a few compiler warnings from xotcl.c + +2003-11-12 + * removed namespace import/forget in predefined.xotcl + * Makefile cleanup (fixed duplicate dependencies, quoting in + loops) + * added tests for xoRDF and Persistence, when actiweb is + enabled + * building expat, when actiweb is enabled + * removed needless files from xotcl-distribution. + +2003-11-09 + * xotcl.c: fixed calling exit-handler twice for threads + +2003-11-06 + * xotcl.c: simplified handling of command substitutions; + starts to work with Zoran's nstrace.tcl for AOLserver + +2003-11-02 MichaelL@frogware.com + * XOTcl Stub lib configure files for C-based extensions. + +2003-11-02 + * XOTcl intercepts a few commands (info, rename, uplevel and + upvar) and assumed that these commands are defined in C. + Command intercepting was fixed such that intercepting + a proc info works as well; before xotcl produced a core. + Example: + % rename ::info ::tcl::info + % proc ::info args {uplevel ::tcl::info $args} + % package req XOTcl + +2003-10-31 + * Substituted config/config.sub and config/config.guess + (many thanks to Zoran) + * unix/Makefile.in fixed target install-aol + +2003-10-23 + * xotcl.c: new proc "__unknown" for Class; whenever + XOTcl references a class, which is not defined yet, + "Class __unknown" is called; this mechanism can be + used to autoload classes in a lightweight fashion + * fixes in the built system to avoid two different + "package ifneeded" (seems to cause troubles under + certain circumstances) + +2003-10-20 MichaelL@frogware.com + * Fixed the return value of TclExpatUnknownEncodingHandler + in tclexpat.c. The return value of the handler is now + correctly passed to expat. + +2003-10-14 MichaelL@frogware.com + * Changed library names on Windows to make library names more + similar across platforms. Changed xotcl.c and xotclStubLib.c + to support XOTcl stubs. Changed Windows Makefile.vc's to + build all libraries with XOTcl stubs by default. Changed + Windows Makefile.vc's to specify base load addresses for all + libraries. Fixed compiler warnings in winMain.c. Fixed + compiler warnings in tclexpat.c. + +2003-10-08 Uwe Zdun + * a number of changes to make XOTclSdbm and XOTclGdbm work + with xotcl.h solely ... in particular, introduced new stub + functions and Interface structs for XOTclClass and + XOTclObject: XOTcl_Class and XOTcl_Object. Changed XOTcl's + core to expose these in the extern functions that are + exposed via xotcl.decls. + +2003-09-10 Uwe Zdun + * Integrated bug fixes provided by Klaus Kolowratnik + for the secure http server. + +2003-08-27 Uwe Zdun + * moved config.vc, installWin.tcl to win dir and corrected them + * merged /makefile.vc and /win/makefile.vc; everything for win + now works from the win dir + * adapted other makefile.vc's in distro + * corrected stub table decls and auto generated table .h files + that where incorrect due to recent changes in external API + (XOTclRemoveClass, XOTclAddClass) + * corrected README + * added pkgIndex file for win local dir + * win version change to 1.1 + * corrected the wrong local TCLLIBPATH on unix from '$(TOP_DIR)' + to '$(TOP_DIR)/unix $(TOP_DIR)/library' to circumvent the win + dir on the auto_path + * added locale support to xotclAppInit + +2003-08-27 + * went with spell checker over tutorial and + fixed a hundred of typos + * fixed install of shells + * fixed optional built of xowish (TK_LIB_SPEC was not passed correctly) + * removed obsolete check_library_path in predefined.xotcl + * some fixes in ::xotcl::config mkindex for autoloadine files + +2003-08-26 Uwe Zdun + * doc for precedence order and transitive instmixins in + tutorial + +2003-08-25 + * Generate library/pkgIndex.tcl from configure + (contains version numbers) + * Fixed script for changing version numbers in xotcl + * Changed version of XOTcl to 1.1.0 + +2003-08-22 Uwe Zdun + * Added support for transitive instmixins in xotcl.c, + added test for transitive instmixins + * Various fixes for new build stuff on Windows + +2003-08-20 + * Fixed configure problem with autoconf coming with RH 9.0 + * Allow for the definition of parameters as objects. + It is now possible to have parameters with properties + (See tutorial, section "Objects as Parameter") + * fixed various bugs in the documentation. + MAKE TODO: make rpm, bin-tar, version-change, install-aol + +2003-07-13 + * Fixed potential crash with shared objects in configure + * First version of object tree creation via parameter + +2003-07-11 + * extended parameter handling code to support the creation + of parameter objects + * fixed a few documentation bugs + +2003-07-05 + * xotcl.c: if object is called without method and + arguments, xotcl calls now a method named 'defaultmethod'; + the default behavior (defined as an instproc on + Object) is that the name of the object is returned. + Example: + Object o + puts <[o]> ;# outputs <::o> + puts <[o defaultmethod]> ;# outputs <::o> + +2003-06-28 + * added --with-xotclsh and --with-xowish to create + shell optionally + +2003-05-28 Uwe Zdun + * added "info mixinguard" and "info instmixinguard" + * changed GuardList behavior to tolerate qualified names + * added tests for 'info instmixinguard' and 'info mixinguard' + * made -withGuard and -order work together for "info filter" + on objects. + * checked that guard is deleted, when redefined + with FilterAdd/MixinAdd + * add -guard modifier into filter, mixin definitions and infos + * updated tests + +2003-05-23 + * removed toplevel configure and Makefile for better + TEA compliance + (configure should be called from xotcl*/unix) + * added --with-actiweb to configure; + (use --with-actiweb=yes to enable it) + * standarized tests (using the same Test classes) + +2003-05-16 + * removed binary shells and XOTcl's context depending + auto_path setting; consequences: + - in order to invoke xotcl before installation, use + export TCLLIBPATH=`pwd` + in XOTcl's build directory + - instead of using the environment variable XOTCL + (as described in this Changelog on 2001-01-08, + use TCLLIBPATH + * Two small tcl scripts "xotclsh" and "xowish" are provided + for backward compatibility with xotclsh applications + * For interactive use, adding + package require XOTcl; namespace import -force xotcl::* + into your ~/.tclshrc is recommended + * Various changes and simplifications in configure and Makefiles + * XOTclGdbm: fixed it such it works with enable-threads without + crashing immediately + +2003-05-12 Uwe Zdun + * removed various bugs in new code and added tests for + redefinition and removal of filterguards + * added tests for 'instmixinguard' and 'mixinguard' + +2003-05-11 Uwe Zdun + * added new methods 'instmixinguard' and 'mixinguard' + +2003-05-09 Uwe Zdun + * changed the filter, mixin, and guard code to provide a new + composition strategy for (filter- and mixin-)guards, in + case a guard is defined more than once for the same filter + or mixin... now only the most specific guard counts, all + others are overridden by this guard. Example: + Class B -superclass A + A instfilter {{f2 {[self] == "::b2"}}} + B instfilter {{f2 {[self calledproc] == "set"}}} + Here: for an instance of B only the guard on B counts. + * updated the tests accordingly + * performance improvement: + removed ::xotcl::Object from mixin full list computation + * added new tests for mixinguards to testx.xotcl + +2003-05-03 + * xotcl.c: Changed mixinlist creation from quadratic to linear + (both, in XOTclAddClass and CmdListAdd) + +2003-04-29 + * xotcl.c: cleanup to avoid potential crashes on error messages + (varargs not terminated by NULL) + * introspection for mixin guards (o|cl info instmixin|mixin + -guards) + * new option for info methods to return only those methods where + the guard holds in the current context (info methods + -incontext) + +2003-04-25 + * fixed various typos in examples in tutorial + * first implementation of guarded mixins + +2003-04-24 Uwe Zdun + * document "info instdefault" in the language reference + * corrected a problem with move: it did not prevail the + subclass relationships; also added a regression test + +2003-04-22 + * xotcl.c: calling the "create" method from + the "new" method through the dispatcher (previous version + used a direct call, now create can be overloaded) + +2003-04-17 Uwe Zdun + * Unified ListObjChildren and ListClassChildren into one + method ListListChildren + +2003-04-16 + * xotcl.c: fixed segfault from classchildren + (many thanks to Michael Cleverly for pointing this out) + +2003-04-16 + * xotcl.c: Fixed passing of error codes from constructors + (instproc init). In previous releases, errors were + ignored + * xotcl.c: Passing correctly error messages from "set" to the + XOTcl set method. + +2003-03-19 , Uwe Zdun + * release of full distribution XOTcl 1.0.2 + +2003-03-19 , Uwe Zdun + * release of full distribution XOTcl 1.0.2 + +2003-03-19 Uwe Zdun + * changed requireNamespace so that contents of a + Tcl Namespace with the same name as the XOTcl Namespace to + be created survive the requireNamespace invocation & added + tests in testx.xotcl. Example: + namespace eval a {proc o args {puts o}} + Object a -requireNamespace + ### -> a::o survives + * some minor issues to everything work with tcl/tk 8.4.2 + +2003-03-08 , Zoran Vasiljevic + * some more code cleanup (do not abort when my is called outside + the scope of an object) + * Makefile less verbose + +2003-03-07 + * Made output of the serializer more compact + (omitting unnecessary references to ::xotcl::Object + +2003-03-07 Uwe Zdun + * Copy/Move to self had undefined or wrong results; corrected + both methods so that the objects stay untouched when copied + or moved to self. Added test in testx.xotcl. + +2003-03-04 , Zoran Vasiljevic + * Made xotcl capable to be loaded via "package require" into + aolserver-4 + * To build and install XOTcl for the aolserver-4 + the following commands can be used + + # cd /usr/homes/zv/tmp/xotcl-1.0.2 + # CC=gcc;export CC + ./configure --enable-threads --prefix=/var/tmp/aolserver \ + --enable-symbols --without-tk --without-gdbm \ + --with-tcl=/usr/homes/zv/dev/tcl8.4.1/unix + # make + # make install-aol + + This installs libxotcl*.so, the serializer, and the file + xotcl.tcl into aolserver/modules/tcl. The file xotcl.tcl + contains a "package require XOTcl" and "... serializer" and + sources the files aolserver/modules/tcl/*.xotcl + +2003-03-04 + * xotcl.c: abort, when a non-threaded xotcl version + is loaded into a threaded environment (e.g. aol-server) + +2003-02-28 + * xotcl.c: fixed a bug the lead to a crash in "self x" + +2003-02-20 + * fixes to compile xotcl as a module for aolserver-4 + +2003-02-06 + * made -volatile a method rather than an option of the + new method + +2003-01-18 + * aol-server adjustments (fix the documentation + for new directory structure, update serializer code, testing) + * provided simple replacements for xotclsh and xowish scripts + in the unix subdir for testing purposes (not yet installed) + +2003-01-17 Uwe Zdun + * new directory structure with no version information + * removed pwd from make.xotcl + * new method "ismixin": Test whether the argument is a + mixin or instmixin of the object. + * new method "hasclass": Test whether the argument is either + a mixin or instmixin of the object or + if it is on the class hierarchy of the object. + This method combines the functionalities of + istype and ismixin. + * documented and tested new methods. + +2003-01-12 + * Changed calls in the form of "[self] method" to "my method" + in 59 files in the xotcl distribution + * changed Serializer to use [list] in configure where necessary + +2003-01-09 + * configure methods can be placed into a list to avoid + ambiguity of "-". This character is used as a meta-char to + denote method names, but it has to be used in values as well. + Example: + Class Book -parameter {title author} + Book b1 -title "--the title--" -author a.b.c + has to be written as + Book b1 [list -title "--the title--"] -author a.b.c + Note, that XOTcl allows us to provide multiple arguments + to methods called via configure + +2003-01-05 + * configure returns now the number of preceding elements + without a "-" in its first place. This is needed + for convenient processing of argument lists with trailing + options from tcl. + * avoid processing configure list twice in c code. + +2002-12-29 + * some cleanup in c-code (to make -Wall slient) + * fixed a bug in the "all" method of the Serializer, changed + package name to "xotcl::serializer" + +2002-12-27 + * removed deprecated methods "parameters", "applymethods", + "newChild", "newChildOf" + +2002-12-23 + * release of full distribution XoTcl 1.0.1 + +2002-12-22 + * xotcl.c: some cleanup + * aol-server: improved namespace.tcl (using Serializer) + +2002-12-19 + * New Serialzer: + - up to 30% faster recreation of objects + - more control of objects or variables to be omitted + - provide mappings for (relative) object names + In general, the Serializer + - is used to generate the blueprint of a workspace + (e.g. in the aolserver) + - can be used migate objects between threads + - to cache objects in the aol-server + For details, see doc. + +2002-12-18 + * xotcl.c: new predefined method 'noinit' + can be used to create an object without calling its + constructor (used in the serializer to recreate objects + from a snapshot) + +2002-12-17 Uwe Zdun + * installWin.tcl: correction for patchlevel + * changed version to 1.0.1 + +2002-12-14 + * xotcl.c fixed a bug in "info default arg var" and + "info instdefault arg var" in connection with filters. + The output variable was created in the filter frame. + Many thanks to Oumung Mehrotra for reporting the problem. + * New switch for compilation USE_ASSOC_DATA to use Tcl_AssocData + instead of namespace client data for the runtime state + (without assoc data, 10-15% faster) + +2002-12-06 Uwe Zdun + * changed recreate semantics: recreate now calls the cleanup + method; so that one can preserve object information in the + recreate, call next (and do the cleanup), and finally handle + the correction for recreation. + * tutorial: added example of structure preserving recreate and + updated langRef.xotcl accordingly + +2002-11-22 + * fixes in documentation + * automatic generation of pdf files and make target + for the tutorial and the language reference + +2002-11-19 + * fixes for configure for aolserver 3.5.* + +2002-11-13 Uwe Zdun + * correct check for XOTcl lib on auto_path in predefined.xotcl; + it was checked for xotcl$VERSION, should be xotcl$VERSION + +2002-11-08 +2002-11-08 Uwe Zdun + * Win makefile.vc: let nmake install call the install script + * removed "class" hook from recreate ... + * updateding AOL-server patch and README + * finshing rpm and bin-tar generation + * release of full distribution XoTcl 1.0 + +2002-11-06 Uwe Zdun + * let the Unix Makefile also (try to) cleanup Win->Release dirs + +2002-10-30 Uwe Zdun + * fixes for tcl 8.0.5 + +2002-10-28 Uwe Zdun + * used a proc for exit handler (instead of Object variable), + old interface for exitHandler does still work + * eliminated a mem leak in FilterFindReg as indicated by + Zoran. + +2002-10-26 + * xotcl.c: fixed problem with external symbol for + cmdType and reactivated KEEP_TCL_CMD_TYPE for all + tcl versions + +2002-10-25 Zoran Vasiljevic + * xotcl.c: fixed memory leak for new method. + +2002-10-23 Uwe Zdun + * Object instproc extractConfigureArg: get one configure argument + (and possibly cut it) from a given args list. Especially used in + create before init is called with next to get args + before the object is actually created (& documentation). + +2002-10-22 Uwe Zdun + * used Tcl's Assoc structures for runtime state + +2002-10-21 Uwe Zdun + * corrected "abstract" next handling in predefined.xotcl + +2002-09-19 + * xotcl.c: prevent duplicate destroy calls during cleanup + * xotcl.c: error in exit handler does not panic anymore, but + writes to stderr (panic can't be used when exit handler + is called by a thread) + * Serializer.xotcl: {Serializer all] return exit handler + as well. + +2002-09-14 + * Trace.xotcl: fixed typos in documentation code, changes + for "my". + +2002-08-29 Uwe Zdun + * corrected findXOTcl.c: it got confused by an toplevel + XOTcl dir, like: ~/xotcl-1.0/x/xotcl-full-1.0 and didn't find + the libs then. + +2002-08-27 Uwe Zdun + * disabled KEEP_TCL_CMD_TYPE for 8.4, as it did not compile for 8.4b1 + +2002-08-04 + * Httpd.xotcl: order directories before files in directory + listings + +2002-07-18 + * Httpd.xotcl: fix for handling broken links + +2002-07-12 Uwe Zdun + * Win fixes for compilation with Tcl 8.4b1 + * fixed mem leak of filter search + +2002-07-10 + * fixes for compilation with Tcl 8.4b1 + +2002-07-06 + * Fixed a compilation bug concerning Tcl 8.2 and younger + +2002-05-30 + * xotcl.c: fixed destroy bug, when object was destroyed + during init + * xotcl.c: minor cleanup + +2002-05-16 Uwe Zdun + * xotcl.c: searching filter start commands again, if order is + invalidated. Otherwise filter commands of de-registered mixins + persist to be a filter. If no other filter or instfilter with + the name is found, the filter entry is removed from the filter + list. + +2002-05-15 Uwe Zdun + * COMPILE: an explicit sentence in the beginning that you need + Tcl/Tk sources to compile XOTcl. + * xotcl.c: FilterSearch has only search for object-specific + filters in the object's current order ... that was a bug. It + has to search for filters on mixins and instmixins as they are + specified by filter and instfilter. fixed. + * xotcl.c: Filter application order was: object filters -> mixin + filters -> class filters. Corrected to mixin filters -> object + filters -> class filters. Now it conforms to the order on + normal dispatches. + * xotcl.c: changed fatal abort to error, when self is called + without an active object + +2002-05-05 + * fixed UTF-8 conversion for filenames + +2002-04-30 + * Httpd.xotcl: minor cleanup (removed superfluous instvars) + * xotcl.c: removed incr/decr refcount on cl-names in DoDispatch + +2002-04-21 + * fixed a bug in path settings: + when xotclsh was called from an xotcl source directory where + no libxotcl*.so was located (e.g. before a compile) an error + was produced during load; xotclsh checks now whether it can + locate the .so file before setting the path. + +2002-04-20 Uwe Zdun + * fixed a bug in filter code (recursion blocking) + +2002-04-20 + * Http client code: fixed several small bugs: + - url composition + - error handling + - redirects to different ports + +2002-04-09 Uwe Zdun +2002-04-09 + * finshing rpm and bin-tar generation + * patch release of full distribution (0.9.4) + +2002-04-08 + * fixed a bug in copy/move (the constructor was called during + copying without instvars etc.; now the construcor is not + called here) Many thanks for Artur Trzewik for noting this. + +2002-04-08 Uwe Zdun + * fixed .add files for Windows + +2002-04-07 + * removed persistence dir in actiweb regression test to achieve + same behavior on each run of the test + * Storage.xotcl: fixed a bug when new persistence directories are + created + * fixed a small memory leak in autonames + +2002-04-05 + * defined the following policies for excplicit freeing in the + exit handler: + + NO_CLEANUP for processes, the physical free in the exit handler + is not needed + + CLEANUP for threads, just the xotcl classes/objects with + its instvars are reclaimed, annother + mechanism should take care of the global + procs and vars (automatically choosen, when + compiled with TCL_THREADS) + + FULL_CLEANUP for testing purposes, to check, whether xotcl + has memory leaks; all global procs and vars + are deleted as well. + +2002-04-04 + * fixed a bug with duplicated tcl_objs of XOTclObjectType + that could cause double frees. + +2002-04-02 + * Less agressive converison to tcl_objs of XOTclObjectType. + It will try to keep objects of type tclCmdType when + KEEP_TCL_CMD_TYPE is activated during compilation (default). + +2002-03-28 + * horrible bug fixed, when USE_ALLOCA or USE_MALLOC + was defined (macro substitution lead to wrong arithmetic). + These macros were defined for c-compilers that do not + support variable sized arrays as local variables. Gcc + were always fine, but e.g. under the standard AIX compiler + array boundaries were overwritten... I wonder, why we have + seen no bug reports, this bug was in since ages.... + +2002-03-27 Zoran Vasiljevic + * more code for volatile objects moved to C + +2002-03-26 + * Fixed a few more places, where recounted xotcl-objects + can cause troubles (mem-leaks + invalid pointers) + +2002-03-24 + * auto-deletion of global vars and proc to + get rid of references to xotcl-objects for deletion + +2002-03-20 Uwe Zdun + * added reference counts for xotcl objects to + avoid crashes for recreated objects (thanks for + Artur Trzewik for sending a good bug report) + +2002-03-11 Zoran Vasiljevic + * xotcl.c: fixed XOTclReplaceCommand for AOL-Server + (multi threading bug) + +2002-03-11 + * Httpd.xotcl: fixed relative pathname-bug for basic authentification + +2002-03-02 + * marked newChild as deprecated (use new -childof) + +2002-03-02 + * Changed name of selfdispatch to "my" + +2002-03-01 + * Httpd.xotcl: allow encoded characters in path and resource names + * Httpd.xotcl: use dictionary oder for directory listings + * Mime.xotcl: added some more default mime times + +2002-02-24 + * Httpd.xotcl: added functionality to provide directory listings + * Httpd.xotcl: create specified root directory if it does not + exist + +2002-02-13 + * Makefile.in: fixed a bug in make install + ("package require package" did not work) + +2002-02-12 + * HttpPlace: added Pragma no-cache for dynamic contents + * overworked persistence manager to separate storage + specific concerns (like directory checking) from generic ones + * new storage manager multi-storage to multiplex storage + requests to multiple sinks. + +2002-01-10 Uwe Zdun + * removed duplicated system library in library/system. The correct + one is in xotcl-XXX/library!! + +2002-01-09 + * fixed path determination code during + startup to avoid "cant read 'pf'" messages + +2002-01-08 Uwe Zdun + * introduced bcc (copy) database option for persistent databases and + configuration option for db file names and dirs in actiweb + places + * xotcl.c: found and fixed a small bug in unknown: + Object o; o r + with no unknown defined has looped (not for class -> unknown). + corrected it and added it to testx.xotcl + +2002-01-06 + * further improvement of bytecode compilation + * new bytecode instruction SELFDISPATCH + * methcall benchmar now more than 40% faster than in 0.9.3 + * some cleanup in xotcl dispatch code + * fixing external references for symbols not starting with xotcl + +2002-01-02 + * new xotcl byte codes for XOTcl primitives next, self, + and initProcNS. Speedup for the oo-shootout + + methcall 30% + + objinst 9% + some tests are now twice as fast than before, self is + now 10 times faster (about 1 microsecond on a 600 MHz PIII) + +2001-12-28 + * fixed changeXOTclVersion, made more generic + * fixed Agent migration, made all migrations synchronous + (for the time being) + +2001-12-17 Uwe Zdun +2001-12-17 + * finshing rpm and bin-tar generation + * patch release of full distribution (0.9.3) + +2001-12-10 Uwe Zdun + * removed two "! test" so that configures work with sh on Solaris + * added make bin-tar target + * removed all compiler warnings on windows + +2001-12-09 + * revived configure-code for aolserver, added patchlevel + to log message, updated aolserver README file + * renamed directory "script-creation" to "serialize" + * deactivated create of unneeded installed dirs + (xotclexpat, xotclgdbm, xotclsdbm) + +2001-12-07 Uwe Zdun + * documented recent changes in XOTcl for release + +2001-12-05 + * fixed call to unknown in copy method + +2001-12-01 Uwe Zdun + * xotcl.c: xotcl::interp rewritten + +2001-11/12 Uwe Zdun + * changed xotcl support a (more or less) TEA compliant + build process, use Tcl stub lib, and make shells + only shallow wrappers that load the XOTcl package + on demand + +2001-10-23 + * removed code for calling variable command + +2001-10-22 + * xotcl.c: fixed bug for empty superclass list + * fixed stub-install under 8.0.5 + +2001-10-20 +2001-10-20 Uwe Zdun + * patch release of source distribution (0.9.1) + +2001-10-20 + * reimplemented method 'new' of Class in C + * various cleanups for stub handling + * added regression test for stub library + +2001-10-18 Uwe Zdun + * removed linking glitch in 0.9: stub enabled lib was linked + with non-stub enabled obj-files. + * added a stub enabled lib to Windows make procedure + * renamed stub enabled lib to (lib)xotcl-tclstubs.(so|dll) + +2001-10-17 Uwe Zdun + * removed "can't instvar to link" problem during aliasing + to a link var + +2001-10-15 +2001-05-15 Uwe Zdun + * XOTcl 0.9 Release + +2001-10-14 + * new method of Object: parametercmd: + a convenient way to define a new getter/setter for + individual objects (similar to parameters for classes) + * polishing docu + +2001-10-11 + * improved make clean + * fixed incompatibilities in various + scripts distributed with xotcl + +2001-10-11 Uwe Zdun + * configure.in: fixed that --without-tk functions + ensured that user-defines with --with-tcl/tk + override found settings. + * xotcl.c: + - conditional for different TclIncrVar2 interfaces + in Tcl 8.05 and Tcl 8.3 + - added TCL_PARSE_PART1 to variable lookup in + GetInstVarIntoCurrentScope. TclLookupVar in 8.05 + requires it for looking up arrays with only part1 + given. + +2001-10-10 + * fixed autoname method for Tcl 8.0.5 + +2001-10-10 Uwe Zdun + * finished polishing mem leaks (thanks to Zoran Vasiljevic again) + * disallowed "[self] next" ... next is now only a command + * Gdbm,Sdbm,Expat: corrected Makefile.in to rely on + -L$(TCLLIBDIR) (thanks to J�rg Rudnik for the hint) + +2001-10-08 + * configure.in: fixes for AOLSERVER to ease configuration + * aolstub.c: fixes for namespace handling (XOTcl is + now a "well behaved" Tcl extension) + +2001-10-05 Uwe Zdun + * added PRESERVE and RELEASE functions for Tcl_Objs so that + we remember all Tcl_Objs that are temporarily allocated, + otherwise the ExitHandler would not free Tcl_Objs, like: + INCR_REF_COUNT(tclobj); + callaMethodContainingExit(); /* "exit" call */ + DECR_REF_COUNT(tclobj); /* not reached */ + * corrected filtersearch and procsearch to return the new + proc qualifier format: + proc|instproc + as a Tcl list. filtersearch does now operate on objs as well, + procsearch does support mixins now. Added tests for both. + * documented new features in tutorial and langRef + +2001-10-04 Uwe Zdun + * minor fixes to get WIN version to run again + +2001-10-03 Uwe Zdun + * removed some more mem leaks, + * reworked exit handler to destroy metaclasses and operate on a + instance list, instead of namespace cmdTable + * pop remaining callstack entries in ExitHandler to prevent + from false deletion order, if "exit" is called from within a + method + * changed XOTclErrInProc not to rely on obj/class Tcl_Obj* + so that we do not have to preserve them in DoDispatch + (mem problem) + +2001-10-02 Uwe Zdun + * added a optional simple mem counter functionality. DEFINE + XOTCL_MEM_COUNT so that you get a mem count dump after exit. + * removed some mem leaks + +2001-10-01 Uwe Zdun + * new info option "info methods" ... returns all methods (procs + and cmds) defined along the hierarchy for an object. + accepts modifiers: -noprocs, -nocmds, -nomixins + +2001-09-30 Uwe Zdun + * don't allow duplicates in filter/mixin structures (e.g. info + filter has returned "b c b", now the filter appears only + once. Filterguards are merged into one guard. + * new modifier "-order" for info filter and info mixin -> + returns order on a particular object, for filters with + syntax " proc/instproc " for mixins just a + class list + +2001-09-26 + * cleanup, removed a few bugs + * new instproc for Class: insttclcmd + creates an instmethod with the given name + that calls the Tcl command with the given name in the + variable environment of the object + * renamed instproc of Class parameteradd to: instparametercmd + * xotcl.c: more complete set of tracing options for debugging + * some speedups: + - instcommand array, append, lappend trace + are now more than 3 times faster than before + (through insttclcmd) + - condition checking (for pre and post conditions and guards) + is as well more than 3 times faster than before + * configure.in: made -Wall conditional for gcc + +2001-09-25 Uwe Zdun + * merge with + * xotcl.c: new XOTclObject member "flags", which + is a bitmap for various object states + (isClass, isDestroyed, etc.). Defined several + according macros XOTclObjectIsClass(obj), + XOTclObjectToClass(obj), etc. + * revitalized Tcl_Obj of type XOTclObj to speedup + access of Objects and classes by using + GetXOTclObjectFromObj + GetXOTclClassFromObj + (speedup of create by 15%, a few simple commands + are now more than twice as fast (Object isclass)) + +2001-09-20 Uwe Zdun + * xotcl.c: + - made objectData structure optional and moved + functions into file xotclObjectData.c + use XOTCL_OBJECTDATA to compile it in + - moved obj & cl clientDatas into optional memory, new extern + getter/setter functions: XOTclSetObjClientData, + XOTclGetObjClientData, XOTclSetClassClientData, + XOTclGetClassClientData. Used them in persistence store + wrappers xotclSdbm.c & xotclGdbm.c + * testx.xotcl: + - Added some obj filter tests + +2001-09-19 Uwe Zdun + * xotcl.c: + - added "opt" structures to XOTclObject and XOTclClass so that + optional info (filters, mixins, asssertion,...) is only + allocated on demand + - corrected bug ... search for epoched filter cmd in + FilterRemoveOnObjFromCmdPtr also in mixins + - added flags to XOTclObject instead of filterDefined, + mixinDefined, and destroyCalled shorts + +2001-09-18 Uwe Zdun + * xotcl.c: removed object reference code ... I guess we won't do + references this way + +2001-09-17 Uwe Zdun + * xotcl.c: added new instcommand "vwait" on object that mirrors + the behavior of Tcl's vwait, but does not operate on flag + TCL_GLOBAL_ONLY. The new xotcl obj var tables do not operate with + that. E.g.: + Object instproc vwait {varName} { + [self] instvar $varName + ::vwait [list $varName] + } + would wait for a global variable varName ... though: + Object instproc vwait {varName} { + [self] requireNamespace + ::vwait [self]::[list $varName] + } + should work ... + * xotcl.c: info classparent now returns object name of class, not + ::xotcl::classes*** + * xotcl.c: new method "objeval" on Object. It executes an command + in the scope of an object. This is an important convenience + method because something like: + Object instproc lappend {varName args} { + [self] instvar varName + eval ::lappend [list $varName] $args + } + is problematic if the object has a namespace and varName is an + array element ... then Tcl does want to upvar it (was also + present in all earlier xotcl versions ... we have used an + instvar alias then). Now we can do: + + Object instproc lappend {varName args} { + [self] objeval [concat ::lappend [list $varName] $args] + } + This is easier an faster than using an alias ... + +2001-09-16 Uwe Zdun + * predefined.xotcl: + - new method "trace" on Object ... simple forwarder to tcl's trace + - eliminated "cset" on Object and from the distribution, seems to + be nearly unused + * whole distr: + - replaced direct namespace variable accesses with [self] or + instvar accesses. Here's what I did: + (a) grep for <[self]::> + (b) grep for plus <::> together in one line + (c) grep for <}::> to get e.g. ${a}::b + that should find most occurrences of variable namespace access, + except for direct accesses like: set y::x, where y is an object + name and c a variable to be set. + +2001-09-15 Uwe Zdun + * xotcl.c: + - Namespaces of objects are now created only on demand, + that is when: + - obj proc is created + - obj command is created with XOTclAddPMethod + - child is created on the object + Note that this is a prominent change. Especially it saves a + significant amount of memory allocation per object. But you + cannot assume the existence of object namespaces anymore. + That means: + Object o + set o::var 1 + returns TCL_ERROR: parent namespace does not exist. Use + o set var 1 + instead. Same appears for append, lappend, trace, array and + other Tcl variable handling commands. + "info exists" is problematic because it does not return an + error message: + Object o + o set i 1 + info exists o::i + returns 0. + It is save to use all Tcl command together with instvar. + + - new method "requireNamespace" on Object. Creates an object + namespace explicitly. + - new info option "hasNamespace" on Object: returns 1, if the obj + currently has a namespace, otherwise: 0. + - eliminated "returnCode" on RUNTIME_STATE due to several bugs, + why was it there??? + +2001-09-14 Uwe Zdun + * xotcl.c: + - Changed XOTclCInfoMethod to be based on two switch statement + instead of ifs. Let List* functions return the state (such + as TCL_OK). + - introduced code for modifiers in info methods. Modifiers are + "-" options that change the behavior of an info method + - introduced -guard modifier for filter and instfilter (it + prints a filter list with guards) + +2001-09-13 Uwe Zdun + * xotcl.c: + - eliminated some flaws in filterguards + - forbid "new" filtering during checking a filterguard + +2001-09-06 Uwe Zdun + * xotcl.c: + - also allowed instfilters on a mixin class of an object + +2001-09-03 Uwe Zdun + * xotcl.c: + - bug corrected: filter correctly removed from all dependent + classes when filter proc is deleted or superclass is changed + - bug corrected: added cmdEpoch check on computation of full + filter/mixin lists + +2001-09-03 + * various cleanup and fixes due to new features + +2001-09-03 Uwe Zdun + * testx.xotcl: + - filterguard tests + * xotcl.c: + - bug corrected: filter order invalidation upon new proc/instproc + ... for filter inheritance + +2001-08-25 Uwe Zdun + * xotcl.c: + - new filter guards language construct for constraining filter + appliance + - introduced generic Tcl_obj* list instead of + XOTclAssertion*, + +2001-08-24 Uwe Zdun + * xotcl.c: + - CallStackGetFrame: iterate only over INACTIVE filters (was a bug) + - self filter & mixin infos: determine info position from + callstack with CallStackGetFrame, so that uplevel functions with + [self calling*,called*] + - NextMethod: passed XOTCL_UNKNOWN through at end of mixin/filter + chain, if no method was found. + * testx: added tests for these corrections. + +2001-08-23 Uwe Zdun + * xotcl.c and tests: added initProcNS command executed at + beginning of all XOTcl procs/instprocs ... it prevents from + jumping to the object's namespace, when a proc is opened. + Now: + namespace eval html { + Object o + o proc t {} {puts ns=[namespace current];li} + o t + } + results in: + li + ns=::html + + Now inside of a namespace, like ::Object, you can call global + methods, like ::set without preceding "::" ... + + => Incompatibility to former versions: direct XOTcl proc + calls, like: + Object rp + rp proc time {cmd time} {...} + rp proc x { + time "set x 3" t + } + are invalid ... you have to write: + rp proc x { + [self] time "set x 3" t + } + +2001-08-20 Uwe Zdun + * xotcl.c and all tests: moved Object, Class, and @ into ::xotcl + namespace, now + namespace import -force xotcl::* + has to be written at the beginning of each script to have + them in the global namespace. + - info options now return ::xotcl::Object, ::xotcl::Class, and + ::xotcl::@ + - direct sets and unsets of variable are not possible anymore: + "Object set a 5" functions, but not "set Object::a 5", + but "set xotcl::Object::a 5" is ok + +2001-08-20 Uwe Zdun + * xotcl.c and all tests: moved xotcl classes from ::XOTclClasses + to ::xotcl::classes + +2001-08-20 Uwe Zdun + * Actiweb -> made it run with new filter code ... what you have to + change on your existing code to make it run: + 1. change all invocations of "filter" to "instfilter" + 2. same for "info filter" to "info instfilter" + 3. same for "filterappend" to "instfilterappend" + 4. for all filters on metaclasses: you must not provide the + metaclass name anymore, the filter finds it + automatically, say, if you have a metaclass C and a + filter f, you had to write: + A filter C::f + now this is + A instfilter f + 5. replace regclass with [lindex [self filterreg] 0] ... + may be changed again + +2001-08-17 Uwe Zdun + * xotcl.c: integrated complete rewrite of filter code with + per-object filters + +2001-08-13 + * patch release of source distribution (0.85.3) + * following naming conventions of Tcl for minor changes + +2001-08-11 + * xotcl.c. predefined.xotcl: fast parameter inst-commands + * xotcl.c: new instcommand for Object: parameteradd + (to register the instcommand for parameters) + * xotcl.c: applymethods renamed to configure + * xotcl.c: small speedup for assertion checking + * xotcl.c: simplified set methods + +2001-08-09 + * fixes for actiweb (agent migration was broken) + * comm/Access.xotcl: a response to an HTTP-PUTS request should + not contain a body. If it does, Httpd complains shortly + and accepts it. + * mos/Agent.xotcl: fixed obsolete code (callcoder) + * mos/AgentManagement.xotcl: fixed broken RDF-interface + +2001-08-04 + * xotcl.c reduced size of XOTclObject structure from + 172 bytes to 68 bytes by allocating assertion + structures on demand and by deactivating per + default the old metadata structures + +2001-08-02 + * integrating AOL-server-changes from Zoran, solution for + threads, stublib and older tcl-versions + * improved stubs support + * generating a stub library src/libxotclstub.so + * AOL_DEFINES in Makefile (automatically activated + when xotcl is compiled within the source tree + of aolserver + * configure.in: using exec_prefix for platform dependent files + * new target: make libs (for AOL-server) + +2001-07-23 + * improved parameter support (see apps/scripts/parameter.xotcl) + * custom setter/getter methods + * xotcl.h: make it usable from C++ + +2001-07-13 Uwe Zdun + * TextFileStorage: bug in opening files with + TextFileStorage eliminated + * MemStorage: fix for Mem Storage to support lazy + persistence (mem store persists object destroy) + * Persistence.test: new test LotsOfObjects + +2001-07-13 + * patch release of source distribution (0.85-p2) + +2001-07-10 + * xotcl.c: first draft of new implementation of parameter + see apps/scripts/parameter.xotcl for a list of features + +2001-07-06 + * xotcl.c: fix for propagating special return codes through + next calls (e.g. ... return -code continue). + This is needed for Tk integration; + thanks to catherine letondal@pasteur.fr for + pointing out the problem + * Mime.xotcl: handling yet another file format for ~/.mime.types + +2001-06-21 Uwe Zdun + * fix for tclexpat in Tcl 8.2 versions + +2001-06-21 + * xotcl.c: more fixes for bug in copy/move for object + names with spaces + * predefined.h: fixes for xotcl methods for spaces in object + names (eval) + +2001-06-20 + * xotcl.c: fixes for bug in copy/move for object names + with spaces + * xotcl.c: reporting error codes when copy move does not work + +2001-06-13 + * AIX compatibility fixes (thanks to Adrian Wallaschek) + * improved portability + * easier export from bk + * Httpd.xotcl: added -ipaddr option to configure + IP-address of server + +2001-06-12 Uwe Zdun + * xotcl.c: fixed reference counting for volatile objects + +2001-05-01 + * patch release of source distribution (0.85p1) + +2001-05-30 + * new predefined method: newChildOf + +2001-05-28 + * HttpPlace.xotcl: added call to replyCode in front + of replyErrorMsg + * Httpd.xotcl: made httpd more robust in error cases + (invalid first line) + * ignore attic in tar + * xotclgdbm.c: faster exists test + * lib/xml/TclExpat-1.1/Makefile.in: better make clean + +2001-05-22 +2001-05-22 Uwe Zdun + * XOTcl 0.85 Release + +2001-05-15 Uwe Zdun + * xotcl.c: parameter defaults for (per-class) mixins are + evaluated upon creation + * tutorial: documented how to evaluate parameter defaults for + obj/class mixins + * win-files: adapted to new src directory tree + +2001-05-15 + * xotcl.c: fix for colon checking to determine parent namespace + * xotcl.c: Object and Class create returns absolute name (with leading ::) + +2001-05-15 Uwe Zdun + * xotcl.c: fix for checking in parent namespace + +2001-05-10 + * doc update (formatting, info instproc, ismetaclass and isclass) + * xotcl.c: argument for ismetaclass and isclass is now optional + * xotcl.c: checking for namespace parent in object creation to avoid crash + * Httpd.xotcl: fix for ie 5.5 under win98, + POST has not always contentlength set + +2001-04-14 + * xotcl.c: don't call unknown for dash-commands on class + objects to avoid errors like "Class C -superClass Object" + that lead to object creation in earlier versions + * first version of xoman + * Httpd.xotcl: new method replyErrorMsg; replyCode + does not produce HTML messages by itself + +2001-04-07 + * Access.xotcl: added :: in front of global objects, more robust + * using namespace for soap, implifying interface + +2001-04-03 Uwe Zdun + * xotcl::comm::httpd: added error code 500 {Server Error}, + errorReply hook in replyCode added to be able to prevent HTML + error response. + +2001-04-03 + * xotcl::comm::httpAccess: user-agent string more generic + +2001-03-27 Uwe Zdun + * xotcl.c: added inheritance feature for instinvars + * xotcl.c: standard cleanup now destroy aggregated children + * testx.xotcl: tests for both new features in xotcl.c + +2001-03-26 + * version number in xotcl references to allow multiple + xotcl-versions to coexist + * various changes to accommodate bitkeeper + * package.xotcl: fixes for argument passing + (thanks to Artur Trzewik) + * Httpd.xotcl: better error messages containing referer for + files which are not found on the server. + +2001-03-22 Uwe Zdun + * xotcl.c: "cleanup" does not receive args anymore + * xoXML.xotcl: used [self class] for parser autoname + +2001-03-19 + * removed dependencies form wafecompat + * Sccs support added to makefiles + * documentation for mixins updated + * decode POST moved before "respond" to ease overloading + +----------------------------------------------------------------------------- +2001-03-09 +2001-03-09 Uwe Zdun + * release of Version 0.84 + +2001-03-09 + * removed "exec date" from tests to ensure win compatibility + * fixed regression tests under win: don't use dependencies on + time-zones, fixed ordering problems and HTML bugs + +2001-03-08 + * fixed a few bugs in xodoc + * documentation for apps/utils/* + * package name xotcl::store::storage changed to xotcl::store + * PCache uses new Storage interface + * new predefined object ::xotcl::rcs to extract + info from RCS strings (methods date and version) + +2001-03-07 Uwe Zdun + * xotcl.c: Mutex patch for exit handlers in MT apps by + Zoran Vasiljevic + * xotcl.c: self next implemented ... enables callstack + information for the "next" method + * Persistent.test: bench test reduced to 272 + * tutorial/langref: documented new functionalities + +2001-03-06 Uwe Zdun + * htmllib.xotcl: integrated new version with HtmlBuilder; + thanks to Antti Salonen. + * package names: changed all package names to convention that + names are starting with lower cases. Separated names with :: + prefixes. For now, these names are just chosen to avoid name + clashes, in 0.85 they will probably be used as basis for a + hierarchical component model. + +2001-03-05 Uwe Zdun + * metadataAnalizer: split into dynamic and static variant (static + is used for xodoc + +2001-03-02 Uwe Zdun + * xotcl.c: moved callstack information (calledproc, calledclass, + callingproc, callingobject, callingclass, regclass) from + info to self; e.g. use in a filter instead of + [[self] info calledproc] + from now on + [self calledproc] + * testx.xotcl: integrated callstack information changes. + +2001-03-01 Uwe Zdun + * complete installation and test suite for Windows, i.e. doc, + packages, all tests, install, etc. now function on Windows + platforms + * XOTclSdbm ported to Windows + * Expat xotcl version running on Windows + * xotclsh.1, xowish.1 man pages added + +2001-02-27 + * new global variables for configuration and logging + ::xotcl::confdir ~/.xotcl + ::xotcl::logdir $::xotcl::confdir/log + * new script daemon.xotcl for starting/stopping + xotcl scripts in the background + +2001-02-22 Uwe Zdun + * xoDoc.xotcl, metadataAnalyzer.xotcl: added documentation and + handling for "abstract" methods, and corrected bugs in html + appearance + +2001-02-22 + * xotkAppInit.c: added static package Tk + +2001-02-22 Uwe Zdun + * splitted xodoc.xotcl into a generic static metadata analyzer + (metadataAnalyzer.xotcl) and the HTML documentation part + (xodoc.xotcl). + * htmllib.xotcl: incorporated fishpool's html lib for use + in xodoc; thanks to Antti Salonen. + +2001-02-17 + * Serializer.xotcl: new package for serialization of workspace + contents (Classes and Objects). Serialization of full + workspace: + Serializer s + s serializeWs ?filename? + Serialization of Object or Class + s serialize ObjectOrClass + * bugfix in mixins + * xotcl.c: tidying up + +2001-02-10 + * xotcl.c: some speed improvements + (next without args more than twice as fast due to moving + arguments to the stack, caching of stack pointers) + +2001-02-08 Uwe Zdun + ! xotcl.c: Removed mixin init logic. Mixin & instmixin inits + are only called if the mixin is registered for the object + during initialization. Beforehand "mixin" has called init, + when it wasn't called before. This was inconsistent with + behavior of class and instmixin. + +2001-02-06 Uwe Zdun + * xotcl.c, testx.xotcl, ...: tests for new destroy logic + +2001-02-04 + * xotcl.c: cleanup and various simplifications + ! using xotcl namespace for: + version, lib, check_library_path, + interp, trace, deprecated, mkindex, load, + namespace_copyvars, namespace_copycmd + potential incompatibility: use ::xotcl::version + instead of ::xotcl_version! + +2001-02-01 Uwe Zdun + * xotcl.c: new destroy logic with recreate + +2001-01-26 Uwe Zdun + * Persistence.xotcl: + - persistenceMgr now uses child object as storage + - persistent arrays bug fixed, lazy persistent arrays added + - added persistent arrays to test + +2001-01-25 Uwe Zdun + * xotcl.c: class redefinition logic instead of direct command + destroy added to solve destroy problems identified + by Kristoffer Lawson. + +2001-01-24 Uwe Zdun + * xotcl.c: fixed alias bug identified by Kristoffer Lawson. + +2001-01-22 + * fixed regression test for new path settings + * removed Unix dependencies from regression test (sleep) + +2001-01-18 Uwe Zdun + * all storages: added nextkey + firstkey methods + for traversal of DBs + +2001-01-17 Uwe Zdun + ! all packages: all internal distribution package names now + start with "xotcl::" to avoid name clashes with other + packages + +2001-01-16 Uwe Zdun + * XOTclGdbm: added XOTcl Gdbm wrapper + +2001-01-15 Uwe Zdun + * xotcl.c: alloc now handled as a Class instproc, like + create. Thanks to Kristoffer Lawson for the hint. + +2001-01-15 + * new Interface for persistent storage + + Class Storage + Storage abstract instproc open filename + Storage abstract instproc close {} + Storage abstract instproc exists key + Storage abstract instproc set {key ?value?} + Storage abstract instproc unset key + Storage abstract instproc names {} + +2001-01-12 Uwe Zdun + * Storage test suite added + +2001-01-09 Uwe Zdun + * Makefiles: generic makefile for expat, gdbm, ... in the + style of XOTcl's Makefile + fed by toplevel configure + * packages/store/XOTclSdbm: sdbm wrapper for XOTcl + +2001-01-08 + * The search for the XOTcl library is performed according to the + following rules: + + 1) If the environment variable XOTCL is set and points to a + directory, it is taken as the XOTCL directory. + + 2) If the auto_path (determined in part by the environment + variable TCLLIBPTH) contains a directory named "xotcl" + and it exists, it is taken. + + 3) If no xotcl library is determined yet, check + whether the current directory is in an xotcl source tree. If + yes take it. + + 4) If the auto_path contains a directory, that has a + sub-directory named xotcl, it is taken. + + 5) If the auto_path contains a directory that has a + directory named xotcl as a neighbor, it is taken. + + 6) Take the compiled-in path for the xotcl library. + + After the search for the XOTcl library the global Tcl + variable ::xotcl::lib is set to the determined directory. This + directory is added automatically to the ::auto_path if + necessary. + +2000-12-15 + * packages/make.xotcl: passing target to avoid grep + through Makefile + +2000-12-15 + * packages/make.xotcl: less verbose + * new environment variable XOTCL, points to directory + where the XOTcl library lives + +2000-12-13 + * packages...Httpd.xotcl: close connection after errors + * packages...Httpd.xotcl: elementary support for HTTP method + OPTIONS + +2000-12-04 + * xoXML: fix info vars + instvar method creates variable that is not accessible and + should not be listed in info vars + +2000-12-04 + * version changed to 0.84 + * xoXML: fix for multiple PCDATA calls after one element + +----------------------------------------------------------------------------- +2000-11-30 +2000-11-30 Uwe Zdun + * release of Version 0.83 + +2000-11-30 Uwe Zdun + * xoXML/xoRDF: added the ability to process mixed content PCDATA + (i.e. more than one pcdata in one element) + +2000-11-29 Uwe Zdun + * src/lib/soccerClub.xotcl: simple introductory example for + the tutorial + * xotcl.c: corrected assertion checking: built in commands that + affect assertions are not checked (check, info, proc, instproc, + invar, and instinvar). Otherwise we can not react on a broken + assertion in the error handler (& documented this stuff in the + tutorial). + +2000-11-29 + * tried to improve documentation tool + * work on xotcl homepage, manual section added + +2000-11-28 + * apps/actiweb-apps/univ/ added (example for RDF) + * packages/make.xotcl extended for test in apps directory + * HtmlPlace.xotcl: allowExit method added for HtmlPlace to allow an + actiweb place to terminate via URL (primarily for regression tests, + which require no kill anymore, now platform independent) + * Httpd.xotcl: logging of contains more detailed information + * HttpPlace.xotcl: added HTTP errors (invalid requests + for actiweb are correctly noted in log files) + +2000-11-28 Uwe Zdun + * xotcl.c: Removed theClasses/theObjecs hashtable, because they + caused some problems in exit handling (thanks to + Catherine Letondal for the hint), + * xotcl.c: fixed all remaining memory leaks in tests (thanks to Zoran + Vasiljevic for helping us out with purify) + * tutorial.html: added documentation for @ + +2000-11-27 + * src/Makefile.in: changed logic for building and + installing xowish + * xotcl.c: fixed bug in "info mixins" + +2000-11-24 + * Access.xotcl: overhaul, uses now exits method instead of + 'info exists' + * packages/xml/xml.xotcl: overhaul of the introductory XML-parser + example + * predefined.xotcl: new predefined method of Object: + vwait (Tcl semantics) + * some tuning to avoid speed penalties + * src/Makefile.in: added some dependencies + +2000-11-24 Uwe Zdun + * xotcl.c: removed internal mem leaks reported by dmalloc + * xotcl.c: corrected assertion checking for built-in commands, like set + * xotcl.c, xotclMetaData.c: put metadata into own file + + made them deprecated -> use @ instead + * testx.xotcl, testo.xotcl: used @ instead of metadata + * tutorial.html: reworked the tutorial, added instmixins + +2000-11-22 + * dmalloc defines added to Makefile.in + * xotcl.c: removed some mem leaks + +2000-11-22 + * documented various sample applications + * fixed problems with pipes for xocomm.test (should work now under + windows as well) + * polished output from xodoc + * extended sample webserver to return info about the current + request and provided means for stopping it remote. + +2000-11-22 Uwe Zdun + * configure.in: added ""'s around -z tests and added + --without-gdbm support + (thanks to Catherine Letondal for the hint) + * package/store/persistenceExample.xotcl added as a basic + persistence store example. + +2000-11-21 Uwe Zdun + * xotcl.c: corrected infinite loop in instvar assertions + (thanks to Zoran Vasiljevic for the hint) + +2000-11-20 Uwe Zdun + * xotcl.c/xotclInt.h: moved the global objects and a static + variable to interpreter structure (thanks to Zoran Vasiljevic for + the patches) + * xotcl.c correctes mem leak in "mixin" method + (thanks to Zoran Vasiljevic for the hint) + +2000-11-03 + * MimeTypes can be specified for certain filenames via + Mime set nameTable(ChangeLog$) text/plain + where the index is treated as a regular expression + * rpm target added to Makefile + * rpm files added to www.xotcl.org + * removed file installed to / from binary distribution + +2000-11-15 Uwe Zdun + * xotcl.c: corrected deletion order for aggregated children: + child destructor is called before parent's destructor + * Makefile.in: removed "-full-" from filename + +2000-11-03 + Various changes to HttpPlace.xotcl and Httpd.xotcl + * access control for HttpPlaces + * new instance variable "user" in Worker for authenticated requests + * access to ordinary files (and not only to WebObjects) from + HttpPlaces (if there is no object with the name of the file) + * worker added as a argument to credentialsNotOk + +2000-10-28 Uwe Zdun + * testx.xotcl: added tests for instmixins + +2000-10-26 Uwe Zdun + * xotcl.c: added instmixins + +2000-10-13 + * new global variable xotcl_version in analogy to tcl_version + * fixed parameter passing to init for multiple arguments + (not starting with a "-") + * added regression test + * fix bug for variable name aliasing in the instvar method + +----------------------------------------------------------------------------- +2000-10-09 Uwe Zdun + * prepared Version 0.82 + +2000-10-06 Uwe Zdun + * experimental tests for actiweb apps (invoke + with 'make test' at toplevel) + +2000-10-02 Uwe Zdun + * Documented xotcl.c + src/lib and src/scripts directories + +2000-09-29 Uwe Zdun + * xodoc.xotcl new XOTcl documentation package .. all docs + are now in file docs, with @ object + +2000-09-28 Uwe Zdun + !! xotcl.c removed aggregation short form due to incompatibilities + with unknown. I.e., + [self] Class x + does not function like + Class [self]::x + anymore, but triggers the unknown mechanism. + * removed bug: parameters have tried to call "-1" + default value as method + +2000-09-26 Uwe Zdun + !! src/xotcl.c: short form for creation of nested object and + classes removed. + * new documentation tool + +2000-09-22 + * new configure flags: + --with-gdbm=INCDIR,LIBDIR + --with-tk=INCDIR,LIBDIR + --with-tcl=INCDIR,LIBDIR + +2000-09-19 + * apps/actiweb-apps/FormsWithState.xotcl: + new example script for implementing a multi-page form + which keeps the state in a context object, which + is passed from form to form via hidden form fields + * new toplevel configure file + * toplevel "make install" copies demo apps as well + (should we set the path to xotclsh in first line?) + +2000-09-13 Uwe Zdun + * xotcl.c: added new format functionality to autoname. % + strings are now recognized as in the Tcl "format" + command. E.g.: autoname a%06d --> a000000, a000001, a000002, .. + + * rdf/xoRDF.test, rdf/RDFTriple.xotcl: used new autonames here + in order to make triples sort-able with lsort + +2000-09-12 + * Httpd.xotcl: Fixed a bug for IE5.5 with persistent connections: + (Server blocked); cause: the Tcl command "fcopy" alters the + blocking state of a socket when it finishes (bug in fcopy + of tcl 8.3.2) + +2000-09-12 Uwe Zdun + * xotcl/src: added xotclInt.h as XOTcl internal API + (still incomplete) + * xotcl.c: + - extracted xotclProfile.c, xotclReference.c, xotclTrace.c, + and xotclError.c from xotcl.c, + - started conversion to Tcl-like naming convention for + functions: XOTcl... for internal API, + XOTcl_... for external API + +2000-09-07 Uwe Zdun + * xoXML.xotcl: removed need for empty topNode + * xoRDF.xotcl/RDFTriple.xotcl: Uniform Parse Tree + - abbrev properties and parseType = resource are now parse + into descriptions + - class hierarchy uniformized to resources and properties + ... object names + are either prop.. or res.. + - resource types are stored in rdftypes variable + (as a list of types) + - Typed nodes are parsed into description + type + - namespace definition at RDF tag recognized + - hard coded "rdf:" removed (now rdfNSPrefix is stored on + each node, the parser has a rdfNamespace parameter) + +2000-09-06 + * packages/store/Persistence.xotcl: lazy open for + persistence database added (to avoid creation of not needed + files, when no persistent variables are used, and to reduce + permission problems for creation, opening, etc) + +2000-09-04 Uwe Zdun + * xotcl.c, Makefile.vc: INST_XOLIBPKG, XOTCLVERSION passed to + VC 6.0 preprocessor from Makefile.vc (thanks to David + LeBlanc for the fix) + +2000-09-04 + * xoRDF: trivial fix for make numbering of anonymous resources + easier to comprehend + * predefined.xotcl: methods "append" and "lappend" added + * xotcl/Makefile: keeps track of configure.in and reconfigures + if necessary (eg. version change) + * new -reset option for autoname (does currently not work with + -instance) + +2000-08-31 Uwe Zdun + * xoRDF: added subject ID to anonymous descriptions & fixed bugs + +2000-08-30 Uwe Zdun + * xotcl.c: fixed xotcltrace + * trace.xotcl: "deprecated messages" show* fixed + +2000-08-19 + * toplevel Makefile: target "make test" added + +2000-08-16 + * RDFTriple got a new method "prettyTriples" which uses + indentation to show connections between triples (used in xoRDF.test) + +2000-08-11 + * apps/xocomm/webserver.xotcl listens on port 9086 as well + to test basic access control + * packages/make.xotcl -test added + * Access.xotcl: fixes for credentials, timing for SimpleRequest now optional + (-timing 1, default is -timing 0) + * new files: packages/comm/xocomm.test, packages/rdf/xoRDF.test + * Ftp fixed for now Access methods + * "Class instproc newChild" and "Class instproc new" added + +2000-08-09 + * untested C-API placed between #ifdef + * dead code removed + * all internal calls to destroy handled by a single + function "callDestroyMethod" + * target "xref" added to xotc/src/Makefile + (needs free program xref to be installed) + +2000-08-08 + * new instcommand "exists" to check whether a variable + exists (no need to use namespaces or instvar to check + for the existence of variables) + * xotcl.c: using new macros + VarFrameDecls + VarFrameSwitchToObj(in,obj) + VarFrameRestore(in) + to change VariableFrames + (speedup mand making code more uniform) + * returning int objects instead of string objects + * using new features obove led to more than 20% speedup + on RDF benchmark. + * regression and speed test + xotcl/src/lib/speedtest.xotcl added + +2000-08-07 + * HTML Form interface changed, + form arguments are not longer appended to call + * new methods for WebObj: getWorker and getFormData + to access worker internals and form data + * some minor speed improvements + +2000-08-01 + !! more thorough checks for object names + (no ":", no "::", no ":[^:].+", no ".+:", no ".*NAME::[:]+NAME") + * copy and move methods create no invalid names that must be fixed + by Object creation + !! methods called via "-" syntax must start with an alphanum character + * Object creation 10% faster + * apps/actiweb-apps/MC.xotcl uses POST instead of GET + +2000-07-27 + !!! info children returns fully qualified object names + !!! info classchildren returns fully qualified object names + !!! info filter returns function names without class paths + * fixed composite attributes in RDF + * some speed improvements + * parameter passing from FORMs to WebObjects via parameter objects + * HtmlPlace has a default method that lists all exported objects + * Mime component added + * multipart-form data code added to Httpd + +2000-06-26 + * version number increased to 0.82 + * automated version number management + * test client and server for tls added + * minor changes for TLS + * minor fixes for Tcl 8.4a + * including certificates + +2000-06-20 Uwe Zdun + + * packages/mos/Agent.xotcl: + - migrate bug -- 'self' called after destroy of migrate -- + corrected + - support for synchronous invoke, clone, and migrate added in + addition to async methods + + * AgentClient/Receiver: example enhanced with class cloning and + sync invoke, clone, and migrate + + +----------------------------------------------------------------------------- +2000-06-05 XOTcl 0.81 Release -- Major Changes to Version 0.80 + - changelog started by Uwe Zdun + * xotcl.c: + - deep copy/move with all language features + - renamed "parameters" to "parameter" + - renamed "info filters" and "info mixins" to "info filter"/ + "info mixin" + - added deprecated error message + - added "xotcl_interp" command to start an XOTcl slave interp + - better "package" support and integration + - linearizing of per-object mixin hierarchy with ordinary + class hierarchy + - isobject, isclass, and ismetaclass with identical interface: + all have the obj/cls in question as argument + - reference tracing with "info reference", "info referencedby" added + - internal xotcl-lib now in predefined.xotcl -> make file + automatically creates predefined.h + * toplevel-configure added + * Actiweb: + - early alpha preview for code mobility, registry, web objects + added. be careful: the APIs will most likely change in the + future + - SSL Place + * HTTPserver/access: + - Open SSL support + * xoXML/xoRDF: + - RDF Typed Node support + - Parsing of several top nodes at once -> mixing of XML and RDF easier + - Tests integrated and several new tests + - XML/RDF recreation added + * xoStore: + - Support for tclgdbm added -- thanks to Stefan Vogel for + providing the Win version of gdbm Index: Makefile =================================================================== diff -u -N --- Makefile (revision 0) +++ Makefile (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,676 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# Copyright (c) 2002-2003 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,v 1.49 2007/10/12 19:53:32 neumann Exp $ + +#======================================================================== +# Add additional lines to handle any additional AC_SUBST cases that +# have been added in a customized configure script. +#======================================================================== + +#XOTCL_VERSION = 1.5.6 +XOTCL_VERSION = 1.5 + +src_lib_dir = ${srcdir}/library +src_doc_dir = ${srcdir}/doc +src_test_dir = ${srcdir}/tests +src_app_dir = ${srcdir}/apps +src_generic_dir = ${srcdir}/generic +TCL_LIB_SPEC = -L/usr/local/lib -ltcl8.5 +TK_LIB_SPEC = +subdirs = +aol_prefix = /usr/local/aolserver + +# Requires native paths +PLATFORM_DIR = `echo $(srcdir)/unix` +target_doc_dir = ./doc + +src_lib_dir_native = `echo ${src_lib_dir}` +src_doc_dir_native = `echo ${src_doc_dir}` +src_test_dir_native = `echo ${src_test_dir}` +src_app_dir_native = `echo ${src_app_dir}` +src_generic_dir_native = `echo ${src_generic_dir}` + +libdirs = comm lib serialize +libsrc = COPYRIGHT pkgIndex.tcl +appdirs = comm scripts utils +appsrc = COPYRIGHT + +DOC_SOURCE = \ + $(src_doc_dir)/langRef.xotcl \ + $(src_lib_dir)/lib/*.xotcl \ + $(src_lib_dir)/store/*.xotcl \ + $(src_lib_dir)/serialize/Serializer.xotcl \ + $(src_test_dir)/*.xotcl \ + $(src_app_dir)/scripts/*.xotcl \ + $(src_app_dir)/comm/[flsw]*.xotcl \ + $(src_app_dir)/actiweb/univ/UNIVERSAL.xotcl \ + $(src_app_dir)/utils/xo-*[a-z0-9] + +#export TCLLIBPATH=. ${srcdir} +mkinstalldirs= mkdir -p +#======================================================================== +# 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. +#======================================================================== + +#======================================================================== +# The names of the source files is defined in the configure script. +# The object files are used for linking into the final library. +# 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 = xotcl.c xotclError.c xotclMetaData.c xotclObjectData.c xotclProfile.c xotclTrace.c xotclUtil.c xotclShadow.c xotclCompile.c aolstub.c xotclStubInit.c +PKG_OBJECTS = xotcl.o xotclError.o xotclMetaData.o xotclObjectData.o xotclProfile.o xotclTrace.o xotclUtil.o xotclShadow.o xotclCompile.o aolstub.o xotclStubInit.o + +PKG_STUB_SOURCES = xotclStubLib.c +PKG_STUB_OBJECTS = xotclStubLib.o + +#======================================================================== +# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with +# this package that need to be installed, if any. +#======================================================================== + +PKG_TCL_SOURCES = + +#======================================================================== +# This is a list of public header files to be installed, if any. +#======================================================================== + +PKG_HEADERS = generic/xotcl.h generic/xotclInt.h generic/xotclDecls.h generic/xotclIntDecls.h + +#======================================================================== +# "PKG_LIB_FILE" refers to the library (dynamic or static as per +# configuration options) composed of the named objects. +#======================================================================== + +PKG_LIB_FILE = libxotcl1.5.6.dylib +PKG_STUB_LIB_FILE = libxotclstub1.5.6.a + +lib_BINARIES = $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE) +BINARIES = $(lib_BINARIES) + +SHELL = /bin/sh + +srcdir = . +prefix = /usr/local +exec_prefix = /usr/local + +bindir = ${exec_prefix}/bin +libdir = /usr/local/lib +datadir = /usr/local/share +mandir = ${prefix}/man +includedir = /usr/local/include + +DESTDIR = + +top_builddir = . + +INSTALL = /usr/bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} + +PACKAGE_NAME = xotcl +PACKAGE_VERSION = 1.5.6 +CC = gcc +CFLAGS_DEFAULT = -Os +CFLAGS_WARNING = -Wall -Wno-implicit-int +CLEANFILES = *.o *.a *.so *~ core gmon.out +EXEEXT = +LDFLAGS_DEFAULT = -prebind -headerpad_max_install_names -Wl,-search_paths_first +MAKE_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} +MAKE_SHARED_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} +MAKE_STATIC_LIB = ${STLIB_LD} $@ $(PKG_OBJECTS) +MAKE_STUB_LIB = ${STLIB_LD} $@ $(PKG_STUB_OBJECTS) +OBJEXT = o +RANLIB = : +RANLIB_STUB = ranlib +SHLIB_CFLAGS = -fno-common +SHLIB_LD = ${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT} -Wl,-single_module +SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@ +SHLIB_LD_LIBS = ${LIBS} -L/usr/local/lib -ltclstub8.5 +STLIB_LD = ${AR} cr +TCL_DEFS = -DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.5\" -DPACKAGE_STRING=\"tcl\ 8.5\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_GET_STACKSIZE_NP=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DHAVE_COREFOUNDATION=1 -DMAC_OSX_TCL=1 -DTCL_SHLIB_EXT=\".dylib\" -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_MTSAFE_GETHOSTBYNAME=1 -DHAVE_MTSAFE_GETHOSTBYADDR=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STRUCT_TM_TM_ZONE=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_CHFLAGS=1 -DHAVE_GETATTRLIST=1 -DHAVE_COPYFILE=1 -DHAVE_LIBKERN_OSATOMIC_H=1 -DHAVE_OSSPINLOCKLOCK=1 -DHAVE_PTHREAD_ATFORK=1 -DUSE_VFORK=1 -DTCL_DEFAULT_ENCODING=\"utf-8\" -DTCL_LOAD_FROM_MEMORY=1 -DTCL_WIDE_CLICKS=1 -DHAVE_AVAILABILITYMACROS_H=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -DTCL_UNLOAD_DLLS=1 +TCL_BIN_DIR = /usr/local/lib +TCL_SRC_DIR = /Users/neumann/src/tcl/tcl +# This is necessary for packages that use private Tcl headers +#TCL_TOP_DIR_NATIVE = "/Users/neumann/src/tcl/tcl" +# Not used, but retained for reference of what libs Tcl required +TCL_LIBS = ${DL_LIBS} ${LIBS} ${MATH_LIBS} + +pkgdatadir = /usr/local/share/xotcl1.5.6 +pkglibdir = /usr/local/lib/xotcl1.5.6 +pkgincludedir = /usr/local/include/xotcl1.5.6 + +# XOTCLSH = xotclsh + +#======================================================================== +# 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). +#======================================================================== + +EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) +TCLSH_ENV = TCL_LIBRARY=`echo $(TCL_SRC_DIR)/library` \ + DYLD_LIBRARY_PATH="$(EXTRA_PATH):$(DYLD_LIBRARY_PATH)" \ + PATH="$(EXTRA_PATH):$(PATH)" \ + TCLLIBPATH="$(top_builddir) ${srcdir}" +TCLSH_PROG = /usr/local/bin/tclsh8.5 +TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) +SHARED_BUILD = 1 + +INCLUDES = -I"/Users/neumann/src/tcl/tcl/generic" -I"/Users/neumann/src/tcl/tcl/unix" -I./generic +EXTRA_CFLAGS = -DXOTCLVERSION=\"1.5\" -DXOTCLPATCHLEVEL=\".6\" -DHAVE_TCL_COMPILE_H=1 + +# TCL_DEFS is not strictly need here, but if you remove it, then you +# must make sure that configure.in 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) -DPACKAGE_NAME=\"xotcl\" -DPACKAGE_TARNAME=\"xotcl\" -DPACKAGE_VERSION=\"1.5.6\" -DPACKAGE_STRING=\"xotcl\ 1.5.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 -DCOMPILE_XOTCL_STUBS=1 $(EXTRA_CFLAGS) +DEFS = -DPACKAGE_NAME=\"xotcl\" -DPACKAGE_TARNAME=\"xotcl\" -DPACKAGE_VERSION=\"1.5.6\" -DPACKAGE_STRING=\"xotcl\ 1.5.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 -DCOMPILE_XOTCL_STUBS=1 $(EXTRA_CFLAGS) + +CONFIG_CLEAN_FILES = Makefile xotclConfig.sh apps/utils/xotclsh apps/utils/xowish unix/xotcl.spec unix/pkgIndex.unix autom4te.cache/ + +CPPFLAGS = +LIBS = +AR = ar +CFLAGS = -pipe ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc end + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: $(BINARIES) xotclsh pkgIndex.tcl + @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ + for dir in $$dirs ; do \ + if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ + done; fi; + +libraries: + @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ + for dir in $$dirs ; do \ + if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ + done; fi; + +libraries-pkgindex: + @$(TCLSH) $(src_lib_dir_native)/lib/make.xotcl -dir $(src_lib_dir_native) -all + +fulldoc: doc pdf +# use language reference as sample file to trigger generation of documentation files +doc: $(target_doc_dir)/langRef-xotcl.html + +$(target_doc_dir)/langRef-xotcl.html: $(src_doc_dir)/langRef.xotcl $(DOC_SOURCE) + @docs=""; \ + for i in $(DOC_SOURCE); do docs="$$docs `echo $$i`"; done; \ + $(TCLSH) $(src_lib_dir_native)/lib/makeDoc.xotcl \ + $(target_doc_dir) $$docs + +pdf: + -(cd $(src_doc_dir); htmldoc --webpage --format pdf14 --title \ + -f tutorial.pdf tutorial.html ) + -(cd $(src_doc_dir); htmldoc --webpage --format pdf14 \ + -f langRef-xotcl.pdf langRef-xotcl.html ) + +install: install-binaries install-shells install-libraries install-doc + @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ + for dir in $$dirs ; do \ + if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ + done; fi; + +install-binaries: binaries install-lib-binaries install-bin-binaries install-pkgIndex + +install-aol: install-binaries install-libraries + $(INSTALL) $(src_generic_dir)/aol-xotcl.tcl \ + $(DESTDIR)/$(aol_prefix)/modules/tcl/xotcl.tcl + + +#======================================================================== +# This rule installs platform-independent files, such as header files. +#======================================================================== +install-libraries: libraries $(DESTDIR)$(includedir) $(DESTDIR)$(pkglibdir) + @echo "Installing header files in $(DESTDIR)$(includedir)" + @for i in $(PKG_HEADERS) ; do \ + echo " Installing $$i" ; \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ + done; + @echo "Installing Libraries to $(DESTDIR)$(pkglibdir)/" + @for i in $(libdirs) ; do \ + echo " Installing $$i/" ; \ + rm -rf $(DESTDIR)$(pkglibdir)/$$i ; \ + mkdir -p $(DESTDIR)$(pkglibdir)/$$i; \ + chmod 755 $(DESTDIR)$(pkglibdir)/$$i; \ + for j in $(src_lib_dir)/$$i/*.*tcl ; do \ + $(INSTALL_DATA) $$j $(DESTDIR)$(pkglibdir)/$$i/; \ + done; \ + done; + @for i in $(libsrc) ; do \ + echo " Installing $$i" ; \ + rm -rf $(DESTDIR)$(pkglibdir)/$$i ; \ + $(INSTALL_DATA) $(src_lib_dir)/$$i $(DESTDIR)$(pkglibdir)/$$i ; \ + done; + cat unix/pkgIndex.unix >> $(DESTDIR)$(pkglibdir)/pkgIndex.tcl + $(INSTALL_DATA) xotclConfig.sh $(DESTDIR)$(libdir)/ + @echo "Installing Applications to $(DESTDIR)$(pkglibdir)/apps/" + @for i in $(appdirs) ; do \ + echo " Installing $$i/" ; \ + rm -rf $(DESTDIR)$(pkglibdir)/apps/$$i ; \ + mkdir -p $(DESTDIR)$(pkglibdir)/apps/$$i; \ + chmod 755 $(DESTDIR)$(pkglibdir)/apps/$$i; \ + for j in $(src_app_dir)/$$i/* ; do \ + if test -d $$j; then \ + mkdir -p $(DESTDIR)$(pkglibdir)/$$j; \ + chmod 755 $(DESTDIR)$(pkglibdir)/$$j; \ + for k in $$j/* ; do \ + $(INSTALL) $$k $(DESTDIR)$(pkglibdir)/$$j ; \ + done; \ + else \ + $(INSTALL) $$j $(DESTDIR)$(pkglibdir)/apps/$$i/; \ + fi; \ + done; \ + done; + @for i in $(appsrc) ; do \ + echo " Installing $$i" ; \ + rm -rf $(DESTDIR)$(pkglibdir)/apps/$$i ; \ + $(INSTALL_DATA) $(src_app_dir)/$$i $(DESTDIR)$(pkglibdir)/apps ; \ + done; + @rm -rf $(DESTDIR)$(pkglibdir)/store/XOTclGdbm + @rm -rf $(DESTDIR)$(pkglibdir)/store/XOTclSdbm + @rm -rf $(DESTDIR)$(pkglibdir)/xml/TclExpat-1.1 + +#======================================================================== +# Install documentation. Unix manpages should go in the $(DESTDIR)$(mandir) +# directory. +#======================================================================== + +install-doc: doc $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man3 $(DESTDIR)$(mandir)/mann + @if test ! "x$(XOTCLSH)" = "x" ; then \ + (cd $(src_man_dir)/ ; \ + for i in *.1; do \ + echo "Installing $$i"; \ + rm -f $(DESTDIR)$(mandir)/man1/$$i; \ + sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \ + $$i > $(DESTDIR)$(mandir)/man1/$$i; \ + chmod 444 $(DESTDIR)$(mandir)/man1/$$i; \ + done) ; \ + fi + +shell: binaries libraries + @$(TCLSH) $(SCRIPT) + +gdb: + $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) + +test: binaries libraries test-core test-http +test-nohttp: binaries libraries test-core + +#TESTFLAGS = -srcdir $(srcdir) +test-core: $(TCLSH_PROG) + $(TCLSH) $(src_test_dir_native)/testx.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/testo.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/speedtest.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/forwardtest.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/slottest.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + +test-http: $(TCLSH_PROG) + $(TCLSH) $(src_test_dir_native)/xocomm.test \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + +test-actiweb: $(TCLSH_PROG) + $(TCLSH) $(src_test_dir_native)/actiweb.test \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/persistence.test \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/UNIVERSAL.test \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/xoRDF.test \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + @rm -rf receiver + +depend: + + +#======================================================================== +# $(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". +# +# 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. +#======================================================================== + +$(PKG_LIB_FILE): $(PKG_OBJECTS) + -rm -f $(PKG_LIB_FILE) + ${MAKE_LIB} + $(RANLIB) $(PKG_LIB_FILE) + +$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) + -rm -f $(PKG_STUB_LIB_FILE) + ${MAKE_STUB_LIB} + $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# +# 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 `echo $(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:.... +#======================================================================== + +VPATH = $(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win + +.c.o: + $(COMPILE) -c `echo $<` -o $@ + +#======================================================================== +# xotcl shells +#======================================================================== + +pkgIndex.tcl: $(PKG_LIB_FILE) + @echo package ifneeded XOTcl $(PACKAGE_VERSION) [list load [file join \$$dir . $(PKG_LIB_FILE)] XOTcl] > pkgIndex.tcl + +install-pkgIndex: +# @echo package ifneeded XOTcl $(PACKAGE_VERSION) [list load [file join \$$dir .. "$(PKG_LIB_FILE)"] XOTcl] > "$(pkglibdir)/pkgIndex.tcl" + +xotclsh: tclAppInit.o $(PKG_OBJECTS) $(CONDITIONAL_STUB_OBJECTS) + $(CC) -rdynamic -o $@ tclAppInit.o \ + $(PKG_OBJECTS) \ + $(CFLAGS) $(TCL_LIB_SPEC) \ + $(DMALLOC_LIB) $(CONDITIONAL_STUB_OBJECTS) + +xowish: tkAppInit.o $(PKG_OBJECTS) $(CONDITIONAL_STUB_OBJECTS) + $(CC) -rdynamic -o $@ tkAppInit.o \ + $(PKG_OBJECTS) \ + $(CFLAGS) $(TCL_LIB_SPEC) $(TK_LIB_SPEC) \ + $(DMALLOC_LIB) $(CONDITIONAL_STUB_OBJECTS) + +install-shells: + @if test -f xotclsh; then \ + $(INSTALL_PROGRAM) xotclsh $(DESTDIR)$(bindir); \ + fi + @if test -f xowish; then \ + $(INSTALL_PROGRAM) xowish $(DESTDIR)$(bindir); \ + fi + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# Unfortunately, there does not seem to be any other way to do this +# in a Makefile-independent way. We can't use VPATH because it picks up +# object files that may be located in the source directory. +# +# In the following lines, $(srcdir) refers to the toplevel directory +# containing your extension. If your sources are in a subdirectory, +# you will have to modify the paths to reflect this: +# +# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c +# $(COMPILE) -c `echo $(srcdir)/src/win/exampleA.c` -o $@ +#======================================================================== + +$(src_generic_dir)/predefined.h: $(src_generic_dir)/mk_predefined.xotcl $(src_generic_dir)/predefined.xotcl + (cd $(src_generic_dir); $(TCLSH) mk_predefined.xotcl > predefined.h) + +xotclStubInit.$(OBJEXT): $(PKG_HEADERS) +xotclStubLib.$(OBJEXT): $(src_generic_dir)/xotclStubLib.c $(PKG_HEADERS) +xotcl.$(OBJEXT): $(src_generic_dir)/xotcl.c $(src_generic_dir)/predefined.h $(PKG_HEADERS) +xotclError.$(OBJEXT): $(src_generic_dir)/xotclError.c $(PKG_HEADERS) +xotclMetaData.$(OBJEXT): $(src_generic_dir)/xotclMetaData.c $(PKG_HEADERS) +xotclObjectData.$(OBJEXT): $(src_generic_dir)/xotclObjectData.c $(PKG_HEADERS) +xotclProfile.$(OBJEXT): $(src_generic_dir)/xotclProfile.c $(PKG_HEADERS) +xotclTrace.$(OBJEXT): $(src_generic_dir)/xotclTrace.c $(PKG_HEADERS) +xotclUtil.$(OBJEXT): $(src_generic_dir)/xotclUtil.c $(PKG_HEADERS) +xotclShadow.$(OBJEXT): $(src_generic_dir)/xotclShadow.c $(PKG_HEADERS) +aolstub.$(OBJEXT): $(src_generic_dir)/aolstub.c $(PKG_HEADERS) + +# +# Target to regenerate header files and stub files from the *.decls tables. +# + +genstubs: + $(TCLSH) $(TCL_SRC_DIR)/tools/genStubs.tcl $(src_generic_dir) \ + $(src_generic_dir)/xotcl.decls $(src_generic_dir)/xotclInt.decls + +# +# Target to check that all exported functions have an entry in the stubs +# tables. +# + +checkstubs: + -@for i in `nm -p $(PKG_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \ + | sort -n`; do \ + match=0; \ + for j in $(TCL_DECLS); do \ + if [ `grep -c $$i $$j` -gt 0 ]; then \ + match=1; \ + fi; \ + done; \ + if [ $$match -eq 0 ]; then echo $$i; fi \ + done + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + -rm -rf $(BINARIES) $(CLEANFILES) xotclsh pkgIndex.tcl ./receiver \ + $(target_doc_dir)/*-xotcl.html + find ${srcdir} -type f -name \*~ -exec rm \{} \; + @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ + for dir in $$dirs ; do \ + if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ + done; fi + +distclean: clean + -rm -rf Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log config.status + @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ + for dir in $$dirs ; do \ + if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ + done; fi + +#======================================================================== +# 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) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: + @mkdir -p $(DESTDIR)$(pkglibdir) + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ + stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ + if test "x$$stub" = "xstub"; then \ + echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ + else \ + echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ + ln -s $(DESTDIR)$(pkglibdir)/$$p $(DESTDIR)$(libdir)/$$p; \ + fi; \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + 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; \ + fi; \ + fi; \ + 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; \ + done + + +#======================================================================== +# 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. +# +# You should not have to modify this target, except to define bin_BINARIES +# above if necessary. +#======================================================================== + +install-bin-binaries: + @mkdir -p $(DESTDIR)$(bindir) + @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; \ + done + +.SUFFIXES: .c .$(OBJEXT) + +#Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +# cd $(top_builddir) \ +# && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +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; \ + done + +$(DESTDIR)$(includedir): + $(mkinstalldirs) $@ +$(DESTDIR)$(bindir): + $(mkinstalldirs) $@ +$(DESTDIR)$(libdir): + $(mkinstalldirs) $@ +$(DESTDIR)$(pkglibdir): + $(mkinstalldirs) $@ +$(DESTDIR)$(pkglibdir)/apps: $(DESTDIR)$(pkglibdir) + $(mkinstalldirs) $@ +$(DESTDIR)$(mandir)/man1: + $(mkinstalldirs) $@ +$(DESTDIR)$(mandir)/man3: + $(mkinstalldirs) $@ +$(DESTDIR)$(mandir)/mann: + $(mkinstalldirs) $@ + +end: + @echo "" + @echo "************************************************************" + @echo " Make completed. In order to test XOTcl, invoke:" + @echo " make test" + @echo "" + @echo " In order install XOTcl, invoke:" + @echo " make install" + @echo "" + @echo " In order to install XOTcl for AOLserver 4.x, invoke:" + @echo " make install-aol" + @echo "" + @echo " In order to invoke XOTcl interactively (before install), use:" + @echo " export TCLLIBPATH=\"$(TCLLIBPATH)\" or " + @echo " setenv TCLLIBPATH \"$(TCLLIBPATH)\"" + @echo " and" + @if test "x$(XOTCLSH)" = "x" ; then \ + echo " /usr/local/bin/tclsh8.5" ; \ + echo " package require XOTcl; namespace import -force xotcl::*" ; \ + echo " or" ; \ + echo " put the 'package require' line into your ~/.tclshrc" ; \ + else \ + echo " ./xotclsh" ; \ + fi + @echo "************************************************************" + +RPMSOURCES=/usr/src/redhat/SOURCES +RPMSPECS=/usr/src/redhat/SPECS + +rpm: + @if test ! -d $(RPMSOURCES); then mkdir -p $(RPMSOURCES); fi + @if test ! -d $(RPMSPECS); then mkdir -p $(RPMSPECS); fi + cp unix/xotcl.spec $(RPMSPECS)/xotcl-$(PACKAGE_VERSION).spec + make tar + cp ../xotcl-$(PACKAGE_VERSION).tar.gz $(RPMSOURCES) + rpmbuild -ba $(RPMSPECS)/xotcl-$(PACKAGE_VERSION).spec + +bin-tar: + (cd ..; tar zcvf xotcl-$(PACKAGE_VERSION)-bin-linux-i686-glibc.tar.gz \ + `find $(exec_prefix)/bin/xotclsh $(exec_prefix)/bin/xowish \ + $(prefix)/lib/xotcl$(PACKAGE_VERSION)* \ + $(prefix)/lib/libxotcl$(PACKAGE_VERSION)* \ + $(prefix)/include/xotcl*.h \ + $(DESTDIR)$(pkglibdir) $(prefix)/man/man1/xo* \ + -type f -o -type l | fgrep -v CVS | fgrep -v SCCS | fgrep -v .junk| fgrep -v .db | fgrep -v "~" | fgrep -v "#" | fgrep -v /receiver/` \ + ) + +tar: libraries-pkgindex + sh ./config/mktar.sh + + +.PHONY: all binaries clean depend distclean doc install libraries \ + test test-core test-actiweb + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: Makefile.in =================================================================== diff -u -N --- Makefile.in (revision 0) +++ Makefile.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,676 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# Copyright (c) 2002-2003 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.25 2007/09/18 19:27:32 neumann Exp $ + +#======================================================================== +# Add additional lines to handle any additional AC_SUBST cases that +# have been added in a customized configure script. +#======================================================================== + +#XOTCL_VERSION = @PACKAGE_VERSION@ +XOTCL_VERSION = @XOTCL_VERSION@ + +src_lib_dir = ${srcdir}/library +src_doc_dir = ${srcdir}/doc +src_test_dir = ${srcdir}/tests +src_app_dir = ${srcdir}/apps +src_generic_dir = ${srcdir}/generic +TCL_LIB_SPEC = @TCL_LIB_SPEC@ +TK_LIB_SPEC = @TK_LIB_SPEC@ +subdirs = @subdirs@ +aol_prefix = @aol_prefix@ + +# Requires native paths +PLATFORM_DIR = `@CYGPATH@ $(srcdir)/@TEA_PLATFORM@` +target_doc_dir = ./doc + +src_lib_dir_native = `@CYGPATH@ ${src_lib_dir}` +src_doc_dir_native = `@CYGPATH@ ${src_doc_dir}` +src_test_dir_native = `@CYGPATH@ ${src_test_dir}` +src_app_dir_native = `@CYGPATH@ ${src_app_dir}` +src_generic_dir_native = `@CYGPATH@ ${src_generic_dir}` + +libdirs = comm lib serialize @libdirs_actiweb@ +libsrc = COPYRIGHT pkgIndex.tcl +appdirs = comm scripts utils @apps_actiweb@ +appsrc = COPYRIGHT + +DOC_SOURCE = \ + $(src_doc_dir)/langRef.xotcl \ + $(src_lib_dir)/lib/*.xotcl \ + $(src_lib_dir)/store/*.xotcl \ + $(src_lib_dir)/serialize/Serializer.xotcl \ + $(src_test_dir)/*.xotcl \ + $(src_app_dir)/scripts/*.xotcl \ + $(src_app_dir)/comm/[flsw]*.xotcl \ + $(src_app_dir)/actiweb/univ/UNIVERSAL.xotcl \ + $(src_app_dir)/utils/xo-*[a-z0-9] + +#export TCLLIBPATH=. ${srcdir} +mkinstalldirs= mkdir -p +#======================================================================== +# 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. +#======================================================================== + +#======================================================================== +# The names of the source files is defined in the configure script. +# The object files are used for linking into the final library. +# 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@ + +PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ +PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ + +#======================================================================== +# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with +# this package that need to be installed, if any. +#======================================================================== + +PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ + +#======================================================================== +# This is a list of public header files to be installed, if any. +#======================================================================== + +PKG_HEADERS = @PKG_HEADERS@ + +#======================================================================== +# "PKG_LIB_FILE" refers to the library (dynamic or static as per +# configuration options) composed of the named objects. +#======================================================================== + +PKG_LIB_FILE = @PKG_LIB_FILE@ +PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ + +lib_BINARIES = $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE) +BINARIES = $(lib_BINARIES) + +SHELL = @SHELL@ + +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +libdir = @libdir@ +datadir = @datadir@ +mandir = @mandir@ +includedir = @includedir@ + +DESTDIR = + +top_builddir = . + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ + +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +CC = @CC@ +CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ +CFLAGS_WARNING = @CFLAGS_WARNING@ +CLEANFILES = @CLEANFILES@ +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_FLAGS = @SHLIB_LD_FLAGS@ +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@ +# This is necessary for packages that use private Tcl headers +#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ +# Not used, but retained for reference of what libs Tcl required +TCL_LIBS = @TCL_LIBS@ + +pkgdatadir = @pkgdatadir@ +pkglibdir = @pkglibdir@ +pkgincludedir = @pkgincludedir@ + +# XOTCLSH = @XOTCLSH@ + +#======================================================================== +# 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). +#======================================================================== + +EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) +TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ + @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ + PATH="$(EXTRA_PATH):$(PATH)" \ + TCLLIBPATH="$(top_builddir) ${srcdir}" +TCLSH_PROG = @TCLSH_PROG@ +TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) +SHARED_BUILD = @SHARED_BUILD@ + +INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @XOTCL_BUILD_INCLUDE_SPEC@ +EXTRA_CFLAGS = @PKG_CFLAGS@ + +# TCL_DEFS is not strictly need here, but if you remove it, then you +# must make sure that configure.in 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@ $(EXTRA_CFLAGS) +DEFS = @DEFS@ $(EXTRA_CFLAGS) + +CONFIG_CLEAN_FILES = @CONFIG_CLEAN_FILES@ + +CPPFLAGS = @CPPFLAGS@ +LIBS = @PKG_LIBS@ @LIBS@ +AR = @AR@ +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc end + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: $(BINARIES) @XOTCLSH@ @XOWISH@ pkgIndex.tcl + @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ + for dir in $$dirs ; do \ + if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ + done; fi; + +libraries: + @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ + for dir in $$dirs ; do \ + if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ + done; fi; + +libraries-pkgindex: + @$(TCLSH) $(src_lib_dir_native)/lib/make.xotcl -dir $(src_lib_dir_native) -all + +fulldoc: doc pdf +# use language reference as sample file to trigger generation of documentation files +doc: $(target_doc_dir)/langRef-xotcl.html + +$(target_doc_dir)/langRef-xotcl.html: $(src_doc_dir)/langRef.xotcl $(DOC_SOURCE) + @docs=""; \ + for i in $(DOC_SOURCE); do docs="$$docs `@CYGPATH@ $$i`"; done; \ + $(TCLSH) $(src_lib_dir_native)/lib/makeDoc.xotcl \ + $(target_doc_dir) $$docs + +pdf: + -(cd $(src_doc_dir); htmldoc --webpage --format pdf14 --title \ + -f tutorial.pdf tutorial.html ) + -(cd $(src_doc_dir); htmldoc --webpage --format pdf14 \ + -f langRef-xotcl.pdf langRef-xotcl.html ) + +install: install-binaries install-shells install-libraries install-doc + @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ + for dir in $$dirs ; do \ + if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ + done; fi; + +install-binaries: binaries install-lib-binaries install-bin-binaries install-pkgIndex + +install-aol: install-binaries install-libraries + $(INSTALL) $(src_generic_dir)/aol-xotcl.tcl \ + $(DESTDIR)/$(aol_prefix)/modules/tcl/xotcl.tcl + + +#======================================================================== +# This rule installs platform-independent files, such as header files. +#======================================================================== +install-libraries: libraries $(DESTDIR)$(includedir) $(DESTDIR)$(pkglibdir) + @echo "Installing header files in $(DESTDIR)$(includedir)" + @for i in $(PKG_HEADERS) ; do \ + echo " Installing $$i" ; \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ + done; + @echo "Installing Libraries to $(DESTDIR)$(pkglibdir)/" + @for i in $(libdirs) ; do \ + echo " Installing $$i/" ; \ + rm -rf $(DESTDIR)$(pkglibdir)/$$i ; \ + mkdir -p $(DESTDIR)$(pkglibdir)/$$i; \ + chmod 755 $(DESTDIR)$(pkglibdir)/$$i; \ + for j in $(src_lib_dir)/$$i/*.*tcl ; do \ + $(INSTALL_DATA) $$j $(DESTDIR)$(pkglibdir)/$$i/; \ + done; \ + done; + @for i in $(libsrc) ; do \ + echo " Installing $$i" ; \ + rm -rf $(DESTDIR)$(pkglibdir)/$$i ; \ + $(INSTALL_DATA) $(src_lib_dir)/$$i $(DESTDIR)$(pkglibdir)/$$i ; \ + done; + cat unix/pkgIndex.unix >> $(DESTDIR)$(pkglibdir)/pkgIndex.tcl + $(INSTALL_DATA) xotclConfig.sh $(DESTDIR)$(libdir)/ + @echo "Installing Applications to $(DESTDIR)$(pkglibdir)/apps/" + @for i in $(appdirs) ; do \ + echo " Installing $$i/" ; \ + rm -rf $(DESTDIR)$(pkglibdir)/apps/$$i ; \ + mkdir -p $(DESTDIR)$(pkglibdir)/apps/$$i; \ + chmod 755 $(DESTDIR)$(pkglibdir)/apps/$$i; \ + for j in $(src_app_dir)/$$i/* ; do \ + if test -d $$j; then \ + mkdir -p $(DESTDIR)$(pkglibdir)/$$j; \ + chmod 755 $(DESTDIR)$(pkglibdir)/$$j; \ + for k in $$j/* ; do \ + $(INSTALL) $$k $(DESTDIR)$(pkglibdir)/$$j ; \ + done; \ + else \ + $(INSTALL) $$j $(DESTDIR)$(pkglibdir)/apps/$$i/; \ + fi; \ + done; \ + done; + @for i in $(appsrc) ; do \ + echo " Installing $$i" ; \ + rm -rf $(DESTDIR)$(pkglibdir)/apps/$$i ; \ + $(INSTALL_DATA) $(src_app_dir)/$$i $(DESTDIR)$(pkglibdir)/apps ; \ + done; + @rm -rf $(DESTDIR)$(pkglibdir)/store/XOTclGdbm + @rm -rf $(DESTDIR)$(pkglibdir)/store/XOTclSdbm + @rm -rf $(DESTDIR)$(pkglibdir)/xml/TclExpat-1.1 + +#======================================================================== +# Install documentation. Unix manpages should go in the $(DESTDIR)$(mandir) +# directory. +#======================================================================== + +install-doc: doc $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man3 $(DESTDIR)$(mandir)/mann + @if test ! "x$(XOTCLSH)" = "x" ; then \ + (cd $(src_man_dir)/ ; \ + for i in *.1; do \ + echo "Installing $$i"; \ + rm -f $(DESTDIR)$(mandir)/man1/$$i; \ + sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \ + $$i > $(DESTDIR)$(mandir)/man1/$$i; \ + chmod 444 $(DESTDIR)$(mandir)/man1/$$i; \ + done) ; \ + fi + +shell: binaries libraries + @$(TCLSH) $(SCRIPT) + +gdb: + $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) + +test: binaries libraries test-core test-http @test_actiweb@ +test-nohttp: binaries libraries test-core + +#TESTFLAGS = -srcdir $(srcdir) +test-core: $(TCLSH_PROG) + $(TCLSH) $(src_test_dir_native)/testx.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/testo.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/speedtest.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/forwardtest.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/slottest.xotcl \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + +test-http: $(TCLSH_PROG) + $(TCLSH) $(src_test_dir_native)/xocomm.test \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + +test-actiweb: $(TCLSH_PROG) + $(TCLSH) $(src_test_dir_native)/actiweb.test \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/persistence.test \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/UNIVERSAL.test \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + $(TCLSH) $(src_test_dir_native)/xoRDF.test \ + -libdir $(PLATFORM_DIR) $(TESTFLAGS) + @rm -rf receiver + +depend: + + +#======================================================================== +# $(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". +# +# 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. +#======================================================================== + +$(PKG_LIB_FILE): $(PKG_OBJECTS) + -rm -f $(PKG_LIB_FILE) + ${MAKE_LIB} + $(RANLIB) $(PKG_LIB_FILE) + +$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) + -rm -f $(PKG_STUB_LIB_FILE) + ${MAKE_STUB_LIB} + $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# +# 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:.... +#======================================================================== + +VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win + +.c.@OBJEXT@: + $(COMPILE) -c `@CYGPATH@ $<` -o $@ + +#======================================================================== +# xotcl shells +#======================================================================== + +pkgIndex.tcl: $(PKG_LIB_FILE) + @echo package ifneeded XOTcl $(PACKAGE_VERSION) [list load [file join \$$dir . $(PKG_LIB_FILE)] XOTcl] > pkgIndex.tcl + +install-pkgIndex: +# @echo package ifneeded XOTcl $(PACKAGE_VERSION) [list load [file join \$$dir .. "$(PKG_LIB_FILE)"] XOTcl] > "$(pkglibdir)/pkgIndex.tcl" + +xotclsh: tclAppInit.o $(PKG_OBJECTS) $(CONDITIONAL_STUB_OBJECTS) + $(CC) -rdynamic -o $@ tclAppInit.o \ + $(PKG_OBJECTS) \ + $(CFLAGS) $(TCL_LIB_SPEC) \ + $(DMALLOC_LIB) $(CONDITIONAL_STUB_OBJECTS) + +xowish: tkAppInit.o $(PKG_OBJECTS) $(CONDITIONAL_STUB_OBJECTS) + $(CC) -rdynamic -o $@ tkAppInit.o \ + $(PKG_OBJECTS) \ + $(CFLAGS) $(TCL_LIB_SPEC) $(TK_LIB_SPEC) \ + $(DMALLOC_LIB) $(CONDITIONAL_STUB_OBJECTS) + +install-shells: + @if test -f xotclsh; then \ + $(INSTALL_PROGRAM) xotclsh $(DESTDIR)$(bindir); \ + fi + @if test -f xowish; then \ + $(INSTALL_PROGRAM) xowish $(DESTDIR)$(bindir); \ + fi + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# Unfortunately, there does not seem to be any other way to do this +# in a Makefile-independent way. We can't use VPATH because it picks up +# object files that may be located in the source directory. +# +# In the following lines, $(srcdir) refers to the toplevel directory +# containing your extension. If your sources are in a subdirectory, +# you will have to modify the paths to reflect this: +# +# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c +# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@ +#======================================================================== + +$(src_generic_dir)/predefined.h: $(src_generic_dir)/mk_predefined.xotcl $(src_generic_dir)/predefined.xotcl + (cd $(src_generic_dir); $(TCLSH) mk_predefined.xotcl > predefined.h) + +xotclStubInit.$(OBJEXT): $(PKG_HEADERS) +xotclStubLib.$(OBJEXT): $(src_generic_dir)/xotclStubLib.c $(PKG_HEADERS) +xotcl.$(OBJEXT): $(src_generic_dir)/xotcl.c $(src_generic_dir)/predefined.h $(PKG_HEADERS) +xotclError.$(OBJEXT): $(src_generic_dir)/xotclError.c $(PKG_HEADERS) +xotclMetaData.$(OBJEXT): $(src_generic_dir)/xotclMetaData.c $(PKG_HEADERS) +xotclObjectData.$(OBJEXT): $(src_generic_dir)/xotclObjectData.c $(PKG_HEADERS) +xotclProfile.$(OBJEXT): $(src_generic_dir)/xotclProfile.c $(PKG_HEADERS) +xotclTrace.$(OBJEXT): $(src_generic_dir)/xotclTrace.c $(PKG_HEADERS) +xotclUtil.$(OBJEXT): $(src_generic_dir)/xotclUtil.c $(PKG_HEADERS) +xotclShadow.$(OBJEXT): $(src_generic_dir)/xotclShadow.c $(PKG_HEADERS) +aolstub.$(OBJEXT): $(src_generic_dir)/aolstub.c $(PKG_HEADERS) + +# +# Target to regenerate header files and stub files from the *.decls tables. +# + +genstubs: + $(TCLSH) $(TCL_SRC_DIR)/tools/genStubs.tcl $(src_generic_dir) \ + $(src_generic_dir)/xotcl.decls $(src_generic_dir)/xotclInt.decls + +# +# Target to check that all exported functions have an entry in the stubs +# tables. +# + +checkstubs: + -@for i in `nm -p $(PKG_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \ + | sort -n`; do \ + match=0; \ + for j in $(TCL_DECLS); do \ + if [ `grep -c $$i $$j` -gt 0 ]; then \ + match=1; \ + fi; \ + done; \ + if [ $$match -eq 0 ]; then echo $$i; fi \ + done + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + -rm -rf $(BINARIES) $(CLEANFILES) @XOTCLSH@ @XOWISH@ pkgIndex.tcl ./receiver \ + $(target_doc_dir)/*-xotcl.html + find ${srcdir} -type f -name \*~ -exec rm \{} \; + @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ + for dir in $$dirs ; do \ + if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ + done; fi + +distclean: clean + -rm -rf Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log config.status + @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ + for dir in $$dirs ; do \ + if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ + done; fi + +#======================================================================== +# 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) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: + @mkdir -p $(DESTDIR)$(pkglibdir) + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ + stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ + if test "x$$stub" = "xstub"; then \ + echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ + else \ + echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ + ln -s $(DESTDIR)$(pkglibdir)/$$p $(DESTDIR)$(libdir)/$$p; \ + fi; \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + 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; \ + fi; \ + fi; \ + 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; \ + done + + +#======================================================================== +# 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. +# +# You should not have to modify this target, except to define bin_BINARIES +# above if necessary. +#======================================================================== + +install-bin-binaries: + @mkdir -p $(DESTDIR)$(bindir) + @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; \ + done + +.SUFFIXES: .c .$(OBJEXT) + +#Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +# cd $(top_builddir) \ +# && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +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; \ + done + +$(DESTDIR)$(includedir): + $(mkinstalldirs) $@ +$(DESTDIR)$(bindir): + $(mkinstalldirs) $@ +$(DESTDIR)$(libdir): + $(mkinstalldirs) $@ +$(DESTDIR)$(pkglibdir): + $(mkinstalldirs) $@ +$(DESTDIR)$(pkglibdir)/apps: $(DESTDIR)$(pkglibdir) + $(mkinstalldirs) $@ +$(DESTDIR)$(mandir)/man1: + $(mkinstalldirs) $@ +$(DESTDIR)$(mandir)/man3: + $(mkinstalldirs) $@ +$(DESTDIR)$(mandir)/mann: + $(mkinstalldirs) $@ + +end: + @echo "" + @echo "************************************************************" + @echo " Make completed. In order to test XOTcl, invoke:" + @echo " make test" + @echo "" + @echo " In order install XOTcl, invoke:" + @echo " make install" + @echo "" + @echo " In order to install XOTcl for AOLserver 4.x, invoke:" + @echo " make install-aol" + @echo "" + @echo " In order to invoke XOTcl interactively (before install), use:" + @echo " export TCLLIBPATH=\"$(TCLLIBPATH)\" or " + @echo " setenv TCLLIBPATH \"$(TCLLIBPATH)\"" + @echo " and" + @if test "x$(XOTCLSH)" = "x" ; then \ + echo " @TCLSH_PROG@" ; \ + echo " package require XOTcl; namespace import -force xotcl::*" ; \ + echo " or" ; \ + echo " put the 'package require' line into your ~/.tclshrc" ; \ + else \ + echo " ./xotclsh" ; \ + fi + @echo "************************************************************" + +RPMSOURCES=/usr/src/redhat/SOURCES +RPMSPECS=/usr/src/redhat/SPECS + +rpm: + @if test ! -d $(RPMSOURCES); then mkdir -p $(RPMSOURCES); fi + @if test ! -d $(RPMSPECS); then mkdir -p $(RPMSPECS); fi + cp unix/xotcl.spec $(RPMSPECS)/xotcl-$(PACKAGE_VERSION).spec + make tar + cp ../xotcl-$(PACKAGE_VERSION).tar.gz $(RPMSOURCES) + rpmbuild -ba $(RPMSPECS)/xotcl-$(PACKAGE_VERSION).spec + +bin-tar: + (cd ..; tar zcvf xotcl-$(PACKAGE_VERSION)-bin-linux-i686-glibc.tar.gz \ + `find $(exec_prefix)/bin/xotclsh $(exec_prefix)/bin/xowish \ + $(prefix)/lib/xotcl$(PACKAGE_VERSION)* \ + $(prefix)/lib/libxotcl$(PACKAGE_VERSION)* \ + $(prefix)/include/xotcl*.h \ + $(DESTDIR)$(pkglibdir) $(prefix)/man/man1/xo* \ + -type f -o -type l | fgrep -v CVS | fgrep -v SCCS | fgrep -v .junk| fgrep -v .db | fgrep -v "~" | fgrep -v "#" | fgrep -v /receiver/` \ + ) + +tar: libraries-pkgindex + sh ./config/mktar.sh + + +.PHONY: all binaries clean depend distclean doc install libraries \ + test test-core test-actiweb + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: README =================================================================== diff -u -N --- README (revision 0) +++ README (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,147 @@ +***************** $Id: README,v 1.2 2004/08/18 09:31:08 neumann Exp $ +XOTcl README File +***************** + +********************************** +Compilation of Source Distribution +********************************* +Read COMPILE for compilation guidance on UNIX or +COMPILE.win for Windows. + + +************************************ +Installation of Binary Distributions +************************************ + +For all binary distributions firstly Tcl and Tk must be installed +properly. Binary distributions require Tcl/Tk 8.3 (included in +most Linux distributions), which you can find from: + + http://www.tcl.tk + + +Working with a Shell +-------------------- + +From version 1.1 on XOTcl does not - by default - build xotclsh and +xowish anymore. Instead you should use xotcl from tclsh or wish. The +typical way to do so is to load XOTcl as a packages and then import +the commands from the XOTcl namespace into the current namespace: + + /usr/local/bin/tclsh8.4 + package require XOTcl; namespace import -force xotcl::* + +That means, the XOTcl installed package library needs to be on Tcl's +search path for packages. + +If XOTcl is not installed in the standard Tcl location, you can either +set the environment variable TCLLIBPATH from outside of Tcl to this +location, or use the variable auto_path in Tcl. For instance, to use +the local, extracted tar ball, you can use something like (under +UNIX): + export TCLLIBPATH="./xotcl-1.3.0" or + setenv TCLLIBPATH "./xotcl-1.3.0" +Under Windows: + set TCLLIBPATH=".\xotcl-1.3.0" + + +Linux Binary Distribution +------------------------- + +Per default the Linux version install to usr/local and XOTcl +directories. If you want to install to these directions, just + cd / + tar xvfz xotcl-XXX.tar.gz +otherwise: + mkdir temp-xotcl + cd temp-xotcl + tar xvfz xotcl-XXX.tar.gz +and then copy the file in temp-xotcl/usr/local to your installation +destination and temp-dir/xotcl where you want to have the examples +and documentation. If the packages can not be found, try to +set the TCLLIBPATH. On Unix Systems: + +csh: setenv TCLLIBPATH "/usr/local/lib/xotcl-/ $(TCLLIBPATH)" +bash: export TCLLIBPATH="/usr/local/lib/xotcl-/ $(TCLLIBPATH)" + + +Windows Binary Release +---------------------- + +You need Tcl 8.3.* or 8.4.* installed properly. If necessary, get Tcl +8.4 for your system from + http://www.tcl.tk + +Now check where Tcl is installed and what the name of the tclsh*.exe +is. If you installed Tcl 8.3.5, the name is tclsh83.exe. On my system +Tcl installs tclsh in c:\Programme\Tcl\bin (in English versions this +is most likely under c:\Program Files\Tcl\bin). + +On my system the tcl installer adds this directory automatically +to the search PATH; if this is not the case on your system, add this +directory manually to your PATH (under NT or Win2K, use: Control +Panel/System/.../Environment; MSDOS-class system use autoexec.bat to +add this directory to the PATH variable by a line like + SET PATH=c:\Progra~1\Tcl\bin;%PATH% +) and reboot. + +Now you should be able now to start the Tcl shell by typing "tclsh83". You +will see the % prompt. To exit the shell, type "exit". + +The xotcl*.zip file contains the XOTcl distribution. Unzip the +contents of the XOTcl zip file on c: to a directory "xotcl*." Open a +DOS box window and change to the XOTcl win directory, like: + + c: + cd \xotcl-\win + +Next, you have to invoke the installer: + + tclsh83 installWin.tcl + +The installer tries to install xotcl in the default directory +"\Program~1\Tcl", which should at least work on English and German +platforms (in English Windows distributions the program directory is +called "Program Files", in German versions, it is called "Programme"). + +If you want to install XOTcl at a different you can specify the target +directory as an argument of the installer: + + tclsh83 installWin.tcl /Programme/Tcl + +Now you should be able to use XOTcl by starting Tclsh and using: + + package require XOTcl; namespace import -force xotcl::* + +If XOTcl is not found on your system, you can set the TCLLIBPATH enviornment +variable to the location of xotcl, e.g.: + + set TCLLIBPATH="C:/PROGRA~1/TCL/lib/xotcl" + +Please note the slashes, do not use backslashes here! + +You can test your installation with: + +XOTcl Tests: + tclsh xotcl-/tests/testx.xotcl + tclsh xotcl-/tests/testo.xotcl + tclsh xotcl-/tests/speedtest.xotcl + tclsh xotcl-/tests/xocomm.test + tclsh xotcl-/tests/persistence.test + tclsh xotcl-/tests/xoRDF.test + +More Infos +---------- + +More information can be found at: + + http://www.xotcl.org + +You can find a mailing list about XOTcl there as well. + +Please report bugs and problems to the authors under one of these +email addresses: + + uwe.zdun@wu-wien.ac.at, zdun@xotcl.org + gustaf.neumann@wu-wien.ac.at, neumann@xotcl.org + Index: README.aol =================================================================== diff -u -N --- README.aol (revision 0) +++ README.aol (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,21 @@ + + Starting with Aolserver 4.* xotcl can be loaded via + package require. However, it is recommended to install + the binaries under the aolserver directory. The + recommended configuration is: + + ./configure --enable-threads --prefix=/usr/local/aolserver + + Then, you can do a + + make + make install + + We provide a small .tcl-file for providing xotcl as a module + (available in all connection threads) and easing the load of + .xotcl files (to be loaded after the xotcl extension). The + support file can be installed via: + + make install-aol + + Zoran, Gustaf Index: aclocal.m4 =================================================================== diff -u -N --- aclocal.m4 (revision 0) +++ aclocal.m4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1 @@ +builtin(include,tcl.m4) Index: apps/COPYRIGHT =================================================================== diff -u -N --- apps/COPYRIGHT (revision 0) +++ apps/COPYRIGHT (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + * XOTcl - Extended OTcl + * + * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) + * + * (a) Vienna University of Economics and Business Administration + * Dept. of Information Systems / New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + Index: apps/actiweb/AgentClient.xotcl =================================================================== diff -u -N --- apps/actiweb/AgentClient.xotcl (revision 0) +++ apps/actiweb/AgentClient.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,151 @@ +#!/usr/bin/env tclsh +# $Id: AgentClient.xotcl,v 1.5 2006/09/27 08:12:39 neumann Exp $ +#if {![info exists ACTIWEB_HOME]} {source ~/actiweb/paths.xotcl} +package require XOTcl; namespace import -force xotcl::* +package require xotcl::package +package verbose 1 + +package require xotcl::actiweb::agent +package require xotcl::actiweb::httpPlace + +Place p +set receiverHost localhost:8087 + +# +# if we migrate an object, we cannot send the result to [self] +# in this example we just use a small result printer object to +# print the result to the stderr stream +# +Object resultPrinter +resultPrinter proc printResult {o m code result} { + if {$code eq "OK"} { + puts stderr "[self] -- Result -- $m:\n$result" + } else { + puts stderr "[self] -- Error -- $m: \n$result" + } +} + +Class CloneableClass -superclass {Agent Class} + +CloneableClass AgentExample -superclass Agent -parameter { + {invokeAgent hallo.txt} + {invokeMethod content} +} +AgentExample proc test-calls {} { + #showObj [self] + + set host [::set ::receiverHost] + my clone $host "" [list [self] class-cloned] +} +AgentExample proc class-cloned {args} { + my a1 + my a2 + my a3 + my a4 + a1 synchronousInvokeCall + a3 synchronousMigrateCall + a4 synchronousCloneCall + + #a1 asynchronousInvokeCall + #a1 asynchronousCloneCall + #a2 asynchronousMigrateCall + exit +} +AgentExample instproc computeXXX args { + return XXX--[my set var1]--XXXX +} +AgentExample instproc init args { + next + my set var1 xyz + my persistent var1 +} +AgentExample instproc synchronousInvokeCall args { + + set host [::set ::receiverHost] + my instvar invokeAgent invokeMethod + puts stderr "*******************[self]: [self proc]" + puts stderr "Result: [my syncInvoke $host $invokeAgent $invokeMethod]" +} +AgentExample instproc synchronousMigrateCall args { + set host [::set ::receiverHost] + puts stderr "*******************[self]: [self proc]" + set result [my syncMigrate $host computeXXX] + puts stderr "Result: '$result'" +} +AgentExample instproc synchronousCloneCall args { + set host [::set ::receiverHost] + puts stderr "*******************[self]: [self proc]" + set result [my syncClone $host computeXXX] + puts stderr "Result: '$result'" +} +AgentExample instproc asynchronousInvokeCall args { + set host [::set ::receiverHost] + my instvar invokeAgent invokeMethod + puts stderr "*******************[self]: [self proc]" + my invoke [list resultPrinter printResult my INVOKE] $host $invokeAgent $invokeMethod +} +AgentExample instproc asynchronousCloneCall args { + set host [::set ::receiverHost] + puts stderr "*******************[self]: [self proc]" + my clone $host computeXXX [list resultPrinter printResult my CLONE] +} +AgentExample instproc asynchronousMigrateCall args { + set host [::set ::receiverHost] + puts stderr "*******************[self]: [self proc]" + my migrate $host computeXXX [list resultPrinter printResult my MIGRATE] +} + + +#AgentExample instproc callSet args { +# set host localhost:8087 +# set agent welcome +# +# puts stderr INVOKE******************************* +# set r [my invoke $host welcome set+a+1] +# puts stderr result=$r +#} + +AgentExample instproc destroy args { + next +} + +Agent registryTest + +registryTest proc test args { + set host localhost:8087 + my createRequest "[self] testOnPlaceName $host" http://$host/ +} + +registryTest proc testOnPlaceName {host placeName} { + set place [Place getInstance] + set subject "http://[$place host]:[$place port]/[self]" + + RDFdb [self]::db + [self]::db add "http://nestroy.wi-inf.uni-essen.de/schema/service#name" \ + $subject registryTest + [self]::db add "http://nestroy.wi-inf.uni-essen.de/schema/xotcl#class" \ + $subject [my info class] + # + # place info als bag machen ... + # + [self]::db add "http://nestroy.wi-inf.uni-essen.de/schema/agent#place" \ + $subject $place + + set rdfText [${place}::rdfCreator createFromTriples [[self]::db getTriples]] + + [self]::db destroy + + my invoke $host ${placeName}::registry register $rdfText + + set r [my invoke $host ${placeName}::registry query registryTest] + puts "************************Query: $r\n" + set r [my invoke $host ${placeName}::registry queryProperty http://nestroy.wi-inf.uni-essen.de/schema/agent\#place ::p] + puts "************************QueryProperty: $r\n" +} + + +p exportedObjs client +#p startEventLoop "registryTest test" +#p startEventLoop "client callWelcome; registryTest test" +p startEventLoop "AgentExample test-calls" + Index: apps/actiweb/Counter.README =================================================================== diff -u -N --- apps/actiweb/Counter.README (revision 0) +++ apps/actiweb/Counter.README (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,61 @@ +* $Id: Counter.README,v 1.1 2004/05/23 22:50:39 neumann Exp $ +* +* Variationen des Counter-Themas im ActiWeb: +* (Zeilenangaben ohne Kommentare und Leerzeilen) +* +* + +1) Counter.xotcl (22 Zeilen) + + Die Klasse Counter wird als Spezialisierung von HtmlDocument + definiert ("Ein Dokument mit weiteren Methoden") + + Aufruf: + http://localhost:8090/counter-1.html + http://localhost:8090/counter-2.html + + +2) Counter2.xotcl (32 Zeilen) + + Die Klasse Counter wird als Spezialisierung von WebAgent + definiert, der ein plain/text interface besitzt. Zus�tzlich + wird eine Web-Facade definiert, die fuer die HTML-spezifische + Pr�sentation des WebAgenten sorgt. + + Aufruf: + http://localhost:8091/htmlUI+invoke+c1 + http://localhost:8091/htmlUI+invoke+c2 + + +3) Counter3.xotcl (28 Zeilen) + + Die Klasse Counter wird v�llig unabh�ngig von jeder + Web-Nutzung definiert (Sachmodell). Als Spezialisierung + dieser Counter-Klasse wird die Klasse Web-Counter definiert, + die auch von HTML-Document erbt. Diese Klasse ist fuer + die HTML-Aufbereitung zust�ndig. Es werden Instanzen von + Web-Counter erzeugt. + + Aufruf: + http://localhost:8093/c1 + http://localhost:8093/c2 + + +4) Counter4.xotcl (33 Zeilen) + + Die Klasse Counter wird v�llig unabh�ngig von jeder + Web-Nutzung definiert (Sachmodell). Ebenso unabh�ngig + von der Web-Nutzung wird PersistentCounter als + spezialisierte Counter-Klasse definiert. Von diesen persistenten + Countern werden Instanzen gebildet (web-unabhaengig). + + Als weitere Instanzen werden Proxy-Objekte erzeugt, + die f�r die HTML-Aufbereitung zust�ndig sind, und die + hereinkommende Requests an die im "Hintergrund" existierenden + eigentlichen Objekte weitergeben, und deren Ergebnisse + entsprechend aufbereiten. Es werden nur die Proxy-Objekte + exportiert, nur diese sind ueber den Web-Server ansprechbar. + + Aufruf: + http://localhost:8094/wc1 + http://localhost:8094/wc2 Index: apps/actiweb/Counter.xotcl =================================================================== diff -u -N --- apps/actiweb/Counter.xotcl (revision 0) +++ apps/actiweb/Counter.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,42 @@ +#!../../src/xotclsh +# $Id: Counter.xotcl,v 1.4 2006/09/27 08:12:39 neumann Exp $ +#load /Users/neumann/src/xotcl-1.4.1/library/store/XOTclSdbm/libxotclsdbm1.2.dylib +array set opts {-pkgdir .}; array set opts $argv +lappend auto_path $opts(-pkgdir) + +package require XOTcl; namespace import -force xotcl::* +package require xotcl::actiweb::htmlPlace +package require xotcl::actiweb::webDocument + +### Instantiate an Html place with the name receive and port 8090 +HtmlPlace ::receiver -port 8090 -allowExit exit + +### Define a class Counter as a special Html Document +Class Counter -superclass HtmlDocument -parameter {{count 0}} + +Counter instproc init args { ;### Constructor + next + my persistent count ;### make count variable persistent + ::receiver exportObjs [self] ;### export the counter object + my exportProcs increment ;### export counter's increment method +} +Counter instproc default {} { ;### Method for updating HTML page + set objName [string trimleft [self] :] + return "The value in $objName is now: [my set count].

+ Increment Counter

+


Last Update: [clock format [clock seconds]] + \n" +} +Counter instproc increment {} { ;### exported increment method + my incr count + return [my default] +} + +### Create two counter instances with the names +### counter-1.html and counter-2.html +Counter counter-1.html +Counter counter-2.html + +### Start event loop and handle connections +receiver startEventLoop + Index: apps/actiweb/Counter2.xotcl =================================================================== diff -u -N --- apps/actiweb/Counter2.xotcl (revision 0) +++ apps/actiweb/Counter2.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,65 @@ +#!../../src/xotclsh +# $Id: Counter2.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ +array set opts {-pkgdir .}; array set opts $argv +lappend auto_path $opts(-pkgdir) + +package require XOTcl; namespace import -force xotcl::* + +package require xotcl::actiweb::htmlPlace +package require xotcl::actiweb::pageTemplate + +HtmlPlace ::receiver -port 8091 -allowExit exit + +### +### The counter class is an agent implementing the business logic +### +Class Counter -superclass Agent -parameter {{count 1}} + +Counter instproc init args { ;### Constructor + next ;### Call superclass constructor + my persistent count ;### make count variable persistent +} +Counter instproc increment {} { ;### increment method + my incr count +} +### Create two counter instances c1/c2 +Counter c1 +Counter c2 + +### +### Define a specialization of web object as a facade to the counters +### The Page Template Mixin defines the HTML appearance +### + +### Define an HTML Page Template +Class WebCounter -superclass WebObject \ + -instmixin PageTemplateHtml -parameter {counter} + +WebCounter instproc init args { + next + [my set place] exportObjs [self] ;### export the web counter object + my exportProcs increment ;### export counter's increment method +} +WebCounter instproc increment {} { ;### A method that decorates increment with HTML appearence + my instvar counter ;### import var that stores shielded web agent + $counter [self proc] ;### call the actual method on the web agent + my default ;### update HTML page +} +WebCounter instproc default {} { ;### Method for updating HTML page + my instvar count counter ;### importiere var that stores shielded web agent + $counter instvar count ;### importiere count var + # + # and create web-page with counter content + # + my simplePage [self] "Html-Facade for $counter using a page template" \ + "The value in $counter is $count.

+ Increment Counter

" +} +# +# create two web-facade instances; one for each counter +# +WebCounter web-c1 -counter c1 +WebCounter web-c2 -counter c2 + +### Start event loop and handle connections +receiver startEventLoop Index: apps/actiweb/Counter3.xotcl =================================================================== diff -u -N --- apps/actiweb/Counter3.xotcl (revision 0) +++ apps/actiweb/Counter3.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,44 @@ +#!../../src/xotclsh +# $Id: Counter3.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +array set opts {-pkgdir .}; array set opts $argv +lappend auto_path $opts(-pkgdir) + +package require XOTcl; namespace import -force xotcl::* +package require xotcl::actiweb::htmlPlace +package require xotcl::actiweb::webDocument + +### Instantiate an Html place with the name receiver +HtmlPlace ::receiver -port 8093 -allowExit exit + +### Define a class solely for counting +Class Counter -parameter {{count 1}} +Counter instproc increment {} { ;### counter method + my incr count +} + +### Define a special WebCounter as a specialization of the Counter class +Class WebCounter -superclass {Counter HtmlDocument} +WebCounter instproc init args { ;### Constructor + next + my persistent count ;### make count variable persistent + ::receiver exportObjs [self] ;### export the counter object + my exportProcs increment ;### export increment method +} +WebCounter instproc default {} { ;### Method for updating HTML page + set objName [string trimleft [self] :] + return "The value in $objName is [my set count].

+ Increment Counter

+


Last Update: [clock format [clock seconds] -format %m/%d/%y-%H:%M] + \n" +} +WebCounter instproc increment {} { ;### exported increment method + next ;### call superclasses' increment + my default ;### display the result as HTML +} + +### Create two web counter instances with the names c1 and c2 +WebCounter c1 +WebCounter c2 + +### Start event loop and handle connections +receiver startEventLoop Index: apps/actiweb/Counter4.xotcl =================================================================== diff -u -N --- apps/actiweb/Counter4.xotcl (revision 0) +++ apps/actiweb/Counter4.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,56 @@ +#!../../src/xotclsh +# $Id: Counter4.xotcl,v 1.2 2004/07/27 21:39:46 neumann Exp $ +array set opts {-pkgdir .}; array set opts $argv +lappend auto_path $opts(-pkgdir) + +package require XOTcl; namespace import -force xotcl::* +package require xotcl::actiweb::htmlPlace +package require xotcl::actiweb::webDocument + +### Instantiate an Html place with the name receiver +HtmlPlace ::receiver -port 8094 -allowExit exit + +### Define a class solely for counting +Class Counter -parameter {{count 1}} +Counter instproc increment {} { ;### counter method + my incr count +} + +### Define a Counter subclass for persistent counting +Class PersistentCounter -superclass Counter +PersistentCounter instproc init args { ;### Constructor + next ;### call superclasses' init + my mixinStrategy Persistent=Eager + my persistenceMgr [Place getInstance]::agentPersistenceMgr + my persistent count ;### make count variable persistent +} + +### Create two persistent counter instances with the names c1 and c2 +PersistentCounter c1 +PersistentCounter c2 + + +### Define a proxy class, that handles HTML decoration +### HtmlProxy forwards all unknown calls to "realSubject" +Class HtmlProxyCounter -superclass HtmlProxy +HtmlProxyCounter instproc init args { ;### Constructor + next + my exportProcs increment ;### export increment method +} +HtmlProxyCounter instproc default {} { + my instvar realSubject + $realSubject instvar count + set objName [string trimleft [self] :] + return "The value in $realSubject is $count.

+ Increment Counter

+


Last Update: [clock format [clock seconds] -format %m/%d/%y-%H:%M] +] + \n" +} + +### Create two proxy instances wc1 und wc2 +HtmlProxyCounter wc1 -realSubject c1 +HtmlProxyCounter wc2 -realSubject c2 + +### Start event loop and handle connections +receiver startEventLoop Index: apps/actiweb/FormsWithState.xotcl =================================================================== diff -u -N --- apps/actiweb/FormsWithState.xotcl (revision 0) +++ apps/actiweb/FormsWithState.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,205 @@ +#!../../src/xotclsh +# $Id: FormsWithState.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# +# Demo Program for Multi-Page Forms implemented via hidden +# Form Fields -gn +# +package require XOTcl; namespace import -force xotcl::* +package require xotcl::actiweb::htmlPlace +package require xotcl::actiweb::webDocument +HtmlPlace receiver -port 8086 + +# The following class is used to define HTML-pages +Class HTMLPage -superclass HtmlDocument -parameter { + {pageContent ""} + {pageTitle ""} + {pageHeader ""} + endCmd +} + +HTMLPage instproc init args { + receiver exportObjs [self] + next +} + +# instproc default is evoked whenever an HTMLDocument object +# is called without a specific method. +HTMLPage instproc default args { + my instvar content + # creates HTML page content + set content + append content \ + [my set pageTitle] \ + [my set pageHeader] \n \ + [my set pageContent] + # substitutes all embedded commands and variables in content + set content [subst $content] + + # An HTMLPage can provide a command, which is executed after + # the content is computed; this mechanism is used here for deleting + # the context object + if {[my exists endCmd]} { + eval [my set endCmd] + } + # next sends content to the client + next +} + +# The form state is kept in a context object. The method varname +# accesses variables from the context object or returns empty values. +HTMLPage instproc get varname { + my instvar context + if {[$context exists $varname]} { + return [$context set $varname] + } else { + return "" + } +} + +# The final page will contain a table with all the variables in +# the context object +HTMLPage instproc printAll {} { + my instvar context + set result " +
  + + + \n" + # creates a table row for each variable and + # it's value of the current context object + foreach var [$context info vars] { + append result \ + \n + } + return "$result
+ Submission
+ You submitted the following values: +
   
$var:[$context set $var]
\n
" +} + +HTMLPage form1 +form1 proc default {} { + set values {} + # process the form data from post method + foreach a [my getFormData] { + set name [$a set name] + switch -glob $name { + *.html {set nextPage $name} + context {set context [$a set content]} + default {lappend values $name [$a set content]} + } + } + # save the form data in the context object + foreach {name value} $values { + $context set $name $value + } + if {![info exists nextPage]} { + # We assume, we are called the first time... + # Create a new context object and call the first page + set context [Object new] + set nextPage [self]/page1.html + } + $nextPage set context $context + # delegeate to the actual form page + $nextPage default +} + +HTMLPage form1/page1.html -pageTitle "First Page" -pageContent { +
+ + + + + +
  + + + + + + + + + +
+ + Primary Contact information
+ Please supply us with full details of + the person who will act as the + person we will contact about this paper. +
   
+ First Name:
+ +
+
+ Second Name:
+ +

+
+ +
+
+} + + +HTMLPage form1/page2.html -pageTitle "Second Page" -pageContent { + + + +
  + + + + + + + + + + + + + +
+ Title and Autors
+ Please supply full title of the paper and the contributing authors. +
  
+ Title:
+ +

+
+ Authors:
+ +

+
+ + + +
+
+} + +### submit.html ist the final page; the context object is destroyed here +HTMLPage form1/submit.html \ + -endCmd {[my set context] destroy} \ + -pageTitle "Third Page" -pageContent { + [my printAll] +

Many thanks for your submission!

+ } + +### provide a default page for the receiver +receiver proc default args { + return { + +

Welcome to the paper provision page

+ In order to fill out the form, press + here + + } +} + +receiver startEventLoop Index: apps/actiweb/MC.xotcl =================================================================== diff -u -N --- apps/actiweb/MC.xotcl (revision 0) +++ apps/actiweb/MC.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,212 @@ +#!../../src/xotclsh +# $Id: MC.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# +# A simple multiple choice test application +# +array set opts {-pkgdir .}; array set opts $argv +lappend auto_path $opts(-pkgdir) + +package require XOTcl; namespace import -force xotcl::* +#package require xotcl::package; package verbose 1 +package require xotcl::actiweb::htmlPlace +package require xotcl::actiweb::pageTemplate + +HtmlPlace ::receiver -port 8092 -allowExit exit + +# Define a pool of questions: Question and their alternatives +# are defined as classes and all questions are stored in the pool +# +Class Pool +Class Pool::Question -parameter {text {altcounter 1}} +Class Pool::Question::Alternative -parameter {text correct} + +Pool::Question instproc alternatives {pairs} { + my instvar altcounter + foreach {alt correct} $pairs { + incr altcounter + [self class]::Alternative [self]::$altcounter \ + -text $alt -correct $correct + } +} + + +# +# An Exam has a name and is a selection of questions from a pool. +# "requiredCorrect" defines the minimal number of correct answers +# to pass the test. + +Class Exam -parameter {name requiredCorrect pool questions} + + +# +# For every candidate we create an individual exam. We scramble +# the questions and alternatives and use the studentID as a seed. +# + +Class IndividualExam -superclass Agent -parameter {ID exam} + +IndividualExam instproc random modulo { ;### random number generator + my instvar seed + set seed [expr {($seed*12731+34197) % 21473}] + return [expr {$seed % $modulo}] +} +IndividualExam instproc permute {list} { ;### permute random permutation + set permuted {} + for {set nr [llength $list]} {$nr>0} {incr nr -1} { + set select [my random $nr] + lappend permuted [lindex $list $select] + set list [lreplace $list $select $select] + } + return $permuted +} +IndividualExam instproc init args { + my instvar seed ID exam individualTest alternatives + set questions [$exam set questions] + set seed $ID + ### compute order of individual tests and alternatives + foreach index [my permute [$exam set questions]] { + set questionObj [$exam set pool]::$index + lappend individualTest $index + set alts [my permute [lsort [$questionObj info children]]] + lappend alternatives $alts + } + #puts stderr "Individual test [self] has $individualTest" +} + +# +# Define a web facade using a page template +# "testObject" is the individual test that is shielded by the web facade +# +Class WebExam -superclass WebObject \ + -instmixin PageTemplateHtml -parameter {testObject} +WebExam instproc default {} { ;### This method creates the HTML Test + my instvar testObject ;### import var that stores shielded test object + ### import vars from the test + $testObject instvar individualTest alternatives exam + set action [my selfAction result] + ### create Test page + set htmlText "\n
    \n" + ### iterate over the set of questions/alternatives + ### and add them to the HTML text + foreach question $individualTest alts $alternatives { + append htmlText "
  1. [[$exam pool]::$question text]\n
      \n" + foreach a $alts { + append htmlText "
    • \ + [$a text] ([$a correct])\n" + } + append htmlText "

    \n" + } + ### we have to add a hidden form field, otherwise we get no result, + ### if nothing is tagged + append htmlText "" + ### the submit button lets us send the result back + append htmlText "

\n" + ### create simple HTML Page + my simplePage [$exam name] \ + "Exam [$exam name] for [string trimleft $testObject :] \ + (Exam: $exam)" $htmlText +} +WebExam instproc result {} { ;# This method analyses the results of the test + my instvar testObject ;### import var that stores shielded test + set exam [$testObject exam] + $testObject instvar individualTest alternatives + foreach question $individualTest alts $alternatives { + foreach a $alts {set ca($a) 0} + } + foreach a [my getFormData] {set ca([$a set content]) 1} + set htmlText "You have answered:
    " + array set answerText {0 " -- answered no\n" 1 " -- answered yes\n"} + array set correctText {0 "\n -- Wrong.
    \n" 1 "\n -- Correct.
    \n"} + set correctAnswers 0 + foreach q $individualTest { + set correct 1 + append htmlText "
  • [[$exam pool]::$q text]:
    \n" + foreach alternative [[$exam pool]::$q info children] { + set altCorrect [expr {$ca($alternative) == [$alternative correct]}] + append htmlText [$alternative text]\n \ + $answerText($ca($alternative)) \ + $correctText($altCorrect) + set correct [expr {$correct && $altCorrect}] + } + if {$correct} {incr correctAnswers} + } + append htmlText
\n + if {$correctAnswers < [$exam requiredCorrect]} { + my simplePage [self] "Sorry" "$htmlText\ + Only $correctAnswers question were answered correctly. You have not succeeded :(" + } else { + my simplePage [self] "Congratulations" "$htmlText\ + $correctAnswers questions were answered correctly. You have succeeded :-)" + } +} +WebExam instproc init args { + next + [my place] exportObjs [self] ;# export object + my exportProcs result ;# export methods +} + + + + + +# Create a Pool P with 6 example questions with 3 alternatives for each. + +Pool p +Pool::Question p::1 \ + -text "When was the first XOTcl Version released?" -alternatives { + "1998" 0 + "1999" 1 + "2000" 0 + } +Pool::Question p::2 -text "Who is author of XOTcl?" -alternatives { + "Gustaf Neumann" 1 + "Mika Haekinnen" 0 + "Uwe Zdun" 1 +} +Pool::Question p::3 -text "Which of the systems are other OO extensions of Tcl?" \ + -alternatives { + "XTCL" 0 + "ITCL" 1 + "OTCL" 1 + } +Pool::Question p::4 \ + -text "Which methods are provided by the Object class?" -alternatives { + "set" 1 + "instvar" 0 + "filter" 1 + } +Pool::Question p::5 \ + -text "Which methods are provided by the Object class?" -alternatives { + "unset" 1 + "instproc" 0 + "mixin" 1 + } +Pool::Question p::6 \ + -text "Which methods are provided by the Class class?" -alternatives { + "proc" 0 + "instproc" 1 + "mixin" 0 + } + +### Define an exam + +Exam xotclTest \ + -pool p \ + -name "XOTcl Test" \ + -questions {1 2 3 4 5} \ + -requiredCorrect 4 + + +### Define two Student tests with the XOTcl Test + +foreach {Student ID} { + Uwe 7850247 + Gustaf 7850248 +} { + ## Define the individual exams + IndividualExam $Student -exam xotclTest -ID $ID + ### Define a web facade for each student + WebExam $Student.html -testObject $Student + +} +receiver startEventLoop Index: apps/actiweb/Receiver.xotcl =================================================================== diff -u -N --- apps/actiweb/Receiver.xotcl (revision 0) +++ apps/actiweb/Receiver.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,22 @@ +#!/usr/bin/env tclsh +#if {![info exists ACTIWEB_HOME]} {source ~/actiweb/paths.xotcl} +package require XOTcl; namespace import -force xotcl::* + +package require xotcl::actiweb::htmlPlace +package require xotcl::actiweb::webDocument + +HtmlPlace receiver -port 8087 + +HtmlDocument hallo.txt -content "************ HALLO *************" +receiver exportObjs hallo.txt +hallo.txt exportProcs content +#hallo.txt attachFile ~/public_html/index.html +Class CloneableClass -superclass {Agent Class} + +FileObjectifier do +do objectifyTree receiver ~/public_html + +#GraphicDirectoryObjectifier gdo +#gdo objectifyTree receiver ~www/bilder/Einweihung/disk1/ + +receiver startEventLoop Index: apps/actiweb/examples.README =================================================================== diff -u -N --- apps/actiweb/examples.README (revision 0) +++ apps/actiweb/examples.README (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,71 @@ +* $Id: examples.README,v 1.1 2004/05/23 22:50:39 neumann Exp $ +* +* This directory contains several simple ActiWeb introductory examples +* + +* +* 4 Variations of the counter theme: +* + +1) Counter.xotcl (22 lines) + + The class counter is a special HtmlDocument that is made active + by adding methods to the document. + + After starting the program, you can call it from your web browser: + http://localhost:8090/counter-1.html + http://localhost:8090/counter-2.html + + +2) Counter2.xotcl (32 lines) + + The Class Counter is a special WebAgent, with a plain/text + interface. Additionally it has an HTML Facade that shields + the sub-system and allows to access the web agent with an + HTML presentation. + + The plain/text interface is: + http://localhost:8091/c1 + http://localhost:8091/c2 + The web facades are: + http://localhost:8091/web-c1 + http://localhost:8091/web-c2 + + +3) Counter3.xotcl (28 lines) + + This example demonstrates how an existing business logic (here: + a small Counter class) can be enhanced with a web representation. + A class WebCounter inherits from Counter and from HtmlDocument. + The two web counter instances are accessible via: + http://localhost:8093/c1 + http://localhost:8093/c2 + + +4) Counter4.xotcl (33 lines) + + The Counter class and a derived persistent counter are + independent of any web usage. Two instances c1 and c2 -- that + are inpendent from the usage as web counters -- are created. + + Two proxy object w1 and w2 handle the HTML decoration and forward + the calls to the persistent counter instances c1/c2 as the real + subjects for handling the calls. Only the proxies are exported, because + c1/c2 can not be reached via the web server. + + Calls: + http://localhost:8094/wc1 + http://localhost:8094/wc2 + +* +* A simple Multiple Choice Test: MC.xotcl +* + + The multiple choice test implements a simple test and evaluation + and a web facade for the test. + + Calls: + http://localhost:8092/Gustaf.html + http://localhost:8092/Uwe.html + + Index: apps/actiweb/securePlaceDemo.xotcl =================================================================== diff -u -N --- apps/actiweb/securePlaceDemo.xotcl (revision 0) +++ apps/actiweb/securePlaceDemo.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,82 @@ + + +package require XOTcl; namespace import -force xotcl::* + +# DEMO OF USE OF ACTIWEB AND SSL +# 03/09/01 klaus.kolowratnik@wu-wien.ac.at +# version 0.806 + +# USAGE: +# +# For secure http connections under Tcl or XOTcl we need the tls-package. +# The following code was tested with tls-version 1.4 successfully. +# Download the tls1.4-package from the TLS-Homepage +# (http://sourceforge.net/projects/tls/) and install the +# tarball (tls1.4.1-linux-x86.tar.gz) in your local filesystem. +# You have to append the path of the tls-package to the +# Tcl-variable "auto_path" as seen in the example below +# +# lappend auto_path $homeDir/tls1.4 $homeDir/projects/actiweb +# +# Don't forget to add the tls-package to your "pkgIndex.tlc"-file! +# +# package ifneeded tls 1.4 "[list load [file join $dir libtls1.4.so] ] ; \ +# [list source [file join $dir tls.tcl]]" +# +# For secure http connections ("http://...") we need at least the Actiweb/XOTcl- +# package "secureHtmlPlace": +# +# package require xotcl::actiweb::secureHtmlPlace +# package require xotcl::actiweb::webDocument +# +# We have to register the private server-keyfile and the certifcates +# of the local server and the certification authority. +# If you want to create own self-signed certificates, you can use the +# "SimpleCA"-Certification Authority (http://users.skynet.be/ballet/joris/SimpleCA). +# +# This example uses the following certificates and key-files: +# +# server.key private key of the local server which is run by this program +# server.pem certificate of the local server which is run by this program +# in PEM-format +# cacert.pem certificate of the certification authority +# +# +# SecureHtmlPlace ::receiver -port 8443 -keyfile server.key \ +# -certfile server.pem -cafile cacert.pem +# +# With this changes a https-server with XOTcl can be run. +# +# 2003/11/19 Klaus.Kolowratnik@wu-wien.ac.at + +set homeDir ~h9252717; # home-directory of Klaus +lappend auto_path $homeDir/packages + +package require xotcl::actiweb::htmlPlace +package require xotcl::actiweb::secureHtmlPlace +package require xotcl::actiweb::webDocument + +#HtmlPlace ::receiver -port 8445 +SecureHtmlPlace ::receiver -port 8445 -keyfile server.key -certfile server.pem -cafile cacert.pem + +HtmlDocument test-1.txt -content "************ TEST-1 *************" +::receiver exportObjs test-1.txt +test-1.txt exportProcs content +#test-1.txt attachFile ~/public_html/index.html + +HtmlDocument test-2.txt -content "************ TEST-2 *************" +::receiver exportObjs test-2.txt +test-2.txt exportProcs content + +set readme "This Web-Server uses XOTcl (www.xotcl.org) and Actiweb" +HtmlDocument readme.txt -content $readme +::receiver exportObjs readme.txt +readme.txt exportProcs content + +FileObjectifier do +do objectifyTree ::receiver ~/public_html + +#GraphicDirectoryObjectifier gdo +#gdo objectifyTree ::receiver ~www/bilder/Einweihung/disk1/ + +::receiver startEventLoop Index: apps/actiweb/univ/UNIVERSAL.css =================================================================== diff -u -N --- apps/actiweb/univ/UNIVERSAL.css (revision 0) +++ apps/actiweb/univ/UNIVERSAL.css (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,21 @@ +A {color: yellow; } +A:selected {color: red; } +A:visited {color: #6699FF; } + +BODY {background-color: #000066; color: #FFFFFF; margin-left: 10; shading: no;} + +B.outer { background-color: #000066; color: #FFFFFF; } +B.inner,TD { background-color: #110088; color: #FFFFFF; } + +H1,H2 {font-family:Helvetica,sans-serif; text-align:center; } +H3 {font-family:Helvetica,sans-serif; color: #FFFFFF;} +HR {align:center; shading:no;} +LI,UL,OL {font-family:Helvetica,sans-serif; } + +TABLE {shading: no; border-style: solid; border-color: solid red; background-color: #110088;} + + +TH {font-family:Helvetica,sans-serif;} +DT {font-family:Helvetica,sans-serif; font-weight:bold;} + + Index: apps/actiweb/univ/UNIVERSAL.jpg =================================================================== diff -u -N Binary files differ Index: apps/actiweb/univ/UNIVERSAL.rdf =================================================================== diff -u -N --- apps/actiweb/univ/UNIVERSAL.rdf (revision 0) +++ apps/actiweb/univ/UNIVERSAL.rdf (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,204 @@ + + + + Object Oriented Design and System Development + + Introduction to the concepts of object-oriented programing ... + + Course + WUW-WI-0012346 + + + object-oriented design + software architecture + + + de + application/pdf + 56000 + http://nm.wu-wien.ac.at/Lehre/oo1/01-handout.pdf + Student + 2 to 4 days + University Second Cycle + Lecture + + Author + Prof. Gustaf Neumann + 01.12.1999 + + 1.0 + -- + 2 + en + + Discipline + Information Systems + + + + + Introduction in the programming language object rexx + + This lecture offers an introduction of the programming language 'object rexx'. + + Course + WUW-WI-0011344 + + + rexx + UML + CORBA + + + de + text/html + 0 + http://wwwi.wu-wien.ac.at/Studium/Abschnitt_2/LVA_allgemein/rexx.html + Student + 3 weeks + University First Cycle + Lecture + + Author + Prof.H. Werthner + 01.11.1999 + + 1.0 + -- + 2 + en + + Discipline + Information Systems + + + + + Object Oriented Development of Web-Based Applications + + This lecture offers the basic knowledge about the Internet and + Internet Protocols from an applied point of view. Half of the + lectures present the theoretical background knowledge, and the other + half exercises this knowledge with practical examples.... + + Course + WUW-WI-0012345 + + + TCP/IP + Web Technolgy + Application Server + Agent Systems + XML + RDF + + + de + application/pdf + 14000 + http://nm.wu-wien.ac.at/Lehre/oo2/01-handout.pdf + Student + 2 to 4 days + University Second Cycle + Lecture + + Author + Prof. Gustaf Neumann + 01.01.2000 + + 1.0 + -- + 2 + en + + Discipline + Information Systems + + + + + Legal aspects of information processing + + Introduction of the occuring legal problems in context of the use of information systems + + Course + WUW-WI-0036589 + + + information systems + legal aspects + data processing + + + de + text/html + 0 + http://wwwi.wu-wien.ac.at/Studium/Abschnitt_2/Wahlfach/recht_vo.html + Student + 1 month + University Second Cycle + Lecture + + Author + Dr. Walter Blocher + 01.01.1999 + + 2.1 + -- + 2 + en + + Discipline + Information Systems + + + + + Electronic cash, payment systems and security + + Introduction to electronic cash systems + + Course + WUW-WI-00352228 + + + electronic cash + security + electronic market place + + + de + application/zip + 230000 + http://wwwi.wu-wien.ac.at/finanz/elekgeld.zip + Student + 6 weeks + University Second Cycle + Lecture + + Author + Prof. G. M�ller + 01.01.1998 + + 2.1 + -- + 2 + en + + Discipline + Information Systems + + + + + + Index: apps/actiweb/univ/UNIVERSAL.xotcl =================================================================== diff -u -N --- apps/actiweb/univ/UNIVERSAL.xotcl (revision 0) +++ apps/actiweb/univ/UNIVERSAL.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,267 @@ +#!/usr/bin/env tclsh +#$Id: UNIVERSAL.xotcl,v 1.8 2007/08/14 16:38:26 neumann Exp $ +package require XOTcl; namespace import -force xotcl::* +array set opts { + -ssl 0 -instanceFile UNIVERSAL.rdf -cssFile UNIVERSAL.css -root . -pkgdir .} +array set opts $argv + +@ @File { + description { + This is a demo of a Webserver that presents the contents of + an RDF source file in a friendly and easy readable manner. +

+ The RDF file is parsed first into triples which + are added to the resource database RDFdb. This RDFdb used in this + example replaces the standard triple database of xoRDF by an + application specific version, which is easier to process. The triple + database is the source of the Catalog, which displays a short, easy to read + summary of the entries. The database is used as well for the "detailed + view", which presents all the data of the triples through nested HTML tables. +

+ The demo program uses either HTTP or HTTPS (in which case you will require + the SSL/TLS extension of Tcl). + } +} + +lappend auto_path $opts(-pkgdir) +if {$opts(-ssl)} { + package require xotcl::actiweb::secureHtmlPlace + SecureHtmlPlace ::receiver -port 443 -root $opts(-root) +} else { + package require xotcl::actiweb::htmlPlace + HtmlPlace ::receiver -port 8095 -root $opts(-root) -allowExit exit +} +package require xotcl::actiweb::webDocument + +# load RDF processing components +package require xotcl::rdf::parser +package require xotcl::rdf::triple +package require xotcl::xml::printVisitor + +proc loadFile filename { + set F [open $filename r]; set c [read $F]; close $F + return $c +} +# +# instantiate parser and parser an example text into a node tree +# + +#puts stderr "parsing [loadFile $opts(-instanceFile)]" +RDFParser R +R parse [loadFile $opts(-instanceFile)] +puts stderr "parsing done" + +# +# load the nodetree from the parser into the triple database +# +#section Triples +TripleVisitor tv -parser R +tv proc interprete {} { + my instvar topNode parser + if {![my exists topNode]} {set topNode ${parser}::topNode1} + my reset + my interpretNodeTree $topNode +} + +#### Define a simple Resource Database +Class RDFdb -superclass RDFTripleDB +RDFdb instproc isContainer c { + regexp ^[self]::rdfdoc\# $c +} +RDFdb instproc add {predicate subject object} { + set s [self]::$subject + if {[my info children $s] eq ""} { + #puts stderr "create new resource $s" + Resource create $s + } + $s set $predicate $object + next ;# for passing to RDFTripleDB (which provides e.g. prettyTriples) +} +RDFdb instproc reset {} { + foreach c [my info children] { $c destroy } + next +} +RDFdb instproc resources {} { + set result "" + foreach c [my info children] { + if {![my isContainer $c] && + [$c istype Resource]} {lappend result $c} + } + return $result +} +RDFdb instproc querySubject {subject} { + set s [self]::$subject + set result "" + if {[my info children $s] ne ""} { + foreach att [lsort [$s info vars]] { + lappend result $att [$s set $att] + } + } + return $result +} + +# create an Instance of the Resource Database +RDFdb tv::db + + + +# define Resources with its methods +Class Resource +Resource instproc dump {} { + foreach att [lsort [my info vars]] { puts stderr "\t$att = [my set $att]" } +} +Resource instproc substitute {lines} { + set result "" + foreach line [split $lines \n] { + if {[regexp {^ *http:} $line]} { + set value "" + set o [self] + set line [string trim $line] + foreach step $line { + set value [$o set $step] + set o tv::db::$value + } + append result $value + } else { + append result $line + } + } + return $result +} + +Resource instproc pretty {} { + set q [univ selfAction "details [namespace tail [self]]"] + my substitute " + http://nm.wu-wien.ac.at/universal/rdf-lifecycle#Contribute \ + http://nm.wu-wien.ac.at/universal/rdf-lifecycle#Entity +: + http://nm.wu-wien.ac.at/universal/rdf-general#Title +, + http://nm.wu-wien.ac.at/universal/rdf-education#LearningResourceType +, + http://nm.wu-wien.ac.at/universal/rdf-education#TypicalLearningTime +, + http://nm.wu-wien.ac.at/universal/rdf-lifecycle#Contribute \ + http://nm.wu-wien.ac.at/universal/rdf-lifecycle#Date + ([my pretty-access])" +} +Resource instproc pretty-title {} { + my substitute "http://nm.wu-wien.ac.at/universal/rdf-general#Title" +} +Resource instproc pretty-access {} { + set tech http://nm.wu-wien.ac.at/universal/rdf-technical + set format [my substitute "$tech#Format"] + set location [my substitute "$tech#Location"] + if {$format eq "text/html"} { + set label "go" } else { + set label "Download [my substitute $tech#Size] bytes" + } + return "$label" +} + + + +### Definition of the Learning Resource Manager: +Class LrManager -superclass WebDocument -parameter { + {defaultUrl http://nm.wu-wien.ac.at/Lehre/oo2/} +} +LrManager instproc html-title {t} { + my contentType text/html + return "$t\n\n" +} +LrManager instproc html-head {t} { + return "

$t

\n" +} + +LrManager instproc details {subject} { + set result [my html-title "Details about a Learning Resource"] + append result [my html-head "Details about the Learning Resource
'[::tv::db::$subject pretty-title]'"] + #append result "The subject: '$subject' has the following properties:

\n" + append result [my attributeTable $subject outer] "" +} + +LrManager instproc attributeTable {subject cls} { + set result "" + set lastns "" + foreach {attr value} [tv::db querySubject $subject] { + if {[tv::db isContainer $value]} { + #set q [univ selfAction "details $value"]; set value "$value" + set value [my attributeTable $value inner] + } + regexp {^(.*)\#(.*)$} $attr _ ns property + if {$ns != $lastns} { + if {$lastns ne ""} { append result

\n } + append result "Attributes from namespace $ns:\n\n" + set lastns $ns + } + append result \ + "" \ + "" \n + } + append result "
$property$value
\n" +} + + +LrManager instproc catalog {} { + set result [my html-title "Universal Resources"] + append result [my html-head "Local Learning Resources:"]

    \n + foreach r [lsort [tv::db resources]] { + append result "
  • [$r pretty]

  • \n" + } + return $result
+} + +LrManager instproc source {file} { + my contentType text/plain + return [loadFile $file] +} + +LrManager instproc nav {} { + set right [my selfAction "catalog"] + set result [my html-title "Universal Navigation Bar"] + set rdfsrc [my selfAction "source $::opts(-instanceFile)"] + set csssrc [my selfAction "source $::opts(-root)/$::opts(-cssFile)"] + set src [my selfAction "source [info script]"] + append result \n \ + "UNIVERSAL HOME \n\ +

All local Resources

+

Search for Title

+

Search for Authors

+
Internal Use only: +

XML:RDF Source

+

CSS Source

+

Source of Meta-Data Application Server

" +} + +LrManager instproc default {} { + set right [my selfAction "catalog"] + set nav [my selfAction "nav"] + set result [my html-title "Universal"] + append result " + + + + <body>\n\<h2>Query UNIVERSAL database for Resource:</h2>\n\ + +" +} + +LrManager instproc init args { + next + ::receiver exportObjs [self] ;# export object + my exportProcs details catalog nav source ;# export methods +} + + +# create an instance of the Learning Resource manager +LrManager univ +receiver proc default {} {univ default} ;# call it like index.html as default + +# Invoke Tiple Visitor to feed the database +tv interprete +#puts stderr [tv::db prettyTriples] + + +receiver startEventLoop ;# Start event loop + Index: apps/actiweb/univ/server.key =================================================================== diff -u -N --- apps/actiweb/univ/server.key (revision 0) +++ apps/actiweb/univ/server.key (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDVg+HdA4RAKyYRaxKRSdAw7mQpephZslIf/ZR7Oe3RKZjxu7Sj +PYG56GSc8y6hiaKuGnDmJcEGXZCXWNtUuACVsNlFrlVbGSEfAbXbz6H4eaaX2d2P +KzrjOc//8+5emaFZRelVTYY4sWNLcCuWV2FIhwMJMblYieXM6iEQg4XzdQIDAQAB +AoGAVdY2OC8QvOdb34bHKSeejf1YwSArHWxF/dxpE/0e8YaimRQYM8QnYgDeagaN +yZ1WjF3O44dsCU4WMfIkAvQSL19RLSgT+jPb3Uu9Aotwmg4x+55BKctRphXKiIfu ++a0IfAFDIt8FMRS08AoSB6eBgOBlhTZM2Y0IuC6QTqaBcwUCQQD5XSiEzh44uMOl +N4FbO0MI2NC3pbPg5u1fEJtIawoYOYxbeGHrlOYO2ZN3ZP6+2g5V0kX5tMMeObhE +qQLlmNETAkEA2zJ/Tk3IE5ByEBcGjG26nJ1zLlY13NaiIg+AoSP+7rHg5TPhoQp1 +VVwcqd4ZWCyqgYDFl2TsiiZwKcEIFJBCVwJBANoLpZSLD04V8a2UXV5C8ZjYzZjo +IeP0yXco9D9cqZUJLTwGhckTiB9QDWyHOWH1FjfhCCMS9tKFMiWHi+rrt1UCQQDC +rlvxURX1gmI8NicjzEVk2la1fe5C4QKJW9lzxUOj/qpvB6BK5r4FfVUb7d32uV0K +vjNAXmvT24XdH8usb9/rAkBR1sqUkqwwm0CSe0Rz9IhSlkwWlmvEzSmEguqrd7Zb +rbYJ9NTnV1uFSAX9vcU7lDRp69il6XmyhOL06FYLRaNa +-----END RSA PRIVATE KEY----- Index: apps/actiweb/univ/server.pem =================================================================== diff -u -N --- apps/actiweb/univ/server.pem (revision 0) +++ apps/actiweb/univ/server.pem (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,66 @@ +issuer :/C=DE/ST=NRW/L=Essen/O=University of Essen/OU=SWT/CN=Fredj Dridi/Email=Fredj.Dridi@uni-essen.de +subject:/C=DE/ST=NRW/L=Essen/O=University of Essen/OU=SWT/CN=tp600e.wi-inf.uni-essen.de/Email=dridi@tp600e.wi-inf.uni-essen.de +serial :01 + +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: md5WithRSAEncryption + Issuer: C=DE, ST=NRW, L=Essen, O=University of Essen, OU=SWT, CN=Fredj Dridi/Email=Fredj.Dridi@uni-essen.de + Validity + Not Before: Apr 28 08:21:19 2000 GMT + Not After : Apr 28 08:21:19 2001 GMT + Subject: C=DE, ST=NRW, L=Essen, O=University of Essen, OU=SWT, CN=tp600e.wi-inf.uni-essen.de/Email=dridi@tp600e.wi-inf.uni-essen.de + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:d5:83:e1:dd:03:84:40:2b:26:11:6b:12:91:49: + d0:30:ee:64:29:7a:98:59:b2:52:1f:fd:94:7b:39: + ed:d1:29:98:f1:bb:b4:a3:3d:81:b9:e8:64:9c:f3: + 2e:a1:89:a2:ae:1a:70:e6:25:c1:06:5d:90:97:58: + db:54:b8:00:95:b0:d9:45:ae:55:5b:19:21:1f:01: + b5:db:cf:a1:f8:79:a6:97:d9:dd:8f:2b:3a:e3:39: + cf:ff:f3:ee:5e:99:a1:59:45:e9:55:4d:86:38:b1: + 63:4b:70:2b:96:57:61:48:87:03:09:31:b9:58:89: + e5:cc:ea:21:10:83:85:f3:75 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Authority Key Identifier: + keyid:D2:B8:E3:2D:A2:5A:22:78:3A:38:F1:1F:F5:7C:AD:8D:A6:C4:41:0F + + X509v3 Extended Key Usage: + TLS Web Server Authentication, TLS Web Client Authentication, Microsoft Server Gated Crypto, Netscape Server Gated Crypto + X509v3 Basic Constraints: critical + CA:FALSE + Signature Algorithm: md5WithRSAEncryption + 38:b5:a1:1c:93:c4:aa:6e:3f:d6:ea:11:7f:7b:2b:11:db:7b: + 22:b3:d2:a8:b3:f3:20:64:6a:25:b4:fe:0d:ac:12:49:a0:6e: + 6d:ef:fb:99:a2:7c:bc:50:b0:eb:42:ef:0a:32:fa:a9:69:e0: + 11:10:9b:00:05:15:97:59:ac:dc:5f:f2:cd:81:28:3e:e6:96: + 86:f4:d7:99:71:52:c3:ca:0f:4a:48:d8:66:b0:da:e8:d1:45: + 84:c4:12:b2:43:ec:63:b6:25:e8:0a:5a:4c:fb:e2:ec:03:36: + 6f:cd:f9:2a:5c:52:ba:02:29:92:f5:bf:c4:96:ff:9e:ed:a3: + cf:02 + +-----BEGIN CERTIFICATE----- +MIIDIjCCAougAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCREUx +DDAKBgNVBAgTA05SVzEOMAwGA1UEBxMFRXNzZW4xHDAaBgNVBAoTE1VuaXZlcnNp +dHkgb2YgRXNzZW4xDDAKBgNVBAsTA1NXVDEUMBIGA1UEAxMLRnJlZGogRHJpZGkx +JzAlBgkqhkiG9w0BCQEWGEZyZWRqLkRyaWRpQHVuaS1lc3Nlbi5kZTAeFw0wMDA0 +MjgwODIxMTlaFw0wMTA0MjgwODIxMTlaMIGtMQswCQYDVQQGEwJERTEMMAoGA1UE +CBMDTlJXMQ4wDAYDVQQHEwVFc3NlbjEcMBoGA1UEChMTVW5pdmVyc2l0eSBvZiBF +c3NlbjEMMAoGA1UECxMDU1dUMSMwIQYDVQQDExp0cDYwMGUud2ktaW5mLnVuaS1l +c3Nlbi5kZTEvMC0GCSqGSIb3DQEJARYgZHJpZGlAdHA2MDBlLndpLWluZi51bmkt +ZXNzZW4uZGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANWD4d0DhEArJhFr +EpFJ0DDuZCl6mFmyUh/9lHs57dEpmPG7tKM9gbnoZJzzLqGJoq4acOYlwQZdkJdY +21S4AJWw2UWuVVsZIR8BtdvPofh5ppfZ3Y8rOuM5z//z7l6ZoVlF6VVNhjixY0tw +K5ZXYUiHAwkxuViJ5czqIRCDhfN1AgMBAAGjZzBlMB8GA1UdIwQYMBaAFNK44y2i +WiJ4OjjxH/V8rY2mxEEPMDQGA1UdJQQtMCsGCCsGAQUFBwMBBggrBgEFBQcDAgYK +KwYBBAGCNwoDAwYJYIZIAYb4QgQBMAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQEE +BQADgYEAOLWhHJPEqm4/1uoRf3srEdt7IrPSqLPzIGRqJbT+DawSSaBube/7maJ8 +vFCw60LvCjL6qWngERCbAAUVl1ms3F/yzYEoPuaWhvTXmXFSw8oPSkjYZrDa6NFF +hMQSskPsY7Yl6ApaTPvi7AM2b835KlxSugIpkvW/xJb/nu2jzwI= +-----END CERTIFICATE----- + Index: apps/comm/client.pem =================================================================== diff -u -N --- apps/comm/client.pem (revision 0) +++ apps/comm/client.pem (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,66 @@ +issuer :/C=DE/ST=NRW/L=Essen/O=University of Essen/OU=SWT/CN=Fredj Dridi/Email=Fredj.Dridi@uni-essen.de +subject:/CN=Fredj Dridi/Email=fredj_dridi@yahoo.com +serial :02 + +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 2 (0x2) + Signature Algorithm: md5WithRSAEncryption + Issuer: C=DE, ST=NRW, L=Essen, O=University of Essen, OU=SWT, CN=Fredj Dridi/Email=Fredj.Dridi@uni-essen.de + Validity + Not Before: Apr 28 08:24:43 2000 GMT + Not After : Apr 28 08:24:43 2001 GMT + Subject: CN=Fredj Dridi/Email=fredj_dridi@yahoo.com + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:e4:df:a7:f3:ed:61:df:30:ad:d9:6f:63:f2:d1: + 85:9b:72:b2:c6:e4:fd:50:11:c5:0a:29:59:02:60: + 29:f6:2c:6a:35:08:89:49:ad:d4:44:1d:7f:14:18: + 61:4d:e8:66:87:30:01:52:cd:7d:16:72:0e:24:38: + 19:a5:a7:dc:cf:7a:5d:79:ea:48:c6:c4:ae:52:a6: + 94:36:7f:f3:24:43:b0:21:5a:f2:d5:6d:66:38:4c: + b7:7a:0e:ce:12:01:b0:46:4b:ea:08:b4:e0:aa:b8: + 96:dc:3e:15:e0:24:92:84:1f:77:d0:8d:73:d2:f3: + ac:82:b0:61:60:1a:6a:fc:b9 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Alternative Name: + email:fredj_dridi@yahoo.com + X509v3 Basic Constraints: critical + CA:FALSE + X509v3 Authority Key Identifier: + keyid:D2:B8:E3:2D:A2:5A:22:78:3A:38:F1:1F:F5:7C:AD:8D:A6:C4:41:0F + + X509v3 Extended Key Usage: + TLS Web Client Authentication, E-mail Protection + Signature Algorithm: md5WithRSAEncryption + 01:88:26:35:b9:c7:c9:5a:90:ff:b8:9c:37:fa:48:0e:03:82: + b4:18:df:49:e7:5d:42:3a:48:e3:e4:84:c7:b6:ef:cc:91:4c: + 47:9d:34:f9:51:0b:63:d0:35:f9:ad:a5:a9:3d:ef:75:23:0c: + 14:77:59:79:59:58:c8:74:df:01:b8:de:f2:78:47:64:1a:7e: + 4b:09:31:5e:f5:34:e2:ad:5e:e8:81:00:f1:af:fe:48:31:0b: + a9:b1:4d:53:51:9a:15:1f:55:ba:30:e4:0e:02:05:20:4b:de: + 9c:d9:86:f1:e4:d9:18:c4:93:03:19:06:a5:f3:cb:2a:28:a0: + fd:de + +-----BEGIN CERTIFICATE----- +MIICuzCCAiSgAwIBAgIBAjANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCREUx +DDAKBgNVBAgTA05SVzEOMAwGA1UEBxMFRXNzZW4xHDAaBgNVBAoTE1VuaXZlcnNp +dHkgb2YgRXNzZW4xDDAKBgNVBAsTA1NXVDEUMBIGA1UEAxMLRnJlZGogRHJpZGkx +JzAlBgkqhkiG9w0BCQEWGEZyZWRqLkRyaWRpQHVuaS1lc3Nlbi5kZTAeFw0wMDA0 +MjgwODI0NDNaFw0wMTA0MjgwODI0NDNaMDwxFDASBgNVBAMTC0ZyZWRqIERyaWRp +MSQwIgYJKoZIhvcNAQkBFhVmcmVkal9kcmlkaUB5YWhvby5jb20wgZ8wDQYJKoZI +hvcNAQEBBQADgY0AMIGJAoGBAOTfp/PtYd8wrdlvY/LRhZtyssbk/VARxQopWQJg +KfYsajUIiUmt1EQdfxQYYU3oZocwAVLNfRZyDiQ4GaWn3M96XXnqSMbErlKmlDZ/ +8yRDsCFa8tVtZjhMt3oOzhIBsEZL6gi04Kq4ltw+FeAkkoQfd9CNc9LzrIKwYWAa +avy5AgMBAAGjcjBwMCAGA1UdEQQZMBeBFWZyZWRqX2RyaWRpQHlhaG9vLmNvbTAM +BgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFNK44y2iWiJ4OjjxH/V8rY2mxEEPMB0G +A1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDANBgkqhkiG9w0BAQQFAAOBgQAB +iCY1ucfJWpD/uJw3+kgOA4K0GN9J511COkjj5ITHtu/MkUxHnTT5UQtj0DX5raWp +Pe91IwwUd1l5WVjIdN8BuN7yeEdkGn5LCTFe9TTirV7ogQDxr/5IMQupsU1TUZoV +H1W6MOQOAgUgS96c2Ybx5NkYxJMDGQal88sqKKD93g== +-----END CERTIFICATE----- + Index: apps/comm/filename.crt =================================================================== diff -u -N --- apps/comm/filename.crt (revision 0) +++ apps/comm/filename.crt (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDmDCCAwGgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBlTELMAkGA1UEBhMCYXQx +EDAOBgNVBAgTB0F1c3RyaWExDzANBgNVBAcTBlZpZW5uYTEQMA4GA1UEChMHV1Ut +V2llbjELMAkGA1UECxMCV0kxHjAcBgNVBAMTFW1vaGVnYW4ud3Utd2llbi5hYy5h +dDEkMCIGCSqGSIb3DQEJARYVbmV1bWFubkB3dS13aWVuLmFjLmF0MB4XDTAyMDQw +MjEwNDUwN1oXDTAyMDUwMjEwNDUwN1owgZUxCzAJBgNVBAYTAmF0MRAwDgYDVQQI +EwdBdXN0cmlhMQ8wDQYDVQQHEwZWaWVubmExEDAOBgNVBAoTB1dVLVdpZW4xCzAJ +BgNVBAsTAldJMR4wHAYDVQQDExVtb2hlZ2FuLnd1LXdpZW4uYWMuYXQxJDAiBgkq +hkiG9w0BCQEWFW5ldW1hbm5Ad3Utd2llbi5hYy5hdDCBnzANBgkqhkiG9w0BAQEF +AAOBjQAwgYkCgYEA5iT1aT1zU5mfqabGQWcdLyGVFlJBuiKnD2wCVDBIJFVYk6EJ +FrFadKgUXNa0Sxrav/5BJyG2ObOrS4BH6yAl8f90QbAokFp9HeW5wkkAhjkSe1Rw +vcts9F+R6OhcBxO+tQ6maR9wIGfWoK+vWDyfO7wnHjiL2YZFW73mDBUuHO8CAwEA +AaOB9TCB8jAdBgNVHQ4EFgQUbnmEzLNHBNqySdNmPzLSf+yjEc8wgcIGA1UdIwSB +ujCBt4AUbnmEzLNHBNqySdNmPzLSf+yjEc+hgZukgZgwgZUxCzAJBgNVBAYTAmF0 +MRAwDgYDVQQIEwdBdXN0cmlhMQ8wDQYDVQQHEwZWaWVubmExEDAOBgNVBAoTB1dV +LVdpZW4xCzAJBgNVBAsTAldJMR4wHAYDVQQDExVtb2hlZ2FuLnd1LXdpZW4uYWMu +YXQxJDAiBgkqhkiG9w0BCQEWFW5ldW1hbm5Ad3Utd2llbi5hYy5hdIIBADAMBgNV +HRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4GBANj6u54TmwEJg/Ldvfx+Qrax+66n +zh1EYzxrlYp6eNQVPEyOsF1DJh150Lci1Mm/i71D87yJRVjagTv5dAUdupy9Zf6c +AMMv6KvK5G7q6LC9ArwNiBObsmQUlN7+PzRmG9CerRJ6W8eEYnYB0EHhYVKc8cED +F4mixcF1HGQJI/qN +-----END CERTIFICATE----- Index: apps/comm/filename.key =================================================================== diff -u -N --- apps/comm/filename.key (revision 0) +++ apps/comm/filename.key (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,075071A5AF5C1D8A + +qmihZRxmNNlGCx9lVC4QQPQS25e4aAg3oHjxDaZ0yyDSKsWz4J04lo2x63QT/88i +z9YUQqyC8ry53D5y3aQKiFuXlDDvX6PtPS+cQANA8g5qOIHsMF3yINfrVEmWkPjx +xOYF2qIGI0ISPTT5AkTN3KVmYE7rbFvqgQMklj/SlNBqeUmKvn1rhUCFAd0jYXa9 +imaKVMj08q4GItLAqPoJNY4K73IHZeaW8GEWAJ5E/KEzYFBnYUiPUN8UPCCQsC+b +ViRF226hCFSu8yDBah8R/u6W9rEa+Vs/T7Cyklnot2FDyCU0EW/lhKBKfEKTmXAe +sBzN7F1hrLFifUD7VzJ2K7zKh7pMy3X+D+0PUjVaIyZWDIH3nOiTzfK6kxksjoE5 +P+fp5IL4okEJgD6MoLJHGWTwfhH9K6QBX01My3s22q5zuiJ3SajRCFlLDn7jTTPV +2OQ9+2FksxJYa5Z5/n63Vslz0+yKv9AVTbrtfrbbRJtmpbElCPrvhzVsuWksRS3A +biZxD5PkWiYDvNm34eOAOARb7n0awTOZ1bqdccT+rhcvo7c+MypIY0/AfZKZK4hN +bWxHR3wZUv+wffx1CBxvsBBomV8XqcqJliVHgdvwDdzl3Z2HbYK3w92RXNY36FYw +C1iqALuxE9nhzyEv0ARfjcXTu0lUmFZOfi4oizzMVj7u2q4mGt0+ZuKBs/fTEEm1 +3L1nLnalGb5ko5OTZ4DMQlP1HCU3UZslImAcc3FFa/WNzhG07/YAlcTS18YUbJYF +19Yx6qrYfrZA2UZq0+8DFa8XgOHCFO0KqQHRfRB/7tGNGxX5md8+9w== +-----END RSA PRIVATE KEY----- Index: apps/comm/ftp.xotcl =================================================================== diff -u -N --- apps/comm/ftp.xotcl (revision 0) +++ apps/comm/ftp.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,12 @@ +#!/usr/bin/env tclsh +package require XOTcl; namespace import -force xotcl::* + +@ @File {description { A tiny FTP client }} + +package require xotcl::comm::ftp + +SimpleRequest r1 -url ftp://prep.ai.mit.edu/README +if {[r1 success]} { + puts "Got:" + puts [r1 getContent] +} Index: apps/comm/get-regression-nb.xotcl =================================================================== diff -u -N --- apps/comm/get-regression-nb.xotcl (revision 0) +++ apps/comm/get-regression-nb.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,419 @@ +#!/usr/bin/env tclsh +package require XOTcl; namespace import -force xotcl::* + +# ./get-regression-nb.xotcl -host swt -parallel 0 +# ./get-regression-nb.xotcl -host swt -sequential 0 +# +# mit ~/wafe/src/cineast/webserver.xotcl (benotigt ~/wafe/test/*) +# ./get-regression-nb.xotcl -port 8086 +# +# Vergleich webserver.xotcl mit Apache: +# 1) installation von Apache auf port 80 +# +# 2) installation vom webserver.xotcl auf port 8086 +# +# 3) von beiden server sollend die files in wafe/test/* unter +# http://SERVER+PORT/test/* +# erreichbar sein. +# +# 4) test der installation +# apache: +# cd wafe/src/cineast +# get-regression-nb.xotcl -sequential 0 +# die ausgabe sollte mit totalbytes=6536120 +# abgeschlossen werden +# +# webserver.xotcl: +# cd wafe/src/cineast +# get-regression-nb.xotcl -port 8086 -sequential 0 +# die ausgabe sollte mit totalbytes=6536120 +# abgeschlossen werden +# +# 5) grosser testlauf: +# rsh muss funktionieren: z.B.: rsh localhost date +# +# apache: +# cd wafe/src/cineast +# time get-regression-nb.xotcl -sequential 0 -clients 1 +# +# webserver.xotcl: +# cd wafe/src/cineast +# time get-regression-nb.xotcl -port 8086 -sequential 0 -clients 1 +# +# Ergebnisse auf meinem Rechner: +# +# der xotcl-webserver ist etwa 20% langsamer als apache. +# das logging (instproc log) aktivieren kostet ein paar weitere prozent.... +# -gn +# +# mohegan:~/wafe/src/cineast> time ./get-regression-nb.xotcl -port 8086 -sequential 0 -clients 1 +# Loading source file ~/wafe/src/cineast/Access.xotcl +# Loading source file ~/wafe/src/cineast/PCache.xotcl +# Loading source file ~/wafe/src/cineast/Connection.xotcl +# Loading source file ~/wafe/src/cineast/trace.xotcl +# 1 clients: 3.07 seconds (per client 3.07 seconds, 2127.31 KB/sec) server: 2127.31 KB/sec +# 2 clients: 6.36 seconds (per client 3.18 seconds, 1028.10 KB/sec) server: 2056.20 KB/sec +# 3 clients: 7.71 seconds (per client 2.57 seconds, 847.74 KB/sec) server: 2543.22 KB/sec +# 4 clients: 11.21 seconds (per client 2.80 seconds, 582.92 KB/sec) server: 2331.66 KB/sec +# 5 clients: 10.57 seconds (per client 2.11 seconds, 618.49 KB/sec) server: 3092.45 KB/sec +# 10 clients: 25.07 seconds (per client 2.51 seconds, 260.68 KB/sec) server: 2606.79 KB/sec +# 20 clients: 45.48 seconds (per client 2.27 seconds, 143.73 KB/sec) server: 2874.58 KB/sec +#0.420u 0.450s 1:49.65 0.7% 0+0k 0+0io 113263310pf+0w +# +# +# +# mohegan:~/wafe/src/cineast> time ./get-regression-nb.xotcl -port 80 -sequential 0 -clients 1 +# Loading source file ~/wafe/src/cineast/Access.xotcl +# Loading source file ~/wafe/src/cineast/PCache.xotcl +# Loading source file ~/wafe/src/cineast/Connection.xotcl +# Loading source file ~/wafe/src/cineast/trace.xotcl +# 1 clients: 1.85 seconds (per client 1.85 seconds, 3542.58 KB/sec) server: 3542.58 KB/sec +# 2 clients: 4.71 seconds (per client 2.36 seconds, 1387.02 KB/sec) server: 2774.03 KB/sec +# 3 clients: 4.09 seconds (per client 1.36 seconds, 1596.58 KB/sec) server: 4789.74 KB/sec +# 4 clients: 7.74 seconds (per client 1.94 seconds, 844.43 KB/sec) server: 3377.71 KB/sec +# 5 clients: 9.46 seconds (per client 1.89 seconds, 690.67 KB/sec) server: 3453.33 KB/sec +# 10 clients: 20.91 seconds (per client 2.09 seconds, 312.52 KB/sec) server: 3125.24 KB/sec +# 20 clients: 39.01 seconds (per client 1.95 seconds, 167.55 KB/sec) server: 3351.08 KB/sec +#0.410u 0.360s 1:27.95 0.8% 0+0k 0+0io 112251994pf+0w +# +# + +set CACHE_DIR [::xotcl::tmpdir] + +package require xotcl::comm::httpAccess +package require xotcl::trace + +set port "" +set host localhost +set cachingopts {0 1 2 2} +set parallel 1 +set sequential 0 +set clients 0 +set local 1 + +foreach {att val} $argv { + switch -exact -- $att { + -port {set port $val} + -host {set host $val} + -memory {set cachingopts 0} + -parallel {set parallel $val} + -sequential {set sequential $val} + -clients {set clients $val} + -local {set local $val} + } +} + +set hosts { + R2H2-11 R2H2-12 R2H2-13 R2H2-21 R2H2-22 R2H2-23 R2H2-31 R2H2-32 + R2H2-33 R2H2-41 R2H2-42 R2H2-43 R2H2-51 R2H2-52 R2H2-53 R2H2-61 + R2H2-62 R2H2-63 R2H2-73 + matush nashawag sagumumpsketuck wawog willimantic wonkituck mashipaug + watuppa +} +#set hosts { +# matush nashawag sagumumpsketuck wawog willimantic wonkituck mashipaug +# R2H2-11 R2H2-12 R2H2-13 R2H2-21 R2H2-22 R2H2-23 R2H2-31 R2H2-32 +# R2H2-33 R2H2-41 R2H2-42 R2H2-43 R2H2-51 R2H2-52 R2H2-53 R2H2-61 +# R2H2-62 R2H2-63 R2H2-73 +# watuppa +#} +set totalbytes 6536120 +set totalbytes 1293240;# ohne 5m request + + +if {$clients} { + proc readable {handle rhost} { + if {[eof $handle]} { + incr ::running -1 + if {[catch {close $handle} output]} { + if {![string match *$::totalbytes $output]} { + puts stderr "invalid output on client on host $rhost" + puts stderr "***********************************" + puts stderr $output + puts stderr "***********************************" + } + } + #puts stderr clients=$::running + if {$::running == 0} { + set ::xxx 1 + } + } else { + gets $handle + } + } + proc clients {clients} { + append cmd "[pwd]/$::argv0 -host $::host " \ + "-parallel $::parallel -sequential $::sequential" + if {$::port ne ""} {append cmd " -port $::port"} + set starttime [clock clicks] + set ::running $clients + for {set s 0} {$s < $clients} {incr s} { + if {$::local} { + set rhost localhost + } else { + set rhost [lindex $::hosts $s] + } + #puts stderr "rsh $rhost $cmd" + puts -nonewline stderr "$rhost " + set f($s) [open "| rsh $rhost $cmd"] + fconfigure $f($s) -blocking 0 + fileevent $f($s) readable "readable $f($s) $rhost" + } + puts stderr "" + vwait ::xxx + set secs [expr {([clock clicks] -$starttime)/1000000.0}] + puts stderr "[format %3d $clients] clients: [format %6.2f $secs] seconds \ + (per client [format %6.2f [expr {$secs/$clients}]] seconds,\ + [format %7.2f [expr {$::totalbytes/($secs*1000.0)}]] KB/sec)\ + server: [format %7.2f [expr {$::totalbytes*$clients/($secs*1000.0)}]] KB/sec" + } + clients 1 + clients 2 + clients 3 + clients 4 + clients 5 + clients 10 + clients 20 + exit +} + +persistentCache clear + +proc assert {f r} { + set got [eval $f] + if {$got ne $r } { + puts stderr "assertion failed: \[$f\] == $r (got $got)" + quit + } else { + puts stderr "OK $r = $f" + } +} +proc head msg { + puts stderr "" + puts stderr "---------------------------- $msg" +} + +proc test {msg cmd} { + set r [Object autoname r] + head $msg + if {[catch {eval $cmd} msg]} { + puts stderr "ERROR: $::errorInfo" + quit + } + $r destroy +} + +Object userPwd +userPwd proc user {u} { + my set user $u +} +userPwd proc show {realm userVar pwVar} { + upvar $userVar u $pwVar pw + set u [my set user] + set pw jogl + return 1 +} + + + + +# test "simple request" { +# SimpleRequest $r -caching 0 \ +# -url http://localhost/index.html +# assert "$r getContentLength" 81 +# } +# test "simple request" { +# SimpleRequest $r -caching 1 \ +# -url http://localhost/index.html +# assert "$r getContentLength" 81 +# } +# test "simple request" { +# SimpleRequest $r -caching 1 \ +# -url http://localhost/index.html +# assert "$r getContentLength" 81 +# } +# test "simple request" { +# persistentCache invalidate \ +# http://localhost/index.html +# SimpleRequest $r -caching 1 \ +# -url http://localhost/index.html +# assert "$r getContentLength" 81 +# } + +# test "simple request" { +# SimpleRequest $r -caching 0 \ +# -url http://localhost/muster-d1klausur.ps +# assert "$r getContentLength" 163840 +# } +set total 0 +proc parallelRequests-1.0 {urls} { + ParallelSink psink -httpVersion 1.0 -init -requests $urls + incr ::total [psink set totalbytes] + psink destroy +} +proc parallelRequests-1.1 {urls} { + ParallelSink psink -init -requests $urls + incr ::total [psink set totalbytes] + psink destroy +} +if {$port ne ""} {set port :$port} + + +if {$parallel} { + parallelRequests-1.0 [list \ + http://$host$port/test/file500.html \ + http://$host$port/test/file5k.html \ + http://$host$port/test/file50k.html \ + http://$host$port/test/file500k.html \ + http://$host$port/test/file5m.html \ + http://$host$port/test/file500.html \ + http://$host$port/test/file5k.html \ + http://$host$port/test/file5k.html \ + http://$host$port/test/file500.html \ + http://$host$port/test/file500.html \ + http://$host$port/test/file5k.html \ + http://$host$port/test/file5k.html \ + http://$host$port/test/file500.html \ + http://$host$port/test/file5k.html \ + http://$host$port/test/file5k.html \ + http://$host$port/test/file500.html \ + ] + for {set i 1} {$i<10} {incr i} { + parallelRequests-1.1 [list \ + http://$host$port/test/file50k.html \ + http://$host$port/test/file5k1.html \ + http://$host$port/test/file5k2.html \ + http://$host$port/test/file5k3.html \ + http://$host$port/test/file5k4.html \ + http://$host$port/test/file5k5.html + ] + } + puts stderr totalbytes=$::total +} + +if {$sequential} { + set doc http://$host$port/test/suexec.html + set size 20680 + foreach c $cachingopts { + test "caching $c $doc" { + SimpleRequest $r -caching $::c -url $::doc + assert "$r getContentLength" $::size + #puts stderr c=<[$r getContent]> + } + } + + set doc http://$host$port/test/xvdocs.ps + set size 3678303 + foreach c $cachingopts { + test "caching $c" { + SimpleRequest $r -caching $::c -url $::doc + assert "$r getContentLength" $::size + } + } + +} +exit + +test "simple request" { + SimpleRequest $r -caching 0 \ + -url http://nestroy.wi-inf.uni-essen.de/Raumplan.html + assert "$r getContentLength" 662 +} + + +test "simple request, larger file" { + SimpleRequest $r -caching 0 \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 +} + + +test "use cache" { + SimpleRequest $r -caching 1 \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 +} + + +test "specify filename, use cache and validate request" { + persistentCache invalidate \ + http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + exec rm -f test.ps + SimpleRequest $r -caching 1 -fileName test.ps \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 + assert "file size test.ps" 349970 + assert {lindex [exec md5sum test.ps] 0} c6029c987e841430f3ca9bab157da12f +} + + +test "specify filename, and use cache and a validated file" { + exec rm -f test.ps + SimpleRequest $r -caching 1 -fileName test.ps \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 + assert "file size test.ps" 349970 + assert {lindex [exec md5sum test.ps] 0} c6029c987e841430f3ca9bab157da12f +} + +test "specify filename, and do not use cache" { + exec rm -f test.ps + SimpleRequest $r -fileName test.ps -caching 0 \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 + assert "file size test.ps" 349970 + assert {lindex [exec md5sum test.ps] 0} c6029c987e841430f3ca9bab157da12f +} + +test "specify filesink and use cache; no copying neccesary" { + persistentCache invalidate \ + http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + SimpleRequest $r -useFileSink 1 -caching 1 \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 + assert "file size test.ps" 349970 +} + + + +test "load a large file to the cache" { + persistentCache clearEntry http://swt.wi-inf.uni-essen.de/lx2.1.55 + SimpleRequest $r -caching 1 \ + -url http://swt.wi-inf.uni-essen.de/lx2.1.55 + assert "$r getContentLength" 522411 +} + + + +test "load a validated large file" { + SimpleRequest $r -caching 1 \ + -url http://swt.wi-inf.uni-essen.de/lx2.1.55 + assert "$r getContentLength" 522411 +} + +test "pure loading test without cache" { + SimpleRequest $r -caching 0 \ + -url http://swt.wi-inf.uni-essen.de/lx2.1.55 + assert "$r getContentLength" 522411 +} + + +test "redirect" { + SimpleRequest $r -caching 1 \ + -url http://mohegan.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 +} + + +test "authentication" { + SimpleRequest $r -caching 1 \ + -url http://nestroy.wi-inf.uni-essen.de/cgi-bin/w3-msql/Forschung/Publikationen/protected/index.html + assert "$r getContentLength" 1164 +} + +puts stderr after +quit + + +### request joining +### load to file depending on content type Index: apps/comm/get-regression.xotcl =================================================================== diff -u -N --- apps/comm/get-regression.xotcl (revision 0) +++ apps/comm/get-regression.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,209 @@ +#!/usr/bin/env tclsh +package require XOTcl; namespace import -force xotcl::* + +package require xotcl::comm::httpAccess +package require xotcl::trace + +persistentCache clear + +proc assert {f r} { + set got [eval $f] + if {$got ne $r } { + puts stderr "assertion failed: \[$f\] == $r (got $got)" + quit + } else { + puts stderr "OK $r = $f" + } +} +proc head msg { + puts stderr "" + puts stderr "---------------------------- $msg" +} + +proc test {msg cmd} { + set r [Object autoname r] + head $msg + if {[catch {eval $cmd} msg]} { + puts stderr "ERROR: $::errorInfo" + quit + } + $r destroy +} + +Object userPwd +userPwd proc user {u} { + my set user $u +} +userPwd proc show {realm userVar pwVar} { + upvar $userVar u $pwVar pw + set u [my set user] + set pw jogl + return 1 +} + + + + +# test "simple request" { +# SimpleRequest $r -caching 0 \ +# -url http://localhost/index.html +# assert "$r getContentLength" 81 +# } +# test "simple request" { +# SimpleRequest $r -caching 1 \ +# -url http://localhost/index.html +# assert "$r getContentLength" 81 +# } +# test "simple request" { +# SimpleRequest $r -caching 1 \ +# -url http://localhost/index.html +# assert "$r getContentLength" 81 +# } +# test "simple request" { +# persistentCache invalidate \ +# http://localhost/index.html +# SimpleRequest $r -caching 1 \ +# -url http://localhost/index.html +# assert "$r getContentLength" 81 +# } + +# test "simple request" { +# SimpleRequest $r -caching 0 \ +# -url http://localhost/muster-d1klausur.ps +# assert "$r getContentLength" 163840 +# } + +proc parallelRequests {urls} { + JoinSink joinsink -requests [llength $urls] + set i 0 + foreach url $urls { + TimedMemorySink sink$i + set t$i [Access [Access autoname a] -url $url \ + -informObject [list joinsink sink$i] \ + -caching 0] + incr i + } + set i 0 + foreach url $urls { sink$i reportTimes;incr i} + joinsink destroy +} + +# parallelRequests { +# http://localhost/muster-d1klausur.ps +# http://localhost/muster-d1klausur2.ps +# } +# quit + +foreach c {0 1 2 2} { + test "caching $c" { + SimpleRequest $r -caching $::c \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 + } +} + + + +test "simple request" { + SimpleRequest $r -caching 0 \ + -url http://nestroy.wi-inf.uni-essen.de/Raumplan.html + assert "$r getContentLength" 662 +} + + +test "simple request, larger file" { + SimpleRequest $r -caching 0 \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 +} + + +test "use cache" { + SimpleRequest $r -caching 1 \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 +} + + +test "specify filename, use cache and validate request" { + persistentCache invalidate \ + http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + exec rm -f test.ps + SimpleRequest $r -caching 1 -fileName test.ps \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 + assert "file size test.ps" 349970 + assert {lindex [exec md5sum test.ps] 0} c6029c987e841430f3ca9bab157da12f +} + + +test "specify filename, and use cache and a validated file" { + exec rm -f test.ps + SimpleRequest $r -caching 1 -fileName test.ps \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 + assert "file size test.ps" 349970 + assert {lindex [exec md5sum test.ps] 0} c6029c987e841430f3ca9bab157da12f +} + +test "specify filename, and do not use cache" { + exec rm -f test.ps + SimpleRequest $r -fileName test.ps -caching 0 \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 + assert "file size test.ps" 349970 + assert {lindex [exec md5sum test.ps] 0} c6029c987e841430f3ca9bab157da12f +} + +test "specify filesink and use cache; no copying neccesary" { + persistentCache invalidate \ + http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + SimpleRequest $r -useFileSink 1 -caching 1 \ + -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 + assert "file size test.ps" 349970 +} + + + +test "load a large file to the cache" { + persistentCache clearEntry http://swt.wi-inf.uni-essen.de/lx2.1.55 + SimpleRequest $r -caching 1 \ + -url http://swt.wi-inf.uni-essen.de/lx2.1.55 + assert "$r getContentLength" 522411 +} + + + +test "load a validated large file" { + SimpleRequest $r -caching 1 \ + -url http://swt.wi-inf.uni-essen.de/lx2.1.55 + assert "$r getContentLength" 522411 +} + +test "pure loading test without cache" { + SimpleRequest $r -caching 0 \ + -url http://swt.wi-inf.uni-essen.de/lx2.1.55 + assert "$r getContentLength" 522411 +} + + +test "redirect" { + SimpleRequest $r -caching 1 \ + -url http://mohegan.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps + assert "$r getContentLength" 349970 +} + + +test "authentication" { + SimpleRequest $r -caching 1 \ + -url http://nestroy.wi-inf.uni-essen.de/cgi-bin/w3-msql/Forschung/Publikationen/protected/index.html + assert "$r getContentLength" 1164 +} + +puts stderr after +quit + + +### request joining +### load to file depending on content type Index: apps/comm/link-checker.xotcl =================================================================== diff -u -N --- apps/comm/link-checker.xotcl (revision 0) +++ apps/comm/link-checker.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,147 @@ +#!/usr/bin/env tclsh +# $Id: link-checker.xotcl,v 1.5 2006/09/27 08:12:39 neumann Exp $ +# -gn july 2000 +package require XOTcl; namespace import -force xotcl::* + +@ @File { + description { + A simple link checking program that checks in parallel + pages of a site. +

+ Options:

+ + + + + + +
-url Start-URL
-foreign 0 or 1, specifies, whether foreign links of + local pages should be checked (default 1)
-local A string match pattern to decide + which url should be treated as local + e.g. -local *wu-wien.ac.at/* + Per default the locality filter ist set + to the name of the host followed by '/*'
-restrict 0 or 1, sets the locality filter to the subtree + implied by the URL
-verbose 0 or 1 or 2, verbosity level (default 0)
+ } +} + +if {$tcl_version<8.2} { + puts stderr "This script requires Tcl 8.2 or newer" + exit -1 +} + +set opt(-url) http://localhost:8000/ +set opt(-url) http://nm.wu-wien.ac.at/Lehre/ +set opt(-verbose) 0; # 0, 1 (show check), or 2 (show ignore) +set opt(-foreign) 1; # 0, 1 (check foreign links on local pages) +set opt(-restrict) 0; # 0, 1 + +## per default, lc checks the +array set opt $argv +if {$opt(-restrict)} { + regexp {://(.*)$} $opt(-url) _ opt(-local) + set opt(-local) [string trimright $opt(-local) /]* + puts stderr "locality filter set to '$opt(-local)'" +} +if {![info exists opt(-local)]} { + regexp {http://([^/:]+)} $opt(-url) _ opt(-local) + append opt(-local) /* + puts stderr "locality filter set to '$opt(-local)'" +} + +#package require xotcl::package; package verbose 1 +package require xotcl::comm::httpAccess +package require xotcl::trace + +proc printError {m} {} + +Class Checker -superclass ParallelSink \ + -parameter {verbose foreign local} +Checker array set ref {A HREF IMG SRC} +Checker set ref_re {[[:space:]]*=[[:space:]]*([[:graph:]]+)} +Checker instproc report {msg {level 1}} { + my instvar verbose + if {$verbose>$level} {puts stderr $msg} + return 0 +} +Checker instproc isLocal {url} { + my instvar local + string match *://$local $url +} +Checker instproc isToCheck {url request methodvar} { + my instvar foreign + upvar $methodvar method + if {![regexp -nocase {http://([^/:]+)} $url _ host]} { + return [my report "ignored, no http: $url"] + } + set method GET + if {![my isLocal $url]} { + if {$foreign} { + #puts stderr "parenturl: [$request set parentUrl] -> [my isLocal [$request set parentUrl]]" + if {[$request info vars parentUrl] ne "" && + ![my isLocal [$request set parentUrl]]} { + return [my report "ignored, nor local: $url"] + } else { + set method HEAD + } + } else { + return [my report "ignored, nor local: $url"] + } + } + if {[regexp -nocase {[.](gif|jpg|ps|pdf|gz)$} $url]} { + set method HEAD + #return [my report "ignored due to extension: $url"] + } + return 1 +} +Checker instproc checkLink {request link} { + set resolved [resolve $link [$request set url]] + if {[my isToCheck $resolved $request method]} { + my instvar checked + if {![info exists checked($resolved)]} { + my report "checking .......... $resolved" 0 + set checked($resolved) 1 + my scheduleRequest $method $resolved [$request set url] + } else { + #puts stderr "already checked $resolved" + } + } +} +Checker instproc checkText {request} { + if {![my isLocal [$request set url]]} return + [self class] instvar ref ref_re + set content [$request getContent] + set start 0 + while {[regexp -nocase -indices -start $start -- \ + {<(A|IMG)([^>]*?)} $content a b c]} { + set elem [string toupper \ + [string range $content [lindex $b 0] [lindex $b 1]]] + set attribs [string range $content [lindex $c 0] [lindex $c 1]] + #regsub -all {[\n ]+} $attribs " " attribs + if {[regexp -nocase $ref($elem)$ref_re $attribs _ i]} { + my checkLink $request [string trim $i '\"] + } + set start [lindex $c 1] + } +} +Checker instproc endCb r { + #showObj $r + switch [$r set contentType] { + text/html {my checkText $r} + } + next +} +Checker instproc cancelCb r { + #$r showVars + puts stderr "ERROR in page [$r set parentUrl]" + puts stderr " Link: [$r set url]" + puts stderr " cause [$r set errormsg]\n" + next +} + +Checker csink \ + -verbose $opt(-verbose) -foreign $opt(-foreign) -local $opt(-local) \ + -sinkClass MemorySink -httpVersion 1.0 -maxsimultaneous 30 +csink requests $opt(-url) +puts stderr "sumbytes: [csink set sumbytes] requests: [csink set numrequests]" +csink destroy Index: apps/comm/secure-webclient.xotcl =================================================================== diff -u -N --- apps/comm/secure-webclient.xotcl (revision 0) +++ apps/comm/secure-webclient.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,52 @@ +#!/usr/bin/env tclsh +# $Id: secure-webclient.xotcl,v 1.2 2006/02/18 22:17:32 neumann Exp $ + +package require XOTcl; namespace import -force xotcl::* + +@ @File { + description { + A sample secure web client that queries an secure web-server. + It needs to be adopted with different https URLs for testing... + } +} + +# +package require xotcl::comm::httpAccess +package require xotcl::comm::ftp +package require xotcl::trace + +#set version 1.1 +set hostport localhost:8086 +set http_server http://localhost:8086/ +set https_server https://localhost:8443/ + +set slowURL "http://quote.yahoo.com/q?s=^DJI&d=1d" +set ftpURL "ftp://mohegan.wi-inf.uni-essen.de/welcome.msg" + +set secureURL "https://wawog.wi-inf.uni-essen.de/" +set secureURL "https://test17.wu-wien.ac.at:1234/" + +proc printError msg {puts stderr !!!$msg!!!} + +puts "\nTrying to get a secure page ..... <$https_server>" +SimpleRequest r0 -url $https_server +puts stderr "\n content = {[r0 getContent]}" + +puts -nonewline "\nTrying to load image logo-100.jpg ... (not secure)" +SimpleRequest r2 -url $http_server/logo-100.jpg +if {[r2::sink set contentLength] == 1706} { + puts "suceeded! Loaded 1706 bytes!" +} else { + puts "failed! Loaded [r2::sink set contentLength] (!= 1706) bytes" + exit +} + +puts -nonewline "\nTrying to load image logo-100.jpg secure ... " +SimpleRequest r1 -url $https_server/logo-100.jpg +if {[r1::sink set contentLength] == 1706} { + puts "suceeded! Loaded 1706 bytes!" +} else { + puts "failed! Loaded [r1::sink set contentLength] (!= 1706) bytes" + exit +} +exit Index: apps/comm/secure-webserver.xotcl =================================================================== diff -u -N --- apps/comm/secure-webserver.xotcl (revision 0) +++ apps/comm/secure-webserver.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,79 @@ +#!/usr/bin/env tclsh +# $Id: secure-webserver.xotcl,v 1.2 2006/02/18 22:17:32 neumann Exp $ +package require XOTcl; namespace import -force xotcl::* + +@ @File { + description { + This small secure web server that provides its documents + via SSL (https, port 8443) and plain http (port 8086). +
+ This file requires TLS. If you experice problems with + versions obtained from the Web, contact gustaf.neumann@wu-wien.ac.at + for a patch. + } +} + +# +# We load the following packages: +# +package require xotcl::trace +package require xotcl::comm::httpd +# +# we set the default for document root to ../../src/doc and port to 8443 +# +set root ../../doc +set port 8443 +set class Httpsd +set cb callback ;# use this for triggering the callbacks +#set cb "" + +foreach {att value} $argv { + switch -- $att { + -root {set root $value} + -port {set port $value} + -class {set class $value} + -cb {set cb $value} + } +} +# +# now we can start the web-server instance with these settings +# +Httpd h0 -port 8086 -root $root +$class h1 -port $port -root $root -infoCb $cb \ + -requestCert 1 -requireValidCert 0 + + +# Start des HTTP-Servers mit port 8086 und dem angegebenen Verzeichnis +#Httpd h2 -port 9086 -root $root \ + -mixin {Responder BasicAccessControl} \ + -addRealmEntry test {test test} -protectDir test "" {} + +Object callback +callback proc error {chan msg} { + puts stderr "+++TLS/$chan: error: $msg" +} +callback proc verify {chan depth cert rc err} { + array set c $cert + if {$rc != "1"} { + puts stderr "+++TLS/$chan: verify/$depth: Bad Cert: $err (rc = $rc)" + } else { + puts stderr "+++TLS/$chan: verify/$depth: $c(subject)" + } + return $rc +} +callback proc info {chan state minor msg} { + # For tracing + #upvar #0 tls::$chan cb + #set cb($major) $minor + #puts stderr "+++TLS/$chan: $major/$minor: $state" + puts stderr "+++TLS/$chan $state $minor: $msg" + +} +callback proc unknown {option args} { + return -code error "bad option \"$option\": must be one of error, info, or verify" +} +# +# and finally call the event loop... +# +vwait forever + Index: apps/comm/server.key =================================================================== diff -u -N --- apps/comm/server.key (revision 0) +++ apps/comm/server.key (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDVg+HdA4RAKyYRaxKRSdAw7mQpephZslIf/ZR7Oe3RKZjxu7Sj +PYG56GSc8y6hiaKuGnDmJcEGXZCXWNtUuACVsNlFrlVbGSEfAbXbz6H4eaaX2d2P +KzrjOc//8+5emaFZRelVTYY4sWNLcCuWV2FIhwMJMblYieXM6iEQg4XzdQIDAQAB +AoGAVdY2OC8QvOdb34bHKSeejf1YwSArHWxF/dxpE/0e8YaimRQYM8QnYgDeagaN +yZ1WjF3O44dsCU4WMfIkAvQSL19RLSgT+jPb3Uu9Aotwmg4x+55BKctRphXKiIfu ++a0IfAFDIt8FMRS08AoSB6eBgOBlhTZM2Y0IuC6QTqaBcwUCQQD5XSiEzh44uMOl +N4FbO0MI2NC3pbPg5u1fEJtIawoYOYxbeGHrlOYO2ZN3ZP6+2g5V0kX5tMMeObhE +qQLlmNETAkEA2zJ/Tk3IE5ByEBcGjG26nJ1zLlY13NaiIg+AoSP+7rHg5TPhoQp1 +VVwcqd4ZWCyqgYDFl2TsiiZwKcEIFJBCVwJBANoLpZSLD04V8a2UXV5C8ZjYzZjo +IeP0yXco9D9cqZUJLTwGhckTiB9QDWyHOWH1FjfhCCMS9tKFMiWHi+rrt1UCQQDC +rlvxURX1gmI8NicjzEVk2la1fe5C4QKJW9lzxUOj/qpvB6BK5r4FfVUb7d32uV0K +vjNAXmvT24XdH8usb9/rAkBR1sqUkqwwm0CSe0Rz9IhSlkwWlmvEzSmEguqrd7Zb +rbYJ9NTnV1uFSAX9vcU7lDRp69il6XmyhOL06FYLRaNa +-----END RSA PRIVATE KEY----- Index: apps/comm/server.pem =================================================================== diff -u -N --- apps/comm/server.pem (revision 0) +++ apps/comm/server.pem (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,66 @@ +issuer :/C=DE/ST=NRW/L=Essen/O=University of Essen/OU=SWT/CN=Fredj Dridi/Email=Fredj.Dridi@uni-essen.de +subject:/C=DE/ST=NRW/L=Essen/O=University of Essen/OU=SWT/CN=tp600e.wi-inf.uni-essen.de/Email=dridi@tp600e.wi-inf.uni-essen.de +serial :01 + +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: md5WithRSAEncryption + Issuer: C=DE, ST=NRW, L=Essen, O=University of Essen, OU=SWT, CN=Fredj Dridi/Email=Fredj.Dridi@uni-essen.de + Validity + Not Before: Apr 28 08:21:19 2000 GMT + Not After : Apr 28 08:21:19 2001 GMT + Subject: C=DE, ST=NRW, L=Essen, O=University of Essen, OU=SWT, CN=tp600e.wi-inf.uni-essen.de/Email=dridi@tp600e.wi-inf.uni-essen.de + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (1024 bit) + Modulus (1024 bit): + 00:d5:83:e1:dd:03:84:40:2b:26:11:6b:12:91:49: + d0:30:ee:64:29:7a:98:59:b2:52:1f:fd:94:7b:39: + ed:d1:29:98:f1:bb:b4:a3:3d:81:b9:e8:64:9c:f3: + 2e:a1:89:a2:ae:1a:70:e6:25:c1:06:5d:90:97:58: + db:54:b8:00:95:b0:d9:45:ae:55:5b:19:21:1f:01: + b5:db:cf:a1:f8:79:a6:97:d9:dd:8f:2b:3a:e3:39: + cf:ff:f3:ee:5e:99:a1:59:45:e9:55:4d:86:38:b1: + 63:4b:70:2b:96:57:61:48:87:03:09:31:b9:58:89: + e5:cc:ea:21:10:83:85:f3:75 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Authority Key Identifier: + keyid:D2:B8:E3:2D:A2:5A:22:78:3A:38:F1:1F:F5:7C:AD:8D:A6:C4:41:0F + + X509v3 Extended Key Usage: + TLS Web Server Authentication, TLS Web Client Authentication, Microsoft Server Gated Crypto, Netscape Server Gated Crypto + X509v3 Basic Constraints: critical + CA:FALSE + Signature Algorithm: md5WithRSAEncryption + 38:b5:a1:1c:93:c4:aa:6e:3f:d6:ea:11:7f:7b:2b:11:db:7b: + 22:b3:d2:a8:b3:f3:20:64:6a:25:b4:fe:0d:ac:12:49:a0:6e: + 6d:ef:fb:99:a2:7c:bc:50:b0:eb:42:ef:0a:32:fa:a9:69:e0: + 11:10:9b:00:05:15:97:59:ac:dc:5f:f2:cd:81:28:3e:e6:96: + 86:f4:d7:99:71:52:c3:ca:0f:4a:48:d8:66:b0:da:e8:d1:45: + 84:c4:12:b2:43:ec:63:b6:25:e8:0a:5a:4c:fb:e2:ec:03:36: + 6f:cd:f9:2a:5c:52:ba:02:29:92:f5:bf:c4:96:ff:9e:ed:a3: + cf:02 + +-----BEGIN CERTIFICATE----- +MIIDIjCCAougAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCREUx +DDAKBgNVBAgTA05SVzEOMAwGA1UEBxMFRXNzZW4xHDAaBgNVBAoTE1VuaXZlcnNp +dHkgb2YgRXNzZW4xDDAKBgNVBAsTA1NXVDEUMBIGA1UEAxMLRnJlZGogRHJpZGkx +JzAlBgkqhkiG9w0BCQEWGEZyZWRqLkRyaWRpQHVuaS1lc3Nlbi5kZTAeFw0wMDA0 +MjgwODIxMTlaFw0wMTA0MjgwODIxMTlaMIGtMQswCQYDVQQGEwJERTEMMAoGA1UE +CBMDTlJXMQ4wDAYDVQQHEwVFc3NlbjEcMBoGA1UEChMTVW5pdmVyc2l0eSBvZiBF +c3NlbjEMMAoGA1UECxMDU1dUMSMwIQYDVQQDExp0cDYwMGUud2ktaW5mLnVuaS1l +c3Nlbi5kZTEvMC0GCSqGSIb3DQEJARYgZHJpZGlAdHA2MDBlLndpLWluZi51bmkt +ZXNzZW4uZGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANWD4d0DhEArJhFr +EpFJ0DDuZCl6mFmyUh/9lHs57dEpmPG7tKM9gbnoZJzzLqGJoq4acOYlwQZdkJdY +21S4AJWw2UWuVVsZIR8BtdvPofh5ppfZ3Y8rOuM5z//z7l6ZoVlF6VVNhjixY0tw +K5ZXYUiHAwkxuViJ5czqIRCDhfN1AgMBAAGjZzBlMB8GA1UdIwQYMBaAFNK44y2i +WiJ4OjjxH/V8rY2mxEEPMDQGA1UdJQQtMCsGCCsGAQUFBwMBBggrBgEFBQcDAgYK +KwYBBAGCNwoDAwYJYIZIAYb4QgQBMAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQEE +BQADgYEAOLWhHJPEqm4/1uoRf3srEdt7IrPSqLPzIGRqJbT+DawSSaBube/7maJ8 +vFCw60LvCjL6qWngERCbAAUVl1ms3F/yzYEoPuaWhvTXmXFSw8oPSkjYZrDa6NFF +hMQSskPsY7Yl6ApaTPvi7AM2b835KlxSugIpkvW/xJb/nu2jzwI= +-----END CERTIFICATE----- + Index: apps/comm/test-tls-client.xotcl =================================================================== diff -u -N --- apps/comm/test-tls-client.xotcl (revision 0) +++ apps/comm/test-tls-client.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,86 @@ +#!../../src/xotclsh +# +# $Id: test-tls-client.xotcl,v 1.2 2006/02/18 22:17:32 neumann Exp $ + +package require tls + +proc bgerror {err} { + global errorInfo + puts stderr "BG Error: $errorInfo" +} + +array set opts { + -port 8443 + -host localhost +} +array set opts $argv + + + + +proc readCB {CHAN} { + #puts stderr "*** CALL: readCB $CHAN" + if {![eof $CHAN]} { + set rData [gets $CHAN] + puts stderr "\nREADING ..." + puts stderr "------------------------------------------------------" + puts stderr <$rData> + puts stderr "------------------------------------------------------" + + #fileevent $CHAN writable [list writeCB $CHAN] + } else { + catch {close $CHAN} + puts stderr "\nSocket ($CHAN) is closed." + exit + } +} +proc writeCB {CHAN} { + #puts stderr "*** CALL: writeCB $CHAN" + #puts stderr "fileevent $CHAN writable {}" + fileevent $CHAN writable {} + set wData "GET / HTTP/1.1\r\nHost: localhost\r\nAccept: */*\r\n\r\n" + #set wData "GET\n" + puts -nonewline $CHAN $wData + flush $CHAN + #puts stderr "\nfileevent $CHAN readable [list readCB $CHAN]" + fileevent $CHAN readable [list readCB $CHAN] +} + +puts stderr "\n\n\n~~~~~~~~~~~~ Trying $opts(-host):$opts(-port)" +# +# Create socket +# +set chan [socket -async $opts(-host) $opts(-port)] + +tls::import $chan -command callback -cafile cacert.pem -certfile client.pem -server 0 -keyfile client.key -request 1 -require 1 + +puts stderr "setting channel to auto binary" +fconfigure $chan -translation {auto binary} +puts stderr "fileevent $chan writable [list writeCB $chan]" +fileevent $chan writable [list writeCB $chan] + + +Object callback +callback proc error {chan msg} { + puts stderr "+++TLS/$chan: error: $msg" +} +callback proc verify {chan depth cert rc err} { + array set c $cert + if {$rc != "1"} { + puts stderr "+++TLS/$chan: verify/$depth: Bad Cert: $err (rc = $rc)" + } else { + puts stderr "+++TLS/$chan: verify/$depth: $c(subject)" + } + return $rc +} +callback proc info {chan state minor msg} { + puts stderr "+++TLS/$chan $state $minor: $msg" + +} +callback proc unknown {option args} { + my showCall + return -code error "bad option \"$option\": must be one of error, info, or verify" +} + + +vwait forever Index: apps/comm/test-tls-server.xotcl =================================================================== diff -u -N --- apps/comm/test-tls-server.xotcl (revision 0) +++ apps/comm/test-tls-server.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,87 @@ +#!../../src/xotclsh +# $Id: test-tls-server.xotcl,v 1.5 2006/09/27 08:12:39 neumann Exp $ +# +# sample secure server that reflect all incoming data to the client +# It uses tls1.3 package of Matt Newman +# Fredj Dridi + +package require tls + +proc bgerror {err} { + global errorInfo + puts stderr "BG Error: $errorInfo" +} + +# +# Sample callback - just reflect data back to client +# +proc reflectCB {chan {verbose 0}} { + puts stderr "\n*** reflectCB $chan $verbose" + + fconfigure $chan -translation {auto crlf} + + set data {} + if {[catch {set n [::gets $chan data]} msg]} { + set error $msg + puts stderr "\nEOF ($data)" + catch {close $chan} + return 0 + } + puts stderr n=<$n> + if {$verbose && $data ne ""} { + puts stderr "data=<$data>" + } + if {[eof $chan]} { ;# client gone or finished + puts stderr "\nEOF" + close $chan ;# release the servers client channel + return + } + #puts -nonewline $chan $data + #flush $chan +} +proc acceptCB { chan ip port } { + puts stderr "\n*** acceptCB $chan $ip $port" + + tls::import $chan -cafile cacert.pem -certfile server.pem \ + -server 1 -request 1 -require 1 -keyfile server.key -command callback + if {![tls::handshake $chan]} { + puts stderr "\nHandshake pending" + return + } + array set cert [tls::status $chan] + puts stderr "\n" + parray cert + + fileevent $chan readable [list reflectCB $chan 1] +} + + +set chan [socket -server acceptCB 8443] +puts stderr "Server waiting connection on $chan (8443)" + + +## Sample Callback that gives SSL information +Object callback +callback proc error {chan msg} { + puts stderr "+++TLS/$chan: error: $msg" +} +callback proc verify {chan depth cert rc err} { + array set c $cert + if {$rc != "1"} { + puts stderr "+++TLS/$chan: verify/$depth: ** Bad Cert **: $err (rc = $rc)" + } else { + puts stderr "+++TLS/$chan: verify/$depth: $c(subject)" + } + return $rc +} +callback proc info {chan state minor msg} { + puts stderr "+++TLS/$chan $state $minor: $msg" + +} +callback proc unknown {option args} { + my showCall + return -code error "bad option \"$option\": must be one of error, info, or verify" +} + +# Go into the eventloop +vwait forever Index: apps/comm/webclient.xotcl =================================================================== diff -u -N --- apps/comm/webclient.xotcl (revision 0) +++ apps/comm/webclient.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,7 @@ +#!../../src/xotclsh +package require XOTcl; namespace import -force xotcl::* + +@ @File {description {For a sample webclient, see packages/comm/xocomm.test}} +package require xotcl::comm::httpAccess +set hostport localhost:8086 +SimpleRequest r0 -url http://$hostport/logo-100.jpg Index: apps/comm/webserver.xotcl =================================================================== diff -u -N --- apps/comm/webserver.xotcl (revision 0) +++ apps/comm/webserver.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,118 @@ +#!../../src/xotclsh +# $Id: webserver.xotcl,v 1.9 2007/08/14 16:38:26 neumann Exp $ +array set opts {-root ../../doc -port 8086 -protected-port 9096 -pkgdir .} +array set opts $argv +lappend auto_path $opts(-pkgdir) +#if {$::tcl_platform(platform) eq "windows"} {lappend auto_path .} +package require XOTcl; namespace import -force xotcl::* + +proc ! string { + set f [open [::xotcl::tmpdir]/log w+]; + puts $f "[clock format [clock seconds]] $string" + close $f +} + +@ @File { + description { + This small demo program starts two different webservers: +

    +
  • Firstly, it provides a sample web server that povides the documents in + ../../src/doc (or the files specified with -root) at port 8086 + (or at the port specified via the -port option) as unprotected resources. +

    +

  • Secondly, it starts a second webserver with basic access control + (it accepts test/test as user/password) on port 9096 (or on the + port specified via -protected-port). If it receives an request + for an resource named "exit", it terminates. For all other requests + it returns actual information about the user and the issued request. +
+ To see, how it works, contact it e.g. from netscape. + } +} + +! "#### webserver starting" +# We load the following packages: +# +#::xotcl::package import ::xotcl::comm::httpd +package require xotcl::comm::httpd + +! "#### httpd required" + +# now we can start the web-server instance with these settings +# +Httpd h1 -port $opts(-port) -root $opts(-root) +@ Httpd h1 {description "unprotected web server"} + +! "#### h1 started" + +# specialized worker, which executes tcl commands in web pages +@ Class SpecializedWorker { description { + Specialized worker that can be passed to any webserver +}} +Class SpecializedWorker -superclass Httpd::Wrk +@ SpecializedWorker instproc respond {} { description { + This method handles all responses from the webserver to the client. + We implent here "exit", and we return the information about the actual + request and user in HTML format for all other requests. +

This method is an example, how to access on the server side + request specific infomation. +}} +SpecializedWorker instproc respond {} { + if {[my set resourceName] eq "exit"} { + set ::forever 1 + #my showVars + #my set version 1.0;### ???? + #puts stderr HERE + } + # return for all other requests the same response + foreach {a v} [my array get meta] { + append m $a$v\n + } + set content { + +

Request Info

+ + + + + + + +
method:[my set method]
resource:[my set resourceName]
user:[my set user]
version:HTTP/[my set version]
response port:[my set port]
request comes from:[my set ipaddr]
+

Request Header Fields

+ $m
+ + } + set c [subst $content] + my replyCode 200 + my connection puts "Content-Type: text/html" + my connection puts "Content-Length: [string length $c]\n" + my connection puts-nonewline $c + my close +} + +@ Httpd h2 { + description "Web server with basic authentication using the specialied worker"} + +if {[info exists env(USER)]} { + set USER "$env(USER)" +} elseif {[info exists env(USERNAME)]} { + set USER "$env(USERNAME)" +} else { + set USER unknown +} +if {$::tcl_platform(platform) eq "windows"} { + set USER unknown +} + +Httpd h2 -port $opts(-protected-port) -root $opts(-root) \ + -httpdWrk SpecializedWorker \ + -mixin Httpd::BasicAccessControl \ + -addRealmEntry test "u1 test $USER test" -protectDir test "" {} + +! "#### h2 started" + +# +# and finally call the event loop... +# +vwait forever Index: apps/persistence/persistenceTest.xotcl =================================================================== diff -u -N --- apps/persistence/persistenceTest.xotcl (revision 0) +++ apps/persistence/persistenceTest.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,44 @@ +#!../../src/xotclsh +package require XOTcl; namespace import -force xotcl::* + +package require xotcl::store::persistence +package require xotcl::mixinStrategy + +PersistenceMgr jufpMgr +PersistenceMgr tclpMgr -dbPackage TclGdbm +Class PersistenceTest -parameter {{countVar 0} {appendVar ""} pm} +PersistenceTest instproc init args { + my mixinStrategy Persistent=Eager + my persistenceMgr [my set pm] + my persistent {countVar appendVar} + next +} + +PersistenceTest instproc incrCount {} { + puts "in [self] countVar now is [my countVar]" + my incr countVar +} +PersistenceTest instproc appendV {x} { + my append appendVar $x + puts "append is: [my appendVar]" +} + +PersistenceTest instproc test {} { + # first we increment a counter: + my incrCount + # now we 5x append something to appendVar + for {set i 0} {$i<5} {incr i} { + my appendV a + } + # now we list all keys in the database + puts "Variables stored in [my persistenceMgr].db: [[my persistenceMgr] names]" + # now we delete append var + puts "Deleting append:[[my persistenceMgr] delete [self]::appendVar]" + # now we list the keys again + puts "Variables stored in [my persistenceMgr].db: [[my persistenceMgr] names]" +} + +PersistenceTest persistenceJufTest -pm jufpMgr -init -test +#PersistenceTest persistenceTclTest -pm tclpMgr -init -test + +#PersistenceTest instproc count \ No newline at end of file Index: apps/scripts/adapter.xotcl =================================================================== diff -u -N --- apps/scripts/adapter.xotcl (revision 0) +++ apps/scripts/adapter.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,30 @@ +# $Id: adapter.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +Class Adapter -superclass Class + +@ @File { + description { + Simple adapter pattern meta-class taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + } +} + +Adapter instproc adapterFilter args { + set r [self calledproc] + my instvar adaptee specificRequest + if {[info exists specificRequest($r)]} { + return [eval $adaptee $specificRequest($r) $args] + } + next +} + +Adapter instproc init args { + my instfilterappend adapterFilter + next + my instproc setRequest {r sr} { + my set specificRequest($r) $sr + } + my instproc setAdaptee {a} { + my set adaptee $a + } +} Index: apps/scripts/adapterExample.xotcl =================================================================== diff -u -N --- apps/scripts/adapterExample.xotcl (revision 0) +++ apps/scripts/adapterExample.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,36 @@ +# $Id: adapterExample.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# include the adapter pattern +source adapter.xotcl + +@ @File { + description { + Simple adapter pattern example class (FTP requests) taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + } +} + +Class FTPLIB +FTPLIB instproc FTPLIB_connect args { + puts "in ftplib connect" +} + +Class Connection +Connection instproc connect args { + puts "in Connection connect" +} +Connection instproc discard args { + puts "in Connection discard" +} + +Adapter FTP -superclass Connection + +FTP instproc init args { + FTPLIB ftpAdaptee + my setRequest connect FTPLIB_connect + my setAdaptee ftpAdaptee +} +FTP f + +f connect +f discard Index: apps/scripts/composite.xotcl =================================================================== diff -u -N --- apps/scripts/composite.xotcl (revision 0) +++ apps/scripts/composite.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,53 @@ +#$Id: composite.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +Class Composite -superclass Class +Composite metadata add description +@ @File { + description { + Simple composite pattern meta-class taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + } +} + +Composite instproc addOperations args { + foreach op $args { + if {![my exists operations($op)]} { + my set operations($op) $op + } + } +} + +Composite instproc removeOperations args { + foreach op $args { + if {![my exists operations($op)]} { + my unset operations($op) + } + } +} + +Composite instproc compositeFilter args { + # get the operations class variable from the object's class + set registrationclass [lindex [self filterreg] 0] + $registrationclass instvar operations + # get the request + set r [self calledproc] + puts ***compositeFilter--${r}--[self] + + # check if the request is a registered operation + if {[info exists operations($r)]} { + foreach object [my info children] { + # forward request + eval $object $r $args + } + } + return [next] +} + + +Composite instproc init {args} { + my array set operations {} + next + my instfilterappend compositeFilter +} + + Index: apps/scripts/compositeExample.xotcl =================================================================== diff -u -N --- apps/scripts/compositeExample.xotcl (revision 0) +++ apps/scripts/compositeExample.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,40 @@ +# $Id: compositeExample.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# include the pattern +source composite.xotcl + +Class Graphic +@ @File { + description { + Simple Graphics example of the composite pattern taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. They demonstrate instfilters, + filter chains and filter inheritance. + } +} + + +Graphic instproc draw {} { + puts "in--- draw SELF: [self] CLASS: [self class]" +} + +Composite Picture -superclass Graphic +Class Line -superclass Graphic +Class Rectangle -superclass Graphic + + +Picture addOperations draw +#Picture removeOperations draw + +Picture aPicture +Picture aPicture::bPicture +Line aPicture::aLine +Rectangle aPicture::aRect +Line aPicture::bPicture::aLine +Rectangle aPicture::bPicture::aRect +Picture aPicture::bPicture::cPicture +Picture aPicture::bPicture::dPicture +Line aPicture::bPicture::cPicture::cLine + +# draw eines Composites +puts "DRAW im Composite: aPicture" +aPicture draw Index: apps/scripts/observer.xotcl =================================================================== diff -u -N --- apps/scripts/observer.xotcl (revision 0) +++ apps/scripts/observer.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,87 @@ +#$Id: observer.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +Class Observer -superclass Class + +Observer metadata add description +@ @File { + description { + Simple observer pattern meta-class taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + } +} + +Class Observer::Subject -superclass Class + +Observer::Subject instproc notificationFilter {args} { + set procName [self calledproc] + my instvar preObservers postObservers + + if {[info exists preObservers($procName)]} { + foreach obj $preObservers($procName) { $obj update [self] $args } + } + + set result [next] + + if {[info exists postObservers($procName)]} { + foreach obj $postObservers($procName) { $obj update [self] $args } + } + return $result +} + +Class Observer::SubjectMgt +Observer::SubjectMgt instproc attach {hook objs} { + upvar $hook observers + foreach obj $objs { + if {![info exists observers] || [lsearch $observers $obj] == -1} { + lappend observers $obj + } + } +} +Observer::SubjectMgt instproc detach {hook objs} { + upvar $hook observers + if {[info exists observers]} { + foreach obj $objs { + set p [lsearch $observers $obj] + set observers [lreplace $observers $p $p] + } + } +} + +Observer::SubjectMgt instproc attachPre {procName args} { + my instvar preObservers + my attach preObservers($procName) $args +} +Observer::SubjectMgt instproc attachPost {procName args} { + my instvar postObservers + my attach postObservers($procName) $args +} +Observer::SubjectMgt instproc detachPre {procName args} { + my instvar preObservers + my detach preObservers($procName) $args +} +Observer::SubjectMgt instproc detachPost {procName args} { + my instvar postObservers + my detach postObservers($procName) $args +} + +Observer::Subject instproc init args { + next + my superclass [list Observer::SubjectMgt [my info superclass]] + my instfilter notificationFilter +} + +Observer instproc timeout t { + my set timeout $t +} + +Observer instproc update {subject args} { + #addTimeOut [my set timeout] "[self] update $subject $args" + #$subject getResponse + # do something with the response + puts [self]---update +} + +Observer instproc init args { + next +} + Index: apps/scripts/parameter.xotcl =================================================================== diff -u -N --- apps/scripts/parameter.xotcl (revision 0) +++ apps/scripts/parameter.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,150 @@ +### Sample file for parameter testing.... +### For every class "-parameter" can be specified which accepts +### a list of parameter specifications. +### +### * If a parameter specification consists of a single word, +### the word is considered as the parameter name and +### a standard setter/getter method with this name is created. +### +### * If the parameter specification consists of two words, the +### second word is treated as the default value, which is stored +### in the class object. +### +### * If a default value exists in the class object, a +### corresponding instance variable with the name of the +### parameter is created automatically during initialization +### of the object. +### +### * If the parameter specification consists of more than two words, +### various parameter methods (starting with "-") with arguments +### can be specified. In the following example +### Class C -parameter {{a 1} {b -default 1}} +### C c1 +### both a and b receive 1 as default value. +### +### * In order to call the standard getter method use the method +### with the name of the parameter with one parameter. For example, +### in order to call the standard getter for parameter a, use +### puts [c1 a] +### In order to use the standard setter for b, use the method with +### two parameters. +### c1 b 123 +### +### * There are two ways to specify custom setter/getter methods for +### parameters: (a) the custom setter/getter can be defined within the +### class hierarchy of the object, or (b) the custom getter/setter can +### be specified on a different object. The custom setter/getter +### method are called, from the standard setter/getter methods +### automatically if specified. +### * In order to use approach (a) the parameter methods -getter +### and -setter can be used to specify the custom getter and +### and setter methods: +### Class D -parameter {{a -setter myset -getter myget}} +### The methods myset and myget are called like set with +### one or two arguments. They are responsible for setting and +### retrieving the appropiate values. It is possible to +### specify any one of these parameter methods. +### * In order to use approach (b) a parameter methods -access +### is use to specify an object responsible for setting/getting +### these values. This has the advantage that the custom getter and +### setter methods can be inherited from a separate class hierarchy, +### such they can used for any object without cluttering its +### interface. +### * In order to keep the parameter specification short the access +### object my contain instance variables setter or getter, naming the +### setter/getter methods. If these instance variables are not +### in the access object, "set" is used per default for getter and +### setter. These default values can be still overridden by the +### parameter methods -setter or -getter. +### * If the access object is specified, +### are passed to the setter method and are passed +### to the custom getter method (in approach (a) the object is +### is not needed). + +Object different +different set setter myset +different set getter myget +different proc myset {o var value} { $o set $var $value } +different proc myget {o var} { $o set $var } + + +Object print +print proc set {o args} { + ::set var [lindex $args 0] + if {[llength $args]==1} { + puts "*** $o get $var" + $o set $var + } else { + ::set value [lindex $args 1] + puts "*** $o set $var $value" + $o set $var $value + } +} +print proc myset {o var value} { + puts "*** $o myset $var $value" + $o set $var $value +} + +Class P +P instproc set {o args} { + puts stderr "instance [self] of parameter class P called for $o $args" + if {[llength $args] == 1} { + $o set [lindex $args 0] + } else { + $o set [lindex $args 0] [lindex $args 1] + } +} +P p + +Class M +M instproc mset args { + puts stderr "Mixin [self class] called for [self] $args" + if {[llength $args] == 1} { + my set [lindex $args 0] + } else { + my set [lindex $args 0] [lindex $args 1] + } +} + + +set x different + +Class C -parameter { + {c [self]} + d + {e ""} + {f -default 123 -setter setf -getter getf} + {g -default 1000 -access print} + {h -default 1001 -access print -setter myset} + {i -default 1002 -access different} + {j -default $x -access ::p} + {k {[self class]}} + {l -default {[self class]} } + } +C parameter [list [list z -access [P new -childof C] -default zzz]] + +C instmixin M +C parameter {{x -default 333 -setter mset -getter mset}} + +puts stderr +++[C info parameter] + +C instproc setf {var val} { + puts stderr "... setting $var to $val" + my set $var $val +} +C instproc getf var { + puts stderr "... getting value of $var" + my set $var +} + +#puts stderr "body of f: [C info instbody f]" +puts stderr "body of x: [C info instbody x]" +puts ======================create +C c1 -f 133 -g 101 -h 102 -i 103 +puts ======================readvars +foreach v [lsort [c1 info vars]] { + puts "$v = <[c1 $v]>" +} + +puts "instances of P: [P info instances]" +puts "instances of C: [C info instances]" Index: apps/scripts/pinger.xotcl =================================================================== diff -u -N --- apps/scripts/pinger.xotcl (revision 0) +++ apps/scripts/pinger.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,64 @@ +#$Id: pinger.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# include the pattern +source observer.xotcl + +Class Pinger +@ @File { + description { + Pinger example for the observer pattern taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + It demonstrates how to observe a network connection. + } +} + +Observer::Subject Pinger::Collector -parameter {hostName {update 1}} +Observer Pinger::Diagram +Observer Pinger::TextOutput + +Pinger::Collector instproc init args { + my instvar update hostName + set f [open "| ping -i $update $hostName" r] + fconfigure $f -blocking false + fileevent $f readable "[self] ping \[gets $f\]" +} + +Pinger::Collector instproc getResponse {} { + puts "in--- [self] [format %-12s [self proc]] ([self class])" +} + +Pinger::Collector instproc ping {string} { + puts "in--- [self] [format %-12s [self proc]] ([self class])" + puts $string +} + +Pinger::Diagram instproc update {subject args} { + puts "in--- [self] [format %-12s [self proc]] ([self class]) -- SUBJECT: $subject" + $subject getResponse + # do something with the response +} + +Pinger::TextOutput instproc update {subject args} { + puts "in--- [self] [format %-12s [self proc]] ([self class]) -- SUBJECT: $subject" + $subject getResponse + # do something with the response +} + +namespace eval ::Pinger { + Collector ::c1 -hostName 132.252.180.231 + Collector ::c2 -hostName 137.208.7.48 + Diagram ::d1 + Diagram ::d2 + Diagram ::d3 + TextOutput ::t1 +} + +c1 attachPre ping d1 d2 +c1 attachPost ping d2 d3 +c1 attachPost ping t1 +c2 attachPost ping t1 d2 + +#c1 detachPre ping d1 +#c1 detachPost ping d2 d3 +vwait forever + Index: apps/scripts/simpleFilters.xotcl =================================================================== diff -u -N --- apps/scripts/simpleFilters.xotcl (revision 0) +++ apps/scripts/simpleFilters.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,57 @@ +# $Id: simpleFilters.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ + +@ @File { + description { + Some simple examples of (inst)filters taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. They demonstrate filters, + filter chains and filter inheritance. + } +} + +Class A +A instproc Filter-1 args { + puts " pre-part of [self proc]" ;# pre part + next ;# next call + puts " post-part of [self proc]" ;# post part +} +A instproc printSomething args { + puts " actual called proc: [self proc]" +} +A a1 + +A instfilter Filter-1 +#a1 set x 1 + +puts "A call surrounded by pre/post messages:" +a1 printSomething + +A instfilter {} +A instproc Filter-2 args { + puts " only a pre-part in [self proc]" + next +} +A instproc Filter-3 args { + next + puts " only a post-part in [self proc]" +} +A instfilter {Filter-1 Filter-2 Filter-3} +puts "Now a filter chain:" +a1 printSomething +A instfilter {} + +Class B -superclass A +B instproc Filter-B args { + puts " entering method: [self proc]" + next +} +B b1; B b2 +A instfilter {Filter-1 Filter-2 Filter-3} +B instfilter Filter-B + +puts "And finally inheritance:" + +b1 printSomething + +B instfilter {} +A instfilter {} Index: apps/scripts/soccerClub.xotcl =================================================================== diff -u -N --- apps/scripts/soccerClub.xotcl (revision 0) +++ apps/scripts/soccerClub.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,210 @@ +# $Id: soccerClub.xotcl,v 1.7 2007/08/14 16:38:26 neumann Exp $ +# This is a simple introductory example for the language XOTcl. +# It demonstrates the basic language constructs on the example of +# a soccer club. + +package require XOTcl; namespace import -force xotcl::* + +# All the characters in this example are fictitious, and any +# resemblance to actual persons, living or deceased, is coincidental. + +# In XOTcl we do not have to provide the above file description +# as a comment, but we can use the @ object, which is used generally +# to provide any kind of information, metadata, and documentation on +# a running program. Here, we just give a file description. +# Now makeDoc.xotcl will automatically document this file for us. +@ @File { + description { + This is a simple introductory example for the language XOTcl. + It demonstrates the basic language constructs on the example of + a soccer club. + } +} + +# +# All things and entities in XOTcl are objects, a special kind of objects +# are classes. These define common properties for other objects. For a +# soccer club, we firstly require a common class for all kinds of members. +# +# Common to all members is that they have a name. Common properties defined +# across all instances of a class are called "Parameters" in XOTcl. +# +Class ClubMember -parameter {{name ""}} + +# A special club member is a Player. Derived classes can be build with +# inheritance (specified through 'superclass'). Players may have a +# playerRole (defaults to NONE): +Class Player -superclass ClubMember -parameter {{playerRole NONE}} + +# other club member types are trainers, player-trainers, and presidents +Class Trainer -superclass ClubMember +Class President -superclass ClubMember + +# the PlayerTrainer uses multiple inheritance by being both a player +# and a trainer +Class PlayerTrainer -superclass {Player Trainer} + +# +# Now we define the SoccerTeam class. +# +Class SoccerTeam -parameter {name location type} + +# We may add a player. This is done by a method. Instance methods are +# in XOTcl defined with 'instproc'. All club members are aggregated in +# the team (denoted by :: namespace syntax). +SoccerTeam instproc newPlayer args { + # we use a unique autoname for the object to prevent name + # collisions, like ::player01, ::player02, ... + eval Player [self]::[my autoname player%02d] $args +} + +# A player can be transfered to another team. The player object does +# not change internally (e.g. the playerRole stays the same). Therefore we +# 'move' it to the destination team. +SoccerTeam instproc transferPlayer {playername destinationTeam} { + # We use the aggregation introspection option 'children' in order + # to get all club members + foreach player [my info children] { + # But we only remove matching playernames of type "Player". We do + # not want to remove another club member type who has the same + # name. + if {[$player istype Player] && [$player name] == $playername} { + # We simply 'move' the player object to the destination team. + # Again we use a unique autoname in the new scope + $player move [set destinationTeam]::[$destinationTeam autoname player%02d] + } + } +} + +# Finally we define two convenience methods to print the members/players to +# stdout with puts. +SoccerTeam instproc printMembers {} { + puts "Members of [my name]:" + foreach m [my info children] {puts " [$m name]"} +} +SoccerTeam instproc printPlayers {} { + puts "Players of [my name]:" + foreach m [my info children] { + if {[$m istype Player]} {puts " [$m name]"} + } +} + +# Now let us build to example soccer team objects. +SoccerTeam lyon -name "Olympique Lyon" -location "Lyon" +SoccerTeam bayernMunich -name "F.C. Bayern München" -location "Munich" + +# With 'addPlayer' we can create new aggregated player objects +# +# Let us start some years in the past, when "Franz Beckenbauer" was +# still a player. +set fb [bayernMunich newPlayer -name "Franz Beckenbauer" \ + -playerRole PLAYER] + +# 'playerRole' may not take any value. It may either be NONE, PLAYER, +# or GOALY ... such rules may be given as assertions (here: an instinvar +# gives an invariant covering all instances of a class). In XOTcl +# the rules are syntactically identical to 'if' statements +Player instinvar { + {[my set playerRole] eq "NONE" || + [my set playerRole] eq "PLAYER" || + [my set playerRole] eq "GOALY"} +} + +# If we break the invariant and turn assertions checking on, we should +# get an error message: +$fb check all +if {[catch {$fb set playerRole SINGER} errMsg]} { + puts "CAUGHT EXCEPTION: playerRole has either to be NONE, PLAYER, or TRAINER" + # turn assertion checking off again and reset to PLAYER + $fb check {} + $fb set playerRole PLAYER +} + +# But soccer players may play quite different, orthogonal +# roles. E.g. Franz Beckenbauer was also a singer (a remarkably bad +# one). However, we can not simply add such orthogonal, extrinsic +# extensions with multiple inheritance or delegation. Otherwise we +# would have either to build a lot of unnecessary helper classes, like +# PlayerSinger, PlayerTrainerSinger, etc., or we would have to build +# such helper objects. This either leads to an unwanted combinatorial +# explosion of class or object number. +# +# Here we can use a per-object mixin, which is a language construct +# that expresses that a class is used as a role or as an extrinsic +# extension to an object. + +# First we just define the Singer class. +Class Singer +Singer instproc sing text { + puts "[my name] sings: $text, lala." +} + +# Now we register this class as a per-object mixin on the player object: +$fb mixin Singer + +# And now Franz Beckenbauer is able to sing: +$fb sing "lali" + +# But Franz Beckenbauer has already retired. When a player retires, we +# have an intrinsic change of the classification. He *is* not a player +# anymore. But still he has the same name, is club member, and +# is a singer (brrrrrr). + +# Before we perform the class change, we extend the Player class to +# support it. I.e. the playerRole is not valid after class change +# anymore (we unset the instance variable). +Player instproc class args { + my unset playerRole + next +} + +# Now we can re-class the player object to its new class (now Franz +# Beckenbauer is President of Bayern Munich. +$fb class President +# Check that the playerRole isn't there anymore. +if {[catch {$fb set playerRole} errMsg]} { + puts "CAUGHT EXCEPTION: The player role doesn't exist anymore (as it should be after the class change)" +} + +# But still Franz Beckenbauer can entertain us with what he believes +# is singing: +$fb sing "lali" + +# Now we define some new players for Bayern Munich: +bayernMunich newPlayer -name "Oliver Kahn" -playerRole GOALY +bayernMunich newPlayer -name "Giovanne Elber" -playerRole PLAYER + +# if we enlist the players of Munich Franz Beckenbauer is not enlisted +# anymore: +bayernMunich printPlayers + +# But as a president he still appears in the list of members: +bayernMunich printMembers + +# Now consider an orthonogal extension of a transfer list. Every +# transfer in the system should be notified. But since the transfer +# list is orthogonal to SoccerTeams we do not want to interfere with +# the existing implementation at all. Moreover, the targeted kind of +# extension has also to work on all subclasses of SoccerTeam. Firstly, we +# just create the extension as an ordinary class: +Class TransferObserver +TransferObserver instproc transferPlayer {pname destinationTeam} { + puts "Player '$pname' is transfered to Team '[$destinationTeam name]'" + next +} + +# Now we can apply the class as a per-class mixin, which functions +# exactly like a per-object mixin, but on all instances of a class and +# its subclasses. The 'next' primitive ensures that the original +# method on 'SoccerTeam' is called after notifying the transfer (with +# puts to stdout) +SoccerTeam instmixin TransferObserver + +# If we perform a transfer of one of the players, he is moved to the new +# club and the transfer is reported to the stdout: + +bayernMunich transferPlayer "Giovanne Elber" lyon + +# Finally we verify the transfer by printing the players: +lyon printPlayers +bayernMunich printPlayers Index: apps/utils/xo-daemon =================================================================== diff -u -N --- apps/utils/xo-daemon (revision 0) +++ apps/utils/xo-daemon (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,171 @@ +#!/usr/bin/env tclsh +package require XOTcl; namespace import -force xotcl::* + +@ @File { + description { + This script can be used to start/stop/restart xotcl daemons + and maintains the process IDs, log files and means for easy + restart. + <@p> + It receives as first parameter the name of the xotcl script + to be executed followed by the desired action and optional + parameters. The specified action can be + <@UL> + <@LI> <@EM>start: the specified script is started in + the background, an entry to restart is generated in + the run-directory as well as the process id of the started + script. In addition a logfile is created in the log directory. + If the start of the script fails, the error messages are + shown. + <@LI> <@EM>startall: all scripts that were started before + via this script, are started + <@LI> <@EM>stop terminates te specified script. + <@LI> <@EM>stopall terminates all scripts started via this + command + <@LI> <@EM>restart tries to restart the specified script. + + The optional parameters are: + <@UL> + <@LI> <@EM>-logir specifies the directory for logging. + The default is ~/.xotcl/log. + <@LI> <@EM>-rundir specifies the directory where + the information about the running processes is kept. + The default is ~/.xotcl/run. + + } + authors { + Gustaf Neumann, Gustaf.Neumann@wu-wien.ac.at + } + date "[::xotcl::rcs date {$Date: 2006/02/18 22:17:32 $}]" +} + +array set opt [list \ + -rundir $::xotcl::confdir/run \ + -logdir $::xotcl::confdir/log \ +] +if {$argc < 2} { + puts "Usage:\n\t$argv0 \ + ?options?\nOptions:\n\ + \t-logdir dirname (default: $::opt(-logdir))\n\ + \t-rundir dirname (default: $::opt(-rundir))\n" + exit -1 +} +foreach {daemon action} $argv break +array set opt [lreplace $argv 0 1] + +# The daemon scripts should be +# - location independent (if the script assumes to be started from +# a certain directory, it should cd to it) +# - parameter less (required for restart, startall, etc.) +# + +# configuration +set ::kill /bin/kill +set ::ps /bin/ps +set ::ln /bin/ln +set ::sleep /bin/sleep +set ::xotclsh /usr/bin/xotclsh + +Class Daemon -parameter progname +Daemon instproc readfile {n} { + set f [open $n r] + set c [read $f] + close $f + return [string trim $c \n] +} +Daemon instproc init {} { + if {![file isdirectory $::opt(-rundir)]} {file mkdir $::opt(-rundir)} + if {![file isdirectory $::opt(-logdir)]} {file mkdir $::opt(-logdir)} +} +Daemon instproc progname name { + set n [file tail $name] + set n [file rootname $n] + [self] set pidfile $::opt(-rundir)/$n.pid + [self] set logfile $::opt(-logdir)/$n.log + [self] set shortname $n + [self] set progname $name +} +Daemon instproc report string { + puts stderr "[[self] set shortname]: $string" +} +Daemon instproc running pid { + set r [catch {exec $::ps -h $pid} msg] + #if {$r} { [self] report "msg=$msg" } + #[self] report "running returns $r" + return [expr {!$r}] +} +Daemon instproc kill {sig pid} { + #[self] report "kill $sig $pid" + exec $::kill $sig $pid +} +Daemon instproc start {} { + [self] instvar pidfile logfile progname + if {[file exists $pidfile]} { + set pid [[self] readfile $pidfile] + [self] report "seems already running $pid" + if {[[self] running $pid]} { + [self] report "... no need to restart" + return + } else { + [self] report "... but disappeared $pid" + } + } + set linkname $::opt(-rundir)/[file tail $progname] + if {[string match *~* $linkname]} { + # file dirname ~ -> requires env(HOME) + regsub ^~ $linkname [file dirname ~]/$::env(USER) linkname + } + if {$progname != $linkname} { + #puts stderr "exec $::ln -sf $progname $linkname" + exec $::ln -sf $progname $linkname + } + set pid [exec $::xotclsh $progname >>& $logfile &] + set F [open $pidfile w] + puts $F $pid + close $F + exec sleep 1 + if {![[self] running $pid]} { + [self] report "start of $pid failed" + set size [file size $logfile] + set F [open $logfile] + if {$size > 500} {seek $F [expr {$size-500}]} + puts [read $F] + close $F + } else { + [self] report "started $pid" + } +} +Daemon instproc stop {} { + [self] instvar pidfile logfile + if {[file exists $pidfile]} { + set pid [[self] readfile $pidfile] + #[self] report "Got PID $pid" + if {[[self] running $pid]} { + [self] report "stopping $pid" + [self] kill -KILL $pid + #if {[running $pid]} {kill -KILL $pid} + } else { + [self] report "not running $pid" + } + file delete $pidfile + } else { + [self] report "was not started before" + } +} +Daemon instproc restart {} { + [self] stop + [self] start +} +Daemon instproc stopall {} { + foreach pidfile [glob -nocomplain $::opt(-rundir)/*.PID] { + set n [file rootname [file tail $pidfile]] + [self] configure -progname $n -stop + } +} +Daemon instproc startall {} { + foreach file [glob -nocomplain $::opt(-rundir)/*] { + if {[string match *.PID $file]} continue + [self] configure -progname $file -start + } +} +Daemon d -init -progname $daemon -$action Index: apps/utils/xo-whichPkg =================================================================== diff -u -N --- apps/utils/xo-whichPkg (revision 0) +++ apps/utils/xo-whichPkg (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,24 @@ +#!/usr/bin/env tclsh +# $Id: xo-whichPkg,v 1.2 2006/02/18 22:17:32 neumann Exp $ +package require XOTcl; namespace import -force xotcl::* + +@ @File { + description { + A small sample script to show which package is loaded from where + when a target package is loaded. <@p> + Usage: "xo-whichPkg -pkg PACKAGENAME" + } + authors { + Fredj Dridi dridi@nestroy.wi-inf.uni-essen.de + } + date "[::xotcl::rcs date {$Date: 2006/02/18 22:17:32 $}]" +} + +array set opts { + -pkg xotcl::comm::httpd +} +array set opts $argv + +package require xotcl::package +package verbose 1 +puts stderr [package require $opts(-pkg)] Index: apps/utils/xotclsh =================================================================== diff -u -N --- apps/utils/xotclsh (revision 0) +++ apps/utils/xotclsh (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,13 @@ +#!/usr/local/bin/tclsh8.5 +if {$argc == 0} { + puts "Don't use [info script] as interactive shell! Use instead:" + puts " /usr/local/bin/tclsh8.5" + puts " package require XOTcl; namespace import ::xotcl::*" +} else { + package require XOTcl + namespace import ::xotcl::* + set argv0 [lindex $argv 0] + set argv [lreplace $argv 0 0] + incr argc -1 + source $argv0 +} Index: apps/utils/xotclsh.in =================================================================== diff -u -N --- apps/utils/xotclsh.in (revision 0) +++ apps/utils/xotclsh.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,13 @@ +#!@TCLSH_PROG@ +if {$argc == 0} { + puts "Don't use [info script] as interactive shell! Use instead:" + puts " @TCLSH_PROG@" + puts " package require XOTcl; namespace import ::xotcl::*" +} else { + package require XOTcl + namespace import ::xotcl::* + set argv0 [lindex $argv 0] + set argv [lreplace $argv 0 0] + incr argc -1 + source $argv0 +} Index: apps/utils/xowish =================================================================== diff -u -N --- apps/utils/xowish (revision 0) +++ apps/utils/xowish (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,17 @@ +#!@WISH_PROG@ +###!/usr/local/bin/tclsh8.5 +###package require Tk +if {$argc == 0} { + puts "Don't use [info script] as interactive shell! Use instead:" + puts " @WISH_PROG@" + puts " package require XOTcl; namespace import ::xotcl::*" + exit +} else { + package require XOTcl + namespace import ::xotcl::* + set argv0 [lindex $argv 0] + set argv [lreplace $argv 0 0] + incr argc -1 + source $argv0 +} +###catch {vwait forever} Index: apps/utils/xowish.in =================================================================== diff -u -N --- apps/utils/xowish.in (revision 0) +++ apps/utils/xowish.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,17 @@ +#!@WISH_PROG@ +###!@TCLSH_PROG@ +###package require Tk +if {$argc == 0} { + puts "Don't use [info script] as interactive shell! Use instead:" + puts " @WISH_PROG@" + puts " package require XOTcl; namespace import ::xotcl::*" + exit +} else { + package require XOTcl + namespace import ::xotcl::* + set argv0 [lindex $argv 0] + set argv [lreplace $argv 0 0] + incr argc -1 + source $argv0 +} +###catch {vwait forever} \ No newline at end of file Index: autoclean.sh =================================================================== diff -u -N --- autoclean.sh (revision 0) +++ autoclean.sh (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,8 @@ +#!/bin/sh + +make distclean + +for configscript in `find . -name configure` +do + rm -f $configscript +done \ No newline at end of file Index: autogen.sh =================================================================== diff -u -N --- autogen.sh (revision 0) +++ autogen.sh (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,6 @@ +#!/bin/sh + +for pdir in `find . -name configure.in` +do + (cd `dirname $pdir`; autoconf) +done Index: config/config.guess =================================================================== diff -u -N --- config/config.guess (revision 0) +++ config/config.guess (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1415 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +timestamp='2003-10-07' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha*:OpenVMS:*:*) + echo alpha-hp-vms + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + *:UNICOS/mp:*:*) + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + # GNU/KFreeBSD systems have a "k" prefix to indicate we are using + # FreeBSD's kernel, but not the complete OS. + case ${LIBC} in gnu) kernel_only='k' ;; esac + echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: Index: config/config.sub =================================================================== diff -u -N --- config/config.sub (revision 0) +++ config/config.sub (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1510 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +timestamp='2003-10-07' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | msp430-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nv1) + basic_machine=nv1-cray + os=-unicosmp + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: Index: config/install-sh =================================================================== diff -u -N --- config/install-sh (revision 0) +++ config/install-sh (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,119 @@ +#!/bin/sh + +# +# install - install a program, script, or datafile +# This comes from X11R5; it is not part of GNU. +# +# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ +# +# This script is compatible with the BSD install script, but was written +# from scratch. +# + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" + +instcmd="$mvprog" +chmodcmd="" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +fi + +if [ x"$dst" = x ] +then + echo "install: no destination specified" + exit 1 +fi + + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + +if [ -d $dst ] +then + dst="$dst"/`basename $src` +fi + +# Make a temp file name in the proper directory. + +dstdir=`dirname $dst` +dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + +$doit $instcmd $src $dsttmp + +# and set any options; do chmod last to preserve setuid bits + +if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi +if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi +if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi +if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi + +# Now rename the file to the real destination. + +$doit $rmcmd $dst +$doit $mvcmd $dsttmp $dst + + +exit 0 Index: config/mktar.sh =================================================================== diff -u -N --- config/mktar.sh (revision 0) +++ config/mktar.sh (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,14 @@ +#!/bin/sh + +pwd=`pwd` +name=`basename $(pwd)` +echo "name=$name" + +make distclean +cd .. +tar zcvf ./$name.tar.gz \ + `find ./$name -type f -o -type l| fgrep -v CVS | fgrep -v SCCS | \ + fgrep -v Attic | fgrep -v "autom4te"| fgrep -v "~"|fgrep -v .db | \ + fgrep -v .junk | fgrep -v "#" |fgrep -v .DS_Store| fgrep -v config. | \ + fgrep -v .gdb` + Index: configure =================================================================== diff -u -N --- configure (revision 0) +++ configure (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,11483 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for xotcl 1.5.6. +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='xotcl' +PACKAGE_TARNAME='xotcl' +PACKAGE_VERSION='1.5.6' +PACKAGE_STRING='xotcl 1.5.6' +PACKAGE_BUGREPORT='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS subdirs XOTCL_VERSION XOTCL_MAJOR_VERSION XOTCL_MINOR_VERSION XOTCL_RELEASE_LEVEL TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_LIBS TK_XINCLUDES CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS aol_prefix PKG_SOURCES PKG_OBJECTS TCL_TOP_DIR_NATIVE TCL_GENERIC_DIR_NATIVE TCL_UNIX_DIR_NATIVE TCL_WIN_DIR_NATIVE TCL_BMAP_DIR_NATIVE TCL_TOOL_DIR_NATIVE TCL_PLATFORM_DIR_NATIVE TCL_INCLUDES CLEANFILES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG XOTCL_COMPATIBLE_TCLSH PKG_DIR pkgdatadir pkglibdir pkgincludedir SHARED_LIB_SUFFIX UNSHARED_LIB_SUFFIX XOTCL_BUILD_LIB_SPEC XOTCL_LIB_SPEC XOTCL_BUILD_STUB_LIB_SPEC XOTCL_STUB_LIB_SPEC XOTCL_BUILD_STUB_LIB_PATH XOTCL_STUB_LIB_PATH XOTCL_SRC_DIR XOTCLSH XOWISH XOTCL_BUILD_INCLUDE_DIR XOTCL_BUILD_INCLUDE_SPEC test_actiweb libdirs_actiweb apps_actiweb TEA_PLATFORM CONFIG_CLEAN_FILES LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures xotcl 1.5.6 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of xotcl 1.5.6:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-threads build with threads + --enable-shared build and link with shared libraries (default: on) + --enable-64bit enable 64bit support (default: off) + --enable-64bit-vis enable 64bit Sparc VIS support (default: off) + --enable-wince enable Win/CE support (where applicable) + --enable-load allow dynamic loading and "load" command (default: + on) + --enable-symbols build with debugging symbols (default: off) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gdbm=GDBM_INCLUDE_DIR,GDBM_LIB_DIR + absolute path to gdbm.h and optionally the path to the library, + --without-gdbm disables build of Tcl Gdbm + --with-aolserver3=AOL_SERVER_DIR, (containing include ,...) + --without-aolserver3 disables build of AOLserver 3 module + --with-actiweb=yes|no, + --without-actiweb disables actiweb components + --with-xotclsh=yes|no, + --without-xotclsh disables built of xotclsh + --with-xowish=yes|no, + --without-xowish disables built of xowish + --with-all=yes|no, + --without-all disables built of all + --with-tclinclude directory containing the public Tcl header files. + --with-tcl directory containing tcl configuration + (tclConfig.sh) + --with-tk directory containing tk configuration (tkConfig.sh) + --with-celib=DIR use Windows/CE support library from DIR + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +xotcl configure 1.5.6 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by xotcl $as_me 1.5.6, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#-------------------------------------------------------------------- +# Call TEA_INIT as the first TEA_ macro to set up initial vars. +# This will define a ${TEA_PLATFORM} variable == "unix" or "windows". +#-------------------------------------------------------------------- + + + # TEA extensions pass this us the version of TEA they think they + # are compatible with. + TEA_VERSION="3.6" + + echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 +echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 + if test x"${PACKAGE_NAME}" = x ; then + { { echo "$as_me:$LINENO: error: +The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 +echo "$as_me: error: +The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} + { (exit 1); exit 1; }; } + fi + if test x"3.6" = x ; then + { { echo "$as_me:$LINENO: error: +TEA version not specified." >&5 +echo "$as_me: error: +TEA version not specified." >&2;} + { (exit 1); exit 1; }; } + elif test "3.6" != "${TEA_VERSION}" ; then + echo "$as_me:$LINENO: result: warning: requested TEA version \"3.6\", have \"${TEA_VERSION}\"" >&5 +echo "${ECHO_T}warning: requested TEA version \"3.6\", have \"${TEA_VERSION}\"" >&6 + else + echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 +echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 + fi + case "`uname -s`" in + *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) + # Extract the first word of "cygpath", so it can be a program name with args. +set dummy cygpath; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CYGPATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CYGPATH"; then + ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CYGPATH="cygpath -w" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" +fi +fi +CYGPATH=$ac_cv_prog_CYGPATH +if test -n "$CYGPATH"; then + echo "$as_me:$LINENO: result: $CYGPATH" >&5 +echo "${ECHO_T}$CYGPATH" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + EXEEXT=".exe" + TEA_PLATFORM="windows" + ;; + *) + CYGPATH=echo + EXEEXT="" + TEA_PLATFORM="unix" + ;; + esac + + # Check if exec_prefix is set. If not use fall back to prefix. + # Note when adjusted, so that TEA_PREFIX can correct for this. + # This is needed for recursive configures, since autoconf propagates + # $prefix, but not $exec_prefix (doh!). + if test x$exec_prefix = xNONE ; then + exec_prefix_default=yes + exec_prefix=$prefix + fi + + + + + # This package name must be replaced statically for AC_SUBST to work + + # Substitute STUB_LIB_FILE in case package creates a stub library too. + + + # We AC_SUBST these here to ensure they are subst'ed, + # in case the user doesn't call TEA_ADD_... + + + + + + + + +ac_aux_dir= +for ac_dir in config $srcdir/config; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config $srcdir/config" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + + +#-------------------------------------------------------------------- +# specify some extra flags +#-------------------------------------------------------------------- + + +# Check whether --with-gdbm or --without-gdbm was given. +if test "${with_gdbm+set}" = set; then + withval="$with_gdbm" + with_gdbm=$withval +else + with_gdbm=no +fi; + +# Check whether --with-aolserver3 or --without-aolserver3 was given. +if test "${with_aolserver3+set}" = set; then + withval="$with_aolserver3" + with_aol3=$withval +else + with_aol3=no +fi; + +# Check whether --with-actiweb or --without-actiweb was given. +if test "${with_actiweb+set}" = set; then + withval="$with_actiweb" + with_actiweb=$withval +else + with_actiweb=no +fi; + +# Check whether --with-xotclsh or --without-xotclsh was given. +if test "${with_xotclsh+set}" = set; then + withval="$with_xotclsh" + with_xotclsh=$withval +else + with_xotclsh=no +fi; + +# Check whether --with-xowish or --without-xowish was given. +if test "${with_xowish+set}" = set; then + withval="$with_xowish" + with_xowish=$withval +else + with_xowish=no +fi; + +# Check whether --with-all or --without-all was given. +if test "${with_all+set}" = set; then + withval="$with_all" + with_all=$withval +else + with_all=no +fi; + +# Check whether --with-all or --without-all was given. +if test "${with_all+set}" = set; then + withval="$with_all" + with_all=$withval +else + with_all=no +fi; + +# Check whether --with-tclinclude or --without-tclinclude was given. +if test "${with_tclinclude+set}" = set; then + withval="$with_tclinclude" + with_tclinclude=${withval} +fi; + +subdirs="" + +if test "$with_all" = yes; then + with_actiweb=yes + with_xotclsh=yes + with_xowish=yes + with_gdbm=yes +fi + +if test "$with_actiweb" = yes; then + test_actiweb="test-actiweb" + libdirs_actiweb="actiweb rdf registry store xml patterns" + apps_actiweb="actiweb persistence" + subdirs="$subdirs library/store/XOTclSdbm/" + if ! test "$with_gdbm" = no; then + subdirs="$subdirs library/store/XOTclGdbm/" + fi + subdirs="$subdirs library/xml/TclExpat-1.1/" +else + test_actiweb="" + libdirs_actiweb="" + apps_actiweb="" +fi + + + +if test "$with_tk" = no; then with_xowish="" ; fi +if test "$with_xotclsh" = yes; then XOTCLSH="xotclsh" ; else XOTCLSH=""; fi +if test "$with_xowish" = yes; then XOWISH="xowish" ; else XOWISH=""; fi + + +#-------------------------------------------------------------------- +# __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. +#-------------------------------------------------------------------- + +# do not modify the following lines manually, they are generated with changeXOTclVersion +XOTCL_MAJOR_VERSION=1 +XOTCL_MINOR_VERSION=5 +XOTCL_RELEASE_LEVEL=.6 + +XOTCL_VERSION=${XOTCL_MAJOR_VERSION}.${XOTCL_MINOR_VERSION} +NODOT_VERSION=${XOTCL_MAJOR_VERSION}${XOTCL_MINOR_VERSION} + + + + + + +echo "Configuring XOTcl Version $PACKAGE_VERSION" + +#-------------------------------------------------------------------- +# Load the tclConfig.sh file +#-------------------------------------------------------------------- + + + + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + with_tclconfig=${withval} +fi; + echo "$as_me:$LINENO: checking for Tcl configuration" >&5 +echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 + if test "${ac_cv_c_tclconfig+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case ${with_tclconfig} in + */tclConfig.sh ) + if test -f ${with_tclconfig}; then + { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 +echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} + with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 +echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tcl.framework/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + +fi + + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 +echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} + exit 0 + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 + fi + fi + + + echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 + + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then + echo "$as_me:$LINENO: result: loading" >&5 +echo "${ECHO_T}loading" >&6 + . "${TCL_BIN_DIR}/tclConfig.sh" + else + echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tcl.framework installed in an arbitary location. + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then + for i in "`cd ${TCL_BIN_DIR}; pwd`" \ + "`cd ${TCL_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then + TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" + break + fi + done + fi + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then + TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + + + + + + + + + + + + + + + + + + + +#-------------------------------------------------------------------- +# check for TK +#-------------------------------------------------------------------- + +if test "$with_xowish" = yes; then + + # + # Ok, lets find the tk configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tk + # + + if test x"${no_tk}" = x ; then + # we reset no_tk in case something fails here + no_tk=true + +# Check whether --with-tk or --without-tk was given. +if test "${with_tk+set}" = set; then + withval="$with_tk" + with_tkconfig=${withval} +fi; + echo "$as_me:$LINENO: checking for Tk configuration" >&5 +echo $ECHO_N "checking for Tk configuration... $ECHO_C" >&6 + if test "${ac_cv_c_tkconfig+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + # First check to see if --with-tkconfig was specified. + if test x"${with_tkconfig}" != x ; then + case ${with_tkconfig} in + */tkConfig.sh ) + if test -f ${with_tkconfig}; then + { echo "$as_me:$LINENO: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5 +echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;} + with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tkconfig}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` + else + { { echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5 +echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a private Tk library + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ../tk \ + `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \ + ../../tk \ + `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \ + ../../../tk \ + `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tk.framework/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + +fi + + + if test x"${ac_cv_c_tkconfig}" = x ; then + TK_BIN_DIR="# no Tk configs found" + { echo "$as_me:$LINENO: WARNING: Can't find Tk configuration definitions" >&5 +echo "$as_me: WARNING: Can't find Tk configuration definitions" >&2;} + exit 0 + else + no_tk= + TK_BIN_DIR=${ac_cv_c_tkconfig} + echo "$as_me:$LINENO: result: found ${TK_BIN_DIR}/tkConfig.sh" >&5 +echo "${ECHO_T}found ${TK_BIN_DIR}/tkConfig.sh" >&6 + fi + fi + + + echo "$as_me:$LINENO: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5 +echo $ECHO_N "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... $ECHO_C" >&6 + + if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then + echo "$as_me:$LINENO: result: loading" >&5 +echo "${ECHO_T}loading" >&6 + . "${TK_BIN_DIR}/tkConfig.sh" + else + echo "$as_me:$LINENO: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5 +echo "${ECHO_T}could not find ${TK_BIN_DIR}/tkConfig.sh" >&6 + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" + eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" + + # If the TK_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TK_LIB_SPEC will be set to the value + # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC + # instead of TK_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TK_BIN_DIR}/Makefile" ; then + TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} + TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} + TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tk.framework installed in an arbitary location. + case ${TK_DEFS} in + *TK_FRAMEWORK*) + if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then + for i in "`cd ${TK_BIN_DIR}; pwd`" \ + "`cd ${TK_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then + TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" + break + fi + done + fi + if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then + TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" + TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" + eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" + eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" + eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" + + # Ensure windowingsystem is defined + if test "${TEA_PLATFORM}" = "unix" ; then + case ${TK_DEFS} in + *MAC_OSX_TK*) + +cat >>confdefs.h <<\_ACEOF +#define MAC_OSX_TK 1 +_ACEOF + + TEA_WINDOWINGSYSTEM="aqua" + ;; + *) + TEA_WINDOWINGSYSTEM="x11" + ;; + esac + elif test "${TEA_PLATFORM}" = "windows" ; then + TEA_WINDOWINGSYSTEM="win32" + fi + + + + + + + + + + + + + + + + +# TEA_PUBLIC_TK_HEADERS +# TEA_PATH_X +fi + +#-------------------------------------------------------------------- +# Handle the --prefix=... option by defaulting to what Tcl gave. +# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. +#----------------------------------------------------------------------- + + + if test "${prefix}" = "NONE"; then + prefix_default=yes + if test x"${TCL_PREFIX}" != x; then + { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 +echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} + prefix=${TCL_PREFIX} + else + { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 +echo "$as_me: --prefix defaulting to /usr/local" >&6;} + prefix=/usr/local + fi + fi + if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ + -o x"${exec_prefix_default}" = x"yes" ; then + if test x"${TCL_EXEC_PREFIX}" != x; then + { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 +echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} + exec_prefix=${TCL_EXEC_PREFIX} + else + { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 +echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} + exec_prefix=$prefix + fi + fi + + +#----------------------------------------------------------------------- +# Standard compiler checks. +# This sets up CC by using the CC env var, or looks for gcc otherwise. +# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create +# the basic setup necessary to compile executables. +#----------------------------------------------------------------------- + + + # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) + # in this macro, they need to go into TEA_SETUP_COMPILER instead. + + # If the user did not set CFLAGS, set it now to keep + # the AC_PROG_CC macro from adding "-g -O2". + if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" + fi + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + + #-------------------------------------------------------------------- + # Checks to see if the make program sets the $MAKE variable. + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + + #-------------------------------------------------------------------- + # Find ranlib + #-------------------------------------------------------------------- + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + #-------------------------------------------------------------------- + # Determines the correct binary file extension (.o, .obj, .exe etc.) + #-------------------------------------------------------------------- + + + + + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. + + + #------------------------------------------------------------------------ + # If we're using GCC, see if the compiler understands -pipe. If so, use it. + # It makes compiling go faster. (This is only a performance feature.) + #------------------------------------------------------------------------ + + if test -z "$no_pipe" -a -n "$GCC"; then + echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 +echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 +if test "${tcl_cv_cc_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_pipe=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_pipe=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 +echo "${ECHO_T}$tcl_cv_cc_pipe" >&6 + if test $tcl_cv_cc_pipe = yes; then + CFLAGS="$CFLAGS -pipe" + fi + fi + + #-------------------------------------------------------------------- + # Common compiler flag setup + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + + if test "${TEA_PLATFORM}" = "unix" ; then + + #-------------------------------------------------------------------- + # On a few very rare systems, all of the libm.a stuff is + # already in libc.a. Set compiler flags accordingly. + # Also, Linux requires the "ieee" library for math to work + # right (and it must appear before "-lm"). + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking for sin" >&5 +echo $ECHO_N "checking for sin... $ECHO_C" >&6 +if test "${ac_cv_func_sin+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define sin to an innocuous variant, in case declares sin. + For example, HP-UX 11i declares gettimeofday. */ +#define sin innocuous_sin + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char sin (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef sin + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char sin (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_sin) || defined (__stub___sin) +choke me +#else +char (*f) () = sin; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != sin; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_sin=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_sin=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 +echo "${ECHO_T}$ac_cv_func_sin" >&6 +if test $ac_cv_func_sin = yes; then + MATH_LIBS="" +else + MATH_LIBS="-lm" +fi + + echo "$as_me:$LINENO: checking for main in -lieee" >&5 +echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 +if test "${ac_cv_lib_ieee_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lieee $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ieee_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ieee_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 +echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 +if test $ac_cv_lib_ieee_main = yes; then + MATH_LIBS="-lieee $MATH_LIBS" +fi + + + #-------------------------------------------------------------------- + # Interactive UNIX requires -linet instead of -lsocket, plus it + # needs net/errno.h to define the socket-related error codes. + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking for main in -linet" >&5 +echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 +if test "${ac_cv_lib_inet_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-linet $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_inet_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_inet_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 +echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 +if test $ac_cv_lib_inet_main = yes; then + LIBS="$LIBS -linet" +fi + + if test "${ac_cv_header_net_errno_h+set}" = set; then + echo "$as_me:$LINENO: checking for net/errno.h" >&5 +echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_net_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking net/errno.h usability" >&5 +echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking net/errno.h presence" >&5 +echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------- ## +## Report this to the xotcl lists. ## +## -------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for net/errno.h" >&5 +echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_net_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_net_errno_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 + +fi +if test $ac_cv_header_net_errno_h = yes; then + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NET_ERRNO_H 1 +_ACEOF + +fi + + + + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- + + tcl_checkBoth=0 + echo "$as_me:$LINENO: checking for connect" >&5 +echo $ECHO_N "checking for connect... $ECHO_C" >&6 +if test "${ac_cv_func_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef connect + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_connect) || defined (__stub___connect) +choke me +#else +char (*f) () = connect; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != connect; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_connect=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +echo "${ECHO_T}$ac_cv_func_connect" >&6 +if test $ac_cv_func_connect = yes; then + tcl_checkSocket=0 +else + tcl_checkSocket=1 +fi + + if test "$tcl_checkSocket" = 1; then + echo "$as_me:$LINENO: checking for setsockopt" >&5 +echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 +if test "${ac_cv_func_setsockopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define setsockopt to an innocuous variant, in case declares setsockopt. + For example, HP-UX 11i declares gettimeofday. */ +#define setsockopt innocuous_setsockopt + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char setsockopt (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef setsockopt + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setsockopt (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_setsockopt) || defined (__stub___setsockopt) +choke me +#else +char (*f) () = setsockopt; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != setsockopt; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_setsockopt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_setsockopt=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 +echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 +if test $ac_cv_func_setsockopt = yes; then + : +else + echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 +echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_setsockopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setsockopt (); +int +main () +{ +setsockopt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_setsockopt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_socket_setsockopt=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 +if test $ac_cv_lib_socket_setsockopt = yes; then + LIBS="$LIBS -lsocket" +else + tcl_checkBoth=1 +fi + +fi + + fi + if test "$tcl_checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + echo "$as_me:$LINENO: checking for accept" >&5 +echo $ECHO_N "checking for accept... $ECHO_C" >&6 +if test "${ac_cv_func_accept+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define accept to an innocuous variant, in case declares accept. + For example, HP-UX 11i declares gettimeofday. */ +#define accept innocuous_accept + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char accept (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef accept + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char accept (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_accept) || defined (__stub___accept) +choke me +#else +char (*f) () = accept; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != accept; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_accept=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_accept=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 +echo "${ECHO_T}$ac_cv_func_accept" >&6 +if test $ac_cv_func_accept = yes; then + tcl_checkNsl=0 +else + LIBS=$tk_oldLibs +fi + + fi + echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_func_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef gethostbyname + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +char (*f) () = gethostbyname; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != gethostbyname; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 +if test $ac_cv_func_gethostbyname = yes; then + : +else + echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_nsl_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_nsl_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 +if test $ac_cv_lib_nsl_gethostbyname = yes; then + LIBS="$LIBS -lnsl" +fi + +fi + + + # Don't perform the eval of the libraries here because DL_LIBS + # won't be set until we call TEA_CONFIG_CFLAGS + + TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' + + + + + echo "$as_me:$LINENO: checking dirent.h" >&5 +echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 +if test "${tcl_cv_dirent_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ + +#ifndef _POSIX_SOURCE +# ifdef __Lynx__ + /* + * Generate compilation error to make the test fail: Lynx headers + * are only valid if really in the POSIX environment. + */ + + missing_procedure(); +# endif +#endif +DIR *d; +struct dirent *entryPtr; +char *p; +d = opendir("foobar"); +entryPtr = readdir(d); +p = entryPtr->d_name; +closedir(d); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_dirent_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_dirent_h=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 +echo "${ECHO_T}$tcl_cv_dirent_h" >&6 + + if test $tcl_cv_dirent_h = no; then + +cat >>confdefs.h <<\_ACEOF +#define NO_DIRENT_H 1 +_ACEOF + + fi + + if test "${ac_cv_header_errno_h+set}" = set; then + echo "$as_me:$LINENO: checking for errno.h" >&5 +echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_errno_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking errno.h usability" >&5 +echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking errno.h presence" >&5 +echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------- ## +## Report this to the xotcl lists. ## +## -------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for errno.h" >&5 +echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_errno_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_errno_h" >&6 + +fi +if test $ac_cv_header_errno_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_ERRNO_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_float_h+set}" = set; then + echo "$as_me:$LINENO: checking for float.h" >&5 +echo $ECHO_N "checking for float.h... $ECHO_C" >&6 +if test "${ac_cv_header_float_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 +echo "${ECHO_T}$ac_cv_header_float_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking float.h usability" >&5 +echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking float.h presence" >&5 +echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------- ## +## Report this to the xotcl lists. ## +## -------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for float.h" >&5 +echo $ECHO_N "checking for float.h... $ECHO_C" >&6 +if test "${ac_cv_header_float_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_float_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 +echo "${ECHO_T}$ac_cv_header_float_h" >&6 + +fi +if test $ac_cv_header_float_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_FLOAT_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_values_h+set}" = set; then + echo "$as_me:$LINENO: checking for values.h" >&5 +echo $ECHO_N "checking for values.h... $ECHO_C" >&6 +if test "${ac_cv_header_values_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 +echo "${ECHO_T}$ac_cv_header_values_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking values.h usability" >&5 +echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking values.h presence" >&5 +echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------- ## +## Report this to the xotcl lists. ## +## -------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for values.h" >&5 +echo $ECHO_N "checking for values.h... $ECHO_C" >&6 +if test "${ac_cv_header_values_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_values_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 +echo "${ECHO_T}$ac_cv_header_values_h" >&6 + +fi +if test $ac_cv_header_values_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_VALUES_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_limits_h+set}" = set; then + echo "$as_me:$LINENO: checking for limits.h" >&5 +echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 +if test "${ac_cv_header_limits_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +echo "${ECHO_T}$ac_cv_header_limits_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking limits.h usability" >&5 +echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking limits.h presence" >&5 +echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------- ## +## Report this to the xotcl lists. ## +## -------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for limits.h" >&5 +echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 +if test "${ac_cv_header_limits_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_limits_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +echo "${ECHO_T}$ac_cv_header_limits_h" >&6 + +fi +if test $ac_cv_header_limits_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIMITS_H 1 +_ACEOF + +else + +cat >>confdefs.h <<\_ACEOF +#define NO_LIMITS_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_stdlib_h+set}" = set; then + echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking stdlib.h usability" >&5 +echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking stdlib.h presence" >&5 +echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------- ## +## Report this to the xotcl lists. ## +## -------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_stdlib_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 + +fi +if test $ac_cv_header_stdlib_h = yes; then + tcl_ok=1 +else + tcl_ok=0 +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtol" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtoul" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtod" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + if test $tcl_ok = 0; then + +cat >>confdefs.h <<\_ACEOF +#define NO_STDLIB_H 1 +_ACEOF + + fi + if test "${ac_cv_header_string_h+set}" = set; then + echo "$as_me:$LINENO: checking for string.h" >&5 +echo $ECHO_N "checking for string.h... $ECHO_C" >&6 +if test "${ac_cv_header_string_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +echo "${ECHO_T}$ac_cv_header_string_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking string.h usability" >&5 +echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking string.h presence" >&5 +echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------- ## +## Report this to the xotcl lists. ## +## -------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for string.h" >&5 +echo $ECHO_N "checking for string.h... $ECHO_C" >&6 +if test "${ac_cv_header_string_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_string_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +echo "${ECHO_T}$ac_cv_header_string_h" >&6 + +fi +if test $ac_cv_header_string_h = yes; then + tcl_ok=1 +else + tcl_ok=0 +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strstr" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strerror" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + + # See also memmove check below for a place where NO_STRING_H can be + # set and why. + + if test $tcl_ok = 0; then + +cat >>confdefs.h <<\_ACEOF +#define NO_STRING_H 1 +_ACEOF + + fi + + if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo "$as_me:$LINENO: checking for sys/wait.h" >&5 +echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 +echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 +echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------- ## +## Report this to the xotcl lists. ## +## -------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for sys/wait.h" >&5 +echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_wait_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 + +fi +if test $ac_cv_header_sys_wait_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_SYS_WAIT_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_dlfcn_h+set}" = set; then + echo "$as_me:$LINENO: checking for dlfcn.h" >&5 +echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 +if test "${ac_cv_header_dlfcn_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 +echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 +echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 +echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------- ## +## Report this to the xotcl lists. ## +## -------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for dlfcn.h" >&5 +echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 +if test "${ac_cv_header_dlfcn_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_dlfcn_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 +echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 + +fi +if test $ac_cv_header_dlfcn_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_DLFCN_H 1 +_ACEOF + +fi + + + + # OS/390 lacks sys/param.h (and doesn't need it, by chance). + +for ac_header in sys/param.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------- ## +## Report this to the xotcl lists. ## +## -------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + # Let the user call this, because if it triggers, they will + # need a compat/strtod.c that is correct. Users can also + # use Tcl_GetDouble(FromObj) instead. + #TEA_BUGGY_STRTOD + fi + + +#-------------------------------------------------------------------- +# check for extra flags +# +# FORCE_NO_STUBS is deactivated for now +if ! test "$with_aol3" = "no"; then + echo "Pre-configuring AOL-Server (xotcl)" + AOL_DEFINES="-DAOL_SERVER -DUSE_TCL8X -I$with_aol3/include -I$TCL_SRC_DIR/generic" + FORCE_NO_STUBS=1 +else + AOL_DEFINES="" + FORCE_NO_STUBS=0 +fi + +aol_prefix="/usr/local/aolserver" +if test -d "${prefix}/modules/tcl" ; then aol_prefix="${prefix}" ; fi + + +#-------------------------------------------------------------------- +# check for tclCompile.h (needed, when compiled without full source) +if test -f "$TCL_SRC_DIR/generic/tclCompile.h"; then + HAVE_TCL_COMPILE_H="-DHAVE_TCL_COMPILE_H=1" +else + HAVE_TCL_COMPILE_H="" +fi + +#----------------------------------------------------------------------- +# __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. +#----------------------------------------------------------------------- + + + + vars="xotcl.c xotclError.c xotclMetaData.c xotclObjectData.c xotclProfile.c \ + xotclTrace.c xotclUtil.c xotclShadow.c xotclCompile.c aolstub.c xotclStubInit.c" + for i in $vars; do + case $i in + \$*) + # allow $-var names + PKG_SOURCES="$PKG_SOURCES $i" + PKG_OBJECTS="$PKG_OBJECTS $i" + ;; + *) + # check for existence - allows for generic/win/unix VPATH + # To add more dirs here (like 'src'), you have to update VPATH + # in Makefile.in as well + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 +echo "$as_me: error: could not find source file '$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_SOURCES="$PKG_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" + fi + PKG_OBJECTS="$PKG_OBJECTS $j" + ;; + esac + done + + + + + vars="generic/xotcl.h generic/xotclInt.h generic/xotclDecls.h generic/xotclIntDecls.h" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 +echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_HEADERS="$PKG_HEADERS $i" + done + + + + vars="" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + + + + vars="" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + + PKG_CFLAGS="$PKG_CFLAGS -DXOTCLVERSION=\\\"$XOTCL_VERSION\\\" -DXOTCLPATCHLEVEL=\\\"$XOTCL_RELEASE_LEVEL\\\" \ + $AOL_DEFINES $HAVE_TCL_COMPILE_H" + + + + vars="xotclStubLib.c" + for i in $vars; do + # check for existence - allows for generic/win/unix VPATH + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 +echo "$as_me: error: could not find stub source file '$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" + fi + PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" + done + + + + + vars="" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 +echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" + done + + + + +#-------------------------------------------------------------------- + +#-------------------------------------------------------------------- +# __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 TEa_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG +# so that we can extract TCL_SRC_DIR from the config file (in the case +# of private headers +#-------------------------------------------------------------------- + +#TEA_PUBLIC_TCL_HEADERS + + echo "$as_me:$LINENO: checking for Tcl private include files" >&5 +echo $ECHO_N "checking for Tcl private include files... $ECHO_C" >&6 + + TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` + TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" + TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" + TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" + TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" + TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" + TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" + TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" + + if test "${TEA_PLATFORM}" = "windows"; then + TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} + else + TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} + fi + # We want to ensure these are substituted so as not to require + # any *_NATIVE vars be defined in the Makefile + TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers and PrivateHeaders directories + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then + TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else + TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi + ;; + esac + else + if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then + { { echo "$as_me:$LINENO: error: Cannot find private header tclInt.h in ${TCL_SRC_DIR}" >&5 +echo "$as_me: error: Cannot find private header tclInt.h in ${TCL_SRC_DIR}" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + + + + + + + + + + + echo "$as_me:$LINENO: result: Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" >&5 +echo "${ECHO_T}Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" >&6 + + +if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + TCL_INCLUDES="-I${with_tclinclude} ${TCL_INCLUDES}" + else + { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain Tcl header file tcl.h" >&5 +echo "$as_me: error: ${with_tclinclude} directory does not contain Tcl header file tcl.h" >&2;} + { (exit 1); exit 1; }; } + fi +fi + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_xotcl 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. +#-------------------------------------------------------------------- + +if test "${TEA_PLATFORM}" = "windows" ; then + cat >>confdefs.h <<\_ACEOF +#define BUILD_xotcl 1 +_ACEOF + + if test "$GCC" != "yes" ; then + cat >>confdefs.h <<\_ACEOF +#define VISUAL_CC 1 +_ACEOF + + fi + CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch vc60.pch" + #TEA_ADD_SOURCES([win/winFile.c]) + #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/w +else + CLEANFILES="*.o *.a *.so *~ core gmon.out" + #TEA_ADD_SOURCES([unix/unixFile.c]) + #TEA_ADD_LIBS([-lsuperfly]) +fi + + + + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +#-------------------------------------------------------------------- + + + # Check whether --enable-threads or --disable-threads was given. +if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + + if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then + TCL_THREADS=1 + + if test "${TEA_PLATFORM}" != "windows" ; then + # We are always OK on Windows, so check what this platform wants: + + # USE_THREAD_ALLOC tells us to try the special thread-based + # allocator that significantly reduces lock contention + +cat >>confdefs.h <<\_ACEOF +#define USE_THREAD_ALLOC 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + if test "`uname -s`" = "SunOS" ; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + fi + +cat >>confdefs.h <<\_ACEOF +#define _THREAD_SAFE 1 +_ACEOF + + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 +if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 +echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char __pthread_mutex_init (); +int +main () +{ +__pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread___pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread___pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 +if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 +if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthreads $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthreads_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthreads_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 +if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 +if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_c_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 +if test $ac_cv_lib_c_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 +if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_c_r_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_r_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 +if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -pthread" + else + TCL_THREADS=0 + { echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 +echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} + fi + fi + fi + fi + fi + else + TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + echo "$as_me:$LINENO: checking for building with threads" >&5 +echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 + if test "${TCL_THREADS}" = 1; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_THREADS 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes (default)" >&5 +echo "${ECHO_T}yes (default)" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + # TCL_THREADS sanity checking. See if our request for building with + # threads is the same as the way Tcl was built. If not, warn the user. + case ${TCL_DEFS} in + *THREADS=1*) + if test "${TCL_THREADS}" = "0"; then + { echo "$as_me:$LINENO: WARNING: + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads." >&5 +echo "$as_me: WARNING: + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads." >&2;} + fi + ;; + *) + if test "${TCL_THREADS}" = "1"; then + { echo "$as_me:$LINENO: WARNING: + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core." >&5 +echo "$as_me: WARNING: + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core." >&2;} + fi + ;; + esac + + + +#-------------------------------------------------------------------- +# The statement below defines a collection of symbols related to +# building as a shared library instead of a static library. +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking how to build libraries" >&5 +echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 + # Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + + if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" ; then + echo "$as_me:$LINENO: result: shared" >&5 +echo "${ECHO_T}shared" >&6 + SHARED_BUILD=1 + else + echo "$as_me:$LINENO: result: static" >&5 +echo "${ECHO_T}static" >&6 + SHARED_BUILD=0 + +cat >>confdefs.h <<\_ACEOF +#define STATIC_BUILD 1 +_ACEOF + + fi + + + +#-------------------------------------------------------------------- +# 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. +#-------------------------------------------------------------------- + + + + + # Step 0.a: Enable 64 bit support? + + echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 +echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 + # Check whether --enable-64bit or --disable-64bit was given. +if test "${enable_64bit+set}" = set; then + enableval="$enable_64bit" + do64bit=$enableval +else + do64bit=no +fi; + echo "$as_me:$LINENO: result: $do64bit" >&5 +echo "${ECHO_T}$do64bit" >&6 + + # Step 0.b: Enable Solaris 64 bit VIS support? + + echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 +echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 + # Check whether --enable-64bit-vis or --disable-64bit-vis was given. +if test "${enable_64bit_vis+set}" = set; then + enableval="$enable_64bit_vis" + do64bitVIS=$enableval +else + do64bitVIS=no +fi; + echo "$as_me:$LINENO: result: $do64bitVIS" >&5 +echo "${ECHO_T}$do64bitVIS" >&6 + + if test "$do64bitVIS" = "yes"; then + # Force 64bit on with VIS + do64bit=yes + fi + + # Step 0.c: Cross-compiling options for Windows/CE builds? + + if test "${TEA_PLATFORM}" = "windows" ; then + echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 +echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 + # Check whether --enable-wince or --disable-wince was given. +if test "${enable_wince+set}" = set; then + enableval="$enable_wince" + doWince=$enableval +else + doWince=no +fi; + echo "$as_me:$LINENO: result: $doWince" >&5 +echo "${ECHO_T}$doWince" >&6 + fi + + # Step 1: set the variable "system" to hold the name and version number + # for the system. + + + echo "$as_me:$LINENO: checking system version" >&5 +echo $ECHO_N "checking system version... $ECHO_C" >&6 +if test "${tcl_cv_sys_version+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "${TEA_PLATFORM}" = "windows" ; then + tcl_cv_sys_version=windows + elif test -f /usr/lib/NextStep/software_version; then + tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + tcl_cv_sys_version=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 +echo "$as_me: WARNING: can't find uname command" >&2;} + tcl_cv_sys_version=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi + fi + fi + +fi +echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 +echo "${ECHO_T}$tcl_cv_sys_version" >&6 + system=$tcl_cv_sys_version + + + # Step 2: check for existence of -ldl library. This is needed because + # Linux can use either -ldl or -ldld for dynamic loading. + + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + have_dl=yes +else + have_dl=no +fi + + + # Require ranlib early so we can override it in special cases below. + + + + # Step 3: set configuration options based on system name and version. + # This is similar to Tcl's unix/tcl.m4 except that we've added a + # "windows" case. + + do64bit_ok=no + LDFLAGS_ORIG="$LDFLAGS" + # When ld needs options to work in 64-bit mode, put them in + # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] + # is disabled by the user. [Bug 1016796] + LDFLAGS_ARCH="" + TCL_EXPORT_FILE_SUFFIX="" + UNSHARED_LIB_SUFFIX="" + TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' + ECHO_VERSION='`echo ${PACKAGE_VERSION}`' + TCL_LIB_VERSIONS_OK=ok + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE=-O + if test "$GCC" = "yes" ; then + CFLAGS_OPTIMIZE=-O2 + CFLAGS_WARNING="-Wall -Wno-implicit-int" + else + CFLAGS_WARNING="" + fi + TCL_NEEDS_EXP_FILE=0 + TCL_BUILD_EXP_FILE="" + TCL_EXP_FILE="" + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STLIB_LD='${AR} cr' + LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" + case $system in + windows) + # This is a 2-stage check to make sure we have the 64-bit SDK + # We have to know where the SDK is installed. + # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs + # MACHINE is IX86 for LINK, but this is used by the manifest, + # which requires x86|amd64|ia64. + MACHINE="X86" + if test "$do64bit" != "no" ; then + if test "x${MSSDK}x" = "xx" ; then + MSSDK="C:/Progra~1/Microsoft Platform SDK" + fi + MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` + PATH64="" + case "$do64bit" in + amd64|x64|yes) + MACHINE="AMD64" ; # default to AMD64 64-bit build + PATH64="${MSSDK}/Bin/Win64/x86/AMD64" + ;; + ia64) + MACHINE="IA64" + PATH64="${MSSDK}/Bin/Win64" + ;; + esac + if test ! -d "${PATH64}" ; then + { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 +echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} + { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 +echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} + do64bit="no" + else + echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 +echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 + do64bit_ok="yes" + fi + fi + + if test "$doWince" != "no" ; then + if test "$do64bit" != "no" ; then + { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 +echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} + { (exit 1); exit 1; }; } + fi + if test "$GCC" = "yes" ; then + { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 +echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} + { (exit 1); exit 1; }; } + fi + + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-celib + + if test x"${no_celib}" = x ; then + # we reset no_celib in case something fails here + no_celib=true + +# Check whether --with-celib or --without-celib was given. +if test "${with_celib+set}" = set; then + withval="$with_celib" + with_celibconfig=${withval} +fi; + echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 +echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 + if test "${ac_cv_c_celibconfig+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + # First check to see if --with-celibconfig was specified. + if test x"${with_celibconfig}" != x ; then + if test -d "${with_celibconfig}/inc" ; then + ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` + else + { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 +echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a celib library + if test x"${ac_cv_c_celibconfig}" = x ; then + for i in \ + ../celib-palm-3.0 \ + ../celib \ + ../../celib-palm-3.0 \ + ../../celib \ + `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ + ${srcdir}/../celib-palm-3.0 \ + ${srcdir}/../celib \ + `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ + ; do + if test -d "$i/inc" ; then + ac_cv_c_celibconfig=`(cd $i; pwd)` + break + fi + done + fi + +fi + + if test x"${ac_cv_c_celibconfig}" = x ; then + { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 +echo "$as_me: error: Cannot find celib support library directory" >&2;} + { (exit 1); exit 1; }; } + else + no_celib= + CELIB_DIR=${ac_cv_c_celibconfig} + CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` + echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 +echo "${ECHO_T}found $CELIB_DIR" >&6 + fi + fi + + # Set defaults for common evc4/PPC2003 setup + # Currently Tcl requires 300+, possibly 420+ for sockets + CEVERSION=420; # could be 211 300 301 400 420 ... + TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... + ARCH=ARM; # could be ARM MIPS X86EM ... + PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" + if test "$doWince" != "yes"; then + # If !yes then the user specified something + # Reset ARCH to allow user to skip specifying it + ARCH= + eval `echo $doWince | awk -F, '{ \ + if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ + if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ + if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ + if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ + if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ + }'` + if test "x${ARCH}" = "x" ; then + ARCH=$TARGETCPU; + fi + fi + OSVERSION=WCE$CEVERSION; + if test "x${WCEROOT}" = "x" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" + if test ! -d "${WCEROOT}" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded Tools" + fi + fi + if test "x${SDKROOT}" = "x" ; then + SDKROOT="C:/Program Files/Windows CE Tools" + if test ! -d "${SDKROOT}" ; then + SDKROOT="C:/Windows CE Tools" + fi + fi + WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` + SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` + if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ + -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then + { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 +echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} + { (exit 1); exit 1; }; } + doWince="no" + else + # We could PATH_NOSPACE these, but that's not important, + # as long as we quote them when used. + CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" + if test -d "${CEINCLUDE}/${TARGETCPU}" ; then + CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" + fi + CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" + fi + fi + + if test "$GCC" != "yes" ; then + if test "${SHARED_BUILD}" = "0" ; then + runtime=-MT + else + runtime=-MD + fi + + if test "$do64bit" != "no" ; then + # All this magic is necessary for the Win64 SDK RC1 - hobbs + CC="\"${PATH64}/cl.exe\"" + CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" + RC="\"${MSSDK}/bin/rc.exe\"" + lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + LINKBIN="\"${PATH64}/link.exe\"" + CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + # Avoid 'unresolved external symbol __security_cookie' + # errors, c.f. http://support.microsoft.com/?id=894573 + + vars="bufferoverflowU.lib" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + elif test "$doWince" != "no" ; then + CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" + if test "${TARGETCPU}" = "X86"; then + CC="\"${CEBINROOT}/cl.exe\"" + else + CC="\"${CEBINROOT}/cl${ARCH}.exe\"" + fi + CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" + RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" + arch=`echo ${ARCH} | awk '{print tolower($0)}'` + defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" + if test "${SHARED_BUILD}" = "1" ; then + # Static CE builds require static celib as well + defs="${defs} _DLL" + fi + for i in $defs ; do + +cat >>confdefs.h <<_ACEOF +#define $i 1 +_ACEOF + + done + +cat >>confdefs.h <<_ACEOF +#define _WIN32_WCE $CEVERSION +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define UNDER_CE $CEVERSION +_ACEOF + + CFLAGS_DEBUG="-nologo -Zi -Od" + CFLAGS_OPTIMIZE="-nologo -Ox" + lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` + lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" + LINKBIN="\"${CEBINROOT}/link.exe\"" + + else + RC="rc" + lflags="-nologo" + LINKBIN="link" + CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + fi + fi + + if test "$GCC" = "yes"; then + # mingw gcc mode + RC="windres" + CFLAGS_DEBUG="-g" + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + SHLIB_LD="$CC -shared" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" + LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" + else + SHLIB_LD="${LINKBIN} -dll ${lflags}" + # link -lib only works when -lib is the first arg + STLIB_LD="${LINKBIN} -lib ${lflags}" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' + PATHTYPE=-w + # For information on what debugtype is most useful, see: + # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp + # This essentially turns it all on. + LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" + LDFLAGS_OPTIMIZE="-release" + if test "$doWince" != "no" ; then + LDFLAGS_CONSOLE="-link ${lflags}" + LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} + else + LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" + LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" + fi + fi + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dll" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' + + TCL_LIB_VERSIONS_OK=nodots + # Bogus to avoid getting this turned off + DL_OBJS="tclLoadNone.obj" + ;; + AIX-*) + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then + # AIX requires the _r compiler when gcc isn't being used + case "${CC}" in + *_r) + # ok ... + ;; + *) + CC=${CC}_r + ;; + esac + echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 +echo "${ECHO_T}Using $CC for compiling with threads" >&6 + fi + LIBS="$LIBS -lc" + SHLIB_CFLAGS="" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + DL_OBJS="tclLoadDl.o" + LD_LIBRARY_PATH_VAR="LIBPATH" + + # Check to enable 64-bit flags for compiler/linker on AIX 4+ + if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then + if test "$GCC" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + else + do64bit_ok=yes + CFLAGS="$CFLAGS -q64" + LDFLAGS_ARCH="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + else + SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' + fi + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then + case $LIBOBJS in + "tclLoadAix.$ac_objext" | \ + *" tclLoadAix.$ac_objext" | \ + "tclLoadAix.$ac_objext "* | \ + *" tclLoadAix.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; +esac + + DL_LIBS="-lld" + fi + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 +echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gettimeofday (); +int +main () +{ +gettimeofday (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bsd_gettimeofday=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bsd_gettimeofday=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 +if test $ac_cv_lib_bsd_gettimeofday = yes; then + libbsd=yes +else + libbsd=no +fi + + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + +cat >>confdefs.h <<\_ACEOF +#define USE_DELTA_FOR_TZ 1 +_ACEOF + + fi + ;; + BeOS*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="${CC} -nostart" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + + #----------------------------------------------------------- + # Check for inet_ntoa in -lbind, for BeOS (which also needs + # -lsocket, even if the network functions are in -lnet which + # is always linked to, for compatibility. + #----------------------------------------------------------- + echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 +echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 +if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbind $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inet_ntoa (); +int +main () +{ +inet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bind_inet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bind_inet_ntoa=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 +if test $ac_cv_lib_bind_inet_ntoa = yes; then + LIBS="$LIBS -lbind -lsocket" +fi + + ;; + BSD/OS-2.1*|BSD/OS-3*) + SHLIB_CFLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD="cc -shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + HP-UX-*.11.*) + # Use updated header definitions where possible + +cat >>confdefs.h <<\_ACEOF +#define _XOPEN_SOURCE_EXTENDED 1 +_ACEOF + + # Needed by Tcl, but not most extensions + #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) + #LIBS="$LIBS -lxnet" # Use the XOPEN network library + + if test "`uname -m`" = "ia64" ; then + SHLIB_SUFFIX=".so" + # Use newer C++ library for C++ extensions + #if test "$GCC" != "yes" ; then + # CPPFLAGS="-AA" + #fi + else + SHLIB_SUFFIX=".sl" + fi + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + SHLIB_LD_LIBS='${LIBS}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc + #CFLAGS="$CFLAGS +DAportable" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + hpux_arch=`${CC} -dumpmachine` + case $hpux_arch in + hppa64*) + # 64-bit gcc in use. Fix flags for GNU ld. + do64bit_ok=yes + SHLIB_LD="${CC} -shared" + SHLIB_LD_LIBS='${LIBS}' + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + *) + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + ;; + esac + else + do64bit_ok=yes + CFLAGS="$CFLAGS +DD64" + LDFLAGS_ARCH="+DD64" + fi + fi + ;; + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + SHLIB_SUFFIX=".sl" + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + ;; + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + ;; + IRIX-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mabi=n32" + LDFLAGS="$LDFLAGS -mabi=n32" + else + case $system in + IRIX-6.3) + # Use to build 6.2 compatible binaries on 6.3. + CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" + ;; + *) + CFLAGS="$CFLAGS -n32" + ;; + esac + LDFLAGS="$LDFLAGS -n32" + fi + ;; + IRIX64-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + + # Check to enable 64-bit flags for compiler/linker + + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 +echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} + else + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS_ARCH="-64" + fi + fi + ;; + Linux*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings + # when you inline the string and math operations. Turn this off to + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + if test $do64bit = yes; then + echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_m64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_m64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_m64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 +echo "${ECHO_T}$tcl_cv_cc_m64" >&6 + if test $tcl_cv_cc_m64 = yes; then + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + fi + fi + + # The combo of gcc + glibc has a bug related + # to inlining of functions like strtod(). The + # -fno-builtin flag should address this problem + # but it does not work. The -fno-inline flag + # is kind of overkill but it works. + # Disable inlining only when one of the + # files in compat/*.c is being linked in. + if test x"${USE_COMPAT}" != x ; then + CFLAGS="$CFLAGS -fno-inline" + fi + + ;; + GNU*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + SHLIB_LD="${CC} -shared" + DL_OBJS="" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + ;; + Lynx*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + CFLAGS_OPTIMIZE=-02 + SHLIB_LD="${CC} -shared " + DL_OBJS="tclLoadDl.o" + DL_LIBS="-mshared -ldl" + LD_FLAGS="-Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + ;; + MP-RAS-02*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + MP-RAS-*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,-Bexport" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + NetBSD-*|FreeBSD-[1-2].*) + # NetBSD/SPARC needs -fPIC, -fpic will not do. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + echo "$as_me:$LINENO: checking for ELF" >&5 +echo $ECHO_N "checking for ELF... $ECHO_C" >&6 +if test "${tcl_cv_ld_elf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef __ELF__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + tcl_cv_ld_elf=yes +else + tcl_cv_ld_elf=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 +echo "${ECHO_T}$tcl_cv_ld_elf" >&6 + if test $tcl_cv_ld_elf = yes; then + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + else + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + fi + + # Ancient FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + OpenBSD-*) + # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. + case `machine` in + sparc|sparc64) + SHLIB_CFLAGS="-fPIC";; + *) + SHLIB_CFLAGS="-fpic";; + esac + SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + echo "$as_me:$LINENO: checking for ELF" >&5 +echo $ECHO_N "checking for ELF... $ECHO_C" >&6 +if test "${tcl_cv_ld_elf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef __ELF__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + tcl_cv_ld_elf=yes +else + tcl_cv_ld_elf=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 +echo "${ECHO_T}$tcl_cv_ld_elf" >&6 + if test $tcl_cv_ld_elf = yes; then + LDFLAGS=-Wl,-export-dynamic + else + LDFLAGS="" + fi + + # OpenBSD doesn't do version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "${TCL_THREADS}" = "1" ; then + # The -pthread needs to go in the CFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + case $system in + FreeBSD-3.*) + # FreeBSD-3 doesn't handle version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + TCL_LIB_VERSIONS_OK=nodots + ;; + esac + ;; + Darwin-*) + CFLAGS_OPTIMIZE="-Os" + SHLIB_CFLAGS="-fno-common" + # To avoid discrepancies between what headers configure sees during + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: + CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" + if test $do64bit = yes; then + case `arch` in + ppc) + echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_ppc64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_arch_ppc64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_ppc64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 + if test $tcl_cv_cc_arch_ppc64 = yes; then + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + do64bit_ok=yes + fi;; + i386) + echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_x86_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch x86_64" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_arch_x86_64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_x86_64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 + if test $tcl_cv_cc_arch_x86_64 = yes; then + CFLAGS="$CFLAGS -arch x86_64" + do64bit_ok=yes + fi;; + *) + { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 +echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; + esac + else + # Check for combined 32-bit and 64-bit fat build + echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ + echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ + fat_32_64=yes + fi + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' + echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 +echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_single_module+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_single_module=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_single_module=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 +echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 + if test $tcl_cv_ld_single_module = yes; then + SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + fi + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" + DL_LIBS="" + # Don't use -prebind when building for Mac OS X 10.4 or later only: + test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \ + LDFLAGS="$LDFLAGS -prebind" + LDFLAGS="$LDFLAGS -headerpad_max_install_names" + echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 +echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_search_paths_first+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_search_paths_first=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_search_paths_first=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 +echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 + if test $tcl_cv_ld_search_paths_first = yes; then + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + + # TEA specific: for Tk extensions, remove 64-bit arch flags from + # CFLAGS et al. for combined 32 & 64 bit fat builds as neither + # TkAqua nor TkX11 can be built for 64-bit at present. + test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done + ;; + NEXTSTEP-*) + SHLIB_CFLAGS="" + SHLIB_LD="cc -nostdlib -r" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadNext.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OS/390-*) + CFLAGS_OPTIMIZE="" # Optimizer is buggy + +cat >>confdefs.h <<\_ACEOF +#define _OE_SOCKETS 1 +_ACEOF + + ;; + OSF1-1.0|OSF1-1.1|OSF1-1.2) + # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + SHLIB_CFLAGS="" + # Hack: make package name same as library name + SHLIB_LD='ld -R -export :' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadOSF.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-1.*) + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SHLIB_CFLAGS="-fPIC" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD="ld -shared" + else + SHLIB_LD="ld -non_shared" + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-V*) + # Digital OSF/1 + SHLIB_CFLAGS="" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD='ld -shared -expect_unresolved "*"' + else + SHLIB_LD='ld -non_shared -expect_unresolved "*"' + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mieee" + else + CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" + fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = "1" ; then + CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" + CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + LIBS=`echo $LIBS | sed s/-lpthreads//` + if test "$GCC" = "yes" ; then + LIBS="$LIBS -lpthread -lmach -lexc" + else + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + fi + + ;; + QNX-6*) + # QNX RTP + # This may work for all QNX, but it was only reported for v6. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + # dlopen is in -lc on QNX + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SCO_SV-3.2*) + # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # this test works, since "uname -s" was non-standard in 3.2.4 and + # below. + if test "$GCC" = "yes" ; then + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + else + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + fi + SHLIB_LD="ld -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SINIX*5.4*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SunOS-4*) + SHLIB_CFLAGS="-PIC" + SHLIB_LD="ld" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + + # SunOS can't handle version numbers with dots in them in library + # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it + # requires an extra version number at the end of .so file names. + # So, the library has to have a name like libtcl75.so.1.0 + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + SunOS-5.[0-6]) + # Careful to not let 5.10+ fall into this case + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + + SHLIB_CFLAGS="-KPIC" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + ;; + SunOS-5*) + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + + SHLIB_CFLAGS="-KPIC" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + arch=`isainfo` + if test "$arch" = "sparcv9 sparc" ; then + if test "$GCC" = "yes" ; then + if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} + else + do64bit_ok=yes + CFLAGS="$CFLAGS -m64 -mcpu=v9" + LDFLAGS="$LDFLAGS -m64 -mcpu=v9" + SHLIB_CFLAGS="-fPIC" + fi + else + do64bit_ok=yes + if test "$do64bitVIS" = "yes" ; then + CFLAGS="$CFLAGS -xarch=v9a" + LDFLAGS_ARCH="-xarch=v9a" + else + CFLAGS="$CFLAGS -xarch=v9" + LDFLAGS_ARCH="-xarch=v9" + fi + # Solaris 64 uses this as well + #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" + fi + elif test "$arch" = "amd64 i386" ; then + if test "$GCC" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + else + do64bit_ok=yes + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64" + fi + else + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 +echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} + fi + fi + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "$do64bit_ok" = "yes" ; then + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + fi + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + fi + ;; + UNIX_SV* | UnixWare-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 +echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_Bexport+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-Bexport" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_Bexport=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_Bexport=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 +echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 + if test $tcl_cv_ld_Bexport = yes; then + LDFLAGS="$LDFLAGS -Wl,-Bexport" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + esac + + if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then + { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 +echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} + fi + + + + # Step 4: disable dynamic loading if requested via a command-line switch. + + # Check whether --enable-load or --disable-load was given. +if test "${enable_load+set}" = set; then + enableval="$enable_load" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + if test "$tcl_ok" = "no"; then + DL_OBJS="" + fi + + if test "x$DL_OBJS" != "x" ; then + BUILD_DLTEST="\$(DLTEST_TARGETS)" + else + echo "Can't figure out how to do dynamic loading or shared libraries" + echo "on this system." + SHLIB_CFLAGS="" + SHLIB_LD="" + SHLIB_SUFFIX="" + DL_OBJS="tclLoadNone.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS_ORIG" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + BUILD_DLTEST="" + fi + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" + + # If we're running gcc, then change the C flags for compiling shared + # libraries to the right flags for gcc, instead of those for the + # standard manufacturer compiler. + + if test "$DL_OBJS" != "tclLoadNone.o" ; then + if test "$GCC" = "yes" ; then + case $system in + AIX-*) + ;; + BSD/OS*) + ;; + IRIX*) + ;; + NetBSD-*|FreeBSD-*) + ;; + Darwin-*) + ;; + SCO_SV-3.2*) + ;; + windows) + ;; + *) + SHLIB_CFLAGS="-fPIC" + ;; + esac + fi + fi + + if test "$SHARED_LIB_SUFFIX" = "" ; then + SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' + fi + if test "$UNSHARED_LIB_SUFFIX" = "" ; then + UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' + fi + + + + + + + + + + + + + + + + # These must be called after we do the basic CFLAGS checks and + # verify any possible 64-bit or similar switches are necessary + + echo "$as_me:$LINENO: checking for required early compiler flags" >&5 +echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 + tcl_flags="" + + if test "${tcl_cv_flag__isoc99_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *)strtoll; char *q = (char *)strtoull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__isoc99_source=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _ISOC99_SOURCE 1 +#include +int +main () +{ +char *p = (char *)strtoll; char *q = (char *)strtoull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__isoc99_source=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__isoc99_source=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _ISOC99_SOURCE 1 +_ACEOF + + tcl_flags="$tcl_flags _ISOC99_SOURCE" + fi + + + if test "${tcl_cv_flag__largefile64_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile64_source=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE64_SOURCE 1 +#include +int +main () +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile64_source=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__largefile64_source=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _LARGEFILE64_SOURCE 1 +_ACEOF + + tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" + fi + + + if test "${tcl_cv_flag__largefile_source64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *)open64; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile_source64=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE64 1 +#include +int +main () +{ +char *p = (char *)open64; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile_source64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__largefile_source64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _LARGEFILE_SOURCE64 1 +_ACEOF + + tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" + fi + + if test "x${tcl_flags}" = "x" ; then + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 + else + echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 +echo "${ECHO_T}${tcl_flags}" >&6 + fi + + + echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 +echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 + if test "${tcl_cv_type_64bit+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +__int64 value = (__int64) 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_type_64bit=__int64 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_type_64bit="long long" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +switch (0) { + case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; + } + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_type_64bit=${tcl_type_64bit} +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "${tcl_cv_type_64bit}" = none ; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_WIDE_INT_IS_LONG 1 +_ACEOF + + echo "$as_me:$LINENO: result: using long" >&5 +echo "${ECHO_T}using long" >&6 + elif test "${tcl_cv_type_64bit}" = "__int64" \ + -a "${TEA_PLATFORM}" = "windows" ; then + # We actually want to use the default tcl.h checks in this + # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* + echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 +echo "${ECHO_T}using Tcl header defaults" >&6 + else + +cat >>confdefs.h <<_ACEOF +#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} +_ACEOF + + echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 +echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 + + # Now check for auxiliary declarations + echo "$as_me:$LINENO: checking for struct dirent64" >&5 +echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 +if test "${tcl_cv_struct_dirent64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +struct dirent64 p; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_struct_dirent64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_struct_dirent64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 +echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_DIRENT64 1 +_ACEOF + + fi + + echo "$as_me:$LINENO: checking for struct stat64" >&5 +echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 +if test "${tcl_cv_struct_stat64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +struct stat64 p; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_struct_stat64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_struct_stat64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 +echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_STAT64 1 +_ACEOF + + fi + + + +for ac_func in open64 lseek64 +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + echo "$as_me:$LINENO: checking for off64_t" >&5 +echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 + if test "${tcl_cv_type_off64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +off64_t offset; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_type_off64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_type_off64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_type_off64_t}" = "xyes" && \ + test "x${ac_cv_func_lseek64}" = "xyes" && \ + test "x${ac_cv_func_open64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_TYPE_OFF64_T 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + fi + + + +# Without the following two eval statements, XOTCL_SHARED_LIB_SUFFIX +# in xotclConfig.sh has $PACKAGE_VERSION unresolved. When another +# app links against xotcl, the PACKAGE_VERSIONs are confused. +# +# Without the first eval, we get +# XOTCL_SHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}${SHLIB_SUFFIX} +# XOTCL_UNSHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}.a +# +# after the first eval, we get +# XOTCL_SHARED_LIB_SUFFIX=1.2.1${DBGX}.so +# XOTCL_UNSHARED_LIB_SUFFIX=1.2.1${DBGX}.a +# after the second eval, all variables are resolved. + + +eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" +eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" + +#eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" +#eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols +# option. +#-------------------------------------------------------------------- + + + + echo "$as_me:$LINENO: checking for build with symbols" >&5 +echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 + # Check whether --enable-symbols or --disable-symbols was given. +if test "${enable_symbols+set}" = set; then + enableval="$enable_symbols" + tcl_ok=$enableval +else + tcl_ok=no +fi; + DBGX="" + if test "$tcl_ok" = "no"; then + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + else + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" + if test "$tcl_ok" = "yes"; then + echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 +echo "${ECHO_T}yes (standard debugging)" >&6 + fi + fi + if test "${TEA_PLATFORM}" != "windows" ; then + LDFLAGS_DEFAULT="${LDFLAGS}" + fi + + + + + + if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_MEM_DEBUG 1 +_ACEOF + + fi + + if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then + if test "$tcl_ok" = "all"; then + echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 +echo "${ECHO_T}enabled symbols mem debugging" >&6 + else + echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 +echo "${ECHO_T}enabled $tcl_ok debugging" >&6 + fi + fi + + +#-------------------------------------------------------------------- +# Everyone should be linking against the Tcl stub library. If you +# can't for some reason, remove this definition. If you aren't using +# stubs, you also need to modify the SHLIB_LD_LIBS setting below to +# link against the non-stubbed Tcl library. +#-------------------------------------------------------------------- + + +#if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then +# FORCE_NO_STUBS=1 +#fi + +if test "${FORCE_NO_STUBS}" = "0" ; then + cat >>confdefs.h <<\_ACEOF +#define USE_TCL_STUBS 1 +_ACEOF + +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. +#-------------------------------------------------------------------- + + + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then + MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" + MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" + else + MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" + MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" + fi + + if test "${SHARED_BUILD}" = "1" ; then + MAKE_LIB="${MAKE_SHARED_LIB} " + else + MAKE_LIB="${MAKE_STATIC_LIB} " + fi + + #-------------------------------------------------------------------- + # Shared libraries and static libraries have different names. + # Use the double eval to make sure any variables in the suffix is + # substituted. (@@@ Might not be necessary anymore) + #-------------------------------------------------------------------- + + if test "${TEA_PLATFORM}" = "windows" ; then + if test "${SHARED_BUILD}" = "1" ; then + # We force the unresolved linking of symbols that are really in + # the private libraries of Tcl and Tk. + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" + fi + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + else + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + if test "$GCC" = "yes"; then + PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} + fi + # These aren't needed on Windows (either MSVC or gcc) + RANLIB=: + RANLIB_STUB=: + else + RANLIB_STUB="${RANLIB}" + if test "${SHARED_BUILD}" = "1" ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" + fi + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + fi + + # These are escaped so that only CFLAGS is picked up at configure time. + # The other values will be substituted at make time. + CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" + if test "${SHARED_BUILD}" = "1" ; then + CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" + fi + + + + + + + + +#-------------------------------------------------------------------- +# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl +# file during the install process. Don't run the TCLSH_PROG through +# ${CYGPATH} because it's being used directly by make. +# Require that we use a tclsh shell version 8.2 or later since earlier +# versions have bugs in the pkg_mkIndex routine. +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking for tclsh" >&5 +echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 + if test -f "${TCL_BIN_DIR}/Makefile" ; then + # tclConfig.sh is in Tcl build directory + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="${TCL_BIN_DIR}/tclsh" + fi + else + # tclConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" + fi + list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${TCLSH_PROG}" ; then + REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" + fi + echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 +echo "${ECHO_T}${TCLSH_PROG}" >&6 + + + +# make this available, for such as xotclConfig.sh +XOTCL_COMPATIBLE_TCLSH=${TCLSH_PROG} + + +# resolve the variables +eval "libdir=${libdir}" +eval "datadir=${datadir}" +eval "includedir=${includedir}" + +PKG_DIR="${PACKAGE_NAME}${PACKAGE_VERSION}" +pkgdatadir="${datadir}/${PKG_DIR}" +pkglibdir="${libdir}/${PKG_DIR}" +# make sure this is right (then remove this comment) +pkgincludedir="${includedir}/${PKG_DIR}" + + + + + + +# +# XOTcl specific configs +# + +if test "${TEA_PLATFORM}" != "windows" ; then + +XOTCL_BUILD_LIB_SPEC="-L`pwd` -lxotcl${PACKAGE_VERSION}" +XOTCL_LIB_SPEC="-L${pkglibdir} -lxotcl${PACKAGE_VERSION}" + +# stub libs are not build for 8.0 +if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then + XOTCL_BUILD_STUB_LIB_PATH="" + XOTCL_STUB_LIB_PATH="" + XOTCL_BUILD_STUB_LIB_SPEC="" + XOTCL_STUB_LIB_SPEC="" +else + XOTCL_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}" + XOTCL_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}" + XOTCL_BUILD_STUB_LIB_SPEC="-L`pwd` -lxotclstub${PACKAGE_VERSION}" + XOTCL_STUB_LIB_SPEC="-L${pkglibdir} -lxotclstub${PACKAGE_VERSION}" + cat >>confdefs.h <<\_ACEOF +#define COMPILE_XOTCL_STUBS 1 +_ACEOF + +fi + +else + +XOTCL_BUILD_LIB_SPEC="`pwd`/${PKG_LIB_FILE}" +XOTCL_LIB_SPEC="${pkglibdir}/${PKG_LIB_FILE}" +XOTCL_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}" +XOTCL_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}" +XOTCL_BUILD_STUB_LIB_SPEC="`pwd`/${PKG_STUB_LIB_FILE}" +XOTCL_STUB_LIB_SPEC="${pkglibdir}/${PKG_STUB_LIB_FILE}" + +fi + + + + + + + + + +XOTCL_SRC_DIR=$srcdir + + + + +# include dir of xotcl during build process (i.e., does not assume installed) +XOTCL_BUILD_INCLUDE_DIR="${XOTCL_SRC_DIR}/generic" +XOTCL_BUILD_INCLUDE_SPEC="-I${XOTCL_BUILD_INCLUDE_DIR}" + + + + + + + + + + + + +#-------------------------------------------------------------------- +# the value of this variable is set to the files which are to be +# removed when the user invokes 'make distclean' (i.e., those +# files generated by ./configure) and is used in the make distclean +# target, defined in Makefile.in +#-------------------------------------------------------------------- + +CONFIG_CLEAN_FILES="Makefile xotclConfig.sh apps/utils/xotclsh apps/utils/xowish unix/xotcl.spec unix/pkgIndex.unix autom4te.cache/" + + ac_config_files="$ac_config_files Makefile xotclConfig.sh apps/utils/xotclsh apps/utils/xowish unix/xotcl.spec unix/pkgIndex.unix" + + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile, +# and generate the other output files. (this is done by invoking +# config.status) +# +# NOTE the lack of parameters! AC_OUTPUT with params is deprecated; +# use macros such as AC_CONFIG_FILES, AC_HEADER_FILES, etc to add +# to the files output by ./configure. +#-------------------------------------------------------------------- + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by xotcl $as_me 1.5.6, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +xotcl config.status 1.5.6 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "xotclConfig.sh" ) CONFIG_FILES="$CONFIG_FILES xotclConfig.sh" ;; + "apps/utils/xotclsh" ) CONFIG_FILES="$CONFIG_FILES apps/utils/xotclsh" ;; + "apps/utils/xowish" ) CONFIG_FILES="$CONFIG_FILES apps/utils/xowish" ;; + "unix/xotcl.spec" ) CONFIG_FILES="$CONFIG_FILES unix/xotcl.spec" ;; + "unix/pkgIndex.unix" ) CONFIG_FILES="$CONFIG_FILES unix/pkgIndex.unix" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@CYGPATH@,$CYGPATH,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t +s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t +s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t +s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t +s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t +s,@PKG_HEADERS@,$PKG_HEADERS,;t t +s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t +s,@PKG_LIBS@,$PKG_LIBS,;t t +s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t +s,@subdirs@,$subdirs,;t t +s,@XOTCL_VERSION@,$XOTCL_VERSION,;t t +s,@XOTCL_MAJOR_VERSION@,$XOTCL_MAJOR_VERSION,;t t +s,@XOTCL_MINOR_VERSION@,$XOTCL_MINOR_VERSION,;t t +s,@XOTCL_RELEASE_LEVEL@,$XOTCL_RELEASE_LEVEL,;t t +s,@TCL_VERSION@,$TCL_VERSION,;t t +s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t +s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t +s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t +s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t +s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t +s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t +s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t +s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t +s,@TCL_LIBS@,$TCL_LIBS,;t t +s,@TCL_DEFS@,$TCL_DEFS,;t t +s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t +s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t +s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t +s,@TK_VERSION@,$TK_VERSION,;t t +s,@TK_BIN_DIR@,$TK_BIN_DIR,;t t +s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t +s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t +s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t +s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t +s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t +s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t +s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t +s,@TK_LIBS@,$TK_LIBS,;t t +s,@TK_XINCLUDES@,$TK_XINCLUDES,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@EGREP@,$EGREP,;t t +s,@MATH_LIBS@,$MATH_LIBS,;t t +s,@aol_prefix@,$aol_prefix,;t t +s,@PKG_SOURCES@,$PKG_SOURCES,;t t +s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t +s,@TCL_TOP_DIR_NATIVE@,$TCL_TOP_DIR_NATIVE,;t t +s,@TCL_GENERIC_DIR_NATIVE@,$TCL_GENERIC_DIR_NATIVE,;t t +s,@TCL_UNIX_DIR_NATIVE@,$TCL_UNIX_DIR_NATIVE,;t t +s,@TCL_WIN_DIR_NATIVE@,$TCL_WIN_DIR_NATIVE,;t t +s,@TCL_BMAP_DIR_NATIVE@,$TCL_BMAP_DIR_NATIVE,;t t +s,@TCL_TOOL_DIR_NATIVE@,$TCL_TOOL_DIR_NATIVE,;t t +s,@TCL_PLATFORM_DIR_NATIVE@,$TCL_PLATFORM_DIR_NATIVE,;t t +s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t +s,@CLEANFILES@,$CLEANFILES,;t t +s,@TCL_THREADS@,$TCL_THREADS,;t t +s,@SHARED_BUILD@,$SHARED_BUILD,;t t +s,@AR@,$AR,;t t +s,@CELIB_DIR@,$CELIB_DIR,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@DL_LIBS@,$DL_LIBS,;t t +s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t +s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t +s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t +s,@STLIB_LD@,$STLIB_LD,;t t +s,@SHLIB_LD@,$SHLIB_LD,;t t +s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t +s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t +s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t +s,@TCL_DBGX@,$TCL_DBGX,;t t +s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t +s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t +s,@MAKE_LIB@,$MAKE_LIB,;t t +s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t +s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t +s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t +s,@RANLIB_STUB@,$RANLIB_STUB,;t t +s,@TCLSH_PROG@,$TCLSH_PROG,;t t +s,@XOTCL_COMPATIBLE_TCLSH@,$XOTCL_COMPATIBLE_TCLSH,;t t +s,@PKG_DIR@,$PKG_DIR,;t t +s,@pkgdatadir@,$pkgdatadir,;t t +s,@pkglibdir@,$pkglibdir,;t t +s,@pkgincludedir@,$pkgincludedir,;t t +s,@SHARED_LIB_SUFFIX@,$SHARED_LIB_SUFFIX,;t t +s,@UNSHARED_LIB_SUFFIX@,$UNSHARED_LIB_SUFFIX,;t t +s,@XOTCL_BUILD_LIB_SPEC@,$XOTCL_BUILD_LIB_SPEC,;t t +s,@XOTCL_LIB_SPEC@,$XOTCL_LIB_SPEC,;t t +s,@XOTCL_BUILD_STUB_LIB_SPEC@,$XOTCL_BUILD_STUB_LIB_SPEC,;t t +s,@XOTCL_STUB_LIB_SPEC@,$XOTCL_STUB_LIB_SPEC,;t t +s,@XOTCL_BUILD_STUB_LIB_PATH@,$XOTCL_BUILD_STUB_LIB_PATH,;t t +s,@XOTCL_STUB_LIB_PATH@,$XOTCL_STUB_LIB_PATH,;t t +s,@XOTCL_SRC_DIR@,$XOTCL_SRC_DIR,;t t +s,@XOTCLSH@,$XOTCLSH,;t t +s,@XOWISH@,$XOWISH,;t t +s,@XOTCL_BUILD_INCLUDE_DIR@,$XOTCL_BUILD_INCLUDE_DIR,;t t +s,@XOTCL_BUILD_INCLUDE_SPEC@,$XOTCL_BUILD_INCLUDE_SPEC,;t t +s,@test_actiweb@,$test_actiweb,;t t +s,@libdirs_actiweb@,$libdirs_actiweb,;t t +s,@apps_actiweb@,$apps_actiweb,;t t +s,@TEA_PLATFORM@,$TEA_PLATFORM,;t t +s,@CONFIG_CLEAN_FILES@,$CONFIG_CLEAN_FILES,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + + +here=${PWD} + +for subdir in ${subdirs} +do + echo "==================== configure $subdir =====================" + if test x"${srcdir}" = x. ; then + confdir=. + else + mkdir -p $subdir + confdir=${srcdir}/$subdir + fi + (cd $subdir; echo $SHELL ${confdir}/configure ${ac_configure_args} --with-xotcl=${here}; eval $SHELL ${confdir}/configure ${ac_configure_args} --with-xotcl=${here}) +done + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: configure.in =================================================================== diff -u -N --- configure.in (revision 0) +++ configure.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,495 @@ + +#-------------------------------------------------------------------- +# 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: +# +#-------------------------------------------------------------------- +define(XOTclVersion, 1.5.6) +AC_INIT([xotcl], [XOTclVersion]) + +#-------------------------------------------------------------------- +# Call TEA_INIT as the first TEA_ macro to set up initial vars. +# This will define a ${TEA_PLATFORM} variable == "unix" or "windows". +#-------------------------------------------------------------------- + +TEA_INIT([3.6]) +AC_CONFIG_AUX_DIR(config) + +#-------------------------------------------------------------------- +# specify some extra flags +#-------------------------------------------------------------------- + +AC_ARG_WITH(gdbm, + [ --with-gdbm=GDBM_INCLUDE_DIR[,GDBM_LIB_DIR] + absolute path to gdbm.h and optionally the path to the library, + --without-gdbm disables build of Tcl Gdbm], + [with_gdbm=$withval], [with_gdbm=no]) +AC_ARG_WITH(aolserver3, + [ --with-aolserver3=AOL_SERVER_DIR, (containing include ,...) + --without-aolserver3 disables build of AOLserver 3 module], + [with_aol3=$withval], [with_aol3=no]) +AC_ARG_WITH(actiweb, + [ --with-actiweb=yes|no, + --without-actiweb disables actiweb components], + [with_actiweb=$withval], [with_actiweb=no]) +AC_ARG_WITH(xotclsh, + [ --with-xotclsh=yes|no, + --without-xotclsh disables built of xotclsh], + [with_xotclsh=$withval], [with_xotclsh=no]) +AC_ARG_WITH(xowish, + [ --with-xowish=yes|no, + --without-xowish disables built of xowish], + [with_xowish=$withval], [with_xowish=no]) +AC_ARG_WITH(all, + [ --with-all=yes|no, + --without-all disables built of all], + [with_all=$withval], [with_all=no]) +AC_ARG_WITH(all, + [ --with-all=yes|no, + --without-all disables built of all], + [with_all=$withval], [with_all=no]) +AC_ARG_WITH(tclinclude, + [ --with-tclinclude directory containing the public Tcl header files.], + with_tclinclude=${withval}) + +subdirs="" + +if test "$with_all" = yes; then + with_actiweb=yes + with_xotclsh=yes + with_xowish=yes + with_gdbm=yes +fi + +if test "$with_actiweb" = yes; then + test_actiweb="test-actiweb" + libdirs_actiweb="actiweb rdf registry store xml patterns" + apps_actiweb="actiweb persistence" + subdirs="$subdirs library/store/XOTclSdbm/" +dnl AC_CONFIG_SUBDIRS(library/store/XOTclSdbm/) + if ! test "$with_gdbm" = no; then + subdirs="$subdirs library/store/XOTclGdbm/" +dnl AC_CONFIG_SUBDIRS(library/store/XOTclGdbm/) + fi + subdirs="$subdirs library/xml/TclExpat-1.1/" +dnl AC_CONFIG_SUBDIRS(library/xml/TclExpat-1.1/) +else + test_actiweb="" + libdirs_actiweb="" + apps_actiweb="" +fi + +AC_SUBST(subdirs) + +if test "$with_tk" = no; then with_xowish="" ; fi +if test "$with_xotclsh" = yes; then XOTCLSH="xotclsh" ; else XOTCLSH=""; fi +if test "$with_xowish" = yes; then XOWISH="xowish" ; else XOWISH=""; fi + + +#-------------------------------------------------------------------- +# __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. +#-------------------------------------------------------------------- + +# do not modify the following lines manually, they are generated with changeXOTclVersion +XOTCL_MAJOR_VERSION=1 +XOTCL_MINOR_VERSION=5 +XOTCL_RELEASE_LEVEL=.6 + +XOTCL_VERSION=${XOTCL_MAJOR_VERSION}.${XOTCL_MINOR_VERSION} +NODOT_VERSION=${XOTCL_MAJOR_VERSION}${XOTCL_MINOR_VERSION} + +AC_SUBST(XOTCL_VERSION) +AC_SUBST(XOTCL_MAJOR_VERSION) +AC_SUBST(XOTCL_MINOR_VERSION) +AC_SUBST(XOTCL_RELEASE_LEVEL) + +echo "Configuring XOTcl Version $PACKAGE_VERSION" + +#-------------------------------------------------------------------- +# Load the tclConfig.sh file +#-------------------------------------------------------------------- + +TEA_PATH_TCLCONFIG +TEA_LOAD_TCLCONFIG + +#-------------------------------------------------------------------- +# check for TK +#-------------------------------------------------------------------- + +if test "$with_xowish" = yes; then + TEA_PATH_TKCONFIG + TEA_LOAD_TKCONFIG +# TEA_PUBLIC_TK_HEADERS +# TEA_PATH_X +fi + +#-------------------------------------------------------------------- +# 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, AC_PROG_INSTALL and a few others to create +# the basic setup necessary to compile executables. +#----------------------------------------------------------------------- + +TEA_SETUP_COMPILER + +#-------------------------------------------------------------------- +# check for extra flags +# +# FORCE_NO_STUBS is deactivated for now +if ! test "$with_aol3" = "no"; then + echo "Pre-configuring AOL-Server (xotcl)" + AOL_DEFINES="-DAOL_SERVER -DUSE_TCL8X -I$with_aol3/include -I$TCL_SRC_DIR/generic" + FORCE_NO_STUBS=1 +else + AOL_DEFINES="" + FORCE_NO_STUBS=0 +fi + +aol_prefix="/usr/local/aolserver" +if test -d "${prefix}/modules/tcl" ; then aol_prefix="${prefix}" ; fi +AC_SUBST(aol_prefix) + +#-------------------------------------------------------------------- +# check for tclCompile.h (needed, when compiled without full source) +if test -f "$TCL_SRC_DIR/generic/tclCompile.h"; then + HAVE_TCL_COMPILE_H="-DHAVE_TCL_COMPILE_H=1" +else + HAVE_TCL_COMPILE_H="" +fi + +#----------------------------------------------------------------------- +# __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([xotcl.c xotclError.c xotclMetaData.c xotclObjectData.c xotclProfile.c \ + xotclTrace.c xotclUtil.c xotclShadow.c xotclCompile.c aolstub.c xotclStubInit.c]) +TEA_ADD_HEADERS([generic/xotcl.h generic/xotclInt.h generic/xotclDecls.h generic/xotclIntDecls.h]) +TEA_ADD_INCLUDES([]) +TEA_ADD_LIBS([]) +TEA_ADD_CFLAGS([-DXOTCLVERSION=\\\"$XOTCL_VERSION\\\" -DXOTCLPATCHLEVEL=\\\"$XOTCL_RELEASE_LEVEL\\\" \ + $AOL_DEFINES $HAVE_TCL_COMPILE_H]) +TEA_ADD_STUB_SOURCES([xotclStubLib.c]) +TEA_ADD_TCL_SOURCES([]) + + +#-------------------------------------------------------------------- + +#-------------------------------------------------------------------- +# __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 TEa_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG +# so that we can extract TCL_SRC_DIR from the config file (in the case +# of private headers +#-------------------------------------------------------------------- + +#TEA_PUBLIC_TCL_HEADERS +TEA_PRIVATE_TCL_HEADERS + +if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + TCL_INCLUDES="-I${with_tclinclude} ${TCL_INCLUDES}" + else + AC_MSG_ERROR([${with_tclinclude} directory does not contain Tcl header file tcl.h]) + fi +fi + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_xotcl 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. +#-------------------------------------------------------------------- + +if test "${TEA_PLATFORM}" = "windows" ; then + AC_DEFINE(BUILD_xotcl) + if test "$GCC" != "yes" ; then + AC_DEFINE(VISUAL_CC) + fi + CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch vc60.pch" + #TEA_ADD_SOURCES([win/winFile.c]) + #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/w +else + CLEANFILES="*.o *.a *.so *~ core gmon.out" + #TEA_ADD_SOURCES([unix/unixFile.c]) + #TEA_ADD_LIBS([-lsuperfly]) +fi + + +AC_SUBST(CLEANFILES) + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +#-------------------------------------------------------------------- + +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 + +# Without the following two eval statements, XOTCL_SHARED_LIB_SUFFIX +# in xotclConfig.sh has $PACKAGE_VERSION unresolved. When another +# app links against xotcl, the PACKAGE_VERSIONs are confused. +# +# Without the first eval, we get +# XOTCL_SHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}${SHLIB_SUFFIX} +# XOTCL_UNSHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}.a +# +# after the first eval, we get +# XOTCL_SHARED_LIB_SUFFIX=1.2.1${DBGX}.so +# XOTCL_UNSHARED_LIB_SUFFIX=1.2.1${DBGX}.a +# after the second eval, all variables are resolved. + + +eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" +eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" + +#eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" +#eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols +# option. +#-------------------------------------------------------------------- + +TEA_ENABLE_SYMBOLS + +#-------------------------------------------------------------------- +# Everyone should be linking against the Tcl stub library. If you +# can't for some reason, remove this definition. If you aren't using +# stubs, you also need to modify the SHLIB_LD_LIBS setting below to +# link against the non-stubbed Tcl library. +#-------------------------------------------------------------------- + + +#if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then +# FORCE_NO_STUBS=1 +#fi + +if test "${FORCE_NO_STUBS}" = "0" ; then + AC_DEFINE(USE_TCL_STUBS) +fi + +#-------------------------------------------------------------------- +# This macro generates a line to use when building a library. It +# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, +# and TEA_LOAD_TCLCONFIG macros above. +#-------------------------------------------------------------------- + +TEA_MAKE_LIB + +#-------------------------------------------------------------------- +# 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. +#-------------------------------------------------------------------- + +TEA_PROG_TCLSH + +# make this available, for such as xotclConfig.sh +XOTCL_COMPATIBLE_TCLSH=${TCLSH_PROG} +AC_SUBST(XOTCL_COMPATIBLE_TCLSH) + +# resolve the variables +eval "libdir=${libdir}" +eval "datadir=${datadir}" +eval "includedir=${includedir}" + +PKG_DIR="${PACKAGE_NAME}${PACKAGE_VERSION}" +pkgdatadir="${datadir}/${PKG_DIR}" +pkglibdir="${libdir}/${PKG_DIR}" +# make sure this is right (then remove this comment) +pkgincludedir="${includedir}/${PKG_DIR}" + +AC_SUBST(PKG_DIR) +AC_SUBST(pkgdatadir) +AC_SUBST(pkglibdir) +AC_SUBST(pkgincludedir) + +# +# XOTcl specific configs +# + +if test "${TEA_PLATFORM}" != "windows" ; then + +XOTCL_BUILD_LIB_SPEC="-L`pwd` -lxotcl${PACKAGE_VERSION}" +XOTCL_LIB_SPEC="-L${pkglibdir} -lxotcl${PACKAGE_VERSION}" + +# stub libs are not build for 8.0 +if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then + XOTCL_BUILD_STUB_LIB_PATH="" + XOTCL_STUB_LIB_PATH="" + XOTCL_BUILD_STUB_LIB_SPEC="" + XOTCL_STUB_LIB_SPEC="" +else + XOTCL_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}" + XOTCL_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}" + XOTCL_BUILD_STUB_LIB_SPEC="-L`pwd` -lxotclstub${PACKAGE_VERSION}" + XOTCL_STUB_LIB_SPEC="-L${pkglibdir} -lxotclstub${PACKAGE_VERSION}" + AC_DEFINE(COMPILE_XOTCL_STUBS) +fi + +else + +XOTCL_BUILD_LIB_SPEC="`pwd`/${PKG_LIB_FILE}" +XOTCL_LIB_SPEC="${pkglibdir}/${PKG_LIB_FILE}" +XOTCL_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}" +XOTCL_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}" +XOTCL_BUILD_STUB_LIB_SPEC="`pwd`/${PKG_STUB_LIB_FILE}" +XOTCL_STUB_LIB_SPEC="${pkglibdir}/${PKG_STUB_LIB_FILE}" + +fi + +AC_SUBST(SHARED_LIB_SUFFIX) +AC_SUBST(UNSHARED_LIB_SUFFIX) +AC_SUBST(XOTCL_BUILD_LIB_SPEC) +AC_SUBST(XOTCL_LIB_SPEC) +AC_SUBST(XOTCL_BUILD_STUB_LIB_SPEC) +AC_SUBST(XOTCL_STUB_LIB_SPEC) +AC_SUBST(XOTCL_BUILD_STUB_LIB_PATH) +AC_SUBST(XOTCL_STUB_LIB_PATH) +XOTCL_SRC_DIR=$srcdir +AC_SUBST(XOTCL_SRC_DIR) +AC_SUBST(XOTCLSH) +AC_SUBST(XOWISH) + +# include dir of xotcl during build process (i.e., does not assume installed) +XOTCL_BUILD_INCLUDE_DIR="${XOTCL_SRC_DIR}/generic" +XOTCL_BUILD_INCLUDE_SPEC="-I${XOTCL_BUILD_INCLUDE_DIR}" +AC_SUBST(XOTCL_BUILD_INCLUDE_DIR) +AC_SUBST(XOTCL_BUILD_INCLUDE_SPEC) + +AC_SUBST(test_actiweb) +AC_SUBST(libdirs_actiweb) +AC_SUBST(apps_actiweb) + +AC_SUBST(TEA_PLATFORM) + +dnl macro expanding to the names of files ./configure is to generate. +dnl reasoning: this is a factoring; I use this value elsewhere. +dnl +dnl Change the value of -this- macro if you want to add or remove +dnl such files. + +AC_DEFUN(CONFIG_OUTPUT_FILES, [[Makefile xotclConfig.sh apps/utils/xotclsh apps/utils/xowish unix/xotcl.spec unix/pkgIndex.unix]]) + +#-------------------------------------------------------------------- +# the value of this variable is set to the files which are to be +# removed when the user invokes 'make distclean' (i.e., those +# files generated by ./configure) and is used in the make distclean +# target, defined in Makefile.in +#-------------------------------------------------------------------- + +CONFIG_CLEAN_FILES="CONFIG_OUTPUT_FILES autom4te.cache/" +AC_SUBST(CONFIG_CLEAN_FILES) +AC_CONFIG_FILES(CONFIG_OUTPUT_FILES) + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile, +# and generate the other output files. (this is done by invoking +# config.status) +# +# NOTE the lack of parameters! AC_OUTPUT with params is deprecated; +# use macros such as AC_CONFIG_FILES, AC_HEADER_FILES, etc to add +# to the files output by ./configure. +#-------------------------------------------------------------------- + +AC_OUTPUT + +here=${PWD} + +for subdir in ${subdirs} +do + echo "==================== configure $subdir =====================" + if test x"${srcdir}" = x. ; then + confdir=. + else + mkdir -p $subdir + confdir=${srcdir}/$subdir + fi + (cd $subdir; echo $SHELL ${confdir}/configure ${ac_configure_args} --with-xotcl=${here}; eval $SHELL ${confdir}/configure ${ac_configure_args} --with-xotcl=${here}) +done + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: doc/Announce-0.9.3 =================================================================== diff -u -N --- doc/Announce-0.9.3 (revision 0) +++ doc/Announce-0.9.3 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,57 @@ +Announcing XOTcl 0.9.3 +********************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +RECENT CHANGES relative to 0.9 are: + + - A "more or less" TEA compliant build process and its + directory structure (aligend it as far as possible to Tcl, sample + extension and other extensions) + + * We started building an XOTcl stub lib. + + * We separated xotcl from its library/applications + (there is an xotcl- directory in the full distribution + that just builds, installs, etc. the XOTcl libraries ... this + can for instance be used in other distributions using and + shipping XOTcl, but not using the shells). + + * The full distribution still builds shells, but they are using + "package require" to load the XOTcl libraries now. + + * For building xowish (the XOTcl Tk shell) you do only require + an installed Tk version on Unix now. + + - On Windows we still use nmake due to problems with VCC 6.0 in + all TEA compliant extensions we have checked, but we use a + completely new build process (more or less one-to-one the + Unix build process). + + - A few minor bugfixes. + + - We have tested this release on platforms we have access to + (Linux, Win NT, Solaris). Please inform us, if there are some + problems on your platform so that we can eliminate them in future + releases. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + Index: doc/Announce-0.9.4 =================================================================== diff -u -N --- doc/Announce-0.9.4 (revision 0) +++ doc/Announce-0.9.4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,100 @@ +Announcing XOTcl 0.9.4 +********************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +CHANGES relative to 0.9.3 are: + + - fixes: + + * separate reference counting for XOTcl objects and classes + to avoid references from tcl_obj's internal representation + to freed memory + + * fixes for AOL-Server (many thanks to Zoran Vasiljevic for + that and for his great help during fixing the problems above) + + * improved portability: horrible macro substitution + bug, when USE_ALLOCA or USE_MALLOC was specified; these + are used for some platforms such as AIX + + * fixing path search for XOTcl library (bug was introduced in + 0.9.3 in connection with TEA compliance) + + * fixed a bug in copy/move (many thanks for Artur Trzewik + for reporting this) in connection with constructors + (constructors are not called automatically in copy/move + operations anymore) + + * various small fixes in libraries (e.g. HTTP support, + generation of pkgIndex-files, using "my", ...) + + - enhancements: + + * new global command "my": + one can use now: + + Class Counter -parameter {{n 0}} + Counter instproc ++ {} { my incr n } + Counter instproc print {} { puts "actual value: [my n]"} + + Counter c1 + c1 ++ + c1 print + + In earlier versions it was neccessary to use "[self]" + instead of "my". This change reduces the number of + special characters in XOTcl programs. + "[self]" will continue to be supported by XOTcl. + + * extended semantics of "new" + + a) Object new ... + b) Object new -childof ... + c) Object new -volatile ... + d) Object new -volatile -childof ... + + where (a) creates now "global" objects not in the global + namespace anymore, but in the ::xotcl namespace, (b) can + be used to create objects as child of other objects + (e.g. as children of the actual object [self]; the objects + are deleted, when the specified object is deleted). (c) + creates are "global" objects as in (a), but they are + deleted, when the scope of the current + tcl-proc/object-proc/instproc is left and (d) is a + combination of (b) and (c). + + - optimizations: + + * XOTcl is trying to keep Tcl_Objs of type tclCmdNameType + instead of converting it to XOTclObjectType agressively. + + * A patch for Tcl 8.4a3 is available from the XOTcl web site + for performance hungry applications to provide special + byte-code-support for xotcl, that yields for classical + benchmark programs up to 40%. This patch is not likely to + be integrated into the general Tcl core in the new or + distant future. + + For more details, please consult the ChangeLog + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + Index: doc/Announce-1.0 =================================================================== diff -u -N --- doc/Announce-1.0 (revision 0) +++ doc/Announce-1.0 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,51 @@ +Announcing XOTcl 1.0 +******************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +CHANGES relative to 0.9.4 are: + + - fixes: + + * various small fixes for compilation with tcl8.4.* + + * fixed some more memory-leaks that showed up in connection + with multi-threading (many thanks to Zoran Vasiljevic for + his great help) + + * removed a few panics() by tcl errors (important for servers) + + * various small fixes in Httpd-code + + * fixes in filter-search mechanism + + * the general cleanup method __exitHandler (called on + interpreter exits and on thread exits) defined now + as a proc of Object + + - optimizations: + + * speedup during recreation of objects + + For more details, please consult the ChangeLog + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + Index: doc/Announce-1.0.1 =================================================================== diff -u -N --- doc/Announce-1.0.1 (revision 0) +++ doc/Announce-1.0.1 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,57 @@ +Announcing XOTcl 1.0.1 +********************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +CHANGES relative to 1.0 are: + + - fixes: + + * fixed installation bug on windows (when installed on + drives different to c:) + + * fixes for aolserver 3.5.* + + * fix for "object info default arg var" in connection + with filters + + * Serializer handles filter guards now + + - new functionality and improvements: + + * improved recreate semantics, makes it easier to + overload recreation logic. + + * new method "noinit" to create objects without + calling the constructor + + - optimizations: + + * general speedup (10 to 15%) by using client data of + namespace instead of Tcl_AssocData for interpreter state + + * faster and more flexible Serializer + + + For more details, please consult the ChangeLog + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + Index: doc/Announce-1.0.2 =================================================================== diff -u -N --- doc/Announce-1.0.2 (revision 0) +++ doc/Announce-1.0.2 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,76 @@ +Announcing XOTcl 1.0.2 +********************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +CHANGES relative to 1.0.1 are: + + - fixes: + + * fixes for copying/moving objects to same name + + * works out of the box with AOL-server 4.0 + (no patch for AOL-server needed) + + * various small fixes and code cleanup + + * new directory structure (no nested version numbers) + + * improved object and class serializer + + - new functionality and improvements: + + * new method "ismixin": Test whether the argument is a + mixin or instmixin of the object. + + * new method "hasclass": Test whether the argument is either + a mixin or instmixin of the object or if it is on the class + hierarchy of the object. This method combines the + functionalities of istype and ismixin. + + * arguments of configure methods can start now + with a leading "-" without ambiguity. In previous versions + + Class C -parameter {name counter} + C c1 -name -x -counter 123 + + the configuration of c1 was interpreted as follows + + method argc + name 0 + x 0 + counter 1 + + Starting with XOTcl 1.0.2 arguments can be protected + by putting it into a list: + + C c1 [list -name -x] -counter 123 + + which is interpreted as follows: + + method argc + name 1 + counter 1 + + For more details, please consult the ChangeLog + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + Index: doc/Announce-1.1.0 =================================================================== diff -u -N --- doc/Announce-1.1.0 (revision 0) +++ doc/Announce-1.1.0 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,87 @@ +Announcing XOTcl 1.1.0 +********************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +CHANGES relative to 1.0.2 are: + + - New functionality and improvements: + + * Transitive instmixins (thanks to a suggestion of Neophytos Demetriou): + The new version supports a tree of mixins (mixins of mixins); + when a mixin-class X has instmixins Y registered, and X is + registered as instmixin for a class C, the mixin classes Y are + applied to C as well. + + * Conditional mixins (thanks to a suggestion of Neophytos Demetriou): + mixins and instmixins can have now guards similar to filters + that define when they should be applied + + * New composition strategy for (filter- and mixin-)guards: + when a guard is defined more than once for the same interceptor + the most specific guard is used, the others are overridden. + + * Creation of sub-objects via parameter: + XOTcl's parameter method supports now a switch named "-Class" + which can be used to create and configure sub-objects (see + tutorial for details) + + * New predefined method: __unknown + This method is called, whenever XOTcl references a class, + which is not defined yet (e.g.: Class C -superclass UNKNOWNCLASS) + This method is used for Zoran's wonderful ttrace package + (for aolserver and tcl-Threads) + + * Improved documentation: + - extended tutorial (Meta-Classes, Tk, ...) + - beautified tutorial (style files, distinction between + literals and placeholders, ...) + - fixed hundreds of typos + + * some speed improvements + + + - fixes: + + * New build system: + - per default no shells are built + - new configure switches eg. --with-xotclsh, -with-actiweb + --with-all + + * Fixes for https in connection with some versions of IE + + * Fixed a few issues with purify and mt (many thanks to Zoran!) + + * Fixes for proc-scoped variable in connections with mixins + + * Fixed passing of error codes from constructors + + * various small fixes and code cleanup + - with newer versions of autoconf + - various fixes for stubs + - improved build under windows + - starkit compliance (many thanks to MichaelL@frogware.com) + + + For more details, please consult the ChangeLog + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + Index: doc/Announce-1.1.1 =================================================================== diff -u -N --- doc/Announce-1.1.1 (revision 0) +++ doc/Announce-1.1.1 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,52 @@ +Announcing XOTcl 1.1.1 +********************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +CHANGES relative to 1.1.0 are: + + - Improved portability + * for Mac OS X (many thanks to Daniel Steffen) + * freebsd 4.9 (many thanks to Marc Spitzer) + + - configure can run outside of xotcl-tree and + can install to a different directory. Example: + + % mkdir -p /tmp/xotcl/unix + % cd /tmp/xotcl/unix + % ~/xotcl-1.1.1/unix/configure --with-all + % make + % make test + % make install DESTDIR=/tmp + + - several fixes and improvements such as + * added option --with-tkinclude for configure + (only needed, when built with optional --with-xowish) + * made gdbm work when compiled with threads enabled + * fix for initialization of stubtables in gdbm + * fixes for HTTP support (return format of values in + HTTP OPTION command made windows explorer hang) + * easy provision for redirects in HTTP server + + For more details, please consult the ChangeLog + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + Index: doc/Announce-1.2.0 =================================================================== diff -u -N --- doc/Announce-1.2.0 (revision 0) +++ doc/Announce-1.2.0 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,199 @@ +Announcing XOTcl 1.2.0 +********************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +CHANGES relative to 1.1.1 are: + + - Qualitative Improvements + * improved performance (up to more than 30% faster) + * reduced dependency on Tcl internals (stack rewritings removed) + * less C-code (code reduction of about 500 lines c code) + * defined macros to access Tcl's internal structures + Due to the speedup, an emulation of an itcl like language + in XOTcl can be faster than itcl itself (see below). + + - Functional Improvements + * new subcommands of self: + self callinglevel: returns the scope of the proc/instproc + calling the current method (ignoring filters and next) + self activelevel: returns the scope of the proc/instproc + preceding the current method (might be a next call, + ignoring filters) + the returned level can be used in uplevel/upvar as first argument + + * new methods upvar/uplevel + "my uplevel set x 1" is a short form of "uplevel [self callinglevel] set x 1" + + * sub-objects can be called like methods (potential incompatibility) + If an object named o has a sub-object q (i.e. o::q) it is now + possible to invoke the sub-object via "o q ?method args?". This change + makes it possible to + + - to redefine tcl sub-commands via procs/instprocs by defining + the command with subcommands as an object (instead of defining + a command as a proc and its subcommands via a large + and hard-to-refine switch statement) + + - to use the same approach for defining subcommands of subcommands + (and so on) in the same way; it would be possible to define e.g. + the xotcl info methods via an object), + + - to use interceptors (filters/mixins) for some or all subcommands (maybe you + are only interested in "file delete") + + - to extend a tcl command on the fly by defining new subcommands + (by defining new procs/instprocs) + + - to use the unknown mechanism to produce dynamic error messages + about valid subcommands (via introspection commands). + + As a simple example, one define the a specialized version of Tcl's + file-command (say ns::file) like the following: + + namespace eval ns { + Object file + file proc tail name { + set tail [file tail $name] + regexp {[^/\\]+$} $tail tail + return $tail + } + file proc unknown {subcmd args} { + return eval ::file $subcmd $args + } + } + + For more details, please consult the ChangeLog + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + +#======================================================================= +# extract from the logfile of oobench (in oo-bench.tar.gz, +# see http://media.wu-wien.ac.at/download.html) + +XOTcl + methcall: 0.470u 0.000s 0:00.41 114.6% 0+0k 0+0io 347pf+0w +ITcl emulation in XOTcl + methcall: 0.590u 0.000s 0:00.62 95.1% 0+0k 0+0io 351pf+0w +itcl + methcall: 0.870u 0.020s 0:00.92 96.7% 0+0k 0+0io 347pf+0w + + +#======================================================================= +package require XOTcl; namespace import -force xotcl::* + +########################################################### +## Small example to emulate a itcl-like language in XOTcl +## -gustaf neumann Jan. 2004 +########################################################### +namespace eval itcl { + Class create class -superclass Class + class instproc instvars {} { + set vars [list]; set c [self] + for {} {[string compare ::xotcl::Object $c]} {set c [$c info superclass]} { + eval lappend vars [$c set __autovars] + } + return "\n\tmy instvar [lsort -unique $vars]" + } + class proc constructor {args} { + if {[llength $args]==2} { + foreach {arglist body} $args break + } else { + foreach {arglist construct body} $args break + set body $construct\n$body + } + my parameter [list {this [self]}] + my proc constructor args {uplevel next $args} + my instproc init $arglist [my instvars]\n$body + } + class proc method {name arglist body} { + my proc $name args {uplevel next $args} + my instproc $name $arglist [my instvars]\n$body + } + class proc inherit {class} { + my superclass $class + } + class proc variable {arglist} { + foreach v $arglist {my lappend __autovars $v} + } + class instproc init {classdef} { + my set __autovars this + namespace eval [self class] $classdef + my class Class + } +} + +########################################################### +# Two Demo classes from oo-bench +########################################################### +itcl::class Toggle { + variable state + constructor {start_state} { + set state $start_state + } + method value {} { + return $state + } + + method activate {} { + set state [expr {!$state}] + return $this + } +} + +itcl::class NthToggle { + inherit Toggle + variable count_max + variable counter + constructor {start_state max_counter} { + Toggle::constructor $start_state + } { + set count_max $max_counter + set counter 0 + } + method activate {} { + if {[incr counter] >= $count_max} { + Toggle::activate + set counter 0 + } + return $this + } +} + + +proc main {} { + set n [lindex $::argv 0] + set val 1 + set toggle [Toggle t1 $val] + for {set i 0} {$i < $n} {incr i} { + set val [[$toggle activate] value] + } + if {$val} {puts "true"} else {puts "false"} + + set val 1 + set ntoggle [NthToggle t2 1 3] + for {set i 0} {$i < $n} {incr i} { + set val [[$ntoggle activate] value] + } + if {$val} {puts "true"} else {puts "false"} +} + +main Index: doc/Announce-1.3.0 =================================================================== diff -u -N --- doc/Announce-1.3.0 (revision 0) +++ doc/Announce-1.3.0 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,76 @@ +Announcing XOTcl 1.3.0 +********************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +Major changes relative to 1.2.0 are: + + - Qualitative Improvements + * Improved portability: + + TEA3 compatible build + + Much more polished configure+makefile (many thanks to + Jim Lynch for his help) + + * Improved code quality: + + fixed 2 possible segmentation violations (error handling) + + fixed free memory reads (many thanks to Zoran Vasiljevic + for his help with purify) + + * Less intrusive usage of XOTcl components: + + XOTcl procs and instprocs use now the namespace in which + they were defined. One can use XOTcl packages without having + the need to import xotcl globally or to use the xotcl-prefix + in all xotcl procs/instprocs. + + - Functional Improvements + * New forwarding mechanisms for fast delegation: + new methods 'forward' and 'instforward' (many thanks + to Bryan Schofield for fruitful discussions and suggestions). + This method is a superset of tclcmd/insttclcmd, which has + been marked as deprecated. See the tutorial for more details. + + * Nonpositional arguments for xotcl procs/instprocs; this is + a flexible way to check arguments, to provide defaults etc + for every xotcl proc/instproc. It uses a similar syntax as + ad_proc and ad_page_contract in OACS. See the tutorial for + more details. + + * Extended methods filter, mixin, instfilter, instmixin as + discussed in the XOTcl mailing list. These commands can be + used more flexibly as follows + + obj mixin same as: obj info mixin + obj mixin {C1 C2} same as: obj mixin set {C1 C2} + obj mixin set {C1 C2} sets the mixins for obj + obj mixin get same as: obj info mixin + obj mixin add C3 adds a mixin on front of the mixin list + obj mixin add C3 end adds a mixin at the end the mixin list + obj mixin add C3 3 adds a mixin at the 3rd position + obj mixin delete ::C3 removes the mixin from the mixin list + + The same semantics are available as well for filter, instmixin + and instfilter. This change is fully backward compatible. + {filter,instfilter,mixin,instmixin}append are deprecated now. + + + For more details about the changes, please consult the ChangeLog and documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun Index: doc/Announce-1.3.1 =================================================================== diff -u -N --- doc/Announce-1.3.1 (revision 0) +++ doc/Announce-1.3.1 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,13 @@ +Announcing XOTcl 1.3.1 +********************** + +This is a minor fix release relative to 1.3.0. This fixes a few +problems introduced in 1.3.0 (invocation of checking procs in +nonpositional argument) and has a better build support for building +XOTcl outside of the source tree, the tar files are now dist-cleaned. + + +Best regards, + +Gustaf Neumann +Uwe Zdun Index: doc/Announce-1.3.3 =================================================================== diff -u -N --- doc/Announce-1.3.3 (revision 0) +++ doc/Announce-1.3.3 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,54 @@ +Announcing XOTcl 1.3.3 +********************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +Major changes relative to 1.3.1 are: + + - Qualitative Improvements + + * Improved code quality: + + fixed possible segmentation violations in free memory reads + (many thanks to Zoran Vasiljevic for his help with purify) + + fixed "self callinglevel" when uplevel was called from uplevel + + fixed nonposargs + + fixed configure in connection with enable-symbols and + for aolserver configuration + + extended regression test + + * Improved Functionality + + Producing error message when a non-existing proc/instproc + is tried to be deleted + + fixed exists method for objects with namespaces by using + a namespace resolver + + fixed return code for unknown handling in next + + reduced memory consumption for objects and classes with procs/instprocs + of about 14% + + * Improved Documentation + + + + For more details about the changes, please consult the ChangeLog and documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.3.4 =================================================================== diff -u -N --- doc/Announce-1.3.4 (revision 0) +++ doc/Announce-1.3.4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,55 @@ +Announcing XOTcl 1.3.4 +********************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +Major changes relative to 1.3.3 are: + + - Qualitative Improvements + + * Improved code quality: + + fixed possible segmentation violations in free memory reads + (many thanks to Zoran Vasiljevic for his help with purify) + + fixed "self callinglevel" when uplevel was called from uplevel + + Improved portability (many thanks to Jeffrey Hobbs) + + fixed nonposargs + + fixed configure in connection with enable-symbols and + for aolserver configuration + + extended regression test + + * Improved Functionality + + Producing error message when a non-existing proc/instproc + is tried to be deleted + + fixed exists method for objects with namespaces by using + a namespace resolver + + fixed return code for unknown handling in next + + reduced memory consumption for objects and classes with procs/instprocs + of about 14% + + * Improved Documentation + + + + For more details about the changes, please consult the ChangeLog and documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.3.5 =================================================================== diff -u -N --- doc/Announce-1.3.5 (revision 0) +++ doc/Announce-1.3.5 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,62 @@ +Announcing XOTcl 1.3.5 +********************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +Major changes relative to 1.3.4 are: + + - Qualitative Improvements + + * Improved code quality: + + fixed possible segmentation violations in non positional + argument handling + + moved the Serializer into a namespace such that + % package req XOTcl + % package req xotcl::serializer + Serialize .... + works without namespace imports (the Serializer is + still auto-exported, but this will change in the future) + + + + * Improved Functionality + + Non-positional arguments can be used in the same argument + list as positional ones (more compliant with OpenACS). + One can write now + % Object o + % o proc foo {-x:boolean -y a b} { ...} + instead of + % ... + % o proc foo {-x:boolean -y} {a b} { ...} + All introspection commands will work like before. + The old syntax (with the additional argument) is deprecated + and will be dropped in the future. + + + Serializer: support for objects with parent namespaces, which are + not xotcl objects + + + additional instproc for ::xotcl::Class allinstances + to return all instances for the actual class + + For more details about the changes, please consult the ChangeLog and documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.3.6 =================================================================== diff -u -N --- doc/Announce-1.3.6 (revision 0) +++ doc/Announce-1.3.6 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,61 @@ +Announcing XOTcl 1.3.6 +********************** + +WHAT IS XOTCL? + + XOTcl is an object-oriented extension of Tcl that was derived from + OTcl. In short, XOTcl tries to provide a highly flexible, + reflective, component-based, and object-oriented environment. It + integrates language support for high level concepts which are not + found in other languages, with reasonable performance. It prevails + the Tcl programming style and the dynamic/introspective nature of + the language, rather than introducing other language's styles and + rigidness (such as C++) into Tcl. + + +Major changes relative to 1.3.5 are: + + * Improved Functionality + + new info subcommand: info precedence + + + simplified meta class definitions: every class can be + changed into a metaclass by adding an instmixin of Class (or + one of its subclasses) to it. In order to define that every + class should be a metaclass, one can use now + Object instmixin Class + instead of the rather complicated solution i posted on + the xotcl mailing list not long ago. + + * Improved code quality: + + fixed possible crashes when + - objects are called with class methods (e.g. due to instmixins) + - when instmixins are defined recursively + (e.g. Class instmixin Class) + - objects are turned into classes by changing the + class relationship + + improved namespace resolution when mixin classes are defined + in namespaces (::xotcl:: namespace is skipped, since a + helper method that calles the primitive setting command + is defined there) + + fixed passing of error code from init methods + (thanks to Fabrice Pardo for noting it) + + returning PACKAGE_VERSION after a package require + (e.g. 'package req XOTcl' returns now 1.3.6) + + some code refactoring, fixed erroneous documentation of c code + + improved documentation + + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.3.7 =================================================================== diff -u -N --- doc/Announce-1.3.7 (revision 0) +++ doc/Announce-1.3.7 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,65 @@ +Announcing XOTcl 1.3.7 +************************* + +I am pleased to annouce XOTcl 1.3.7. +Major changes relative to 1.3.6 are: + + * Improved Functionality + + new option "switch" for non positional arguments to be used + to toggle the default value. A switch is a non positional argument + without extra argument. + + new option "isnextcall" for self + + new command "::xotcl::configure filter on|off" to turn off filters. + needed for serializing objects/classes with active filters + + several improvements for serializer to handle e.g. application + methods on Object/Class (needed for ad_instproc in oacs) + + improving namespace resolving in for object/class references + + moving all library packages into namespaces + + preventing "new" from overwriting objects + + allow xotcl to be used in slave interpreters + + + * Improved code quality: + + fixed namespace confusion in forward to expression calling + xotcl methods + + fixed possible crash in instvar when empty variable names are used + + some code cleanup + + improved documentation + + * new method "method" for defining methods (experimental): + Instead of using e.g. + + Object o1 + Class C + + o proc m1 {} {....} + C instproc m2 {} {....} + C proc m3 {} {....} + + one can use now + + o method m1 {} {....} + C method m2 {} {....} + C method -per-object m3 {} {....} + + in general, we can support options for method definitions, which + can be used as well for mixins, filters or info (instead of the + "inst" prefix). This way the problem of finding appropriate names for + distinguishing between object or class matters can be solved, + in rather rare cases (when referring the to class object) "-per-object" + can be used. The according name changes will happen in xotcl 2.0. + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.3.8 =================================================================== diff -u -N --- doc/Announce-1.3.8 (revision 0) +++ doc/Announce-1.3.8 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,67 @@ +Announcing XOTcl 1.3.8 +************************* + +I am pleased to annouce XOTcl 1.3.8 +Major changes relative to 1.3.6 are: + + * Improved Functionality + + new option "switch" for non positional arguments to be used + to toggle the default value. A switch is a non positional argument + without extra argument. + + new option "isnextcall" for self + + new command "::xotcl::configure filter on|off" to turn off filters. + needed for serializing objects/classes with active filters + + several improvements for serializer to handle e.g. application + methods on Object/Class (needed for ad_instproc in oacs) + + improving namespace resolving in for object/class references + + moving all library packages into namespaces + + preventing "new" from overwriting objects + + allow xotcl to be used in slave interpreters + + + * Improved code quality: + + fixed namespace confusion in forward to expression calling + xotcl methods + + fixed possible memory leak with instmixins + + fixed possible crash in instvar when empty variable names are used + + fixed namespace related bug in __unknown resolver hook + + some code cleanup + + improved documentation + + * new method "method" for defining methods (experimental): + Instead of using e.g. + + Object o1 + Class C + + o proc m1 {} {....} + C instproc m2 {} {....} + C proc m3 {} {....} + + one can use now + + o method m1 {} {....} + C method m2 {} {....} + C method -per-object m3 {} {....} + + in general, we can support options for method definitions, which + can be used as well for mixins, filters or info (instead of the + "inst" prefix). This way the problem of finding appropriate names for + distinguishing between object or class matters can be solved, + in rather rare cases (when referring the to class object) "-per-object" + can be used. The according name changes will happen in xotcl 2.0. + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.3.9 =================================================================== diff -u -N --- doc/Announce-1.3.9 (revision 0) +++ doc/Announce-1.3.9 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ +Announcing XOTcl 1.3.9 +************************* + +Hi everybody. I am pleased to annouce the availability of XOTcl 1.3.9. +Major changes relative to 1.3.8 are: + + * Improved Functionality + + new subcommand for self: [self args] return the full argument list + of the current call + + " info vars" does not trigger read traces on each variable anymore + + Serializer: exportMethods accepts forwards/instforwards now + as well + + new switch -nocomplain for "mixin|instmixin|filter|instfilter delete" + to avoid error messages when deleting entries not there (similar unset) + + require automatically a namespace when a childobject is added + + new command ::xotcl::__qualify: convert an relative name + into an command name (exactly as create does it, ignoring + namespaces from transparent interceptors) + + * Improved code quality: + + fixing version numbers for package require + + Upgraded TEA to 3.4 + + updated rpm build (many thanks to Ildiko Schmidt and Alexander Bergolth) + + fixed bug with error propagation when getter/setter methods are + used for parameters (many thanks to Manfred Stelzhammer for + pointing this out) + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.4.0 =================================================================== diff -u -N --- doc/Announce-1.4.0 (revision 0) +++ doc/Announce-1.4.0 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,42 @@ +Announcing XOTcl 1.4.0 +************************* + +Hi everybody. I am pleased to annouce the availability of XOTcl 1.4.0. +Major changes relative to 1.3.9 are: + + * Improved Functionality + * new option: ::xotcl::configure softrecreate on|off + if softrecreate is set, class relations (superclass, subclass, class, instances) + are not affected by a recreate; this allows files with class definitions + more easily to reload + + easier syntax for providing commands for initializing default values + + setting and querying options for ::xotcl::configure simiar to set + + * Improved code quality: + + fixed a bug in connection with nonpositional arguments and "args" + + fixed a bug with adding on the fly transitive mixin classes + + fixed a bug with filter states after next + + fixed omitted error message after calling self with unknown subcommands + + fixed a bug with variable traces on thread exit (triggered by volatile) + + fixed incorrect rpm dependencies + + cleaner compile for xotcl for gcc 4.* under linux + + don't destroy namespace imported child objects + + info children returns true children, not namespace imported objects/classes + + unsetting the global variable "cmd" from predefined.xotcl + + Upgraded TEA to 3.5 + + more regression tests addeed + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.4.1 =================================================================== diff -u -N --- doc/Announce-1.4.1 (revision 0) +++ doc/Announce-1.4.1 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,207 @@ +Announcing XOTcl 1.5.0 +************************* + +Hi everybody. I am pleased to announce the availability of XOTcl 1.5.0. +Major changes relative to 1.4.0 are: + + * Improved Functionality + + + The C-level implementation of XOTcl create now the basic + classes ::xotcl::Object and ::xotcl::Class completely without + any methods. All predefined methods are now registered + from the initialization script-code (predefined.xotcl) + via the new command + + ::xotcl::alias | \ + ?-objscope? ?-per-object? + + which is used for registering predefined Tcl commands + as methods. These aliases are like zero cost forwarders, + since they lookup the function pointer from the commands + and used these in the methods. + + This change makes it possible to register the same command + on different classes (with maybe different names), such that + for example the predefined set method of ::xotcl::Object + can be replaced with a different method and the set method + can be registered on some other classes (maybe some + application classes). This change makes it as well quite + easy to use the XOTcl framework to develop some other + object oriented frameworks. + + + slots + TODO documentation of slots + TODO remove + TODO optimize via parametercmd + TODO parametercmd with 3+ args + TODO info parameter deprecated + + A slot is a meta-object that manages property-changes of + objects. A property is either an attribute or a role of an relation. + In a nutshell, a slot has among other attributes + - a name (which it used to access it), + - a domain (object or class on which it can be used) , and + - can be multivalued or not + We distinguish between system slots (predefined slots like + class, superclass, mixin, instmixin, filter, instfilter) and + application slots (e.g. attributes of classes). + + System Slots + ======== + + System slots are predefined slots defining e.g. some relations + between classes, or between objects and classes. + + The predefined system slots are: + - superclass: every class in XOTcl has one or more superclasses. + The name of this slot is "superclass", the domain is "::xotcl::Class", + the slot is multivalued. One object might have multiple superclasses. + - class: every object has a class; therefore, the domain of the slot + is "::xotcl::Class", the property is not multivalued. + - mixin: every object in XOTcl can have one or more mixin classes. + The name of this slot is "mixin", the domain is "::xotcl::Object", the slot is + multivalued. + - instmixin: same as above, but the domain is "::xotcl::Class" + - filter, instfilter: similar to "mixin" and "instmixin" + + Every slot can be used set and query the property from its domain. + The syntax for setting values is + newValue + replace newValue + and for getting its values is + set x [ ] +TODO "mixin set" -> "mixin assign" +TODO "mixin set" -> "mixin replace" +TODO "mixin set" -> "mixin reset" +TODO "mixin delete" -> "mixin remove" + where the first form is in both cases the short form of the second one. + Every multivalued slot has as well a method "add" and "remove" + + Examples for using the system slot "mixin" + + Object o; Class M; class N + o mixin ::M ;# replacing the per-object mixins of o with M + o mixin reset ::M ;# same as before + o mixin add ::N ;# add N to the front of the mixin list + o mixin delete ::M ;# delete M from the mixin list + puts [o mixin] ;# query the current mixin list + + Every system slot (e.g. superclass) has the exact same interface. + + + Attribute Slots + ========= + + Attribute slots are used to manage the setting and querying + of instance variables. We define now a person with three + attributes,"name", "salary" and "projects". + + Class Person -slots { + Attribute name + Attribute salary -default 0 + Attribute projects -default {} -multivalued true + } + + These attributes might have a default value or they might be + multivalued. When an instance of class Person is created, the + slot names can be used for specifying values for the slots. + + Person p1 -name "Joe" + + Object p1 has three instance variables, namely "name", + "salary" and "projects". Since slot "projects" is multivalued, + we can add values the "add" subcommand. + + Project project1 -name XOTcl \ + -description "A highly flexible OO scripting language" + + p1 projects add ::project1 + p1 projects add some-other-value + + The value of the instance variable "project" of Person p1 + is now the list "some-other-value ::project1" + + + Type Checking + ========= + + Attribute slots can have types assigned which are tested + whenever the instance variable is altered. The slot "salary" + is defined as integer whereas "projects" is defined to + be a list of instances of the class Project (a list, since + "projects" is defined as multivalued). + + Class Person -slots { + Attribute name + Attribute salary -default 0 -type integer + Attribute projects -default {} -multivalued true -type ::Project + } + + Person p2 -name "Sue" -salary 1000 + + The slot types are checked via Tcl variable traces. This means + that the values are enforced now matter how the variables + are accessed. The checks are performed in the following + two commands, and they will throw an error in the second + command, since "1100x" is not an integer. + + p2 incr salary 100 + p2 append salary x + + similarly the second command below will through + an error, since some-other-value is not an instance + of ::Project. + + p2 projects add ::project1 + p2 projects add some-other-value + + When a check throws an error, the instance variables + are reset to the previous value. To restore the original + value, an associative array "__oldvalue()" is kept as + instance variable in the object. + + In general, checking of variables can be turned off globally + by "::xotcl::Slot instmixin add ::xotcl::Slot::Nocheck". + It can be turned off selectively for each slot via + a per-object-mixin; if attributes are subclassed, + it is possible to register the "Nocheck" mixin on a + subclass of Attribute. + + procsearch returns for forwarders now "forward" or "instforward", + for parametercmds now "parametercmd" or "instparametercmd" + and for other commands "cmd" and "instcmd" + +info slots +TODO slow -superclass +TODO king of the bongo + + + improved forwarding ... expr earlybinding + %argclindex + + + improved serializer + - handling of slot dependencies + - + - + + * Improved code quality: + + fixed a bug with nonpositional arguments, some + positional arguments and "args" + + fixed a bug in nonpositional arguments when called without + arguments + + improved error messages in connection with nonpositional arguments + + more regression tests added + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.5.0 =================================================================== diff -u -N --- doc/Announce-1.5.0 (revision 0) +++ doc/Announce-1.5.0 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,232 @@ +Announcing XOTcl 1.5.0 +************************* + +Hi everybody. We are pleased to announce the availability of XOTcl 1.5.0. +Major changes relative to 1.4.0 are: + + * Improved Functionality + + + The C-level implementation of XOTcl creates now the basic + classes ::xotcl::Object and ::xotcl::Class completely without + any methods. All predefined methods are now registered from + the initialization script-code (predefined.xotcl) via the new + command + + ::xotcl::alias | \ + ?-objscope? ?-per-object? + + which is used for registering predefined Tcl commands as + methods. These aliases are like zero cost forwarders, since + they lookup the function pointer from the commands and used + these in the methods. + + This change makes it possible to register the same command + on different classes (with maybe different names), such that + for example the predefined set method of ::xotcl::Object can + be replaced with a different method and the set method can + be registered on some other classes (maybe some application + classes). + + This change makes it as well quite easy to develop some + other object oriented languages based on the XOTcl + framework, since all methods can be rearrange from the Tcl + layer . + + + + Slots + + A slot is a meta-object that manages property-changes of + objects. A property is either an attribute or a role of an + relation. + + In a nutshell, a slot has among other attributes + - a name (which it used to access it), + - a domain (object or class on which it can be used) , and + - can be multivalued or not + + Every slot defines a uniform interface to access its + content. So has for example, every multivalued slot a + method "add" to add a value to the list of values and a + method "remove" to remove it again. + + We distinguish between system slots (predefined slots like + class, superclass, mixin, instmixin, filter, instfilter) and + application slots (e.g. attributes of classes). + + System Slots + ======== + + System slots are predefined slots defining e.g. some relations + between classes, or between objects and classes. + + The predefined system slots are: + - superclass: every class in XOTcl has one or more superclasses. + The name of this slot is "superclass", the domain is "::xotcl::Class", + the slot is multivalued. One object might have multiple superclasses. + - class: every object has a class; therefore, the domain of the slot + is "::xotcl::Class", the property is not multivalued. + - mixin: every object in XOTcl can have one or more mixin classes. + The name of this slot is "mixin", the domain is "::xotcl::Object", the slot is + multivalued. + - instmixin: same as above, but the domain is "::xotcl::Class" + - filter, instfilter: similar to "mixin" and "instmixin" + + Every slot can be used set and query the property from its domain. + The syntax for setting values is + newValue + and for getting its values is + set x [ ] + + Every multivalued slot has as well a method "add" and "remove" + + Examples for using the system slot "mixin" + + Object o; Class M; class N + o mixin ::M ;# replacing the per-object mixins of o with M + o mixin add ::N ;# add N to the front of the mixin list + o mixin delete ::M ;# delete M from the mixin list + puts [o mixin] ;# query the current mixin list + + + Attribute Slots + ========= + + Attribute slots are used to manage the setting and querying + of instance variables. We define now a person with three + attributes,"name", "salary" and "projects". + + Class Person -slots { + Attribute name + Attribute salary -default 0 + Attribute projects -default {} -multivalued true + } + + Examples for using the slots are + + Person p1 -name "Joe" + p1 projects add project1 + + Some additional features of the slots are: + + - Support for value checking for + * primitive types (all types from "string is", like integer, + boolean, ...) + * instances of Classes (e.g. value must be an instance + of Person) + * custom value checkers + * uniform interface for single and multi-valued slots + + - Support for lazy initialization (e.g. when costly + commands (like SQL) are used to initialize instance + variables, not all variables are used for each object) + + - more experimental low level functionality, like + * initcmd (executed, whenever the variable is read the first time) + * valuecmd (executed, whenever the variable is read) + * valuechangedcmd (executed, whenever the variable is altered) + + For more details, see http://media.wu-wien.ac.at/doc/tutorial.html#slots + + + + Re-implementation of the method "parameter" based on slots. + All forms except + ... -parameter {name1 {name2 default2}} ... + (I.e. pure accessor parameters and parameters with + defaults) are deprecated, since slots are the much more + powerful and orthogonal construct. + + The old c-based parameter support based on "parameterclass" + is deprecated. It is still in the C-code (the method "parameter" + is redefined in predefined.xotcl). If someone urgently needs + it, please remove the parameter instproc from predefined + for the time being, and write an email to me, in case + you really need it). The C code for parameter will be removed + in the next release. + + + Improved introspection though the procsearch method. This + method reports now in its second argument not only + [inst]proc but as well [inst]forward, [inst]parametercmd + and [inst]cmd (the latter for methods implemented in C. + + * Improved introspection through "info" + - new subcommand "info slots" + - implemented backwards bug-compatible "info parameter", + deprecated + + + Improved serializer + - better handling of cyclical dependencies, when mixins are involved + - fix for namespace handling to make the XOTcl communication + library classes working with the aolserver (thanks for Stefan Sobernig + for pointing this out) + - Now other ::xotcl::* objects can be included in the aolserver blueprint + (e.g. non positional argument handlers) + - handling of slot dependencies + - more convenient calling of the serializer: + Method "serialize" for Object is defined when the package xotcl::serializer + is loaded. + + + Improved forwarding commands + - New option for the argument substitution. When the argument + list of the forward command contains "%argclindex {a b c}", then + depending of the number of arguments at invocation "a", "b" + or "c" is substituted. If more arguments are used at the invocation + of the forwarder than values are contained in the list after %argclindex, + an error is generated. + - New options for forwarder: + * The option -earlybinding can be used to look + up the function pointer of the called Tcl command at + definition time of the forwarder instead of invocation time. + This option should only be used for calling C-implemented Tcl commands) + * The option -verbose prints the substituted command in the forwarder + prior to invocation. + + + New snit-like utility functions: + - ::xotcl::myvar varName: return the fully qualified variable name + of the specified variable. + - ::xotcl::myproc methodName ?args?: call an xotcl method without the need + of using "[list [self] methodName ...]" + Both commands are namespace exported + + + added "subst" to the set of Tcl imported methods (like e.g. incr, append, ...) + On can do now: + % Object o + ::o + % o subst {I am [self]} + I am ::o + + + added new method for ::xotcl::Object named "contains": + This method is essentially a value added back-port + of the OpenACS version. It allows to create a nested + object structure with little syntactic overhead. See tutorial + or language reference for more details. + + * Improved code quality: + + fixed a bug with nonpositional arguments, some + positional arguments and "args" + + fixed a bug in nonpositional arguments when called without + arguments + + tested with Tcl 8.4.13 and 8.5a4 + + improved error messages in connection with nonpositional arguments + + fixed a bug in the xotcl trace module (many thanks to jima for reporting) + + fixed a namespace bug in ::xotcl::package require in connection with xotclide + (many thanks to Bill Paulsen and Artur Trzewik for identifying the problem and + suggesting a fix) + + improved documentation (e.g. new sections added, + some sections deleted, spelling improved, in total 8 pages longer) + + fixed documentation bugs (many thanks for Kristoffer for reporting) + + more regression tests added + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.5.1 =================================================================== diff -u -N --- doc/Announce-1.5.1 (revision 0) +++ doc/Announce-1.5.1 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,67 @@ +Announcing XOTcl 1.5.1 +************************* + +Hi everybody. We are pleased to announce the availability of XOTcl 1.5.1. +Major changes relative to 1.5.0 are: + + * Improved Functionality + + + Improved interface to develop XOTcl methods in C + (Many thanks to Scott Gargash for the constructive discussions + and suggestions). + + New functions imported through the XOTcl's stub interface: + - XOTclNextCmd() + - XOTclCallMethodWithArgs + + New constant XOTCL_NONLEAF_METHOD to allow C-implemented + methods to call next. This constant can be passed as 5th + argument to XOTclAddIMethod (or ...AddPMethod). The + following is a short example for defining and registering + a C-implemented constructor "init" to a class. + + static int MyClassInit( ClientData cdata, Tcl_Interp *interp, + int objc, Tcl_Obj *CONST objv[] ) { + int rc; + /*** before next ***/ + rc = XOTclNextObjCmd(cdata, interp, objc,objv); + /*** after next ***/ + return rc; + } + ... + MyClass = XOTclGetClass(interp, "MyClass" ); + XOTclAddIMethod(interp, MyClass, "init", MyClassInit, + XOTCL_NONLEAF_METHOD, 0 ); + + + * Improved code quality: + + fixed a bug with the backward-compatible and deprecated + "setter" interface (many thanks to Manfred Stelzhammer for + reporting the bug) + + fixed a bug in parsing nonpositional arguments, when + e.g. square brackets are used in type declarations for + parameters (Many thanks to Stefan Sobernig for reporting) + + fixed autoname crash under Windows NT (Many thanks to Mark + Janssen for reporting and providing a patch) + + fixed serializer to handle deeper stratification layers + + simplification and speedup of dispatcher + + Makefile.in improvements for genstubs + + Changed "test -e" to "test -f" in Makefile.in, since the + standard test command in Solaris does not understand + "test -e" (Many thanks to Andreas Kupries for reporting) + + improved 64-bit compatibility on POWER5+ + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.5.2 =================================================================== diff -u -N --- doc/Announce-1.5.2 (revision 0) +++ doc/Announce-1.5.2 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,37 @@ +Announcing XOTcl 1.5.2 +************************* + +Hi everybody. We are pleased to announce the availability of XOTcl 1.5.2. +Major changes relative to 1.5.2 are: + + * Improved Functionality + + + allowing to trace objects as well as classes via the + package xotcl::trace (many thanks to jima for suggesting this) + + * Improved code quality: + + terminating all vararg lists in C by ..., (char *) NULL + There was a problem with this on 64bit AMD on FreeBSD, + as some lists were terminated previously by an integer typed + zero-value. + + better handling of Tcl result objects. Make sure that + no changes happen on shared objects. Removed all + occurrences of Tcl_AppendResult() from xotcl.c + + Fixed memory corruption (accessing feed memory) in + the invalidation of transitive mixins (many thanks to + Don Porter for reporting) + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.5.3 =================================================================== diff -u -N --- doc/Announce-1.5.3 (revision 0) +++ doc/Announce-1.5.3 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,38 @@ +Announcing XOTcl 1.5.3 +************************* + +Hi everybody. We are pleased to announce the availability of XOTcl 1.5.3. +Major changes relative to 1.5.2 are: + + * Improved code quality: + + + provided compatibility with Tcl 8.5 + + + provided compatibility with Tcl 8.4.14 + + (fixed a nasty bug caused by a change in tcl 8.4.14, could + led to a crash due to freed Tcl_Objs in OpenACS, allthough + the xotcl regression test passed correctly) + + + reduced calling overhead of methods with nonpositional + arguments by about 10 percent by avoiding shimmering. + + + fixed handling of "return -code break" from xotcl methods + (thanks to Artur Trzewik for the bug report) + + + library/comm/Access.xotcl: fixed handling of chunked encoding + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.5.4 =================================================================== diff -u -N --- doc/Announce-1.5.4 (revision 0) +++ doc/Announce-1.5.4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,46 @@ +Announcing XOTcl 1.5.4 +************************* + +Hi everybody. We are pleased to announce the availability of XOTcl 1.5.4. +Originally, this release was planned as a small bug fix release. However, +the total size of the (unified) diff between 1.5.3 and 1.5.4 is more +than 5000 lines, mostly due to the varRefom changes (see first +item below). + +Major changes relative to 1.5.4 are: + + * Improved code quality: + + + provided compatibility with Tcl 8.5 + (currently, this requires the verison of Tcl 8.5 + from CVS head, including the changes for VarReform + (For details, see http://groups.google.at/group/comp.lang.tcl/browse_frm/thread/bff391a7f1bd8f6c/3f214d088a28ed13?hl=de#3f214d088a28ed13) + + + improved serializer + (handling var traces for instances variables) + + + several small bug-fixes + (e.g. fixing empty variable names, error message + propagation for configure, fixing potential crashes, + when namespaces are added to objects during + eval, etc.) + + + improved portablility for more platforms + (more portable shell tests for e.g. FreeBSD) + + + extended regression test + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + + +Best regards, + +Gustaf Neumann +Uwe Zdun + + Index: doc/Announce-1.5.5 =================================================================== diff -u -N --- doc/Announce-1.5.5 (revision 0) +++ doc/Announce-1.5.5 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,44 @@ +Dear XOTcl Community, + +XOTcl 1.5.5 is available. The main change is to achieve binary compatibility +between Tcl 8.5 and XOTcl compiled with Tcl 8.4. This is essential achieved +through a small emulation layer based on C-structures that will be available +in Tcl 8.5. + +best regards +-gustaf neumann + +Announcing XOTcl 1.5.5 +************************* + +We are pleased to announce the availability of XOTcl 1.5.5. + +Major changes relative to 1.5.4 are: + + * Improved binary compatibility: + + It is now possible to load XOTcl compiled for Tcl 8.4 + into a tclsh8.5 (again, substantial change). + + One can now test now 4 versions: + a) a native version for Tcl 8.4 (without compatibility layer) + b) a native version for Tcl 8.5 + c) a version compiled for Tcl 8.4 with compatibility layer in tclsh8.4 + d) a version compiled for Tcl 8.4 with compatibility layer in tclsh8.5 + + Tests showed that the overhead is for the compatibility + layer is between 1.1% and 2.3%, the difference between + tcl8.5 and tcl8.4 is much larger. + + The forward compatibility behavior behavior can be turned off by setting + FORWARD_COMPATIBLE to 0 during compilation (xotcl.h) to get + a small performance improvement. + + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + Index: doc/Announce-1.5.6 =================================================================== diff -u -N --- doc/Announce-1.5.6 (revision 0) +++ doc/Announce-1.5.6 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,51 @@ +Dear XOTcl Community, + +XOTcl 1.5.6 is available. This version is mostly a fix release for +some problems that were apparently quite long in the code and could +cause crashes for threaded applications. + +best regards +-gustaf neumann + +Announcing XOTcl 1.5.6 +************************* + +We are pleased to announce the availability of XOTcl 1.5.6. + +Major changes relative to 1.5.4 are: + + * Fixes for treating global volatile objects (many thanks to Zoran + for his concise reports). The problem was that XOTcl uses + C-level var traces containing object pointers to objects. + If for some reason, these objects are destroyed earlier, this + results in dangling references. This problem caused especially + problems in the automatic cleanup of variables at the end + of a thread. + + * Fix for Tcl 8.4.* for situations, where Tcl variables + contained references to deleted XOTcl objects. The problem + was introduced by the VarReform changes between 1.5.3 and + 1.5.4 by a bad side effect of a Tcl_Obj based command + to look up Tcl command structurs. The problem did not + exist for xotcl compiled against Tcl 8.5 and is as well + fixed on the Tcl side in CVS (might become available, + when one more Tcl 8.4 release is eventually released) + + * Serializer: + - Added dependency rule in serializer to ensure slots of + super-classes are listed before subclasses. (Thanks to Stefan + Sobernig for reporting the problem) + + - Moved deactivation of traces into "Serializer all" + to get simpler results on "o serialize". + + * Extended regression tests + + + For more details about the changes, please consult the ChangeLog and + documentation. + +MORE INFO + General and more detailed information about XOTcl and its components + can be found at http://www.xotcl.org + Index: doc/JufGdbmStorage-xotcl.html =================================================================== diff -u -N --- doc/JufGdbmStorage-xotcl.html (revision 0) +++ doc/JufGdbmStorage-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,45 @@ + + + + + XOTcl - Documentation -- ./library/store/JufGdbmStorage.xotcl + + + +

+ ./library/store/JufGdbmStorage.xotcl + ./library/store/JufGdbmStorage.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::store::jufgdbm 0.81 +
+ Package required: xotcl::store::juf_gdbm +
+ Package required: xotcl::store +
+
+ Filename: + + ./library/store/JufGdbmStorage.xotcl + +
+
+ +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/MemStorage-xotcl.html =================================================================== diff -u -N --- doc/MemStorage-xotcl.html (revision 0) +++ doc/MemStorage-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,43 @@ + + + + + XOTcl - Documentation -- ./library/store/MemStorage.xotcl + + + +

+ ./library/store/MemStorage.xotcl + ./library/store/MemStorage.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::store::mem 0.84 +
+ Package required: xotcl::store 0.84 +
+
+ Filename: + + ./library/store/MemStorage.xotcl + +
+
+ +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/MultiStorage-xotcl.html =================================================================== diff -u -N --- doc/MultiStorage-xotcl.html (revision 0) +++ doc/MultiStorage-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,43 @@ + + + + + XOTcl - Documentation -- ./library/store/MultiStorage.xotcl + + + +

+ ./library/store/MultiStorage.xotcl + ./library/store/MultiStorage.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::store::multi 0.9 +
+ Package required: xotcl::store 0.84 +
+
+ Filename: + + ./library/store/MultiStorage.xotcl + +
+
+ +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/Persistence-xotcl.html =================================================================== diff -u -N --- doc/Persistence-xotcl.html (revision 0) +++ doc/Persistence-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,365 @@ + + + + + XOTcl - Documentation -- ./library/store/Persistence.xotcl + + + +

+ ./library/store/Persistence.xotcl + ./library/store/Persistence.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::store::persistence 0.8 +
+ Package required: xotcl::trace +
+ Package required: xotcl::package +
+ Package required: xotcl::mixinStrategy +
+ Package required: xotcl::store +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./library/store/Persistence.xotcl + +
+
+ + + + + +
+ Description: + + + Persistent store for XOTcl objects with Eager and Lazy persistence. + Take a look at "persistenceExample.xotcl" for exmaple of usage. + +
+
+
+

+ + + +

Class: PersistenceMgr

+ Class: Class +
+ + + + + + + +
+ Description: + + + A persistent store requires a persistent manager. The persistent + manager implements the Storage interface via storage mixin. With + the parameter "dbPackage" we can specify which storage will be used. + The persistent manager than tries to load the package + "xotcl::${dbPackage}Storage". Default is Sdbm. + + Example: +
+    PersistenceMgr pmgr -persistenceDir . -persistenceFile example-db
+    
+ + +
+

+
+

+ + + +

Class: Persistent

+ Class: Class +
+ Procs/Instprocs: + makeVarScript, persistenceMgr, persistent, persistent+init, persistentVars, unPersistent. + + + + + +
+ Description: + + + Superclass or mixin class for all persistent objects. Normally + subclasses are used as mixins or instmixins on object, like: +
+      o mixin Persistent=Eager
+      p mixin Persistent=Lazy
+    
+ +
+

Instprocs

+
    +
  • + + + + persistenceMgr + args + + + + + + + + + + +
    + Arguments: + + args: persistent manager name +
    + Description: + + + Specify which persistence manager to use for [self] object, like: +
    +      o persistenceMgr pmgr
    +    
    + Each persistent object must have a persistence manager specified, + before vars can be made persistent. + +
    +
  • +
  • + + + + persistentVars + + + + + + +
    + Description: + + + Returns list of persistent vars. + +
    +
  • +
  • + + + + persistent + list + + + + + + + + + + +
    + Arguments: + + list: persistent variables +
    + Description: + + + Make a list of object variables persistent. If a persistent + DB exists, the values are read from this DB, overwriting the current value. + E.g.: +
    +     o persistent {x y}
    +    
    + + +
    +
  • +
  • + + + + persistent+init + list + + + + + + + + + + +
    + Arguments: + + list: persistent variables +
    + Description: + + + Initialize all data in the list as empty strings, + if they do not exist yet, and then make them persistent + using the 'persistent' method + +
    +
  • +
  • + + + + unPersistent + list + + + + + + + + + + +
    + Arguments: + + list: persistent variables +
    + Description: + + + Make a list of object variables not persistent. + +
    +
  • +
  • + + + + makeVarScript + + + + + + +
    + Description: + + + Build a Tcl script of "set ..." statements reflecting the current situation in the database. + +
    +
  • +
+

+
+

+ + + +

Class: Persistent=Eager

+ Class: Class +
+ + + + + + + +
+ Description: + + + Eager persistence strategy. Store everything at the same moment to the database + +
+

+
+

+ + + +

Class: Persistent=Lazy

+ Class: Class +
+ + + + + + + +
+ Description: + + + Lazy persistence strategy. Store everything on object destroy (or program termination. + +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/Script-xotcl.html =================================================================== diff -u -N --- doc/Script-xotcl.html (revision 0) +++ doc/Script-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,92 @@ + + + + + XOTcl - Documentation -- ./library/lib/Script.xotcl + + + +

+ ./library/lib/Script.xotcl + ./library/lib/Script.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::script 0.9 +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./library/lib/Script.xotcl + +
+
+ + + + + +
+ Description: + + + A small package to instantiate an object, that + represents a script. + +
+
+
+

+ + + +

Class: Script

+ Class: Class +
+ + + + + + + +
+ Description: + + + An object of type Script becomes automatically the command + line arguments evaluated as "-" method calls during creation, e.g. +
+      Script s -set r 5
+    
+ and a call with cmd-line "-set v 6" of the script, results in an + object s with two vars set: r to 5, and v to 6. + +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/Serializer-xotcl.html =================================================================== diff -u -N --- doc/Serializer-xotcl.html (revision 0) +++ doc/Serializer-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,278 @@ + + + + + XOTcl - Documentation -- ./library/serialize/Serializer.xotcl + + + +

+ ./library/serialize/Serializer.xotcl + ./library/serialize/Serializer.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl 1.0 +
+ Package provided: xotcl::serializer 0.4 +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./library/serialize/Serializer.xotcl + +
+
+ + + + + + + + + + + + + +
+ Description: + + + This package provides the class Serializer, which can be used to + generate a snapshot of the current state of the workspace + in the form of XOTcl source code. + +
+ Authors: + + + Gustaf Neumann, Gustaf.Neumann@wu-wien.ac.at + +
+ Date: + + $Date: 2004/07/02 11:22:31 $ +
+
+
+

+ + + +

Class: Serializer

+ Procs/Instprocs: + all, deepSerialize, serialize. + +
+

Instprocs

+
    +
  • + + + + serialize + entity + + + + + + + + + + + + + + +
    + Arguments: + + entity: Object or Class +
    + Description: + + + Serialize the specified object or class. + +
    + Return: + + Object or Class with all currently defined methods, + variables, invariants, filters and mixins +
    +
  • +
+

Procs

+
    +
  • + + + + all + ?-ignoreVarsRE RE? + ?-ignore obj1 obj2 ...? + + + + + + + + + + + + + + + + + + +
    + Arguments: + + ?-ignoreVarsRE RE?: provide regular expression; matching vars are ignored +
    + + + ?-ignore obj1 obj2 ...?: provide a list of objects to be omitted +
    + Description: + + + Serialize all objects and classes that are currently + defined (except the specified omissions and the current + Serializer object). +

    Examples:
    + Serializer all -ignoreVarsRE {::b$}
    + do not serialize any instance variable named b (of any object)

    + Serializer all -ignoreVarsRE {^::o1::.*text.*$|^::o2::x$}
    + do not serialize any variable of c1 whose name contains + the string "text" and do not serialze the variable x of o2

    + Serializer all - ignore obj1 obj2 ...
    + do not serizalze the specified objects + +

    + Return: + + script +
    +
  • +
  • + + + + deepSerialize + objs + ?-ignoreVarsRE RE? + ?-ignore obj1 obj2 ...? + ?-map list? + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Arguments: + + objs: Objects to be serialized +
    + + + ?-ignoreVarsRE RE?: provide regular expression; matching vars are ignored +
    + + + ?-ignore obj1 obj2 ...?: provide a list of objects to be omitted +
    + + + ?-map list?: translate object names in serialized code +
    + Description: + + + Serialize object with all child objects (deep operation) + except the specified omissions. For the description of + ignore and igonoreVarsRE see + Serizalizer all. map can be used + in addition to provide pairs of old-string and new-string + (like in the tcl command string map). This option + can be used to regenerate the serialized object under a different + object or under an different name, or to translate relative + object names in the serialized code.

    + + Examples: + Serializer deepSerialize ::a::b::c -map {::a::b ::x::y}
    + Serialize the object c which is a child of a::b; + the object will be reinitialized as object ::x::y::c, + all references ::a::b will be replaced by ::x::y.

    + + Serializer deepSerialize ::a::b::c -map {::a::b [self]}
    + The serizalized object can be reinstantiated under some current object, + under which the script is evaluated.

    + + Serializer deepSerialize ::a::b::c -map {::a::b::c ${var}}
    + The serizalized object will be reinstantiated under a name specified + by the variable var in the recreation context. + +

    + Return: + + script +
    +
  • +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/Storage-xotcl.html =================================================================== diff -u -N --- doc/Storage-xotcl.html (revision 0) +++ doc/Storage-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,397 @@ + + + + + XOTcl - Documentation -- ./library/store/Storage.xotcl + + + +

+ ./library/store/Storage.xotcl + ./library/store/Storage.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::store 0.84 +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./library/store/Storage.xotcl + +
+
+ + + + + + + + + +
+ Description: + + + Simple generic storage interface for hashtable-like (persistent) + storages. There are several different existing stores, including + a memory storage, a GDBM storage, a SDBM storage, and a + TextFile storage. + +
+ Date: + + $Date: 2004/05/23 22:50:39 $ +
+
+
+

+ + + +

Class: Storage

+ Class: Class +
+ Procs/Instprocs: + close, exists, firstkey, names, nextkey, open, set, someNewChildStore, unset. + + + + + +
+ Description: + + + Abstract storage interface class (superclass of all storages). + +
+

Instprocs

+
    +
  • + + + + open + filename + + + + + + + + + + + + + + +
    + Arguments: + + filename: database filename (or filename base, if more + than one file has to be created) +
    + Description: + + + Each storage object represents exactly one database table. The db + has to be opened, before it can it used. If it is not opened all + other methods return errors. + +
    + Return: + + empty string +
    +
  • +
  • + + + + close + + + + + + + + + + +
    + Description: + + + Close associated database. + +
    + Return: + + empty string +
    +
  • +
  • + + + + exists + key + + + + + + + + + + + + + + +
    + Arguments: + + key: Key to be searched for. +
    + Description: + + + Search for a key whether it exists or not. + +
    + Return: + + 1, if key exists in the database, otherwise 0 +
    +
  • +
  • + + + + set + key + ?value? + + + + + + + + + + + + + + + + + + +
    + Arguments: + + key: Key to be set. +
    + + + ?value?: Optional value that might be set +
    + Description: + + + Set or query a database key in the same way as Tcl's set functions. + +
    + Return: + + Key value. +
    +
  • +
  • + + + + unset + key + + + + + + + + + + + + + + +
    + Arguments: + + key: Key to be unset. +
    + Description: + + + Unset a database key in the same way as Tcl's unset functions. + +
    + Return: + + empty string +
    +
  • +
  • + + + + names + + + + + + + + + + +
    + Description: + + + Return a list of keys in the database (functions in the same + way as Tcl's array names) + +
    + Return: + + List of keys in the db. +
    +
  • +
  • + + + + firstkey + + + + + + + + + + +
    + Description: + + + Start a traversal of the database, starting with any key. + +
    + Return: + + Name of first key. +
    +
  • +
  • + + + + nextkey + + + + + + + + + + +
    + Description: + + + Proceed with the db traversal. Requires a firstkey before + first usage, otherwise it returns an error. + +
    + Return: + + Name of next key, if one exists. Otherwise an empty string is returned. +
    +
  • +
+

Procs

+
    +
  • + + + + someNewChildStore + + + + + + + + + + +
    + Description: + + + Create a childStore according to a preference list depending on + which storages are available. Currently the preference list has + the following order: Gdbm, Sdbm and TextFile. + +
    + Return: + + name of the created storage object. +
    +
  • +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/TclGdbmStorage-xotcl.html =================================================================== diff -u -N --- doc/TclGdbmStorage-xotcl.html (revision 0) +++ doc/TclGdbmStorage-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,45 @@ + + + + + XOTcl - Documentation -- ./library/store/TclGdbmStorage.xotcl + + + +

+ ./library/store/TclGdbmStorage.xotcl + ./library/store/TclGdbmStorage.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::store::tclgdbm 0.84 +
+ Package required: xotcl::store::gdbm +
+ Package required: xotcl::store +
+
+ Filename: + + ./library/store/TclGdbmStorage.xotcl + +
+
+ +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/TextFileStorage-xotcl.html =================================================================== diff -u -N --- doc/TextFileStorage-xotcl.html (revision 0) +++ doc/TextFileStorage-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,43 @@ + + + + + XOTcl - Documentation -- ./library/store/TextFileStorage.xotcl + + + +

+ ./library/store/TextFileStorage.xotcl + ./library/store/TextFileStorage.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::store::textfile 0.84 +
+ Package required: xotcl::store +
+
+ Filename: + + ./library/store/TextFileStorage.xotcl + +
+
+ +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/UNIVERSAL-xotcl.html =================================================================== diff -u -N --- doc/UNIVERSAL-xotcl.html (revision 0) +++ doc/UNIVERSAL-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,71 @@ + + + + + XOTcl - Documentation -- ./apps/actiweb/univ/UNIVERSAL.xotcl + + + +

+ ./apps/actiweb/univ/UNIVERSAL.xotcl + ./apps/actiweb/univ/UNIVERSAL.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+ Package required: xotcl::actiweb::webDocument +
+ Package required: xotcl::rdf::parser +
+ Package required: xotcl::rdf::triple +
+ Package required: xotcl::xml::printVisitor +
+
+ Filename: + + ./apps/actiweb/univ/UNIVERSAL.xotcl + +
+
+ + + + + +
+ Description: + + + This is a demo of a Webserver that presents the contents of + an RDF source file in a friendly and easy readable manner. +

+ The RDF file is parsed first into triples which + are added to the resource database RDFdb. This RDFdb used in this + example replaces the standard triple database of xoRDF by an + application specific version, which is easier to process. The triple + database is the source of the Catalog, which displays a short, easy to read + summary of the entries. The database is used as well for the "detailed + view", which presents all the data of the triples through nested HTML tables. +

+ The demo program uses either HTTP or HTTPS (in which case you will require + the SSL/TLS extension of Tcl). + +

+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/adapter-xotcl.html =================================================================== diff -u -N --- doc/adapter-xotcl.html (revision 0) +++ doc/adapter-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,53 @@ + + + + + XOTcl - Documentation -- ./apps/scripts/adapter.xotcl + + + +

+ ./apps/scripts/adapter.xotcl + ./apps/scripts/adapter.xotcl

+
+

+

Package/File Information

+ No package provided/required +
+
+ Filename: + + ./apps/scripts/adapter.xotcl + +
+
+ + + + + +
+ Description: + + + Simple adapter pattern meta-class taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/adapterExample-xotcl.html =================================================================== diff -u -N --- doc/adapterExample-xotcl.html (revision 0) +++ doc/adapterExample-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,53 @@ + + + + + XOTcl - Documentation -- ./apps/scripts/adapterExample.xotcl + + + +

+ ./apps/scripts/adapterExample.xotcl + ./apps/scripts/adapterExample.xotcl

+
+

+

Package/File Information

+ No package provided/required +
+
+ Filename: + + ./apps/scripts/adapterExample.xotcl + +
+
+ + + + + +
+ Description: + + + Simple adapter pattern example class (FTP requests) taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/cascaded-message-filter.gif =================================================================== diff -u -N Binary files differ Index: doc/changeXOTclVersion-xotcl.html =================================================================== diff -u -N --- doc/changeXOTclVersion-xotcl.html (revision 0) +++ doc/changeXOTclVersion-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + + + + + XOTcl - Documentation -- ./library/lib/changeXOTclVersion.xotcl + + + +

+ ./library/lib/changeXOTclVersion.xotcl + ./library/lib/changeXOTclVersion.xotcl

+
+

+

Package/File Information

+ No package provided/required +
+
+ Filename: + + ./library/lib/changeXOTclVersion.xotcl + +
+
+ +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/composite-xotcl.html =================================================================== diff -u -N --- doc/composite-xotcl.html (revision 0) +++ doc/composite-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,53 @@ + + + + + XOTcl - Documentation -- ./apps/scripts/composite.xotcl + + + +

+ ./apps/scripts/composite.xotcl + ./apps/scripts/composite.xotcl

+
+

+

Package/File Information

+ No package provided/required +
+
+ Filename: + + ./apps/scripts/composite.xotcl + +
+
+ + + + + +
+ Description: + + + Simple composite pattern meta-class taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/compositeExample-xotcl.html =================================================================== diff -u -N --- doc/compositeExample-xotcl.html (revision 0) +++ doc/compositeExample-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,54 @@ + + + + + XOTcl - Documentation -- ./apps/scripts/compositeExample.xotcl + + + +

+ ./apps/scripts/compositeExample.xotcl + ./apps/scripts/compositeExample.xotcl

+
+

+

Package/File Information

+ No package provided/required +
+
+ Filename: + + ./apps/scripts/compositeExample.xotcl + +
+
+ + + + + +
+ Description: + + + Simple Graphics example of the composite pattern taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. They demonstrate instfilters, + filter chains and filter inheritance. + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/features.gif =================================================================== diff -u -N Binary files differ Index: doc/filter-inheritance.gif =================================================================== diff -u -N Binary files differ Index: doc/ftp-xotcl.html =================================================================== diff -u -N --- doc/ftp-xotcl.html (revision 0) +++ doc/ftp-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,51 @@ + + + + + XOTcl - Documentation -- ./apps/comm/ftp.xotcl + + + +

+ ./apps/comm/ftp.xotcl + ./apps/comm/ftp.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+ Package required: xotcl::comm::ftp +
+
+ Filename: + + ./apps/comm/ftp.xotcl + +
+
+ + + + + +
+ Description: + + A tiny FTP client +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/htmllib-xotcl.html =================================================================== diff -u -N --- doc/htmllib-xotcl.html (revision 0) +++ doc/htmllib-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,74 @@ + + + + + XOTcl - Documentation -- ./library/lib/htmllib.xotcl + + + +

+ ./library/lib/htmllib.xotcl + ./library/lib/htmllib.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::htmllib 0.1 +
+ Package required: XOTcl +
+
+ Filename: + + ./library/lib/htmllib.xotcl + +
+
+ + + + + + + + + + + + + +
+ Description: + + + This package provides the class HtmlBuilder, which can be used to + generate HTML documents, or a part of a document. + +
+ Authors: + + + Antti Salonen, as@fishpool.fi + +
+ Date: + + + $Date: 2004/05/23 22:50:39 $ + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/index.html =================================================================== diff -u -N --- doc/index.html (revision 0) +++ doc/index.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,35 @@ + + +The Extended Object Tcl (XOTcl) Documentation contains the +following parts: + +

XOTcl Language Documentation

+ + +

Package and Script Documentation

+
+ This section of the documentation is under work... +
+ + +

+ +

Tcl Online Information

+ + + Index: doc/langRef-xotcl.html =================================================================== diff -u -N --- doc/langRef-xotcl.html (revision 0) +++ doc/langRef-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,3231 @@ + + + + + XOTcl - Documentation -- ./doc/langRef.xotcl + + + +

+ ./doc/langRef.xotcl + ./doc/langRef.xotcl

+
+

+

Package/File Information

+ Package provided: XOTcl-langRef 1.2 +
+ Package required: Tcl +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./doc/langRef.xotcl + +
+
+ + + + + + + + + + + + + +
+ Description: + + + XOTcl language reference. Describes predefined objects and classes. + +
+ Predefined primitives: + + + XOTcl contains three predefined primitives: +

+ self computes callstack related information. + It can be used in the following ways: +

    +
  • self - returns the name + of the object, which is currently in execution. If it is + called from outside of a proc, it returns the + error message ``Can't find self''. +
  • self class - the self + command with a given argument class returns the name of the + class, which holds the currently executing instproc. Note, that this + may be different to the class of the current object. If it is called + from a proc it returns an empty string. +
  • self proc - the self command with a given argument + proc returns the name of the currently executing proc or + instproc. +
  • self callingclass: Returns class name of the + class that has called the executing method. +
  • self callingobject: Returns object name of + the object that has called the executing method. +
  • self callingproc: Returns proc name of + the method that has called the executing method. +
  • self calledclass: Returns class name of the + class that holds the target proc (in mixins and filters). +
  • self calledproc: Returns method + name of the target proc (only applicable + in a filter). +
  • self next: Return the + "next" method on the path as a string. +
  • self filterreg: In a filter: returns the name + of the object/class on which the filter is registered. Returns either + 'objName filter filterName' or 'className instfilter filterName'. + +
  • self callinglevel: Returns the calling level, from where + the actual proc was called from. Intermediary next calls are ignored + in this computation. The level is returned in a form + it can be used as first argument in uplevel or upvar. + +
  • self activelevel: Returns the level, from where + the actual proc was invoked from. This might be the calling level or a next + call, whatsever is higher in the stack. The level is returned in a form + it can be used as first argument in uplevel or upvar. + + +
+

+ my someMethod is a short form for [self] someMethod and can only be + called in a context of an instproc or an method specific proc. It allows certain + optimizations and shorter to write. +

+ next executes the "next" method on the precedence + order and return with the result. +

+ + +
+ Date: + + $Date: 2004/07/02 11:22:31 $ +
+
+
+

+ + + +

Class: Class

+ Class: Class +
+ Heritage: Object +
+ Procs/Instprocs: + __unknown, alloc, create, info, instdestroy, instfilter, instfilterappend, instfilterguard, instinvar, instmixin, instmixinappend, instparametercmd, instproc, insttclcmd, new, parameter, parameterclass, recreate, superclass, unknown, volatile. + + + + + +
+ Description: + + + This meta-class holds the pre-defined methods available for all XOTcl + classes. + +
+

Instprocs

+
    +
  • + + + + alloc + obj + ?args? + + + + + + + + + + + + + + + + + + +
    + Arguments: + + obj: new obj/class name +
    + + + ?args?: arguments passed to the new class after creation +
    + Description: + + + Allocate memory for a new XOTcl object or class. create uses + alloc to allocate memory. But create also + calls init and evaluates '-' arguments as method calls. + In seldom cases the programmer may want to suppress the + create + mechanism and just allocate memory. Then alloc can + be used. + +
    + Return: + + new class name +
    +
  • +
  • + + + + create + objName + ?args? + + + + + + + + + + + + + + + + + + +
    + Arguments: + + objName: name of a new class or object +
    + + + ?args?: arguments passed to the constructor +
    + Description: + + + Create user-defined classes or objects. If the class is a meta-class, + a class is created, otherwise an object. + + Create firstly calls alloc in order to allocate memory for the + new object. Then default values for parameters are searched on + superclasses (an set if found). Then args is searched for args + starting with '-' followed by an alpha character. These arguments + are called as methods. '-' followed by a numerical is interpreted + as a negative number (and not as a method). If a value of a method + called this way starts with a "a", the call can be placed safely + into a list (e.g. "Class c [-strangearg -a-] -simplearg 2"). + + Finally the constructor init is called on the object + with all arguments up to the first '-' arg.

    + + The create method is called implicitly through the + unknown + mechanism when a class (meta-class) is called with an unknown + method. E.g. the following two commands are equivalent + +

     Car herby -color red 
    +           Car create herby -color red 
    + + When a users may want to call the constructor init + before other '-' methods, one can specify '-init' + explicitly in the left to + right order of the '-' method. Init is called always only once. + e.g.:
     Class Car -init -superclass Vehicle 
    + +
    + Return: + + name of the created instance (result of alloc) +
    +
  • +
  • + + + + info + args + + + + + + + + + + + + + + +
    + Arguments: + + args: info options +
    + Description: + + + Introspection of classes. All options available for objects + (see info object) is also available + for classes. + The following options can be specified: +
      +
    • ClassName info classchildren ?pattern?: + Returns the list of nested classes with fully qualified names + if pattern was not specified, + otherwise it returns all class children where the class name + matches the pattern. + +
    • ClassName info classparent: + Returns the class ClassName is nesting to. + +
    • ClassName info instdefault method arg var: + Returns 1 if the argument arg of the instance method + method has a default value, otherwise 0. If it exists + the default value is stored in var. + +
    • ClassName info instfilter: + Returns the list of registered filters. With -guard modifier + all instfilterguards are integrated + ( ClassName info instfilter -guards). + +
    • objName info instfilterguard name: Returns the guards + for instfilter identified by name. + +
    • ClassName info heritage ?pattern?: + Returns a list of all classes in the precedence order + of the class hierarchy. + If pattern is specified, only matching values are returned. + +
    • ClassName info instances ?pattern?: + Returns a list of the instances of the class. + If pattern is specified, only matching values are returned. + +
    • ClassName info instargs method: + Returns the arguments of the specified method. + +
    • ClassName info instbody method: + Returns the body of the specified method. + +
    • ClassName info instcommands ?pattern?: + Returns all commands defined for the class. If pattern + is specified it returns all commands that match the pattern. + +
    • ClassName info instinvar: + Returns class invariants. + +
    • ClassName info instmixin: + Returns the list of instmixins of this class. + +
    • ClassName info instpost methodName: + Returns post assertions of methodName. + +
    • ClassName info instpre methodName: + Returns pre assertions of methodName. + +
    • ClassName info instprocs ?pattern?: + Returns all instprocs defined for the class. If pattern + is specified it returns all instprocs that match the pattern. + +
    • ClassName info parameter: + Returns parameter list. + +
    • ClassName info subclass ?subclassname?: + Returns a list of all subclasses of the class, if subclassname + was not specified, otherwise it returns 1 if subclassname is a + subclass and 0 if not. + +
    • ClassName info superclass ?superclassname?: + Returns a list of all super-classes of the class, + if superclassname was not specified, otherwise it returns + 1 if superclassname is a superclass and 0 if not. +
    + +
    + Return: + + Value of introspected option as a string. +
    +
  • +
  • + + + + instdestroy + obj + ?args? + + + + + + + + + + + + + + + + + + +
    + Arguments: + + obj: obj/class name +
    + + + ?args?: arguments passed to the destructor +
    + Description: + + + Standard destructor. Destroys XOTcl object physically from the memory. + Can be overloaded for customized destruction process. +

    + In XOTcl objects are not directly destroyed, when a destroy is + encountered in a method. Beforehand, the interpreter looks up whether + the object is still referenced on the method callstack or not. If not, + the object is directly destroyed. Otherwise every occurrence of the + object on the callstack is marked as destroyed. During popping of the + callstack, for each object marked as destroyed, the reference count is + decremented by one. When no more references to the object are on the + callstack the object is physically destroyed. This way we can assure + that objects are not accessed with [self] in running methods after + they are physically destroyed. + +

    + Return: + + empty string +
    +
  • +
  • + + + + instfilter + filterList + + + + + + + + + + + + + + +
    + Arguments: + + filterList: list of methods that should be registered as filters +
    + Description: + + + Specifies the list of filters registered for the class. + instfilter overwrites all previous setting. + Filters must be available on the class or its heritage + order. Filters may also reside on the meta-class of the class. + + Filter list may contain filter guards. Then the + filter is composed of two list elements: {filtername filterguard}. + +
    + Return: + + empty string +
    +
  • +
  • + + + + instfilterappend + filterList + + + + + + + + + + + + + + +
    + Arguments: + + filterList: name of the new instfilter +
    + Description: + + + Convenience method that appends an instfilter to the existing filters of the class. + +
    + Return: + + empty string +
    +
  • +
  • + + + + instfilterguard + filtername + guard + + + + + + + + + + + + + + + + + + +
    + Arguments: + + filtername: filter name of a registered filter +
    + + + guard: set of conditions to execute the filter +
    + Description: + + + Add conditions to guard a filter registration point. The filter + is only executed, if the guards are true. Otherwise we ignore the + filter. If no guards are given, we always execute the filter. + +
    + Return: + + empty string +
    +
  • +
  • + + + + instinvar + invariantList + + + + + + + + + + + + + + +
    + Arguments: + + invariantList: Body of invariants for the class +
    + Description: + + + Specify invariants for the class. These are inherited by + sub-classes. The invariants must hold for all instances. + All assertions are a list of ordinary Tcl conditions. + +
    + Return: + + empty string +
    +
  • +
  • + + + + instmixin + instmixinList + + + + + + + + + + + + + + +
    + Arguments: + + instmixinList: list of classes that should be registered as instmixins +
    + Description: + + + Specifies the list of instmixins (per-class mixins) for the class. + Note that the registration of a per-mixin-class does not invoke + automatically the constructors of the registered class. + The method instmixin overwrites any previous settings. + +
    + Return: + + empty string +
    +
  • +
  • + + + + instmixinappend + mixinList + + + + + + + + + + + + + + +
    + Arguments: + + mixinList: name of the new instmixin +
    + Description: + + + Convenience method that appends an instmixin to the existing mixins of the class. + +
    + Return: + + empty string +
    +
  • +
  • + + + + instparametercmd + name + + + + + + + + + + + + + + +
    + Arguments: + + name: variable to be provided with getter/setter method +
    + Description: + + + Add a getter/setter command for an instance variable with the + specified name. This method is used for example by the + parameter method. + Example:
    + Class C
    + C instparametercmd x
    + C c1 -x 100
    + puts [c1 x]
    + +
    + Return: + + empty string +
    +
  • +
  • + + + + instproc + name + args + body + ?preAssertion? + ?postAssertion? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Arguments: + + name: instance method name +
    + + + args: instance method arguments +
    + + + body: instance method body +
    + + + ?preAssertion?: optional assertions that must hold before the proc executes +
    + + + ?postAssertion?: optional assertions that must hold after the proc executes +
    + Description: + + + Specify an instance method in the same style as Tcl specifies procs. + + Optionally assertions may be given. The number of args is either 3 or 5. + Therefore, to specify only post-assertions an empty pre-assertion list + must be given. All assertions are a list + of ordinary Tcl conditions. + +
    + Return: + + empty string +
    +
  • +
  • + + + + insttclcmd + name + + + + + + + + + + + + + + +
    + Arguments: + + name: cmd to be execute in obj scope +
    + Description: + + + Create a method 'name' that is evaluated as a tcl command in the + scope of the object. E.g. 'Object insttclcmd vwait' creates + an instproc vwait on Object that executes Tcl's vwait in the + scope of the object. That is local vars of the object are accessible + to that vwait. (Used to circumvent, for instance, the TCL_GLOBAL_ONLY + flag of vwait in Tcl.) + +
    + Return: + + empty string +
    +
  • +
  • + + + + new + ?-childof obj? ?args? + + + + + + + + + + + + + + +
    + Arguments: + + ?-childof obj? ?args?: args passed to create +
    + Description: + + + Convenience method to create an autonamed object. E.g.: +
     Http new 
    + creates ::xotcl::__#0, a subsequent call creates ::xotcl::__#1, ...
    + If -childof obj is specified, the new object is + created as a child of the specified object. + +
    + Return: + + new object name +
    +
  • +
  • + + + + parameter + parameterList + + + + + + + + + + + + + + +
    + Arguments: + + parameterList: list of parameter definitions +
    + Description: + + + Specify parameters automatically created for each instance. + Parameters denote instance variables which are available on each class instance + and that have a getter/setter method with their own name. + Parameters are specified in a parameter list of the form + {p1 p2 ... pn}. + p1 ... pn may either be parameter names or definitions of the form + {parameterName defaultValue}. + If a default value is given, that parameter + is created during creation process of the instance object, otherwise + only the getter/setter method is created (and the parameter does not + exist). The getter/setter method has the same name as the + parameter. It gets and returns the parameter, if no + argument is specified. With one argument, the parameter is set + to the argument value. + + Example: +
    +    Class Car -parameter {{doors 4} color}
    +    Car herby -doors 2 -color green
    +    
    + +
    + Return: + + empty string +
    +
  • +
  • + + + + parameterclass + class + + + + + + + + + + + + + + +
    + Arguments: + + class: parameter class name +
    + Description: + + + Set the parameter class. + The parameter class specifies how parameters are stored and + maintained internally. Per default, a method "default" is called, + to set the parameter with a default value. + + I.e., +
    +    Class Car -parameter {
    +      {doors 4}
    +    }
    +    
    + + is a short form for +
    +    Class Car -parameter {
    +      {doors -default 4}
    +    }
    +    
    + + For specialized parameter classes other methods can be called, e.g.
    +
     
    +    {doors -default 3 -updateWidget car}
    +    
    + +
    + Return: + + empty string +
    +
  • +
  • + + + + recreate + obj + ?args? + + + + + + + + + + + + + + + + + + +
    + Arguments: + + obj: obj to be recreated +
    + + + ?args?: arbitrary arguments +
    + Description: + + + Hook called upon recreation of an object. Performs standard object + initialization, per default. May be overloaded/-written. It calls + another method cleanup which handles actual cleanup of the object + during next. That means, if you overload recreate, in the pre-part + the object still contains its old state, after next it is cleaned up. + +
    + Return: + + obj name +
    +
  • +
  • + + + + superclass + classList + + + + + + + + + + + + + + +
    + Arguments: + + classList: list of classes +
    + Description: + + + Specify super-classes for a class. "superclass" changes the list + of superclasses dynamically to classList. + +
    + Return: + + empty string +
    +
  • +
  • + + + + unknown + ?args? + + + + + + + + + + + + + + +
    + Arguments: + + ?args?: arbitrary arguments +
    + Description: + + + Standard unknown mechanism. This mechanism is always triggered when + XOTcl does not know a method called on an object. Supposed that + there is no method with the called name, XOTcl looks up the method + "unknown" (which is found on the Class Object) and executes it. + The standard unknown-mechanism of XOTcl calls create with all + arguments stepping one step to the right; in the general case: + +
    ClassName create ClassName ?args?
    + + Unknown can be overloaded in user-defined subclasses of class. + +
    + Return: + + Standard unknown mechanism returns result of create +
    +
  • +
  • + + + + volatile + + + + + + + + + + + + + + + +
    + Arguments: + + : +
    + Description: + + + This method is used to specify that the object + should be deleted automatically, when the current + tcl-proc/object-proc/instproc is left. Example + set x [Object new -volatile] + +
    + Return: + + empty string +
    +
  • +
+

Procs

+
    +
  • + + + + __unknown + name + + + + + + + + + + + + + + +
    + Arguments: + + name: name of class to be created +
    + Description: + + + This method is called, whenever XOTcl references a class, + which is not defined yet. In the following example: + Class C -superclass D + D is not defined. Therefore Class __unknown D + is called. This callback can be used to perform auto-loading + of classes. After this call, XOTcl tries again to + resolve D. If it succeeds, XOTcl will continue; otherwise, + an error is generated. + +
    + Return: + + empty string +
    +
  • +
+

+
+

+ + + +

Class: Object

+ Class: Class +
+ Procs/Instprocs: + abstract, append, array, autoname, check, class, cleanup, configure, copy, destroy, eval, exists, extractConfigureArg, filter, filterappend, filterguard, filtersearch, getExitHandler, hasclass, incr, info, instvar, invar, isclass, ismetaclass, ismixin, isobject, istype, lappend, mixin, mixinappend, move, noinit, parametercmd, proc, procsearch, requireNamespace, set, setExitHandler, trace, unset, uplevel, upvar, vwait. + + + + + +
+ Description: + + + This class holds the pre-defined methods available for all XOTcl + objects. All these methods are also available on classes. + +
+

Instprocs

+
    +
  • + + + + abstract + methtype + methname + arglist + + + + + + + + + + + + + + + + + + + + + + +
    + Arguments: + + methtype: instproc or proc +
    + + + methname: name of abstract method +
    + + + arglist: arguments +
    + Description: + + + Specify an abstract method for class/object with arguments. + + An abstract method specifies an interface and + returns an error, if it is invoked directly. + Sub-classes or mixins have to override it. + +
    + Return: + + error +
    +
  • +
  • + + + + append + varName + args + + + + + + + + + + + + + + + + + + +
    + Arguments: + + varName: name of variable +
    + + + args: arguments to append +
    + Description: + + + Append all of the value arguments to the current value of variable + varName. Wrapper to the same named Tcl command + (see documentation of Tcl command with the same name for details). + +
    + Return: + + empty string +
    +
  • +
  • + + + + array + opt + array + ?args? + + + + + + + + + + + + + + + + + + + + + + +
    + Arguments: + + opt: array option +
    + + + array: array name +
    + + + ?args?: args of the option +
    + Description: + + + This method performs one of several operations on the variable + given by arrayName. It is a wrapper to the same named Tcl command + (see documentation of Tcl command with the same name for details). + +
    + Return: + + diverse results +
    +
  • +
  • + + + + autoname + ?<-instance>|<-reset>? + name + + + + + + + + + + + + + + + + + + +
    + Arguments: + + ?<-instance>|<-reset>?: Optional modifiers:
    + '-instance' makes the autoname start with a small letter.
    + '-reset' resets the autoname index to 0. +
    + + + name: base name of the autoname +
    + Description: + + + autoname creates an automatically assigned name. It is + constructed from the base name plus an index, that is + incremented for each usage. E.g.: +
    $obj autoname a
    + produces a0, a1, a2, ... + Autonames may have format strings + as in the Tcl 'format' command. + E.g.: +
    $obj autoname a%06d
    + produces a000000, a000001, a000002, ... + +
    + Return: + + newly constructed autoname value +
    +
  • +
  • + + + + check + options + + + + + + + + + + + + + + +
    + Arguments: + + options: none, one or more of: (?all? ?pre? ?post? ?invar? ?instinvar?) +
    + Description: + + + Turn on/off assertion checking. Options argument is the list + of assertions, that should be checked on the object automatically. + Per default assertion checking is turned + off. Examples: +
    +      o check {}; # turn off assertion checking on object o  
    +      o check all; # turn on all assertion checks on object o 
    +      o check {pre post}; # only check pre/post assertions 
    +      
    + info check introspects check options. + +
    + Return: + + empty string +
    +
  • +
  • + + + + class + newClass + + + + + + + + + + + + + + +
    + Arguments: + + newClass: new class name +
    + Description: + + + Changes the class of an object dynamically to newClass. + +
    + Return: + + empty string +
    +
  • +
  • + + + + cleanup + ?args? + + + + + + + + + + + + + + +
    + Arguments: + + ?args?: Arbitrary arguments passed to cleanup +
    + Description: + + + Resets an object or class into an initial state, as after construction. + Called during recreation process by the method 'recreate' + +
    + Return: + + empty string +
    +
  • +
  • + + + + configure + ?args? + + + + + + + + + + + + + + +
    + Arguments: + + ?args?: '-' method calls +
    + Description: + + + Calls the '-' methods. I.e. evaluates arguments and calls + everything starting with '-' (and not having a digit a + second char) as a method. Every list element until the next '-' + is interpreted as a method argument. configure is called + before the constructor during initialization and recreation. + E.g.
    Object o -set x 4
    + here: +
    o configure -set x 4
    + is executed. + + +
    + Return: + + number of the skipped first arguments +
    +
  • +
  • + + + + copy + newName + + + + + + + + + + + + + + +
    + Arguments: + + newName: destination of copy operation +
    + Description: + + + Perform a deep copy of the object/class (with all information, like + class, parameter, filter, ...) + to "newName". + +
    + Return: + + empty string +
    +
  • +
  • + + + + destroy + ?args? + + + + + + + + + + + + + + +
    + Arguments: + + ?args?: Arbitrary arguments passed to the destructor +
    + Description: + + + Standard destructor. + Can be overloaded for customized destruction process. Actual destruction + is done by instdestroy. "destroy" in principal does: +
    +      Object instproc destroy args {
    +        [my info class] instdestroy [self]
    +      }
    +      
    + +
    + Return: + + empty string +
    +
  • +
  • + + + + eval + args + + + + + + + + + + + + + + +
    + Arguments: + + args: cmds to eval +
    + Description: + + + Eval args in the scope of the object. That is local variables + are directly accessible as Tcl vars. + +
    + Return: + + result of cmds evaled +
    +
  • +
  • + + + + extractConfigureArg + al + name + ?cutTheArg? + + + + + + + + + + + + + + + + + + + + + + +
    + Arguments: + + al: Argument List Name +
    + + + name: Name of the Configure Argument to be extracted (should start with '-') +
    + + + ?cutTheArg?: if cutTheArg not 0, it cut from upvar argsList, default is 0 +
    + Description: + + + Check an argument list separated with '-' args, as for instance + configure + arguments, and extract the argument's values. Optionally, cut the + whole argument. + +
    + Return: + + value list of the argument +
    +
  • +
  • + + + + exists + var + + + + + + + + + + + + + + +
    + Arguments: + + var: variable name +
    + Description: + + + Check for existence of the named instance variable on the object. + +
    + Return: + + 1 if variable exists, 0 if not +
    +
  • +
  • + + + + filter + filterList + + + + + + + + + + + + + + +
    + Arguments: + + filterList: list of methods that should be registered as filters +
    + Description: + + + Specifies the list of filters registered for the class. + filter overwrites all previous setting. + Filters must be available on the class or its heritage + order. Filters may also reside on the meta-class of the class. + + Filter list may contain filter guards. Then the + filter is composed of two list elements: {filtername filterguard}. + +
    + Return: + + empty string +
    +
  • +
  • + + + + filterappend + filterList + + + + + + + + + + + + + + +
    + Arguments: + + filterList: name of the new filter +
    + Description: + + + Convenience method that appends a filter to the existing filters of the object. + +
    + Return: + + empty string +
    +
  • +
  • + + + + filterguard + filtername + guard + + + + + + + + + + + + + + + + + + +
    + Arguments: + + filtername: filter name of a registered filter +
    + + + guard: set of conditions to execute the filter +
    + Description: + + + Add conditions to guard a filter registration point. The filter + is only executed, if the guards are true. Otherwise we ignore the + filter. If no guards are given, we always execute the filter. + +
    + Return: + + an empty string +
    +
  • +
  • + + + + filtersearch + methodName + + + + + + + + + + + + + + +
    + Arguments: + + methodName: filter method name +
    + Description: + + + Search a full qualified method name that + is currently registered as a filter. Return a list of the + proc qualifier format: + 'objName|classname proc|instproc methodName'. + +
    + Return: + + full qualified name, if filter is found, otherwise an empty string +
    +
  • +
  • + + + + hasclass + ?className? + + + + + + + + + + + + + + +
    + Arguments: + + ?className?: name of a class to be tested +
    + Description: + + + Test whether the argument is either + a mixin or instmixin of the object or + if it is on the class hierarchy of the object. + This method combines the functionalities of + istype and ismixin. + +
    + Return: + + 1 or 0 +
    +
  • +
  • + + + + incr + varName + ?increment? + + + + + + + + + + + + + + + + + + +
    + Arguments: + + varName: variable name +
    + + + ?increment?: value to increment +
    + Description: + + + Increments the value stored in the variable whose name is varName. + The new value is stored as a decimal string in variable varName and also + returned as result. Wrapper to the same named Tcl command + (see documentation of Tcl command with the same name for details). + +
    + Return: + + new value of varName +
    +
  • +
  • + + + + info + args + + + + + + + + + + + + + + +
    + Arguments: + + args: info options +
    + Description: + + + Introspection of objects. The following options can be specified: +
      +
    • objName info args method: + Returns the arguments of the specified method. + +
    • objName info body method: + Returns the body of the specified method. + +
    • objName info class ?classname?: + Returns the name of the class of the current object, if classname was + not specified, otherwise it returns 1 if classname matches the + object's class and 0 if not. + +
    • objName info children ?pattern?: Returns the list of aggregated + objects with fully qualified names if pattern was not specified, + otherwise it returns all children where the object name matches the pattern. + +
    • objName info commands ?pattern: Returns all commands + defined for the object if pattern was not specified, otherwise + it returns all commands that match the pattern. + +
    • objName info default method arg var: Returns 1 if the + argument arg of the method method has a default + value, otherwise 0. If it exists the default value is stored in var. + +
    • objName info filter: Returns a list of filters. + With -guard modifier all filterguards are integrated + ( objName info filter -guards). With -order + modifier the order of filters (whole hierarchy) is printed. + +
    • objName info filterguard name: Returns the guards + for filter identified by name. + +
    • objName info hasNamespace: From XOTcl version 0.9 on, + namespaces + of objects are allocated on demand. hasNamespace returns 1, if the + object currently has a namespace, otherwise 0. The method + requireNamespace can + be used to ensure that the object has a namespace. + +
    • objName info info: Returns a list of all available info + options on the object. + +
    • objName info invar: Returns object invariants. + +
    • objName info metadata ?pattern?: + Returns available metadata options. + +
    • objName info methods: Returns the list of all method + currently reachable for objName. Includes procs, instprocs, cmds, + instcommands on object, class hierarchy and mixins. + Modifier -noprocs only returns instcommands, + -nocmds only returns procs. + Modifier -nomixins excludes search on mixins. + +
    • objName info mixin: Returns the list of mixins + of the object. With -order modifier the order of mixins + (whole hierarchy) is printed. + +
    • objName info parent: + Returns parent object name (or "::" for no parent), + in fully qualified form. + +
    • objName info post methodName: + Returns post assertions of methodName. + +
    • objName info pre methodName: + Returns pre assertions of methodName. + +
    • objName info procs ?pattern?: Returns all procs defined + for the object if pattern was not specified, + otherwise it returns all procs that match the pattern. + +
    • objName info vars ?pattern?: Returns all variables defined + for the object if pattern was not specified, otherwise it + returns all variables that match the pattern. +
    + +
    + Return: + + Value of introspected option as a string. +
    +
  • +
  • + + + + instvar + v1 + ?v2...vn? + + + + + + + + + + + + + + + + + + +
    + Arguments: + + v1: instvar variable +
    + + + ?v2...vn?: optional other instvar variables +
    + Description: + + + Binds an variable of the object to the current method's scope. + Example: +
    +      kitchen proc enter {name} {
    +        my instvar persons
    +        set persons($name) [clock seconds]
    +      }
    +      
    + Now persons can be accessed as a local variable of the method.
    + + A special syntax is: {varName aliasName} . + This gives the variable with the name + varName the alias aliasName. + This way the variables can be linked to the methods scope, + even if a variable with that name already exists in the scope. + +
    + Return: + + empty string +
    +
  • +
  • + + + + invar + invariantList + + + + + + + + + + + + + + +
    + Arguments: + + invariantList: Body of invariants for the object +
    + Description: + + + Specify invariants for the objects. All assertions are a list + of ordinary Tcl conditions. + +
    + Return: + + empty string +
    +
  • +
  • + + + + isclass + ?className? + + + + + + + + + + + + + + +
    + Arguments: + + ?className?: name of a class to be tested +
    + Description: + + + Test whether the argument (or the Object, if no argument is specified) + is an existing class or not. + +
    + Return: + + 1 or 0 +
    +
  • +
  • + + + + ismetaclass + ?metaClassName? + + + + + + + + + + + + + + +
    + Arguments: + + ?metaClassName?: name of a metaclass to be tested +
    + Description: + + + Test whether the argument (or the Object, if no argument is specified) + is an existing metaclass or not. + +
    + Return: + + 1 or 0 +
    +
  • +
  • + + + + ismixin + ?className? + + + + + + + + + + + + + + +
    + Arguments: + + ?className?: name of a class to be tested +
    + Description: + + + Test whether the argument is a mixin or instmixin of the object. + +
    + Return: + + 1 or 0 +
    +
  • +
  • + + + + isobject + objName + + + + + + + + + + + + + + +
    + Arguments: + + objName: string that should be tested, whether it is a name of an object or not +
    + Description: + + + Test whether the argument is an existing object or not. Every XOTcl object + has the capability to check the object system. + +
    + Return: + + 1 or 0 +
    +
  • +
  • + + + + istype + className + + + + + + + + + + + + + + +
    + Arguments: + + className: type name +
    + Description: + + + Test whether the argument is a type of the object. I.e., 1 is returned + if className is either the class of the object or one of its + superclasses. + +
    + Return: + + 1 or 0 +
    +
  • +
  • + + + + lappend + varName + args + + + + + + + + + + + + + + + + + + +
    + Arguments: + + varName: name of variable +
    + + + args: elements to append +
    + Description: + + + Append all the specified arguments to the list specified + by varName as separated elements (typically separated by blanks). + If varName doesn't exist, it creates a list with the specified + values + (see documentation of Tcl command with the same name for details). + +
    + Return: + + empty string +
    +
  • +
  • + + + + mixin + mixinList + + + + + + + + + + + + + + +
    + Arguments: + + mixinList: list of classes that should be registered as mixins +
    + Description: + + + Specifies the list of mixins registered for the object. + The method mixin overwrites all previous settings. + +
    + Return: + + empty string +
    +
  • +
  • + + + + mixinappend + mixinList + + + + + + + + + + + + + + +
    + Arguments: + + mixinList: name of the new mixin +
    + Description: + + + Convenience method that appends a mixin to the existing mixins of the object. + +
    + Return: + + empty string +
    +
  • +
  • + + + + move + newName + + + + + + + + + + + + + + +
    + Arguments: + + newName: destination of move operation +
    + Description: + + + Perform a deep move of the object/class (with all information, like + class, parameter, filter, ...) + to "newName". + +
    + Return: + + empty string +
    +
  • +
  • + + + + parametercmd + name + + + + + + + + + + + + + + +
    + Arguments: + + name: variable to be provided with getter/setter method +
    + Description: + + + Add a getter/setter for an instance variable with the + specified name as a command for the obj. + Example:
    + Object o
    + o parametercmd x
    + o x 100
    + puts [o x]
    + +
    + Return: + + empty string +
    +
  • +
  • + + + + noinit + + + + + + + + + + +
    + Description: + + + flag that constructor (method init) should + not be called. + Example:
    + Class C
    + C instproc init {} {puts hu}
    + C c1 -noinit
    + The object c1 will be created without calling + the constructor. This can be used to draw a snapshot of + an existing object (using the serializer) and to recreate + it in some other context in its last state. + +
    + Return: + + empty string +
    +
  • +
  • + + + + proc + name + args + body + ?preAssertion? + ?postAssertion? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Arguments: + + name: method name +
    + + + args: method arguments +
    + + + body: method body +
    + + + ?preAssertion?: optional assertions that must hold before the proc executes +
    + + + ?postAssertion?: optional assertions that must hold after the proc executes +
    + Description: + + + Specify a method in the same style as Tcl specifies procs. + + Optionally assertions may be given. The number of args is either + 3 or 5. + Therefore, to specify only post-assertions an empty pre-assertion + list must be given. All assertions are a list + of ordinary Tcl conditions. + +
    + Return: + + empty string +
    +
  • +
  • + + + + procsearch + procname + + + + + + + + + + + + + + +
    + Arguments: + + procname: simple proc name +
    + Description: + + + Search for a proc or instproc on an object and return the fully + qualified name of the method as a list in + proc qualifier format: + 'objName|classname proc|instproc methodName'. E.g., +
     o procsearch set 
    + returns
    ::xotcl::Object instproc set
    . + +
    + Return: + + fully qualified name of the searched method or empty string if not found +
    +
  • +
  • + + + + requireNamespace + + + + + + + + + + +
    + Description: + + + The method requireNamespace can + be used to ensure that the object has a namespace. + Namespaces are created automatically by XOTcl, when e.g. an object has + child objects (aggregated objects) or procs. The namespace + will be used to keep instance variables, procs and child objects. + To check, whether an object currently has a namespace, + info hasNamespace can be used. + + Hint: In versions prior to XOTcl 0.9 all XOTcl objects + had their own namespaces; it was made on demand to save memory when + e.g. huge numbers of objects are created. + requireNamespace is often needed when e.g. using Tk widgets + when variables are to be referenced via the namespace + (with ... -variable [self]::varname ...). + +
    + Return: + + empty string +
    +
  • +
  • + + + + set + varname + ?value? + + + + + + + + + + + + + + + + + + +
    + Arguments: + + varname: name of the instance variable +
    + + + ?value?: optional new value +
    + Description: + + + Set an instance variable in the same style as Tcl sets a variable. + + With one argument, we retrieve the current value, + with two arguments, we set the instance variable to the new value. + +
    + Return: + + Value of the instance variable +
    +
  • +
  • + + + + trace + varName + + + + + + + + + + + + + + +
    + Arguments: + + varName: name of variable +
    + Description: + + + Trace an object variable + (see documentation of Tcl command with the same name for details). + +
    + Return: + + empty string +
    +
  • +
  • + + + + unset + v1 + ?v2...vn? + + + + + + + + + + + + + + + + + + +
    + Arguments: + + v1: Variable to unset +
    + + + ?v2...vn?: Optional more vars to unset +
    + Description: + + + The unset operation deletes one or optionally a set of variables from an object. + +
    + Return: + + empty string +
    +
  • +
  • + + + + uplevel + ?level? + command ?args? + + + + + + + + + + + + + + + + + + +
    + Arguments: + + ?level?: Level +
    + + + command ?args?: command and arguments to be called +
    + Description: + + + When this method is used without the optional level, it is a short form + of the Tcl command
    + upevel [self callinglevel] command ?args?. + When it is called with the level, it is compatible with the original tcl command. + +
    + Return: + + result of the command +
    +
  • +
  • + + + + upvar + ?level? + othervar localvar + ?othervar localvar? + + + + + + + + + + + + + + + + + + + + + + +
    + Arguments: + + ?level?: Level +
    + + + othervar localvar: referenced variable and variale in the local scope +
    + + + ?othervar localvar?: optional pairs of referenced and local variable names +
    + Description: + + + When this method is used without the optional level, it is a short form + of the Tcl command
    + upvar [self callinglevel] othervar localvar ?...?. + When it is called with the level, it is compatible with the original tcl command. + +
    + Return: + + result of the command +
    +
  • +
  • + + + + vwait + varName + + + + + + + + + + + + + + +
    + Arguments: + + varName: name of variable +
    + Description: + + + Enter event loop until the specified variable is set + (see documentation of Tcl command with the same name for details). + +
    + Return: + + empty string +
    +
  • +
+

Procs

+
    +
  • + + + + getExitHandler + + + + + + + + + + +
    + Description: + + Retrieve the current exit handler procedure body as a string. +
    + Return: + + exit handler proc body +
    +
  • +
  • + + + + setExitHandler + body + + + + + + + + + + + + + + +
    + Arguments: + + body: procedure body +
    + Description: + + + Set body for the exit handler procedure. The exit handler + is executed when XOTcl is existed or aborted. Can be used to call + cleanups that are not associated with objects (otherwise use + destructor). + On exit the object destructors are called after the + user-defined exit-handler. + +
    + Return: + + exit handler proc body +
    +
  • +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/langRef-xotcl.pdf =================================================================== diff -u -N Binary files differ Index: doc/langRef.xotcl =================================================================== diff -u -N --- doc/langRef.xotcl (revision 0) +++ doc/langRef.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1450 @@ +# $Id: langRef.xotcl,v 1.18 2007/09/05 19:09:22 neumann Exp $ +package provide XOTcl-langRef 1.5.5 +package require XOTcl + +@ @File { + description { + XOTcl language reference. Describes predefined objects and classes. + } + "predefined primitives" { + XOTcl contains the following predefined primitives (Tcl commands): +
+
<@tt>self<@/tt>
+
computes callstack related information. + It can be used in the following ways: + <@UL> + <@LI><@TT>self - returns the name + of the object, which is currently in execution. If it is + called from outside of a proc, it returns the + error message ``<@TT>Can't find self''. + <@LI><@TT>self class - the self + command with a given argument <@TT>class returns the name of the + class, which holds the currently executing instproc. Note, that this + may be different to the class of the current object. If it is called + from a proc it returns an empty string. + <@LI><@TT>self proc - the self command with a given argument + <@TT>proc returns the name of the currently executing proc or + instproc. + <@li><@TT>self callingclass: Returns class name of the + class that has called the executing method. + <@li><@TT>self callingobject: Returns object name of + the object that has called the executing method. + <@li><@TT>self callingproc: Returns proc name of + the method that has called the executing method. + <@li><@TT>self calledclass: Returns class name of the + class that holds the target proc (in mixins and filters). + <@li><@TT>self calledproc: Returns method + name of the target proc (only applicable + in a filter). + <@li><@TT>self isnextcall: Return 1 if this method + was invoked via next, otherwise 0 + <@li><@TT>self next: Return the + "next" method on the precedence path as a string. + <@li><@TT>self filterreg: In a filter: returns the name + of the object/class on which the filter is registered. Returns either + 'objName filter filterName' or 'className instfilter filterName'. + + <@li><@TT>self callinglevel: Returns the calling level, from where + the actual proc was called from. Intermediary next calls are ignored + in this computation. The level is returned in a form + it can be used as first argument in <@TT>uplevel or <@TT>upvar. + + <@li><@TT>self activelevel: Returns the level, from where + the actual proc was invoked from. This might be the calling level or a next + call, whatever is higher in the stack. The level is returned in a form + it can be used as first argument in <@TT>uplevel or <@TT>upvar. + + <@/UL> + <@/p> +
+ +
<@tt>my methodName<@/tt>
+
is a short form for <@tt>[self] methodName and can only be + called in a context of an instproc or an method specific proc. It allows certain + optimizations and shorter to write. + <@/p><@p> + <@tt>next <@/tt>
invokes the next shadowed (same-named) method on the + precedence path and returns its result. If <@tt>next is + called without arguments, the arguments of the current method + are passed through the called method. If <@tt>next is + invoked with the flag <@tt>--noArgs, the shadowed method + is called without arguments. If other arguments are specified + for next, these will be used for the call. + <@/dd> +
<@tt>myvar varName
+
returns the fully qualified variable name of the specified + variable.

+

+ +
<@tt>myproc methodName ?args?
+
calls the specified XOTcl method without the need + of using "<@tt>[list [self] methodName ...]".

+

+ +
<@tt>::xotcl::alias class|obj methodName ?-objscope? ?-per-object? cmdName
+
can be used to register a predefined C-implemented Tcl command as + method <@tt>methodName. + The option <@tt>-objscope has the same meaning as for forwarder + (instance variables of the calling object appear in the local scope of + the Tcl command), <@tt>-per-object has the same meaning as for + the method <@tt>method (when used on a class, the method is registered for the + class object only, but not for the instances). This command + can be used to bootstrap xotcl (when e.g. no methods are available).

+

+ +
::xotcl::configure filter ?on|off?<@/tt>
+
allows to + turn on or off filters globally for the current interpreter. + By default, the filter state is turned off. + This function returns the old filter state. + This function is needed for the serializer that is intended + to serialize the objects classes independent of filter settings.

+

+ + +
<@tt>::xotcl::configure softrecreate ?on|off?<@/tt>
+
allows to control + what should happen, when an object / a class is recreated. Per + default it is set off, which means that the object/class is destroyed + and all relations (e.g. subclass/superclass) to other + objects/classes are destroyed as well. If <@tt>softrecreate is + set, the object is reseted, but not destroyed, the relations + are kept. This is important, when e.g. reloading a file + with class definitions (e.g. when used in OpenACS with file watching and + reloading). With <@tt>softrecreate set, + it is not necessary to recreate dependent subclasses etc. +
+ Example: e.g. there is a class hierarchy A <- B <- C + Without <@tt>softrecreate set, a reload of B means + first a destroy of B, leading to A <- C, and instances + of B are re-classed to ::xotcl::Object. When <@tt>softrecreate is + set, the structure remains unchanged. +
+ +
+ + } + date { $Date: 2007/09/05 19:09:22 $ } +} + +## +## Object methods +## +@ Class Object { + description { + This class holds the pre-defined methods available for all XOTcl + objects. All these methods are also available on classes. + } +} + +@ Object instproc abstract { + methtype "instproc or proc" + methodName "name of abstract method" + arglist "arguments" +} { + Description { + Specify an abstract method for class/object with arguments. + + An abstract method specifies an interface and + returns an error, if it is invoked directly. + Sub-classes or mixins have to override it. + } + return "error" +} + +@ Object instproc append { + varName "name of variable" + args "arguments to append" +} { + Description { + Append all of the value arguments to the current value of variable + varName. Wrapper to the same named Tcl command + (see documentation of Tcl command with the same name for details). + } + return "empty string" +} + +@ Object instproc array { + opt "array option" + array "array name" + ?args? "args of the option" +} { + Description { + This method performs one of several operations on the variable + given by arrayName. It is a wrapper to the same named Tcl command + (see documentation of Tcl command with the same name for details). + } + return "diverse results" +} + +@ Object instproc autoname { + ?<-instance>|<-reset>? "Optional modifiers: <@br> + '-instance' makes the autoname start with a small letter.<@br> + '-reset' resets the autoname index to 0." + name "base name of the autoname"} { + Description { + autoname creates an automatically assigned name. It is + constructed from the base name plus an index, that is + incremented for each usage. E.g.: + <@pre class='code'> $obj autoname a + produces a0, a1, a2, ... + Autonames may have format strings + as in the Tcl 'format' command. + E.g.: + <@pre class='code'> $obj autoname a%06d + produces a000000, a000001, a000002, ... + } + return "newly constructed autoname value" +} + +@ Object instproc check { + options "none, one or more of: (?all? ?pre? ?post? ?invar? ?instinvar?)" +} { + Description { + Turn on/off assertion checking. Options argument is the list + of assertions, that should be checked on the object automatically. + Per default assertion checking is turned + off. Examples: + <@pre class='code'> + o check {}; <@it># turn off assertion checking on object o + o check all; <@it># turn on all assertion checks on object o + o check {pre post}; <@it># only check pre/post assertions + <@a href="#Object-info">info check introspects check options. + } + return "empty string" +} + +@ Object instproc class { + newClass "?new class?" +} { + Description { + Changes the class of an object dynamically to <@tt>newClass. + The method returns the current value of class, + when it is called without arguments. + } + return "if <@tt>newClass is not specified return class, otherwise empty" +} + +@ Object instproc cleanup { + ?args? "Arbitrary arguments passed to cleanup" +} { + Description { + Resets an object or class into an initial state, as after construction. + Called during recreation process by the method 'recreate' + } + return "empty string" +} + +@ Object instproc configure { + ?args? "'-' method calls" +} { + Description { + Calls the '-' (dash) methods. I.e. evaluates arguments and calls + everything starting with '-' (and not having a digit a + second char) as a method. Every list element until the next '-' + is interpreted as a method argument. configure/tt> is called + before the constructor during initialization and recreation. + In the following example, the variable set is called via + configure before init: + <@pre class='code'> Object o -set x 4 + The method configure can be called with the + dash-notation at arbitrary times: + <@pre class='code'> o configure -set x 4 + } + return "number of the skipped first arguments" +} + +@ Object instproc contains { + "?-withnew?" "Option to overload new to create new objects within + the specified object. Per default, this option is turned on." + "?-object?" "object, in which the new objects should be created. + The default is the object, for which contains>/tt> was called." + "?-class?" "In combination with option -object: If the specified + object does not exist, create it from the specified class. The default + is ::xotcl::Object" + cmd "Tcl command to create multiple objects" +} { + Description { + This method can be used to create nested object structures + with little syntactic overhead. The method changes the namespace + to the specified object and creates objects there. + Optionally, a different object scope can be specified and + creating new objects in the specified scope can be turned off. + The following command creates a three rectangles, containing some + points. +
+  Class Point -parameter {{x 100} {y 300}}
+  Class Rectangle -parameter {color}
+
+  Rectangle r0 -color pink -contains {
+    Rectangle r1 -color red -contains {
+      Point x1 -x 1 -y 2
+      Point x2 -x 1 -y 2
+    }
+    Rectangle r2 -color green -contains {
+      Point x1
+      Point x2
+    }
+  }
+
+ The resulting object structure looks like in the folloing + example (simplified). +
+   ::r0
+   ::r0::r1
+   ::r0::r1::x1
+   ::r0::r1::x2
+   ::r0::r2
+   ::r0::r2::x1
+   ::r0::r2::x2
+
+ } + return "number of the skipped first arguments" +} + + + +@ Object instproc copy { + newName "destination of copy operation" +} { + Description { + Perform a deep copy of the object/class (with all information, like + class, parameter, filter, ...) + to "newName". + } + return "empty string" +} + +@ Object instproc destroy { + ?args? "Arbitrary arguments passed to the destructor" +} { + Description { + Standard destructor. + Can be overloaded for customized destruction process. Actual destruction + is done by instdestroy. "destroy" in principal does: + <@pre class='code'> + Object instproc destroy args { + [my info class] instdestroy [self] + } + } + return "empty string" +} + +@ Object instproc eval { + args "cmds to eval" +} { + Description { + Eval args in the scope of the object. That is local variables + are directly accessible as Tcl vars. + } + return "result of cmds evaled" +} + +@ Object instproc extractConfigureArg { + al "Argument List Name" + name "Name of the configure argument to be extracted (should start with '-')" + ?cutTheArg? "if cutTheArg not 0, it cut from upvar argsList, default is 0" +} { + Description { + Check an argument list separated with '-' args, as for instance + configure + arguments, and extract the argument's values. Optionally, cut the + whole argument. + } + return "value list of the argument" +} + +@ Object instproc exists { + var "variable name" +} { + Description { + Check for existence of the named instance variable on the object. + } + return "1 if variable exists, 0 if not" +} + +@ Object instproc filter { + ?args? "filter specification" +} { + Description { + If <@tt>$args is one argument, it specifies a list of filters to + be set. Every filter must be an XOTcl proc/instproc within + the object scope. + If <@tt>$args it has more argument, the first one specifies the + action. Possible values are <@tt>assign, <@tt>get, + <@tt>add or <@tt>delete, it modifies the current + settings as indicated. For more details, check the + tutorial. + } + return "if <@tt>$args return empty current filters, otherwise empty" +} + +@ Object instproc filterguard { + filterName "filter name of a registered filter" + guard "set of conditions to execute the filter" +} { + description { + Add conditions to guard a filter registration point. The filter + is only executed, if the guards are true. Otherwise we ignore the + filter. If no guards are given, we always execute the filter. + } + return "an empty string" +} + +@ Object instproc filtersearch { + methodName "filter method name" +} { + description { + Search a full qualified method name that + is currently registered as a filter. Return a list of the + proc qualifier format: + 'objName|className proc|instproc methodName'. + } + return "full qualified name, if filter is found, otherwise an empty string" +} + + +@ Object instproc forward { + methodName "name of forwarder method" + ?options? "-objscope, -methodprefix string, -default names, -earlybinding, -verbose" + ?callee? "named of the called command or object" + ?args? "arguments" + +} { + Description { + Register an object specific method (similar to a proc) for forwarding calls to + a callee (target Tcl command, other object). + When the forwarder method is called, the actual arguments + of the invocation are appended to the specified arguments. In callee an + arguments certain substitutions can take place: +
  • %proc: substituted by name of the forwarder method
  • +
  • %self: substitute by name of the object
  • +
  • %1: substitute by first argument of the invocation
  • +
  • {%@POS value}: substitute the specified value in the argument list + on position POS, where POS can be a positive or negative integer + or end. Positive integers specify the position from the begin + of the list, while negative integer specify the position from the end. +
  • {%argclindex LIST}: take the nth argument of the specified list as + substitution value, where n is the number of arguments from the + invocation. +
  • %%: a single percent.
  • +
  • %Tcl-command: command to be executed; substituted by result.
  • +
+ Additionally each argument can be prefixed by the positional prefix %@POS + (note the delimiting space at the end) that can be used to specify an + explicit position. POS can be a positive or negative integer or the word + end. The positional arguments are evaluated from left to + right and should be used in ascending order. valid Options are: +
  • -objscope causes the target to be evaluated in the scope + of the object,
  • +
  • -methodprefix string inserts the specified prefix + in front of the second argument of the invocation,
  • +
  • -default is used for default method names (only + in connection with %1)
  • +
  • -earlybinding: look up the function + pointer of the called Tcl command at + definition time of the forwarder instead of invocation time. + This option should only be used + for calling C-implemented Tcl commands, no procs etc.);
  • +
  • -verbose
  • : print the substituted command to stderr + before executing +
+ See + tutorial + for detailed examples. + } + return "empty" +} + + +@ Object instproc hasclass { + ?className? "name of a class to be tested" +} { + Description { + Test whether the argument is either + a mixin or instmixin of the object or + if it is on the class hierarchy of the object. + This method combines the functionalities of + istype and ismixin. + } + return "1 or 0" +} + + +@ Object instproc incr { + varName "variable name" + ?increment? "value to increment" +} { + Description { + Increments the value stored in the variable whose name is varName. + The new value is stored as a decimal string in variable varName and also + returned as result. Wrapper to the same named Tcl command + (see documentation of Tcl command with the same name for details). + } + return "new value of varName" +} + +@ Object instproc info { + args "info options" +} { + Description { + Introspection of objects. The following options can be specified: + <@l> + <@li><@TT>objName info args method: + Returns the arguments of the specified proc (object specific method). + + <@li><@TT>objName info body method: + Returns the body of the specified proc (object specific method). + + <@li><@TT>objName info class ?classname?: + Returns the name of the class of the current object, if className was + not specified, otherwise it returns 1 if className matches the + object's class and 0 if not. + + <@li><@TT>objName info children ?pattern?: Returns the + list of aggregated objects with fully qualified names if + <@TT>pattern was not specified, otherwise it returns all + children where the object name matches the pattern. + + <@li><@TT>objName info commands ?pattern: Returns all + commands defined for the object if <@TT>pattern was not + specified, otherwise it returns all commands that match the + pattern. + + <@li><@TT>objName info default method arg var: Returns 1 + if the argument <@TT>arg of the proc (object specific + method) <@TT>method has a default value, otherwise 0. If + it exists the default value is stored in <@TT>var. + + <@li><@TT>objName info filter: Returns a list of filters. + With -guard modifier all filterguards are integrated + (<@TT> objName info filter -guards). With <@TT>-order + modifier the order of filters (whole hierarchy) is printed. + + <@li><@TT>objName info filterguard name: Returns the guards + for filter identified by name. + + <@li><@TT>objName info hasNamespace: From XOTcl version 0.9 on, + namespaces + of objects are allocated on demand. hasNamespace returns 1, if the + object currently has a namespace, otherwise 0. The method + <@TT>requireNamespace can + be used to ensure that the object has a namespace. + + <@li><@TT>objName info info: Returns a list of all available info + options on the object. + + <@li><@TT>objName info invar: Returns object invariants. + + <@li><@TT>objName info methods: Returns the list of all methods + currently reachable for objName. Includes procs, instprocs, cmds, + instcommands on object, class hierarchy and mixins. + Modifier <@TT>-noprocs only returns instcommands, + <@TT>-nocmds only returns procs. + Modifier <@TT>-nomixins excludes search on mixins. + + <@li><@TT>objName info mixin: Returns the list of mixins + of the object. With <@TT>-order modifier the order of mixins + (whole hierarchy) is printed. + + <@li><@TT>objName info nonposargs methodName: Returns + non-positional arg list of methodName + + <@li><@TT>objName info parent: + Returns parent object name (or "::" for no parent), + in fully qualified form. + + <@li><@TT>objName info post methodName: + Returns post assertions of methodName. + + <@li><@TT>objName info pre methodName: + Returns pre assertions of methodName. + + <@li><@TT>objName info procs ?pattern?: Returns all procs + defined for the object if <@TT>pattern was not specified, + otherwise it returns all procs that match the pattern. + + <@li><@TT>objName info precedence ?pattern?: Returns all + classes in the precedence order from which the specified + object inherits methods. The returned list of classes contains + the mixin and instmixin classes as well as the classes of the + superclass chain in linearized order (i.e., duplicate classes + are removed). If the pattern is specified, only matching classes + are returned. + + <@li><@TT>objName info vars ?pattern?: Returns all + variables defined for the object if <@TT>pattern was not + specified, otherwise it returns all variables that match the + pattern. <@/ul> + } + return "Value of introspected option as a string." +} + +@ Object instproc instvar { + v1 "name of instance variable" + "?v2...vn?" "optional other names for instance variables" +} { + Description { + Binds an variable of the object to the current method's scope. + Example: + <@pre class='code'> + kitchen proc enter {name} { + my instvar persons + set persons($name) [clock seconds] + } + Now persons can be accessed as a local variable of the method.<@br> + + A special syntax is: <@tt> {varName aliasName} . + This gives the variable with the name + <@TT>varName the alias <@TT>aliasName. + This way the variables can be linked to the methods scope, + even if a variable with that name already exists in the scope. + } + return "empty string" +} + +@ Object instproc invar { + invariantList "Body of invariants for the object" +} { + Description { + Specify invariants for the objects. All assertions are a list + of ordinary Tcl conditions. + } + return "empty string" +} + +@ Object instproc isclass { + ?className? "name of a class to be tested" +} { + Description { + Test whether the argument (or the Object, if no argument is specified) + is an existing class or not. + } + return "1 or 0" +} + +@ Object instproc ismetaclass { + ?metaClassName? "name of a metaclass to be tested" +} { + Description { + Test whether the argument (or the Object, if no argument is specified) + is an existing metaclass or not. + } + return "1 or 0" +} + +@ Object instproc ismixin { + ?className? "name of a class to be tested" +} { + Description { + Test whether the argument is a mixin or instmixin of the object. + } + return "1 or 0" +} + +@ Object instproc isobject { + objName "string that should be tested, whether it is a name of an object or not" +} { + Description { + Test whether the argument is an existing object or not. Every XOTcl object + has the capability to check the object system. + } + return "1 or 0" +} + +@ Object instproc istype { + className "type name" +} { + Description { + Test whether the argument is a type of the object. I.e., 1 is returned + if className is either the class of the object or one of its + superclasses. + } + return "1 or 0" +} + +@ Object instproc lappend { + varName "name of variable" + args "elements to append" +} { + Description { + Append all the specified arguments to the list specified + by varName as separated elements (typically separated by blanks). + If varName doesn't exist, it creates a list with the specified + values + (see documentation of Tcl command with the same name for details). + } + return "empty string" +} + + + +@ Object instproc mixin { + ?args? "mixin specification" +} { + Description { + If <@tt>$args is one argument, it specifies a list of mixins to + be set. Every mixin must be a defined class. + If <@tt>$args has more argument, the first one specifies the + action. Possible values are <@tt>assign, <@tt>get, + <@tt>add or <@tt>delete, it modifies the current + settings as indicated. For more details, check the + tutorial. + } + return "if <@tt>$args empty return current mixins, otherwise empty" +} + +@ Object instproc move { + newName "destination of move operation" +} { + Description { + Perform a deep move of the object/class (with all information, like + class, parameter, filter, ...) + to "newName". + Note that move is currently implemented as a copy plus + subsequent destroy operation. + } + return "empty string" +} + +@ Object instproc parametercmd { + name "variable to be provided with getter/setter method" +} { + description { + Add a getter/setter for an instance variable with the + specified name as a command for the obj. + Example: + <@pre class='code'> + Object o + o parametercmd x + o x 100 + puts [o x] + } + return "empty string" +} + +@ Object instproc noinit { +} { + description { + flag that constructor (method <@tt>init
) should + not be called. + Example: + <@pre class='code'> + Class C + C instproc init {} {puts hu} + C c1 -noinit + The object <@tt>c1 will be created without calling + the constructor. This can be used to draw a snapshot of + an existing object (using the serializer) and to recreate + it in some other context in its last state. + } + return "empty string" +} + + +@ Object instproc proc { + name "method name" + ?non-pos-args? "optional non-positional arguments" + args "method arguments" + body "method body" + "?preAssertion?" "optional assertions that must hold before the proc executes" + "?postAssertion?" "optional assertions that must hold after the proc executes" +} { + Description { + Specify a method in the same style as Tcl specifies procs. + <@br> + Optionally assertions may be specified by two additional arguments. + Therefore, to specify only post-assertions an empty pre-assertion + list must be given. All assertions are a list + of ordinary Tcl conditions. + <@br> + When instproc is called with an empty argument list and an empty + body, the specified instproc is deleted. + + } + return "empty string" +} + +@ Object instproc procsearch { + procName "simple proc name" +} { + Description { + Search which method should be invoked for an object and return the fully + qualified name of the method as a list in + proc qualifier format: + 'objName|className proc|instproc|forward|instforward|parametercmd|instparametercmd|cmd|instcmd methodName'. + The proc qualifier format reports the command used to create the method. The + only exception is instcmd and cmd, which refer to commands implemented in C. + E.g., + <@pre class='code'> o procsearch set + returns <@pre>::xotcl::Object instcmd set. + } + return "fully qualified name of the searched method or empty string if not found" +} + +@ Object instproc requireNamespace { +} { + Description { + The method <@TT>requireNamespace can + be used to ensure that the object has a namespace. + Namespaces are created automatically by XOTcl, when e.g. an object has + child objects (aggregated objects) or procs. The namespace + will be used to keep instance variables, procs and child objects. + To check, whether an object currently has a namespace, + <@TT>info hasNamespace can be used. + + Hint: In versions prior to XOTcl 0.9 all XOTcl objects + had their own namespaces; it was made on demand to save memory when + e.g. huge numbers of objects are created. + <@TT>requireNamespace is often needed when e.g. using Tk widgets + when variables are to be referenced via the namespace + (with <@TT>... -variable [self]::varName ...). + } + return "empty string" +} + +@ Object instproc set { + varName "name of the instance variable" + ?value? "optional new value" +} { + Description { + Set an instance variable in the same style as Tcl sets a variable. + + With one argument, we retrieve the current value, + with two arguments, we set the instance variable to the new value. + } + return "Value of the instance variable" +} + +@ Object instproc subst { + options "?-nobackslashes? ?-nocommands? ?-novariables?" + string "string to be substituted" +} { + Description { + Perform backslash, command, and variable substitutions + in the scope of the given object + (see documentation of Tcl command with the same name for details). + } + return "substituted string" +} + +@ Object instproc trace { + varName "name of variable" +} { + Description { + Trace an object variable + (see documentation of Tcl command with the same name for details). + } + return "empty string" +} + +@ Object instproc unset { + "?-nocomplain?" "possible error messages are suppressed" + v1 "Variable to unset" + "?v2...vn?" "Optional more vars to unset" +} { + Description { + The unset operation deletes one or optionally a set of variables from an object. + } + return "empty string" +} + +@ Object instproc uplevel { + ?level? "Level" + command ?args? "command and arguments to be called" +} { + Description { + When this method is used without the optional level, it is a short form + of the Tcl command + <@pre class='code'> uplevel [self callinglevel] command ?args?<@/pre> + When it is called with the level, it is compatible with the original Tcl command. + } + return "result of the command" +} +@ Object instproc upvar { + ?level? "Level" + otherVar localVar "referenced variable and variable in the local scope" + ?otherVar localVar? "optional pairs of referenced and local variable names" +} { + Description { + When this method is used without the optional level, it is a short form + of the Tcl command + <@pre class='code'> upvar [self callinglevel] otherVar localVar ?...?<@/pre>. + When it is called with the level, it is compatible with the original Tcl command. + } + return "result of the command" +} + +@ Object instproc vwait { + varName "name of variable" +} { + Description { + Enter event loop until the specified variable is set + (see documentation of Tcl command with the same name for details). + } + return "empty string" +} + +# procs of Object +@ Object proc getExitHandler {} { + Description "Retrieve the current exit handler procedure body as a string." + return "exit handler proc body" +} + +@ Object proc setExitHandler {body "procedure body"} { + Description { + Set body for the exit handler procedure. The exit handler + is executed when XOTcl is existed or aborted. Can be used to call + cleanups that are not associated with objects (otherwise use + destructor). + On exit the object destructors are called after the + user-defined exit-handler. + } + return "exit handler proc body" +} + +# class +@ Class Class -superclass Object { + description { + This meta-class holds the pre-defined methods available for all XOTcl + classes. + } +} +@ Class instproc alloc { + obj "new obj/class name" + ?args? "arguments passed to the new class after creation" +} { + description { + Allocate memory for a new XOTcl object or class. <@tt>create<@/tt> uses + <@tt>alloc to allocate memory. But <@tt>create<@/tt> also + calls init and evaluates '-' arguments as method calls. + In seldom cases the programmer may want to suppress the + <@tt>create<@/tt> + mechanism and just allocate memory. Then <@tt>alloc can + be used. + } + return "new class name" +} + +@ Class instproc allinstances { +} { + description { + Compute all immediate and indirect instances of a class + } + return "fully qualified list of instances" +} + +@ Class instproc create { + objName "name of a new class or object" + ?args? "arguments passed to the constructor" +} { + description { + Create user-defined classes or objects. If the class is a meta-class, + a class is created, otherwise an object. + + Create firstly calls <@tt>alloc in order to allocate memory for the + new object. Then default values for parameters are searched on + superclasses (an set if found). Then <@tt>args is searched for args + starting with '-' followed by an alpha character. These arguments + are called as methods. '-' followed by a numerical is interpreted + as a negative number (and not as a method). If a value of a method + called this way starts with a "a", the call can be placed safely + into a list (e.g. "Class c [-strangearg -a-] -simplearg 2"). + + Finally the constructor <@tt>init is called on the object + with all arguments up to the first '-' arg.<@p> + + The <@tt>create method is called implicitly through the + <@tt>unknown + mechanism when a class (meta-class) is called with an unknown + method. E.g. the following two commands are equivalent + + <@pre class='code'> + Car herby -color red + Car create herby -color red <@/pre> + + When a users may want to call the constructor <@tt>init + before other '-' methods, one can specify '-init' + explicitly in the left to + right order of the '-' method. Init is called always only once. + e.g.: + + <@pre class='code'> Class Car -init -superclass Vehicle <@/pre> + + } + return "name of the created instance (result of alloc)" +} + +@ Class instproc info { + args "info options" +} { + Description { + Introspection of classes. All options available for objects + (see <@a href="#Object-info">info object) is also available + for classes. + The following options can be specified: + <@ul> + + <@li><@TT>ClassName info classchildren ?pattern?: + Returns the list of nested classes with fully qualified names + if <@TT>pattern was not specified, + otherwise it returns all class children where the class name + matches the pattern. + + <@li><@TT>ClassName info classparent: + Returns the class ClassName is nesting to. + + <@li><@TT>ClassName info heritage ?pattern?: + Returns a list of all classes in the precedence order + of the class hierarchy. + If pattern is specified, only matching values are returned. + + <@li><@TT>ClassName info instances ?pattern?: + Returns a list of the instances of the class. + If pattern is specified, only matching values are returned. + + <@li><@TT>ClassName info instargs method: + Returns the arguments of the specified instproc (instance method). + + <@li><@TT>ClassName info instbody method: + Returns the body of the specified instproc (instance method). + + <@li><@TT>ClassName info instcommands ?pattern?: + Returns all commands defined for the class. If pattern + is specified it returns all commands that match the pattern. + + <@li><@TT>ClassName info instdefault method arg var: + Returns 1 if the argument <@TT>arg of the instproc (instance method) + <@TT>method has a default value, otherwise 0. If it exists + the default value is stored in <@TT>var. + + <@li><@TT>ClassName info instfilter: + Returns the list of registered filters. With -guard modifier + all instfilterguards are integrated + (<@TT> ClassName info instfilter -guards). + + <@li><@TT>objName info instfilterguard name: Returns the guards + for instfilter identified by name. + + <@li><@TT>ClassName info instinvar: + Returns class invariants. + + <@li><@TT>ClassName info instmixin: + Returns the list of instmixins of this class. + + <@li><@TT>ClassName info instnonposargs methodName: returns list of + non-positional args of methodName + + <@li><@TT>ClassName info instpost methodName: + Returns post assertions of methodName. + + <@li><@TT>ClassName info instpre methodName: + Returns pre assertions of methodName. + + <@li><@TT>ClassName info instprocs ?pattern?: + Returns all instprocs defined for the class. If pattern + is specified it returns all instprocs that match the pattern. + + <@li><@TT>ClassName info parameter: + Returns parameter list. + + <@li><@TT>ClassName info subclass ?subclassname?: + Returns a list of all subclasses of the class, if subclassname + was not specified, otherwise it returns 1 if subclassname is a + subclass and 0 if not. + + <@li><@TT> ClassName info superclass ?superclassname?: + Returns a list of all super-classes of the class, + if superclassname was not specified, otherwise it returns + 1 if superclassname is a superclass and 0 if not. + <@/ul> + } + return "Value of introspected option as a string." +} + +@ Class instproc instdestroy { + obj "obj/class name" + ?args? "arguments passed to the destructor" +} { + Description { + Standard destructor. Destroys XOTcl object physically from the memory. + Can be overloaded for customized destruction process. + <@p> + In XOTcl objects are not directly destroyed, when a destroy is + encountered in a method. Beforehand, the interpreter looks up whether + the object is still referenced on the method callstack or not. If not, + the object is directly destroyed. Otherwise every occurrence of the + object on the callstack is marked as destroyed. During popping of the + callstack, for each object marked as destroyed, the reference count is + decremented by one. When no more references to the object are on the + callstack the object is physically destroyed. This way we can assure + that objects are not accessed with [self] in running methods after + they are physically destroyed. + } + return "empty string" +} + +@ Class instproc instfilter { + ?args? "instfilter specification" +} { + Description { + If <@tt>$args is one argument, it specifies a list of + instfilters to + be set. Every filter must be an XOTcl proc/instproc within + the object scope. + If <@tt>$args it has more argument, the first one specifies the + action. Possible values are <@tt>assign, <@tt>get, + <@tt>add or <@tt>delete, it modifies the current + settings as indicated. For more details, check the + tutorial. + } + return "if <@tt>$args return empty current instfilters, otherwise empty" +} + + + +@ Class instproc instfilterguard { + filterName "filter name of a registered filter" + guard "set of conditions to execute the filter" +} { + description { + Add conditions to guard a filter registration point. The filter + is only executed, if the guards are true. Otherwise we ignore the + filter. If no guards are given, we always execute the filter. + } + return "empty string" +} + + +@ Class instproc instforward { + methodName "name of forwarder method" + ?options? "-objscope, -methodprefix string, -default names, -earlybinding, -verbose" + ?callee? "named of the called command or object" + ?args? "arguments" + +} { + Description { + Register a method for the instances of a class (similar to an instproc) + for forwarding calls to a callee (target Tcl command, + other object). + When the forwarder method is called, the actual arguments + of the invocation are appended to the specified arguments. In callee an + arguments certain substitutions can take place: +
  • %proc: substituted by name of the forwarder method
  • +
  • %self: substitute by name of the object
  • +
  • %1: substitute by first argument of the invocation
  • +
  • {%@POS value}: substitute the specified value in the argument list + on position POS, where POS can be a positive or negative integer + or end. Positive integers specify the position from the begin + of the list, while negative integer specify the position from the end. +
  • {%argclindex LIST}: take the nth argument of the specified list as + substitution value, where n is the number of arguments from the + invocation. +
  • %%: a single percent.
  • +
  • %Tcl-command: command to be executed; substituted by result.
  • +
+ Additionally each argument can be prefixed by the positional prefix %@POS + (note the delimiting space at the end) that can be used to specify an + explicit position. POS can be a positive or negative integer or the word + end. The positional arguments are evaluated from left to + right and should be used in ascending order. valid Options are: +
  • -objscope causes the target to be evaluated in the scope + of the object,
  • +
  • -methodprefix string inserts the specified prefix + in front of the second argument of the invocation,
  • +
  • -default is used for default method names (only + in connection with %1)
  • +
  • -earlybinding: look up the function + pointer of the called Tcl command at + definition time of the forwarder instead of invocation time. + This option should only be used + for calling C-implemented Tcl commands, no procs etc.);
  • +
  • -verbose
  • : print the substituted command to stderr + before executing +
+ See tutorial + for detailed examples. + + } + return "empty" +} + + +@ Class instproc instinvar { + invariantList "Body of invariants for the class" +} { + Description { + Specify invariants for the class. These are inherited by + sub-classes. The invariants must hold for all instances. + All assertions are a list of ordinary Tcl conditions. + } + return "empty string" +} + +@ Class instproc instmixin { + ?args? "instmixin specification" +} { + Description { + If <@tt>$args is one argument, it specifies a list of instmixins to + be set. Every instmixin must be a defined class. + If <@tt>$args has more argument, the first one specifies the + action. Possible values are <@tt>assign, <@tt>get, + <@tt>add or <@tt>delete, it modifies the current + settings as indicated. For more details, check the + tutorial. + } + return "if <@tt>$args empty return current instmixins, otherwise empty" +} + + +@ Class instproc instparametercmd { + name "variable to be provided with getter/setter method" +} { + description { + Add a getter/setter command for an instance variable with the + specified name. This method is used for example by the + <@A href="#Class-parameter">parameter method. + Example: <@br> + <@pre class='code'> + Class C + C instparametercmd x + C c1 -x 100 + puts [c1 x] + } + return "empty string" +} + +@ Class instproc instproc { + name "instance method name" + ?non-pos-args?" "optional non-positional arguments" + args "instance method arguments" + body "instance method body" + "?preAssertion?" "optional assertions that must hold before the proc executes" + "?postAssertion?" "optional assertions that must hold after the proc executes" +} { + Description { + Specify an instance method in the same style as Tcl specifies procs. + <@br> + Optionally assertions may be given by two additional arguments. + Therefore, to specify only post-assertions an empty pre-assertion list + must be given. All assertions are a list + of ordinary Tcl conditions. + <@br> + When instproc is called with an empty argument list and an empty + body, the specified instproc is deleted. + } + return "empty string" +} + + +@ Class instproc new { + "?-childof obj? ?args?" "args passed to create" +} { + description { + Convenience method to create an autonamed object. E.g.: + <@pre class='code'> + HTTP new + creates ::xotcl::__#0, a subsequent call creates ::xotcl::__#1, ...<@br> + If <@tt>-childof obj is specified, the new object is + created as a child of the specified object. + } + return "new object name" +} + +@ Class instproc parameter { + parameterList "list of parameter definitions" +} { + description { + Specify parameters automatically created for each instance. + Parameters denote instance variables which are available on each class instance + and that have a getter/setter method with their own name. + Parameters are specified in a parameter list of the form + {p1 p2 ... pn}. + p1 ... pn may either be parameter names or definitions of the form + {parameterName defaultValue}. + If a default value is given, that parameter + is created during creation process of the instance object, otherwise + only the getter/setter method is created (and the parameter does not + exist). The getter/setter method has the same name as the + parameter. It gets and returns the parameter, if no + argument is specified. With one argument, the parameter is set + to the argument value. + <@br> + Example: + <@pre class='code'> + Class Car -parameter {{doors 4} color} + Car herby -doors 2 -color green <@/pre> + } + return "empty string" +} +@ Class instproc parameterclass { + class "parameter class name" +} { + description { + Set the parameter class. + The parameter class specifies how parameters are stored and + maintained internally. Per default, a method "default" is called, + to set the parameter with a default value. I.e., + <@pre class='code'> + Class Car -parameter { + {doors 4} + }<@/pre> + + is a short form for + <@pre class='code'> + Class Car -parameter { + {doors -default 4} + }<@/pre> + + For specialized parameter classes other methods can be called, e.g.<@br> + <@pre class='code'> {doors -default 3 -updateWidget car}<@/pre> + } + return "empty string" +} + +@ Class instproc recreate { + obj "obj to be recreated" + ?args? "arbitrary arguments" +} { + description { + Hook called upon recreation of an object. Performs standard object + initialization, per default. May be overloaded/-written. It calls + another method cleanup which handles actual cleanup of the object + during next. That means, if you overload recreate, in the pre-part + the object still contains its old state, after next it is cleaned up. + } + return "obj name" +} + +@ Class instproc superclass { + classList "?list of classes?" +} { + description { + Specify super-classes for a class. "superclass" changes the list + of superclasses dynamically to <@tt>classList. + The method returns the current value of superclass, + when it is called without arguments. + } + return "if <@tt>classList is not specified return superclass(es), otherwise empty" +} + +@ Class instproc unknown { + ?args? "arbitrary arguments" +} { + description { + Standard unknown mechanism. This mechanism is always triggered when + XOTcl does not know a method called on an object. Supposed that + there is no method with the called name, XOTcl looks up the method + "unknown" (which is found on the Class Object) and executes it. + The standard unknown-mechanism of XOTcl calls create with all + arguments stepping one step to the right; in the general case: + <@pre class='code'> + ClassName create ClassName ?args?<@/pre> + + Unknown can be overloaded in user-defined subclasses of class. + } + return "Standard unknown mechanism returns result of create" +} + +@ Object instproc volatile { + "" "" +} { + description { + This method is used to specify that the object + should be deleted automatically, when the current + Tcl-proc/object-proc/instproc is left. Example: + <@pre class='code'> set x [Object new -volatile] + } + return "empty string" +} + +@ Class proc __unknown { + "name" "name of class to be created" +} { + description { + This method is called, whenever XOTcl references a class, + which is not defined yet. In the following example: + <@tt>Class C -superclass D + D is not defined. Therefore <@tt>Class __unknown D + is called. This callback can be used to perform auto-loading + of classes. After this call, XOTcl tries again to + resolve D. If it succeeds, XOTcl will continue; otherwise, + an error is generated. + <@p> + This method is called on mixin/instmixin definition calls, + istype, ismixin, class, superclass and parameterclass + } + return "empty string" +} + +@ Class ::xotcl::Slot -superclass Object { + description { + A slot is a meta-object that manages property-changes of + objects. A property is either an attribute or a role of an + relation (e.g. in system slots). + The predefined system slots are class, + superclass, mixin, instmixin, + filter, instfilter. These slots appear + as methods of Object or Class. + +

The slots provide a common query and setting interface. + Every multivalued slot provides e.g. a method add + to add a value to the list of values, and a method delete + which removes it. See for example the documentation of the slot + mixin.

+ + Parameters:

+ + + + + + + +
-name Name of the slot to access from an object the slot
-domain domain (object or class) of a slot on which it can be used
-multivalued boolean value for specifying single or multiple values (lists)
-defaultmethods list of two elements for specifying which methods are called + per default, when no slot method is explicitly specified
-manager the manager object of the slot (per default [self])
-per-object specify whether a slot should be used per class or per object; note that there is a restricted usage if applied per class, since defaults etc, work per initialization
+ +

For more details, consult the + tutorial.

+ } +} +@ Class Attribute -superclass ::xotcl::Slot { + description { + Attribute slots are used to manage the setting and querying + of instance variables. + + Parameters:

+ + + + + + +
-default specify a default value
-type specify the type of a slot
-initcmd specify a Tcl command to be executed when the value of the + associated variable is read the first time; allows lazy initialization
-valuecmd specify a Tcl command to be executed whenever the variable is read
-valuechangedcmd specify a Tcl command to be executed whenever the variable is changed
+ +

Example of a class definition with three attribute slots:

+
+  <@tt>Class Person -slots {
+    Attribute name
+    Attribute salary -default 0
+    Attribute projects -default {} -multivalued true
+  }
+  Person p1 -name "John Doe"
+
+
+   

The slot parameters default, initcmd and + valuecmd have to be used mutually exclusively. + For more details, consult the + tutorial. +

+ } +} + + + + +#Class::Parameter instproc values {param args} + +#proc xotcl_mkindex +#proc xotcl_load Index: doc/link-checker-xotcl.html =================================================================== diff -u -N --- doc/link-checker-xotcl.html (revision 0) +++ doc/link-checker-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,71 @@ + + + + + XOTcl - Documentation -- ./apps/comm/link-checker.xotcl + + + +

+ ./apps/comm/link-checker.xotcl + ./apps/comm/link-checker.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+ Package required: xotcl::comm::httpAccess +
+ Package required: xotcl::trace +
+
+ Filename: + + ./apps/comm/link-checker.xotcl + +
+
+ + + + + +
+ Description: + + + A simple link checking program that checks in parallel + pages of a site. +

+ Options:

+ + + + + + +
-url Start-URL
-foreign 0 or 1, specifies, whether foreign links of + local pages should be checked (default 1)
-local A string match pattern to decide + which url should be treated as local + e.g. -local *wu-wien.ac.at/* + Per default the locality filter ist set + to the name of the host followed by '/*'
-restrict 0 or 1, sets the locality filter to the subtree + implied by the URL
-verbose 0 or 1 or 2, verbosity level (default 0)
+ +

+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/logo-100.jpg =================================================================== diff -u -N Binary files differ Index: doc/make-xotcl.html =================================================================== diff -u -N --- doc/make-xotcl.html (revision 0) +++ doc/make-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + + + + + XOTcl - Documentation -- ./library/lib/make.xotcl + + + +

+ ./library/lib/make.xotcl + ./library/lib/make.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+
+ Filename: + + ./library/lib/make.xotcl + +
+
+ +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/makeDoc-xotcl.html =================================================================== diff -u -N --- doc/makeDoc-xotcl.html (revision 0) +++ doc/makeDoc-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,57 @@ + + + + + XOTcl - Documentation -- ./library/lib/makeDoc.xotcl + + + +

+ ./library/lib/makeDoc.xotcl + ./library/lib/makeDoc.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+ Package required: xotcl::package +
+ Package required: xotcl::xodoc +
+
+ Filename: + + ./library/lib/makeDoc.xotcl + +
+
+ + + + + +
+ Description: + + + Documentation tool for the XOTcl distribution.
+ Usage: 'makeDoc docdir filename ?filename ...?'
+ Called by Makefile. + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/metadataAnalyzer-xotcl.html =================================================================== diff -u -N --- doc/metadataAnalyzer-xotcl.html (revision 0) +++ doc/metadataAnalyzer-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,599 @@ + + + + + XOTcl - Documentation -- ./library/lib/metadataAnalyzer.xotcl + + + +

+ ./library/lib/metadataAnalyzer.xotcl + ./library/lib/metadataAnalyzer.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::metadataAnalyzer 0.84 +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./library/lib/metadataAnalyzer.xotcl + +
+
+ + + + + +
+ Description: + + + XOTcl file analyzer for @ metadata. E.g.\ used for + doumentation with xoDoc (but in the static variant + StaticMetadataAnalyzer which uses the dynamic + variant in this file). +

+ Sample sample usage: +

+    package require xotcl::metadataAnalyzer
+
+    # instantiate metadata analyzer object
+    MetadataAnalyzer @::m
+    # make this object be known to @ and turn @ metadata processing on
+    @ analyzerObj @::m
+    @ onOff 1
+
+    # read in some metadata tags (in sample file) & execute the file
+    source lib/testx.xotcl
+
+    # turn @ metadata processing off again
+    @ onOff 0
+
+    # print out all collected metadata
+    puts [@::m print]
+    
+ +
+
+
+

+ + + +

Object: @

+ Class: AnalyzerCmd +
+ + + + + + + +
+ Description: + + Recreate @ with metadata analyis funtionality. +
+

+
+

+ + + +

Class: AnalyzerCmd

+ Class: Class +
+ + + + + + + +
+ Description: + + Class that overload the unknown mechanism of @ to provide metadata analysis. +
+

+
+

+ + + +

Class: ClassToken

+ Class: Class +
+ Heritage: ObjToken +
+ + + + + + + +
+ Description: + + + Token for Class metadata. Contains additional parameters: + "instprocList" = list of all instproc token. + +
+

+
+

+ + + +

Class: ConstraintToken

+ Class: Class +
+ Heritage: MetadataToken +
+ + + + + + + +
+ Description: + + + Token for @Constraint Metadata. + +
+

+
+

+ + + +

Class: FileToken

+ Class: Class +
+ Heritage: MetadataToken +
+ + + + + + + +
+ Description: + + + Token for @File Metadata. + +
+

+
+

+ + + +

Class: InstprocToken

+ Class: Class +
+ Heritage: MethodToken +
+ + + + + + + +
+ Description: + + + Token for Instproc metadata. + +
+

+
+

+ + + +

Class: MetaClassToken

+ Class: Class +
+ Heritage: ClassToken +
+ + + + + + + +
+ Description: + + + Token for Meta-Class metadata. + +
+

+
+

+ + + +

Class: MetadataAnalyzer

+ Class: Class +
+ Procs/Instprocs: + print. + + + + + +
+ Description: + + Handler class for building a metadata runtime structure +
+

Instprocs

+
    +
  • + + + + print + + + + + + +
    + Description: + + Print all collected token information to stdout. + This method is also an exmaple how the tokens can be used. +
    +
  • +
+

+
+

+ + + +

Class: MetadataToken

+ Class: Class +
+ Procs/Instprocs: + print, printProperties, sortTokenList. + + + + + +
+ Description: + + + Each collected metadata element is stored in a token object. + MetadataToken is superclass of token object classes. Each metadata token + has two interesting parameters: +

+ "properties" contains list of all described metadata properties. E.g. can + be printed with +

+    foreach p [my set properties] { 
+      if {[my exists $p]} {
+        append c "    $p=[my set $p]\n"
+      }
+    }
+    
+ "name" contains the method, object, ... name of the metadata element. +

+ All metadata token are aggregated by @. Therefore, +

+    foreach mdt [@ info children] { 
+      if {[$mdt istype MetadataToken]} {$mdt print}
+    }
+    
+ prints all token. + + +
+

Instprocs

+
    +
  • + + + + printProperties + + + + + + +
    + Description: + + Print metadata properties to stdout. +
    +
  • +
  • + + + + abstract + print + + + + + + +
    + Description: + + + Abstract method for printing a token to stdout. + +
    +
  • +
+

Procs

+
    +
  • + + + + sortTokenList + l + + + + + + + + + + +
    + Arguments: + + l: token list +
    + Description: + + Sort a token list with names. Since names are autonames, + this means order of appearance in the program. +
    +
  • +
+

+
+

+ + + +

Class: MethodToken

+ Class: Class +
+ Heritage: MetadataToken +
+ + + + + + + +
+ Description: + + + Token for Method metadata. Contains additional parameters: + "arguments" of the method, "returnValue" of the method, + "obj" name, "abstract" = 0 or 1 (whether its an abstract method or not). + +
+

+
+

+ + + +

Class: ObjToken

+ Class: Class +
+ Heritage: MetadataToken +
+ + + + + + + +
+ Description: + + + Token for Object metadata. Contains additional parameters: + "procList" = list of all proc token and "cl"= class name. + +
+

+
+

+ + + +

Class: PackageToken

+ Class: Class +
+ Heritage: MetadataToken +
+ + + + + + + +
+ Description: + + + Token for Package metadata. Contains additional parameters: + "version" of the package and "type"= either "require" or "provide". + + +
+

+
+

+ + + +

Class: ProcToken

+ Class: Class +
+ Heritage: MethodToken +
+ + + + + + + +
+ Description: + + + Token for Proc metadata + +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/mixinStrategy-xotcl.html =================================================================== diff -u -N --- doc/mixinStrategy-xotcl.html (revision 0) +++ doc/mixinStrategy-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,245 @@ + + + + + XOTcl - Documentation -- ./library/lib/mixinStrategy.xotcl + + + +

+ ./library/lib/mixinStrategy.xotcl + ./library/lib/mixinStrategy.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::mixinStrategy 0.8 +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./library/lib/mixinStrategy.xotcl + +
+
+ + + + + +
+ Description: + + + These methods provide support for managing "strategies", i.e. + mixin-classes, where only one kind of a family of conformant + mixins should be registered. +

+ Naming convertions for strategies: + All strategies must follow the naming convention 'kind=implementation'. + Examples are the persistency strategy 'eager' specfied as + 'persistent=eager' or the persistency strategy 'lazy' (specified as + 'persistent=lazy') + +

+
+
+

+ + + +

Class: Object

+ Procs/Instprocs: + add, mixinQueryStrategy, mixinStrategy, remove. + +
+

Instprocs

+
    +
  • + + + + mixinStrategy + strategy + + + + + + + + + + + + + + +
    + Arguments: + + strategy: Strategy to be added +
    + Description: + + + This method adds or replaces a new strategy from the mixin + list. Strategies are named following the converntion mentioned + above. + +
    + Return: + + old strategy +
    +
  • +
  • + + + + mixinQueryStrategy + kind + + + + + + + + + + + + + + +
    + Arguments: + + kind: strategy kind +
    + Description: + + + This method searches the mixin list for a mixin of this + kind (starting with $kind=) + +
    + Return: + + returns the maching strategy +
    +
  • +
  • + + + + add + construct + args + + + + + + + + + + + + + + + + + + +
    + Arguments: + + construct: (inst) 'filter' or 'mixin' +
    + + + args: to be added +
    + Description: + + add the specified (inst) 'filters' or 'mixins' +
    + Return: + + empty +
    +
  • +
  • + + + + remove + construct + args + + + + + + + + + + + + + + + + + + +
    + Arguments: + + construct: (inst) 'filter' or 'mixin' +
    + + + args: to be removed +
    + Description: + + remove the specified (inst) 'filters' or 'mixins' +
    + Return: + + empty +
    +
  • +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/next-path-mixin-movement.gif =================================================================== diff -u -N Binary files differ Index: doc/next-path.gif =================================================================== diff -u -N Binary files differ Index: doc/obj_class_system.gif =================================================================== diff -u -N Binary files differ Index: doc/observer-xotcl.html =================================================================== diff -u -N --- doc/observer-xotcl.html (revision 0) +++ doc/observer-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,53 @@ + + + + + XOTcl - Documentation -- ./apps/scripts/observer.xotcl + + + +

+ ./apps/scripts/observer.xotcl + ./apps/scripts/observer.xotcl

+
+

+

Package/File Information

+ No package provided/required +
+
+ Filename: + + ./apps/scripts/observer.xotcl + +
+
+ + + + + +
+ Description: + + + Simple observer pattern meta-class taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/openacs-4/readme.txt =================================================================== diff -u -N --- doc/openacs-4/readme.txt (revision 0) +++ doc/openacs-4/readme.txt (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,51 @@ +This is the OpenACS Community System. + +OpenACS (Open ArsDigita Community System) is an advanced toolkit for +building scalable, community-oriented web applications. + +The original ACS, which formed the foundation of OpenACS is described +in http://photo.net/wtr/thebook/community.html + +The original ACS was Copyright (C) 1995-2000 ArsDigita Corporation +and, in some cases, individual authors. + +OpenACS is a community created and supported software system, visit +http://openacs.org for more information. + +The major change in OpenACS 4.x is its database-independence; it can +use either PostgreSQL (7.1 or later) or Oracle (8.1.6 or later). + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +-------------- + +Documentation for this system is at viewable via your favorite browser +at http://openacs.org/doc + +For installation instructions, please see +http://openacs.org/4/ + +Once your service is up and running, this same documenation is +available at + +http://yourservicename/www/doc/ + +The release notes for this release are available at +packages/acs-core-docs/www/release-notes/. + +This is an early development version of OpenACS 4.x. Production use +is NOT recommended. Please report bugs via http://openacs.org/sdm + + Index: doc/package-xotcl.html =================================================================== diff -u -N --- doc/package-xotcl.html (revision 0) +++ doc/package-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,150 @@ + + + + + XOTcl - Documentation -- ./library/lib/package.xotcl + + + +

+ ./library/lib/package.xotcl + ./library/lib/package.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::package 0.91 +
+ Package required: xotcl::mixinStrategy +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./library/lib/package.xotcl + +
+
+ + + + + +
+ Description: + + + Represent Tcl package loading command by an XOTcl + object. Enables tracking, tracing, and verbose output + of package loading + +
+
+
+

+ + + +

Object: package

+ Class: Object +
+ Procs + present, verbose. + + + + + +
+ Description: + + + Supports all Tcl package options plus present and verbose. + +
+

Procs

+
    +
  • + + + + present + args + + + + + + + + + + +
    + Arguments: + + args: packageName or -exact packageName +
    + Description: + + + Check whether a package is present or not. Similar to Tcl's + package present, but works with Tcl < 8.3 + +
    +
  • +
  • + + + + verbose + v + + + + + + + + + + +
    + Arguments: + + v: 1 or 0 +
    + Description: + + + Toggle verbose output on/off. If on, package prints the locations + from where packages are loaded to the screen. Default is off. + +
    +
  • +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/parameter-xotcl.html =================================================================== diff -u -N --- doc/parameter-xotcl.html (revision 0) +++ doc/parameter-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + + + + + XOTcl - Documentation -- ./apps/scripts/parameter.xotcl + + + +

+ ./apps/scripts/parameter.xotcl + ./apps/scripts/parameter.xotcl

+
+

+

Package/File Information

+ No package provided/required +
+
+ Filename: + + ./apps/scripts/parameter.xotcl + +
+
+ +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/persistenceExample-xotcl.html =================================================================== diff -u -N --- doc/persistenceExample-xotcl.html (revision 0) +++ doc/persistenceExample-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + + + + + XOTcl - Documentation -- ./library/store/persistenceExample.xotcl + + + +

+ ./library/store/persistenceExample.xotcl + ./library/store/persistenceExample.xotcl

+
+

+

Package/File Information

+ Package required: xotcl::store::persistence +
+
+ Filename: + + ./library/store/persistenceExample.xotcl + +
+
+ +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/pinger-xotcl.html =================================================================== diff -u -N --- doc/pinger-xotcl.html (revision 0) +++ doc/pinger-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,54 @@ + + + + + XOTcl - Documentation -- ./apps/scripts/pinger.xotcl + + + +

+ ./apps/scripts/pinger.xotcl + ./apps/scripts/pinger.xotcl

+
+

+

Package/File Information

+ No package provided/required +
+
+ Filename: + + ./apps/scripts/pinger.xotcl + +
+
+ + + + + +
+ Description: + + + Pinger example for the observer pattern taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + It demonstrates how to observe a network connection. + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/pkgIndex.tcl =================================================================== diff -u -N --- doc/pkgIndex.tcl (revision 0) +++ doc/pkgIndex.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,11 @@ +# Tcl package index file, version 1.1 +# This file is generated by the "pkg_mkIndex -direct" command +# and sourced either when an application starts up or +# by a "package unknown" script. It invokes the +# "package ifneeded" command to set up package-related +# information so that packages will be loaded automatically +# in response to "package require" commands. When this +# script is sourced, the variable $dir must contain the +# full path name of this file's directory. + +package ifneeded XOTcl-langRef 1.0 [list source [file join $dir langRef.xotcl]] Index: doc/secure-webclient-xotcl.html =================================================================== diff -u -N --- doc/secure-webclient-xotcl.html (revision 0) +++ doc/secure-webclient-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,58 @@ + + + + + XOTcl - Documentation -- ./apps/comm/secure-webclient.xotcl + + + +

+ ./apps/comm/secure-webclient.xotcl + ./apps/comm/secure-webclient.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+ Package required: xotcl::comm::httpAccess +
+ Package required: xotcl::comm::ftp +
+ Package required: xotcl::trace +
+
+ Filename: + + ./apps/comm/secure-webclient.xotcl + +
+
+ + + + + +
+ Description: + + + A sample secure web client that queries an secure web-server. + It needs to be adopted with different https URLs for testing... + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/secure-webserver-xotcl.html =================================================================== diff -u -N --- doc/secure-webserver-xotcl.html (revision 0) +++ doc/secure-webserver-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,60 @@ + + + + + XOTcl - Documentation -- ./apps/comm/secure-webserver.xotcl + + + +

+ ./apps/comm/secure-webserver.xotcl + ./apps/comm/secure-webserver.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+ Package required: xotcl::trace +
+ Package required: xotcl::comm::httpd +
+
+ Filename: + + ./apps/comm/secure-webserver.xotcl + +
+
+ + + + + +
+ Description: + + + This small secure web server that provides its documents + via SSL (https, port 8443) and plain http (port 8086). +
+ This file requires TLS. If you experice problems with + versions obtained from the Web, contact gustaf.neumann@wu-wien.ac.at + for a patch. + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/simpleFilters-xotcl.html =================================================================== diff -u -N --- doc/simpleFilters-xotcl.html (revision 0) +++ doc/simpleFilters-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,54 @@ + + + + + XOTcl - Documentation -- ./apps/scripts/simpleFilters.xotcl + + + +

+ ./apps/scripts/simpleFilters.xotcl + ./apps/scripts/simpleFilters.xotcl

+
+

+

Package/File Information

+ No package provided/required +
+
+ Filename: + + ./apps/scripts/simpleFilters.xotcl + +
+
+ + + + + +
+ Description: + + + Some simple examples of (inst)filters taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. They demonstrate filters, + filter chains and filter inheritance. + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/soccerClub-xotcl.html =================================================================== diff -u -N --- doc/soccerClub-xotcl.html (revision 0) +++ doc/soccerClub-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,53 @@ + + + + + XOTcl - Documentation -- ./apps/scripts/soccerClub.xotcl + + + +

+ ./apps/scripts/soccerClub.xotcl + ./apps/scripts/soccerClub.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+
+ Filename: + + ./apps/scripts/soccerClub.xotcl + +
+
+ + + + + +
+ Description: + + + This is a simple introductory example for the language XOTcl. + It demonstrates the basic language constructs on the example of + a soccer club. + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/speedtest-xotcl.html =================================================================== diff -u -N --- doc/speedtest-xotcl.html (revision 0) +++ doc/speedtest-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,54 @@ + + + + + XOTcl - Documentation -- ./tests/speedtest.xotcl + + + +

+ ./tests/speedtest.xotcl + ./tests/speedtest.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+ Package required: xotcl::test +
+
+ Filename: + + ./tests/speedtest.xotcl + +
+
+ + + + + +
+ Description: + + + Regression and speed test for various ways to achieve a similar + behaviour. + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/staticMetadata-xotcl.html =================================================================== diff -u -N --- doc/staticMetadata-xotcl.html (revision 0) +++ doc/staticMetadata-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,121 @@ + + + + + XOTcl - Documentation -- ./library/lib/staticMetadata.xotcl + + + +

+ ./library/lib/staticMetadata.xotcl + ./library/lib/staticMetadata.xotcl

+
+

+

Package/File Information

+ Package required: xotcl::metadataAnalyzer +
+ Package provided: xotcl::staticMetadataAnalyzer 0.84 +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./library/lib/staticMetadata.xotcl + +
+
+ + + + + +
+ Description: + + + XOTcl file static analyzer for @ metadata. E.g. used for + doumentation with xoDoc. I.e. allows for reading in a + file and evaluating the metadata-related info only. + +
+
+
+

+ + + +

Class: StaticMetadataAnalyzer

+ Class: Class +
+ Heritage: MetadataAnalyzer +
+ Procs/Instprocs: + analyzeFile. + + + + + +
+ Description: + + + Metadata analyzer class that allows for reading in files + and evaluation of the metadata content in the file. + +
+

Instprocs

+
    +
  • + + + + analyzeFile + name + + + + + + + + + + +
    + Arguments: + + name: File name +
    + Description: + + Analyze a file and build up a token structure for each metadata token in the file. +
    +
  • +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/test-xotcl.html =================================================================== diff -u -N --- doc/test-xotcl.html (revision 0) +++ doc/test-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,94 @@ + + + + + XOTcl - Documentation -- ./library/lib/test.xotcl + + + +

+ ./library/lib/test.xotcl + ./library/lib/test.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::test 1.03 +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./library/lib/test.xotcl + +
+
+ + + + + +
+ Description: + + + Simple regression test support. + +
+
+
+

+ + + +

Class: Test

+ Class: Class +
+ + + + + + + +
+ Description: + + + Class Test is used to configure test instances, which can + be configured by the following parameters: +
    +
  • cmd: the command to be executed
  • +
  • expected: the expected result
  • +
  • count: number of executions of cmd
  • +
  • pre: a command to be executed at the begin of the test (before cmd)
  • +
  • post: a command to be executed after the test (after all cmds)
  • +
+ The defined tests can be executed by Test run + +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/testo-xotcl.html =================================================================== diff -u -N --- doc/testo-xotcl.html (revision 0) +++ doc/testo-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,108 @@ + + + + + XOTcl - Documentation -- ./tests/testo.xotcl + + + +

+ ./tests/testo.xotcl + ./tests/testo.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./tests/testo.xotcl + +
+
+ + + + + +
+ Description: + + + This is a class which provides regression test objects + for the OTcl derived features of the XOTcl - Language. + This script is based upon the test.tcl script of the OTcl distribution + and adopted for XOTcl. + +
+
+
+

+ + + +

Class: TestClass

+ Class: Class +
+ + + + + + + +
+ Description: + + + A meta-class for test objects. + +
+

+
+

+ + + +

Class: TestSuite

+ Class: Class +
+ + + +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/testx-xotcl.html =================================================================== diff -u -N --- doc/testx-xotcl.html (revision 0) +++ doc/testx-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,692 @@ + + + + + XOTcl - Documentation -- ./tests/testx.xotcl + + + +

+ ./tests/testx.xotcl + ./tests/testx.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./tests/testx.xotcl + +
+
+ + + + + +
+ Description: + + + This is a file which provides a regression test + for the features of the XOTcl - Language. + +
+
+
+

+ + + +

Class: TestX

+ Class: Class +
+ + + +
+

+
+

+ + + +

Object: assertions

+ Class: TestX +
+ + + + + + + +
+ Description: + + Regression test object testing the assertions. +
+

+
+

+ + + +

Object: condMixins

+ Class: TestX +
+ + + + + + + +
+ Description: + + + Regression test for conditional mixins + +
+

+
+

+ + + +

Object: copymove

+ Class: TestX +
+ + + + + + + +
+ Description: + + + Regression test for copy/move methods + +
+

+
+

+ + + +

Object: filterAddRemove

+ Class: TestX +
+ + + + + + + +
+ Description: + + Regression test object testing adding/removing of filters. +
+

+
+

+ + + +

Object: filterClassChange

+ Class: TestX +
+ + + + + + + +
+ Description: + + Regression test object testing class changes of filters. +
+

+
+

+ + + +

Object: filterGuards

+ Class: TestX +
+ + + + + + + +
+ Description: + + Regression test object testing filter guards. +
+

+
+

+ + + +

Object: filterInfo

+ Class: TestX +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ Description{: + + Regression +
+ Test: + + object +
+ Testing: + + introspection +
+ Of: + + filters. +
+ }: + + +
+

+
+

+ + + +

Object: filterSimpleObserver

+ Class: TestX +
+ + + + + + + +
+ Description: + + Regression test object testing a simple observer using filters. +
+

+
+

+ + + +

Object: init_params

+ Class: TestX +
+ + + + + + + +
+ Description: + + + Regression test object testing the parameter instance method, + the init dash '-' and constructor calling. + +
+

+
+

+ + + +

Object: mixinGuards

+ Class: TestX +
+ + + + + + + +
+ Description: + + Regression test object testing mixin guards. +
+

+
+

+ + + +

Object: mixinInheritanceTest

+ Class: TestX +
+ + + + + + + +
+ Description: + + + Regression test object testing per-object mixin inheritance. + +
+

+
+

+ + + +

Object: mixinTest

+ Class: TestX +
+ + + + + + + +
+ Description: + + + Regression test object testing per-object mixins. + +
+

+
+

+ + + +

Object: nestingClasses

+ Class: TestX +
+ + + + + + + +
+ Description: + + Regression test object testing the class nesting feature. +
+

+
+

+ + + +

Object: nestingObjects

+ Class: TestX +
+ + + + + + + +
+ Description: + + Regression test object testing the object nesting feature. +
+

+
+

+ + + +

Object: nextTest

+ Class: TestX +
+ + + + + + + +
+ Description: + + + Regression test object testing the next primitive. + +
+

+
+

+ + + +

Object: objectReferences

+ Class: TestX +
+ + + + + + + +
+ Description: + + + Regression test for object and class references in tcl_objs + +
+

+
+

+ + + +

Object: recreation

+ Class: TestX +
+ + + + + + + +
+ Description: + + + Regression test for object recreation/cleanup. + +
+

+
+

+ + + +

Object: smallScripts

+ Class: TestX +
+ + + + + + + +
+ Description: + + + Regression test object testing arbitrary features. + +
+

+
+

+ + + +

Object: stdargs

+ Class: TestX +
+ + + + + + + +
+ Description: + + + Regression test object testing the ability of the next primitive to pass + arguments without naming them. + +
+

+
+

+ + + +

Object: volatileObjects

+ Class: TestX +
+ + + + + + + +
+ Description: + + + Regression test for volatile objects + +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/trace-xotcl.html =================================================================== diff -u -N --- doc/trace-xotcl.html (revision 0) +++ doc/trace-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,431 @@ + + + + + XOTcl - Documentation -- ./library/lib/trace.xotcl + + + +

+ ./library/lib/trace.xotcl + ./library/lib/trace.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::trace 0.91 +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./library/lib/trace.xotcl + +
+
+ + + + + +
+ Description: + + + Various tracing tools for the XOTcl language. + +
+
+
+

+ + + +

Class: Object

+ Procs/Instprocs: + lintFilter, showCall, showClass, showMsg, showStack, showTimeEnd, showTimeStart, showVars, statFilter, traceFilter. + +
+

Instprocs

+
    +
  • + + + + traceFilter + args + + + + + + + + + + + + + + +
    + Arguments: + + args: arbitrary args +
    + Description: + + + Filter to trace every method call on an object or class hierarchy. + Outputs a message befora and after each call of the traced object. + +
    + Return: + + empty string +
    +
  • +
  • + + + + lintFilter + + + + + + +
    + Description: + + Experimental lint filter +
    +
  • +
  • + + + + statFilter + + + + + + +
    + Description: + + Experimental statistics filter +
    +
  • +
  • + + + + showVars + args + + + + + + + + + + +
    + Arguments: + + args: ist of variables +
    + Description: + + Show the values of the specified variables (or of all variables) + of an object on stderr. +
    +
  • +
  • + + + + showMsg + msg + + + + + + + + + + +
    + Arguments: + + msg: optional output +
    + Description: + + Show a message msg with the form "[self] $cls->$method $msg" on stderr. +
    +
  • +
  • + + + + showClass + + + + + + +
    + Description: + + Show classes and mixins of the object +
    +
  • +
  • + + + + showStack + maxDepth + + + + + + + + + + +
    + Arguments: + + maxDepth: max stack depth, default=100 +
    + Description: + + Show callstack up to the specified calldepth. +
    +
  • +
  • + + + + showCall + + + + + + +
    + Description: + + Show the current call with the form "[self] $cls->$method $args" on stderr. +
    +
  • +
  • + + + + showTimeStart + ?handle? + + + + + + + + + + +
    + Arguments: + + ?handle?: Handle object name, optional +
    + Description: + + start a timer +
    +
  • +
  • + + + + showTimeEnd + ?handle? + + + + + + + + + + +
    + Arguments: + + ?handle?: Handle object name, optional +
    + Description: + + end a timer and show result +
    +
  • +
+

+
+

+ + + +

Object: Trace

+ Class: Object +
+ Procs + closeTraceFile, openTraceFile, puts. + + + + + +
+ Description: + + + Write trace outputs and produce statistics. Variable traceStream + defines where to write trace output (default: stderr). + +
+

Procs

+
    +
  • + + + + puts + line + + + + + + + + + + +
    + Arguments: + + line: output line +
    + Description: + + + Define how traceFilter writes to the output stream. Default: + write to trace stream. + +
    +
  • +
  • + + + + openTraceFile + name + + + + + + + + + + +
    + Arguments: + + name: file name +
    + Description: + + + Redirect trace output to file. + +
    +
  • +
  • + + + + closeTraceFile + name + + + + + + + + + + +
    + Arguments: + + name: file name +
    + Description: + + + Close trace file and redirect output to stderr. + +
    +
  • +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/tutorial.html =================================================================== diff -u -N --- doc/tutorial.html (revision 0) +++ doc/tutorial.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,4782 @@ + + + + + XOTcl - Tutorial + + + + + + + + + + + +
+

XOTcl + - Tutorial - Index +

+
+
+

Version: 1.5.5

+ + + + + + + + + + +
+

Introduction + +

+
+
+ + +

 
Language Overview +

+ +

XOTcl [Neumann and Zdun 2000a] is an extension +to the object-oriented scripting language OTcl [Wetherall and Lindblad 1995] which itself extends +Tcl [Ousterhout 1990] (Tool Command Language) with +object-orientation. XOTcl is a value-added replacement for OTcl and +does not require OTcl to compile.

+ +

XOTcl runs in the tclsh and provides a few extension +commands. These are offered in a Tcl namespace ::xotcl, and +can be imported into the current namespace to reduce typing and +improve readability. All Tcl commands remain available (and are also +applicable on the extension constructs).

+ +

A central property of Tcl is, that it uses strings solely for the +representation of data. Internally it uses an dynamic type system with +automatic conversion (which enables efficient type handling). For +that reason all components (e.g. written in C) once integrated in Tcl +automatically fit together and the components can be reused in +unpredicted situations without change. The evolving component +frameworks provide a high degree of code reuse, rapid +application development, and ease of use. The application developer +may concentrate on the application task solely, rather than investing +efforts in fitting components together. Therefore, in certain +applications scripting languages like Tcl are very useful for a fast +and high-quality development of software (see [Ousterhout 1998] for more details). +

+

Tcl is equipped with appropriate functionalities for the easy +gluing of components, like dynamic typing, dynamic extensibility, and +read/write introspection. OTcl is an object-oriented extension to Tcl, +which encourages a Tcl-like programming style and is composed of +language constructs with properties similar to Tcl. It offers an +object-orientation with encapsulation of data and operation without +protection mechanisms and single and multiple inheritance. +Furthermore it enables to change the relationships dynamically, offers +read/write introspection, has a three level class system based on +meta-classes and offers method chaining. These abilities are +integrated in XOTcl with only slight changes to OTcl visible to the +programmer. +

+

The XOTcl extension aims at complexity and adaptability issues that +may occur in context of large (object-oriented) software structures +and in the context of component glueing. In particular we added the +following support: +

+
    +
  • Filters as a means of + abstractions over method invocations to implement large program + structures, like design patterns. +

    +
  • Mixin Classes, as a + means to give an object or a classes' instances access to several different supplemental + classes, which may be changed dynamically. +

    +
  • Dynamic Object Aggregations, + to provide dynamic aggregations through nested namespaces. +

    +
  • Nested Classes, to reduce + the interference of independently developed program structures. +

    +
  • Assertions, to reduce the + interface and the reliability problems caused by dynamic typing and, + therefore, to ease the combination of components. +

    +
  • Forwarders, to delegate + calls efficiently to other objects or classes. +

    +
  • Slots, to manage values + of instance variables with a common interface. +

    +
  • Meta-data and Automatic Documentation, to enhance self-documentation of objects + and classes. +

    +
+ + + +


+

+

+   +

+

Figure 1: +Language Extensions of XOTcl +

+
+ + + + + +
+

+
+
+ + +

 
Introductory Overview Example: Soccer Club +

+

+To give you an impression of the language before we go into the +details of the language construct, we present in this section a +simple, introductory example. It shall demonstrate the basic +language constructs on the example of a soccer club (the full code can +be found in the xotcl/src/scripts/soccerClub.xotcl file. All +the characters in this example are fictitious, and any resemblance to +actual persons, living or deceased, is coincidental. +

+

+In XOTcl we do not have to provide a file description as a comment, +but we can use the @ object, which is used generally to +provide any kind of information, meta-data, and documentation on a +running program. Here, we just give a file description. Then the +makeDoc.xotcl tool can automatically document the program file for +us. +

+
+  @ @File {
+    description {
+      This is a simple introductory example for the language XOTcl. 
+      It demonstrates the basic language constructs on the example of
+      a soccer club.
+    }
+  }
+
+

+ +All things and entities in XOTcl are objects, a special kind of objects +are classes. These define common properties for other objects. For a +soccer club, we firstly require a common class for all kinds of members. +

+

+Common to all members is that they have a name. Common properties +defined across all instances of a class are called 'parameter' in +XOTcl. In this example the instance variable name will be +initialized by default with an empty string. +

+
+  Class ClubMember -parameter {{name ""}}
+
+

+A special club member is a Player. Derived classes can be +build with inheritance (specified through +superclass). Players may have a playerRole (defaults +to NONE). +

+
+  Class Player -superclass ClubMember -parameter {{playerRole NONE}}
+
+

+Other club member types are trainers, player-trainers, and presidents: +

+
+  Class Trainer -superclass ClubMember
+  Class President -superclass ClubMember
+
+

+The PlayerTrainer uses multiple inheritances by being both a player +and a trainer: +

+
+  Class PlayerTrainer -superclass {Player Trainer}
+
+

+Now we define the SoccerTeam class: +

+
+  Class SoccerTeam -parameter {name location type}
+
+

+We may add a player. This is done by a method. Instance methods are +in XOTcl defined with instproc. All club members are aggregated in +the team (denoted by :: namespace syntax). +

+
+  SoccerTeam instproc newPlayer args {
+    # we create a new player who is part of the soccer team
+    # "eval" is needed to pass the provided arguments to the call of new
+    eval Player new -childof [self] $args
+  }
+
+

+A player can be transfered to another team. The player object does +not change internally (e.g. the playerRole stays the same). Therefore we +move it to the destination team. +

+
+  SoccerTeam instproc transferPlayer {playername destinationTeam} {
+    # We use the aggregation introspection option children in order
+    # to get all club members
+    foreach player [my info children] {
+      # But we only remove matching playernames of type "Player". We do
+      # not want to remove another club member type who has the same
+      # name.
+      if {[$player istype Player] && [$player name] == $playername} {
+        # We simply 'move' the player object to the destination team.
+        # Again we use a unique autoname in the new scope
+        $player move [set destinationTeam]::[$destinationTeam autoname player%02d]
+      }
+    }
+  }
+
+

+Finally we define two convenience to print the members/players to +the stdout with puts. +

+
+  SoccerTeam instproc printMembers {} {
+    puts "Members of [my name]:"
+    foreach m [my info children] {puts "  [$m name]"}
+  }
+  SoccerTeam instproc printPlayers {} {
+    puts "Players of [my name]:"
+    foreach m [my info children] {
+      if {[$m istype Player]} {puts "  [$m name]"}
+    }
+  }
+
+

+Now let us build to example soccer team objects. +

+
+  SoccerTeam chelsea -name "Chelsea FC" -location "Chelsea"
+  SoccerTeam bayernMunich -name "F.C. Bayern M�nchen" -location "Munich"
+
+

+ +With addPlayer we can create new aggregated player objects +

+Let us start some years in the past, when "Franz Beckenbauer" was +still a player. +

+
+  set fb [bayernMunich newPlayer -name "Franz Beckenbauer" \
+    -playerRole PLAYER]
+
+

+playerRole may not take any value. It may either be NONE, PLAYER, +or GOALY ... such rules may be given as assertions (here: an instinvar +gives an invariant covering all instances of a class). In XOTcl +the rules are syntactically identical to if statements: +

+
+  Player instinvar {
+      {[my playerRole] == "NONE" ||  
+       [my playerRole] == "PLAYER" || 
+       [my playerRole] == "GOALY"}
+  }
+
+

+If we break the invariant and turn assertions checking on, we should +get an error message: +

+
+  $fb check all
+  if {[catch {$fb set playerRole SINGER} errMsg]} {
+    puts "CAUGHT EXCEPTION: playerRole has either to be NONE, PLAYER, or TRAINER"
+    # turn assertion checking off again and reset to PLAYER
+    $fb check {}
+    $fb set playerRole PLAYER
+  }
+
+

+But soccer players may play quite different, orthogonal +roles. E.g. Franz Beckenbauer was also a singer (a remarkably bad +one). However, we can not simply add such orthogonal, extrinsic +extensions with multiple inheritance or delegation. Otherwise we +would have either to build a lot of unnecessary helper classes, like +PlayerSinger, PlayerTrainerSinger, etc., or we would have to build +such helper objects. This either leads to an unwanted combinatorial +explosion of class or object number +

+Here we can use a per-object mixin, which is a language construct +that expresses that a class is used as a role or as an extrinsic +extension to an object. +

+First we just define the Singer class. +

+
+  Class Singer
+  Singer instproc sing text {
+    puts "[my name] sings: $text, lala."
+  }
+
+

+Now we register this class as a per-object mixin on the player object: +

+
+  $fb mixin Singer
+
+

+And now Franz Beckenbauer is able to sing: +

+
+  $fb sing "lali"
+
+

+But Franz Beckenbauer has already retired. When a player retires, we +have an intrinsic change of the classification. He *is* not a player +anymore. But still he has the same name, is club member, and +is a singer (brrrrrr). +

+Before we perform the class change, we extend the Player class to +support it. I.e. the playerRole is not valid after class change +anymore (we unset the instance variable). +

+
+  Player instproc class args {
+    my unset playerRole
+    next
+  }
+
+

+Now we can re-class the player object to its new class (now Franz +Beckenbauer is President of Bayern Munich. +

+
+  $fb class President
+  # Check that the playerRole isn't there anymore.
+  if {[catch {$fb set playerRole} errMsg]} {
+    puts "CAUGHT EXCEPTION: The player role doesn't exist anymore \
+         (as it should be after the class change)"
+  }
+
+

+But still Franz Beckenbauer can entertain us with what he believes +is singing: +

+
+  $fb sing "lali"
+
+

+Now we define some new players for Bayern Munich: +

+
+  bayernMunich newPlayer -name "Oliver Kahn" -playerRole GOALY
+  bayernMunich newPlayer -name "Giovanne Elber" -playerRole PLAYER
+
+

+If we enlist the players of Munich Franz Beckenbauer is not enlisted +anymore: +

+
+  bayernMunich printPlayers
+
+

+But as a president he still appears in the list of members: +

+
+  bayernMunich printMembers
+
+

+Now consider an orthonogal extension of a transfer list. Every +transfer in the system should be notified. But since the transfer +list is orthogonal to SoccerTeams we do not want to interfere with +the existing implementation at all. Moreover, the targeted kind of +extension has also to work on all subclasses of SoccerTeam. Firstly, we +just create the extension as an ordinary class: +

+
+  Class TransferObserver
+  TransferObserver instproc transferPlayer {pname destinationTeam} {
+    puts "Player '$pname' is transfered to Team '[$destinationTeam name]'"
+    next
+  }
+
+

+Now we can apply the class as a per-class mixin, which functions +exactly like a per-object mixin, but on all instances of a class and +its subclasses. The next primitive ensures that the original +method on SoccerTeam is called after notifying the transfer (with +puts to stdout): +

+
+  SoccerTeam instmixin TransferObserver
+
+

+If we perform a transfer of one of the players, he is moved to the new +club and the transfer is reported to the stdout: +

+
+  bayernMunich transferPlayer "Giovanne Elber" chelsea
+
+

+Finally we verify the transfer by printing the players: +

+
+  chelsea printPlayers
+  bayernMunich printPlayers
+
+

+ +



+

+ + + + + +
+

Object + and Class System +

+
+
+

In XOTcl every object is associated with a class over the class +relationship. Classes are special objects with the purpose of +managing other objects. ``Managing'' means that a class controls the +creation and destruction of its instances and that it contains a +repository of methods (``instprocs'') accessible for the instances. +Object-specific methods are called ``procs'', instance methods are +called ``instprocs''. +

+

The instance methods common to all objects are defined in the root +class Object (predefined or user-defined). Since a class is a +special (managing) kind of object it is managed itself by a special +class called ``meta-class'' (which manages itself). Meta-Classes are +used to define classes and to provides methods for these. Most +classes are defined by the predefined meta-class Class. One +interesting aspect of meta-classes is that by providing a constructor +pre-configured classes can be derived. Meta-classes can be used to +instantiate large program structures, like some design patterns (see +[Neumann and Zdun 1999a] for more +details), where the meta-class may holds the generic parts of the +structures. Since a meta-class is an entity of the program, it is +possible to collect these entities in pattern libraries for later +reuse easily (more details about meta-classes are given in a later section). +

+

XOTcl supports single and multiple inheritance. Classes are ordered +by the relationship superclass in a directed acyclic +graph. The root of the class hierarchy is the class Object. +A single object can be instantiated directly from this class. An +inherent problem of multiple inheritance is the problem of name +resolution, when for example two super-classes contain an instance +method with the same name. XOTcl provides an intuitive and unambiguous +approach for name resolution by defining the precedence order along a +linear ``next-path'' incorporating the class and mixin +hierarchies, which is modeled after CLOS. A method can invoke +explicitly the shadowed methods by the predefined command +next. When this command is executed a shadowed method is +``mixed into'' the execution of the current method. Method chaining +without explicit naming of the targeted method is very important for +languages supporting a dynamic class system, because one cannot always +predict which classes are currently participating in the inheritance +hierarchy at design time (often necessary in inheritance models, like +C++). +

+

An important feature of all XOTcl +objects is the read/write introspection. The reading introspection +abilities of XOTcl are packed compactly into the info +instance method which is available for objects and classes. All +obtained information can be changed at run-time dynamically with +immediate effect. Unlike languages with a static class concept, XOTcl +supports dynamic class/superclass relationships. At any time the class +graph may be changed entirely using the superclass method, or +an object may change its class through the class method. This +feature can be used for an implementation of a life-cycle or other +intrinsic changes of object properties (in contrast to extrinsic +properties e.g. modeled through roles and implemented through +per-object and per-class mixins [Neumann and +Zdun 1999c] ) . These changes can be achieved without loosing the +object's identity, its inner state, and its per-object behavior (procs +and per-object mixins). +

+

+   +

+

Figure 2: +Object and Class System +

+
+ + + + + +
+

+
+
+ + + + + +
+

Basic + Functionalities +

+
+
+

 
Objects +

+

Initially XOTcl offers two new commands: Object and +Class. They represent hooks to the features of the language. +This section discusses both of them in detail and shows how they +function in the context of XOTcl. Note, that even if most of this is +compatible to OTcl, a few changes occur. For this reason, this +section is no introduction to plain OTcl. The Object command +provides access to the Object class, which holds the common +features of all objects, and allows us to define new objects. Objects +are always instances of classes, therefore, objects defined with the +Object command are (initially) instances of the Object +class. But since they have no user-defined type, they may be referred +to as singular objects. As all other objects they may be +specialized by object-operations and -data. +

+

The object command has the following syntax: +

+
+  Object objName ?args?
+

+A command of this form is a short-cut for a message to the create +instance method (forwarded automatically by the unknown +mechanism, which is invoked every time the message dispatch system +discovers an unknown message): +

+
+  Object create objName ?args?
+

+It creates a new object of type Object with the name objName +(in fact it invokes a create call on the Object class). +objName becomes a new command, which allows us to access the +created object. Similar to the Object command it may be +used like a normal Tcl-command (using sub-commands to access the +object's methods). Therefore, this form of access is called +object-command approach. A simple example is an object which +holds the information of a kitchen. It is created by: +

+
+  Object kitchen
+
+

+An object creation calls the constructor init of the +object's class. The destruction of an object is handled by the +destroy instance method. The general syntax of destroy +is: +

+
+  objName destroy
+

+E.g. the kitchen object is destroyed by: +

+
+  kitchen destroy
+

+To invoke a user-defined destruction process, it is possible to +overload this instance method in every class derived from object. +

+

+Note that the destruction of an object is performed by the +method destroy of Object (since every object is an instance +of Object, every object can call destroy). When an application class +overloads destroy, this method should contain a next in order +to reach the base class and to actually destroy the object. +

+

Data on Objects +

+

The Object class provides a range of operations to manage +objects, including those to manipulate data-structures on the +objects. They are similar to the same-named Tcl-commands: +

+
+  objName set varname ?value?
+  objName unset v1 ?v2 ... vn?
+
+

+The set instance method with given value option +allows us to manipulate an object-variable's value or to create a new +one, if the variable varname does not exist on the object so +far. Without value option the set operation queries +the variable and returns it's value, if the variable exists, +otherwise it produces an error message. The unset operation +deletes one or optionally a set of variables from an object. For +example the kitchen object can store information on the +color of the wall-paper by: +

+
+  kitchen set wallPaperColor white
+

+Similar to Tcl-variables the object variables are dynamical; they +may be set at run-time when they are needed and unset when they +become obsolete. E.g. the persons in the kitchen may be stored in an +array. If there are no persons in the kitchen the array is deleted: +

+
+  # Peter enters the kitchen to cook
+  kitchen set persons(cook) Peter
+  ...
+  # Marion enters the kitchen to take one of the seats
+  kitchen set persons(seat1) Marion 
+  ...
+  # Both Peter and Marion leave the kitchen
+  # the array is deleted by unset
+  kitchen unset persons
+

+Since XOTcl variables are internally realized through Tcl-variables +they may be treated like all Tcl-variables. For that reason they have +all Tcl-variable abilities, including the possibility to handle them +as lists or arrays (as seen in the last example). The array +command of Tcl is mapped to an XOTcl-command directly. An +object-oriented call to an object of the form +

+
+  objName array option arrayName args
+

+forwards its arguments to an array Tcl-command for the +object´s instance variable arrayName. It could be used like +the same-named Tcl-command, e.g. the command +

+
+  kitchen array names persons
+

+returns all indexes currently stored in the persons array. +

+

Similarly Tcl´s incr command is mapped to the +object system. A call with the syntax: +

+
+  objName incr varName ?value?
+

+increments varName with the given value (or without given +value with 1). +

+

Methods for Objects +

+

Methods in XOTcl resemble Tcl-procedures. On objects one can define +object-specific methods, called procs. Instance methods which are +defined on classes are called instprocs. A new proc is defined using +the proc instance method of the class Object: +

+
+  objName proc name args body
+

+The arguments of the proc instance method specify the name, +the arguments as a Tcl-list, and the body of the new proc. All of them +must be given, only one of args and body may be +empty. An example proc would be a method to let persons enter the +kitchen: +

+
+  kitchen proc enter {name} {
+    [self] set persons($name) [clock seconds]
+  }
+

+Here the predefined self command is used in one of three +possible ways, which allow us to access useful information when working +with XOTcl-methods, these are in particular: +

+
    +
  • self: returns the + name of the object, which is currently in execution. This + command is similar to this in C++. It is + automatically generated on each object. If it is called from + outside of an XOTcl method, it produces the error message + "Can't find self". +

    +
  • self class: the self + command with the argument class returns the name of the + class, which holds the currently executing instproc. Note, that this + may be different to the class of the current object. If it is called + from a proc it returns an empty string. +

    +
  • self proc: the self command with the argument + proc returns the name of the currently executing + method (proc or instproc). +

    +
+

The method enter can be written in XOTcl as well with +less syntactic overhead by using the predefined primitive my +instead of [self]:

+
+  kitchen proc enter {name} {
+    my set persons($name) [clock seconds]
+  }
+

+

Note, that there is a difference to the realization of these +object informations to OTcl. XOTcl uses commands in order to make +XOTcl-methods compatible to Tcl-procedures and accessible via +namespace-paths. OTcl uses the three variables self, class +and proc, which are filled automatically with proper values +by the interpreter each time a method is called. To gain backwards +compatibility XOTcl can be compiled with -DAUTOVARS to +provide these variables additionally. By default this option is turned off. +

+

Each XOTcl-method has its own scope for definition of local +variables for the executing method. In most cases when a method uses +object-variables, it is likely that the programmer wants to make one +or more of these variables part of the method's scope. Then the +Tcl-command for variable handling, like set, lindex, +array, ... work also on these variables. The +instvar instance method links a variable to the scope of +an executing method. It has the syntax: +

+
+  objName instvar v1 ?v2 ... vn?
+
+

+It makes the variables v1 ... vn, which must +be variables of the object, part of the current method's scope. A +special syntax is: +

+
+  objName instvar {varName aliasName} ...
+
+

+for one of the variables. This gives the variable with the name +varName the alias aliasName. This way the variables +can be linked to the methods scope, even if a variable with that name +already exists in the scope. Now the enter method can be +adapted slightly and a leave method can be added, which uses +Tcl's info command to check +whether the named person is in the object's persons array. To +demonstrate the alias-syntax this is done with the persons +array and the alias p. +

+
+  kitchen proc enter {name} {
+    my instvar persons
+    set persons($name) [clock seconds]
+  }
+
+  kitchen proc leave {name} {
+    my instvar {persons p}
+    if {[info exists p($name)]} {
+      puts "$name leaves after [expr {[clock seconds]-$p($name)}] seconds" 
+      unset p($name) 
+    } else {
+      puts "$name is not in the room"
+    }
+  }
+
+A method defined via proc can be deleted by proc using +an empty argument list and an empty body. The following example deletes the method +enter: +
+  Room proc enter {} {}
+
+ +

+Information about Objects +

+

XOTcl offers reading and writing +introspection. The reading introspection abilities are packed +compactly into the info instance method which is available +for objects and classes (there are special info options for object +aggregations, nested classes, mixins, filters, meta-data and +assertions, which are explained separately in the following +sections). The info instance method's options, from the view +of an object, are summarized in the following table. They are +identically to the OTcl info options on objects. +

+
+

+ Options for the info method on objects

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ objName info args methodName + +

Returns the arguments of the specified proc (object specific method).

+
+ objName info body methodName + +

Returns the body of the specified proc.

+
objName info class ?className? + +

Returns the name of the class of the current + object, if className was not specified. Otherwise it + returns 1 if className matches the object's class and 0 if + not. +

+
objName info commands ?pattern? + +

Returns all commands defined on the object + if pattern was not specified. Otherwise it + returns all commands that match the pattern.

+
objName info default methodName arg var

+
+

Returns 1 if the argument arg of + the specified proc has a default value, otherwise 0. If + the default value exists it is stored in var.

+
objName info precedence ?pattern? + +

Returns all classes in the precedence order + from which the specified object inherits methods. The + returned list of classes contains the mixin and instmixin + classes as well as the classes of the superclass chain in + linearized order (i.e., duplicate classes are removed). If + the pattern is specified, only matching classes are + returned.

+
objName info vars ?pattern? + +

Returns all variables defined on the object + if pattern was not specified, otherwise it returns + all variables that match the pattern.

+
+ +
+


+

For example on the kitchen object +

+
+  kitchen info procs
+

+returns enter and leave as a Tcl-list since these +are the procs defined on the object. +

+

Classes +

+

Creating Classes and deriving +Instances +

+

There are different ways to create a class in XOTcl. They have in +common that they derive the new class from a meta-class. Initially the +Class command provides access to the meta-class +Class, which holds the features common to all classes. It +also allows one to derive new meta-classes. The common way to create a +new class is: +

+
+  Class className ?args?
+
+ +

+Similar to the object short form, this is a short form of a call to +the create instance method of the meta-class Class, +which is also executed by the standard unknown mechanism. +This mechanism is always triggered when XOTcl does not know a method +called on an object. Supposed that there is no method with the name +className, defined on the class-object of Class, +XOTcl looks up the method unknown (which is found on the +Class Object) and executes it. The standard unknown-mechanism +of XOTcl calls create with all arguments stepping one step +to the right; in the general case: +

+
+  Class create className ?args?
+

+This may also be called directly. Besides the indirection when using +unknown, in most cases there is no difference in the action +performed: Firstly the memory is allocated, using the alloc +instance method; as the next step the constructor init is called +on the creating object, which is in this case the class-object of the +meta-class Class. In seldom cases the programmer may want to +suppress the init call. To do so the alloc instance +method may also be called directly: +

+
+  Class alloc className ?args?
+
+

+As seen in the preceding section objects are created in the same way. +The difference was, that the command Object, which accesses +a class, instead of the command Class, which accesses a +meta-class, was used. The user-defined classes may also be used in +the same way to create new objects: +

+
+  className objName ?args?
+
+

+Resembling the creation of classes this creates an object objName +of type className using the unknown mechanism. That +means the create instance method of the class is called. If +there is no other instance method defined on the class-path so far +(which would mean, an user defined creation process is invoked), the +create instance method of the class Object is +invoked. This method is similar to the create method of the +meta-class Class. It firstly calls the alloc +instance method on its (of the Class class) which allocates +memory for the object, and makes it an instance of it's class. +Afterwards a call to the constructor init is invoked. +

+

Now we can specify the object for the kitchen by the class to +which it belongs. In this case a kitchen is an instance of a room. +

+
+  Class Room
+  Room kitchen
+

+A set call on a class creates an instance variable on the +class-object. This variable is unique for all instances, therefore, +it may be referred to as a class variable. +

+

Methods Defined in Classes +

+

Methods which are defined in classes and which are provided to the +instances of these classes are called "instprocs". +The syntax for defining an instproc is: +

+
+  className instproc procname args body
+
+

+It is similar to the definition of procs on objects, but uses the +keyword instproc to distinguish between the methods defined +on the class-object and those defined on the class. Since all rooms +(in the modeled world) have ceilings, we may want to define a simple +convenience instproc, which is able to set the color: +

+
+  Room instproc setCeilingColor color {
+    my set ceilingColor $color
+  }
+

+A special instproc, the constructor init, was mentioned +already. Now we are able to define such an instproc. Defined on a +class it is responsible for all initialization tasks, which needed to +be performed, when constructing a new instance object of the class. +The constructor of the Room can initialize a variable for +the color, in which the ceiling is painted, to white as default, +since this is the color of ceilings without painting. +

+
+  Room instproc init args {
+    my setCeilingColor white
+    next
+  }
+
+

+After this definition, all instances derived from the Room +class have an instance variable ceilingColor with the value +white. The args argument used here is a special +argument in Tcl which allows us to use a list of arguments which may +change its length from call to call. +

+An instproc can be deleted by the method instproc as well. +If instproc is called with an empty argument list and an +empty body, the specified method is deleted, as the following example shows: +

+  Room instproc setCeilingColor {} {}
+
+ +

+

Information about Classes +

+

Resembling to objects, information on +classes may be gained through the info instance method of the +meta-class Class. Note that this instance method does not +only support the class info options, but also the object info options, +since the accessing command refers to the class-object, which itself +is an object and, therefore, offers its informations. The following +table summarizes the additional info options available on classes. +

+
+

Options for the info method on classes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
className info heritage ?pattern? +

Returns a list of all classes in the + precedence order of the class hierarchy matching + pattern or a list of all classes, if + pattern was not specified.

+
className info instances ?pattern? +

Returns a list of the instances of the + class matching pattern or of all instances, if + pattern was not specified. +

+
className info instargs methodName +

Returns the arguments of the specified instproc + (method provided to objects).

+
className info instbody methodName +

Returns the body of the specified instproc.

+
className info instcommands ?pattern? +

Returns all commands defined on the class, if + pattern was not specified, otherwise it returns all + commands provided to objects that match the pattern.

+
className info instdefault methodName arg var

+
+

Returns 1 if the argument arg of + the specified instproc has a default value, otherwise 0. If + the default value exists it is stored in var.

+
className info subclass ?className2? +

Returns a list of all subclasses of the class, if + className2 was not specified, otherwise it returns 1 if + className2 is a subclass and 0 if not.

+
className info superclass ?className2? +

Returns a list of all super-classes of the class, + if className2 was not specified, otherwise it returns 1 + if className2 is a superclass and 0 if not.

+
+
+


+

Inheritance +

+

Besides encapsulation of operations and state in objects, a second +central ability of object-orientation is inheritance. XOTcl supports +single and multiple inheritance with a directed acyclic class +graph. Automatically each new class created by the instance methods +create and alloc of Class inherits from +Object. Therefore, it is ensured that all instances of the +new class have access to the common features of objects stored in the +class Object. +

+

To specify further inheritance relationships the instance methods +superclass of Class is used: +

+
+  className -superclass classList
+

+E.g. in the example a kitchen may be seen as a +special room: +

+
+  Class Room
+  Class Kitchen -superclass Room
+

+Now all instances of Kitchen are able to access the +operations stored in the Room and in the Kitchen class. +Note the transition the kitchen was going through: firstly it was a +singular object, then it was an object with a user-defined class, +and now it is a class. This is possible (and not senseless) because +of the per-object specialization ability and the dual shape of a +class, which is at the same time object and class. Both lead to a +seamless connection of the run-time properties (the object features) +and their descriptive properties (the class features). It is possible +to avoid the strict distinction between them, known from static typed +languages, like C++, Java, etc. +

+

Moreover, since the syntaxes of constructs expressing the same +concern are nearly identical, we can re-factor a solution with very few +changes to the alternative. We will see similar "ease of refactoring" +throughout the XOTcl language. E.g., we can also easily re-factor the +class hierarchies or exchange class hierarchies against mixin +solutions with only slight changes in the code. +

+

Besides single inheritance, as seen, XOTcl provides also multiple +inheritance. This is syntactically solved by giving the superclass +instance method a list of classes instead of a single class as +argument. +

+
+  Class Room
+  Class 4WallsRoom -superclass Room
+  Class CookingPlace
+  Class Kitchen -superclass {4WallsRoom CookingPlace}
+

+Now the kitchen class is specialized a bit more. It is a special room +which has four walls and it is a cooking place. Multiple +inheritance, as seen here, is as simple to apply as single +inheritance. +

+ +Most often when the disadvantages of multiple inheritance are +discussed, the name resolution along the class graph is considered as +the biggest problem. The question is, which method is to be chosen and +which path through class graph is to be taken, if more then one method +of the specified name exist on the class graph. + +

+

In the example such questions +would arise for an object of the Kitchen class, if two +same-named methods are defined on CookingPlace and +4WallsRoom or if a method of the class Object is +called, which is reachable through two paths (along +CookingPlace or Room). +

+ +

Often - e.g. in the +inheritance model of C++ - the path through the graph is not clearly +determined and/or the rules are too complicated to be understood on +the first glance. The programmer often can only determine by trial +which method is found firstly. Than an explicit naming of the class is +necessary, which means storage of non-local information in +sub-classes. Often different compilers of one language behave +differently. All these issues make code reuse difficult. Moreover +understandability and portability are reduced. +

+


+

+

Figure 3: +The example classes and the following next-path

+
+ + + + + +
+
+
+

XOTcl goes an intuitive and unambiguous way to solve this problem. +It resolutes the precedence order along a ``next-path''. +Firstly the class of the object is searched, which is Kitchen +in example. Then the super-classes are searched in definition order, +which means at first 4WallsRoom, then CookingPlace. +Each branch is searched completely, before changing to the next +branch. That means, Room is searched, before the +CookingPlace branch is visited. At last the top of the +hierarchy, the class Object, is searched. +

+ +

The usage of next in XOTcl is different to OTcl: In OTcl, + next is defined as a method, in XOTcl it is a + primitive command. Furthermore, in OTcl, +it is always necessary to provide the full argument list for every +invocation explicitly. In XOTcl, a call of next without +arguments can be used to call the shadowed methods with the same +arguments (which is the most common case). When arguments should be +changed for the shadowed methods, they must be provided explicitly in +XOTcl as well. In the rare case that the shadowed method should +receive no argument, the flag --noArgs must be used. +

+ +

Destruction of Classes +

+

Classes are destroyed by the destruction of the class-object using +the destroy method of the Object class. The +destruction of super-classes does not destroy the sub-classes. The +super-class is simply removed from the sub-classes' super-class +lists. All classes have the super-class Object, if no +super-class is specified. Therefore, if all super-classes are +destroyed or removed, the new super-class is Object, not: no +super-class. The destruction of the class of an object does neither +delete the object nor leave it without class. In XOTcl a deleted class +leaves it's instances with the class Object. +

+

So all empty class- and superclass-relationships are automatically +reseted to Object. Note, that this are differences to OTcl, +where the destruction of an class destroys all instances and an empty +super-class list remains empty. +

+

Method Chaining +

+

A special feature of XOTcl is the method chaining without explicit +naming of the ``mix-in''-method. It allows one to mix the same-named +superclass methods into the current method (modeled after CLOS). The +previously described next-path is the basis for this functionality. +At the point marked by a call to the next primitive of XOTcl +the next shadowed method on the next path is searched and, when it is +found, it is mixed into the execution of the current method. When no +method is found, the call of next returns an empty string, +otherwise it returns the result of the called method. +The syntax is: +

+
+  next ?arguments|--noArgs?
+

+As stated earlier the usage of next in XOTcl differs from +OTcl, since the next call without arguments in OTcl means +per default that no arguments are passed. But most often all +arguments are passed through to the shadowed methods (since these will +most likely have the same signatures). When all +variables should be passed through, in OTcl it is necessary for +correct variable substitution to use: +

+
+  eval $self next $args
+

+To avoid such difficulties, we made the passing of all arguments the +default case; a simple +

+
+  next
+

+performs the task of passing all arguments to the shadowed methods. +These arguments are called the standard arguments. If the +standard argument feature should not be used, optionally arguments +can be given or the flag --noArgs could be set as sole +argument, which means that the shadowed method is called with no +arguments. +

+

+E.g. the following next call ignores the standard arguments +and sends the arguments 1 and 2 instead: +

+
+  next 1 2
+

+ +

As an example all classes involved in the previous example should +get a constructor instance method, which simply sets an instance +variable on the object: +

+
+  Room instproc init args {
+    my set roomNumber 0
+    next
+  }    
+  4WallsRoom instproc init args {
+    my set doorPosition 0
+    next
+  }
+  CookingPlace instproc init args {
+    my set stoveType electric
+    next
+  }
+  Kitchen instproc init args {
+    my set cookName -
+    next
+  }
+

+After creation an object of class Kitchen gets automatically +four instance variables cookName, roomNumber, +doorPosition and stoveType set up with default +values in this order (since this is the order of the classes in the +next-path). Note, that the order is important, because one missing +next call, in one of the init methods, means that succeeding +init methods will not be executed. This mechanism functions +equally on all kinds of instprocs, not only on constructors. +

+

The constructors use the args argument, which allows us to +give a list of variable length as arguments. To ensure reusability of +our classes the constructors should use args in most cases, +since they may pass through arguments for constructors further up the +class hierarchy. +

+

If a proc with the searched name exists on the object it +shadows all instprocs. A next call in a proc leads to +the normal next-paths search, starting with the object's class. +

+

By the way, an observant reader might notice that the example +above can be rewritten without explicit constructors, just by +using parameters with default values. +

+
+  Class Room -parameter {{roomNumber 0}}
+  Class 4WallsRoom -superclass Room -parameter {{doorPosition 0}}
+  Class CookingPlace -parameter {{stoveType electric}}
+  Class Kitchen -superclass {4WallsRoom CookingPlace} -parameter {{cookName -}}
+

+If an instance of a Kitchen is created it will contain instance +variables for doorPosition, cookName, +roomNumber, and stoveType, as the following +statements will show.

+
+  Kitchen k
+  puts [k info vars]
+
+ + +

Dynamic Class and Superclass +Relationships +

+

Another property of XOTcl that distinguishes it from statically typed +languages are dynamics of class relationships. The realization of the +definition of super-classes as seen above with the superclass +method suggests already, that it is not only available at the class +definition time. In the above example its appended to the class +definition with "-superclass" as a short syntax +for method invocation at definition time (all other available methods +can also be called with a preceding dash ("-") appended +to definitions). +

+

At any time the class graph may be changed entirely using the +superclass method. Suppose the rooms and kitchens created in +modeling of a house should be displayed to a screen, but it is not +determined, whether the user of the system has the possibilities for +graphical outputs. Two classes TextOutput and +GraphicalOutput may be defined, which handle the output. Both +have an instproc paint which does the painting of the virtual +world on the chosen display type. The common output requirements are +handled by a derived class VirtualWorldOutput which calls the +paint method of the superclass using next. In +statically typed languages it would need more sophisticated constructs +to change the output class at run-time. E.g. a delegation to another +object handling the intrinsic task of the output object would be +introduced solely for the purpose of configuring the output +form. With a dynamic class system we can use the superclass +method to do so easily: +

+
+  Class TextOutput
+  TextOutput instproc paint args {
+    # do the painting ...
+  }
+  Class GraphicalOutput
+  GraphicalOutput instproc paint args {
+    # do the painting ...
+  }
+
+  # initially we use textual output
+  Class VirtualWorldOutput -superclass TextOutput
+  VirtualWorldOutput instproc paint args {
+    # do the common computations for painting ...
+    next; # and call the actual output
+  }
+
+  # user decides to change to graphical output
+  VirtualWorldOutput superclass GraphicalOutput
+
+

+Sometimes, such a change to new intrinsic properties should not happen +for all instances of a class (or the class hierarchy), but only for +one specific object. Then the usage of a dynamic super-class +relationship is a too coarse-grained means. A second form of such +dynamics is the changing of the relationship between object and +class. This means, objects can also change their class dynamically at +run-time. This feature may be used to model a life-cycle of an object, +without loosing the object's identity, inner state or +per-object-specializations through procs. The class instance +method enables this functionality. +

+

An example would be an agent for the virtual world. Agents may be +placeholders for persons, who interactively travel the world, or +programs, which act automatically. When a person decides at run-time +to give a task it has performed formerly by hand to an automatic +agent, the agents nature changes from interactive agent to automatic +agent, but the identity and the local state (that means the parts of +the task, that are already fulfilled by the person) stay the same. +This is a scenario for changing class relationships, e.g.: +

+
+  Class Agent
+  Class AutomaticAgent -superclass Agent
+  Class InteractiveAgent -superclass Agent
+
+  # create a new agent for a person
+  InteractiveAgent agent1
+
+  # the person does something ...
+  # and decides the change to an automatic agent
+  agent1 class AutomaticAgent
+
+ +

+Meta-Classes +

+

Meta-classes are a special kind of classes. Similar as classes are +managing objects (where managing means: control the creation and +destruction of instances, know what instances exist, provide methods), +meta-classes are managing classes. So, meta-classes are used to define +classes. In other words, every Class in XOTcl is created by a +meta-class, in most cases by the meta-class named Class. New +user-defined meta-classes can be defined as subclasses of the +predefined meta-class Class, or by adding an instmixin class +(see below) containing Class +to the precedence chain of the class. By defining Object +instmixin Class one can even change the object system of XOTcl in +in a way such that every created Object is a meta-class. +

+

Since the concept of a meta-class are sometimes +confusing to people of a background of some other programming +languages, we explain meta-classes slowly with the analogy of classes +and objects. +

+

+When a class Foo is created via the command +

+   Class Foo
+
+ it has no private variables and no special methods. This is + somewhat similar as creating an object via Object: +
+   Object foo
+
+ This plain object foo can be configured directly, or + one can create a class that configures the object. + Instead of writing +
+   Object foo 
+   foo set x 1
+   foo proc hi {} {puts "hello"}
+
+ one can use +
+   Class C -superclass Object
+   C instproc init {} {my set x 1}
+   C instproc hi {} {puts "hello"}
+
+ and create an instance and call the method. +
+   C c1
+   c1 hi
+
+ The same holds for meta-classes and classes as well: Instead of writing +
+   Class Foo
+   Foo set x 1
+   Foo proc hi {} {puts "hello"}
+
+ the following can be used: +
+   Class MC -superclass Class
+   MC instproc init {} {my set x 1}
+   MC instproc hi {} {puts "hello"}
+
+ The instances of meta-classes are classes which can be + defined the usual way: +
+   MC Bar
+   Bar hi
+   Bar b1
+
+ Now we have a class names Bar which has a class-scoped + variable named x with the value of 1 (set via the + constructor); the class Bar has as well a class-method named + hi which prints, when called, the string "hello". The class + Bar can be used to create instances of the class like + b1, b2 and so on. +

+

Note that the command Class is a predefined definition +of the most general meta-class in XOTcl. Each time we are creating +a class, we use this meta-class. +In order to define a specialized meta-class, we can do this the +traditional object-oriented way: we subclass. Therefore, in to define +a specialized meta-class, we can use: +

+
+  Class myMetaClass -superclass Class
+
+

This defines a new meta-class myMetaClass, which has all the +abilities of meta-classes. That means that the programmer is able to +specify new class features or override old ones. Later she/he may +instantiate these into new classes. +

+

This is a very powerful language feature, since it allows one to give +some classes further abilities than the others (or to restrict +classes). This way large program structures, like certain design +pattern parts, may be instantiated. Meta-classes hold the common +abstract parts of the structures. They allow one to form libraries of +such structures very easily. +

+

Example 1: Overloading the info method of classes +

+

+As a simple example we can derive a new meta-class +NoClassInfo from Class. Later we override the +info method of Class. Thus the classes created with +NoClassInfo, have an info option that only produces +an error message. All classes created with NoClassInfo, like +Agent in the example below, are not capable of accessing the class +info method anymore: +

+
+  Class NoClassInfo -superclass Class
+  # redefine info ability
+  NoClassInfo instproc info args {
+    error "No class info available"
+  }
+  # derive agent class from meta-class, which
+  # can not access class info
+  NoClassInfo Agent
+
+Now a call like: +
+  Agent info superclass
+

+triggers the error message. +

+ +

Example 2: Defining Classes that Count Their Instances +

+

Meta-classes are frequently used to define some bookkeeping +about the number of instances on the class level. In the following +example we define a meta-class named CountedClass which +defines classes that count their instances: +

+  Class CountedClass -superclass Class -parameter {{counter 0}}
+  CountedClass instproc create args {
+    my incr counter
+    next
+  }
+  CountedClass instproc instdestroy args {
+    my incr counter -1
+    next
+  }
+  CountedClass Dog
+
+  Dog piffie
+  Dog idefix
+  puts "nr of dogs: [Dog counter]"
+
+  piffie destroy
+  puts "nr of dogs: [Dog counter]"
+
+Note that the behavior introduced by meta-classes +can be orthogonal to the behavior of the classes. One can +define Dog as a specialization of Animal +or defines a special kind of dog such as Poodle using +the method superclass as usual. +

+ +

Example 3: The Singleton Meta-Class +

+

Finally, a small example, which is more practical. Some +applications have the requirement that only one instance of a class +might be defined at a certain time. Such a behavior is frequently +called a "Singleton". In XOTcl we can define a class singleton by +overloading the create method of Class: when +create is called and there exists already an instance of the +singleton it is returned instead of a new instance. +

+  Class Singleton -superclass Class
+  Singleton instproc create args {
+    expr {[my exists instance] ? [my set instance] : [my set instance [next]]}
+  }
+
+ If someone wants to have a class e.g. Manager to be a + singleton, you can create it by e.g. +
+  Singleton Manager -superclass FOO
+
+

+ + +

+Create, Destroy, and Recreate Methods +

+

+

+XOTcl allows since version 0.84 for a flexible destroy and recreate scheme. +create and alloc are both Class instprocs +handling creation for their instances. I.e.: +

+
+ className alloc [self]
+
+and +
+ className create [self]
+
+

+are used for creating an instance. A similar method instdestroy +exists on Class that handles physical destruction of an object. The +method destroy on Object which lets an object destroy itself in fact +has the following behavior: +

+
+  Object instproc destroy args {
+   [my info class] instdestroy [self]
+  }
+
+

+However, this behavior is not implemented in XOTcl, but in C. +create distinguishes between the following situations: +

+
    +
  • Create a new object: + create calls alloc and then + doInitializations. +
  • Recreate an existing object: + When the specified object exists, it is recreated through the + recreate method: +
    +  givenClass recreate [self]
    +
    +

    + recreate can be customized e.g. by overloading or interception. + By default it calls cleanup followed by doInitializations. +

+

+In both cases, the method doInitializations +is called automatically from C and has the following default behavior: +

+
    +
  • Search for parameter default values, +
  • Call parameter initialization methods, +
  • Call the constructor init. +
+

+Each step has a method call that can be changed, intercepted, etc. Of +course, cleanup, recreate, instdestroy, +etc. can also be overloaded or intercepted. +

+

+Consider a typical case for overloading recreate: a structure +preserving recreate that cleans up the class but +preserves the existing class hierarchy (subclass and instance relationships): +

+
+  Class StructurePreservingRecreate
+  StructurePreservingRecreate instproc recreate {cl args} {
+    if {[my isclass $cl]} {
+      set subclass [$cl info subclass]
+      set instances [$cl info instances]
+    }
+    next
+    if {[my isclass $cl]} {
+      foreach sc $subclass {
+        $sc superclass $cl
+      }
+      foreach i $instances {
+        $i class $cl
+      }
+    }
+  }
+  Object instmixin add StructurePreservingRecreate
+
+

+Now the following code does not change the superclass or instance +relationships of C: +

+
+  Class A
+  Class B
+  Class C -superclass {A B}
+  Class D
+  Class E -superclass {C D}
+  C c1
+  C c2
+
+  # recreate -> is structure preserving
+  Class C -superclass {A B}
+  C c2
+
+  # test
+  puts superclass=[C info superclass]
+  puts subclass=[C info subclass]
+  puts instances=[C info instances]
+  puts class=[c1 info class]
+  puts class=[c2 info class]
+
+ +

+Methods with Non-Positional Arguments +

+

+

+So far we have introduced methods only with positional arguments: that +is, the position of an argument in the argument list determines to +which local variable the argument is bound, when the method is +invoked. Sometimes non-positional arguments -- arguments that carry +both a name and a value when the method is invoked -- are +useful. Before a non-positional argument can be used, it must be +defined in the method definition using the following syntax: +

+
+ className instproc methodName ?non-pos-args? args body ?assertions
+ objName proc methodName ?non-pos-args? args body ?assertions
+
+

+The non-positional arguments are defined with the following syntax: +

+
+ {-name?:checkoption1, checkoption2, ...? default value} \
+     {-name?:checkoption1, checkoption2, ...? ?default value?} ...
+
+

+Only the name of the non-positional argument is really required, all +other parts of this syntax are optional. +

+

+Let's consider a simple example, where a method with two +non-positional args is defined; one has only a name ("a"), and one has +a name and a default value (b): +

+
+ Object o
+ o proc someproc {-a {-b {1 2 3}} x y} {
+     puts "$a $b $x $y"
+ }
+

+We can invoke this method as follows: +

+
+ o someproc -b {4 5} -a 1 3 4
+

+ +Here, the order of a and b can be changed; hence the name +non-positional arguments. As b has a default value, we do not need +to provide a value for it. In the following invocation b has the +value "1 2 3": +

+
+ o someproc -a 1 3 4
+

+The ordinary arguments start after the last non-positional argument +(here: "3 4"). We can explicitly end the non-positional arguments by +using "--". This is useful if we want to provide arguments that contain +dashes ("-"), e.g.: +

+
+ o someproc -a 1 -- -b -c
+

+ +Sometimes we want to check or control the non-positional +arguments. For instance, in the above invocation, we might want to +check that a is not forgotten, because otherwise the method cannot +execute properly. This is the role of the checkoptions. There are three +predefined checkoptions: required, boolean and +switch. required checks +whether a non-positional argument is given, boolean checks that a +non-positional argument is of boolean type. For instance: +

+
+ Class P
+ P instproc someproc {-a:required {-b:boolean true}} {
+     puts "$a $b"
+ }
+ P p
+

+ +This method requires a, and b needs to be +of type boolean (is has +the default value true). This invocation is valid: +

+
+ p someproc -a 1 -b 0
+

+ +This invocation is invalid, because a is missing, +and b is not a Tcl boolean type: +

+
+ p someproc -b " a b v"
+

+The checkoption switch is similar to boolean except +it does not require an additional argument. If the default value is +false, the switch can be turned on, if the default is true +it can be switched off. +

+The checkoptions are extensible. In fact, they are defined in an +object ::xotcl::nonposArgs. We can extend this object with new +methods. + +A check option method has the following syntax: +

+
+ someobject|someclass proc|instproc methodName {?optional nonpositional arguments? argName arg} {
+  ...
+ }
+
+

+ +argName is here used to denote the name of the argument, +and arg is the provided value. +

+ + + + +Of course, the non-positional arguments can also be introspected. The +following info options return the non-positional arguments of a +method: + +

+
+ objName info nonposargs methodName
+ className info instnonposargs methodName
+

+ + + + + + + + +
+

Message +Interception Techniques + +

+
+
+ +

Even though object-orientation orders program structures around +data, objects are characterized primarily by their behavior. +Object-oriented programming style encourages the access of +encapsulated data only through the methods of an object, since this +enables data abstractions. A method invocation can be interpreted as a +message exchange between the calling and the called object. +Therefore, objects are at runtime only traceable through their message +exchanges. At this point the message interceptors can be applied to +catch and manipulate all incoming and outgoing messages of an +object. +

+

Generally interceptors can be applied to attach additional or +extrinsic concerns to an object or a class or a class hierarchy. For +instance roles or aspects can be implemented this way on various +levels of scale. +

+ +

We have already discussed some interception techniques +implicitly. E.g., the unknown mechanism intercepts messages +that have not be found on the object. It can be used as a very useful +programming technique, e.g., the define a default behavior for an +object. The interceptors presented in this section have a different +character: They are applied before/after the original method even +if the method is defined for the target object. Thus these +interception techniques may be applied +

+ +

We will discuss the message interceptors in this section in +detail. The table below gives an impression, when which interceptor +may be applied. + +

Message + Interceptors Overview

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Applied When

Primary Target Structure

Coverage

Per-Object Filter

before/after a call

object hierarchies

all methods

Per-Class Filter

before/after a call

class and class hierarchies

all methods

Per-Object Mixin

before/after a call

object

specific methods

Per-Class Mixin

before/after a call

class and class hierarchies

specific methods

Unknown Mechanism

after method was not found

object

all unknown calls

+
+ +
+ +

Filter +

+ +

The filter (see [Neumann and Zdun +1999a] for more details) is a language construct to implement +broader extensional concerns either for a single object or for several +classes or class hierarchies. This way large program structures at the +scale of several classes or class hierarchies can be managed. It is a +very general interception mechanism which can be used in various +application areas. E.g. a very powerful programming language support +for certain design patterns is easily achievable, but there are also +several other domains which are covered, like tracing of program +structures, self-documentation at run-time, re-interpretation of the +running program, etc. +

+

A per-class filter is a special instance method that is +registered for a class C. A per-object filter is a +special instance method that is registered for a object +o. Every time an object of class, C or the object +o respectively, receives a message, +the filter method is invoked automatically. +

+

Usage of Filters +

+

All messages to a filtered object must go through the filter before +they reach their destination object. A simple example would be a sole +filter on the class of the object. To define such a filter two steps +are necessary. Firstly an filter method has to be defined, then the +filter has to be registered. The filter method consists of three parts +which are all optional. A filter method has the following form: +

+
+  className instproc FilterName args {
+    pre-part
+    next
+    post-part
+  }
+
+

+When a filter comes to execution at first the actions in the pre-part +are processed. The filter is free in what it does with the +message. Especially it can (a) pass the message, which was perhaps +modified in the pre-part, to other filters and finally to +the object. It can (b) redirect it to another destination. Or it can +(c) decide to handle the message on its own. The forward passing of +messages is implemented through the next primitive of XOTcl. +After the filter has passed its pre-part, the actual called method is +invoked through next. +

+

After the call of next is processed, the execution returns +to the point in the filter, where the next call is located +and resumes execution with the actions of the post-part. +These may contain arbitrary statements, but especially may take the +result of the actual called method (which is returned by the +next-call) and modify it. The caller then receives the result of the +filter, instead of the result of the actual called method. +

+

The pre- and post-part may be filled with any ordinary +XOTcl-statements. The distinction between the three parts is just a +naming convention for explanation purposes. +

+

The filter uses the args argument which lets us use a list of +variable length as arguments, since it must filter a lot of different +calls, which may have different argument lists. Furthermore, it may +pass through arguments to other filters and the preceding filters may +change the argument list. +

+

Since any proc/instproc may be a filter, a registration of the +filter is necessary, in order to tell XOTcl, which instprocs are +filters on which classes. The filter and instfilter +instance methods are able to handle this task for per-object filters +and per-class filters respectively. Similar to the XOTcl language +introduced so far, the filter registration is dynamic at run-time. By +supplying a new list of filters to +filter/instfilter, the programmer can change the +filters registered on a class at arbitrary times. The filter instance +method has the syntax: +

+
+  className instfilter filterList
+
+for per-class filters and: +
+  objName filter filterList
+
+for per-object filters. + +

+Now a simple example should show the filter's usage. In the preceding +examples we have defined several rooms. Every time a room action +occurs it is likely that the graphical sub-system has to change +something on the output of that particular room. Therefore, at first +we need a facility to be informed every time an action on a room +happens. This is quite easily done using filters: +

+
+  Class Room
+  Room r1; Room r2;       # just two test objects
+
+  Room instproc roomObservationFilter args {
+    puts "now a room action begins"
+    set result [next]
+    puts "now a room action ends - Result: $result"
+    return $result
+  }
+
+  Room instfilter roomObservationFilter
+

+Now every action performed on room objects is notified with a pre- +and a post-message to the standard output stream. We return the +result of the actual called method, since we don't want to change the +program behavior at all. E.g. we can set an instance variable on both +of the two room objects: +

+
+  r1 set name "room 1"
+  r2 set name "room 2"
+

+The output would be: +

+
+  now a room action begins
+  now a room action ends - Result: room 1
+  now a room action begins
+  now a room action ends - Result: room 2
+

+
+

+

+   +

+

Figure 4: +Cascaded Message Filtering

+
+ + + + + +
+

+
+
+



+

+

All classes may have more than one filter. In fact they may have a +whole filter chain, where the filters are cascaded through next. +The next method is responsible for the forwarding of +messages to the remaining filters in the chain one by one till all +pre-parts are executed. Then the actual method is executed and +then the post-parts come to turn. If one next-call is omitted the +chain ends in this filter method. As an example for an additional +filter we may register a filter that just counts the calls to +rooms. +

+
+  Room set callCounter 0;  # set class variable
+  Room instproc counterFilter args {
+    [self class] instvar callCounter
+    incr callCounter
+    puts "the call number callCounter to a room object"
+    next
+  }
+  Room instfilter {roomObservationFilter counterFilter}
+

+Filters are invoked in registration order. The order may be changed +by removing them and adding them in new order. Filters are inherited +by sub-classes. E.g. in the preceding example for the next path, an +OvalOffice was derived from the Room class. Without +a change to the program each OvalOffice object automatically +produces the same filter output as rooms. +

+


+

+

+   +

+

Figure 5: +Filter Inheritance

+
+ + + + + +
+

+
+
+


Filter chains can also be combined through (multiple) +inheritance using the next method. When the filter chain of +the object's class is passed, the filter chains of the superclasses +are invoked using the same precedence order as for inheritance. Since +on the subclass there may also be a another filter chain, without +sophisticated computing in the pre- and post-parts one can produce +easily a powerful tracing facility. E.g. if we want to distinguish an +OvalOffice from other rooms we may want to add a filter +solely for rooms of the type OvalOffice: +

+
+  Class OvalOffice -superclass Room
+  OvalOffice o1;  # test object
+  OvalOffice instproc ovalOfficeObservationFilter args {
+    puts "actions in an oval office"
+    next
+  }
+  OvalOffice instfilter ovalOfficeObservationFilter
+

+A simple call to the o1 object, like: +

+
+  o1 set location "Washington"
+

+produces the following output: +

+
+  actions in an oval office
+  now a room action begins
+  the call number 3 to a room object
+  now a room action ends - Result: Washington
+

+As seen already, filter registrations can be added dynamically at +runtime. But they may also be removed. Perhaps the counting on rooms +should stop after a while, then a simple call of the instfilter +method is sufficient: +

+
+  Room instfilter roomObservationFilter
+
+

Filters can be removed completely by giving an empty list to the +registration method:

+
+  Room instfilter {}
+
+ + +

Per-object filters operate on a single object. E.g. if we only +want to observe a single Room object room1, we can use the filter +method to register the roomObservationFilter only for this particular +instance:

+
+  room1 filter roomObservationFilter
+
+

As a filter we can register any method in the precedence order of +the class or object. Thus we can also register procs as per-object +filters. Additionally, meta-class methods may be registered as +per-class filters. Filters are linearized so that each filter is only +executed once, even if it is registered multiple times. +

+



+

+

Introspection on Filters +

+In order to gain information about the currently registered filters on +a certain object/class, the object info option filters and +the class info option instfilters may be +queried. It returns a list of the currently registered filters: +

+
+  className info instfilter
+  objName info filter
+
+

+ +A special call-stack info option for filters is self +filterreg. It returns the name of the object or class on which +the filter is registered. Since the filter may be registered on other +objects/classes than the one on which it is defined, this may vary from +self class in the filter. + +The command returns a list of the form: +

+  objName filter filterName
+
+or: +
+  className instfilter filterName
+
+respectively. +

+ +



+

+

Example: A Simple Trace Filter +

+

The trace example primarily demonstrates the inheritance of filter +chains. Since all classes inherit from Object, a filter on +this class is applied on all messages to objects. The Trace +object encapsulates methods for managing the tracing: +

+
+  Object Trace
+  Trace set traceStream stdout
+
+  Trace proc openTraceFile name {
+    my set traceStream [open $name w]
+  }
+
+  Trace proc closeTraceFile {} {
+    close $Trace::traceStream
+    my set traceStream stdout
+  }
+
+  Trace proc puts line {
+    puts $Trace::traceStream $line
+  }
+
+  Trace proc add className {
+    $className instfilter [concat [$className info filter] traceFilter]
+  }
+

+First we define the object and set a variable for the stream to which +we send the trace outputs (here: stdout). With a method for opening +and a method for closing a file we can redirect the trace stream to a +file. puts is helper method for the filter to print an +output to the selected output stream. In add the traceFilter +is appended to the existing filters of a specified class. The actual +filter method (see below) displays the calls and exits of methods +with an according message. The calls are supplied with the arguments, +the exit traces contain the result values. We have to avoid the +tracing of the trace methods explicitly. +

+
+  Object instproc traceFilter args {
+    # don't trace the Trace object
+    if {[string equal [self] ::Trace]} {return [next]}
+    set context "[self class]->[self callingproc]"
+    set method [self calledproc]
+    switch -- $method {
+      proc -
+      instproc {::set dargs [list [lindex $args 0] [lindex $args 1] ...] }
+      default  {::set dargs $args }
+    }
+    Trace::puts "CALL $context>  [self]->$method $dargs"
+    set result [next]
+    Trace::puts "EXIT $context>  [self]->$method ($result)"
+    return $result
+  }
+

+As trace message we write the callee´s context (class and +proc), the invoked method (using calledproc), and the given +arguments. In the switch statement we avoid to print whole method +bodies. +

+

With +

+
+  Trace add Room
+

+messages to all rooms, including all instances of Room´s +sub-classes, are surrounded with a CALL and an EXIT output. With +

+
+  Trace add Object
+

+messages to all objects in an XOTcl environment are surrounded with a +CALL and an EXIT output. In general, it is possible to restrict the +trace to instances of certain classes, or to produce trace output for +only certain methods. This requires registration methods and a more +sophisticated implementation of the filter method. +

+



+

+ +

Mixin Classes +

+ +

Per-object and per-class mixins (see [Neumann and Zdun 1999c] for more details) are +another interception technique of XOTcl to handle complex +data-structures dynamically. Here, we use mixin as a short form for +mixin class. All methods which are mixed into the execution of the +current method, by method chaining or through a mixin class, are +called mixin methods. Mixin classes resembles the filter +presented in the preceding section. While the filters work on all +calls to all methods of an object/class hierarchy, the mixin classes +are applied on specific methods. The filter is defined in a single +method, while the mixin is composes several method in a class. + +

+

Supplemental Classes +

+

Mixin classes cover a problem which is not solvable elegantly just +by the method chaining, introduced so far. To bring in an addition to +a class, the normal XOTcl way is to define a mixin method and chain +the methods through next, e.g.: +

+
+  Class Basic
+  Basic instproc someProc  {
+    # do the basic computations
+  }
+  Class Addition
+  Addition instproc someProc {
+    # do the additional computations
+    next
+  }
+

+In order to mix-in the additional functionality of the supplemental +class Addition a new helper class (sometimes called +intersection class) has to be defined, like: +

+
+  Basic+Addition -superclass Addition Basic
+

+This is even applicable in a dynamical manner, every object of the +class Basic may be changed to class Basic+Addition +at arbitrary times, e.g.: +

+
+  Basic+Addition basicObj
+  ...
+  basicObj class Basic+Addition
+

+Now consider a situation with two addition classes. Then following +set of classes has to be defined to cover all possible combinations: +

+
+  Class Basic
+  Class Addition1
+  Class Addition2
+  Class Basic+Addition1 -superclass Addition1 Basic
+  Class Basic+Addition2 -superclass Addition2 Basic
+  Class Basic+Addition1+Addition2 -superclass Addition2 Addition1 Basic
+

+The number of necessary helper classes rises exponential. For n +additions, 2n-1(or their permutations if order +matters) artificially constructed helper-classes are needed to +provide all combinations of additional mix-in functionality. +Furthermore it is possible that the number of additions is unlimited, +since the additions may produce other additions as side-effects. This +demonstrates clearly that the sub-class mechanism provides only a +poor mechanism for mix-in of orthogonal functionality. Therefore we +provide an extension in the form of object mixin classes, which are +added in front of the search precedence of classes. +

+

Per-Object Mixins +

+

The mix-ins methods extend the next-path of shadowed methods. +Therefore, per-object mix-in methods use the next primitive +to access the next shadowed method. Consider the following example: +

+
+  Class Agent
+  Agent instproc move {x y} { 
+    # do the movement
+  }
+  Class InteractiveAgent -superclass Agent
+  # Addition-Classes
+  Class MovementLog
+  MovementLog instproc move {x y} { 
+    # movement logging
+    next
+  }
+  Class MovementTest
+  MovementTest instproc move {x y} {
+    # movement testing
+    next
+  }
+

+An agent class is defined, which allows agents to move around. Some +of the agents may need logging of the movements, some need a testing +of the movements, and some both (perhaps only for a while). These +functionalities are achieved through the additional classes, which we +will apply through per-object mixins. +

+

Before we can use the per-object mix-ins on a particular object, +we must register the mixins on it with the mixin instance +method. It has the syntax: +

+
+  objName mixin mixinList
+

+For example we may create two interactive agents, where one is logged +and one is tested: +

+
+  InteractiveAgent i1; InteractiveAgent i2
+  i1 mixin MovementLog
+  i2 mixin MovementTest
+

+At arbitrary times the mixins can be changed dynamically. For example +i2's movements can also be logged: +

+
+  i2 mixin MovementTest MovementLog
+

+
+

+

+   +

+

Figure 6: +Per-Object Mix-ins: Next-Path for the Example

+
+ + + + + +
+

+
+
+



+

+

The mixin option of the info instance method +allows us to introspect the per-object mix-ins. It has the syntax: +

+
+  objName info mixin ?className?
+
+

+It returns the list of all mix-ins of the object, if className +is not specified, otherwise it returns 1, if className +is a mixin of the object, or 0 if not. +

+ +

Note, that the constructors (init methods) of per-object mixins (and per-class mixins) +are only called, if the mixin is registered already during object +initialization (when init is called). For per-object mixins, one can +achieve the initialization of a mixin via an idiom like +

+  Object o -mixin M -init
+
+that registers the mixin before init is called. When a mixin is registered +after object creation and it needs initializations, it is necessary to +define special methods for this. Note, that the behavior described +here is introduced in version 0.84 to ensure consistent behavior of +intrinsic classes, per-object and per-class mixins, and to achieve +predictable behavior for dynamic registration for all kind of mixins, +and as well during recreations of objects having mixins +registered. Older versions used heuristics for the initialization of +per-object mixins. +

+ +

Per-Class Mixins +

+ +

Per-class mixins are exactly identical in their behavior to +per-object mixins, but they operate on classes. Thus they are the +class-specific variant of the per-object mixins, like instprocs are a +class-specific variant of procs. Therefore, in the language the +per-class mixins are called instmixins. +

+ +

+In general a per-class mixin is a class which is mixed into the +precedence order of all instances of the class and all its subclasses +it is registered for. It is also searched before the object's class +itself is searched, but after per-object mixins. +

+

+Per-class mixins are linearized according to the +precedence order +like classes on the superclass hierarchy. I.e. from the full +list of per-object mixins, per-class mixins, and intrinsic classes +(and all the superclasses of all these classes) always the last +occurrence is used. +

+ +

+From the point of view of language expressibility instmixins are not +required, because they cannot express anything that per-object mixins +cannot express already (like procs can express any instproc +feature). As alternative to instmixins, we could simply register the +per-object mixins in the constructor of the class. +

+ +

+But there at least the following reasons for instmixins as an +additional language construct: +

    +
  1. we can at runtime determine with info mixin +and info instmixin whether it is a class- or object-specific +mixin. Thus we get a better structuring at runtime. +
  2. We have not to 'pollute' the constructors with per-class mixin +registrations. Therefore, the constructors get more understandable. +
  3. If it is required to add (and remove) dynamically interceptors +to a set of objects, which are instances of a certain type, per-class +mixins are much easier to handle (e.g. add an instmixin to Object +to intercept e.g. all calls to certain predefined methods). +
  4. The language is more 'symmetrical', since any object-specific +feature in XOTcl has a class-specific variant. +
+

+ +

The mix-ins methods of per-class mixins extend the next-path of +shadowed methods in the same way as per-object mixin methods. Before +we can use a per-class mix-in on a particular class, we must +register the mixin on it with the instmixin instance method. It +has the syntax: +

+
+  className instmixin mixinList
+
+

+Now consider that in the given per-object mixin example all +interactive agents should be tested. We could either build a subclass +TestedInteractiveAgent or register the per-object mixin in +the constructor of the interactive agent class. The subclass solution +leads to the same combinatorial explosion of intersection classes as +discussed in the previous section, if more supplemental classes are +added. The per-object mixin solution pollutes the constructor and does +not prevail the structural semantics that the 'tested' property +belongs to the interactive agent class at runtime +

+

+Here, we can use a per-class mixin: +

+
+  Class Agent
+  Agent instproc move {x y} {# do the movement}
+  Class InteractiveAgent -superclass Agent
+  Class MovementTest
+  MovementTest instproc move {x y} {
+    # movement testing
+    next
+  }
+
+  # now register the instmixin
+  InteractiveAgent instmixin MovementTest
+
+
+ +

The per-class mixin now operates on all interactive agent +including the instances of subclasses. E.g. for interactive agents +i1 and i2 we automatically have movement +testing. i2 is also logged, since it has the logging class +as object-specific mixin: +

+
+  InteractiveAgent i1
+  InteractiveAgent i2 -mixin MovementLog
+
+  i1 move 3 4
+  i2 move 1 2 
+
+ +

+At arbitrary times the instmixins can be changed dynamically. +

+

The instmixin option of the class info instance +method allows us to introspect the per-class mixins. It has the +syntax: +

+
+  className info instmixin ?className2?
+
+

+It returns the list of all instmixins of the the class, if className2 +is not specified, otherwise it returns 1, if className2 +is a mixin of the object, or 0 if not. +

+ +

Per-class mixins are applied transitively. That means the per-class +mixin A of a per-class mixin B is also applied for an object in in B's +scope. This is exactly the same as how superclasses are applied for +instances. Consider the following example

+ +
+  Class X11 \
+     -instproc test args {
+	puts [self class]
+	next
+     }
+  Class X12 \
+    -instproc test args {
+	puts [self class]
+	next
+    }
+  Class X \
+    -instmixin {X11 X12} \
+    -instproc test args {
+	puts [self class]
+	next
+    }
+
+  Class Y \
+    -instmixin X
+
+  Y create y -test
+  X create x -test
+
+

Here the application as a superclass (for x) yields the same +result as the application as an instmixin (for y): +

+  ::X11 
+  ::X12 
+  ::X
+
+

Precedence Order +

+ +

The precedence order is composed by the precedence order of the +superclass hierarchy (as explained earlier) and the message +interceptors. In general, filters precede mixins and the superclass +hierarchy. They are applied in the order of the next path of the +object. Thus per-object filters are ordered before per-class +filters.

+ +

Mixins are processed after the filters. Again, they are applied in +the order of the next path of the object. Thus per-object mixins are +ordered before per-class mixins.

+ +

Finally, the object's own heritage order comes in the order: object, +class, superclasses.

+ +

The three precedence order lists (filters, mixins, and classes) are +pre-calculated and cached.

+ +

Filters as well as classes (mixins and ordinary classes) are +linearized. That means, each filter and each class can be only once on +a precedence order list. If a filter or class can be reached more than +once, than the last occurrence is used.

+ +

For instance, consider a class A is superclass, per-class mixin, +and per-object mixin. On the precedence order lists only the last +occurrence as a superclass is used after linearization.

+ + +

Guards for Filters and Mixins +

+ +Message interceptors, such as filters and mixins, are applied for +potentially huge number of messages. In many cases it is possible to +reduce the effective number of cases in which interceptors are +applied. Interceptor guards offer this functionality: they are boolean +conditions with which you can specify in which cases a registered +interceptor should be applied. + +

Filter Guards

+

+A filter guard is a set of conditions that determine whether a filter +is to be executed upon a certain invocation or not. Syntactically we can +append a filter guard to the filter registration, or it can be +registered using the methods filterguard for filters and +instfilterguard for instfilters. + +

Each filter guard is an ordinary condition. A filter guard is +executed in the call frame of the filter to be executed, if the filter +guard returns 1. Thus, the call-stack information are already set to +the values of the targeted filter - and these values can be used in +the filter guard. + +

+Let us consider a simple program: +

+
+Class Room
+Room instproc enter {name} {puts [self proc]}
+Room instproc leave {name} {puts [self proc]}
+Room instproc loggingFilter args {
+    puts [self calledproc]
+    next
+}
+Room instfilter loggingFilter
+
+ +

+Now consider we only want to apply the logging filter for enter and +leave, not for any other message sent to Room instances. In the +following example, for instance, we do not want to log the set +message: +

+ +
+Room r 
+r enter Uwe
+r leave Uwe
+r set roomName "Office"
+
+ +

+In this example a filterguard can be applied to restrict the +application of the filter to those two methods: +

+ +
+Room instfilterguard loggingFilter {
+  [self calledproc] == "enter" || 
+  [self calledproc] == "leave"}
+
+ +

+Here we limit the filter application of the logging filter on rooms to +calls to enter and leave. All other calls are not filtered at +all. Note that the same syntax can also be applied for +filterguard. Also, there is a short form to register filter +guards directly during filter registration. The following code has the +same semantics as the filter and filter guard definitions above: +

+ +
+Room instfilter {{loggingFilter -guard {
+    [self calledproc] == "enter" || 
+    [self calledproc] == "leave"}}}
+

+ +The filter guard language construct is registration centric. It only +applies for the class or object on which a filter is registered, not +for all applications of the filter method. That is, if we use +loggingFilter on another class we may give no or completely +different filter guards. +

+If no filter guard is given for a filter, we assume that it is to be +applied on all methods (equivalent to the filter guard '1' which is +always true). +

+ +

+There are introspection options for filter guards. In particular, we +can use info filterguard and info instfilterguard +for getting the filter guards for a particular filter or instfilter +respectively. For instance: +

+
+puts [Room info instfilterguard loggingFilter]
+

+This prints out the content of the above guard definition. +We can also append -guard to info filter or +info instfilter to obtain a filter definition with guards: +

+
+puts [Room info instfilter -guards]
+

+ +

+If we call a method from within a filter guard, as for instance +callsMethod, we might require some parameters from the guard's +context, such as calledproc. These parameters can be passed +as references, as in the following example: +

+ +
+  Room instfilter loggingFilter
+  Room instfilterguard loggingFilter {[my callsMethod openURL [self calledproc]]}
+

+This example works because the filterguard is already set to the scope of the guard. Now we can use this dynamic calledproc context in the called method: +

+
+  Room instproc callsMethod {method calledproc} {
+    return[string match $calledproc $method]
+  }
+

+We simply check whether the called method +matches the given method name or not. + +

Mixin Guards

+

+Similar to filters, there are mixin guards, defined with +mixinguard and instmixinguard, or with +-guard during mixin registration. Consider a simple example: +there are a number of birds who have two mixins: Fly and Sing. For Fly +there are limitations: a bird can only fly if it is at least two years +old and is not a Penguin. Such problems are be solved with +mixin guards: +

+ +
+  Class Fly
+  Fly instproc fly {} {puts "[my signature]: yippee, fly like an eagle!"}
+
+  Class Sing
+  Sing instproc sing {} {puts "[my signature]: what a difference a day makes"}
+
+  Class Animal -parameter age
+  Animal instproc unknown args { puts "[my signature]: how should I $args?"}
+  Animal instproc signature {} {
+    return "[self] [my info class] ([my age] years)"
+  }
+
+  Class Bird -superclass Animal
+  Class Penguine -superclass Bird
+  Class Parrot -superclass Bird
+  Class Duck -superclass Bird
+
+  Parrot tweedy -age 1
+  Penguine pingo -age 5
+  Duck donald -age 4
+  Parrot lora -age 6
+
+  Bird instmixin {{Fly -guard {[my age] > 2 && ![my istype Penguine]}} Sing}
+

+An invocation like: +

+ +
+foreach bird {tweedy pingo donald lora} { $bird fly }
+

+yields the following result: +

+
+::tweedy ::Parrot (1 years): how should I fly?
+::pingo ::Penguine (5 years): how should I fly?
+::donald ::Duck (4 years): yippee, fly like an eagle!
+::lora ::Parrot (6 years): yippee, fly like an eagle!
+
+ +

+There are similar introspection options for mixin guards as those for +filter guards. In particular, we can use info mixinguard and +info instmixinguard for getting the mixin guards for a +particular mixin or instmixin respectively. +

+ +

Querying, Setting, Altering Filter and Mixin Lists +

+ +The methods mixin, instmixin, filter and +instfilter are system slots +having the same query and update interface. +
    +
  • If one of those methods is called without argument, it returns the current +setting.
  • +
  • If it is called with one argument, the argument is used to +set the specified list as indicated in the above examples.
  • +
  • If these methods are called with more than one argument, the first argument +is used to specify the action. Possible values for the action are +set, get, add and delete. See below for +commonly used examples. +
+

+

+ + + + + + + + +
obj mixin same as: obj info mixin
obj mixin {C1 C2} same as: obj mixin assign {C1 C2}
obj mixin assign {C1 C2}sets the mixins for obj
obj mixin add C3 adds the mixin C3 on front of the mixin list
obj mixin add C3 end adds the mixin C3 at the end the mixin list
obj mixin add C3 3 adds the mixin C3 at the 3rd position
obj mixin delete ::C3removes the mixin C3 from the mixin list. +Use absolute class names. delete supports an optional flag -nocomplain that does not produce an error, when the specified class is not in the list. +
+
+

+

+Note, that the list of possible actions can be +extended by extending the class ::xotcl::Relations. +

+ +

+Querying Call-stack Information +

+

Since the presented interceptors are +normal XOTcl instprocs they can access all XOTcl introspection +abilities introduced so far. In instprocs all recent information is +accessible within their scope. But the interceptors are mechanisms, +which cover more then their sole scope. The meaningful usage of the +meta-programming abilities often requires to go further and to get +information from the caller's and the callee's scope (e.g for +delegation decisions). Therefore, we introduced rich call-stack +informations for the interceptors. Note, that these are also available +for ordinary methods, but the "called..." info options return empty +strings. +

+

All call-stack information are packed compactly into the +self primitive as additional options. Note, before XOTcl +version 0.84 these were implemented as a part of the info +method. They are part of the self command for conceptual +integrity: introspection options in info can be expected to +produce the same result, when they are not explicitly changed. In +contrast, all information provided by self are +call-stack dependent. +

+ +
+

Querying Call-stack Information via self

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
self activelevel + +

Returns the stack level from where the + current command was invoked from, or where the last next + was called (whatever is closer to the invocation). + If the current command was invoked from + an XOTcl method the absolute level is returned (e.g. #4) + which can be used in the uplevel or + upvar Tcl command or XOTcl method. If the current + command was not invoked from an XOTcl method, the value 1 + is returned. +

self calledproc + +

Returns the name of the method which was invoked in + the original call. +

self calledclass + +

Returns the name + of the class which presumably (if no dynamic class change occurs + afterwards) is invoked in + the original call. +

self callingclass + +

Returns the name of the class from which the + call was invoked (if one exists, otherwise an empty + string). +

self callinglevel + +

Returns the stack level from where the + current command was invoked from. In contrary to + activelevel next-calls are ignored in the + computation. If the current command was invoked from an + XOTcl method the absolute level is returned (e.g. #4) + which can be used in the uplevel or + upvar Tcl command or XOTcl method. If the current + command was not invoked from an XOTcl method, the value 1 is + returned. +

self callingproc + +

Returns the name of the method from which the + call was invoked (if one exists, otherwise an empty + string). +

self callingobject + +

Returns the name of the object from which the + call was invoked (if one exists, otherwise an empty + string). +

self filterreg + +

In a filter: returns the name + of the object/class on which the filter is registered. Returns either + 'objName filter filterName' or + 'className instfilter filterName'. +

self isnextcall + +

Return 1 if this method + was invoked via next, otherwise 0 +

self next + +

Return the + "next" method on the path as a string, i.e. the method which will be + called by [next]. +

+
+

+


+

Note, that three options with the prefix calling +represent the values of self, self proc, and self +class in the scope where the original call was invoked. In the +following section we will show a simple program in which all of the +info options have different values. + +


Filter Call-stack Information Example +

+

Now we discuss a simple example that shows that all filter +introspection options may have different values: +

+
+  Class InfoTrace
+  InfoTrace instproc infoTraceFilter args { 
+    puts "SELF:                [self]"
+    puts "SELF PROC:           [self proc]"
+    puts "SELF CLASS:          [self class]"
+    puts "INFO CLASS:          [my info class]"
+    puts "CALLED PROC:         [self calledproc]"
+    puts "CALLING PROC:        [self callingproc]"
+    puts "CALLING OBJECT:      [self callingobject]"
+    puts "CALLING CLASS:       [self callingclass]"
+    puts "REGISTRATION CLASS:  [self filterreg]"
+    puts "CALLING LEVEL:       [self callinglevel]"
+    puts "ACTIVE LEVEL:        [self activelevel]"
+    next
+  }
+
+  Class CallingObjectsClass
+  CallingObjectsClass callingObject
+
+  Class FilterRegClass -superclass InfoTrace
+  Class FilteredObjectsClass -superclass FilterRegClass 
+  FilteredObjectsClass  filteredObject 
+
+  CallingObjectsClass instproc callingProc args {
+     filteredObject set someVar 0
+  }    
+  FilterRegClass instfilter infoTraceFilter

+The invocation of callingObject callingProc produces the +following output: +

+
+  SELF:                ::filteredObject
+  SELF PROC:           infoTraceFilter
+  SELF CLASS:          ::InfoTrace
+  INFO CLASS:          ::FilteredObjectsClass
+  CALLED PROC:         set
+  CALLING PROC:        callingProc
+  CALLING OBJECT:      ::callingObject
+  CALLING CLASS:       ::CallingObjectsClass
+  REGISTRATION CLASS:  ::FilterRegClass instfilter infoTraceFilter
+  CALLING LEVEL:       #1
+  ACTIVE LEVEL:        #1

+The filter reports for self the value filteredObject, +since this is the object on which the set call is invoked; +infoTraceFilter is the method of the filter, and therefore, +the actual proc, while the actual class is InfoTrace, the +filter's class. The class of the actual object is +FilteredObjectsClass. +

+

The called procedure is set. While the program stays in a +XOTcl-instproc all calling-info-options are set, the calling +procedure is callingProc, the calling class is the class, +where the method is defined (namely CallingObjectsClass), +and the object from which the call invoked is callingObject. +

+

In this example, the calling level is equal to the active level, both +are #1. +

+ + + + + + + + +
+

Slots +

+
+
+ +

A slot is a meta-object that manages property-changes of objects. A +property is either an attribute or a role in an relation. In a +nutshell, a slot has among other attributes:

+ +
    +
  • a name (which it used to access it), +
  • a domain (object or class on which it can be used) , and +
  • can be multivalued or not. +
+ +

We distinguish between system slots (predefined slots + like class, superclass, mixin, + instmixin, filter, instfilter) and + attribute slots (e.g. attributes of classes).

+ +

System Slots

+

+System slots are predefined slots defining e.g. some relations +between classes, or between objects and classes. The predefined system slots +are: +

    + +
  • superclass: every class in XOTcl has one or more + superclasses. The name of this slot is superclass, the + domain is ::xotcl::Class, the slot is multivalued, since + one object might have multiple superclasses.

    + +

  • class: every object has a class; therefore, the domain + of the slot is ::xotcl::Class, the property is not multivalued.

    + +

  • mixin: every object in XOTcl can have one or more + mixin classes. The name of this slot is mixin, the domain + is ::xotcl::Object , the slot is multivalued.

    + +

  • instmixin: same as above, but the domain is + ::xotcl::Class.

    + +

  • filter, instfilter: similar to mixin + and instmixin. + +

The system slots were introduced earlier with their +semantics. Here we just point out, that they have all the same +interfaces for querying, setting, adding and removing of slot +values.

+ +

Every slot can be used set and query the property from its domain. +The syntax for setting values is +

+  object property newValue
+
+ and for getting its values is +
+   set x [object property]
+
+where property denotes the slot name. +Every multivalued slot provides the methods add and +delete. + +Here are a few examples for using the system slot mixin which we have introduced already in the section of the mixins +
+  Object o; Class M; Class N
+  o mixin ::M      ;# replacing the per-object mixins of o with M
+  o mixin reset ::M  ;# same as before
+  o mixin add ::N   ;# add N to the front of the mixin list
+  o mixin delete ::M ;# delete M from the mixin list
+  puts [o mixin]   ;# query the current mixin list
+
+ +Every system slot (e.g. superclass) has the exact same interface. + +

Attribute Slots

+ +

Attribute slots are used to manage the setting and querying of +instance variables. We define now a person with three attributes +name, salary and projects.

+ +
+  Class Person -slots {
+    Attribute name
+    Attribute salary -default 0
+    Attribute projects -default {} -multivalued true
+  }
+
+ +

These attributes might have a default value or they might be + multivalued. When an instance of class Person is created, the + slot names can be used for specifying values for the slots.

+ +
+  Person p1 -name "Joe"	
+
+ +

Object p1 has three instance variables, namely name, +salary and projects. Since slot projects is +multivalued, we can add a value to the list of values the add +subcommand.

+ +
+  Project project1 -name XOTcl \
+     -description "A highly flexible OO scripting language"
+
+  p1 projects add ::project1
+  p1 projects add some-other-value
+
+ +

The value of the instance variable project of Person +p1 is now the list {some-other-value ::project1}. +

+ +

Attribute slots are implemented via dynamic object aggregations +(see below), where the Class objects contain +the slot objects with the information like default etc. In order to +prevent name clashes between the slot objects and the methods of a +class (like e.g. create), an intermediary object named +slot is used as a container of the slot objects. In the example above +we create an object structure of the following form:

+
+  Person
+  Person slot name
+  Person slot salary
+  Person slot projects
+
+ +

This object structure can be used to to query and modify the slot +properties or to add additional methods to the slot objects. One +application is for example to used slot-specific methods for checking +slot values, as shown in the next section. + +

+  Person info vars  ;# results in the list of variables of ::Person
+  Person slot name info vars ;# list of variables of the slot object ::Person::slot::name
+
+Since slot objects are ordinary XOTcl objects, they can have their own slots as well (such as default, name etc.). + +The following example +sets and queries the default of the slot name of Person: +

+ +
+  Person slot name default "gustaf"
+  ? {Person slot name default} gustaf
+
+ +

However, due to the current implementation, it is necessary to +re-init the slot object when the slot properties (such as +e.g. default) are changed. This can be achieved by calling +the method init of the slot object. +

+ +

Note that a statement for creating a slot object like

+
+  ... {
+    Attribute name
+    ...
+  }
+
+

is a short hand notation for

+
+  ... {
+    Attribute create name
+    ...
+  }
+
+

This is exactly the same situation like every where else in XOTcl, +when an object/class is created. One has to use create explicitly, +when a name of a slot object conflicts with a method of the class +(e.g. one has to use "Attribute create class" if a slot named +class is created).

+ +

One cannot define on a meta-class an attribute named slot +or slots and use then "... MetaClass Foo -slots { +::xotcl::Attribute x}... to create the slot objects. To handle +this naming conflict, one has to create the slot objects outside of the +aggregation and to provide the values for the properties of Attribute +(domain, manager, .... ) by hand.

+ + +

Setter and Getter Methods for Slots

+ +

When a slot is called via its name, the call is delegated to the +slot object. Per default, the slot value is read via the get +method of the slot and it is set the assign method. By +redefining these methods, it is possible to provide custom setter and +getter methods. The following example redefines the setter methods +assign to check, whether an attribute value is within the +range between 1 and 99.

+ +
+  Class create A -slots {
+    Attribute foo -default 1 -proc assign {domain var value} {
+      if {$value < 0 || $value > 99} {
+        error "$value is not in the range of 0 .. 99"
+      }  
+      $domain set $var $value
+    }
+  }
+
+  A create a1
+  ? {a1 foo 10} 10
+  ? {a1 foo} 10
+  ? {catch {a1 foo -1}} 1
+
+ +

For the most common simple cases with single valued attributes, +where neither setter or getter are redefined, XOTcl optimizes the slot +access function and replaces the delegation to the slot object by the +the C-level implementation of instparametercmd. + +

Note that it is possible to subclass Attribute (e.g. in +order to store more properties for attributes, like when attributes +are stored in a relational database) or to register mixin-classes or +filters.

+ + +

Backward-compatible Short-Hand Notation +for Attribute Slots

+ +

XOTcl provides a short-hand notation for creating attribute slots, +which is backward compatible for the most important options of XOTcl +verison prior to 1.5.0. Instead of writing

+ +
+  Class Car -slots {
+    Attribute owner
+    Attribute doors -default 4
+  }
+
+

one can use as well

+
+  Class Car -parameter {
+    owner
+    {doors 4}
+  }
+
+

The various features of the prior implementation of parameter are +deprecated and will be removed in future versions. +

+ +

Experimental Slot Features

+

Value Checking

+ +

Attribute slots can have types assigned which are tested whenever +the instance variable is altered. The slot salary is defined +as integer whereas projects is defined to be a list of +instances of the class ::Project (a list of instances, since +projects is defined as multivalued).

+ +
+  Class Person -slots {
+    Attribute name
+    Attribute salary -default 0 -type integer
+    Attribute projects -default {} -multivalued true -type ::Project
+    ...
+  }
+
+  Person p2 -name "Sue"	-salary 1000
+
+ +

It is as well possible to define custom value checkers and to +normalize the input values. We extend the previous example and define +"my sex" as value for type. If the value checker +consists of multiple words, the type check compiler assumes that the +value is a Tcl command, to which the actual value is appended as +additional argument before invocation. my refers to the +slot object. In the example below, we define for the slot object an +object specific method that returns 1 or 0 depending on the success of the +check. This method (a) checks the values via switch +and (b) normalizes and resets the value via uplevel. +

+ +
+  Class Person -slots {
+    ...
+    Attribute sex -type "my sex" -proc sex {value} {
+      switch -glob $value {
+        m* {my uplevel {$obj set $var m}; return 1}
+        f* {my uplevel {$obj set $var f}; return 1}
+        default {return 0}
+      }
+    }
+  }
+
+ + +

The slot values are actually checked via Tcl variable traces whenever the +associated variable gets a new value assigned. This means that the values are +enforced now matter how the variables are set. Therefore, the +checks are performed in the following two commands as well, although +the slot values are not accessed via the slot names. The checks will +throw an error in the second command, since 1100x is not an +integer.

+ +
+  p2 incr salary 100
+  p2 append salary x
+
+ +

Similarly the second command below will throw an error, since +some-other-value is not an instance of ::Project. + +

+  p2 projects add ::project1
+  p2 projects add some-other-value     
+
+ +

When a check throws an error, the instance variables + are reset to the previous value. To restore the original + value, an associative array __oldvalue() is kept as + instance variable in the object. +

+ +

In general, checking of variables can be turned off globally + by +

+  ::xotcl::Slot instmixin add ::xotcl::Slot::Nocheck
+
+

+ This mixin replaces the methods check and + checkall as well as mk_type_checker by + no-ops. When the mixin is active and the Attribute definitions + are loaded, the specified type has no effect. +

+

+ Value checking can be turned off also selectively for each slot via + using ::xotcl::Slot::Nocheck as per-object-mixin; if + attributes are subclassed, + it is possible to register the Nocheck mixin on a + subclass of Attribute. +

+ +

Init Commands and Value Commands for Slot Values

+ +

An init command (initcmd) of a slot is similar to a +default and is a command to be executed when the value of the +associated variable is read the first time. That means that when an +object is created the associated variable has no value. On the +contrary, when a default is used, the variable is set to the default +value, when the object is created.

+ +The primary advantage of slot init commands is Lacy +initialization: When an object has many slots and the +initialization of all slots is costly (e.g. the value of each slot is +fetched from a relational database), and not all of the values are +needed for each instance, only the relevant variables of the object +are initialized on demand. + +
+  Class C -slots {
+    Attribute x -initcmd {puts {init}; set _ 101}
+  }
+
+  C c1
+  c1 info vars  ;# ==> returns ""
+  c1 set  x     ;# ==> puts init, returns 101
+  c1 info vars  ;# ==> returns "x"
+

+
+ +

The initcmd is executed only once, when the variable is read the first +time. For later reads of the variable contents, the values are returned. + +

A value command (valuecmd) of a slot is similar to a a +init command, except that it is executed whenever the value of the +variable is read. A value command can be used e.g. to implement live +updates for variables or for abstracting from sql sequences or the +like.

+ +

Finally the value changed command (valuechangedcmd) can be +used to specify the behavior, whenever the value of the variable is +altered. This option is used to implement the value checking described +in the last section.

+ +

The slot parameters default, initcmd and +valuecmd have to be used mutually exclusively. +

+ + + + + + + + + + +
+

Nested Classes + and Dynamic Object Aggregations +

+
+
+

Most object-oriented analysis and design methods are based on the +concepts of generalization and aggregation. Generalization is +achieved through class hierarchies and inheritance, while static +aggregation is provided through embedding. Since version 8.0 Tcl +offers a namespace concept which can be used as a mechanism to +provide dynamic aggregations. +

+

A namespace provides an encapsulation of variable and +procedure names in order to prevent unwanted name collisions with +other system components. Each namespace has a unique identifier which +becomes part of the fully qualified variable and procedure names. +Namespaces are therefore already object-based in the terminology of +Wegner. OTcl is object-oriented since it offers classes and class +inheritance. Its objects are also namespaces, but an object is more +than only a namespace. Therefore, two incompatible namespace concepts +have existed in OTcl in parallel. +

+

In XOTcl every object and every class is +logically implemented as a separate Tcl namespace. The biggest benefit of this +design decision aside from performance advantages is the ability to +aggregate objects and nest classes. Contrary in OTcl every object has +a global identifier. Through the introspection abilities of +namespaces nested classes are also traceable at runtime and can be +changed dynamically. In XOTcl objects are allowed to contain nested +objects, which are dynamically changeable aggregates of the +containing object. +

+ + +

Nested Classes

+ +

The notation for nested classes follows the syntax of Tcl +namespaces by using ``::'' as a delimiter. For example the +description of a oval carpet and a desk can nest inside of the +OvalOffice class: +

+
+  Class OvalOffice
+  # general carpet
+  Class Carpet
+  Class OvalOffice::Desk
+  # special oval carpet - no name collision
+  Class OvalOffice::Carpet -superclass ::Carpet
+

+Nested classes can be used exactly like ordinary classes, a user can +sub-class it, derive instances, etc. The information about the +nesting structure of classes is available through the info +instance method: +

+
+  className info classchildren ?pattern?
+  className info classparent
+

+The classchildren option returns a list of children, if one +or more exist, otherwise it returns an empty string. classparent +results in the name of the parent class, if the class is nested. +Since nested classes are realized through namespaces, all +functionality offered by Tcl's namespace command is usable +from XOTcl as well. +

+

Dynamic Object Aggregations

+ +

The nested classes only provide an aggregation of the descriptive +not of the runtime properties of an object. We have pointed out the +difference of object and class in XOTcl. Because of the splitting of a +class into class and class-object it is possible to give each object +its own namespace. The internal implementation of objects enable them +to contain nested objects, which are aggregates of the containing +object. In XOTcl these can be changed dynamically and introspected +through the language support of dynamic object aggregations [Neumann and Zdun 2000b]. Suppose an +object of the class Agent should aggregate some property +objects of an agent, such as head and body: +

+
+  ClassAgent
+  Agent myAgent
+
+  Class Agent::Head
+  Class Agent::Body
+
+  Agent::Head ::myAgent::myHead
+  Agent::Body ::myAgent::myBody
+

+Now the objects myHead and myBody are part of the +myAgent object and they are accessible through a +qualification using ``::'' (or through Tcl's namespace command). But +in the common case they will be accessed, as introduced so far: the +explicit full qualification is not necessary when such variables are +being accessed from within XOTcl methods, since the object changes to +its namespace. +

+

The information about the part-of relationship of objects can be +obtained exactly the same way as for classes through the +info interface: +

+
+  objName info children ?pattern?
+  objName info parent
+
+ +

Relationship between Class Nesting and Object Aggregation

+ +

The classes Head and Body are children of the +Agent class. It is likely that all agents, interactive or +not, have properties for head and body. This implies a static or +predetermined relationship between class nesting and object +aggregation. Such predetermination do not exist in XOTcl, but are +simply build, when specifying the relationship in the constructor, +e.g.: +

+
+  Agent instproc init args {
+    ::Agent::Head [self]::myHead
+    ::Agent::Body [self]::myBody
+  }
+

+Now all agents derived from the class have the two property objects +aggregated after creation. But still they are changeable in a +dynamical manner, e.g. with: +

+
+  Agent myAgent
+  myAgent::myHead destroy
+

+The agent turns into a headless agent. In companion of the +introspection mechanisms such constructions could be very useful. +Suppose, that in the virtual world the agents heads may be slashed +from their bodies. The graphical system simply needs to ask with info +children on the agent's object, whether it has a head or not and +can choose the appropriate graphical representation. +

+ +

Simplified Syntax for Creating Nested Object Structures

+ +To ease the generation of nested structures, one can use the +predefined method contains. In essence, contains +changes the namespace, where objects are created to the object, +on which it is executed. In the example below, we create three +nested rectangles, where two of these contain two more points. +The outer rectangle is r0 containing rectangle r1 +and r2. + +
+  Class Point -parameter {{x 100} {y 300}}
+  Class Rectangle -parameter {color}
+
+  Rectangle r0 -color pink -contains {
+    Rectangle r1 -color red -contains {
+      Point x1 -x 1 -y 2
+      Point x2 -x 1 -y 2
+    }
+    Rectangle r2 -color green -contains {
+      Point x1
+      Point x2
+    }
+  }
+
+  ? {r0 color} pink
+  ? {r0 r1 color} red
+  ? {r0 r1 x1 x} 1
+  ? {r0 r1 x2 y} 2
+  ? {r0 r2 color} green
+
+ +

Every object in XOTcl is realized as a Tcl command. If nested +objects are created, these commands are available as object specific +methods. So, instead of calling the contained rectangle r1 via the +fully qualfied name ::r0::r1, one can use r0 +r1. This is exactly the same situation as it arises, when e.g. a +global Tcl proc proc o1 {} {...} and an XOTcl object o1 +(created via Object o1) is created. Both commands cannot +coexist in the same namespace. + +

+ +

Copy/Move

+ +Often an object has to be copied/moved. This is a very useful +functionality when XOTcl should be used as a prototyping language. +The XOTcl method move provides this functionality. Another +common behavior is implemented by the copy method which +clones the actual object to a destination object via a deep copy operation. +The two methods have the syntax: + +
+  objName move destination
+  objName copy destination
+

+ +Copy and move operations work with all object/class information, i.e., +information on filters, mixins, parameters, etc. are +automatically copied. Copy and move are integrated with class nesting +and object aggregations. All copy/move operations are deep copy +operations: all nested objects/classes are automatically copied/moved, +too. + +E.g. if we want to reuse an imperial march object of star wars for +star wars 2, we can just copy the object: +

+  starWars::imperialMarch copy starWars2::imperialMarch
+
+ +Note that move is implemented in current versions of xotcl +as a copy plus subsequent destroy operation. +

+ + + + + + + + + + + + + +
+

Method Forwarding +

+
+
+

As you have seen from many previous examples, XOTcl's primary command for +method forwarding is the next primitive. next calls +the same-named method of the current object, usually with the same +argument list. However, frequently method forwarding is required +between different objects as well, commonly referred to as +delegation.

+ +

In general, delegation can be achieved in XOTcl without any special construct +using simple methods containing a few lines. However, In +several situations, forwarding is as well needed to plain +Tcl commands, for example, if object oriented stubs are implemented on +base of non-oo function calls. These functions might access instance +variables of the objects. XOTcl uses this functionality in various +situations, such as for instance in the implementation of the +set, unset, append, array methods among others.

+ +

The fowarding functionality is suppored by XOTcl be the methods +forward and instforward that address these requirements +and provide an efficient implementation for these tasks.

+ +

The forwarding command specifies that whenever methodName is called, +this invocation is delegated to callee, where the actual argument list +(from the invocation) is appended to the argument list specified in the forwarding command. +Like for procs and instprocs, we can distinguish between forward and +instforward, depending on we want to the method available for a single object +of for the instances of a class.

+ +

The general form of the forwarding commands is: +

+  obj  forward methodName ?options? callee ?arglist? 
+  cls  instforward methodName ?options? callee ?arglist? 
+
+ +where valid options are -objscope, -methodprefix, +-earlybinding and -default. The option +-objscope is used to specify that the command should be +executed in the scope of the calling object (i.e. instance variables apprear +as local varibales), -methodprefix means that the called +method should be prefixed with the specified string (to avoid name +clashes), -earlybinding means that the function pointer of +the specified command (callee) is take at invocation time (should only +be done for (builtin) commands inplemented in C), and +-default provides a means for providing default methods when +none are specifed.

+ +

Each of the arguments after the method name (including +callee) can be be substituted an invocation time, or they are +taken literally. The arguments to be substituted are starting always +with a percent sign. These arguemnts can be %self, +%proc, %1, %argclindex, or % +followed by a Tcl command, and it can be prefixed with a positional +prefix %@. We will introduce the usage of these options and +argument substitutions based on examples.

+ +

In our first example we define an object dog and an object +tail. If the dog receives the call wag it +delegates this call to the tail and returns its result. In +this introductory example, the method tail simply returns its +arguments.

+ +

In this example, forwarding is achieved through the method +forward that creates a forwarder command. This method +receives as first argument the name, under which the forwarder is +registered, followed by the object that receives the delegation (the +"callee"), followed my the (optional) method name and optional +arguments. More about this later. Here we register the forwarder under +the name wag, the callee is tail, and the method is +defined to have the name of the forwarder. We could have written here +dog forward wag tail wag as well, be we use %proc +which refers to the name of the forwarder. Using %proc is +slightly more general in cases the forwarder is renamed. +

+ +
+  ###########################################
+  # trivial object delegation
+  ###########################################
+  Object dog
+  Object tail
+  tail proc wag args { return $args }
+  dog forward wag tail %proc
+
+ +

With these definitions a call to "dog wag 100" calls +actually "tail wag 100" which returns the result of +100.

+ +

The following command shows the delegation to a Tcl command +(instead of delegation to an object). We define a simple forwarder +that forwards a call to the Tcl command expr with some +arguments.

+ +
+  ###########################################
+  # adding 
+  ###########################################
+  Object obj
+  obj forward addOne expr 1 +
+
+The invocation obj addOne 5 returns 6 as value.

+ + +

In our next example we want additionally that the Tcl command +should to be evaluated in the context of the current object. This +means that the method can easily access instance variables of the +delegating object. We define a forwarder for the class X with +the name Incr (to avoid confusion with the already defined +method incr), we use the -objscope option and +specify incr as the callee. Since the forwarder is defined +via instforward the forwarder is available to all instances +of the class. +

+  ###########################################
+  # evaluating in scope 
+  ###########################################
+  Class X -parameter {{x 1}}
+  X instforward Incr -objscope incr
+  
+  X x1 -x 100
+  x1 Incr x
+  x1 Incr x
+  x1 Incr x
+
+After the three calls to Incr the call x1 x +returns the value 103.

+ +

In our next example, we show the usage of the +%-substitution more advanced argument handling. This example +sketches the implementation of the mixin add, mixin +set methods as shown above. In order to obtain extensible +subcommands (such as mixin add, mixin delete, etc.), we +define an object for which the subcommands are defined as methods. We +will use this object as callee for the appropriate methods. So, we +define an object named mixin and define a forwarder with the +name Mixin (again we capitalize Mixin to avoid name clashes +with the already defined methodmixin ). +

+  ###########################################
+  # mixin example
+  ###########################################
+  Object create mixin
+  mixin proc unknown {m args} {return [concat [self] $m $args]}
+  obj forward Mixin mixin %1 %self
+
+We define here the method unknown to see what arguments are +passed. The following invocation will lead to the call in noted in the comment. +
+  obj Mixin add M1       ;# calls ::mixin add ::obj M1
+
+You see that %1 was substituted by the first argument of the +invocation (here add) and %self was substituted by +the name of the current object (here ::obj). The second +argument of the invocation (here M1) was appended as +usual. However, in calls like +
+  obj Mixin
+
+we have to deal with cases, where the used argument (%1) is +not given at the invocation. In this case we get either an +error message, or we can specify a default argument via the +option -default: +
+  obj forward Mixin -default {getter setter} mixin %1 %self
+
+This definition means that if no argument is specified in the +invocation we call the method getter, if one argument is +given the method setter, in other cases we use the specified +arguments. Therefore the following three invocations are delegated as +indicated in the comments. +
+  obj Mixin              ;# calls ::mixin getter ::obj
+  obj Mixin M1           ;# calls ::mixin setter ::obj M1
+  obj Mixin add M1       ;# calls ::mixin add ::obj M1
+
+ +

When we implement subcommands by delegating to other commands +(as shown in the last example), there can be situations where naming +conflicts might arise. For example, if we want to implement a +subcommand method class we might not want to implement a new +method class on the callee, since this would overwrite the +standard definition of class. To overcome such difficulties, +we provide the option -methodprefix. The following example +shows how to prefix every called method with the prefix @. +

+
+  ###########################################
+  # sketching extensible info
+  ###########################################
+  Object Info
+  Info proc @mixin {o} {
+    $o info mixin
+  }
+  Info proc @class {o} { ;# without prefix, doing here a [Info class] would be wrong
+    $o info class
+  }
+  Info proc @help {o} { ;# define a new subcommand for info
+    foreach c [my info procs] {lappend result [string range $c 1 end]}
+    return $result
+  }
+  Object instforward Info -methodprefix @ Info %1 %self 
+
+With this definitions, the following call is rewritten as indicated in the comment. +
+  x1 Info class          ;# ::Info @class ::x1
+
+ +

When a forwarder is defined, the callee (the target command) can be +omitted. When the callee is not specified, the method-name is used +instead. When the method-name has a namespace prefix, the method name +is the tail and the callee is the fully qualified name. +

+
+  ###########################################
+  # optional callee
+  ###########################################
+  obj set x 2
+  obj forward append -objscope
+  Object n; Object n::x
+  obj forward ::n::x
+
+With this definitions of the forwarder append and x, +the following calls are rewritten as indicated in the comment. +
+  obj append x y z        ;# ::append x y z ... returning  2yz
+  obj x self              ;# ::n::x self    ... returning  ::n::x
+
+

The forwarder append forwards the call to the Tcl command +append, which accesses the instance variable x and +appends the specified values.

+ +

The list of tokens executed by the forwarder might +contain Tcl commands executed during every invocations. This makes it +for instance possible to pass instances variables to the callee. In +the next example the object has the instvar named x which is +multiplied by a factor of 10 when the method x* is invoked. +

+  ###########################################
+  # command substitution
+  ###########################################
+  obj set x 10
+  obj forward x* expr {%my set x} *
+
+With this definitions, the following call is rewritten as indicated in the comment. +
+  obj x* 10               ;# expr 10 * 10 ... returning  100
+
+ +

In certain situations it is necessary to insert arguments always at +the same position (e.g. at the second to last position). The +positional addressing can be achieved by prefixing the arguments of +the forward specification by %@POS , where POS is +either a positive (argument positing from the beginning) or negative +integer (argument counting from the end) or the constant end +(denoting the last position). After POS a single space is +used as a delimiter for the rest of the argument, which might be +some other %-substitution or a constant. The positional arguments +are evaluated from left to right and should be used in ascending order. +

+ +

The following examples show a few usages of the positional arguments +in the forwarder. The forwarders f1 to f5 are created, followed by +one or more usages. The first argument of the usage is the call to +to forewarder, the second argument is the result. +

+
+  ###########################################
+  # forwarding with positional arguments
+  ###########################################
+  Object obj
+  obj forward f1 list {%@end 13}
+  ? {obj f1 1 2 3 } [list 1 2 3 13]
+
+  obj forward f2 list {%@-1 13}
+  ? {obj f2 1 2 3 } [list 1 2 13 3]
+
+  obj forward f3 list {%@1 13}
+  ? {obj f3 1 2 3 } [list 13 1 2 3]
+  ? {obj f3} [list 13]
+
+  obj forward f4 list {%@2 13}
+  ? {obj f4 1 2 3 } [list 1 13 2 3]
+
+  obj forward f5 {%@end 99} {%@0 list} 10
+  ? {obj f5} [list 10 99]
+  ? {obj f5 a b c} [list 10 a b c 99]
+
+ +

The construct %argclindex LIST can be used to substitute an argument +depending on the number of arguments when the forwarder is +invoked. For example, it is possible to call forward to a different +method depending on how many arguments are specified. The number of arguments +is used as an index in the specified list. When the number of arguments is larger +than the number of elements in the specified list, an error is generated.

+ +
+  ###############################################
+  # substitution depending on number of arguments
+  ###############################################
+  obj forward f %self [list %argclindex [list a b c]]
+  obj proc a args {return [list [self proc] $args]}
+  obj proc b args {return [list [self proc] $args]}
+  obj proc c args {return [list [self proc] $args]}
+  ? {obj f} [list a {}]
+  ? {obj f 1 } [list b 1]
+  ? {obj f 1 2} [list c {1 2}]
+  ? {catch {obj f 1 2 3}} 1
+
+ +

Finally, the concluding example defines a class chan to use the +I/O-commands in an OO-manner. The proc open is used to create a +chan instance. For the channel object we provide the method +close (to close a channel and to destroy the channel object), +puts (to write on a stream), blocked (to check +whether last command exhausted all input), and fconfigure (to +configure the stream). Note that for puts we specified that +the actual stream should be inserted as the second to last argument. +

+
+  Class chan -parameter stream
+  # create stream and object
+  chan proc open args { 
+    set stream [eval open $args]
+    my create $stream -stream $stream  ;# make an object
+  }
+  # close stream and destroy object
+  chan instproc close {} {
+    close [my stream]
+    [self] destroy
+  }
+  # handle other subcommands (methods) via unknown
+  chan instproc unknown {m args} {
+    set valid [lsort [chan info instcommands]]
+    stderr puts "unknown chan method '$m' $args called; 
+      	defined methods: $valid"
+  }
+  chan create stdout -stream stdout   ;# define standard stream
+  chan create stderr -stream stderr   ;# define standard stream
+
+  chan instforward puts puts {%@-1 %my stream}
+  chan instforward blocked fblocked {%my stream}
+  chan instforward fconfigure fconfigure {%my stream} 
+
+  set c [chan open /tmp/junk w]
+  $c puts -nonewline "hello"
+  $c puts -nonewline " world"
+  $c puts ""
+  $c xxx                                       ;# trigger unknown
+  # The stream instances denote the currently open streams
+  stderr puts "currently open streams: [chan info instances]" 
+  $c close
+  stderr puts "currently open streams: [chan info instances]"
+
+ + + + + + + + + +
+

Assertions + +

+
+
+

In order to improve reliability and self documentation we added +assertions to XOTcl. The implemented assertions are modeled after the +``design by contract'' concept of Bertrand Meyer. In XOTcl assertions +can be specified in form of formal and informal pre- and +post-conditions for each method. The conditions are defined as a list +of and-combined constraints. The formal conditions have the form of +normal Tcl conditions, while the informal conditions are defined as +comments (specified with a starting ``#''). The lists +containing the pre- and post-conditions are appended to the method +definition (see example below). +

+

Since XOTcl offers per-object specialization it is desirable to +specify conditions within objects as well (this is different to the +concept of Meyer). Furthermore there may be conditions which must be +valid for the whole class or object at any visible state (that means +in every pre- and post-condition). These are called invariants and +may be defined with following syntax for class invariants: +

+
+  className instinvar invariantList
+

+or for objects invariants: +

+
+  objName invar invariantList
+

+Logically all invariants are appended to the pre- and post-conditions +with a logical ``and''. All assertions can be introspected. +

+

Since assertions are contracts they need not to be tested if one +can be sure that the contracts are fulfilled by the partners. But for +example when a component has changed or a new one is developed the +assertions could be checked on demand. For this purpose the check +method can be used either to test the pre- or the post-conditions. +The syntax is: +

+
+  objName check ?all? ?instinvar? ?invar? ?pre? ?post?
+

+Per default all options are turned off. check all turns all +assertion options for an object on, an arbitrary list (maybe empty) +can be used for the selection of certain options. Assertion options +are introspected by the info check option. The following +class is equipped with assertions: +

+
+  Class Sensor -parameter {{value 1}}
+  Sensor instinvar {
+    {[regexp {^[0-9]$} [my value]] == 1}
+  }
+  Sensor instproc incrValue {} {
+    my incr value
+  } {
+    {# pre-condition:} 
+    {[my value] > 0}
+  } {
+    {# post-condition:} 
+    {[my value] > 1}
+  }
+

+The parameter instance method defines an instance variable +value with value 1. The invariant expresses the +condition (using the Tcl command regexp), that the value +must be a single decimal digit. The method definition expresses the +formal contract between the class and its clients that the method +incrValue only gets input-states in which the value of the +variable value is positive. If this contract is fulfilled by +the client, the class commits itself to supply a post-condition where +the variable's value is larger than 1. The formal conditions are +ordinary Tcl conditions. If checking is turned on for sensor s: +

+
+  s check all
+

+the pre-conditions and invariants are tested at the beginning and the +post-condition and invariants are tested at the end of the method +execution automatically. A broken assertion, like calling incrValue +9 times (would break the invariant of being a single digit) results +in an error message. +

+

+In assertions we do not check methods that modify or introspect +assertions. These are +check,info,proc,instproc,invar, +and instinvar. The reason for this is that we want to be able +to recover a malicious action in a catch error handler, like: +

+
+  ...
+  if {[catch {my assertionBreakingAction} errMsg]} {
+    puts "CAUGHT ERROR: $errMsg"
+    # remember checking options, for turning them on later again
+    set check [my info check]
+    my check {}
+    # recover from broken assertion
+    ...
+    # turning checking on again 
+    $fb check $check
+  }
+
+ + + + + + + + +
+

Meta-Data +and Automatic Documentation + +

+
+
+

To enhance the understandability and the consistency between +documentation and program it is useful to have a facility to make the +documentation a part of the program. There are several kinds of +meta-data which are interesting for a class, e.g. the author, a +description, the version, etc. +

+

+Older versions of XOTcl have contained a special meta-data command +metadata. This command is now (from version 0.83) deprecated +and replaced by an integrated solution with XOTcl's API documentation +functionality. The object @ is used for documentation and +metadata issues. Per default it is not evaluated at all. Everything +that is send to @ is simply ignored. That way we do not waste +memory/performance at runtime, if we do not require to parse the +metadata/documentation. +

+

+If we have to know the meta-data/documentation, as for instance in the +xoDoc component and the makeDoc tool, that handle +XOTcl's internal documentation, we have to re-define the documentation +object. Alternatively, we can partially parse the source code for +@ commands. +

+

+With @ the meta-data/documentation is handled by first class +XOTcl objects. By defining alternate @ implementations - as in +xoDoc/makeDoc - we can evaluate the +meta-data/documentation arbitrarily. xoDoc/makeDoc +are only an HTML back-end, but the basic idea is to provide support for +several other usages as well (e.g. XML, RDF, on-line help, +documentation of dynamic structures, etc). +

+

+The object@ handles comments via its unknown +method. xoDoc adds the appropriate instprocs to t@ to produce HTML +output. The appropriate command is: +

+
+  tclsh src/lib/makeDoc.xotcl DOCDIR DOCFILES
+

+ +The source of a documentation is structurally very similar to the +XOTcl constructs being commented. E.g. one can copy an instproc and +add comments at the right places, like: +

+
+    Class C
+    C instproc m {a1 a2} {
+       return [expr {$a1+$a2}]
+    }
+

+ + can be commented as follows +

+
+    @ Class C { description { "my sample class"} }
+    @ C instproc m {a1 "first number" a2 "second number"} {
+       description "add two numbers"
+       return "sum of a1 and a2"
+    }
+

+

+ One can do essentially a copy+paste of the source and add the + comments via attribute value pairs. Every basic language construct + can have a "description". If you want to include other properties to + the description, you can add them like: +

+
+    @ C instproc m {a1 "first number" a2 "second number"} {
+       author "GN+UZ"
+       date "Feb 31"
+       description "add two numbers"
+       return "sum of a1 and a2"
+    }
+

+ + This way, author and date are added automatically to the generated + HTML file. + + In addition, there is a @File hook for a per file +description, like: +

+
+@ @File {
+  description {
+    This is a file which provides a regression test
+    for the features of the XOTcl - Language. 
+  }
+}
+

+ + + + + + +
+

Additional + Functionalities +

+
+
+

Abstract Classes +

+

In XOTcl a class is defined abstract if at least one method of +this class is abstract. The instance method abstract defines +an abstract method and specifies its interface. Direct calls to +abstract methods produce an error message. E.g. a Storage class +provides an abstract interface for access to different storage forms: +

+
+  Class Storage
+  Storage abstract instproc open  {name}       
+  Storage abstract instproc store {key value}
+  Storage abstract instproc list  {}         
+  Storage abstract instproc fetch key        
+  Storage abstract instproc close {}         
+  Storage abstract instproc delete {k} 
+

+All kinds of storage have to implement every method from the +interface. E.g. a GNU Database Access, a relational database access, +and several other storage forms may be derived by sub-classing +(therefore, all conform to the same storage access interface). +

+ +

Checking Commands for being Objects, +Classes, or Meta-Classes +

+

Since XOTcl is a hybrid language containing several Tcl commands, +sometimes its necessary for applications to distinguish between Tcl +commands and object commands for XOTcl. method of the +Object class looks up an objName and returns 1 if it +is an object and 0 if not: + +

+  objName1 isobject objName2
+

+ +If one can be sure that a command represents an +object, it might be unsure if the command is only an object or also +class or even meta-class. The two instance methods isclass +and ismetaclass check in the same manner, whether a class or +meta-class is given (since ever XOTcl class is an object, they also +return 0, when objName is not an XOTcl object). + +

+  objName1 isclass objName2
+  objName1 ismetaclass objName2
+
+ +

+Exit Handler +

+

A task for a programming language, sometimes of similar importance +as object creation, is the object destruction. XOTcl ensures that all +objects are destroyed and their destructors are invoked when XOTcl +applications terminate. For that reason objects and classes are +destroyed in the order objects, classes, meta-classes. Sometimes +further destruction order is of importance. For these cases, the XOTcl +language provides an exit handler, which is a user-defined proc, which +invokes user-defined exit handling just before the destruction of +objects, classes, meta-classes is invoked. For instance, the exit +handler lets the user specify objects which have to be destroyed +before all other objects. +

+

The exit handler is defined as a proc of Object, which is per default empty: +

+  ::xotcl::Object proc __exitHandler {} {
+    # clients should append exit handlers to this proc body
+    ;
+  }
+
+ +

There are some procs of the Object class pre-defined, +which let us specify an exit handler conveniently: +

+
+   Object setExitHandler body
+   Object getExitHandler
+   Object unsetExitHandler
+

+setExitHandler lets us specify +a proc body that actually contains the user-defined exit handling: +

+   Object setExitHandler {
+     aObj destroy
+     puts "exiting"
+   }
+

+destroys the object aObj before +all other objects and prints the message existing to the screen. With +getExitHandler the exit +handler can be introspected. E.g. if we just want to append the +destruction of object bObj to +an existing exit handler, we use getExitHandler: +

+
+   Object setExitHandler "[Object getExitHandler]; bObj destroy"
+
+

+unsetExitHandler deletes the exit handler. +

+
+
+

Automatic Name Creation +

+The XOTcl autoname +instance method provides an simple way to take the task of +automatically creating names out of the responsibility of the +programmer. The example below shows how to create on each invocation +of method new an agent with a fresh name +(prefixed with agent): +

+
+  Agent proc new args {
+    eval my [my autoname agent] $args
+  }
+
+

+Autonames may have format strings as in the Tcl 'format' command. +E.g.: +

+
+  objName autoname a%06d
+
+

+produces +

+  a000000, a000001, a000002, ...
+
+

+ + + + + + + + +
+

Integrating XOTcl Programs with C Extensions (such as TK) + +

+
+
+ +

Because all XOTcl commands are in the ::xotcl namespace, it is +usually no problem to integrate XOTcl with other Tcl extensions. Most +often it works to import the XOTcl commands (like Object, Class) into +the current namespace because there are no name-clashes with the +commands defined by other extensions.

+ +

Consider you want to perform a deeper integration of an other +extension and XOTcl because you want to benefit from XOTcl's object +system. For instance, you might want to introduce composite TK widgets +(sometimes called mega-widgets) as classes and inherit from these +classes. Here, you have two options: you can change or extend the C +code of that other extension to provide XOTcl classes or objects, or +you can write an XOTcl wrapper in Tcl. For the first alternative, +there are some examples provided in the XOTcl distribution. XOTclGdbm +provides an OO Tcl interface to the GDBM database, for +instance. XOTclSdbm does the same for SDBM, and the TclExpat wrapper +provides a class-based interface to the TclExpat XML parser.

+ +

Consider you do not want to change the C code of a Tcl +extension. Then you can write an OO wrapper in XOTcl for the commands +of the other extension. For stateless commands, you can simply write +forwarder methods. If the extension maintains some state, you +typically associate the state handle with an XOTcl parameter, acquire +the state in the XOTcl constructor, and align the XOTcl destructor +with the stateful instance.

+ +

Consider you want to wrap the Tk button widget. You can acquire the +widget in the constructor, and maintain the widget ID in a +parameter. You now can forward invocations to this widget ID +(e.g. when using "pack"), or register command callbacks (like +buttonPressed). Note that we let the "self" command be replaced in the +scope of the current method so that TK receives the correct object ID +for the callback. In the destructor we destroy the widget as well (we +use "catch" because sometimes widgets can destroyed by other means as +well (e.g. by their parent widget, when a widget/object hierarchy is +destroyed at once).

+ +
+  Class MyButton -parameter {button}
+  MyButton instproc buttonPressed args {
+    puts "pressed [my button]"
+  }
+  MyButton instproc init args {
+    set ID [namespace tail [self]]
+    my instvar button
+    set button [button .$ID \
+      -text "My Button $ID" \
+      -command [list [self] buttonPressed]] 
+    pack $button
+    next
+  }
+  MyButton instproc destroy args {
+     catch {destroy [my button]}
+     next
+  }
+
+  # a test -> 3 buttons, destroy one of them
+  foreach b {a b c} {
+    MyButton $b
+  }
+  b destroy
+
+ +

The "trick" to substitute "self" within the current method scope +works for all kinds of command callbacks. Extensions such as TK, +however, often work with bindings to (global) variables as well. Using +global variables is frowned upon in the OO community. Instead you +should use instance variables of objects. As Tcl can only bind to +existing namespace variables (and XOTcl acquires the namespace of an +object on demand), you have to make sure that the namespace of an +object exists before binding a variable. That can be done with +"requireNamespace":

+
+  GUIClass instproc buildEntry win {
+    my requireNamespace
+    entry $win -textvariable [self]::entryValue
+    my set entryValue {Init Value}
+  }
+
+ +

Note that in the above example we have used to tail of the object ID +as ID for the widget. Usually, it is a good idea to the object name, +if possible, for TK (and other extensions) IDs as well. Another option +is to use a autoname to get a unique name for the ID.

+ +

Sometimes you want to simply send all invocations, not implemented by +XOTcl, to the wrapped command. Here, it is tedious to write a wrapper +for each of these methods. Instead you can use "unknown" to handle +automatic forwarding. Consider you want to wrap TK commands like pack +and replace XOTcl object names with their TK widget ID, so that you can +use both IDs synonymously. You can rename the respective TK commands in +the following way: + +

+  foreach tkCommand {bell bind bindtags clipboard event 
+    focus font grid image lower option pack place raise 
+    selection send tk tkwait winfo wm} { 
+    rename ::$tkCommand __tk_$tkCommand
+    TkCommand ::$tkCommand
+    ::$tkCommand set wrapped __tk_$tkCommand
+  }
+
+ +

The XOTcl class handling the ID substitution for the TK command +might look as follows:

+ +
+  Class TkCommand -parameter wrapped
+  TkCommand instproc unknown args {
+      my instvar wrapped
+      set args [Widget replaceWithWidgetIDs $args]
+      # now call the command
+      eval $wrapped $args
+  }
+
+ +

+ + + + + + + + +
+

References + +

+
+
+ +

[Neumann and Zdun 1999a] +G. Neumann and U. Zdun. +Filters as a language support for design patterns in object-oriented + scripting languages. +In Proceedings of COOTS'99, 5th Conference on Object-Oriented + Technologies and Systems, San Diego, May 1999. + +

[Neumann and Zdun 1999b] +G. Neumann and U. Zdun. +Implementing object-specific design patterns using per-object mixins. +In Proc. of NOSA`99, Second Nordic Workshop on Software + Architecture, Ronneby, Sweden, August 1999. + +

[Neumann and Zdun 1999c] +G. Neumann and U. Zdun. +Enhancing object-based system composition through per-object mixins. +In Proceedings of Asia-Pacific Software Engineering Conference + (APSEC), Takamatsu, Japan, December 1999. + +

[Neumann and Zdun 2000a] +G. Neumann and U. Zdun. + XOTCL, an object-oriented scripting language. +In Proceedings of Tcl2k: The 7th USENIX Tcl/Tk Conference, + Austin, Texas, February 2000. + +

[Neumann and Zdun 2000b] +G. Neumann and U. Zdun. Towards the Usage of Dynamic Object + Aggregations as a Form of Composition +In: Proceedings of Symposium of Applied Computing (SAC'00), Como, Italy, Mar 19-21, 2000. + + +

[Ousterhout 1990] +J. K. Ousterhout. +Tcl: An embeddable command language. +In Proc. of the 1990 Winter USENIX Conference, January 1990. + +

[Ousterhout 1998] +J. K. Ousterhout. +Scripting: Higher Level Programming for the 21st Century, IEEE Computer 31(3), March 1998. + +

[Wetherall and Lindblad 1995] +D. Wetherall and C. J. Lindblad. Extending Tcl for Dynamic + Object-Oriented Programming. Proc. of the Tcl/Tk Workshop '95, July 1995. + + + + + + + + Index: doc/tutorial.pdf =================================================================== diff -u -N Binary files differ Index: doc/upvarcompat-xotcl.html =================================================================== diff -u -N --- doc/upvarcompat-xotcl.html (revision 0) +++ doc/upvarcompat-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,56 @@ + + + + + XOTcl - Documentation -- ./library/lib/upvarcompat.xotcl + + + +

+ ./library/lib/upvarcompat.xotcl + ./library/lib/upvarcompat.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::upvar-compat 1.0 +
+
+ Filename: + + ./library/lib/upvarcompat.xotcl + +
+
+ + + + + +
+ Description: + + + Provide a version of upvar and uplevel that provide + backward compatibility such that these commands + ignore inactive filter and mixin frames (upvar behaves + the same whether or not a filter is installed). Newer + scripts should use upvar/uplevel [self callinglevel] var/command + instead. + +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/webclient-xotcl.html =================================================================== diff -u -N --- doc/webclient-xotcl.html (revision 0) +++ doc/webclient-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,51 @@ + + + + + XOTcl - Documentation -- ./apps/comm/webclient.xotcl + + + +

+ ./apps/comm/webclient.xotcl + ./apps/comm/webclient.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+ Package required: xotcl::comm::httpAccess +
+
+ Filename: + + ./apps/comm/webclient.xotcl + +
+
+ + + + + +
+ Description: + + For a sample webclient, see packages/comm/xocomm.test +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/webserver-xotcl.html =================================================================== diff -u -N --- doc/webserver-xotcl.html (revision 0) +++ doc/webserver-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,181 @@ + + + + + XOTcl - Documentation -- ./apps/comm/webserver.xotcl + + + +

+ ./apps/comm/webserver.xotcl + ./apps/comm/webserver.xotcl

+
+

+

Package/File Information

+ Package required: XOTcl +
+ Package required: xotcl::comm::httpd +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./apps/comm/webserver.xotcl + +
+
+ + + + + +
+ Description: + + + This small demo program starts two different webservers: +
    +
  • Firstly, it provides a sample web server that povides the documents in + ../../src/doc (or the files specified with -root) at port 8086 + (or at the port specified via the -port option) as unprotected resources. +

    +

  • Secondly, it starts a second webserver with basic access control + (it accepts test/test as user/password) on port 9096 (or on the + port specified via -protected-port). If it receives an request + for an resource named "exit", it terminates. For all other requests + it returns actual information about the user and the issued request. +
+ To see, how it works, contact it e.g. from netscape. + +
+
+
+

+ + + +

Class: SpecializedWorker

+ Class: Class +
+ Procs/Instprocs: + respond. + + + + + +
+ Description: + + + Specialized worker that can be passed to any webserver + +
+

Instprocs

+
    +
  • + + + + respond + + + + + + +
    + Description: + + + This method handles all responses from the webserver to the client. + We implent here "exit", and we return the information about the actual + request and user in HTML format for all other requests. +

    This method is an example, how to access on the server side + request specific infomation. + +

    +
  • +
+

+
+

+ + + +

Object: h1

+ Class: Httpd +
+ + + + + + + +
+ Description: + + unprotected web server +
+

+
+

+ + + +

Object: h2

+ Class: Httpd +
+ + + + + + + +
+ Description: + + Web server with basic authentication using the specialied worker +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/xo-daemon.html =================================================================== diff -u -N --- doc/xo-daemon.html (revision 0) +++ doc/xo-daemon.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,98 @@ + + + + + XOTcl - Documentation -- ./apps/utils/xo-daemon + + + + +

+ ./apps/utils/xo-daemon + ./apps/utils/xo-daemon

+
+

+

Package/File Information

+ No package provided/required +
+
+ Filename: + + ./apps/utils/xo-daemon + +
+
+ + + + + + + + + + + + + +
+ Description: + + + This script can be used to start/stop/restart xotcl daemons + and maintains the process IDs, log files and means for easy + restart. +

+ It receives as first parameter the name of the xotcl script + to be executed followed by the desired action and optional + parameters. The specified action can be +

    +
  • start: the specified script is started in + the background, an entry to restart is generated in + the run-directory as well as the process id of the started + script. In addition a logfile is created in the log directory. + If the start of the script fails, the error messages are + shown. +
  • startall: all scripts that were started before + via this script, are started +
  • stop terminates te specified script. +
  • stopall terminates all scripts started via this + command +
  • restart tries to restart the specified script. +
+ The optional parameters are: +
    +
  • -logir specifies the directory for logging. + The default is ~/.xotcl/log. +
  • -rundir specifies the directory where + the information about the running processes is kept. + The default is ~/.xotcl/run. +
+ +
+ Authors: + + + Gustaf Neumann, Gustaf.Neumann@wu-wien.ac.at + +
+ Date: + + [::xotcl::rcs date {$Date: 2007/10/12 19:53:32 $}] +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/xo-whichPkg.html =================================================================== diff -u -N --- doc/xo-whichPkg.html (revision 0) +++ doc/xo-whichPkg.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,72 @@ + + + + + XOTcl - Documentation -- ./apps/utils/xo-whichPkg + + + + +

+ ./apps/utils/xo-whichPkg + ./apps/utils/xo-whichPkg

+
+

+

Package/File Information

+ No package provided/required +
+
+ Filename: + + ./apps/utils/xo-whichPkg + +
+
+ + + + + + + + + + + + + +
+ Description: + + + A small sample script to show which package is loaded from where + when a target package is loaded.

+ Usage: "xo-whichPkg -pkg PACKAGENAME" + +

+ Authors: + + + Fredj Dridi dridi@nestroy.wi-inf.uni-essen.de + +
+ Date: + + [::xotcl::rcs date {$Date: 2007/10/12 19:53:32 $}] +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/xocomm-test.html =================================================================== diff -u -N --- doc/xocomm-test.html (revision 0) +++ doc/xocomm-test.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,63 @@ + + + + + XOTcl - Documentation -- ../library/comm/xocomm.test + + + +

+ ../library/comm/xocomm.test + ../library/comm/xocomm.test

+
+

+

Package/File Information

+ Package required: XOTcl +
+ Package required: xotcl::comm::httpAccess +
+ Package required: xotcl::comm::ftp +
+ Package required: xotcl::trace +
+
+ Filename: + + ../library/comm/xocomm.test + +
+
+ + + + + +
+ Description: + + + This is a webclient used as a regression test. + When it is started it launches an xotcl-Web server as partner process. + It tests currently the basic functionality of: +
    +
  • GET and PUT requests +
  • Basic Access Control +
+ +
+
+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/xodoc-xotcl.html =================================================================== diff -u -N --- doc/xodoc-xotcl.html (revision 0) +++ doc/xodoc-xotcl.html (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,358 @@ + + + + + XOTcl - Documentation -- ./library/lib/xodoc.xotcl + + + +

+ ./library/lib/xodoc.xotcl + ./library/lib/xodoc.xotcl

+
+

+

Package/File Information

+ Package provided: xotcl::xodoc 0.84 +
+ Package required: xotcl::staticMetadataAnalyzer +
+ Package required: xotcl::htmllib +
+
+ Defined Objects/Classes: + +
+ Filename: + + ./library/lib/xodoc.xotcl + +
+
+ + + + + +
+ Description: + + + XOTcl documentation tool. Overloads the command @, which is used + as a documentation token. + +
+
+
+

+ + + +

Class: ConstraintTokenHTML

+ Class: Class +
+ Heritage: MetadataTokenHTML +
+ + + +
+

+
+

+ + + +

Class: FileTokenHTML

+ Class: Class +
+ Heritage: MetadataTokenHTML +
+ + + +
+

+
+

+ + + +

Class: MetadataTokenHTML

+ Class: Class +
+ Procs/Instprocs: + getDocPropertiesHTML, printHTML. + + + + + +
+ Description: + + Instmixin to provide HTML printing. Such instmixins + are registered for all token types. + +
+

Instprocs

+
    +
  • + + + + abstract + printHTML + + + + + + +
    + Description: + + Print token to HTML document object +
    +
  • +
  • + + + + getDocPropertiesHTML + + + + + + +
    + Description: + + + Returns list of properties as HTML. + +
    +
  • +
+

+
+

+ + + +

Class: MethodTokenHTML

+ Class: Class +
+ Heritage: MetadataTokenHTML +
+ + + +
+

+
+

+ + + +

Class: ObjTokenHTML

+ Class: Class +
+ Heritage: MetadataTokenHTML +
+ + + +
+

+
+

+ + + +

Class: XODoc

+ Class: Class +
+ Procs/Instprocs: + documentFileAsHTML, printHTML, writeFile. + + + + + +
+ Description: + + Handler class for building a documentation database +
+

Instprocs

+
    +
  • + + + + printHTML + name + + + + + + + + + + +
    + Arguments: + + name: name of the html document +
    + Description: + + Create HTML documentation object from metadata token +
    +
  • +
  • + + + + writeFile + filename + name + + + + + + + + + + + + + + +
    + Arguments: + + filename: file name destination +
    + + + name: name of the html document +
    + Description: + + Create HTML docuemntation from metadata token and write to file +
    +
  • +
+

Procs

+
    +
  • + + + + documentFileAsHTML + file + docdir + + + + + + + + + + + + + + + + + + +
    + Arguments: + + file: filename of the xotcl file to be documented +
    + + + docdir: directory to which the html file is written +
    + Description: + + Uses the xoDoc package to produce an HTML documentation of + a specified file ***.xotcl. The file is written to ***.html + in docdir +
    + Return: + + file basename without suffix +
    +
  • +
+

+
+

+
+

+

+ + Back to index page. + +
+
+

+

+ + + Index: doc/xotcl-doc.css =================================================================== diff -u -N --- doc/xotcl-doc.css (revision 0) +++ doc/xotcl-doc.css (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,48 @@ +BODY { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-weight: normal; + background-color : white; + color: black; +} +tt { + font-family: courier, monospace; +} +A { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-weight: 100; + background-color : white; +} +A em { + font-weight: 900; +} + +pre.code { + font-size: 90%; + font-family: courier, monospace; + PADDING-RIGHT: 10px; + PADDING-LEFT: 10px; + PADDING-BOTTOM: 10px; + PADDING-TOP: 10px; + BORDER: #cccccc 1px solid; + BACKGROUND-COLOR: #eeeeee; + MARGIN-BOTTOM: 15px; +} +pre em { + font-family: cursive; + color: #888888; +} +pre tt { + font-family: helvetica; + font-weight: 900; +} +pre it { + font-style: italic; + color: green; +} +tt em { + font-family: cursive; + color: #888888; +} +table { + font-size: 80%; +} Index: generic/aol-xotcl.tcl =================================================================== diff -u -N --- generic/aol-xotcl.tcl (revision 0) +++ generic/aol-xotcl.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,81 @@ +# $Id: aol-xotcl.tcl,v 1.15 2007/08/14 16:38:26 neumann Exp $ + +# +# Load XOTcl library and some related packages. +# We expect to find them somewhere in standard +# Tcl package search path (the auto_path var) +# The simplest location is to put them under +# the "lib" directory within the AOLserver tree. +# + +package require XOTcl; namespace import ::xotcl::* +package require xotcl::serializer +ns_log notice "XOTcl version $::xotcl::version$::xotcl::patchlevel loaded" + +# +# Overload procedure defined in bin/init.tcl. +# It is now XOTcl-savvy in how it treats some +# special namespaces. +# + +proc _ns_savenamespaces {} { + set script [_ns_getpackages] + set import "" + set nslist "" + _ns_getnamespaces namespaces + foreach n $namespaces { + if {[string match "::xotcl*" $n] == 0 + && ([catch {::xotcl::Object isobject $n} ret] || $ret == 0)} { + lappend nslist $n + } + } + foreach n $nslist { + foreach {ns_script ns_import} [_ns_getscript $n] { + append script [list namespace eval $n $ns_script] \n + if {$ns_import ne ""} { + append import [list namespace eval $n $ns_import] \n + } + } + } + if {[catch {::Serializer all} objects]} { + ns_log notice "XOTcl extension not loaded; will not copy objects\ + (error: $objects; $::errorInfo)." + set objects "" + } + ns_ictl save [append script \n \ + "namespace import -force ::xotcl::*" \n \ + $objects \n $import] + # just for debugging purposes + if {0} { + set f [open [::xotcl::tmpdir]/__aolserver-blueprint.tcl w] + puts $f $script + close $f + } +} + +# +# Source XOTcl files from shared/private library +# the way AOLserver does for plain Tcl files. +# + +proc _my_sourcefiles {shared private} { + set files "" + foreach file [lsort [glob -nocomplain -directory $shared *.xotcl]] { + if {[file exists [file join $private [file tail $file]]] == 0} { + lappend files $file + } + } + foreach file [lsort [glob -nocomplain -directory $private *.xotcl]] { + lappend files $file + } + foreach file $files { + _ns_sourcefile $file + } +} + +ns_eval { + _my_sourcefiles [ns_library shared] [ns_library private] +} + +# EOF $RCSfile: aol-xotcl.tcl,v $ + Index: generic/aolstub.c =================================================================== diff -u -N --- generic/aolstub.c (revision 0) +++ generic/aolstub.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,175 @@ +/* $Id: aolstub.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ + + This file provides the stubs needed for the AOL_SERVER, + Please note, that you have to have to apply a small patch + to the AOL server as well (available from www.xotcl.org) + in order to get it working. + + Authore: + Zoran Vasiljevic + Archiware Inc. + +*/ +#ifdef AOL_SERVER + + +#include "xotcl.h" +#include + +int Ns_ModuleVersion = 1; + +#if NS_MAJOR_VERSION>=4 +# define AOL4 +#endif + +/* + *---------------------------------------------------------------------------- + * + * NsXotcl_Init -- + * + * Loads the package for the first time, i.e. in the startup thread. + * + * Results: + * Standard Tcl result + * + * Side effects: + * Package initialized. Tcl commands created. + * + *---------------------------------------------------------------------------- + */ + + +static int +NsXotcl_Init (Tcl_Interp *interp, void *context) +{ + static int firsttime = 1; + int ret; + + ret = Xotcl_Init(interp); + + if (firsttime) { + if (ret != TCL_OK) { + Ns_Log(Warning, "can't load module %s: %s", (char *)context, + Tcl_GetStringResult(interp)); + } else { + Ns_Log(Notice, "%s module version %s%s", (char*)context, + XOTCLVERSION,XOTCLPATCHLEVEL); + /* + * Import the XOTcl namespace only for the shell after + * predefined is through + */ + Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), + "xotcl::*", 0); + } + firsttime = 0; + } + + return ret; +} + +/* + *---------------------------------------------------------------------------- + * + * NsXotcl_Init1 -- + * + * Loads the package in each thread-interpreter. + * This is needed since XOTcl Class/Object commands are not copied + * from the startup thread to the connection (or any other) thread. + * during AOLserver initialization and/or thread creation times. + * + * Why ? + * + * Simply because these two commands declare a delete callback which is + * unsafe to call in any other thread but in the one which created them. + * + * To understand this, you may need to get yourself acquainted with the + * mechanics of the AOLserver, more precisely, with the way Tcl interps + * are initialized (dive into nsd/tclinit.c in AOLserver distro). + * + * So, we made sure (by patching the AOLserver code) that no commands with + * delete callbacks declared, are ever copied from the startup thread. + * Additionaly, we also made sure that AOLserver properly invokes any + * AtCreate callbacks. So, instead of activating those callbacks *after* + * running the Tcl-initialization script (which is the standard behaviour) + * we activate them *before*. So we may get a chance to configure the + * interpreter correctly for any commands within the init script. + * + * Proper XOTcl usage would be to declare all resources (classes, objects) + * at server initialization time and let AOLserver machinery to copy them + * (or re-create them, better yet) in each new thread. + * Resources created within a thread are automatically garbage-collected + * on thread-exit time, so don't create any XOTcl resources there. + * Create them in the startup thread and they will automatically be copied + * for you. + * Look in /modules/tcl/xotcl for a simple example. + * + * Results: + * Standard Tcl result. + * + * Side effects: + * Tcl commands created. + * + *---------------------------------------------------------------------------- + */ + +static int +NsXotcl_Init1 (Tcl_Interp *interp, void *notUsed) +{ + int result; + +#ifndef AOL4 + result = Xotcl_Init(interp); +#else + result = TCL_OK; +#endif + + /* + * Import the XOTcl namespace only for the shell after + * predefined is through + */ + Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), "xotcl::*", 1); + + return result; +} + +/* + *---------------------------------------------------------------------------- + * + * Ns_ModuleInit -- + * + * Called by the AOLserver when loading shared object file. + * + * Results: + * Standard AOLserver result + * + * Side effects: + * Many. Depends on the package. + * + *---------------------------------------------------------------------------- + */ + +int +Ns_ModuleInit(char *hServer, char *hModule) +{ + int ret; + + /*Ns_Log(Notice, "+++ ModuleInit","INIT");*/ + ret = Ns_TclInitInterps(hServer, NsXotcl_Init, (void*)hModule); + + if (ret == TCL_OK) { + /* + * See discussion for NsXotcl_Init1 procedure. + * Note that you need to patch AOLserver for this to work! + * The patch basically forbids copying of C-level commands with + * declared delete callbacks. It also runs all AtCreate callbacks + * BEFORE AOLserver runs the Tcl script for initializing new interps. + * These callbacks are then responsible for setting up the stage + * for correct (XOTcl) extension startup (including copying any + * XOTcl resources (classes, objects) created in the startup thread. + */ + Ns_TclRegisterAtCreate((Ns_TclInterpInitProc *)NsXotcl_Init1, NULL); + } + + return ret == TCL_OK ? NS_OK : NS_ERROR; +} +#endif Index: generic/mk_predefined.xotcl =================================================================== diff -u -N --- generic/mk_predefined.xotcl (revision 0) +++ generic/mk_predefined.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,25 @@ +#!./xotclsh +# $Id: mk_predefined.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# A small script file that creates a static array from a tcl- +# script for inclusion in c programs -gn +set f [open predefined.xotcl] +set content [read $f] +close $f + +regsub -all {\\} $content && content +regsub -all {"} $content {\"} content ;#" +regsub -all "\[ \]+\n" $content \n content ;# remove trailing space +regsub -all "\n\[ \t\]+" $content \n content ;# remove leading space +regsub -all "\n#\[^\n\]*\n" $content \n content ;# remove comment lines +regsub -all "\n#\[^\n\]*\n" $content \n content ;# remove comment lines +regsub -all "\n#\[^\n\]*\n" $content \n content ;# remove comment lines +regsub -all "\n#\[^\n\]*\n" $content \n content ;# remove comment lines +regsub -all "\[\n\]+" $content \n content ;# remove empty lines +regsub -all "\n}" $content "}" content ;# newlines btwn braces +regsub -all "\n" $content "\\n\"\n\"" content + +puts "static char cmd\[\] = " +puts "\"$content\";" +puts "" + + Index: generic/predefined.h =================================================================== diff -u -N --- generic/predefined.h (revision 0) +++ generic/predefined.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,540 @@ +static char cmd[] = +"# $Id: predefined.h,v 1.17 2007/09/05 19:09:22 neumann Exp $\n" +"foreach cmd [info command ::xotcl::Object::instcmd::*] {\n" +"::xotcl::alias ::xotcl::Object [namespace tail $cmd] $cmd}\n" +"foreach cmd {array append eval incr lappend trace subst unset} {\n" +"::xotcl::alias ::xotcl::Object $cmd -objscope ::$cmd}\n" +"foreach cmd [info command ::xotcl::Class::instcmd::*] {\n" +"::xotcl::alias ::xotcl::Class [namespace tail $cmd] $cmd}\n" +"unset cmd\n" +"::xotcl::Object instproc init args {}\n" +"::xotcl::Object create ::xotcl::@\n" +"::xotcl::@ proc unknown args {}\n" +"proc ::xotcl::myproc {args} {linsert $args 0 [::xotcl::self]}\n" +"proc ::xotcl::myvar {var} {::xotcl::my requireNamespace; return [::xotcl::self]::$var}\n" +"namespace eval ::xotcl { namespace export @ myproc myvar Attribute}\n" +"::xotcl::setrelation ::xotcl::Class::Parameter superclass ::xotcl::Class\n" +"::xotcl::Class::Parameter instproc mkParameter {obj name args} {\n" +"if {[$obj exists $name]} {\n" +"eval [$obj set $name] configure $args} else {\n" +"$obj set $name [eval ::xotcl::my new -childof $obj $args]}}\n" +"::xotcl::Class::Parameter instproc getParameter {obj name args} {\n" +"[$obj set $name]}\n" +"::xotcl::Class::Parameter proc Class {param args} {\n" +"::xotcl::my set access [lindex $param 0]\n" +"::xotcl::my set setter mkParameter\n" +"::xotcl::my set getter getParameter\n" +"::xotcl::my set extra {[::xotcl::self]}\n" +"::xotcl::my set defaultParam [lrange $param 1 end]}\n" +"::xotcl::Class::Parameter proc default {val} {\n" +"[::xotcl::my set cl] set __defaults([::xotcl::my set name]) $val}\n" +"::xotcl::Class::Parameter proc setter x {\n" +"::xotcl::my set setter $x}\n" +"::xotcl::Class::Parameter proc getter x {\n" +"::xotcl::my set getter $x}\n" +"::xotcl::Class::Parameter proc access obj {\n" +"::xotcl::my set access $obj\n" +"::xotcl::my set extra \\[::xotcl::self\\]\n" +"foreach v [$obj info vars] {::xotcl::my set $v [$obj set $v]}}\n" +"::xotcl::Class::Parameter proc values {param args} {\n" +"set cl [::xotcl::my set cl]\n" +"set ci [$cl info instinvar]\n" +"set valueTest {}\n" +"foreach a $args {\n" +"::lappend valueTest \"\\[\\$cl set $param\\] == [list $a]\"}\n" +"::lappend ci [join $valueTest \" || \"]\n" +"$cl instinvar $ci}\n" +"::xotcl::Class create ::xotcl::MetaSlot\n" +"::xotcl::setrelation ::xotcl::MetaSlot superclass ::xotcl::Class\n" +"::xotcl::MetaSlot instproc new args {\n" +"set slotobject [self callingobject]::slot\n" +"if {![my isobject $slotobject]} {Object create $slotobject}\n" +"eval next -childof $slotobject $args}\n" +"::xotcl::MetaSlot create ::xotcl::Slot -array set __defaults {\n" +"name \"[namespace tail [::xotcl::self]]\"\n" +"domain \"[lindex [regexp -inline {^(.*)::slot::[^:]+$} [::xotcl::self]] 1]\"\n" +"defaultmethods {get assign}\n" +"manager \"[::xotcl::self]\"\n" +"multivalued false\n" +"per-object false}\n" +"foreach p {name domain defaultmethods manager default multivalued type\n" +"per-object initcmd valuecmd valuechangedcmd} {\n" +"::xotcl::Slot instparametercmd $p}\n" +"unset p\n" +"::xotcl::alias ::xotcl::Slot get ::xotcl::setinstvar\n" +"::xotcl::alias ::xotcl::Slot assign ::xotcl::setinstvar\n" +"::xotcl::Slot instproc add {obj prop value {pos 0}} {\n" +"if {![my multivalued]} {\n" +"error \"Property $prop of [my domain]->$obj ist not multivalued\"}\n" +"if {[$obj exists $prop]} {\n" +"$obj set $prop [linsert [$obj set $prop] $pos $value]} else {\n" +"$obj set $prop [list $value]}}\n" +"::xotcl::Slot instproc delete {-nocomplain:switch obj prop value} {\n" +"set old [$obj set $prop]\n" +"set p [lsearch -glob $old $value]\n" +"if {$p>-1} {$obj set $prop [lreplace $old $p $p]} else {\n" +"error \"$value is not a $prop of $obj (valid are: $old)\"}}\n" +"::xotcl::Slot instproc unknown {method args} {\n" +"set methods [list]\n" +"foreach m [my info methods] {\n" +"if {[::xotcl::Object info methods $m] ne \"\"} continue\n" +"if {[string match __* $m]} continue\n" +"lappend methods $m}\n" +"error \"Method '$method' unknown for slot [self]; valid are: {[lsort $methods]]}\"}\n" +"::xotcl::Slot instproc init {} {\n" +"my instvar name domain manager\n" +"set forwarder [expr {[my per-object] ? \"forward\" : \"instforward\"}]\n" +"if {$domain eq \"\"} {\n" +"set domain [self callingobject]}\n" +"$domain $forwarder $name -default [$manager defaultmethods] $manager %1 %self %proc}\n" +"::xotcl::MetaSlot create ::xotcl::InfoSlot -array set __defaults {\n" +"multivalued true}\n" +"::xotcl::setrelation ::xotcl::InfoSlot superclass ::xotcl::Slot\n" +"::xotcl::InfoSlot instproc get {obj prop} {$obj info $prop}\n" +"::xotcl::InfoSlot instproc add {obj prop value {pos 0}} {\n" +"if {![my multivalued]} {\n" +"error \"Property $prop of [my domain]->$obj ist not multivalued\"}\n" +"$obj $prop [linsert [$obj info $prop] $pos $value]}\n" +"::xotcl::InfoSlot instproc delete {-nocomplain:switch obj prop value} {\n" +"set old [$obj info $prop]\n" +"set p [lsearch -glob $old $value]\n" +"if {$p>-1} {$obj $prop [lreplace $old $p $p]} else {\n" +"error \"$value is not a $prop of $obj (valid are: $old)\"}}\n" +"::xotcl::MetaSlot create ::xotcl::InterceptorSlot\n" +"::xotcl::setrelation ::xotcl::InterceptorSlot superclass ::xotcl::InfoSlot\n" +"::xotcl::alias ::xotcl::InterceptorSlot set ::xotcl::setrelation ;# for backwards compatibility\n" +"::xotcl::alias ::xotcl::InterceptorSlot assign ::xotcl::setrelation\n" +"::xotcl::InterceptorSlot instproc add {obj prop value {pos 0}} {\n" +"if {![my multivalued]} {\n" +"error \"Property $prop of [my domain]->$obj ist not multivalued\"}\n" +"$obj $prop [linsert [$obj info $prop -guards] $pos $value]}\n" +"namespace eval ::xotcl::Class::slot {}\n" +"namespace eval ::xotcl::Object::slot {}\n" +"::xotcl::InfoSlot create ::xotcl::Class::slot::superclass\n" +"::xotcl::alias ::xotcl::Class::slot::superclass assign ::xotcl::setrelation\n" +"::xotcl::InfoSlot create ::xotcl::Object::slot::class\n" +"::xotcl::alias ::xotcl::Object::slot::class assign ::xotcl::setrelation\n" +"::xotcl::InterceptorSlot create ::xotcl::Object::slot::mixin\n" +"::xotcl::InterceptorSlot create ::xotcl::Object::slot::filter\n" +"::xotcl::InterceptorSlot create ::xotcl::Class::slot::instmixin\n" +"::xotcl::InterceptorSlot create ::xotcl::Class::slot::instfilter\n" +"::xotcl::MetaSlot create ::xotcl::Attribute -superclass ::xotcl::Slot\n" +"foreach p {default value_check initcmd valuecmd valuechangedcmd} {\n" +"::xotcl::Attribute instparametercmd $p}\n" +"unset p\n" +"::xotcl::Attribute array set __defaults {\n" +"value_check once}\n" +"::xotcl::Attribute instproc __default_from_cmd {obj cmd var sub op} {\n" +"$obj trace remove variable $var $op [list [self] [self proc] $obj $cmd]\n" +"$obj set $var [$obj eval $cmd]}\n" +"::xotcl::Attribute instproc __value_from_cmd {obj cmd var sub op} {\n" +"$obj set $var [$obj eval $cmd]}\n" +"::xotcl::Attribute instproc __value_changed_cmd {obj cmd var sub op} {\n" +"eval $cmd}\n" +"::xotcl::Attribute instproc destroy {} {\n" +"next}\n" +"::xotcl::Attribute instproc check_single_value {\n" +"{-keep_old_value:boolean true}\n" +"value predicate type obj var} {\n" +"if {![expr $predicate]} {\n" +"if {[$obj exists __oldvalue($var)]} {\n" +"$obj set $var [$obj set __oldvalue($var)]} else {\n" +"$obj unset -nocomplain $var}\n" +"error \"$value is not of type $type\"}\n" +"if {$keep_old_value} {$obj set __oldvalue($var) $value}}\n" +"::xotcl::Attribute instproc check_multiple_values {values predicate type obj var} {\n" +"foreach value $values {\n" +"my check_single_value -keep_old_value false $value $predicate $type $obj $var}\n" +"$obj set __oldvalue($var) $value}\n" +"::xotcl::Attribute instproc mk_type_checker {} {\n" +"set __initcmd \"\"\n" +"if {[my exists type]} {\n" +"my instvar type name\n" +"if {[::xotcl::Object isclass $type]} {\n" +"set predicate [subst -nocommands {[::xotcl::Object isobject \\$value]\n" +"&& [\\$value istype $type]}]} elseif {[llength $type]>1} {\n" +"set predicate \"\\[$type \\$value\\]\"} else {\n" +"set predicate \"\\[string is $type \\$value\\]\"}\n" +"my append valuechangedcmd [subst {\n" +"my [expr {[my multivalued] ? \"check_multiple_values\" : \"check_single_value\"}] \\[\\$obj set $name\\] \\\n" +"{$predicate} [list $type] \\$obj $name}]\n" +"append __initcmd [subst -nocommands {\n" +"if {[my exists $name]} {my set __oldvalue($name) [my set $name]}\\n}]}\n" +"return $__initcmd}\n" +"::xotcl::Attribute instproc init {} {\n" +"my instvar domain name\n" +"next ;# do first ordinary slot initialization\n" +"$domain unset -nocomplain __defaults($name)\n" +"set __initcmd \"\"\n" +"if {[my exists default]} {\n" +"$domain set __defaults($name) [my default]} elseif [my exists initcmd] {\n" +"append __initcmd \"my trace add variable [list $name] read \\\n" +"\\[list [self] __default_from_cmd \\[self\\] [list [my initcmd]]\\]\\n\"} elseif [my exists valuecmd] {\n" +"append __initcmd \"my trace add variable [list $name] read \\\n" +"\\[list [self] __value_from_cmd \\[self\\] [list [my valuecmd]]\\]\"}\n" +"append __initcmd [my mk_type_checker]\n" +"if {[my exists valuechangedcmd]} {\n" +"append __initcmd \"my trace add variable [list $name] write \\\n" +"\\[list [self] __value_changed_cmd \\[self\\] [list [my valuechangedcmd]]\\]\"}\n" +"if {$__initcmd ne \"\"} {\n" +"$domain set __initcmds($name) $__initcmd}}\n" +"::xotcl::Class create ::xotcl::Slot::Nocheck \\\n" +"-instproc check_single_value args {;} -instproc check_multiple_values args {;} \\\n" +"-instproc mk_type_checker args {return \"\"}\n" +"::xotcl::Class create ::xotcl::Slot::Optimizer \\\n" +"-instproc proc args {::xotcl::next; ::xotcl::my optimize} \\\n" +"-instproc forward args {::xotcl::next; ::xotcl::my optimize} \\\n" +"-instproc init args {::xotcl::next; ::xotcl::my optimize} \\\n" +"-instproc optimize {} {\n" +"if {[::xotcl::my multivalued]} return\n" +"if {[::xotcl::my defaultmethods] ne {get assign}} return\n" +"if {[::xotcl::my procsearch assign] ne \"::xotcl::Slot instcmd assign\"} return\n" +"if {[::xotcl::my procsearch get] ne \"::xotcl::Slot instcmd get\"} return\n" +"set forwarder [expr {[::xotcl::my per-object] ? \"parametercmd\":\"instparametercmd\"}]\n" +"[::xotcl::my domain] $forwarder [::xotcl::my name]}\n" +"::xotcl::Slot instmixin add ::xotcl::Slot::Optimizer\n" +"::xotcl::Class create ::xotcl::ScopedNew -superclass ::xotcl::Class \\\n" +"-array set __defaults {withclass ::xotcl::Object}\n" +"::xotcl::ScopedNew instparametercmd withclass\n" +"::xotcl::ScopedNew instparametercmd inobject\n" +"::xotcl::ScopedNew instproc init {} {\n" +"::xotcl::my instproc new {-childof args} {\n" +"[::xotcl::self class] instvar {inobject object} withclass\n" +"if {![::xotcl::my isobject $object]} {\n" +"$withclass create $object}\n" +"eval ::xotcl::next -childof $object $args}}\n" +"::xotcl::Object instproc contains {\n" +"{-withnew:boolean true}\n" +"-object\n" +"{-class ::xotcl::Object}\n" +"cmds} {\n" +"if {![info exists object]} {set object [::xotcl::self]}\n" +"if {![::xotcl::my isobject $object]} {$class create $object}\n" +"$object requireNamespace\n" +"if {$withnew} {\n" +"set m [::xotcl::ScopedNew new \\\n" +"-inobject $object -withclass $class -volatile]\n" +"::xotcl::Class instmixin add $m end\n" +"namespace eval $object $cmds\n" +"::xotcl::Class instmixin delete $m} else {\n" +"namespace eval $object $cmds}}\n" +"::xotcl::Class instforward slots %self contains \\\n" +"-object {%::xotcl::my subst [::xotcl::self]::slot}\n" +"::xotcl::Class instproc parameter arglist {\n" +"if {![::xotcl::my isobject [self]::slot]} {::xotcl::Object create [self]::slot}\n" +"foreach arg $arglist {\n" +"set l [llength $arg]\n" +"set name [lindex $arg 0]\n" +"if {$l == 1} {\n" +"::xotcl::Attribute create [::xotcl::self]::slot::$name} elseif {$l == 2} {\n" +"::xotcl::Attribute create [::xotcl::self]::slot::$name [list -default [lindex $arg 1]]} elseif {$l == 3 && [lindex $arg 1] eq \"-default\"} {\n" +"::xotcl::Attribute create [::xotcl::self]::slot::$name [list -default [lindex $arg 2]]} else {\n" +"set paramstring [string range $arg [expr {[string length $name]+1}] end]\n" +"if {[string match {[$\\[]*} $paramstring]} {\n" +"::xotcl::Attribute create [::xotcl::self]::slot::$name [list -default $paramstring]\n" +"continue}\n" +"set po ::xotcl::Class::Parameter\n" +"puts stderr \"deprecated parameter usage '$arg'; use '-slots {Attribute ...}' instead\"\n" +"set cl [self]\n" +"$po set name $name\n" +"$po set cl [self]\n" +"::eval $po configure [lrange $arg 1 end]\n" +"if {[$po exists extra] || [$po exists setter] ||\n" +"[$po exists getter] || [$po exists access]} {\n" +"$po instvar extra setter getter access defaultParam\n" +"if {![info exists extra]} {set extra \"\"}\n" +"if {![info exists defaultParam]} {set defaultParam \"\"}\n" +"if {![info exists setter]} {set setter set}\n" +"if {![info exists getter]} {set getter set}\n" +"if {![info exists access]} {set access ::xotcl::my}\n" +"$cl instproc $name args \"\n" +"if {\\[llength \\$args] == 0} {\n" +"return \\[$access $getter $extra $name\\]} else {\n" +"return \\[eval $access $setter $extra $name \\$args $defaultParam \\]}\"\n" +"foreach instvar {extra defaultParam setter getter access} {\n" +"$po unset -nocomplain $instvar}} else {\n" +"::xotcl::my instparametercmd $name}}}\n" +"[self]::slot set __parameter $arglist}\n" +"::xotcl::Object instproc self {} {::xotcl::self}\n" +"::xotcl::Object instproc defaultmethod {} {\n" +"return [::xotcl::self]}\n" +"::xotcl::Object instproc hasclass cl {\n" +"if {[::xotcl::my ismixin $cl]} {return 1}\n" +"::xotcl::my istype $cl}\n" +"::xotcl::Class instproc allinstances {} {\n" +"set set [::xotcl::my info instances]\n" +"foreach sc [::xotcl::my info subclass] {\n" +"eval lappend set [$sc allinstances]}\n" +"return $set}\n" +"::xotcl::Object proc unsetExitHandler {} {\n" +"::xotcl::Object proc __exitHandler {} {\n" +";}}\n" +"::xotcl::Object unsetExitHandler\n" +"::xotcl::Object proc setExitHandler {newbody} {\n" +"::xotcl::Object proc __exitHandler {} $newbody}\n" +"::xotcl::Object proc getExitHandler {} {\n" +"::xotcl::Object info body __exitHandler}\n" +"::xotcl::Object instproc abstract {methtype methname arglist} {\n" +"if {$methtype ne \"proc\" && $methtype ne \"instproc\"} {\n" +"error \"invalid method type '$methtype', \\\n" +"must be either 'proc' or 'instproc'.\"}\n" +"::xotcl::my $methtype $methname $arglist \"\n" +"if {!\\[::xotcl::self isnextcall\\]} {\n" +"error \\\"Abstract method $methname $arglist called\\\"} else {::xotcl::next}\n" +"\"}\n" +"::xotcl::Class create ::xotcl::Object::CopyHandler -parameter {\n" +"{targetList \"\"}\n" +"{dest \"\"}\n" +"objLength}\n" +"::xotcl::Object::CopyHandler instproc makeTargetList t {\n" +"::xotcl::my lappend targetList $t\n" +"if {[::xotcl::my isobject $t]} {\n" +"if {[$t info hasNamespace]} {\n" +"set children [$t info children]} else {\n" +"return}}\n" +"foreach c [namespace children $t] {\n" +"if {![::xotcl::my isobject $c]} {\n" +"lappend children [namespace children $t]}}\n" +"foreach c $children {\n" +"::xotcl::my makeTargetList $c}}\n" +"::xotcl::Object::CopyHandler instproc copyNSVarsAndCmds {orig dest} {\n" +"::xotcl::namespace_copyvars $orig $dest\n" +"::xotcl::namespace_copycmds $orig $dest}\n" +"::xotcl::Object::CopyHandler instproc getDest origin {\n" +"set tail [string range $origin [::xotcl::my set objLength] end]\n" +"return ::[string trimleft [::xotcl::my set dest]$tail :]}\n" +"::xotcl::Object::CopyHandler instproc copyTargets {} {\n" +"foreach origin [::xotcl::my set targetList] {\n" +"set dest [::xotcl::my getDest $origin]\n" +"if {[::xotcl::my isobject $origin]} {\n" +"if {[::xotcl::my isclass $origin]} {\n" +"set cl [[$origin info class] create $dest -noinit]\n" +"set obj $cl\n" +"$cl superclass [$origin info superclass]\n" +"$cl parameterclass [$origin info parameterclass]\n" +"$cl instinvar [$origin info instinvar]\n" +"$cl instfilter [$origin info instfilter -guards]\n" +"$cl instmixin [$origin info instmixin]\n" +"my copyNSVarsAndCmds ::xotcl::classes::$origin ::xotcl::classes::$dest} else {\n" +"set obj [[$origin info class] create $dest -noinit]}\n" +"$obj invar [$origin info invar]\n" +"$obj check [$origin info check]\n" +"$obj mixin [$origin info mixin]\n" +"$obj filter [$origin info filter -guards]\n" +"if {[$origin info hasNamespace]} {\n" +"$obj requireNamespace}} else {\n" +"namespace eval $dest {}}\n" +"::xotcl::my copyNSVarsAndCmds $origin $dest\n" +"foreach i [$origin info forward] {\n" +"eval [concat $dest forward $i [$origin info forward -definition $i]]}\n" +"if {[::xotcl::my isclass $origin]} {\n" +"foreach i [$origin info instforward] {\n" +"eval [concat $dest instforward $i [$origin info instforward -definition $i]]}}\n" +"set traces [list]\n" +"foreach var [$origin info vars] {\n" +"set cmds [$origin trace info variable $var]\n" +"if {$cmds ne \"\"} {\n" +"foreach cmd $cmds {\n" +"foreach {op def} $cmd break\n" +"$origin trace remove variable $var $op $def\n" +"if {[lindex $def 0] eq $origin} {\n" +"set def [concat $dest [lrange $def 1 end]]}\n" +"$dest trace add variable $var $op $def}}}}\n" +"set origin [lindex [::xotcl::my set targetList] 0]\n" +"if {[::xotcl::my isclass $origin]} {\n" +"foreach oldslot [$origin info slots] {\n" +"set newslot ${cl}::slot::[namespace tail $oldslot]\n" +"if {[$oldslot domain] eq $origin} {$newslot domain $cl}\n" +"if {[$oldslot manager] eq $oldslot} {$newslot manager $newslot}}}}\n" +"::xotcl::Object::CopyHandler instproc copy {obj dest} {\n" +"::xotcl::my set objLength [string length $obj]\n" +"::xotcl::my set dest $dest\n" +"::xotcl::my makeTargetList $obj\n" +"::xotcl::my copyTargets}\n" +"::xotcl::Object instproc copy newName {\n" +"if {[string compare [string trimleft $newName :] [string trimleft [::xotcl::self] :]]} {\n" +"[[::xotcl::self class]::CopyHandler new -volatile] copy [::xotcl::self] $newName}}\n" +"::xotcl::Object instproc move newName {\n" +"if {[string trimleft $newName :] ne [string trimleft [::xotcl::self] :]} {\n" +"if {$newName ne \"\"} {\n" +"::xotcl::my copy $newName}\n" +"if {[::xotcl::my isclass [::xotcl::self]] && $newName ne \"\"} {\n" +"foreach subclass [::xotcl::my info subclass] {\n" +"set scl [$subclass info superclass]\n" +"if {[set index [lsearch -exact $scl [::xotcl::self]]] != -1} {\n" +"set scl [lreplace $scl $index $index $newName]\n" +"$subclass superclass $scl}} }\n" +"::xotcl::my destroy}}\n" +"::xotcl::Object create ::xotcl::config\n" +"::xotcl::config proc load {obj file} {\n" +"source $file\n" +"foreach i [array names ::auto_index [list $obj *proc *]] {\n" +"set type [lindex $i 1]\n" +"set meth [lindex $i 2]\n" +"if {[$obj info ${type}s $meth] == {}} {\n" +"$obj $type $meth auto $::auto_index($i)}}}\n" +"::xotcl::config proc mkindex {meta dir args} {\n" +"set sp {[ ]+}\n" +"set st {^[ ]*}\n" +"set wd {([^ ;]+)}\n" +"foreach creator $meta {\n" +"::lappend cp $st$creator${sp}create$sp$wd\n" +"::lappend ap $st$creator$sp$wd}\n" +"foreach method {proc instproc} {\n" +"::lappend mp $st$wd${sp}($method)$sp$wd}\n" +"foreach cl [concat ::xotcl::Class [::xotcl::Class info heritage]] {\n" +"eval ::lappend meths [$cl info instcommands]}\n" +"set old [pwd]\n" +"cd $dir\n" +"::append idx \"# Tcl autoload index file, version 2.0\\n\"\n" +"::append idx \"# xotcl additions generated with \"\n" +"::append idx \"\\\"::xotcl::config::mkindex [list $meta] [list $dir] $args\\\"\\n\"\n" +"set oc 0\n" +"set mc 0\n" +"foreach file [eval glob -nocomplain -- $args] {\n" +"if {[catch {set f [open $file]} msg]} then {\n" +"catch {close $f}\n" +"cd $old\n" +"error $msg}\n" +"while {[gets $f line] >= 0} {\n" +"foreach c $cp {\n" +"if {[regexp $c $line x obj]==1 &&\n" +"[string index $obj 0]!={$}} then {\n" +"::incr oc\n" +"::append idx \"set auto_index($obj) \"\n" +"::append idx \"\\\"::xotcl::config::load $obj \\$dir/$file\\\"\\n\"}}\n" +"foreach a $ap {\n" +"if {[regexp $a $line x obj]==1 &&\n" +"[string index $obj 0]!={$} &&\n" +"[lsearch -exact $meths $obj]==-1} {\n" +"::incr oc\n" +"::append idx \"set auto_index($obj) \"\n" +"::append idx \"\\\"::xotcl::config::load $obj \\$dir/$file\\\"\\n\"}}\n" +"foreach m $mp {\n" +"if {[regexp $m $line x obj ty pr]==1 &&\n" +"[string index $obj 0]!={$} &&\n" +"[string index $pr 0]!={$}} then {\n" +"::incr mc\n" +"::append idx \"set \\{auto_index($obj \"\n" +"::append idx \"$ty $pr)\\} \\\"source \\$dir/$file\\\"\\n\"}}}\n" +"close $f}\n" +"set t [open tclIndex a+]\n" +"puts $t $idx nonewline\n" +"close $t\n" +"cd $old\n" +"return \"$oc objects, $mc methods\"}\n" +"::xotcl::Object instproc extractConfigureArg {al name {cutTheArg 0}} {\n" +"set value \"\"\n" +"upvar $al argList\n" +"set largs [llength $argList]\n" +"for {set i 0} {$i < $largs} {incr i} {\n" +"if {[lindex $argList $i] == $name && $i + 1 < $largs} {\n" +"set startIndex $i\n" +"set endIndex [expr {$i + 1}]\n" +"while {$endIndex < $largs &&\n" +"[string first - [lindex $argList $endIndex]] != 0} {\n" +"lappend value [lindex $argList $endIndex]\n" +"incr endIndex}}}\n" +"if {[info exists startIndex] && $cutTheArg != 0} {\n" +"set argList [lreplace $argList $startIndex [expr {$endIndex - 1}]]}\n" +"return $value}\n" +"::xotcl::Object create ::xotcl::rcs\n" +"::xotcl::rcs proc date string {\n" +"lreplace [lreplace $string 0 0] end end}\n" +"::xotcl::rcs proc version string {\n" +"lindex $string 2}\n" +"if {![info exists ::env(HOME)]} {set ::env(HOME) /root}\n" +"set ::xotcl::confdir ~/.xotcl\n" +"set ::xotcl::logdir $::xotcl::confdir/log\n" +"::xotcl::Class proc __unknown name {}\n" +"::xotcl::Class instproc uses list {\n" +"foreach package $list {\n" +"::xotcl::package import -into [self] $package\n" +"puts stderr \"*** using ${package}::* in [self]\"}}\n" +"::xotcl::Class create ::xotcl::package -superclass ::xotcl::Class -parameter {\n" +"provide\n" +"{version 1.0}\n" +"{autoexport {}}\n" +"{export {}}}\n" +"::xotcl::package proc create {name args} {\n" +"set nq [namespace qualifiers $name]\n" +"if {$nq ne \"\" && ![namespace exists $nq]} {Object create $nq}\n" +"next}\n" +"::xotcl::package proc extend {name args} {\n" +"my require $name\n" +"eval $name configure $args}\n" +"::xotcl::package instproc contains script {\n" +"if {[my exists provide]} {\n" +"package provide [my provide] [my version]} else {\n" +"package provide [self] [my version]}\n" +"namespace eval [self] {namespace import ::xotcl::*}\n" +"namespace eval [self] $script\n" +"foreach e [my export] {\n" +"set nq [namespace qualifiers $e]\n" +"if {$nq ne \"\"} {\n" +"namespace eval [self]::$nq [list namespace export [namespace tail $e]]} else {\n" +"namespace eval [self] [list namespace export $e]}}\n" +"foreach e [my autoexport] {\n" +"namespace eval :: [list namespace import [self]::$e]}}\n" +"::xotcl::package configure \\\n" +"-set component . \\\n" +"-set verbose 0 \\\n" +"-set packagecmd ::package\n" +"::xotcl::package proc unknown args {\n" +"eval [my set packagecmd] $args}\n" +"::xotcl::package proc verbose value {\n" +"my set verbose $value}\n" +"::xotcl::package proc present args {\n" +"if {$::tcl_version<8.3} {\n" +"my instvar loaded\n" +"switch -exact -- [lindex $args 0] {\n" +"-exact {set pkg [lindex $args 1]}\n" +"default {set pkg [lindex $args 0]}}\n" +"if {[info exists loaded($pkg)]} {\n" +"return $loaded($pkg)} else {\n" +"error \"not found\"}} else {\n" +"eval [my set packagecmd] present $args}}\n" +"::xotcl::package proc import {{-into ::} pkg} {\n" +"my require $pkg\n" +"namespace eval $into [subst -nocommands {\n" +"namespace import ${pkg}::*}]\n" +"foreach e [$pkg export] {\n" +"set nq [namespace qualifiers $e]\n" +"if {$nq ne \"\"} {\n" +"namespace eval $into$nq [list namespace import ${pkg}::$e]}}}\n" +"::xotcl::package proc require args {\n" +"::xotcl::my instvar component verbose uses loaded\n" +"set prevComponent $component\n" +"if {[catch {set v [eval package present $args]} msg]} {\n" +"switch -exact -- [lindex $args 0] {\n" +"-exact {set pkg [lindex $args 1]}\n" +"default {set pkg [lindex $args 0]}}\n" +"set component $pkg\n" +"lappend uses($prevComponent) $component\n" +"set v [uplevel \\#1 [my set packagecmd] require $args]\n" +"if {$v ne \"\" && $verbose} {\n" +"set path [lindex [::package ifneeded $pkg $v] 1]\n" +"puts \"... $pkg $v loaded from '$path'\"\n" +"set loaded($pkg) $v ;# loaded stuff needed for Tcl 8.0}}\n" +"set component $prevComponent\n" +"return $v}\n" +"::xotcl::Object instproc method {name arguments body} {\n" +"my proc name $arguments $body }\n" +"::xotcl::Class instproc method {\n" +"-per-object:switch name arguments body} {\n" +"if {${per-object}} {\n" +"my proc $name $arguments $body} else {\n" +"my instproc $name $arguments $body}}\n" +"proc ::xotcl::tmpdir {} {\n" +"foreach e [list TMPDIR TEMP TMP] {\n" +"if {[info exists ::env($e)] \\\n" +"&& [file isdirectory $::env($e)] \\\n" +"&& [file writable $::env($e)]} {\n" +"return $::env($e)}}\n" +"if {$::tcl_platform(platform) eq \"windows\"} {\n" +"foreach d [list \"C:\\\\TEMP\" \"C:\\\\TMP\" \"\\\\TEMP\" \"\\\\TMP\"] {\n" +"if {[file isdirectory $d] && [file writable $d]} {\n" +"return $d}}}\n" +"return /tmp}\n" +""; + Index: generic/predefined.xotcl =================================================================== diff -u -N --- generic/predefined.xotcl (revision 0) +++ generic/predefined.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,880 @@ +# $Id: predefined.xotcl,v 1.16 2007/09/05 19:09:22 neumann Exp $ +# provide the standard command set for ::xotcl::Object +foreach cmd [info command ::xotcl::Object::instcmd::*] { + ::xotcl::alias ::xotcl::Object [namespace tail $cmd] $cmd +} +# provide some Tcl-commands as methods for Objects +foreach cmd {array append eval incr lappend trace subst unset} { + ::xotcl::alias ::xotcl::Object $cmd -objscope ::$cmd +} +# provide the standard command set for ::xotcl::Class +foreach cmd [info command ::xotcl::Class::instcmd::*] { + ::xotcl::alias ::xotcl::Class [namespace tail $cmd] $cmd +} +unset cmd + +# init must exist on Object. per default it is empty. +::xotcl::Object instproc init args {} + +# documentation stub object -> just ignore +# all documentations if xoDoc is not loaded +::xotcl::Object create ::xotcl::@ +::xotcl::@ proc unknown args {} +proc ::xotcl::myproc {args} {linsert $args 0 [::xotcl::self]} +proc ::xotcl::myvar {var} {::xotcl::my requireNamespace; return [::xotcl::self]::$var} +namespace eval ::xotcl { namespace export @ myproc myvar Attribute} +######################## +# Parameter definitions +######################## +::xotcl::setrelation ::xotcl::Class::Parameter superclass ::xotcl::Class +::xotcl::Class::Parameter instproc mkParameter {obj name args} { + #puts "[::xotcl::self proc] $obj $name <$args>" + if {[$obj exists $name]} { + eval [$obj set $name] configure $args + } else { + $obj set $name [eval ::xotcl::my new -childof $obj $args] + } +} +::xotcl::Class::Parameter instproc getParameter {obj name args} { + #puts "[::xotcl::self proc] $obj $name <$args>" + [$obj set $name] +} +::xotcl::Class::Parameter proc Class {param args} { + #puts "*** [::xotcl::self] parameter: [::xotcl::self proc] '$param' <$args>" + ::xotcl::my set access [lindex $param 0] + ::xotcl::my set setter mkParameter + ::xotcl::my set getter getParameter + ::xotcl::my set extra {[::xotcl::self]} + ::xotcl::my set defaultParam [lrange $param 1 end] +} +::xotcl::Class::Parameter proc default {val} { + [::xotcl::my set cl] set __defaults([::xotcl::my set name]) $val +} +::xotcl::Class::Parameter proc setter x { + ::xotcl::my set setter $x +} +::xotcl::Class::Parameter proc getter x { + ::xotcl::my set getter $x +} +::xotcl::Class::Parameter proc access obj { + ::xotcl::my set access $obj + ::xotcl::my set extra \[::xotcl::self\] + foreach v [$obj info vars] {::xotcl::my set $v [$obj set $v]} +} +::xotcl::Class::Parameter proc values {param args} { + set cl [::xotcl::my set cl] + set ci [$cl info instinvar] + set valueTest {} + foreach a $args { + ::lappend valueTest "\[\$cl set $param\] == [list $a]" + } + ::lappend ci [join $valueTest " || "] + $cl instinvar $ci +} + +################## +# Slot definitions +################## +# bootstrap code; we cannot use -parameter yet +::xotcl::Class create ::xotcl::MetaSlot +::xotcl::setrelation ::xotcl::MetaSlot superclass ::xotcl::Class +::xotcl::MetaSlot instproc new args { + set slotobject [self callingobject]::slot + if {![my isobject $slotobject]} {Object create $slotobject} + #namespace eval [self]::slot $cmds + #puts "metaslot $args // [namespace current] // [self callingobject]" + eval next -childof $slotobject $args +} +::xotcl::MetaSlot create ::xotcl::Slot -array set __defaults { + name "[namespace tail [::xotcl::self]]" + domain "[lindex [regexp -inline {^(.*)::slot::[^:]+$} [::xotcl::self]] 1]" + defaultmethods {get assign} + manager "[::xotcl::self]" + multivalued false + per-object false +} +foreach p {name domain defaultmethods manager default multivalued type + per-object initcmd valuecmd valuechangedcmd} { + ::xotcl::Slot instparametercmd $p +} +unset p + +::xotcl::alias ::xotcl::Slot get ::xotcl::setinstvar +::xotcl::alias ::xotcl::Slot assign ::xotcl::setinstvar +::xotcl::Slot instproc add {obj prop value {pos 0}} { + if {![my multivalued]} { + error "Property $prop of [my domain]->$obj ist not multivalued" + } + if {[$obj exists $prop]} { + $obj set $prop [linsert [$obj set $prop] $pos $value] + } else { + $obj set $prop [list $value] + } +} +::xotcl::Slot instproc delete {-nocomplain:switch obj prop value} { + set old [$obj set $prop] + set p [lsearch -glob $old $value] + if {$p>-1} {$obj set $prop [lreplace $old $p $p]} else { + error "$value is not a $prop of $obj (valid are: $old)" + } +} + +::xotcl::Slot instproc unknown {method args} { + set methods [list] + foreach m [my info methods] { + if {[::xotcl::Object info methods $m] ne ""} continue + if {[string match __* $m]} continue + lappend methods $m + } + error "Method '$method' unknown for slot [self]; valid are: {[lsort $methods]]}" +} +::xotcl::Slot instproc init {} { + my instvar name domain manager + set forwarder [expr {[my per-object] ? "forward" : "instforward"}] + #puts "domain=$domain /[self callingobject]/[my info parent]" + if {$domain eq ""} { + set domain [self callingobject] + } + $domain $forwarder $name -default [$manager defaultmethods] $manager %1 %self %proc +} +# +# InfoSlot +# +::xotcl::MetaSlot create ::xotcl::InfoSlot -array set __defaults { + multivalued true +} +::xotcl::setrelation ::xotcl::InfoSlot superclass ::xotcl::Slot +::xotcl::InfoSlot instproc get {obj prop} {$obj info $prop} +::xotcl::InfoSlot instproc add {obj prop value {pos 0}} { + if {![my multivalued]} { + error "Property $prop of [my domain]->$obj ist not multivalued" + } + $obj $prop [linsert [$obj info $prop] $pos $value] +} +::xotcl::InfoSlot instproc delete {-nocomplain:switch obj prop value} { + set old [$obj info $prop] + set p [lsearch -glob $old $value] + if {$p>-1} {$obj $prop [lreplace $old $p $p]} else { + error "$value is not a $prop of $obj (valid are: $old)" + } +} +# +# InterceptorSlot +# +::xotcl::MetaSlot create ::xotcl::InterceptorSlot +::xotcl::setrelation ::xotcl::InterceptorSlot superclass ::xotcl::InfoSlot +::xotcl::alias ::xotcl::InterceptorSlot set ::xotcl::setrelation ;# for backwards compatibility +::xotcl::alias ::xotcl::InterceptorSlot assign ::xotcl::setrelation + +::xotcl::InterceptorSlot instproc add {obj prop value {pos 0}} { + if {![my multivalued]} { + error "Property $prop of [my domain]->$obj ist not multivalued" + } + $obj $prop [linsert [$obj info $prop -guards] $pos $value] +} + +###################### +# system slots +###################### +namespace eval ::xotcl::Class::slot {} +namespace eval ::xotcl::Object::slot {} + +::xotcl::InfoSlot create ::xotcl::Class::slot::superclass +::xotcl::alias ::xotcl::Class::slot::superclass assign ::xotcl::setrelation + +::xotcl::InfoSlot create ::xotcl::Object::slot::class +::xotcl::alias ::xotcl::Object::slot::class assign ::xotcl::setrelation + +::xotcl::InterceptorSlot create ::xotcl::Object::slot::mixin +::xotcl::InterceptorSlot create ::xotcl::Object::slot::filter +::xotcl::InterceptorSlot create ::xotcl::Class::slot::instmixin +::xotcl::InterceptorSlot create ::xotcl::Class::slot::instfilter + +# +# Attribute +# +::xotcl::MetaSlot create ::xotcl::Attribute -superclass ::xotcl::Slot +foreach p {default value_check initcmd valuecmd valuechangedcmd} { + ::xotcl::Attribute instparametercmd $p +} +unset p +::xotcl::Attribute array set __defaults { + value_check once +} +::xotcl::Attribute instproc __default_from_cmd {obj cmd var sub op} { + #puts "GETVAR [self proc] obj=$obj cmd=$cmd, var=$var, op=$op" + $obj trace remove variable $var $op [list [self] [self proc] $obj $cmd] + $obj set $var [$obj eval $cmd] +} +::xotcl::Attribute instproc __value_from_cmd {obj cmd var sub op} { + #puts "GETVAR [self proc] obj=$obj cmd=$cmd, var=$var, op=$op" + $obj set $var [$obj eval $cmd] +} +::xotcl::Attribute instproc __value_changed_cmd {obj cmd var sub op} { + #puts stderr "**************************" + #puts "valuechanged obj=$obj cmd=$cmd, var=$var, op=$op, ... + #$obj exists $var -> [$obj set $var]" + eval $cmd +} +::xotcl::Attribute instproc destroy {} { + #puts stderr "++++ [my domain] unset __defaults([my name]) [my default]" + #[my domain] unset -nocomplain __defaults([my name]) + next +} +::xotcl::Attribute instproc check_single_value { + {-keep_old_value:boolean true} + value predicate type obj var +} { + #puts "+++ checking $value with $predicate ==> [expr $predicate]" + if {![expr $predicate]} { + if {[$obj exists __oldvalue($var)]} { + $obj set $var [$obj set __oldvalue($var)] + } else { + $obj unset -nocomplain $var + } + error "$value is not of type $type" + } + if {$keep_old_value} {$obj set __oldvalue($var) $value} +} + +::xotcl::Attribute instproc check_multiple_values {values predicate type obj var} { + foreach value $values { + my check_single_value -keep_old_value false $value $predicate $type $obj $var + } + $obj set __oldvalue($var) $value +} +::xotcl::Attribute instproc mk_type_checker {} { + set __initcmd "" + if {[my exists type]} { + my instvar type name + if {[::xotcl::Object isclass $type]} { + set predicate [subst -nocommands {[::xotcl::Object isobject \$value] + && [\$value istype $type]}] + } elseif {[llength $type]>1} { + set predicate "\[$type \$value\]" + } else { + set predicate "\[string is $type \$value\]" + } + my append valuechangedcmd [subst { + my [expr {[my multivalued] ? "check_multiple_values" : "check_single_value"}] \[\$obj set $name\] \ + {$predicate} [list $type] \$obj $name + }] + append __initcmd [subst -nocommands { + if {[my exists $name]} {my set __oldvalue($name) [my set $name]}\n + }] + } + return $__initcmd +} +::xotcl::Attribute instproc init {} { + my instvar domain name + next ;# do first ordinary slot initialization + # there might be already default values registered on the class + $domain unset -nocomplain __defaults($name) + set __initcmd "" + if {[my exists default]} { + $domain set __defaults($name) [my default] + } elseif [my exists initcmd] { + append __initcmd "my trace add variable [list $name] read \ + \[list [self] __default_from_cmd \[self\] [list [my initcmd]]\]\n" + } elseif [my exists valuecmd] { + append __initcmd "my trace add variable [list $name] read \ + \[list [self] __value_from_cmd \[self\] [list [my valuecmd]]\]" + } + append __initcmd [my mk_type_checker] + if {[my exists valuechangedcmd]} { + append __initcmd "my trace add variable [list $name] write \ + \[list [self] __value_changed_cmd \[self\] [list [my valuechangedcmd]]\]" + } + if {$__initcmd ne ""} { + $domain set __initcmds($name) $__initcmd + #puts stderr "$domain set __initcmds($name) $__initcmd" + } +} +# mixin class for decativating all checks +::xotcl::Class create ::xotcl::Slot::Nocheck \ + -instproc check_single_value args {;} -instproc check_multiple_values args {;} \ + -instproc mk_type_checker args {return ""} +::xotcl::Class create ::xotcl::Slot::Optimizer \ + -instproc proc args {::xotcl::next; ::xotcl::my optimize} \ + -instproc forward args {::xotcl::next; ::xotcl::my optimize} \ + -instproc init args {::xotcl::next; ::xotcl::my optimize} \ + -instproc optimize {} { + if {[::xotcl::my multivalued]} return + if {[::xotcl::my defaultmethods] ne {get assign}} return + if {[::xotcl::my procsearch assign] ne "::xotcl::Slot instcmd assign"} return + if {[::xotcl::my procsearch get] ne "::xotcl::Slot instcmd get"} return + set forwarder [expr {[::xotcl::my per-object] ? "parametercmd":"instparametercmd"}] + #puts stderr "**** optimizing [::xotcl::my domain] $forwarder [::xotcl::my name]" + [::xotcl::my domain] $forwarder [::xotcl::my name] + } +# register the optimizer per default +::xotcl::Slot instmixin add ::xotcl::Slot::Optimizer + +# +# Create a mixin class to overload method "new", such it does not allocate +# new objects in ::xotcl::*, but in the specified object (without +# syntactic overhead). +# +::xotcl::Class create ::xotcl::ScopedNew -superclass ::xotcl::Class \ + -array set __defaults {withclass ::xotcl::Object} +::xotcl::ScopedNew instparametercmd withclass +::xotcl::ScopedNew instparametercmd inobject +::xotcl::ScopedNew instproc init {} { + ::xotcl::my instproc new {-childof args} { + [::xotcl::self class] instvar {inobject object} withclass + if {![::xotcl::my isobject $object]} { + $withclass create $object + } + eval ::xotcl::next -childof $object $args + } +} +# +# change the namespace to the specified object and create +# objects there. This is a friendly notation for creating +# nested object structures. Optionally, creating new objects +# in the specified scope can be turned off. +# +::xotcl::Object instproc contains { + {-withnew:boolean true} + -object + {-class ::xotcl::Object} + cmds} { + if {![info exists object]} {set object [::xotcl::self]} + if {![::xotcl::my isobject $object]} {$class create $object} + $object requireNamespace + if {$withnew} { + set m [::xotcl::ScopedNew new \ + -inobject $object -withclass $class -volatile] + ::xotcl::Class instmixin add $m end + namespace eval $object $cmds + ::xotcl::Class instmixin delete $m + } else { + namespace eval $object $cmds + } + } +::xotcl::Class instforward slots %self contains \ + -object {%::xotcl::my subst [::xotcl::self]::slot} + +# +# utilities +# +::xotcl::Class instproc parameter arglist { + if {![::xotcl::my isobject [self]::slot]} {::xotcl::Object create [self]::slot} + foreach arg $arglist { + #puts "arg=$arg" + set l [llength $arg] + set name [lindex $arg 0] + if {$l == 1} { + ::xotcl::Attribute create [::xotcl::self]::slot::$name + + } elseif {$l == 2} { + #puts stderr "parameter $name has default '[lindex $arg 1]'" + ::xotcl::Attribute create [::xotcl::self]::slot::$name [list -default [lindex $arg 1]] + } elseif {$l == 3 && [lindex $arg 1] eq "-default"} { + ::xotcl::Attribute create [::xotcl::self]::slot::$name [list -default [lindex $arg 2]] + } else { + set paramstring [string range $arg [expr {[string length $name]+1}] end] + #puts stderr "remaining arg = '$paramstring'" + if {[string match {[$\[]*} $paramstring]} { + #puts stderr "match, $cl set __defaults($name) $paramstring" + ::xotcl::Attribute create [::xotcl::self]::slot::$name [list -default $paramstring] + continue + } + + set po ::xotcl::Class::Parameter + puts stderr "deprecated parameter usage '$arg'; use '-slots {Attribute ...}' instead" + + set cl [self] + $po set name $name + $po set cl [self] + ::eval $po configure [lrange $arg 1 end] + + if {[$po exists extra] || [$po exists setter] || + [$po exists getter] || [$po exists access]} { + $po instvar extra setter getter access defaultParam + if {![info exists extra]} {set extra ""} + if {![info exists defaultParam]} {set defaultParam ""} + if {![info exists setter]} {set setter set} + if {![info exists getter]} {set getter set} + if {![info exists access]} {set access ::xotcl::my} + $cl instproc $name args " + if {\[llength \$args] == 0} { + return \[$access $getter $extra $name\] + } else { + return \[eval $access $setter $extra $name \$args $defaultParam \] + }" + foreach instvar {extra defaultParam setter getter access} { + $po unset -nocomplain $instvar + } + } else { + ::xotcl::my instparametercmd $name + } + } + } + [self]::slot set __parameter $arglist +} +# +# utilities +# +::xotcl::Object instproc self {} {::xotcl::self} +::xotcl::Object instproc defaultmethod {} { + #if {"::" ne [::xotcl::my info parent] } { + # [::xotcl::my info parent] __next + #} + return [::xotcl::self] +} + +# support for XOTcl specifics +::xotcl::Object instproc hasclass cl { + if {[::xotcl::my ismixin $cl]} {return 1} + ::xotcl::my istype $cl +} +::xotcl::Class instproc allinstances {} { + set set [::xotcl::my info instances] + foreach sc [::xotcl::my info subclass] { + eval lappend set [$sc allinstances] + } + return $set +} + + +# Exit Handler +::xotcl::Object proc unsetExitHandler {} { + ::xotcl::Object proc __exitHandler {} { + # clients should append exit handlers to this proc body + ; + } +} +# pre-defined as empty method +::xotcl::Object unsetExitHandler +::xotcl::Object proc setExitHandler {newbody} { + ::xotcl::Object proc __exitHandler {} $newbody +} +::xotcl::Object proc getExitHandler {} { + ::xotcl::Object info body __exitHandler +} + +::xotcl::Object instproc abstract {methtype methname arglist} { + if {$methtype ne "proc" && $methtype ne "instproc"} { + error "invalid method type '$methtype', \ + must be either 'proc' or 'instproc'." + } + ::xotcl::my $methtype $methname $arglist " + if {!\[::xotcl::self isnextcall\]} { + error \"Abstract method $methname $arglist called\" + } else {::xotcl::next} + " +} + +# +# copy/move implementation +# +::xotcl::Class create ::xotcl::Object::CopyHandler -parameter { + {targetList ""} + {dest ""} + objLength +} + +# targets are all namspaces and objs part-of the copied obj +::xotcl::Object::CopyHandler instproc makeTargetList t { + ::xotcl::my lappend targetList $t + # if it is an object without namespace, it is a leaf + if {[::xotcl::my isobject $t]} { + if {[$t info hasNamespace]} { + # make target list from all children + set children [$t info children] + } else { + # ok, no namespace -> no more children + return + } + } + # now append all namespaces that are in the obj, but that + # are not objects + foreach c [namespace children $t] { + if {![::xotcl::my isobject $c]} { + lappend children [namespace children $t] + } + } + + # a namespace or an obj with namespace may have children + # itself + foreach c $children { + ::xotcl::my makeTargetList $c + } +} + +::xotcl::Object::CopyHandler instproc copyNSVarsAndCmds {orig dest} { + ::xotcl::namespace_copyvars $orig $dest + ::xotcl::namespace_copycmds $orig $dest +} + +# construct destination obj name from old qualified ns name +::xotcl::Object::CopyHandler instproc getDest origin { + set tail [string range $origin [::xotcl::my set objLength] end] + return ::[string trimleft [::xotcl::my set dest]$tail :] +} + +::xotcl::Object::CopyHandler instproc copyTargets {} { + #puts stderr "copy targetList = [::xotcl::my set targetList]" + foreach origin [::xotcl::my set targetList] { + set dest [::xotcl::my getDest $origin] + if {[::xotcl::my isobject $origin]} { + # copy class information + if {[::xotcl::my isclass $origin]} { + set cl [[$origin info class] create $dest -noinit] + # class object + set obj $cl + $cl superclass [$origin info superclass] + $cl parameterclass [$origin info parameterclass] + $cl instinvar [$origin info instinvar] + $cl instfilter [$origin info instfilter -guards] + $cl instmixin [$origin info instmixin] + my copyNSVarsAndCmds ::xotcl::classes::$origin ::xotcl::classes::$dest + #$cl parameter [$origin info parameter] + } else { + # create obj + set obj [[$origin info class] create $dest -noinit] + } + # copy object -> may be a class obj + $obj invar [$origin info invar] + $obj check [$origin info check] + $obj mixin [$origin info mixin] + $obj filter [$origin info filter -guards] + # set md [$origin info metadata] + # $obj metadata add $md + # foreach m $md { $obj metadata $m [$origin metadata $m] } + if {[$origin info hasNamespace]} { + $obj requireNamespace + } + } else { + namespace eval $dest {} + } + ::xotcl::my copyNSVarsAndCmds $origin $dest + foreach i [$origin info forward] { + eval [concat $dest forward $i [$origin info forward -definition $i]] + } + if {[::xotcl::my isclass $origin]} { + foreach i [$origin info instforward] { + eval [concat $dest instforward $i [$origin info instforward -definition $i]] + } + } + set traces [list] + foreach var [$origin info vars] { + set cmds [$origin trace info variable $var] + if {$cmds ne ""} { + foreach cmd $cmds { + foreach {op def} $cmd break + $origin trace remove variable $var $op $def + if {[lindex $def 0] eq $origin} { + set def [concat $dest [lrange $def 1 end]] + } + $dest trace add variable $var $op $def + } + } + } + } + # alter 'domain' and 'manager' in slot objects + set origin [lindex [::xotcl::my set targetList] 0] + if {[::xotcl::my isclass $origin]} { + foreach oldslot [$origin info slots] { + set newslot ${cl}::slot::[namespace tail $oldslot] + if {[$oldslot domain] eq $origin} {$newslot domain $cl} + if {[$oldslot manager] eq $oldslot} {$newslot manager $newslot} + } + } +} + +::xotcl::Object::CopyHandler instproc copy {obj dest} { + #puts stderr "[::xotcl::self] copy <$obj> <$dest>" + ::xotcl::my set objLength [string length $obj] + ::xotcl::my set dest $dest + ::xotcl::my makeTargetList $obj + ::xotcl::my copyTargets +} + +#Class create ::xotcl::NoInit +#::xotcl::NoInit instproc init args {;} + + +::xotcl::Object instproc copy newName { + if {[string compare [string trimleft $newName :] [string trimleft [::xotcl::self] :]]} { + [[::xotcl::self class]::CopyHandler new -volatile] copy [::xotcl::self] $newName + } +} + +::xotcl::Object instproc move newName { + if {[string trimleft $newName :] ne [string trimleft [::xotcl::self] :]} { + if {$newName ne ""} { + ::xotcl::my copy $newName + } + ### let all subclasses get the copied class as superclass + if {[::xotcl::my isclass [::xotcl::self]] && $newName ne ""} { + foreach subclass [::xotcl::my info subclass] { + set scl [$subclass info superclass] + if {[set index [lsearch -exact $scl [::xotcl::self]]] != -1} { + set scl [lreplace $scl $index $index $newName] + $subclass superclass $scl + } + } + } + ::xotcl::my destroy + } +} + +::xotcl::Object create ::xotcl::config +::xotcl::config proc load {obj file} { + source $file + foreach i [array names ::auto_index [list $obj *proc *]] { + set type [lindex $i 1] + set meth [lindex $i 2] + if {[$obj info ${type}s $meth] == {}} { + $obj $type $meth auto $::auto_index($i) + } + } +} + +::xotcl::config proc mkindex {meta dir args} { + set sp {[ ]+} + set st {^[ ]*} + set wd {([^ ;]+)} + foreach creator $meta { + ::lappend cp $st$creator${sp}create$sp$wd + ::lappend ap $st$creator$sp$wd + } + foreach method {proc instproc} { + ::lappend mp $st$wd${sp}($method)$sp$wd + } + foreach cl [concat ::xotcl::Class [::xotcl::Class info heritage]] { + eval ::lappend meths [$cl info instcommands] + } + set old [pwd] + cd $dir + ::append idx "# Tcl autoload index file, version 2.0\n" + ::append idx "# xotcl additions generated with " + ::append idx "\"::xotcl::config::mkindex [list $meta] [list $dir] $args\"\n" + set oc 0 + set mc 0 + foreach file [eval glob -nocomplain -- $args] { + if {[catch {set f [open $file]} msg]} then { + catch {close $f} + cd $old + error $msg + } + while {[gets $f line] >= 0} { + foreach c $cp { + if {[regexp $c $line x obj]==1 && + [string index $obj 0]!={$}} then { + ::incr oc + ::append idx "set auto_index($obj) " + ::append idx "\"::xotcl::config::load $obj \$dir/$file\"\n" + } + } + foreach a $ap { + if {[regexp $a $line x obj]==1 && + [string index $obj 0]!={$} && + [lsearch -exact $meths $obj]==-1} { + ::incr oc + ::append idx "set auto_index($obj) " + ::append idx "\"::xotcl::config::load $obj \$dir/$file\"\n" + } + } + foreach m $mp { + if {[regexp $m $line x obj ty pr]==1 && + [string index $obj 0]!={$} && + [string index $pr 0]!={$}} then { + ::incr mc + ::append idx "set \{auto_index($obj " + ::append idx "$ty $pr)\} \"source \$dir/$file\"\n" + } + } + } + close $f + } + set t [open tclIndex a+] + puts $t $idx nonewline + close $t + cd $old + return "$oc objects, $mc methods" +} + +# +# if cutTheArg not 0, it cut from upvar argsList +# +::xotcl::Object instproc extractConfigureArg {al name {cutTheArg 0}} { + set value "" + upvar $al argList + set largs [llength $argList] + for {set i 0} {$i < $largs} {incr i} { + if {[lindex $argList $i] == $name && $i + 1 < $largs} { + set startIndex $i + set endIndex [expr {$i + 1}] + while {$endIndex < $largs && + [string first - [lindex $argList $endIndex]] != 0} { + lappend value [lindex $argList $endIndex] + incr endIndex + } + } + } + if {[info exists startIndex] && $cutTheArg != 0} { + set argList [lreplace $argList $startIndex [expr {$endIndex - 1}]] + } + return $value +} + +::xotcl::Object create ::xotcl::rcs +::xotcl::rcs proc date string { + lreplace [lreplace $string 0 0] end end +} +::xotcl::rcs proc version string { + lindex $string 2 +} + +# if HOME is not set, and ~ is resolved, Tcl chokes on that +if {![info exists ::env(HOME)]} {set ::env(HOME) /root} +set ::xotcl::confdir ~/.xotcl +set ::xotcl::logdir $::xotcl::confdir/log + +::xotcl::Class proc __unknown name { + #unknown $name +} + +# +# package support +# +::xotcl::Class instproc uses list { + foreach package $list { + ::xotcl::package import -into [self] $package + puts stderr "*** using ${package}::* in [self]" + } +} +::xotcl::Class create ::xotcl::package -superclass ::xotcl::Class -parameter { + provide + {version 1.0} + {autoexport {}} + {export {}} +} +::xotcl::package proc create {name args} { + set nq [namespace qualifiers $name] + if {$nq ne "" && ![namespace exists $nq]} {Object create $nq} + next +} +::xotcl::package proc extend {name args} { + my require $name + eval $name configure $args +} +::xotcl::package instproc contains script { + if {[my exists provide]} { + package provide [my provide] [my version] + } else { + package provide [self] [my version] + } + namespace eval [self] {namespace import ::xotcl::*} + namespace eval [self] $script + foreach e [my export] { + set nq [namespace qualifiers $e] + if {$nq ne ""} { + namespace eval [self]::$nq [list namespace export [namespace tail $e]] + } else { + namespace eval [self] [list namespace export $e] + } + } + foreach e [my autoexport] { + namespace eval :: [list namespace import [self]::$e] + } +} +::xotcl::package configure \ + -set component . \ + -set verbose 0 \ + -set packagecmd ::package + +::xotcl::package proc unknown args { + #puts stderr "unknown: package $args" + eval [my set packagecmd] $args +} +::xotcl::package proc verbose value { + my set verbose $value +} +::xotcl::package proc present args { + if {$::tcl_version<8.3} { + my instvar loaded + switch -exact -- [lindex $args 0] { + -exact {set pkg [lindex $args 1]} + default {set pkg [lindex $args 0]} + } + if {[info exists loaded($pkg)]} { + return $loaded($pkg) + } else { + error "not found" + } + } else { + eval [my set packagecmd] present $args + } +} +::xotcl::package proc import {{-into ::} pkg} { + my require $pkg + namespace eval $into [subst -nocommands { + #puts stderr "*** package import ${pkg}::* into [namespace current]" + namespace import ${pkg}::* + }] + # import subclasses if any + foreach e [$pkg export] { + set nq [namespace qualifiers $e] + if {$nq ne ""} { + namespace eval $into$nq [list namespace import ${pkg}::$e] + } + } +} +::xotcl::package proc require args { + #puts "XOTCL package require $args, current=[namespace current]" + ::xotcl::my instvar component verbose uses loaded + set prevComponent $component + if {[catch {set v [eval package present $args]} msg]} { + #puts stderr "we have to load $msg" + switch -exact -- [lindex $args 0] { + -exact {set pkg [lindex $args 1]} + default {set pkg [lindex $args 0]} + } + set component $pkg + lappend uses($prevComponent) $component + set v [uplevel \#1 [my set packagecmd] require $args] + if {$v ne "" && $verbose} { + set path [lindex [::package ifneeded $pkg $v] 1] + puts "... $pkg $v loaded from '$path'" + set loaded($pkg) $v ;# loaded stuff needed for Tcl 8.0 + } + } + set component $prevComponent + return $v +} + +::xotcl::Object instproc method {name arguments body} { + my proc name $arguments $body +} +::xotcl::Class instproc method { + -per-object:switch name arguments body} { + + if {${per-object}} { + my proc $name $arguments $body + } else { + my instproc $name $arguments $body + } +} + +# setup a temp directory +proc ::xotcl::tmpdir {} { + foreach e [list TMPDIR TEMP TMP] { + if {[info exists ::env($e)] \ + && [file isdirectory $::env($e)] \ + && [file writable $::env($e)]} { + return $::env($e) + } + } + if {$::tcl_platform(platform) eq "windows"} { + foreach d [list "C:\\TEMP" "C:\\TMP" "\\TEMP" "\\TMP"] { + if {[file isdirectory $d] && [file writable $d]} { + return $d + } + } + } + return /tmp +} Index: generic/xotcl.c =================================================================== diff -u -N --- generic/xotcl.c (revision 0) +++ generic/xotcl.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,12430 @@ +/* $Id: xotcl.c,v 1.51 2007/10/12 19:53:32 neumann Exp $ + * + * XOTcl - Extended Object Tcl + * + * Copyright (C) 1999-2007 Gustaf Neumann (a), Uwe Zdun (a) + * + * (a) Vienna University of Economics and Business Administration + * Institute. of Information Systems and New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + * */ + +#define XOTCL_C 1 +#include "xotclInt.h" +#include "xotclAccessInt.h" + +#ifdef KEEP_TCL_CMD_TYPE +/*# include "tclCompile.h"*/ +#endif + +#ifdef COMPILE_XOTCL_STUBS +extern XotclStubs xotclStubs; +#endif + +#ifdef XOTCL_MEM_COUNT +int xotclMemCountInterpCounter = 0; +#endif + + +/* + * Tcl_Obj Types for XOTcl Objects + */ + +#ifdef USE_TCL_STUBS +# define XOTcl_ExprObjCmd(cd,in,objc,objv) \ + XOTclCallCommand(in, XOTE_EXPR, objc, objv) +# define XOTcl_SubstObjCmd(cd,in,objc,objv) \ + XOTclCallCommand(in, XOTE_SUBST, objc, objv) +#else +# define XOTcl_ExprObjCmd(cd,in,objc,objv) \ + Tcl_ExprObjCmd(cd, in, objc, objv) +# define XOTcl_SubstObjCmd(cd,in,objc,objv) \ + Tcl_SubstObjCmd(cd, in, objc, objv) +#endif + + +static int SetXOTclObjectFromAny(Tcl_Interp *in, Tcl_Obj *objPtr); +static void UpdateStringOfXOTclObject(Tcl_Obj *objPtr); +static void FreeXOTclObjectInternalRep(Tcl_Obj *objPtr); +static void DupXOTclObjectInternalRep(Tcl_Obj *src, Tcl_Obj *cpy); + +static Tcl_Obj*NameInNamespaceObj(Tcl_Interp *in, char *name, Tcl_Namespace *ns); +static Tcl_Namespace *callingNameSpace(Tcl_Interp *in); +XOTCLINLINE static Tcl_Command NSFindCommand(Tcl_Interp *in, char *name, Tcl_Namespace *ns); + +XOTCLINLINE static void GuardAdd(Tcl_Interp *in, XOTclCmdList* filterCL, Tcl_Obj *guard); +static int GuardCheck(Tcl_Interp *in, ClientData guards); +static int GuardCall(XOTclObject *obj, XOTclClass* cl, Tcl_Command cmd, Tcl_Interp *in, ClientData clientData, int push); +static void GuardDel(XOTclCmdList* filterCL); +static int IsMetaClass(Tcl_Interp *in, XOTclClass *cl); +static int hasMixin(Tcl_Interp *in, XOTclObject *obj, XOTclClass *cl); +static int isSubType(XOTclClass *subcl, XOTclClass *cl); + +static Tcl_ObjType XOTclObjectType = { + "XOTclObject", + FreeXOTclObjectInternalRep, + DupXOTclObjectInternalRep, + UpdateStringOfXOTclObject, + SetXOTclObjectFromAny +}; + +typedef enum { CALLING_LEVEL, ACTIVE_LEVEL } CallStackLevel; + +typedef struct callFrameContext { + int framesSaved; + Tcl_CallFrame *framePtr; + Tcl_CallFrame *varFramePtr; +} callFrameContext; +typedef struct tclCmdClientData { + XOTclObject *obj; + Tcl_Obj *cmdName; +} tclCmdClientData; +typedef struct forwardCmdClientData { + XOTclObject *obj; + Tcl_Obj *cmdName; + Tcl_ObjCmdProc *objProc; + int passthrough; + int needobjmap; + int verbose; + ClientData cd; + int nr_args; + Tcl_Obj *args; + int objscope; + Tcl_Obj *prefix; + int nr_subcommands; + Tcl_Obj *subcommands; +} forwardCmdClientData; +typedef struct aliasCmdClientData { + XOTclObject *obj; + Tcl_Obj *cmdName; + Tcl_ObjCmdProc *objProc; + ClientData cd; +} aliasCmdClientData; + +static int ObjDispatch(ClientData cd, Tcl_Interp *in, int objc, + Tcl_Obj *CONST objv[], int flags); +XOTCLINLINE static int DoDispatch(ClientData cd, Tcl_Interp *in, int objc, + Tcl_Obj *CONST objv[], int flags); +static int XOTclNextMethod(XOTclObject *obj, Tcl_Interp *in, XOTclClass *givenCl, + char *givenMethod, int objc, Tcl_Obj *CONST objv[], + int useCSObjs); + +static int XOTclForwardMethod(ClientData cd, Tcl_Interp *in, int objc, + Tcl_Obj *CONST objv[]); +static int XOTclObjscopedMethod(ClientData cd, Tcl_Interp *in, int objc, + Tcl_Obj *CONST objv[]); +static int XOTclSetterMethod(ClientData cd, Tcl_Interp *in, int objc, + Tcl_Obj *CONST objv[]); + +static int callDestroyMethod(ClientData cd, Tcl_Interp *in, XOTclObject *obj, int flags); + +static int XOTclObjConvertObject(Tcl_Interp *in, register Tcl_Obj *objPtr, XOTclObject **obj); +static XOTclObject *XOTclpGetObject(Tcl_Interp *in, char *name); +static XOTclClass *XOTclpGetClass(Tcl_Interp *in, char *name); +static XOTclCallStackContent* CallStackGetFrame(Tcl_Interp *in); +#if !defined(NDEBUG) +static void checkAllInstances(Tcl_Interp *in, XOTclClass *startCl, int lvl); +#endif + + + + + + +#ifdef PRE81 +/* for backward compatibility only +*/ +static int +Tcl_EvalObjv(Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[], int flags) { + int i, result; + Tcl_DString ds, *dsp = &ds; + + assert(flags == 0); + DSTRING_INIT(dsp); + for (i = 0; i < objc; i++) { + Tcl_DStringAppendElement(dsp, ObjStr(objv[i])); + } + result = Tcl_Eval(in, Tcl_DStringValue(dsp)); + DSTRING_FREE(dsp); + return result; +} +static int +Tcl_EvalEx(Tcl_Interp *in, char *cmd, int len, int flags) { + return Tcl_Eval(in, cmd); +} +static int +Tcl_SubstObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + char *ov[20]; + int i; + assert(objc<19); + for (i=0; ifield)) +#endif +#endif + +#if defined(PRE85) && FORWARD_COMPATIBLE +/* + * Define the types missing for the forward compatible mode + */ +typedef Var * (Tcl_VarHashCreateVarFunction) _ANSI_ARGS_( + (TclVarHashTable *tablePtr, Tcl_Obj *key, int *newPtr) +); +typedef void (Tcl_InitVarHashTableFunction) _ANSI_ARGS_( + (TclVarHashTable *tablePtr, Namespace *nsPtr) +); +typedef void (Tcl_CleanupVarFunction) _ANSI_ARGS_ ( + (Var * varPtr, Var *arrayPtr) +); +typedef Var * (Tcl_DeleteVarFunction) _ANSI_ARGS_ ( + (Interp *iPtr, TclVarHashTable *tablePtr) +); +typedef Var * (lookupVarFromTableFunction) _ANSI_ARGS_ ( + (TclVarHashTable *varTable, CONST char *simpleName, XOTclObject *obj) +); + + +typedef struct TclVarHashTable85 { + Tcl_HashTable table; + struct Namespace *nsPtr; +} TclVarHashTable85; + +typedef struct Var85 { + int flags; + union { + Tcl_Obj *objPtr; + TclVarHashTable85 *tablePtr; + struct Var85 *linkPtr; + } value; +} Var85; + +typedef struct VarInHash { + Var85 var; + int refCount; + Tcl_HashEntry entry; +} VarInHash; + + +typedef struct Tcl_CallFrame85 { + Tcl_Namespace *nsPtr; + int dummy1; + int dummy2; + char *dummy3; + char *dummy4; + char *dummy5; + int dummy6; + char *dummy7; + char *dummy8; + int dummy9; + char *dummy10; + char *dummy11; + char *dummy12; +} Tcl_CallFrame85; + +typedef struct CallFrame85 { + Namespace *nsPtr; + int isProcCallFrame; + int objc; + Tcl_Obj *CONST *objv; + struct CallFrame *callerPtr; + struct CallFrame *callerVarPtr; + int level; + Proc *procPtr; + TclVarHashTable *varTablePtr; + int numCompiledLocals; + Var85 *compiledLocals; + ClientData clientData; + void *localCachePtr; +} CallFrame85; + +/* + * These are global variables, but thread-safe, since they + * are only set during initialzation and they are never changed, + * and the variables are single words. + */ +static int forwardCompatibleMode; + +static Tcl_VarHashCreateVarFunction *tclVarHashCreateVar; +static Tcl_InitVarHashTableFunction *tclInitVarHashTable; +static Tcl_CleanupVarFunction *tclCleanupVar; +static lookupVarFromTableFunction *lookupVarFromTable; + +static int varRefCountOffset; +static int varHashTableSize; + +# define VarHashRefCount(varPtr) \ + (*((int *) (((char *)(varPtr))+varRefCountOffset))) + +# define VarHashGetValue(hPtr) \ + (forwardCompatibleMode ? \ + (Var *) ((char *)hPtr - TclOffset(VarInHash, entry)) : \ + (Var *) Tcl_GetHashValue(hPtr) \ + ) + +#define VarHashGetKey(varPtr) \ + (((VarInHash *)(varPtr))->entry.key.objPtr) + +#define VAR_TRACED_READ85 0x10 /* TCL_TRACE_READS */ +#define VAR_TRACED_WRITE85 0x20 /* TCL_TRACE_WRITES */ +#define VAR_TRACED_UNSET85 0x40 /* TCL_TRACE_UNSETS */ +#define VAR_TRACED_ARRAY85 0x800 /* TCL_TRACE_ARRAY */ +#define VAR_TRACE_ACTIVE85 0x2000 +#define VAR_SEARCH_ACTIVE85 0x4000 +#define VAR_ALL_TRACES85 \ + (VAR_TRACED_READ85|VAR_TRACED_WRITE85|VAR_TRACED_ARRAY85|VAR_TRACED_UNSET85) + +#define VAR_ARRAY85 0x1 +#define VAR_LINK85 0x2 + +#define varFlags(varPtr) \ + (forwardCompatibleMode ? \ + ((Var85 *)varPtr)->flags : \ + (varPtr)->flags \ + ) +#undef TclIsVarScalar +#define TclIsVarScalar(varPtr) \ + (forwardCompatibleMode ? \ + !(((Var85 *)varPtr)->flags & (VAR_ARRAY85|VAR_LINK85)) : \ + ((varPtr)->flags & VAR_SCALAR) \ + ) +#undef TclIsVarArray +#define TclIsVarArray(varPtr) \ + (forwardCompatibleMode ? \ + (((Var85 *)varPtr)->flags & VAR_ARRAY85) : \ + ((varPtr)->flags & VAR_ARRAY) \ + ) +#define TclIsVarNamespaceVar(varPtr) \ + (forwardCompatibleMode ? \ + (((Var85 *)varPtr)->flags & VAR_NAMESPACE_VAR) : \ + ((varPtr)->flags & VAR_NAMESPACE_VAR) \ + ) + +#define TclIsVarTraced(varPtr) \ + (forwardCompatibleMode ? \ + (((Var85 *)varPtr)->flags & VAR_ALL_TRACES85) : \ + (varPtr->tracePtr != NULL) \ + ) +#undef TclIsVarLink +#define TclIsVarLink(varPtr) \ + (forwardCompatibleMode ? \ + (((Var85 *)varPtr)->flags & VAR_LINK85) : \ + (varPtr->flags & VAR_LINK) \ + ) +#undef TclIsVarUndefined +#define TclIsVarUndefined(varPtr) \ + (forwardCompatibleMode ? \ + (((Var85 *)varPtr)->value.objPtr == NULL) : \ + (varPtr->flags & VAR_UNDEFINED) \ + ) +#undef TclSetVarLink +#define TclSetVarLink(varPtr) \ + if (forwardCompatibleMode) \ + ((Var85 *)varPtr)->flags = (((Var85 *)varPtr)->flags & ~VAR_ARRAY85) | VAR_LINK85; \ + else \ + (varPtr)->flags = ((varPtr)->flags & ~(VAR_SCALAR|VAR_ARRAY)) | VAR_LINK + +#undef TclClearVarUndefined +#define TclClearVarUndefined(varPtr) \ + if (!forwardCompatibleMode) \ + (varPtr)->flags &= ~VAR_UNDEFINED + +#undef Tcl_CallFrame_compiledLocals +#define Tcl_CallFrame_compiledLocals(cf) \ + (forwardCompatibleMode ? \ + (Var *)(((CallFrame85 *)cf)->compiledLocals) : \ + (((CallFrame*)cf)->compiledLocals) \ + ) + +#define getNthVar(varPtr,i) \ + (forwardCompatibleMode ? \ + (Var *)(((Var85 *)varPtr)+(i)) : \ + (((Var *)varPtr)+(i)) \ + ) + +#define valueOfVar(type,varPtr,field) \ + (forwardCompatibleMode ? \ + (type *)(((Var85 *)varPtr)->value.field) : \ + (type *)(((Var *)varPtr)->value.field) \ + ) +#endif + + +#if !FORWARD_COMPATIBLE +# define getNthVar(varPtr,i) (((Var *)varPtr)+(i)) +#endif + + +#define TclIsCompiledLocalArgument(compiledLocalPtr) \ + ((compiledLocalPtr)->flags & VAR_ARGUMENT) +#define TclIsCompiledLocalTemporary(compiledLocalPtr) \ + ((compiledLocalPtr)->flags & VAR_TEMPORARY) + +#if defined(PRE85) && !FORWARD_COMPATIBLE +# define VarHashGetValue(hPtr) (Var *)Tcl_GetHashValue(hPtr) +# define VarHashRefCount(varPtr) (varPtr)->refCount +# define TclIsVarTraced(varPtr) (varPtr->tracePtr != NULL) +# define TclIsVarNamespaceVar(varPtr) ((varPtr)->flags & VAR_NAMESPACE_VAR) +# define varHashTableSize sizeof(TclVarHashTable) +# define valueOfVar(type,varPtr,field) (type *)(varPtr)->value.field +#endif + + +#if defined(PRE85) +/* + * We need NewVar from tclVar.c ... but its not exported + */ +static Var *NewVar84() { + register Var *varPtr; + + varPtr = (Var *) ckalloc(sizeof(Var)); + varPtr->value.objPtr = NULL; + varPtr->name = NULL; + varPtr->nsPtr = NULL; + varPtr->hPtr = NULL; + varPtr->refCount = 0; + varPtr->tracePtr = NULL; + varPtr->searchPtr = NULL; + varPtr->flags = (VAR_SCALAR | VAR_UNDEFINED | VAR_IN_HASHTABLE); + return varPtr; +} + +static Var * +VarHashCreateVar84(TclVarHashTable *tablePtr, Tcl_Obj *key, int *newPtr) { + char *newName = ObjStr(key); + Tcl_HashEntry *hPtr = Tcl_CreateHashEntry(tablePtr, newName, newPtr); + Var *varPtr; + + if (newPtr && *newPtr) { + varPtr = NewVar84(); + Tcl_SetHashValue(hPtr, varPtr); + varPtr->hPtr = hPtr; + varPtr->nsPtr = NULL; /* a local variable */ + } else { + varPtr = (Var *) Tcl_GetHashValue(hPtr); + } + + return varPtr; +} + +static void +InitVarHashTable84(TclVarHashTable *tablePtr, Namespace *nsPtr) { + /* fprintf(stderr,"InitVarHashTable84\n"); */ + Tcl_InitHashTable((tablePtr), TCL_STRING_KEYS); +} + +static void +TclCleanupVar84(Var * varPtr, Var *arrayPtr) { + if (TclIsVarUndefined(varPtr) && (varPtr->refCount == 0) + && (varPtr->tracePtr == NULL) + && (varPtr->flags & VAR_IN_HASHTABLE)) { + if (varPtr->hPtr != NULL) { + Tcl_DeleteHashEntry(varPtr->hPtr); + } + ckfree((char *) varPtr); + } + if (arrayPtr != NULL) { + if (TclIsVarUndefined(arrayPtr) && (arrayPtr->refCount == 0) + && (arrayPtr->tracePtr == NULL) + && (arrayPtr->flags & VAR_IN_HASHTABLE)) { + if (arrayPtr->hPtr != NULL) { + Tcl_DeleteHashEntry(arrayPtr->hPtr); + } + ckfree((char *) arrayPtr); + } + } +} +static Var * +LookupVarFromTable84(TclVarHashTable *varTable, CONST char *simpleName, + XOTclObject *obj) { + Var *varPtr = NULL; + Tcl_HashEntry *entryPtr; + + if (varTable) { + entryPtr = Tcl_FindHashEntry(varTable, simpleName); + if (entryPtr) { + varPtr = VarHashGetValue(entryPtr); + } + } + return varPtr; +} +#endif + + +#if defined(PRE85) +# if FORWARD_COMPATIBLE +# define VarHashCreateVar (*tclVarHashCreateVar) +# define InitVarHashTable (*tclInitVarHashTable) +# define CleanupVar (*tclCleanupVar) +# define LookupVarFromTable (*lookupVarFromTable) +# define TclCallFrame Tcl_CallFrame85 +# else +# define VarHashCreateVar VarHashCreateVar84 +# define InitVarHashTable InitVarHashTable84 +# define CleanupVar TclCleanupVar84 +# define LookupVarFromTable LookupVarFromTable84 +# define TclCallFrame Tcl_CallFrame +# endif +#else +# define VarHashCreateVar VarHashCreateVar85 +# define InitVarHashTable TclInitVarHashTable +# define CleanupVar TclCleanupVar +# define LookupVarFromTable LookupVarFromTable85 +# define TclCallFrame Tcl_CallFrame +#endif + + +#if defined(PRE85) +/* + * for backward compatibility + */ + +#define VarHashTable(t) t +#define TclVarHashTable Tcl_HashTable + +static Var * +XOTclObjLookupVar(Tcl_Interp *interp, Tcl_Obj *part1Ptr, CONST char *part2, + int flags, const char *msg, int createPart1, int createPart2, + Var **arrayPtrPtr) { + + return TclLookupVar(interp, ObjStr(part1Ptr), part2, flags, msg, + createPart1, createPart2, arrayPtrPtr); +} + +#define ObjFindNamespace(interp, objPtr) \ + Tcl_FindNamespace((interp), ObjStr(objPtr), NULL, 0); + +#else + +/* + * definitions for tcl 8.5 + */ + +#define VarHashGetValue(hPtr) \ + ((Var *) ((char *)hPtr - TclOffset(VarInHash, entry))) +#define VarHashGetKey(varPtr) \ + (((VarInHash *)(varPtr))->entry.key.objPtr) +#define VarHashTable(varTable) \ + &(varTable)->table +#define XOTclObjLookupVar TclObjLookupVar +#define varHashTableSize sizeof(TclVarHashTable) +#define valueOfVar(type,varPtr,field) (type *)(varPtr)->value.field + +XOTCLINLINE static Tcl_Namespace * +ObjFindNamespace(Tcl_Interp *interp, Tcl_Obj *objPtr) { + Tcl_Namespace *nsPtr; + + if (TclGetNamespaceFromObj(interp, objPtr, &nsPtr) == TCL_OK) { + return nsPtr; + } else { + return NULL; + } +} +#endif + +#if !defined(PRE85) || FORWARD_COMPATIBLE +static XOTCLINLINE Var * +VarHashCreateVar85(TclVarHashTable *tablePtr, Tcl_Obj *key, int *newPtr) +{ + Var *varPtr = NULL; + Tcl_HashEntry *hPtr; + hPtr = Tcl_CreateHashEntry((Tcl_HashTable *) tablePtr, + (char *) key, newPtr); + if (hPtr) { + varPtr = VarHashGetValue(hPtr); + } + return varPtr; +} + +static XOTCLINLINE Var * +LookupVarFromTable85(TclVarHashTable *tablePtr, CONST char *simpleName, + XOTclObject *obj) { + Var *varPtr = NULL; + if (tablePtr) { + Tcl_Obj *keyPtr = Tcl_NewStringObj(simpleName, -1); + Tcl_IncrRefCount(keyPtr); + varPtr = VarHashCreateVar85(tablePtr, keyPtr, NULL); + Tcl_DecrRefCount(keyPtr); + } + return varPtr; +} +#endif + + + + + +/* + * call an XOTcl method + */ +static int +callMethod(ClientData cd, Tcl_Interp *in, Tcl_Obj *method, + int objc, Tcl_Obj *CONST objv[], int flags) { + XOTclObject *obj = (XOTclObject*) cd; + int result; + ALLOC_ON_STACK(Tcl_Obj*,objc, tov); + + tov[0] = obj->cmdName; + tov[1] = method; + + if (objc>2) + memcpy(tov+2, objv, sizeof(Tcl_Obj *)*(objc-2)); + + /*fprintf(stderr, "%%%% callMethod cmdname=%s, method=%s, objc=%d\n", + ObjStr(tov[0]),ObjStr(tov[1]),objc);*/ + result = DoDispatch(cd, in, objc, tov, flags); + /*fprintf(stderr, " callMethod returns %d\n", result);*/ + FREE_ON_STACK(tov); + return result; +} + +int +XOTclCallMethodWithArgs(ClientData cd, Tcl_Interp *in, Tcl_Obj *method, Tcl_Obj *arg, + int givenobjc, Tcl_Obj *CONST objv[], int flags) { + XOTclObject *obj = (XOTclObject*) cd; + int objc = givenobjc + 2; + int result; + ALLOC_ON_STACK(Tcl_Obj*,objc, tov); + + assert(objc>1); + tov[0] = obj->cmdName; + tov[1] = method; + if (objc>2) { + tov[2] = arg; + } + if (objc>3) + memcpy(tov+3, objv, sizeof(Tcl_Obj *)*(objc-3)); + + result = DoDispatch(cd, in, objc, tov, flags); + + FREE_ON_STACK(tov); + return result; +} + +/* + * realize self, class, proc through the [self] command + */ + +XOTCLINLINE static CONST84 char * +GetSelfProc(Tcl_Interp *in) { + /*return Tcl_GetCommandName(in, RUNTIME_STATE(in)->cs.top->cmdPtr);*/ + return Tcl_GetCommandName(in, CallStackGetFrame(in)->cmdPtr); + +} + +XOTCLINLINE static XOTclClass* +GetSelfClass(Tcl_Interp *in) { + /*return RUNTIME_STATE(in)->cs.top->cl;*/ + return CallStackGetFrame(in)->cl; +} + +XOTCLINLINE static XOTclObject* +GetSelfObj(Tcl_Interp *in) { + return CallStackGetFrame(in)->self; +} + +/* extern callable GetSelfObj */ +XOTcl_Object* +XOTclGetSelfObj(Tcl_Interp *in) { + return (XOTcl_Object*)GetSelfObj(in); +} + +XOTCLINLINE static Tcl_Command +GetSelfProcCmdPtr(Tcl_Interp *in) { + /*return RUNTIME_STATE(in)->cs.top->cmdPtr;*/ + return CallStackGetFrame(in)->cmdPtr; +} + +/* + * prints a msg to the screen that oldCmd is deprecated + * optinal: give a new cmd + */ +extern void +XOTclDeprecatedMsg(char *oldCmd, char *newCmd) { + fprintf(stderr, "**\n**\n** The command/method <%s> is deprecated.\n", oldCmd); + if (newCmd) + fprintf(stderr, "** Use <%s> instead.\n", newCmd); + fprintf(stderr, "**\n"); +} + +static int +XOTcl_DeprecatedCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + char *new; + if (objc == 2) + new = 0; + else if (objc == 3) + new = ObjStr(objv[2]); + else + return XOTclObjErrArgCnt(in, NULL, "deprecated oldcmd ?newcmd?"); + XOTclDeprecatedMsg(ObjStr(objv[1]), new); + return TCL_OK; +} +#ifdef DISPATCH_TRACE +static void printObjv(int objc, Tcl_Obj *CONST objv[]) { + int i, j; + if (objc <= 3) j = objc; else j = 3; + for (i=0;i 3) fprintf(stderr," ..."); + fprintf(stderr," (objc=%d)",objc); +} + +static void printCall(Tcl_Interp *in, char *string, int objc, Tcl_Obj *CONST objv[]) { + fprintf(stderr, " (%d) >%s: ", Tcl_Interp_numLevels(in), string); + printObjv(objc, objv); + fprintf(stderr, "\n"); +} +static void printExit(Tcl_Interp *in, char *string, + int objc, Tcl_Obj *CONST objv[], int result) { + fprintf(stderr, " (%d) <%s: ", Tcl_Interp_numLevels(in), string); + /*printObjv(objc, objv);*/ + fprintf(stderr, " result=%d\n", result); +} +#endif + + +/* + * XOTclObject Reference Accounting + */ +#if defined(XOTCLOBJ_TRACE) +# define XOTclObjectRefCountIncr(obj) \ + obj->refCount++; \ + fprintf(stderr, "RefCountIncr %p count=%d %s\n", obj, obj->refCount,obj->cmdName?ObjStr(obj->cmdName):"no name"); \ + MEM_COUNT_ALLOC("XOTclObject RefCount",obj) +# define XOTclObjectRefCountDecr(obj) \ + obj->refCount--; \ + fprintf(stderr, "RefCountDecr %p count=%d\n", obj, obj->refCount); \ + MEM_COUNT_FREE("XOTclObject RefCount", obj) +#else +# define XOTclObjectRefCountIncr(obj) \ + obj->refCount++; \ + MEM_COUNT_ALLOC("XOTclObject RefCount",obj) +# define XOTclObjectRefCountDecr(obj) \ + obj->refCount--; \ + MEM_COUNT_FREE("XOTclObject RefCount",obj) +#endif + +#if defined(XOTCLOBJ_TRACE) +void objTrace(char *string, XOTclObject *obj) { + if (obj) + fprintf(stderr,"--- %s tcl %p %s (%d %p) xotcl %p (%d) %s \n", string, + obj->cmdName, obj->cmdName->typePtr ? obj->cmdName->typePtr->name : "NULL", + obj->cmdName->refCount, obj->cmdName->internalRep.twoPtrValue.ptr1, + obj, obj->refCount, ObjStr(obj->cmdName)); + else + fprintf(stderr,"--- No object: %s\n",string); +} +#else +# define objTrace(a,b) +#endif + + +/* search for tail of name */ +static char * +NSTail(char *string) { + register char *p = string+strlen(string); + while (p > string) { + if (*p == ':' && *(p-1) == ':') return p+1; + p--; + } + return string; +} + +XOTCLINLINE static int +isClassName(char *string) { + return (strncmp((string), "::xotcl::classes", 16) == 0); +} + +/* removes preceding ::xotcl::classes from a string */ +XOTCLINLINE static char * +NSCutXOTclClasses(char *string) { + assert(strncmp((string), "::xotcl::classes", 16) == 0); + return string+16; +} + +XOTCLINLINE static char * +NSCmdFullName(Tcl_Command cmd) { + Tcl_Namespace *nsPtr = Tcl_Command_nsPtr(cmd); + return nsPtr ? nsPtr->fullName : ""; +} + +static void +XOTclCleanupObject(XOTclObject *obj) { + XOTclObjectRefCountDecr(obj); +#if REFCOUNT_TRACE + fprintf(stderr,"###CLNO %p refcount = %d\n", obj, obj->refCount); +#endif + if (obj->refCount <= 0) { + assert(obj->refCount == 0); + assert(obj->flags & XOTCL_DESTROYED); +#if REFCOUNT_TRACE + fprintf(stderr,"###CLNO %p flags %x rc %d destr %d dc %d\n", + obj, obj->flags, + (obj->flags & XOTCL_REFCOUNTED) != 0, + (obj->flags & XOTCL_DESTROYED) != 0, + (obj->flags & XOTCL_DESTROY_CALLED) != 0 + ); +#endif + + MEM_COUNT_FREE("XOTclObject/XOTclClass",obj); +#if defined(XOTCLOBJ_TRACE) || defined(REFCOUNT_TRACE) + fprintf(stderr, "CKFREE Object %p refcount=%d\n", obj, obj->refCount); +#endif +#if !defined(NDEBUG) + memset(obj, 0, sizeof(XOTclObject)); +#endif + /* fprintf(stderr,"CKFREE obj %p\n",obj);*/ + ckfree((char *) obj); + } +} + + + +/* + * Tcl_Obj functions for objects + */ +static void +RegisterObjTypes() { + Tcl_RegisterObjType(&XOTclObjectType); +} + +static void +FreeXOTclObjectInternalRep(register Tcl_Obj *objPtr) { + XOTclObject *obj = (XOTclObject*) objPtr->internalRep.otherValuePtr; + + /* fprintf(stderr,"FIP objPtr %p obj %p obj->cmd %p '%s', bytes='%s'\n", + objPtr,obj, obj->cmdName, ObjStr(obj->cmdName), objPtr->bytes); + */ +#if defined(XOTCLOBJ_TRACE) + if (obj) + fprintf(stderr,"FIP --- tcl %p (%d)\n",objPtr,objPtr->refCount); +#endif + +#if !defined(REFCOUNTED) + if (obj != NULL) { + XOTclCleanupObject(obj); + } +#else + if (obj != NULL) { +#if REFCOUNT_TRACE + fprintf(stderr, "FIP in %p\n", obj->teardown); + fprintf(stderr, "FIP call is destroy %d\n", RUNTIME_STATE(obj->teardown)->callIsDestroy); + fprintf(stderr,"FIP %p flags %x rc %d destr %d dc %d refcount = %d\n", + obj, obj->flags, + (obj->flags & XOTCL_REFCOUNTED) != 0, + (obj->flags & XOTCL_DESTROYED) != 0, + (obj->flags & XOTCL_DESTROY_CALLED) != 0, + obj->refCount + ); +#endif + if (obj->flags & XOTCL_REFCOUNTED && + !(obj->flags & XOTCL_DESTROY_CALLED)) { + Tcl_Interp *in = obj->teardown; + INCR_REF_COUNT(obj->cmdName); + callDestroyMethod((ClientData)obj, in, obj, 0); + /* the call to cleanup is the counterpart of the + INCR_REF_COUNT(obj->cmdName) above */ + XOTclCleanupObject(obj); + } else { + fprintf(stderr, "BEFORE CLEANUPOBJ %x\n", (obj->flags & XOTCL_REFCOUNTED)); + XOTclCleanupObject(obj); + fprintf(stderr, "AFTER CLEANUPOBJ\n"); + } + } +#endif + objPtr->internalRep.otherValuePtr = NULL; + objPtr->typePtr = NULL; +} + +static void +DupXOTclObjectInternalRep(Tcl_Obj *src, Tcl_Obj *cpy) { + XOTclObject *obj = (XOTclObject*)src->internalRep.otherValuePtr; +#if defined(XOTCLOBJ_TRACE) + if (obj) fprintf(stderr,"DIP --- tcl %p (%d)\n", src, src->refCount); +#endif + XOTclObjectRefCountIncr(obj); + cpy->internalRep.otherValuePtr = src->internalRep.otherValuePtr; + cpy->typePtr = src->typePtr; +} + +static int +SetXOTclObjectFromAny(Tcl_Interp *in, register Tcl_Obj *objPtr) { + Tcl_ObjType *oldTypePtr = objPtr->typePtr; + char *string = ObjStr(objPtr); + XOTclObject *obj; + Tcl_Obj *tmpName = NULL; + int result = TCL_OK; + +#ifdef XOTCLOBJ_TRACE + fprintf(stderr,"SetXOTclObjectFromAny %p '%s' %p\n", + objPtr,string,objPtr->typePtr); + if (oldTypePtr) + fprintf(stderr," convert %s to XOTclObject\n", oldTypePtr->name); +#endif + + if (!isAbsolutePath(string)) { + char *nsString; + tmpName = NameInNamespaceObj(in,string,callingNameSpace(in)); + + nsString = ObjStr(tmpName); + INCR_REF_COUNT(tmpName); + obj = XOTclpGetObject(in, nsString); + DECR_REF_COUNT(tmpName); + if (!obj) { + /* retry with global namespace */ + tmpName = Tcl_NewStringObj("::",2); + Tcl_AppendToObj(tmpName,string,-1); + INCR_REF_COUNT(tmpName); + obj = XOTclpGetObject(in, ObjStr(tmpName)); + DECR_REF_COUNT(tmpName); + } + } else { + obj = XOTclpGetObject(in, string); + } + +#if 0 + obj = XOTclpGetObject(in, string); +#endif + + if (obj) { + if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { +#ifdef XOTCLOBJ_TRACE + fprintf(stderr," freeing type=%p, type=%s\n", + objPtr->typePtr, objPtr->typePtr ? objPtr->typePtr->name : ""); +#endif + oldTypePtr->freeIntRepProc(objPtr); + } + XOTclObjectRefCountIncr(obj); +#if defined(XOTCLOBJ_TRACE) + fprintf(stderr, "SetXOTclObjectFromAny tcl %p (%d) xotcl %p (%d)\n", + objPtr, objPtr->refCount, obj, obj->refCount); +#endif + objPtr->internalRep.otherValuePtr = (XOTclObject*) obj; + objPtr->typePtr = &XOTclObjectType; + } else + result = TCL_ERROR; + + return result; +} + +static void +UpdateStringOfXOTclObject(register Tcl_Obj *objPtr) { + XOTclObject *obj = (XOTclObject *)objPtr->internalRep.otherValuePtr; + char *nsFullName = NULL; + +#ifdef XOTCLOBJ_TRACE + fprintf(stderr,"UpdateStringOfXOTclObject %p refCount %d\n", + objPtr,objPtr->refCount); + fprintf(stderr," teardown %p id %p destroyCalled %d\n", + obj->teardown, obj->id, (obj->flags & XOTCL_DESTROY_CALLED)); +#endif + + /* Here we use GetCommandName, because it doesnt need + Interp*, but Tcl_GetCommandFullName(in,obj->id,ObjName); does*/ + if (obj && !(obj->flags & XOTCL_DESTROY_CALLED)) { + Tcl_DString ds, *dsp = &ds; + unsigned l; + DSTRING_INIT(dsp); + nsFullName = NSCmdFullName(obj->id); + if (!(*nsFullName==':' && *(nsFullName+1)==':' && + *(nsFullName+2)=='\0')) { + Tcl_DStringAppend(dsp, nsFullName, -1); + } + Tcl_DStringAppend(dsp, "::", 2); + Tcl_DStringAppend(dsp, Tcl_GetCommandName(NULL, obj->id), -1); + + l = (unsigned) Tcl_DStringLength(dsp)+1; + objPtr->bytes = (char *) ckalloc(l); + memcpy(objPtr->bytes, Tcl_DStringValue(dsp), l); + objPtr->length = Tcl_DStringLength(dsp); + DSTRING_FREE(dsp); + } else if (obj) { + fprintf(stderr,"try to read string of deleted command\n"); + FreeXOTclObjectInternalRep(objPtr); + objPtr->bytes = NULL; + objPtr->length = 0; + } else { + objPtr->bytes = NULL; + objPtr->length = 0; + } + /* + fprintf(stderr, "+++UpdateStringOfXOTclObject bytes='%s',length=%d\n", + objPtr->bytes,objPtr->length); + */ +} + +#ifdef NOTUSED +static Tcl_Obj * +NewXOTclObjectObj(register XOTclObject *obj) { + register Tcl_Obj *objPtr = 0; + XOTclNewObj(objPtr); + objPtr->bytes = NULL; + objPtr->internalRep.otherValuePtr = obj; + objPtr->typePtr = &XOTclObjectType; +#ifdef XOTCLOBJ_TRACE + fprintf(stderr,"NewXOTclObjectObj %p\n",objPtr); +#endif + return objPtr; +} +#endif + +static Tcl_Obj * +NewXOTclObjectObjName(register XOTclObject *obj, char *name, unsigned l) +{ + register Tcl_Obj *objPtr = 0; + + XOTclNewObj(objPtr); + + objPtr->length = l; + objPtr->bytes = ckalloc(l+1); + memcpy(objPtr->bytes, name, l); + *(objPtr->bytes+l) = 0; + objPtr->internalRep.otherValuePtr = obj; + objPtr->typePtr = &XOTclObjectType; + +#ifdef XOTCLOBJ_TRACE + fprintf(stderr,"NewXOTclObjectObjName tcl %p (%d) xotcl %p (%d) %s\n", + objPtr, objPtr->refCount, obj, obj->refCount, objPtr->bytes); +#endif + XOTclObjectRefCountIncr(obj); + + return objPtr; +} + +#ifdef KEEP_TCL_CMD_TYPE +XOTCLINLINE static Tcl_ObjType * +GetCmdNameType(Tcl_ObjType *cmdType) { + static Tcl_ObjType *tclCmdNameType = NULL; + + if (tclCmdNameType == NULL) { +# if defined(PRE82) + if (cmdType + && cmdType != &XOTclObjectType + && !strcmp(cmdType->name,"cmdName")) { + tclCmdNameType = cmdType; + } +# else + static XOTclMutex initMutex = 0; + XOTclMutexLock(&initMutex); + if (tclCmdNameType == NULL) + tclCmdNameType = Tcl_GetObjType("cmdName"); + XOTclMutexUnlock(&initMutex); +# endif + } + return tclCmdNameType; +} +#endif + +#if NOTUSED +static int +XOTclObjGetObject(Tcl_Interp *in, register Tcl_Obj *objPtr, XOTclObject **obj) { + int result; + register Tcl_ObjType *cmdType = objPtr->typePtr; + XOTclObject *o; + + if (cmdType == &XOTclObjectType) { + o = (XOTclObject*) objPtr->internalRep.otherValuePtr; + if (!(o->flags & XOTCL_DESTROYED)) { + *obj = o; + return TCL_OK; + } + } + + if (cmdType == GetCmdNameType(cmdType)) { + Tcl_Command cmd = Tcl_GetCommandFromObj(in, objPtr); + /*fprintf(stderr,"obj is of type tclCmd\n");*/ + if (cmd) { + o = XOTclGetObjectFromCmdPtr(cmd); + if (o) { + *obj = o; + return TCL_OK; + } + } + } + + o = XOTclpGetObject(in, ObjStr(objPtr)); + if (o) { + *obj = o; + return TCL_OK; + } + return TCL_ERROR; +} +#endif + +static int +XOTclObjConvertObject(Tcl_Interp *in, Tcl_Obj *objPtr, XOTclObject **obj) { + int result; + register Tcl_ObjType *cmdType = objPtr->typePtr; + + /* + * Only really share the "::x" Tcl_Objs but not "x" because we so not have + * references upon object kills and then will get dangling + * internalRep references to killed XOTclObjects + */ + if (cmdType == &XOTclObjectType) { + /*fprintf(stderr,"obj is of type XOTclObjectType\n");*/ + if (obj) { + XOTclObject *o = (XOTclObject*) objPtr->internalRep.otherValuePtr; + int refetch = 0; + if (o->flags & XOTCL_DESTROYED) { + /* fprintf(stderr,"????? calling free by hand\n"); */ + FreeXOTclObjectInternalRep(objPtr); + refetch = 1; + result = SetXOTclObjectFromAny(in, objPtr); + if (result == TCL_OK) { + o = (XOTclObject*) objPtr->internalRep.otherValuePtr; + assert(o && !(o->flags & XOTCL_DESTROYED)); + } + } else { + result = TCL_OK; + } + + *obj = o; + +#ifdef XOTCLOBJ_TRACE + if (result == TCL_OK) + fprintf(stderr,"XOTclObjConvertObject tcl %p (%d) xotcl %p (%d) r=%d %s\n", + objPtr, objPtr->refCount, o, o->refCount, refetch, objPtr->bytes); + else + fprintf(stderr,"XOTclObjConvertObject tcl %p (%d) **** rc=%d r=%d %s\n", + objPtr, objPtr->refCount, result, refetch, objPtr->bytes); +#endif + } else { + result = TCL_OK; + } +#ifdef KEEP_TCL_CMD_TYPE + } else if (cmdType == GetCmdNameType(cmdType)) { + Tcl_Command cmd = Tcl_GetCommandFromObj(in, objPtr); + /*fprintf(stderr,"obj %s is of type tclCmd, cmd=%p\n",ObjStr(objPtr),cmd);*/ + if (cmd) { + XOTclObject *o = XOTclGetObjectFromCmdPtr(cmd); + /* + fprintf(stderr,"Got Object from '%s' %p\n",objPtr->bytes,o); + fprintf(stderr,"cmd->objProc %p == %p, proc=%p\n", + Tcl_Command_objProc(cmd), XOTclObjDispatch, + Tcl_Command_proc(cmd) ); + */ + if (o) { + if (obj) *obj = o; + result = TCL_OK; + } else { + goto convert_to_xotcl_object; + } + } else goto convert_to_xotcl_object; +#endif + } else { +#ifdef KEEP_TCL_CMD_TYPE + convert_to_xotcl_object: +#endif + result = SetXOTclObjectFromAny(in, objPtr); + if (result == TCL_OK && obj) { + *obj = (XOTclObject*) objPtr->internalRep.otherValuePtr; + } + } + return result; +} + +#ifndef NAMESPACEINSTPROCS +static Tcl_Namespace * +GetCallerVarFrame(Tcl_Interp *in, Tcl_CallFrame *varFramePtr) { + Tcl_Namespace *nsPtr = NULL; + if (varFramePtr) { + Tcl_CallFrame *callerVarPtr = Tcl_CallFrame_callerVarPtr(varFramePtr); + if (callerVarPtr) { + nsPtr = (Tcl_Namespace *)callerVarPtr->nsPtr; + } + } + if (nsPtr == NULL) + nsPtr = Tcl_Interp_globalNsPtr(in); + + return nsPtr; +} +#endif + +static Tcl_Obj* +NameInNamespaceObj(Tcl_Interp *in, char *name, Tcl_Namespace *ns) { + Tcl_Obj *objName; + int len; + char *p; + + /*fprintf(stderr,"NameInNamespaceObj %s (%p) ",name,ns);*/ + if (!ns) + ns = Tcl_GetCurrentNamespace(in); + objName = Tcl_NewStringObj(ns->fullName,-1); + len = Tcl_GetCharLength(objName); + p = ObjStr(objName); + if (len == 2 && p[0] == ':' && p[1] == ':') { + } else { + Tcl_AppendToObj(objName,"::",2); + } + Tcl_AppendToObj(objName, name, -1); + + /*fprintf(stderr,"returns %s\n",ObjStr(objName));*/ + return objName; +} + + + +static int +GetXOTclClassFromObj(Tcl_Interp *in, register Tcl_Obj *objPtr, + XOTclClass **cl, int retry) { + XOTclObject *obj; + XOTclClass *cls = NULL; + int result = TCL_OK; + char *objName = ObjStr(objPtr); + + /*fprintf(stderr, "GetXOTclClassFromObj %s retry %d\n", objName, retry);*/ + + if (retry) { + /* we refer to an existing object; use command resolver */ + if (!isAbsolutePath(objName)) { + Tcl_Command cmd = NSFindCommand(in, objName, callingNameSpace(in)); + + /*fprintf(stderr, "GetXOTclClassFromObj %s cmd = %p cl=%p retry=%d\n", + objName, cmd, cmd ? XOTclGetClassFromCmdPtr(cmd) : NULL, retry);*/ + if (cmd) { + cls = XOTclGetClassFromCmdPtr(cmd); + if (cl) *cl = cls; + } + } + } + + if (!cls) { + result = XOTclObjConvertObject(in, objPtr, &obj); + if (result == TCL_OK) { + cls = XOTclObjectToClass(obj); + if (cls) { + if (cl) *cl = cls; + } else { + /* we have an object, but no class */ + result = TCL_ERROR; + } + } + } + + if (!cls && retry) { + Tcl_Obj *ov[3]; + ov[0] = RUNTIME_STATE(in)->theClass->object.cmdName; + ov[1] = XOTclGlobalObjects[XOTE___UNKNOWN]; + if (isAbsolutePath(objName)) { + ov[2] = objPtr; + } else { + ov[2] = NameInNamespaceObj(in,objName,callingNameSpace(in)); + } + INCR_REF_COUNT(ov[2]); + /*fprintf(stderr,"+++ calling %s __unknown for %s, objPtr=%s\n", + ObjStr(ov[0]), ObjStr(ov[2]), ObjStr(objPtr)); */ + + result = Tcl_EvalObjv(in, 3, ov, 0); + if (result == TCL_OK) { + result = GetXOTclClassFromObj(in, objPtr, cl, 0); + } + DECR_REF_COUNT(ov[2]); + } + + /*fprintf(stderr, "GetXOTclClassFromObj %s returns %d cls = %p *cl = %p\n", + objName, result, cls, cl?*cl:NULL);*/ + return result; +} + +extern void +XOTclFreeClasses(XOTclClasses* sl) { + XOTclClasses *n; + for (; sl; sl = n) { + n = sl->next; + FREE(XOTclClasses,sl); + } +} + +extern XOTclClasses** +XOTclAddClass(XOTclClasses **cList, XOTclClass *cl, ClientData cd) { + XOTclClasses *l = *cList, *element = NEW(XOTclClasses); + element->cl = cl; + element->clientData = cd; + element->next = NULL; + if (l) { + while (l->next) l = l->next; + l->next = element; + } else + *cList = element; + return &(element->next); +} + +/* + * precedence ordering functions + */ + +enum colors { WHITE, GRAY, BLACK }; + +static XOTclClasses* Super(XOTclClass *cl) { return cl->super; } +static XOTclClasses* Sub(XOTclClass *cl) { return cl->sub; } + + +static int +TopoSort(XOTclClass *cl, XOTclClass *base, XOTclClasses* (*next)(XOTclClass*)) { + /*XOTclClasses* sl = (*next)(cl);*/ + XOTclClasses* sl = next == Super ? cl->super : cl->sub; + XOTclClasses* pl; + + /* + * careful to reset the color of unreported classes to + * white in case we unwind with error, and on final exit + * reset color of reported classes to white + */ + + cl->color = GRAY; + for (; sl != 0; sl = sl->next) { + XOTclClass *sc = sl->cl; + if (sc->color == GRAY) { cl->color = WHITE; return 0; } + if (sc->color == WHITE && !TopoSort(sc, base, next)) { + cl->color = WHITE; + if (cl == base) { + XOTclClasses* pc = cl->order; + while (pc != 0) { pc->cl->color = WHITE; pc = pc->next; } + } + return 0; + } + } + cl->color = BLACK; + pl = NEW(XOTclClasses); + pl->cl = cl; + pl->next = base->order; + base->order = pl; + if (cl == base) { + XOTclClasses* pc = cl->order; + while (pc != 0) { pc->cl->color = WHITE; pc = pc->next; } + } + return 1; +} + +static XOTclClasses* +TopoOrder(XOTclClass *cl, XOTclClasses* (*next)(XOTclClass*)) { + if (TopoSort(cl, cl, next)) + return cl->order; + XOTclFreeClasses(cl->order); + cl->order = 0; + return 0; +} + +static XOTclClasses* +ComputeOrder(XOTclClass *cl, XOTclClasses *order, XOTclClasses* (*direction)(XOTclClass*)) { + if (order) + return order; + return (cl->order = TopoOrder(cl, direction)); +} + +extern XOTclClasses* +XOTclComputePrecedence(XOTclClass *cl) { + return ComputeOrder(cl, cl->order, Super); +} + +extern XOTclClasses* +XOTclComputeDependents(XOTclClass *cl) { + return ComputeOrder(cl, cl->order, Sub); +} + + +static void +FlushPrecedences(XOTclClass *cl) { + XOTclClasses* pc; + XOTclFreeClasses(cl->order); + cl->order = 0; + pc = ComputeOrder(cl, cl->order, Sub); + + /* + * ordering doesn't matter here - we're just using toposort + * to find all lower classes so we can flush their caches + */ + + if (pc) pc = pc->next; + for (; pc; pc = pc->next) { + XOTclFreeClasses(pc->cl->order); + pc->cl->order = 0; + } + XOTclFreeClasses(cl->order); + cl->order = 0; +} + +static void +AddInstance(XOTclObject *obj, XOTclClass *cl) { + obj->cl = cl; + if (cl != 0) { + int nw; + (void) Tcl_CreateHashEntry(&cl->instances, (char *)obj, &nw); + } +} + +static int +RemoveInstance(XOTclObject *obj, XOTclClass *cl) { + if (cl) { + Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&cl->instances, (char *)obj); + if (hPtr) { + Tcl_DeleteHashEntry(hPtr); + return 1; + } + } + return 0; +} + +/* + * superclass/subclass list maintenance + */ + +static void +AS(XOTclClass *cl, XOTclClass *s, XOTclClasses **sl) { + register XOTclClasses* l = *sl; + while (l && l->cl != s) l = l->next; + if (!l) { + XOTclClasses* sc = NEW(XOTclClasses); + sc->cl = s; + sc->next = *sl; + *sl = sc; + } +} + +static void +AddSuper(XOTclClass *cl, XOTclClass *super) { + if (cl && super) { + /* + * keep corresponding sub in step with super + */ + AS(cl, super, &cl->super); + AS(super, cl, &super->sub); + } +} + +static int +RemoveSuper1(XOTclClass *cl, XOTclClass *s, XOTclClasses **sl) { + XOTclClasses* l = *sl; + if (!l) return 0; + if (l->cl == s) { + *sl = l->next; + FREE(XOTclClasses,l); + return 1; + } + while (l->next && l->next->cl != s) l = l->next; + if (l->next) { + XOTclClasses* n = l->next->next; + FREE(XOTclClasses,l->next); + l->next = n; + return 1; + } + return 0; +} + +static int +RemoveSuper(XOTclClass *cl, XOTclClass *super) { + /* + * keep corresponding sub in step with super + */ + int sp = RemoveSuper1(cl, super, &cl->super); + int sb = RemoveSuper1(super, cl, &super->sub); + + return sp && sb; +} + +/* + * internal type checking + */ + +extern XOTcl_Class* +XOTclIsClass(Tcl_Interp *in, ClientData cd) { + if (cd && XOTclObjectIsClass((XOTclObject *)cd)) + return (XOTcl_Class*) cd; + return 0; +} + +/* + * methods lookup + */ +/*XOTCLINLINE*/ +static Tcl_Command +FindMethod(char *methodName, Tcl_Namespace* nsPtr) { + Tcl_HashEntry *entryPtr; +#if 0 + Tcl_HashTable *cmdTable; + /* if somebody messes around with the deleteProc, we conclude that the + entries of the cmdTable are not ours ... */ + cmdTable = Tcl_Namespace_deleteProc(nsPtr) ? Tcl_Namespace_cmdTable(nsPtr) : NULL ; + if (cmdTable== NULL) { + fprintf(stderr,"********************** FindMethod %s cmdTable = %p\n",methodName, cmdTable); + } + /*fprintf(stderr,"FindMethod '%s', cmdTable %p ns=%p \n",methodName,cmdTable,nsPtr);*/ + + if (cmdTable && (entryPtr = Tcl_FindHashEntry(cmdTable, methodName))) { + return (Tcl_Command) Tcl_GetHashValue(entryPtr); + } + /*fprintf(stderr, "find %s in %p returns %p\n",methodName,cmdTable,cmd);*/ + return NULL; +#endif + if ((entryPtr = Tcl_FindHashEntry(Tcl_Namespace_cmdTable(nsPtr), methodName))) { + return (Tcl_Command) Tcl_GetHashValue(entryPtr); + } + /*fprintf(stderr, "find %s in %p returns %p\n",methodName,cmdTable,cmd);*/ + return NULL; +} + +static XOTclClass* +SearchPLMethod(register XOTclClasses* pl, char *nm, Tcl_Command *cmd) { + /* Search the class hierarchy */ + for (; pl; pl = pl->next) { + Tcl_Command pi = FindMethod(nm, pl->cl->nsPtr); + if (pi) { + *cmd = pi; + return pl->cl; + } + } + return NULL; +} + + +static XOTclClass* +SearchCMethod(XOTclClass *cl, char *nm, Tcl_Command *cmd) { + assert(cl); + return SearchPLMethod(ComputeOrder(cl, cl->order, Super), nm, cmd); +} + +static int +callDestroyMethod(ClientData cd, Tcl_Interp *in, XOTclObject *obj, int flags) { + int result; + + /* don't call destroy after exit handler started physical + destruction */ + if (RUNTIME_STATE(in)->exitHandlerDestroyRound == + XOTCL_EXITHANDLER_ON_PHYSICAL_DESTROY) + return TCL_OK; + + /* fprintf(stderr," obj %p flags %.4x %d\n",obj, obj->flags, + RUNTIME_STATE(in)->callDestroy);*/ + /* we don't call destroy, if we're in the exit handler + during destruction of Object and Class */ + if (!RUNTIME_STATE(in)->callDestroy) { + obj->flags |= XOTCL_DESTROY_CALLED; + /* return TCL_ERROR so that clients know we haven't deleted the + associated command yet */ + return TCL_ERROR; + } + /*fprintf(stderr, "+++ calldestroy flags=%d\n",flags);*/ + if (obj->flags & XOTCL_DESTROY_CALLED) + return TCL_OK; + +#if !defined(NDEBUG) + {char *cmdName = ObjStr(obj->cmdName); + assert(cmdName != NULL); + /*fprintf(stderr,"findCommand %s -> %p obj->id %p\n",cmdName, + Tcl_FindCommand(in, cmdName, NULL, 0),obj->id);*/ + /*assert(Tcl_FindCommand(in, cmdName, NULL, 0) != NULL);*/ + /*fprintf(stderr,"callDestroyMethod: %p command to be destroyed '%s' does not exist\n", + obj, cmdName);*/ + } +#endif + + +#ifdef OBJDELETION_TRACE + fprintf(stderr, " command found\n"); + PRINTOBJ("callDestroy", obj); +#endif + result = callMethod(cd, in, XOTclGlobalObjects[XOTE_DESTROY], 2, 0, flags); + if (result != TCL_OK) { + static char cmd[] = + "puts stderr \"[self]: Error in instproc destroy\n\ + $::errorCode $::errorInfo\""; + Tcl_EvalEx(in, cmd, -1, 0); + if (++RUNTIME_STATE(in)->errorCount > 20) + panic("too many destroy errors occured. Endless loop?", NULL); + } else { + if (RUNTIME_STATE(in)->errorCount > 0) + RUNTIME_STATE(in)->errorCount--; + } + +#ifdef OBJDELETION_TRACE + fprintf(stderr, "callDestroyMethod for %p exit\n", obj); +#endif + return result; +} + +/* + * conditional memory allocations of optional storage + */ + +extern XOTclObjectOpt * +XOTclRequireObjectOpt(XOTclObject *obj) { + if (!obj->opt) { + obj->opt = NEW(XOTclObjectOpt); + memset(obj->opt, 0, sizeof(XOTclObjectOpt)); + } + return obj->opt; +} + +extern XOTclClassOpt* +XOTclRequireClassOpt(XOTclClass *cl) { + assert(cl); + if (!cl->opt) { + cl->opt = NEW(XOTclClassOpt); + memset(cl->opt, 0, sizeof(XOTclClassOpt)); + } + return cl->opt; +} + + + + +static Tcl_Namespace* +NSGetFreshNamespace(Tcl_Interp *in, ClientData cd, char *name); + +static void +makeObjNamespace(Tcl_Interp *in, XOTclObject *obj) { +#ifdef NAMESPACE_TRACE + fprintf(stderr, "+++ Make Namespace for %s\n", ObjStr(obj->cmdName)); +#endif + if (!obj->nsPtr) { + Tcl_Namespace* nsPtr; + char *cmdName = ObjStr(obj->cmdName); + obj->nsPtr = NSGetFreshNamespace(in, (ClientData)obj, cmdName); + if (!obj->nsPtr) + panic("makeObjNamespace: Unable to make namespace",0); + nsPtr = obj->nsPtr; + + /* + * Copy all obj variables to the newly created namespace + */ + + if (obj->varTable) { + Tcl_HashSearch search; + Tcl_HashEntry *hPtr; + TclVarHashTable *varTable = Tcl_Namespace_varTable(nsPtr); + Tcl_HashTable *varHashTable = VarHashTable(varTable); + Tcl_HashTable *objHashTable = VarHashTable(obj->varTable); + + *varHashTable = *objHashTable; /* copy the table */ + + if (objHashTable->buckets == objHashTable->staticBuckets) { + varHashTable->buckets = varHashTable->staticBuckets; + } + for (hPtr = Tcl_FirstHashEntry(varHashTable, &search); hPtr != NULL; + hPtr = Tcl_NextHashEntry(&search)) { +#if defined(PRE85) + Var *varPtr; +# if FORWARD_COMPATIBLE + if (!forwardCompatibleMode) { + varPtr = (Var *) Tcl_GetHashValue(hPtr); + varPtr->nsPtr = (Namespace *)nsPtr; + } +# else + varPtr = (Var *) Tcl_GetHashValue(hPtr); + varPtr->nsPtr = (Namespace *)nsPtr; +# endif +#endif + hPtr->tablePtr = varHashTable; + } + + ckfree((char *) obj->varTable); + obj->varTable = 0; + } + } +} +/* + typedef int (Tcl_ResolveVarProc) _ANSI_ARGS_(( + * Tcl_Interp* in, CONST char * name, Tcl_Namespace *context, + * int flags, Tcl_Var *rPtr)); + */ +int +varResolver(Tcl_Interp *in, CONST char *name, Tcl_Namespace *ns, int flags, Tcl_Var *varPtr) { + *varPtr = (Tcl_Var)LookupVarFromTable(Tcl_Namespace_varTable(ns), name,NULL); + /*fprintf(stderr,"lookup '%s' successful %d\n",name, *varPtr != NULL);*/ + return *varPtr ? TCL_OK : TCL_ERROR; +} + + +static void +requireObjNamespace(Tcl_Interp *in, XOTclObject *obj) { + if (!obj->nsPtr) makeObjNamespace(in,obj); + /* + Tcl_SetNamespaceResolvers(obj->nsPtr, (Tcl_ResolveCmdProc*)NULL, + varResolver, (Tcl_ResolveCompiledVarProc*)NULL); + */ + +} +extern void +XOTclRequireObjNamespace(Tcl_Interp *in, XOTcl_Object *obj) { + requireObjNamespace(in,(XOTclObject*) obj); +} + + +/* + * Namespace related commands + */ + +static int +NSDeleteCmd(Tcl_Interp *in, Tcl_Namespace* ns, char *name) { + /* a simple deletion would delete a global command with + the same name, if the command is not existing, so + we use the CmdToken */ + Tcl_Command token; + assert(ns); + if ((token = FindMethod(name, ns))) { + return Tcl_DeleteCommandFromToken(in, token); + } + return -1; +} + +static void +CallStackDestroyObject(Tcl_Interp *in, XOTclObject *obj); +static void +PrimitiveCDestroy(ClientData cd); +static void +PrimitiveODestroy(ClientData cd); + +static void +NSDeleteChildren(Tcl_Interp *in, Tcl_Namespace* ns) { + Tcl_HashTable *cmdTable = Tcl_Namespace_cmdTable(ns); + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr; + +#ifdef OBJDELETION_TRACE + fprintf(stderr, "NSDeleteChildren %s\n", ns->fullName); +#endif + + Tcl_ForgetImport(in, ns, "*"); /* don't destroy namespace imported objects */ + + for (hPtr = Tcl_FirstHashEntry(cmdTable, &hSrch); hPtr != 0; + hPtr = Tcl_NextHashEntry(&hSrch)) { + Tcl_Command cmd = (Tcl_Command)Tcl_GetHashValue(hPtr); + if (!Tcl_Command_cmdEpoch(cmd)) { + char *oname = Tcl_GetHashKey(cmdTable, hPtr); + Tcl_DString name; + XOTclObject *obj; + /* fprintf(stderr, " ... child %s\n", oname); */ + + ALLOC_NAME_NS(&name, ns->fullName, oname); + obj = XOTclpGetObject(in, Tcl_DStringValue(&name)); + + if (obj) { + /* fprintf(stderr, " ... obj= %s\n", ObjStr(obj->cmdName));*/ + + /* in the exit handler physical destroy --> directly call destroy */ + if (RUNTIME_STATE(in)->exitHandlerDestroyRound + == XOTCL_EXITHANDLER_ON_PHYSICAL_DESTROY) { + if (XOTclObjectIsClass(obj)) + PrimitiveCDestroy((ClientData) obj); + else + PrimitiveODestroy((ClientData) obj); + } else { + if (obj->teardown != 0 && obj->id && + !(obj->flags & XOTCL_DESTROY_CALLED)) { + if (callDestroyMethod((ClientData)obj, in, obj, 0) != TCL_OK) { + /* destroy method failed, but we have to remove the command + anyway. */ + obj->flags |= XOTCL_DESTROY_CALLED; + + if (obj->teardown) { + CallStackDestroyObject(in, obj); + } + /*(void*) Tcl_DeleteCommandFromToken(in, oid);*/ + } + } + } + } + DSTRING_FREE(&name); + } + } +} + +/* + * ensure that a variable exists on object varTable or nsPtr->varTable, + * if necessary create it. Return Var * if successful, otherwise 0 + */ +static Var * +NSRequireVariableOnObj(Tcl_Interp *in, XOTclObject *obj, char *name, int flgs) { + XOTcl_FrameDecls; + Var *varPtr, *arrayPtr; + + XOTcl_PushFrame(in, obj); + varPtr = TclLookupVar(in, name, 0, flgs, "obj vwait", + /*createPart1*/ 1, /*createPart2*/ 0, &arrayPtr); + XOTcl_PopFrame(in, obj); + return varPtr; +} + +/* delete a namespace recursively, but check whether the + namespace is an object or not */ +static void +NSDeleteNamespace(Tcl_Interp *in, Tcl_Namespace* ns) { + Tcl_HashTable *childTable = Tcl_Namespace_childTable(ns); + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr; + + NSDeleteChildren(in, ns); + for (hPtr = Tcl_FirstHashEntry(childTable, &hSrch); hPtr != 0; + hPtr = Tcl_NextHashEntry(&hSrch)) { + Tcl_Namespace *child = ((Tcl_Namespace*)Tcl_GetHashValue(hPtr)); + NSDeleteNamespace(in, child); + } + /* + fprintf(stderr, "NSDeleteNamespace deleting %s\n", ns->fullName); + */ + MEM_COUNT_FREE("TclNamespace",ns); + Tcl_DeleteNamespace(ns); +} + +static int +XOTcl_DeleteCommandFromToken(Tcl_Interp *in, Tcl_Command cmd) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + XOTclCallStackContent *csc = cs->top; + + for (; csc > cs->content; csc--) { + if (csc->cmdPtr == cmd) { + csc->cmdPtr = NULL; + } + } + return Tcl_DeleteCommandFromToken(in, cmd); +} + +/* + * delete all vars & procs in a namespace + */ +static void +NSCleanupNamespace(Tcl_Interp *in, Tcl_Namespace* ns) { + TclVarHashTable *varTable = Tcl_Namespace_varTable(ns); + Tcl_HashTable *cmdTable = Tcl_Namespace_cmdTable(ns); + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr; + Tcl_Command cmd; + /* + * Delete all variables and initialize var table again + * (deleteVars frees the vartable) + */ + TclDeleteVars((Interp *)in, varTable); + InitVarHashTable(varTable, (Namespace *)ns); + + /* + * Delete all user-defined procs in the namespace + */ + for (hPtr = Tcl_FirstHashEntry(cmdTable, &hSrch); hPtr != 0; + hPtr = Tcl_NextHashEntry(&hSrch)) { + cmd = (Tcl_Command) Tcl_GetHashValue(hPtr); + /* objects should not be deleted here to preseve children deletion order*/ + if (!XOTclGetObjectFromCmdPtr(cmd)) { + /*fprintf(stderr,"NSCleanupNamespace deleting %s %p\n", + Tcl_Command_nsPtr(cmd)->fullName, cmd);*/ + XOTcl_DeleteCommandFromToken(in, cmd); + } + } +} + + +static void +NSNamespaceDeleteProc(ClientData clientData) { + /* dummy for ns identification by pointer comparison */ + XOTclObject *obj = (XOTclObject*) clientData; + /*fprintf(stderr,"namespacedeleteproc obj=%p\n",clientData);*/ + if (obj) { + obj->flags |= XOTCL_NS_DESTROYED; + obj->nsPtr = NULL; + } +} + +void +XOTcl_DeleteNamespace(Tcl_Interp *in, Tcl_Namespace *nsPtr) { + int activationCount = 0; + Tcl_CallFrame *f = (Tcl_CallFrame *)Tcl_Interp_framePtr(in); + + /* + fprintf(stderr, " ... correcting ActivationCount for %s was %d ", + nsPtr->fullName, nsp->activationCount); + */ + while (f) { + if (f->nsPtr == nsPtr) + activationCount++; + f = Tcl_CallFrame_callerPtr(f); + } + + Tcl_Namespace_activationCount(nsPtr) = activationCount; + + /* + fprintf(stderr, "to %d. \n", nsp->activationCount); + */ + MEM_COUNT_FREE("TclNamespace",nsPtr); + if (Tcl_Namespace_deleteProc(nsPtr) != NULL) { + /*fprintf(stderr,"calling deteteNamespace\n");*/ + Tcl_DeleteNamespace(nsPtr); + } +} + +static Tcl_Namespace* +NSGetFreshNamespace(Tcl_Interp *in, ClientData cd, char *name) { + Tcl_Namespace *ns = Tcl_FindNamespace(in, name, NULL, 0); + + if (ns) { + if (ns->deleteProc != NULL || ns->clientData != NULL) { + panic("Namespace '%s' exists already with delProc %p and clientData %p; Can only convert a plain Tcl namespace into an XOTcl namespace", + name, ns->deleteProc, ns->clientData); + } + ns->clientData = cd; + ns->deleteProc = (Tcl_NamespaceDeleteProc*) NSNamespaceDeleteProc; + } else { + ns = Tcl_CreateNamespace(in, name, cd, + (Tcl_NamespaceDeleteProc*) NSNamespaceDeleteProc); + } + MEM_COUNT_ALLOC("TclNamespace",ns); + return ns; +} + + +/* + * check colons for illegal object/class names + */ +XOTCLINLINE static int +NSCheckColons(char *name, unsigned l) { + register char *n = name; + if (*n == '\0') return 0; /* empty name */ + if (l==0) l=strlen(name); + if (*(n+l-1) == ':') return 0; /* name ends with : */ + if (*n == ':' && *(n+1) != ':') return 0; /* name begins with single : */ + for (; *n != '\0'; n++) { + if (*n == ':' && *(n+1) == ':' && *(n+2) == ':') + return 0; /* more than 2 colons in series in a name */ + } + return 1; +} + +/* + * check for parent namespace existance (used before commands are created) + */ + +XOTCLINLINE static int +NSCheckForParent(Tcl_Interp *in, char *name, unsigned l) { + register char *n = name+l; + int result = 1; + + /*search for last '::'*/ + while ((*n != ':' || *(n-1) != ':') && n-1 > name) {n--; } + if (*n == ':' && n > name && *(n-1) == ':') {n--;} + + if ((n-name)>0) { + Tcl_DString parentNSName, *dsp = &parentNSName; + char *parentName; + DSTRING_INIT(dsp); + + Tcl_DStringAppend(dsp, name, (n-name)); + parentName = Tcl_DStringValue(dsp); + + if (Tcl_FindNamespace(in, parentName, (Tcl_Namespace *) NULL, TCL_GLOBAL_ONLY) == 0) { + XOTclObject *parentObj = (XOTclObject*) XOTclpGetObject(in, parentName); + if (parentObj) { + /* this is for classes */ + requireObjNamespace(in, parentObj); + } else { + /* call unknown and try again */ + Tcl_Obj *ov[3]; + int rc; + ov[0] = RUNTIME_STATE(in)->theClass->object.cmdName; + ov[1] = XOTclGlobalObjects[XOTE___UNKNOWN]; + ov[2] = Tcl_NewStringObj(parentName,-1); + INCR_REF_COUNT(ov[2]); + /*fprintf(stderr,"+++ parent... calling __unknown for %s\n", ObjStr(ov[2]));*/ + rc = Tcl_EvalObjv(in, 3, ov, 0); + if (rc == TCL_OK) { + XOTclObject *parentObj = (XOTclObject*) XOTclpGetObject(in, parentName); + if (parentObj) { + requireObjNamespace(in, parentObj); + } + result = (Tcl_FindNamespace(in, parentName, + (Tcl_Namespace *) NULL, TCL_GLOBAL_ONLY) != 0); + } else { + result = 0; + } + DECR_REF_COUNT(ov[2]); + } + } else { + XOTclObject *parentObj = (XOTclObject*) XOTclpGetObject(in, parentName); + if (parentObj) { + requireObjNamespace(in, parentObj); + } + } + DSTRING_FREE(dsp); + } + return result; +} + +/* + * Find the "real" command belonging eg. to an XOTcl class or object. + * Do not return cmds produced by Tcl_Import, but the "real" cmd + * to which they point. + */ +XOTCLINLINE static Tcl_Command +NSFindCommand(Tcl_Interp *in, char *name, Tcl_Namespace *ns) { + Tcl_Command cmd; + if ((cmd = Tcl_FindCommand(in, name, ns, 0))) { + Tcl_Command importedCmd; + if ((importedCmd = TclGetOriginalCommand(cmd))) + cmd = importedCmd; + } + return cmd; +} + + + +/* + * C interface routines for manipulating objects and classes + */ + + +extern XOTcl_Object* +XOTclGetObject(Tcl_Interp *in, char *name) { + return (XOTcl_Object*) XOTclpGetObject(in, name); +} + +/* + * Find an object using a char *name + */ +static XOTclObject* +XOTclpGetObject(Tcl_Interp *in, char *name) { + register Tcl_Command cmd; + assert(name); + cmd = NSFindCommand(in, name, NULL); + + /*if (cmd) { + fprintf(stderr,"+++ XOTclGetObject from %s -> objProc=%p, dispatch=%p\n", + name, Tcl_Command_objProc(cmd), XOTclObjDispatch); + }*/ + + if (cmd && Tcl_Command_objProc(cmd) == XOTclObjDispatch) { + return (XOTclObject*)Tcl_Command_objClientData(cmd); + } + return 0; +} + +/* + * Find a class using a char *name + */ + +extern XOTcl_Class* +XOTclGetClass(Tcl_Interp *in, char *name) { + return (XOTcl_Class*)XOTclpGetClass(in, name); +} + +static XOTclClass* +XOTclpGetClass(Tcl_Interp *in, char *name) { + XOTclObject *obj = XOTclpGetObject(in, name); + return (obj && XOTclObjectIsClass(obj)) ? (XOTclClass*)obj : NULL; +} + +void +XOTclAddPMethod(Tcl_Interp *in, XOTcl_Object *obji, char *nm, Tcl_ObjCmdProc* proc, + ClientData cd, Tcl_CmdDeleteProc* dp) { + XOTclObject *obj = (XOTclObject*) obji; + Tcl_DString newCmd, *cptr = &newCmd; + requireObjNamespace(in, obj); + ALLOC_NAME_NS(cptr, obj->nsPtr->fullName, nm); + Tcl_CreateObjCommand(in, Tcl_DStringValue(cptr), proc, cd, dp); + DSTRING_FREE(cptr); +} + +void +XOTclAddIMethod(Tcl_Interp *in, XOTcl_Class *cli, char *nm, + Tcl_ObjCmdProc* proc, ClientData cd, Tcl_CmdDeleteProc* dp) { + XOTclClass *cl = (XOTclClass*) cli; + Tcl_DString newCmd, *cptr = &newCmd; + ALLOC_NAME_NS(cptr, cl->nsPtr->fullName, nm); + Tcl_CreateObjCommand(in, Tcl_DStringValue(cptr), proc, cd, dp); + DSTRING_FREE(cptr); +} + + +/* + * Generic Tcl_Obj List + */ + +static void +TclObjListFreeList(XOTclTclObjList* list) { + XOTclTclObjList* del; + while (list) { + del = list; + list = list->next; + DECR_REF_COUNT(del->content); + FREE(XOTclTclObjList, del); + } +} + +static Tcl_Obj* +TclObjListNewElement(XOTclTclObjList **list, Tcl_Obj *ov) { + XOTclTclObjList* elt = NEW(XOTclTclObjList); + INCR_REF_COUNT(ov); + elt->content = ov; + elt->next = *list; + *list = elt; + return ov; +} + +/* + * Autonaming + */ + +static Tcl_Obj* +AutonameIncr(Tcl_Interp *in, Tcl_Obj *name, XOTclObject *obj, + int instanceOpt, int resetOpt) { + int valueLength, mustCopy = 1, format = 0; + char *valueString, *c; + Tcl_Obj *valueObject, *result = NULL, *savedResult = NULL; +#ifdef PRE83 + int flgs = 0; +#else + int flgs = TCL_LEAVE_ERR_MSG; +#endif + XOTcl_FrameDecls; + + XOTcl_PushFrame(in, obj); + if (obj->nsPtr) + flgs |= TCL_NAMESPACE_ONLY; + + valueObject = Tcl_ObjGetVar2(in, XOTclGlobalObjects[XOTE_AUTONAMES],name, flgs); + if (valueObject != NULL ) { + long autoname_counter; + /* should probably do an overflow check here */ + Tcl_GetLongFromObj(in, valueObject,&autoname_counter); + autoname_counter++; + if (Tcl_IsShared(valueObject)) { + valueObject = Tcl_DuplicateObj(valueObject); + } + Tcl_SetLongObj(valueObject,autoname_counter); + } + Tcl_ObjSetVar2(in, XOTclGlobalObjects[XOTE_AUTONAMES], name, + valueObject, flgs); + + if (resetOpt) { + if (valueObject != NULL) { /* we have an entry */ + Tcl_UnsetVar2(in, XOTclGlobalStrings[XOTE_AUTONAMES], ObjStr(name), flgs); + } + result = XOTclGlobalObjects[XOTE_EMPTY]; + INCR_REF_COUNT(result); + } else { + if (valueObject == NULL) { + valueObject = Tcl_ObjSetVar2(in, XOTclGlobalObjects[XOTE_AUTONAMES], + name, XOTclGlobalObjects[XOTE_ONE], flgs); + } + if (instanceOpt) { + char buffer[1], firstChar, *nextChars; + nextChars = ObjStr(name); + firstChar = *(nextChars ++); + if (isupper((int)firstChar)) { + buffer[0] = tolower((int)firstChar); + result = Tcl_NewStringObj(buffer,1); + INCR_REF_COUNT(result); + Tcl_AppendToObj(result, nextChars, -1); + mustCopy = 0; + } + } + if (mustCopy) { + result = Tcl_DuplicateObj(name); + INCR_REF_COUNT(result); + /* + fprintf(stderr,"*** copy %p %s = %p\n", name,ObjStr(name),result); + */ + } + /* if we find a % in the autoname -> We use Tcl_FormatObjCmd + to let the autoname string be formated, like Tcl "format" + command, with the value. E.g.: + autoname a%06d --> a000000, a000001, a000002, ... + */ + for (c = ObjStr(result); *c != '\0'; c++) { + if (*c == '%') { + if (*(c+1) != '%') { + format = 1; + break; + } else { + /* when we find a %% we format and then append autoname, e.g. + autoname a%% --> a%1, a%2, ... */ + c++; + } + } + } + if (format) { + ALLOC_ON_STACK(Tcl_Obj*,3, ov); + savedResult = Tcl_GetObjResult(in); + INCR_REF_COUNT(savedResult); + ov[0] = XOTclGlobalObjects[XOTE_FORMAT]; + ov[1] = result; + ov[2] = valueObject; + if (Tcl_EvalObjv(in, 3, ov, 0) != TCL_OK) { + XOTcl_PopFrame(in, obj); + DECR_REF_COUNT(savedResult); + FREE_ON_STACK(ov); + return 0; + } + DECR_REF_COUNT(result); + result = Tcl_DuplicateObj(Tcl_GetObjResult(in)); + INCR_REF_COUNT(result); + Tcl_SetObjResult(in, savedResult); + DECR_REF_COUNT(savedResult); + FREE_ON_STACK(ov); + } else { + valueString = Tcl_GetStringFromObj(valueObject,&valueLength); + Tcl_AppendToObj(result, valueString, valueLength); + /*fprintf(stderr,"+++ append to obj done\n");*/ + } + } + + XOTcl_PopFrame(in, obj); + assert((resetOpt && result->refCount>=1) || (result->refCount == 1)); + return result; +} + +/* + * XOTcl CallStack + */ + +XOTclCallStackContent * +XOTclCallStackFindLastInvocation(Tcl_Interp *in, int offset) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + register XOTclCallStackContent *csc = cs->top; + int topLevel = csc->currentFramePtr ? Tcl_CallFrame_level(csc->currentFramePtr) :0; + int deeper = offset; + + /* skip through toplevel inactive filters, do this offset times */ + for (csc=cs->top; csc > cs->content; csc--) { + if ((csc->callType & XOTCL_CSC_CALL_IS_NEXT) || + (csc->frameType & XOTCL_CSC_TYPE_INACTIVE)) + continue; + if (offset) + offset--; + else { + if (!deeper) { + return csc; + } + if (csc->currentFramePtr && Tcl_CallFrame_level(csc->currentFramePtr) < topLevel) { + return csc; + } + } + } + /* for some reasons, we could not find invocation (topLevel, destroy) */ + return NULL; +} + +static XOTclCallStackContent * +CallStackFindActiveFilter(Tcl_Interp *in) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + register XOTclCallStackContent *csc; + + /* search for first active frame and set tcl frame pointers */ + for (csc=cs->top; csc > cs->content; csc --) { + if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) return csc; + } + /* for some reasons, we could not find invocation (topLevel, destroy) */ + return NULL; +} + +XOTclCallStackContent * +XOTclCallStackFindActiveFrame(Tcl_Interp *in, int offset) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + register XOTclCallStackContent *csc; + + /* search for first active frame and set tcl frame pointers */ + for (csc=cs->top-offset; csc > cs->content; csc --) { + if (!(csc->frameType & XOTCL_CSC_TYPE_INACTIVE)) { + /* we found the highest active frame */ + return csc; + } + } + /* we could not find an active frame; called from toplevel? */ + return NULL; +} + +static void +CallStackUseActiveFrames(Tcl_Interp *in, callFrameContext *ctx) { + XOTclCallStackContent *active, *top = RUNTIME_STATE(in)->cs.top; + Tcl_CallFrame *inFramePtr = (Tcl_CallFrame *) Tcl_Interp_varFramePtr(in); + + active = XOTclCallStackFindActiveFrame(in, 0); + /*fprintf(stderr,"active %p, varFrame(in) %p, topVarFrame %p, active->curr %p\n", + active, inFramePtr, top->currentFramePtr, + active? active->currentFramePtr : NULL);*/ + + if (active == top || inFramePtr == NULL || Tcl_CallFrame_level(inFramePtr) == 0) { + /* top frame is a active frame, or we could not find a calling + frame, call frame pointers are fine */ + ctx->framesSaved = 0; + } else if (active == NULL) { + Tcl_CallFrame *cf = inFramePtr; + /*fprintf(stderr,"active == NULL\n"); */ + /* find a proc frame, which is not equal the top level cmd */ + /* XOTclStackDump(in);*/ + for (; cf && Tcl_CallFrame_level(cf); cf = Tcl_CallFrame_callerPtr(cf)) { + if (Tcl_CallFrame_isProcCallFrame(cf) && cf != top->currentFramePtr) + break; + } + ctx->varFramePtr = inFramePtr; + Tcl_Interp_varFramePtr(in) = (CallFrame *) cf; + ctx->framesSaved = 1; + } else { + Tcl_CallFrame *framePtr; + /*fprintf(stderr,"active == deeper active=%p frame %p, active+1 %p frame %p\n", + active, active->currentFramePtr, + active+1, (active+1)->currentFramePtr);*/ + /* search returned a deeper pointer, use stored tcl frame pointers; + If Tcl is mixed with XOTcl it is needed to use instead of + active->currentFrame the callerPtr of the last inactive frame + unless the last inactive is NULL */ + if ((framePtr = (active+1)->currentFramePtr)) + framePtr = Tcl_CallFrame_callerPtr(framePtr); + else + framePtr = active->currentFramePtr; + ctx->varFramePtr = inFramePtr; + Tcl_Interp_varFramePtr(in) = (CallFrame *) framePtr; + ctx->framesSaved = 1; + } +} + +static void +CallStackRestoreSavedFrames(Tcl_Interp *in, callFrameContext *ctx) { + if (ctx->framesSaved) { + Tcl_Interp_varFramePtr(in) = (CallFrame *)ctx->varFramePtr; + /*RUNTIME_STATE(in)->varFramePtr = ctx->varFramePtr;*/ + + } +} + + +XOTCLINLINE static int +CallStackPush(Tcl_Interp *in, XOTclObject *obj, XOTclClass *cl, + Tcl_Command cmd, int objc, Tcl_Obj *CONST objv[], int frameType) { + XOTclCallStack *cs; + register XOTclCallStackContent *csc; + + cs = &RUNTIME_STATE(in)->cs; + if (cs->top >= &cs->content[MAX_NESTING_DEPTH-1]) { + Tcl_SetResult(in, "too many nested calls to Tcl_EvalObj (infinite loop?)", + TCL_STATIC); + return TCL_ERROR; + } + /*fprintf(stderr, "CallStackPush sets self\n");*/ + csc = ++cs->top; + csc->self = obj; + csc->cl = cl; + csc->cmdPtr = cmd; + csc->destroyedCmd = 0; + csc->frameType = frameType; + csc->callType = 0; + csc->currentFramePtr = NULL; /* this will be set by InitProcNSCmd */ + + if (frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) + csc->filterStackEntry = obj->filterStack; + else + csc->filterStackEntry = 0; + + /*fprintf(stderr, "PUSH obj %s, self=%p cmd=%p (%s) id=%p (%s) frame=%p\n", + ObjStr(obj->cmdName), obj, + cmd, (char *) Tcl_GetCommandName(in, cmd), + obj->id, Tcl_GetCommandName(in, obj->id), csc);*/ + + MEM_COUNT_ALLOC("CallStack",NULL); + return TCL_OK; +} + +XOTCLINLINE static void +CallStackDoDestroy(Tcl_Interp *in, XOTclObject *obj) { + Tcl_Command oid; + + PRINTOBJ("CallStackDoDestroy", obj); + oid = obj->id; + obj->id = 0; + if (obj->teardown && oid) { + Tcl_DeleteCommandFromToken(in, oid); + } +} + + +static void +CallStackDestroyObject(Tcl_Interp *in, XOTclObject *obj) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + XOTclCallStackContent *csc; + int countSelfs = 0; + Tcl_Command oid = obj->id; + + for (csc = &cs->content[1]; csc <= cs->top; csc++) { + if (csc->self == obj) { + csc->destroyedCmd = oid; + csc->callType |= XOTCL_CSC_CALL_IS_DESTROY; + /*fprintf(stderr,"setting destroy on frame %p for obj %p\n",csc,obj);*/ + if (csc->destroyedCmd) { + Tcl_Command_refCount(csc->destroyedCmd)++; + MEM_COUNT_ALLOC("command refCount",csc->destroyedCmd); + } + countSelfs++; + } + } + /* if the object is not referenced at the callstack anymore + we have to directly destroy it, because CallStackPop won't + find the object destroy */ + if (countSelfs == 0) { + /*fprintf(stderr,"directdestroy %p\n",obj);*/ + CallStackDoDestroy(in, obj); + } else { + /*fprintf(stderr,"selfcount for %p = %d\n",obj,countSelfs);*/ + /* to prevail the deletion order call delete children now + -> children destructors are called before parent's + destructor */ + if (obj->teardown && obj->nsPtr) { + NSDeleteChildren(in, obj->nsPtr); + } + } +} + +XOTCLINLINE static int +CallStackIsDestroyed(Tcl_Interp *in) { + return (RUNTIME_STATE(in)->cs.top->destroyedCmd == NULL) ? 0 : 1; +} + +XOTCLINLINE static void +CallStackPop(Tcl_Interp *in) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + XOTclCallStackContent *csc; + XOTclCallStackContent *h = cs->top; + + assert(cs->top > cs->content); + csc = cs->top; + + /*fprintf(stderr, "POP frame=%p\n",csc);*/ + + if (csc->destroyedCmd != 0) { + int destroy = 1; + TclCleanupCommand((Command *)csc->destroyedCmd); + MEM_COUNT_FREE("command refCount", csc->destroyedCmd); + /* do not physically destroy, when callstack still contains "self" + entries of the object */ + while (--h > cs->content) { + if (h->self == csc->self) { + destroy = 0; + break; + } + } + if (destroy) { + CallStackDoDestroy(in, csc->self); + } + } + + cs->top--; + MEM_COUNT_FREE("CallStack",NULL); +} + + + +XOTCLINLINE static XOTclCallStackContent* +CallStackGetTopFrame(Tcl_Interp *in) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + return cs->top; +} + +static XOTclCallStackContent* +CallStackGetFrame(Tcl_Interp *in) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + register XOTclCallStackContent *top = cs->top; + Tcl_CallFrame *varFramePtr = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(in); + + /* fprintf(stderr, "Tcl_Interp_framePtr(in) %p != varFramePtr %p && top->currentFramePtr %p\n", Tcl_Interp_framePtr(in), varFramePtr, top->currentFramePtr);*/ + + if (Tcl_Interp_framePtr(in) != varFramePtr && top->currentFramePtr) { + XOTclCallStackContent *bot = cs->content + 1; + /*fprintf(stderr, "uplevel\n");*/ + /* we are in a uplevel */ + while (varFramePtr != top->currentFramePtr && top>bot) { + top--; + } + } + return top; +} + +/* + * cmd list handling + */ + +/* + * Cmd List Add/Remove ... returns the new element + */ +static XOTclCmdList* +CmdListAdd(XOTclCmdList **cList, Tcl_Command c, XOTclClass *clorobj, int noDuplicates) { + XOTclCmdList *l = *cList, *new; + + /* + * check for duplicates, if necessary + */ + if (noDuplicates) { + XOTclCmdList *h = l, **end = NULL; + while (h) { + if (h->cmdPtr == c) + return h; + end = &(h->next); + h = h->next; + } + if (end) { + /* no duplicates, no need to search below, we are at the end of the list */ + cList = end; + l = NULL; + } + } + + /* + * ok, we have no duplicates -> append "new" + * to the end of the list + */ + new = NEW(XOTclCmdList); + new->cmdPtr = c; + Tcl_Command_refCount(new->cmdPtr)++; + MEM_COUNT_ALLOC("command refCount",new->cmdPtr); + new->clientData = NULL; + new->clorobj = clorobj; + new->next = NULL; + + if (l) { + while (l->next) + l = l->next; + l->next = new; + } else + *cList = new; + return new; +} + +static void +CmdListReplaceCmd(XOTclCmdList *replace, Tcl_Command cmd, XOTclClass *clorobj) { + Tcl_Command del = replace->cmdPtr; + replace->cmdPtr = cmd; + replace->clorobj = clorobj; + Tcl_Command_refCount(cmd)++; + MEM_COUNT_ALLOC("command refCount", cmd); + TclCleanupCommand((Command *)del); + MEM_COUNT_FREE("command refCount",cmd); +} + +#if 0 +/** for debug purposes only */ +static void +CmdListPrint(Tcl_Interp *in, char *title, XOTclCmdList *cmdList) { + if (cmdList) + fprintf(stderr,title); + while (cmdList) { + fprintf(stderr, " CL=%p, cmdPtr=%p %s, clorobj %p, clientData=%p\n", + cmdList, + cmdList->cmdPtr, + in ? Tcl_GetCommandName(in, cmdList->cmdPtr) : "", + cmdList->clorobj, + cmdList->clientData); + cmdList = cmdList->next; + } +} +#endif + +/* + * physically delete an entry 'del' + */ +static void +CmdListDeleteCmdListEntry(XOTclCmdList* del, XOTclFreeCmdListClientData* freeFct) { + if (freeFct) + (*freeFct)(del); + MEM_COUNT_FREE("command refCount",del->cmdPtr); + TclCleanupCommand((Command *)del->cmdPtr); + FREE(XOTclCmdList, del); +} + +/* + * remove a command 'delCL' from a command list, but do not + * free it ... returns the removed XOTclCmdList* + */ +static XOTclCmdList* +CmdListRemoveFromList(XOTclCmdList **cmdList, XOTclCmdList* delCL) { + register XOTclCmdList* c = *cmdList, *del = 0; + if (c == 0) + return NULL; + if (c == delCL) { + *cmdList = c->next; + del = c; + } else { + while (c->next && c->next != delCL) { + c = c->next; + } + if (c->next == delCL) { + del = delCL; + c->next = delCL->next; + } + } + return del; +} + +/* + * remove all command pointers from a list that have a bumped epoch + */ +static void +CmdListRemoveEpoched(XOTclCmdList **cmdList, XOTclFreeCmdListClientData *freeFct) { + XOTclCmdList *f = *cmdList, *del; + while (f) { + if (Tcl_Command_cmdEpoch(f->cmdPtr)) { + del = f; + f = f->next; + del = CmdListRemoveFromList(cmdList, del); + CmdListDeleteCmdListEntry(del, freeFct); + } else + f = f->next; + } +} + + +/* + * delete all cmds with given context class object + */ +static void +CmdListRemoveContextClassFromList(XOTclCmdList **cmdList, XOTclClass *clorobj, + XOTclFreeCmdListClientData* freeFct) { + XOTclCmdList* c, *del = 0; + /* + CmdListRemoveEpoched(cmdList, freeFct); + */ + c = *cmdList; + while (c && c->clorobj == clorobj) { + del = c; + *cmdList = c->next; + CmdListDeleteCmdListEntry(del, freeFct); + c = *cmdList; + } + while (c) { + if (c->clorobj == clorobj) { + del = c; + c = *cmdList; + while (c->next && c->next != del) + c = c->next; + if (c->next == del) + c->next = del->next; + CmdListDeleteCmdListEntry(del, freeFct); + } + c = c->next; + } +} + +/* + * free the memory of a whole 'cmdList' + */ +static void +CmdListRemoveList(XOTclCmdList **cmdList, XOTclFreeCmdListClientData* freeFct) { + XOTclCmdList *del; + while (*cmdList) { + del = *cmdList; + *cmdList = (*cmdList)->next; + CmdListDeleteCmdListEntry(del, freeFct); + } +} + +/* + * simple list search proc to search a list of cmds + * for a command ptr + */ +static XOTclCmdList* +CmdListFindCmdInList(Tcl_Command cmd, XOTclCmdList* l) { + register XOTclCmdList* h = l; + while (h != 0) { + if (h->cmdPtr == cmd) + return h; + h = h->next; + } + return 0; +} + +/* + * simple list search proc to search a list of cmds + * for a simple Name + */ +static XOTclCmdList* +CmdListFindNameInList(Tcl_Interp *in, char *name, XOTclCmdList* l) { + register XOTclCmdList* h = l; + while (h != 0) { + CONST84 char *cmdName = Tcl_GetCommandName(in, h->cmdPtr); + if (cmdName[0] == name[0] && !strcmp(cmdName, name)) + return h; + h = h->next; + } + return 0; +} + +/* + * Assertions + */ +static XOTclTclObjList* +AssertionNewList(Tcl_Interp *in, Tcl_Obj *aObj) { + Tcl_Obj **ov; int oc; + XOTclTclObjList *last = NULL; + + if (Tcl_ListObjGetElements(in, aObj, &oc, &ov) == TCL_OK) { + if (oc > 0) { + int i; + for (i=oc-1; i>=0; i--) { + TclObjListNewElement(&last, ov[i]); + } + } + } + return last; +} + +static Tcl_Obj* +AssertionList(Tcl_Interp *in, XOTclTclObjList* alist) { + Tcl_Obj *newAssStr = Tcl_NewStringObj("",0); + for (; alist!=NULL; alist = alist->next) { + Tcl_AppendStringsToObj(newAssStr, "{", ObjStr(alist->content), + "}", (char *) NULL); + if (alist->next != NULL) + Tcl_AppendStringsToObj(newAssStr, " ", (char *) NULL); + } + return newAssStr; +} + +/* append a string of pre and post assertions to a proc + or instproc body */ +static void +AssertionAppendPrePost(Tcl_Interp *in, Tcl_DString *dsPtr, XOTclProcAssertion *procs) { + if (procs) { + Tcl_Obj *preAss = AssertionList(in, procs->pre); + Tcl_Obj *postAss = AssertionList(in, procs->post); + INCR_REF_COUNT(preAss); INCR_REF_COUNT(postAss); + Tcl_DStringAppendElement(dsPtr, ObjStr(preAss)); + Tcl_DStringAppendElement(dsPtr, ObjStr(postAss)); + DECR_REF_COUNT(preAss); DECR_REF_COUNT(postAss); + } +} + +static int +AssertionListCheckOption(Tcl_Interp *in, XOTclObject *obj) { + XOTclObjectOpt *opt = obj->opt; + if (!opt) + return TCL_OK; + if (opt->checkoptions & CHECK_OBJINVAR) + Tcl_AppendElement(in, "invar"); + if (opt->checkoptions & CHECK_CLINVAR) + Tcl_AppendElement(in, "instinvar"); + if (opt->checkoptions & CHECK_PRE) + Tcl_AppendElement(in, "pre"); + if (opt->checkoptions & CHECK_POST) + Tcl_AppendElement(in, "post"); + return TCL_OK; +} + +static XOTclProcAssertion* +AssertionFindProcs(XOTclAssertionStore* aStore, char *name) { + Tcl_HashEntry *hPtr; + if (aStore == NULL) return NULL; + hPtr = Tcl_FindHashEntry(&aStore->procs, name); + if (hPtr == NULL) return NULL; + return (XOTclProcAssertion*) Tcl_GetHashValue(hPtr); +} + +static void +AssertionRemoveProc(XOTclAssertionStore* aStore, char *name) { + Tcl_HashEntry *hPtr; + if (aStore) { + hPtr = Tcl_FindHashEntry(&aStore->procs, name); + if (hPtr) { + XOTclProcAssertion* procAss = + (XOTclProcAssertion*) Tcl_GetHashValue(hPtr); + TclObjListFreeList(procAss->pre); + TclObjListFreeList(procAss->post); + FREE(XOTclProcAssertion, procAss); + Tcl_DeleteHashEntry(hPtr); + } + } +} + +static void +AssertionAddProc(Tcl_Interp *in, char *name, XOTclAssertionStore* aStore, + Tcl_Obj *pre, Tcl_Obj *post) { + int nw = 0; + Tcl_HashEntry* hPtr = NULL; + XOTclProcAssertion *procs = NEW(XOTclProcAssertion); + + AssertionRemoveProc(aStore, name); + procs->pre = AssertionNewList(in, pre); + procs->post = AssertionNewList(in, post); + hPtr = Tcl_CreateHashEntry(&aStore->procs, name, &nw); + if (nw) Tcl_SetHashValue(hPtr, (ClientData)procs); +} + +static XOTclAssertionStore* +AssertionCreateStore() { + XOTclAssertionStore* aStore = NEW(XOTclAssertionStore); + aStore->invariants = NULL; + Tcl_InitHashTable(&aStore->procs, TCL_STRING_KEYS); + MEM_COUNT_ALLOC("Tcl_InitHashTable",&aStore->procs); + return aStore; +} + +static void +AssertionRemoveStore(XOTclAssertionStore* aStore) { + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr; + + if (aStore) { + hPtr = Tcl_FirstHashEntry(&aStore->procs, &hSrch); + while (hPtr) { + /* + * AssertionRemoveProc calls Tcl_DeleteHashEntry(hPtr), thus + * we get the FirstHashEntry afterwards again to proceed + */ + AssertionRemoveProc(aStore, Tcl_GetHashKey(&aStore->procs, hPtr)); + hPtr = Tcl_FirstHashEntry(&aStore->procs, &hSrch); + } + Tcl_DeleteHashTable(&aStore->procs); + MEM_COUNT_FREE("Tcl_InitHashTable",&aStore->procs); + TclObjListFreeList(aStore->invariants); + FREE(XOTclAssertionStore, aStore); + } +} + +/* + * check a given condition in the current callframe's scope + * it's the responsiblity of the caller to push the intended callframe + */ +static int +checkConditionInScope(Tcl_Interp *in, Tcl_Obj *condition) { + int result, success; + Tcl_Obj *ov[2]; + ov [1] = condition; + INCR_REF_COUNT(condition); + /* + fprintf(stderr, "----- evaluating condition '%s'\n", ObjStr(condition)); + */ + result = XOTcl_ExprObjCmd(NULL, in, 2, ov); + DECR_REF_COUNT(condition); + /* + fprintf(stderr, "----- running condition '%s', result=%d '%s'\n", + ObjStr(condition), result, + ObjStr(Tcl_GetObjResult(in))); + */ + if (result == TCL_OK) { + result = Tcl_GetIntFromObj(in,Tcl_GetObjResult(in),&success); + /* + fprintf(stderr, " success=%d\n", success); + */ + if (result == TCL_OK && success == 0) + result = XOTCL_CHECK_FAILED; + } + return result; +} + +static int +AssertionCheckList(Tcl_Interp *in, XOTclObject *obj, + XOTclTclObjList* alist, char *methodName) { + XOTclTclObjList* checkFailed = NULL; + Tcl_Obj *savedObjResult = Tcl_GetObjResult(in); + int savedCheckoptions, acResult = TCL_OK; + + /* + * no obj->opt -> checkoption == CHECK_NONE + */ + if (!obj->opt) + return TCL_OK; + + /* we do not check assertion modifying methods, otherwise + we can not react in catch on a runtime assertion check failure */ + if (isCheckString(methodName) || isInfoString(methodName) || + isInvarString(methodName) || isInstinvarString(methodName) || + isProcString(methodName) || isInstprocString(methodName)) + return TCL_OK; + + INCR_REF_COUNT(savedObjResult); + + Tcl_ResetResult(in); + + while (alist != NULL) { + /* Eval instead of IfObjCmd => the substitutions in the + conditions will be done by Tcl */ + char *assStr = ObjStr(alist->content), *c = assStr; + int comment = 0; + + while (c != 0 && *c != '\0') { + if (*c == '#') { + comment = 1; break; + } + c++; + } + if (!comment) { + XOTcl_FrameDecls; + XOTcl_PushFrame(in, obj); + CallStackPush(in, obj, 0, 0, 0, 0, XOTCL_CSC_TYPE_PLAIN); + + /* don't check assertion during assertion check */ + savedCheckoptions = obj->opt->checkoptions; + obj->opt->checkoptions = CHECK_NONE; + + /*fprintf(stderr, "Checking Assertion %s ", assStr);*/ + + /* + * now check the assertion in the pushed callframe's scope + */ + acResult = checkConditionInScope(in, alist->content); + if (acResult != TCL_OK) + checkFailed = alist; + + obj->opt->checkoptions = savedCheckoptions; + + /*fprintf(stderr, "...%s\n", checkFailed ? "failed" : "ok");*/ + + CallStackPop(in); + XOTcl_PopFrame(in,obj); + } + if (checkFailed) + break; + alist = alist->next; + } + + if (checkFailed != NULL) { + DECR_REF_COUNT(savedObjResult); + if (acResult == TCL_ERROR) { + Tcl_Obj *sr = Tcl_GetObjResult(in); + INCR_REF_COUNT(sr); + XOTclVarErrMsg(in, "Error in Assertion: {", + ObjStr(checkFailed->content), "} in proc '", + GetSelfProc(in), "'\n\n", ObjStr(sr), (char *) NULL); + DECR_REF_COUNT(sr); + return TCL_ERROR; + } + return XOTclVarErrMsg(in, "Assertion failed check: {", + ObjStr(checkFailed->content), "} in proc '", + GetSelfProc(in), "'", (char *) NULL); + } + + Tcl_SetObjResult(in, savedObjResult); + DECR_REF_COUNT(savedObjResult); + return TCL_OK; +} + +static int +AssertionCheckInvars(Tcl_Interp *in, XOTclObject *obj, char *method, + CheckOptions checkoptions) { + int result = TCL_OK; + + if (checkoptions & CHECK_OBJINVAR && obj->opt->assertions) { + result = AssertionCheckList(in, obj, obj->opt->assertions->invariants, + method); + } + + if (result != TCL_ERROR && checkoptions & CHECK_CLINVAR) { + XOTclClasses* clPtr; + clPtr = ComputeOrder(obj->cl, obj->cl->order, Super); + while (clPtr != 0 && result != TCL_ERROR) { + XOTclAssertionStore* aStore = (clPtr->cl->opt) ? clPtr->cl->opt->assertions : 0; + if (aStore) { + result = AssertionCheckList(in, obj, aStore->invariants, method); + } + clPtr = clPtr->next; + } + } + return result; +} + +static int +AssertionCheck(Tcl_Interp *in, XOTclObject *obj, XOTclClass *cl, + char *method, int checkOption) { + XOTclProcAssertion* procs; + int result = TCL_OK; + XOTclAssertionStore* aStore; + + if (cl) + aStore = cl->opt ? cl->opt->assertions : 0; + else + aStore = obj->opt ? obj->opt->assertions : 0; + + assert(obj->opt); + + if (checkOption & obj->opt->checkoptions) { + procs = AssertionFindProcs(aStore, method); + if (procs) { + switch (checkOption) { + case CHECK_PRE: + result = AssertionCheckList(in, obj, procs->pre, method); + break; + case CHECK_POST: + result = AssertionCheckList(in, obj, procs->post, method); + break; + } + } + if (result != TCL_ERROR) + result = AssertionCheckInvars(in, obj, method, obj->opt->checkoptions); + } + return result; +} + + + + +/* + * Per-Object-Mixins + */ + +/* + * push a mixin stack information on this object + */ +static int +MixinStackPush(XOTclObject *obj) { + register XOTclMixinStack* h = NEW(XOTclMixinStack); + h->currentCmdPtr = 0; + h->next = obj->mixinStack; + obj->mixinStack = h; + return 1; +} + +/* + * pop a mixin stack information on this object + */ +static void +MixinStackPop(XOTclObject *obj) { + register XOTclMixinStack *h = obj->mixinStack; + obj->mixinStack = h->next; + FREE(XOTclMixinStack,h); +} + +/* + * Appends XOTclClasses* containing the mixin classes and their + * superclasses to 'mixinClasses' list from a given mixinList + */ +static void +MixinComputeOrderFullList(Tcl_Interp *in, XOTclCmdList **mixinList, + XOTclClasses **mixinClasses, + XOTclClasses **checkList, int level) { + XOTclCmdList *m; + XOTclClasses *pl, **clPtr = mixinClasses; + + CmdListRemoveEpoched(mixinList, GuardDel); + m = *mixinList; + + while (m) { + XOTclClass *mCl = XOTclGetClassFromCmdPtr(m->cmdPtr); + if (mCl) { + for (pl = ComputeOrder(mCl, mCl->order, Super); pl; pl = pl->next) { + /*fprintf(stderr, " %s, ", ObjStr(pl->cl->object.cmdName));*/ + if (!(pl->cl == RUNTIME_STATE(in)->theObject)) { + XOTclClassOpt* opt = pl->cl->opt; + if (opt && opt->instmixins != 0) { + /* compute transitively the instmixin classes of this added + class */ + XOTclClasses *cls; + int i, found=0; + for (i=0, cls = *checkList; cls; i++,cls = cls->next) { + /* fprintf(stderr,"+++ c%d: %s\n",i, + ObjStr(cls->cl->object.cmdName));*/ + if (pl->cl == cls->cl) { + found = 1; + break; + } + } + if (!found) { + XOTclAddClass(checkList, pl->cl, NULL); + /*fprintf(stderr, "+++ transitive %s\n", + ObjStr(pl->cl->object.cmdName));*/ + + MixinComputeOrderFullList(in, &opt->instmixins, mixinClasses, + checkList, level+1); + } + } + /* fprintf(stderr,"+++ add to mixinClasses %p path: %s clPtr %p\n", + mixinClasses, ObjStr(pl->cl->object.cmdName), clPtr);*/ + clPtr = XOTclAddClass(clPtr, pl->cl, m->clientData); + } + } + } + m = m->next; + } + if (level == 0 && *checkList) { + XOTclFreeClasses(*checkList); + *checkList = NULL; + } +} + +static void +MixinResetOrder(XOTclObject *obj) { + /*fprintf(stderr,"removeList %s \n",ObjStr(obj->cmdName));*/ + CmdListRemoveList(&obj->mixinOrder, NULL /*GuardDel*/); + obj->mixinOrder = 0; +} + +/* + * Computes a linearized order of per-object and per-class mixins. Then + * duplicates in the full list and with the class inheritance list of + * 'obj' are eliminated. + * The precendence rule is that the last occurence makes it into the + * final list. + */ +static void +MixinComputeOrder(Tcl_Interp *in, XOTclObject *obj) { + XOTclClasses *fullList, *checkList=0, *mixinClasses = 0, *nextCl, *pl, + *checker, *guardChecker; + + if (obj->mixinOrder) MixinResetOrder(obj); + /*fprintf(stderr, "Mixin Order:\n First List: ");*/ + + /* append per-obj mixins */ + if (obj->opt) { + MixinComputeOrderFullList(in, &obj->opt->mixins, &mixinClasses, + &checkList, 0); + } + + /* append per-class mixins */ + for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); pl; pl = pl->next) { + XOTclClassOpt* opt = pl->cl->opt; + if (opt && opt->instmixins) { + MixinComputeOrderFullList(in, &opt->instmixins, &mixinClasses, + &checkList, 0); + } + } + fullList = mixinClasses; + + /* use no duplicates & no classes of the precedence order + on the resulting list */ + while (mixinClasses) { + checker = nextCl = mixinClasses->next; + /* fprintf(stderr,"--- checking %s\n", + ObjStr(mixinClasses->cl->object.cmdName));*/ + + while (checker) { + if (checker->cl == mixinClasses->cl) break; + checker = checker->next; + } + /* if checker is set, it is a duplicate and ignored */ + + if (checker == 0) { + /* check obj->cl hierachy */ + for (checker = ComputeOrder(obj->cl, obj->cl->order, Super); checker; checker = checker->next) { + if (checker->cl == mixinClasses->cl) + break; + } + /* if checker is set, it was found in the class hierarchy + and it is ignored */ + } + if (checker == 0) { + /* add the class to the mixinOrder list */ + XOTclCmdList* new; + /* fprintf(stderr,"--- adding to mixinlist %s\n", + ObjStr(mixinClasses->cl->object.cmdName));*/ + new = CmdListAdd(&obj->mixinOrder, mixinClasses->cl->object.id,NULL, + /*noDuplicates*/ 0); + + /* in the client data of the order list, we require the first + matching guard ... scan the full list for it. */ + for (guardChecker = fullList; guardChecker; guardChecker = guardChecker->next) { + if (guardChecker->cl == mixinClasses->cl) { + new->clientData = guardChecker->clientData; + break; + } + } + } + mixinClasses = nextCl; + } + + /* ... and free the memory of the full list */ + XOTclFreeClasses(fullList); + + /*CmdListPrint(in,"mixin order\n", obj->mixinOrder);*/ + +} + +/* + * add a mixin class to 'mixinList' by appending it + */ +static int +MixinAdd(Tcl_Interp *in, XOTclCmdList **mixinList, Tcl_Obj *name) { + XOTclClass *mixin; + Tcl_Obj *guard = NULL; + int ocName; Tcl_Obj **ovName; + XOTclCmdList* new; + + if (Tcl_ListObjGetElements(in, name, &ocName, &ovName) == TCL_OK && ocName > 1) { + if (ocName == 3 && !strcmp(ObjStr(ovName[1]), XOTclGlobalStrings[XOTE_GUARD_OPTION])) { + name = ovName[0]; + guard = ovName[2]; + /*fprintf(stderr,"mixinadd name = '%s', guard = '%s'\n", ObjStr(name), ObjStr(guard));*/ + } /*else return XOTclVarErrMsg(in, "mixin registration '", ObjStr(name), + "' has too many elements.", (char *) NULL);*/ + } + + if (GetXOTclClassFromObj(in, name, &mixin, 1) != TCL_OK) + return XOTclErrBadVal(in, "mixin", "a class as mixin", ObjStr(name)); + + + new = CmdListAdd(mixinList, mixin->object.id, NULL, /*noDuplicates*/ 1); + + if (guard) { + GuardAdd(in, new, guard); + } else { + if (new->clientData) + GuardDel(new); + } + + return TCL_OK; +} + +/* + * get all instances of a class recursively to an initialized + * String key hashtable + */ +static void +getAllInstances(Tcl_HashTable *destTable, XOTclClass *startCl) { + Tcl_HashTable *table = &startCl->instances; + Tcl_HashSearch search; + Tcl_HashEntry *hPtr; + + for (hPtr = Tcl_FirstHashEntry(table, &search); hPtr != NULL; + hPtr = Tcl_NextHashEntry(&search)) { + XOTclObject *inst = (XOTclObject*) Tcl_GetHashKey(table, hPtr); + Tcl_HashEntry *hPtrDest; + int new; + hPtrDest = Tcl_CreateHashEntry(destTable, ObjStr(inst->cmdName), &new); + /* + fprintf (stderr, " -- %s (%s)\n", ObjStr(inst->cmdName), ObjStr(startCl->object.cmdName)); + */ + if (new && XOTclObjectIsClass(inst)) { + getAllInstances(destTable, (XOTclClass*) inst); + } + } +} + +/* + * if the class hierarchy or class mixins have changed -> + * invalidate mixin entries in all dependent instances + */ +static void +MixinInvalidateObjOrders(Tcl_Interp *in, XOTclClass *cl) { + XOTclClasses *saved = cl->order, *clPtr; + Tcl_HashSearch hSrch; + Tcl_HashEntry *hPtr; + Tcl_HashTable objTable, *commandTable = &objTable; + XOTclObject *obj; + + cl->order = 0; + + for (clPtr = ComputeOrder(cl, cl->order, Sub); clPtr; clPtr = clPtr->next) { + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr = &clPtr->cl->instances ? + Tcl_FirstHashEntry(&clPtr->cl->instances, &hSrch) : 0; + + /*fprintf(stderr,"invalidating instances of class %s\n", + ObjStr(clPtr->cl->object.cmdName));*/ + + /* here we should check, whether this class is used as + a mixin / instmixin somewhere else and invalidate + the objects of these as well -- */ + + for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { + XOTclObject *obj = (XOTclObject*) + Tcl_GetHashKey(&clPtr->cl->instances, hPtr); + MixinResetOrder(obj); + obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; + } + } + + XOTclFreeClasses(cl->order); + cl->order = saved; +#if 1 + /* TODO: Uwe, this slows down superclass by a factor of 5! + */ + + /* invalidate the mixins on all instances that have this mixin (cl) + at the moment */ + Tcl_InitHashTable(commandTable, TCL_STRING_KEYS); + MEM_COUNT_ALLOC("Tcl_InitHashTable",commandTable); + getAllInstances(commandTable, RUNTIME_STATE(in)->theClass); + hPtr = Tcl_FirstHashEntry(commandTable, &hSrch); + while (hPtr) { + char *key = Tcl_GetHashKey(commandTable, hPtr); + obj = XOTclpGetObject(in, key); + + if (obj && !XOTclObjectIsClass(obj) + && !(obj->flags & XOTCL_DESTROY_CALLED) + && (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID)) { + XOTclCmdList *ml; + for (ml = obj->mixinOrder; ml; ml = ml->next) { + XOTclClass *mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); + if (mixin == cl) { + MixinResetOrder(obj); + obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; + break; + } + } + } + hPtr = Tcl_NextHashEntry(&hSrch); + } + MEM_COUNT_FREE("Tcl_InitHashTable",commandTable); + Tcl_DeleteHashTable(commandTable); +#endif +} + static int MixinInfo(Tcl_Interp *in, XOTclCmdList* m, char *pattern, int withGuards); +/* + * the mixin order is either + * DEFINED (there are mixins on the instance), + * NONE (there are no mixins for the instance), + * or INVALID (a class re-strucuturing has occured, thus it is not clear + * whether mixins are defined or not). + * If it is INVALID MixinComputeDefined can be used to compute the order + * and set the instance to DEFINE or NONE + */ +static void +MixinComputeDefined(Tcl_Interp *in, XOTclObject *obj) { + MixinComputeOrder(in, obj); + obj->flags |= XOTCL_MIXIN_ORDER_VALID; + if (obj->mixinOrder) + obj->flags |= XOTCL_MIXIN_ORDER_DEFINED; + else + obj->flags &= ~XOTCL_MIXIN_ORDER_DEFINED; +} + +/* + * walk through the mixin order until the current mixin is reached. + * then use the next mixin as current mixin. + * + * precondition: obj->mixinStack is not NULL + */ +static void +MixinSeekCurrent(Tcl_Interp *in, XOTclObject *obj, XOTclCmdList **cmdList) { + Tcl_Command currentCmdPtr; + + /* ensure that the mixin order is not invalid, otherwise compute order */ + assert(obj->flags & XOTCL_MIXIN_ORDER_VALID); + /*MixinComputeDefined(in, obj);*/ + currentCmdPtr = obj->mixinStack->currentCmdPtr; + + /* + { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + XOTclCallStackContent *csc = cs->top; + fprintf(stderr, "%p == %p ==> %d \n", csc->cl, currentCmdPtr, + csc->cmdPtr == currentCmdPtr); + } + */ + + /*** + { Tcl_Obj *sr; + + MixinInfo(in, obj->mixinOrder, NULL,0); + sr = Tcl_GetObjResult(in); + fprintf(stderr,"INFO->%s order %p next %p\n",ObjStr(sr), obj->mixinOrder, obj->mixinOrder->next); + } + ***/ + + *cmdList = obj->mixinOrder; + /* + fprintf(stderr, "->1 mixin seek current = %p next = %p %s\n", + currentCmdPtr, + (*cmdList)->next, + (*cmdList)->next ? Tcl_GetCommandName(in, (*cmdList)->next->cmdPtr) : ""); + */ + +#if defined(ACTIVEMIXIN) + /*RUNTIME_STATE(in)->cmdPtr = (*cmdList)->next ? (*cmdList)->next->cmdPtr : NULL;*/ + RUNTIME_STATE(in)->cmdPtr = (*cmdList)->cmdPtr; +#endif + + /* go forward to current class */ + while (*cmdList && currentCmdPtr) { + /* fprintf(stderr, "->2 mixin seek current = %p next = %p\n", currentCmdPtr, (*cmdList)->next);*/ + if ((*cmdList)->cmdPtr == currentCmdPtr) + currentCmdPtr = 0; + *cmdList = (*cmdList)->next; + +#if defined(ACTIVEMIXIN) + /*RUNTIME_STATE(in)->cmdPtr = (*cmdList)->next ? (*cmdList)->next->cmdPtr : NULL;*/ + RUNTIME_STATE(in)->cmdPtr = (*cmdList)->cmdPtr; +#endif + } +} + +/* + * before we can perform a mixin dispatch, MixinSearchProc seeks the + * current mixin and the relevant calling information + */ +static Tcl_Command +MixinSearchProc(Tcl_Interp *in, XOTclObject *obj, char *methodName, + XOTclClass **cl, Tcl_ObjCmdProc **proc, ClientData* cp, + Tcl_Command* currentCmdPtr) { + Tcl_Command cmd = NULL; + XOTclCmdList *cmdList; + XOTclClass *cls; + + assert(obj); + assert(obj->mixinStack); + + MixinSeekCurrent(in, obj, &cmdList); + + /* + fprintf(stderr, "MixinSearch searching for '%s' %p\n", methodName,cmdList); + */ + /*CmdListPrint(in,"MixinSearch CL = \n", cmdList);*/ + + + while (cmdList) { + if (Tcl_Command_cmdEpoch(cmdList->cmdPtr)) { + cmdList = cmdList->next; + } else { + cls = XOTclGetClassFromCmdPtr(cmdList->cmdPtr); + /* + fprintf(stderr,"+++ MixinSearch %s->%s in %p cmdPtr %p clientData %p\n", + ObjStr(obj->cmdName),methodName, cmdList, + cmdList->cmdPtr, cmdList->clientData); + */ + if (cls) { + int guardOk = TCL_OK; + cmd = FindMethod(methodName, cls->nsPtr); + if (cmd && cmdList->clientData) { + if (!RUNTIME_STATE(in)->cs.guardCount) { + guardOk = GuardCall(obj, cls, (Tcl_Command) cmd, in, cmdList->clientData, 1); + } + } + if (cmd && guardOk == TCL_OK) { + /* + * on success: compute mixin call data + */ + *cl = cls; + *proc = Tcl_Command_objProc(cmd); + *cp = Tcl_Command_objClientData(cmd); + *currentCmdPtr = cmdList->cmdPtr; + break; + } else { + cmd = NULL; + cmdList = cmdList->next; + } + } + } + } + + return cmd; +} + +/* + * info option for mixins and instmixins + */ +static int +MixinInfo(Tcl_Interp *in, XOTclCmdList* m, char *pattern, int withGuards) { + Tcl_Obj *list = Tcl_NewListObj(0, NULL); + XOTclClass *mixinClass; + while (m) { + /* fprintf(stderr," mixin info m=%p, next=%p\n",m,m->next); */ + mixinClass = XOTclGetClassFromCmdPtr(m->cmdPtr); + if (mixinClass && + (!pattern || + Tcl_StringMatch(ObjStr(mixinClass->object.cmdName), pattern))) { + if (withGuards && m->clientData) { + Tcl_Obj *l = Tcl_NewListObj(0, NULL); + Tcl_Obj *g = (Tcl_Obj*) m->clientData; + Tcl_ListObjAppendElement(in, l, mixinClass->object.cmdName); + Tcl_ListObjAppendElement(in, l, XOTclGlobalObjects[XOTE_GUARD_OPTION]); + Tcl_ListObjAppendElement(in, l, g); + Tcl_ListObjAppendElement(in, list, l); + } else + Tcl_ListObjAppendElement(in, list, mixinClass->object.cmdName); + } + m = m->next; + } + Tcl_SetObjResult(in, list); + return TCL_OK; +} + +static Tcl_Command +MixinSearchMethodByName(Tcl_Interp *in, XOTclCmdList* mixinList, char *name, XOTclClass **cl) { + Tcl_Command cmd; + while (mixinList) { + XOTclClass *mcl = + XOTclpGetClass(in, (char *) Tcl_GetCommandName(in, mixinList->cmdPtr)); + if (mcl && SearchCMethod(mcl, name, &cmd)) { + if (cl) *cl = mcl; + return cmd; + } + + mixinList = mixinList->next; + } + return 0; +} + + +/* + * Filter-Commands + */ + +/* + * The search method implements filter search order for filter + * and instfilter: first a given name is interpreted as fully + * qualified instproc name. If no instproc is found, a proc is + * search with fully name. Otherwise the simple name is searched + * on the heritage order: object (only for + * per-object filters), class, meta-class + */ + +static Tcl_Command +FilterSearch(Tcl_Interp *in, char *name, XOTclObject *startingObj, + XOTclClass *startingCl, XOTclClass **cl) { + Tcl_Command cmd = NULL; + + if (startingObj) { + XOTclObjectOpt *opt = startingObj->opt; + /* + * the object-specific filter can also be defined on the object's + * class, its hierarchy, or the respective instmixins; thus use the + * object's class as start point for the class-specific search then ... + */ + startingCl = startingObj->cl; + + /* + * search for filters on object mixins + */ + if (opt && opt->mixins) { + if ((cmd = MixinSearchMethodByName(in, opt->mixins, name, cl))) { + return cmd; + } + } + } + + /* + * search for instfilters on instmixins + */ + if (startingCl) { + XOTclClassOpt* opt = startingCl->opt; + if (opt && opt->instmixins) { + if ((cmd = MixinSearchMethodByName(in, opt->instmixins, name, cl))) { + return cmd; + } + } + } + + /* + * seach for object procs that are used as filters + */ + if (startingObj && startingObj->nsPtr) { + if ((cmd = FindMethod(name, startingObj->nsPtr))) { + *cl = (XOTclClass*)startingObj; + return cmd; + } + } + + /* + * ok, no filter on obj or mixins -> search class + */ + if (startingCl) { + *cl = SearchCMethod(startingCl, name, &cmd); + if (!*cl) { + /* + * If no filter is found yet -> search the meta-class + */ + *cl = SearchCMethod(startingCl->object.cl, name, &cmd); + } + } + return cmd; +} + +/* + * Filter Guards + */ + +/* check a filter guard, return 1 if ok */ +static int +GuardCheck(Tcl_Interp *in, ClientData clientData) { + Tcl_Obj *guard = (Tcl_Obj*) clientData; + int rc; + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + + if (guard) { + /* + * if there are more than one filter guard for this filter + * (i.e. they are inherited), then they are OR combined + * -> if one check succeeds => return 1 + */ + + /*fprintf(stderr, "checking guard **%s**\n", ObjStr(guard));*/ + + cs->guardCount++; + rc = checkConditionInScope(in, guard); + cs->guardCount--; + + /*fprintf(stderr, "checking guard **%s** returned rc=%d\n", + ObjStr(fr->content), rc);*/ + + if (rc == TCL_OK) { + /* fprintf(stderr, " +++ OK\n"); */ + return TCL_OK; + } else if (rc == TCL_ERROR) { + Tcl_Obj *sr = Tcl_GetObjResult(in); + INCR_REF_COUNT(sr); + + /* fprintf(stderr, " +++ ERROR\n");*/ + + XOTclVarErrMsg(in, "Guard Error: '", ObjStr(guard), "'\n\n", + ObjStr(sr), (char *) NULL); + DECR_REF_COUNT(sr); + return TCL_ERROR; + } + } + /* + fprintf(stderr, " +++ FAILED\n"); + */ + return XOTCL_CHECK_FAILED; +} + +/* +static void +GuardPrint(Tcl_Interp *in, ClientData clientData) { + Tcl_Obj *guard = (TclObj*) clientData; + fprintf(stderr, " +++ \n"); + if (guard) { + fprintf(stderr, " * %s \n", ObjStr(guard)); + } + fprintf(stderr, " +++ \n"); +} +*/ + +static void +GuardDel(XOTclCmdList* CL) { + /*fprintf(stderr, "GuardDel %p cd = %p\n", + CL, CL? CL->clientData : NULL);*/ + if (CL && CL->clientData) { + DECR_REF_COUNT((Tcl_Obj*)CL->clientData); + CL->clientData = NULL; + } +} + +XOTCLINLINE static void +GuardAdd(Tcl_Interp *in, XOTclCmdList* CL, Tcl_Obj *guard) { + if (guard) { + GuardDel(CL); + if (strlen(ObjStr(guard)) != 0) { + INCR_REF_COUNT(guard); + CL->clientData = (ClientData) guard; + /*fprintf(stderr,"guard added to %p cmdPtr=%p, clientData= %p\n", + CL, CL->cmdPtr, CL->clientData); + */ + } + } +} +/* +static void +GuardAddList(Tcl_Interp *in, XOTclCmdList* dest, ClientData source) { + XOTclTclObjList* s = (XOTclTclObjList*) source; + while (s) { + GuardAdd(in, dest, (Tcl_Obj*) s->content); + s = s->next; + } +} */ + +static int +GuardCall(XOTclObject *obj, XOTclClass *cl, Tcl_Command cmd, + Tcl_Interp *in, ClientData clientData, int push) { + int rc = TCL_OK; + + if (clientData) { + Tcl_Obj *res = Tcl_GetObjResult(in); /* save the result */ + INCR_REF_COUNT(res); + + /* GuardPrint(in, cmdList->clientData); */ + /* + * ok, there is a guard ... we have to push a + * fake callframe on the tcl stack so that uplevel + * is in sync with the XOTcl callstack, and we can uplevel + * into the above pushed CallStack entry + */ + if (push) { + CallStackPush(in, obj, cl, cmd, 0, 0, XOTCL_CSC_TYPE_GUARD); + rc = GuardCheck(in, clientData); + CallStackPop(in); + } else { + rc = GuardCheck(in, clientData); + } + Tcl_SetObjResult(in, res); /* restore the result */ + DECR_REF_COUNT(res); + } + + return rc; +} + +static int +GuardAddFromDefinitionList(Tcl_Interp *in, XOTclCmdList* dest, + XOTclObject *obj, Tcl_Command interceptorCmd, + XOTclCmdList* interceptorDefList) { + XOTclCmdList* h; + if (interceptorDefList != 0) { + h = CmdListFindCmdInList(interceptorCmd, interceptorDefList); + if (h) { + GuardAdd(in, dest, (Tcl_Obj*) h->clientData); + /* + * 1 means we have added a guard successfully "interceptorCmd" + */ + return 1; + } + } + /* + * 0 means we have not added a guard successfully "interceptorCmd" + */ + return 0; +} + +static void +GuardAddInheritedGuards(Tcl_Interp *in, XOTclCmdList* dest, + XOTclObject *obj, Tcl_Command filterCmd) { + XOTclClasses* pl; + int guardAdded = 0; + XOTclObjectOpt *opt; + + /* search guards for instfilters registered on mixins */ + if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) + MixinComputeDefined(in, obj); + if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { + XOTclCmdList *ml = obj->mixinOrder; + XOTclClass *mixin; + while (ml && ! guardAdded) { + mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); + if (mixin && mixin->opt) { + guardAdded = GuardAddFromDefinitionList(in, dest, obj, filterCmd, + mixin->opt->instfilters); + } + ml = ml->next; + } + } + + /* search per-object filters */ + opt = obj->opt; + if (!guardAdded && opt && opt->filters) { + guardAdded = GuardAddFromDefinitionList(in, dest, obj, filterCmd, opt->filters); + } + + if (!guardAdded) { + /* search per-class filters */ + for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); !guardAdded && pl; pl = pl->next) { + XOTclClassOpt* opt = pl->cl->opt; + if (opt) { + guardAdded = GuardAddFromDefinitionList(in, dest, obj, filterCmd, + opt->instfilters); + } + } + + + /* + * if this is not a registered filter, it is an inherited filter, like: + * Class A + * A instproc f ... + * Class B -superclass A + * B instproc {{f {}}} + * B instfilter f + * -> get the guard from the filter that inherits it (here B->f) + */ + if (!guardAdded) { + XOTclCmdList* registeredFilter = + CmdListFindNameInList(in,(char *) Tcl_GetCommandName(in, filterCmd), + obj->filterOrder); + if (registeredFilter) { + GuardAdd(in, dest, (Tcl_Obj*) registeredFilter->clientData); + } + } + } +} + +static int +GuardList(Tcl_Interp *in, XOTclCmdList* frl, char *interceptorName) { + XOTclCmdList* h; + if (frl) { + /* try to find simple name first */ + h = CmdListFindNameInList(in, interceptorName, frl); + if (!h) { + /* maybe it is a qualified name */ + Tcl_Command cmd = NSFindCommand(in, interceptorName, NULL); + if (cmd) { + h = CmdListFindCmdInList(cmd, frl); + } + } + if (h) { + Tcl_ResetResult(in); + if (h->clientData) { + Tcl_Obj *g = (Tcl_Obj*) h->clientData; + Tcl_SetObjResult(in, g); + } + return TCL_OK; + } + } + return XOTclVarErrMsg(in, "info (*)guard: can't find filter/mixin ", + interceptorName, (char *) NULL); +} + +/* + * append a filter command to the 'filterList' of an obj/class + */ +static int +FilterAdd(Tcl_Interp *in, XOTclCmdList **filterList, Tcl_Obj *name, + XOTclObject *startingObj, XOTclClass *startingCl) { + Tcl_Command cmd; + int ocName; Tcl_Obj **ovName; + Tcl_Obj *guard = NULL; + XOTclCmdList *new; + XOTclClass *cl; + + if (Tcl_ListObjGetElements(in, name, &ocName, &ovName) == TCL_OK && ocName > 1) { + if (ocName == 3 && !strcmp(ObjStr(ovName[1]), XOTclGlobalStrings[XOTE_GUARD_OPTION])) { + name = ovName[0]; + guard = ovName[2]; + } + } + + if (!(cmd = FilterSearch(in, ObjStr(name), startingObj, startingCl, &cl))) { + if (startingObj) + return XOTclVarErrMsg(in, "filter: can't find filterproc on: ", + ObjStr(startingObj->cmdName), " - proc: ", + ObjStr(name), (char *) NULL); + else + return XOTclVarErrMsg(in, "instfilter: can't find filterproc on: ", + ObjStr(startingCl->object.cmdName), " - proc: ", + ObjStr(name), (char *) NULL); + } + + /*fprintf(stderr, " +++ adding filter %s cl %p\n", ObjStr(name),cl);*/ + + new = CmdListAdd(filterList, cmd, cl, /*noDuplicates*/ 1); + + if (guard) { + GuardAdd(in, new, guard); + } else { + if (new->clientData) + GuardDel(new); + } + + return TCL_OK; +} + +/* + * reset the filter order cached in obj->filterOrder + */ +static void +FilterResetOrder(XOTclObject *obj) { + CmdListRemoveList(&obj->filterOrder, GuardDel); + obj->filterOrder = 0; +} + +/* + * search the filter in the hierarchy again with FilterSearch, e.g. + * upon changes in the class hierarchy or mixins that carry the filter + * command, so that we can be sure it is still reachable. + */ +static void +FilterSearchAgain(Tcl_Interp *in, XOTclCmdList **filters, + XOTclObject *startingObj, XOTclClass *startingCl) { + char *simpleName; + Tcl_Command cmd; + XOTclCmdList *cmdList, *del; + XOTclClass *cl = NULL; + + CmdListRemoveEpoched(filters, GuardDel); + cmdList = *filters; + while (cmdList) { + simpleName = (char *) Tcl_GetCommandName(in, cmdList->cmdPtr); + cmd = FilterSearch(in, simpleName, startingObj, startingCl, &cl); + if (cmd == NULL) { + del = cmdList; + cmdList = cmdList->next; + del = CmdListRemoveFromList(filters, del); + CmdListDeleteCmdListEntry(del, GuardDel); + } else { + if (cmd != cmdList->cmdPtr) + CmdListReplaceCmd(cmdList, cmd, cl); + cmdList = cmdList->next; + } + } + /* some entries might be NULL now, if they are not found anymore + -> delete those + CmdListRemoveNulledEntries(filters, GuardDel); + */ + +} + +/* + * if the class hierarchy or class filters have changed -> + * invalidate filter entries in all dependent instances + * + */ +static void +FilterInvalidateObjOrders(Tcl_Interp *in, XOTclClass *cl) { + XOTclClasses *saved = cl->order, *clPtr, *savePtr; + + cl->order = 0; + savePtr = clPtr = ComputeOrder(cl, cl->order, Sub); + cl->order = saved; + + while (clPtr != 0) { + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr = &clPtr->cl->instances ? + Tcl_FirstHashEntry(&clPtr->cl->instances, &hSrch) : 0; + + /* recalculate the commands of all instfilter registrations */ + if (clPtr->cl->opt) { + FilterSearchAgain(in, &clPtr->cl->opt->instfilters, 0, clPtr->cl); + } + for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { + XOTclObject *obj = (XOTclObject*) Tcl_GetHashKey(&clPtr->cl->instances, hPtr); + FilterResetOrder(obj); + obj->flags &= ~XOTCL_FILTER_ORDER_VALID; + + /* recalculate the commands of all object filter registrations */ + if (obj->opt) { + FilterSearchAgain(in, &obj->opt->filters, obj, 0); + } + } + clPtr = clPtr->next; + } + XOTclFreeClasses(savePtr); +} + +/* + * from cl on down the hierarchy we remove all filters + * the refer to "removeClass" namespace. E.g. used to + * remove filters defined in superclass list from dependent + * class cl + */ +static void +FilterRemoveDependentFilterCmds(XOTclClass *cl, XOTclClass *removeClass) { + XOTclClasses *saved = cl->order, *clPtr; + cl->order = 0; + + /*fprintf(stderr, "FilterRemoveDependentFilterCmds cl %p %s, removeClass %p %s\n", + cl,ObjStr(cl->object.cmdName), + removeClass,ObjStr(removeClass->object.cmdName));*/ + + for (clPtr = ComputeOrder(cl, cl->order, Sub); clPtr; clPtr = clPtr->next) { + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr = &clPtr->cl->instances ? + Tcl_FirstHashEntry(&clPtr->cl->instances, &hSrch) : 0; + XOTclClassOpt* opt = clPtr->cl->opt; + if (opt) { + CmdListRemoveContextClassFromList(&opt->instfilters,removeClass, GuardDel); + } + for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { + XOTclObject *obj = (XOTclObject*) Tcl_GetHashKey(&clPtr->cl->instances, hPtr); + if (obj->opt) { + CmdListRemoveContextClassFromList(&obj->opt->filters,removeClass, GuardDel); + } + } + } + + XOTclFreeClasses(cl->order); + cl->order = saved; +} + +/* + * build up a qualifier of the form proc/instproc + * if cl is not NULL, we build an instproc identifier for cl, else a proc + * with obj + */ +static Tcl_Obj* +getFullProcQualifier(Tcl_Interp *in, CONST84 char *cmdName, + XOTclObject *obj, XOTclClass *cl, Tcl_Command cmd) { + Tcl_Obj *list = Tcl_NewListObj(0, NULL); + Tcl_Obj *procObj = Tcl_NewStringObj(cmdName, -1); + Tcl_ObjCmdProc *objProc = Tcl_Command_objProc(cmd); + int isTcl = (TclIsProc((Command *)cmd) != NULL); + + if (cl) { + Tcl_ListObjAppendElement(in, list, cl->object.cmdName); + /*fprintf(stderr,"current %p, dispatch %p, forward %p, parametermcd %p, is tcl %p\n", + objProc, XOTclObjDispatch, XOTclForwardMethod, + XOTclSetterMethod, TclIsProc((Command *)cmd)); */ + if (isTcl) { + Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_INSTPROC]); + } else if (objProc == XOTclForwardMethod) { + Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_INSTFORWARD]); + } else if (objProc == XOTclSetterMethod) { + Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_INSTPARAMETERCMD]); + } else { + Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_INSTCMD]); + } + } else { + Tcl_ListObjAppendElement(in, list, obj->cmdName); + if (isTcl) { + Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_PROC]); + } else if (objProc == XOTclForwardMethod) { + Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_FORWARD]); + } else if (objProc == XOTclSetterMethod) { + Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_PARAMETERCMD]); + } else { + Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_CMD]); + } + } + Tcl_ListObjAppendElement(in, list, procObj); + return list; +} + +/* + * info option for filters and instfilters + * withGuards -> if not 0 => append guards + * fullProcQualifiers -> if not 0 => full names with obj/class proc/instproc + */ +static int +FilterInfo(Tcl_Interp *in, XOTclCmdList* f, char *pattern, + int withGuards, int fullProcQualifiers) { + CONST84 char *simpleName; + Tcl_Obj *list = Tcl_NewListObj(0, NULL); + + /* guard lists should only have unqualified filter lists + when withGuards is activated, fullProcQualifiers has not + effect */ + if (withGuards) { + fullProcQualifiers = 0; + } + + while (f) { + simpleName = Tcl_GetCommandName(in, f->cmdPtr); + if (!pattern || Tcl_StringMatch(simpleName, pattern)) { + if (withGuards && f->clientData) { + Tcl_Obj *innerList = Tcl_NewListObj(0, NULL); + Tcl_Obj *g = (Tcl_Obj*) f->clientData; + Tcl_ListObjAppendElement(in, innerList, + Tcl_NewStringObj(simpleName, -1)); + Tcl_ListObjAppendElement(in, innerList, XOTclGlobalObjects[XOTE_GUARD_OPTION]); + Tcl_ListObjAppendElement(in, innerList, g); + Tcl_ListObjAppendElement(in, list, innerList); + } else { + if (fullProcQualifiers) { + XOTclClass *fcl; + XOTclObject *fobj; + if (f->clorobj && !XOTclObjectIsClass(&f->clorobj->object)) { + fobj = (XOTclObject *)f->clorobj; + fcl = NULL; + } else { + fobj = NULL; + fcl = f->clorobj; + } + Tcl_ListObjAppendElement(in, list, + getFullProcQualifier(in, simpleName, + fobj, fcl, f->cmdPtr)); + } else { + Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj(simpleName, -1)); + } + } + } + f = f->next; + } + Tcl_SetObjResult(in, list); + return TCL_OK; +} + +/* + * Appends XOTclCmdPtr* containing the filter cmds and their + * superclass specializations to 'filterList' + */ +static void +FilterComputeOrderFullList(Tcl_Interp *in, XOTclCmdList **filters, + XOTclCmdList **filterList) { + XOTclCmdList *f ; + char *simpleName; + XOTclClass *fcl; + XOTclClasses *pl; + + /* + * ensure that no epoched command is in the filters list + */ + CmdListRemoveEpoched(filters, GuardDel); + + for (f = *filters; f; f = f->next) { + simpleName = (char *) Tcl_GetCommandName(in, f->cmdPtr); + fcl = f->clorobj; + CmdListAdd(filterList, f->cmdPtr, fcl, /*noDuplicates*/ 0); + + if (fcl && !XOTclObjectIsClass(&fcl->object)) { + /* get the object for per-object filter */ + XOTclObject *fObj = (XOTclObject *)fcl; + /* and then get class */ + fcl = fObj->cl; + } + + /* if we have a filter class -> search up the inheritance hierarchy*/ + if (fcl) { + pl = ComputeOrder(fcl, fcl->order, Super); + if (pl && pl->next) { + /* don't search on the start class again */ + pl = pl->next; + /* now go up the hierarchy */ + for(; pl; pl = pl->next) { + Tcl_Command pi = FindMethod(simpleName, pl->cl->nsPtr); + if (pi) { + CmdListAdd(filterList, pi, pl->cl, /*noDuplicates*/ 0); + /* + fprintf(stderr, " %s::%s, ", ObjStr(pl->cl->object.cmdName), simpleName); + */ + } + } + } + } + } + /*CmdListPrint(in,"FilterComputeOrderFullList....\n", *filterList);*/ +} + +/* + * Computes a linearized order of filter and instfilter. Then + * duplicates in the full list and with the class inheritance list of + * 'obj' are eliminated. + * The precendence rule is that the last occurence makes it into the + * final list. + */ +static void +FilterComputeOrder(Tcl_Interp *in, XOTclObject *obj) { + XOTclCmdList *filterList = 0, *next, *checker, *newlist; + XOTclClasses *pl; + + if (obj->filterOrder) FilterResetOrder(obj); + /* + fprintf(stderr, " List: ", ObjStr(obj->cmdName)); + */ + + /* append instfilters registered for mixins */ + if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) + MixinComputeDefined(in, obj); + + if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { + XOTclCmdList *ml = obj->mixinOrder; + XOTclClass *mixin; + while (ml) { + mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); + if (mixin && mixin->opt && mixin->opt->instfilters) + FilterComputeOrderFullList(in, &mixin->opt->instfilters, &filterList); + ml = ml->next; + } + } + + /* append per-obj filters */ + if (obj->opt) + FilterComputeOrderFullList(in, &obj->opt->filters, &filterList); + + /* append per-class filters */ + for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); pl; pl=pl->next) { + XOTclClassOpt* opt = pl->cl->opt; + if (opt && opt->instfilters) { + FilterComputeOrderFullList(in, &opt->instfilters, &filterList); + } + } + + /* + fprintf(stderr, "\n"); + */ + /* use no duplicates & no classes of the precedence order + on the resulting list */ + while (filterList) { + checker = next = filterList->next; + while (checker) { + if (checker->cmdPtr == filterList->cmdPtr) break; + checker = checker->next; + } + if (checker == 0) { + newlist = CmdListAdd(&obj->filterOrder, filterList->cmdPtr, filterList->clorobj, + /*noDuplicates*/ 0); + GuardAddInheritedGuards(in, newlist, obj, filterList->cmdPtr); + /* + fprintf(stderr, " Adding %s::%s,\n", filterList->cmdPtr->nsPtr->fullName, Tcl_GetCommandName(in, filterList->cmdPtr)); + */ + /* + GuardPrint(in, newlist->clientData); + */ + + } + + CmdListDeleteCmdListEntry(filterList, GuardDel); + + filterList = next; + } + /* + fprintf(stderr, "\n"); + */ +} + +/* + * the filter order is either + * DEFINED (there are filter on the instance), + * NONE (there are no filter for the instance), + * or INVALID (a class re-strucuturing has occured, thus it is not clear + * whether filters are defined or not). + * If it is INVALID FilterComputeDefined can be used to compute the order + * and set the instance to DEFINE or NONE + */ +static void +FilterComputeDefined(Tcl_Interp *in, XOTclObject *obj) { + FilterComputeOrder(in, obj); + obj->flags |= XOTCL_FILTER_ORDER_VALID; + if (obj->filterOrder) + obj->flags |= XOTCL_FILTER_ORDER_DEFINED; + else + obj->flags &= ~XOTCL_FILTER_ORDER_DEFINED; +} + +/* + * push a filter stack information on this object + */ +static int +FilterStackPush(Tcl_Interp *in, XOTclObject *obj, Tcl_Obj *calledProc) { + register XOTclFilterStack* h = NEW(XOTclFilterStack); + + h->currentCmdPtr = 0; + h->calledProc = calledProc; + INCR_REF_COUNT(h->calledProc); + h->next = obj->filterStack; + obj->filterStack = h; + return 1; +} + +/* + * pop a filter stack information on this object + */ +static void +FilterStackPop(XOTclObject *obj) { + register XOTclFilterStack *h = obj->filterStack; + obj->filterStack = h->next; + + /* free stack entry */ + DECR_REF_COUNT(h->calledProc); + FREE(XOTclFilterStack, h); +} + +/* + * walk through the filter order until the current filter is reached. + * then use the next filter as current filter. + * + * precondition: obj->filterStack is not NULL + */ +static void +FilterSeekCurrent(Tcl_Interp *in, XOTclObject *obj, XOTclCmdList **cmdList) { + Tcl_Command currentCmd = obj->filterStack->currentCmdPtr; + + assert(obj->flags & XOTCL_FILTER_ORDER_VALID); + /* ensure that the filter order is not invalid, otherwise compute order + FilterComputeDefined(in, obj); + */ + + *cmdList = obj->filterOrder; + + /* go forward to current class */ + while (*cmdList && currentCmd) { + if ((*cmdList)->cmdPtr == currentCmd) + currentCmd = 0; + *cmdList = (*cmdList)->next; + } +} + +/* + * seek through the filters active for "obj" and check whether cmdPtr + * is among them + */ +XOTCLINLINE static int +FilterActiveOnObj(Tcl_Interp *in, XOTclObject *obj, Tcl_Command cmd) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + XOTclCallStackContent *bot = cs->content; + register XOTclCallStackContent *csc = cs->top; + while (csc > bot) { + /* only check the callstack entries for this object && + only check the callstack entries for the given cmd */ + if (obj == csc->self && cmd == csc->cmdPtr && + csc->frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) { + return 1; + } + csc--; + } + return 0; +} + +/* + * search through the filter list on obj and class hierarchy + * for registration of a command ptr as filter + * + * returns a tcl obj list with the filter registration, like: + * " filter , + * " instfilter , + * or an empty list, if not registered + */ +static Tcl_Obj* +FilterFindReg(Tcl_Interp *in, XOTclObject *obj, Tcl_Command cmd) { + Tcl_Obj *list = Tcl_NewListObj(0, NULL); + XOTclClasses* pl; + + /* search per-object filters */ + if (obj->opt && CmdListFindCmdInList(cmd, obj->opt->filters)) { + Tcl_ListObjAppendElement(in, list, obj->cmdName); + Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_FILTER]); + Tcl_ListObjAppendElement(in, list, + Tcl_NewStringObj(Tcl_GetCommandName(in, cmd), -1)); + return list; + } + + /* search per-class filters */ + for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); pl; pl = pl->next) { + XOTclClassOpt* opt = pl->cl->opt; + if (opt && opt->instfilters) { + if (CmdListFindCmdInList(cmd, opt->instfilters)) { + Tcl_ListObjAppendElement(in, list, pl->cl->object.cmdName); + Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_INSTFILTER]); + Tcl_ListObjAppendElement(in, list, + Tcl_NewStringObj(Tcl_GetCommandName(in, cmd), -1)); + return list; + } + } + } + return list; +} + +/* + * before we can perform a filter dispatch, FilterSearchProc seeks the + * current filter and the relevant calling information + */ +static Tcl_Command +FilterSearchProc(Tcl_Interp *in, XOTclObject *obj, Tcl_ObjCmdProc **proc, ClientData* cp, + Tcl_Command* currentCmd, XOTclClass **cl) { + XOTclCmdList *cmdList; + + assert(obj); + assert(obj->filterStack); + + *currentCmd = 0; + *proc = 0; + *cp = 0; + + FilterSeekCurrent(in, obj, &cmdList); + while (cmdList) { + if (Tcl_Command_cmdEpoch(cmdList->cmdPtr)) { + cmdList = cmdList->next; + } else if (FilterActiveOnObj(in, obj, cmdList->cmdPtr)) { + /* fprintf(stderr, "Filter <%s> -- Active on: %s\n", + Tcl_GetCommandName(in, (Tcl_Command)cmdList->cmdPtr), ObjStr(obj->cmdName)); + */ + obj->filterStack->currentCmdPtr = cmdList->cmdPtr; + FilterSeekCurrent(in, obj, &cmdList); + } else { + /* ok. we' ve found it */ + *proc = Tcl_Command_objProc(cmdList->cmdPtr); + *cp = Tcl_Command_objClientData(cmdList->cmdPtr); + if (cmdList->clorobj && !XOTclObjectIsClass(&cmdList->clorobj->object)) { + *cl = NULL; + } else { + *cl = cmdList->clorobj; + } + *currentCmd = cmdList->cmdPtr; + /* fprintf(stderr, "FilterSearchProc - found: %s, %p\n", + Tcl_GetCommandName(in, (Tcl_Command)cmdList->cmdPtr), cmdList->cmdPtr); + */ + return cmdList->cmdPtr; + } + } + return 0; +} + + +static int +SuperclassAdd(Tcl_Interp *in, XOTclClass *cl, int oc, Tcl_Obj **ov, Tcl_Obj *arg) { + XOTclClasses *filterCheck, *osl = 0; + XOTclClass **scl = 0; + int reversed = 0; + int i, j; + + filterCheck = ComputeOrder(cl, cl->order, Super); + /* + * we have to remove all dependent superclass filter referenced + * by class or one of its subclasses + * + * do not check the class "cl" itself (first entry in + * filterCheck class list) + */ + if (filterCheck) + filterCheck = filterCheck->next; + while (filterCheck) { + FilterRemoveDependentFilterCmds(cl, filterCheck->cl); + filterCheck = filterCheck->next; + } + + /* invalidate all interceptors orders of instances of this + and of all depended classes */ + MixinInvalidateObjOrders(in, cl); + FilterInvalidateObjOrders(in, cl); + + scl = NEW_ARRAY(XOTclClass*,oc); + for (i = 0; i < oc; i++) { + if (GetXOTclClassFromObj(in, ov[i], &scl[i], 1) != TCL_OK) { + FREE(XOTclClass**, scl); + return XOTclErrBadVal(in, "superclass", "a list of classes", + ObjStr(arg)); + } + } + + /* + * check that superclasses don't precede their classes + */ + + for (i = 0; i < oc; i++) { + if (reversed != 0) break; + for (j = i+1; j < oc; j++) { + XOTclClasses* dl = ComputeOrder(scl[j], scl[j]->order, Super); + if (reversed != 0) break; + while (dl != 0) { + if (dl->cl == scl[i]) break; + dl = dl->next; + } + if (dl != 0) reversed = 1; + } + } + + if (reversed != 0) { + return XOTclErrBadVal(in, "superclass", "classes in dependence order", + ObjStr(arg)); + } + + while (cl->super != 0) { + + /* + * build up an old superclass list in case we need to revert + */ + + XOTclClass *sc = cl->super->cl; + XOTclClasses* l = osl; + osl = NEW(XOTclClasses); + osl->cl = sc; + osl->next = l; + (void)RemoveSuper(cl, cl->super->cl); + } + for (i = 0; i < oc; i++) + AddSuper(cl, scl[i]); + FREE(XOTclClass**,scl); + FlushPrecedences(cl); + + if (!ComputeOrder(cl, cl->order, Super)) { + + /* + * cycle in the superclass graph, backtrack + */ + + XOTclClasses* l; + while (cl->super != 0) (void)RemoveSuper(cl, cl->super->cl); + for (l = osl; l != 0; l = l->next) AddSuper(cl, l->cl); + XOTclFreeClasses(osl); + return XOTclErrBadVal(in, "superclass", "a cycle-free graph", ObjStr(arg)); + } + XOTclFreeClasses(osl); + + /* if there are no more super classes add the Object + class as superclasses */ + if (cl->super == 0) + AddSuper(cl, RUNTIME_STATE(in)->theObject); + + Tcl_ResetResult(in); + return TCL_OK; +} + + + +static int +varExists(Tcl_Interp *in, XOTclObject *obj, char *varName, char *index, + int triggerTrace, int requireDefined) { + XOTcl_FrameDecls; + Var *varPtr, *arrayPtr; + int result; + int flags; + + flags = (index == NULL) ? TCL_PARSE_PART1 : 0; + + if (obj->nsPtr) { + Tcl_SetNamespaceResolvers(obj->nsPtr, (Tcl_ResolveCmdProc*)NULL, + varResolver, (Tcl_ResolveCompiledVarProc*)NULL); + } + + XOTcl_PushFrame(in, obj); + +#if defined(PRE83) + varPtr = TclLookupVar(in, varName, index, flags, "access", + /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); +#else + if (triggerTrace) + varPtr = TclVarTraceExists(in, varName); + else + varPtr = TclLookupVar(in, varName, index, flags, "access", + /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); +#endif + result = ((varPtr != NULL) && + (!requireDefined || !TclIsVarUndefined(varPtr))); + + XOTcl_PopFrame(in, obj); + + if (obj->nsPtr) { + Tcl_SetNamespaceResolvers(obj->nsPtr, (Tcl_ResolveCmdProc*)NULL, + (Tcl_ResolveVarProc *)NULL, + (Tcl_ResolveCompiledVarProc*)NULL); + } + return result; +} + +static void +getVarAndNameFromHash(Tcl_HashEntry *hPtr, Var **val, Tcl_Obj **varNameObj) { + *val = VarHashGetValue(hPtr); +#if defined(PRE85) +# if FORWARD_COMPATIBLE + if (forwardCompatibleMode) { + *varNameObj = VarHashGetKey(*val); + } else { + *varNameObj = Tcl_NewStringObj(Tcl_GetHashKey(hPtr->tablePtr, hPtr),-1); + } +# else + *varNameObj = Tcl_NewStringObj(Tcl_GetHashKey(hPtr->tablePtr, hPtr),-1); +# endif +#else + *varNameObj = VarHashGetKey(*val); +#endif +} + +/* + * Search default values specified through 'parameter' on one class + */ +static int +SearchDefaultValuesOnClass(Tcl_Interp *in, XOTclObject *obj, + XOTclClass *cmdCl, XOTclClass *targetClass) { + int result = TCL_OK; + Var *defaults, *initcmds; + Tcl_Namespace *ns = targetClass->object.nsPtr; + TclVarHashTable *varTable = ns ? Tcl_Namespace_varTable(ns) : targetClass->object.varTable; + + defaults = LookupVarFromTable(varTable, "__defaults",(XOTclObject*)targetClass); + initcmds = LookupVarFromTable(varTable, "__initcmds",(XOTclObject*)targetClass); + + if (defaults && TclIsVarArray(defaults)) { + TclVarHashTable *tablePtr = valueOfVar(TclVarHashTable,defaults,tablePtr); + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr = tablePtr ? Tcl_FirstHashEntry(VarHashTable(tablePtr), &hSrch) : 0; + + /*fprintf(stderr, "+++ we have defaults for %s in <%s>\n", + ObjStr(obj->cmdName),className(targetClass));*/ + + /* iterate over all elements of the defaults array */ + for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { + Var *val; + Tcl_Obj *varNameObj; + + getVarAndNameFromHash(hPtr, &val, &varNameObj); + INCR_REF_COUNT(varNameObj); + + if (TclIsVarScalar(val)) { + Tcl_Obj *oldValue = XOTclOGetInstVar2((XOTcl_Object*) obj, + in, varNameObj, NULL, + TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1); + /** we check whether the variable is already set. + if so, we do not set it again */ + if (oldValue == NULL) { + Tcl_Obj *valueObj = valueOfVar(Tcl_Obj,val,objPtr); + char *value = ObjStr(valueObj), *v; + int doSubst = 0; + for (v=value; *v; v++) { + if (*v == '[' && doSubst == 0) + doSubst = 1; + else if ((doSubst == 1 && *v == ']') || *v == '$') { + doSubst = 2; + break; + } + } + if (doSubst == 2) { /* we have to subst */ + Tcl_Obj *ov[2]; + int rc = CallStackPush(in, obj, cmdCl, 0, 1, + &varNameObj, XOTCL_CSC_TYPE_PLAIN); + if (rc != TCL_OK) { + DECR_REF_COUNT(varNameObj); + return rc; + } + ov[1] = valueObj; + Tcl_ResetResult(in); + rc = XOTcl_SubstObjCmd(NULL, in, 2, ov); + CallStackPop(in); + if (rc == TCL_OK) { + valueObj = Tcl_GetObjResult(in); + } else { + DECR_REF_COUNT(varNameObj); + return rc; + } + } + /*fprintf(stderr,"calling %s value='%s'\n", + ObjStr(varNameObj),ObjStr(valueObj));*/ + INCR_REF_COUNT(valueObj); + result = XOTclCallMethodWithArgs((ClientData)obj, in, + varNameObj, valueObj, 1, 0, 0); + DECR_REF_COUNT(valueObj); + + if (result != TCL_OK) { + DECR_REF_COUNT(varNameObj); + return result; + } + } + } + DECR_REF_COUNT(varNameObj); + } + } + + if (initcmds && TclIsVarArray(initcmds)) { + TclVarHashTable *tablePtr = valueOfVar(TclVarHashTable,initcmds,tablePtr); + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr = tablePtr ? Tcl_FirstHashEntry(VarHashTable(tablePtr), &hSrch) : 0; + + /*fprintf(stderr, "+++ we have initcmds for <%s>\n", className(targetClass));*/ + /* iterate over the elements of initcmds */ + for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { + Var *val; + Tcl_Obj *varNameObj; + + getVarAndNameFromHash(hPtr, &val, &varNameObj); + + INCR_REF_COUNT(varNameObj); + /*fprintf(stderr,"varexists(%s->%s) = %d\n", + ObjStr(obj->cmdName), + ObjStr(varNameObj), varExists(in, obj, ObjStr(varNameObj), NULL, 0, 0));*/ + + if (TclIsVarScalar(val) && + (!varExists(in, obj, ObjStr(varNameObj), NULL, 0, 0) || + varExists(in, &targetClass->object, "__defaults", ObjStr(varNameObj), 0,0) + )) { + Tcl_Obj *valueObj = valueOfVar(Tcl_Obj,val,objPtr); + char *string = ObjStr(valueObj); + int rc; + XOTcl_FrameDecls; + if (*string) { + XOTcl_PushFrame(in, obj); /* make instvars accessible */ + CallStackPush(in, obj, cmdCl, 0, 1, + &varNameObj, XOTCL_CSC_TYPE_PLAIN); /*allow to call self*/ + + /*fprintf(stderr,"evaluating '%s' obj=%s\n\n",ObjStr(valueObj),ObjStr(obj->cmdName)); + XOTclCallStackDump(in);*/ + + rc = Tcl_EvalObjEx(in, valueObj, TCL_EVAL_DIRECT); + CallStackPop(in); + XOTcl_PopFrame(in, obj); + if (rc != TCL_OK) { + DECR_REF_COUNT(varNameObj); + return rc; + } + /* fprintf(stderr,"... varexists(%s->%s) = %d\n", + ObjStr(obj->cmdName), + varName, varExists(in, obj, varName, NULL, 0, 0)); */ + } + } + DECR_REF_COUNT(varNameObj); + } + } + return result; +} + +/* + * Search default values specified through 'parameter' on + * mixin and class hierarchy + */ +static int +SearchDefaultValues(Tcl_Interp *in, XOTclObject *obj, XOTclClass *cmdCl) { + XOTcl_FrameDecls; + XOTclClass *cl = obj->cl, *mixin; + XOTclClasses *pl = 0; + XOTclCmdList *ml = 0; + int result = TCL_OK; + + if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) + MixinComputeDefined(in, obj); + if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) + ml = obj->mixinOrder; + + assert(cl); + + XOTcl_PushFrame(in, obj); + + while (ml) { + mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); + result = SearchDefaultValuesOnClass(in, obj, cmdCl, mixin); + if (result != TCL_OK) + break; + ml = ml->next; + } + + for (pl = ComputeOrder(cl, cl->order, Super); pl; pl = pl->next) { + result = SearchDefaultValuesOnClass(in, obj, cmdCl, pl->cl); + if (result != TCL_OK) + break; + } + + XOTcl_PopFrame(in,obj); + return result; +} + +static int +ParameterSearchDefaultsMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + XOTclObject *defaultObj; + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc != 2) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "searchDefaults obj"); + if (XOTclObjConvertObject(in, objv[1], &defaultObj) != TCL_OK) + return XOTclVarErrMsg(in, "Can't find default object ", + ObjStr(objv[1]), (char *) NULL); + + /* + * Search for default values for vars on superclasses + */ + return SearchDefaultValues(in, defaultObj, defaultObj->cl); +} + +static int +callParameterMethodWithArg(XOTclObject *obj, Tcl_Interp *in, Tcl_Obj *method, + Tcl_Obj *arg, int objc, Tcl_Obj *CONST objv[], int flags) { + XOTclClassOpt* opt = obj->cl->opt; + Tcl_Obj *pcl = XOTclGlobalObjects[XOTE_PARAM_CL]; + XOTclClass *paramCl; + int result; + + if (opt && opt->parameterClass) pcl = opt->parameterClass; + + if (GetXOTclClassFromObj(in,pcl,¶mCl, 1) == TCL_OK) { + result = XOTclCallMethodWithArgs((ClientData)paramCl, in, + method, arg, objc-2, objv, flags); + } + else + result = XOTclVarErrMsg(in, "create: can't find parameter class", + (char *) NULL); + return result; +} + + +/* + * method dispatch + */ + +/* actually call a method (with assertion checking) */ +static int +callProcCheck(ClientData cp, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[], + Tcl_Command cmd, XOTclObject *obj, XOTclClass *cl, + char *methodName, int frameType, int isTclProc) { + int result = TCL_OK; + XOTclRuntimeState *rst = RUNTIME_STATE(in); + CheckOptions co; + +#if defined(PROFILE) + long int startUsec, startSec; + struct timeval trt; + + gettimeofday(&trt, NULL); + startSec = trt.tv_sec; + startUsec = trt.tv_usec; +#endif + assert(obj); + + rst->callIsDestroy = 0; + /*fprintf(stderr,"callProcCheck: setting callIsDestroy = 0, m=%s obj=%p (%s)\n", + methodName, obj, ObjStr(obj->cmdName));*/ + + /* + fprintf(stderr,"*** callProcCheck: cmd = %p\n",cmd); + fprintf(stderr, + "cp=%p, isTclProc=%d %p %s, dispatch=%d %p, forward=%d %p, scoped %p, ov[0]=%p oc=%d\n", + cp, + isTclProc, cmd, + Tcl_GetCommandName(in, cmd), + Tcl_Command_objProc(cmd) == XOTclObjDispatch, XOTclObjDispatch, + Tcl_Command_objProc(cmd) == XOTclForwardMethod, XOTclForwardMethod, + XOTclObjscopedMethod, + objv[0], objc + );*/ + + +#ifdef CALLSTACK_TRACE + XOTclCallStackDump(in); +#endif + + if (!isTclProc && obj->teardown) { + co = 0; + if (obj->opt) co = obj->opt->checkoptions; + if ((co & CHECK_INVAR) && + ((result = AssertionCheckInvars(in, obj, methodName, co)) == TCL_ERROR)) { + goto finish; + } + +#ifdef DISPATCH_TRACE + printCall(in,"callProcCheck cmd", objc,objv); + /*fprintf(stderr,"\tproc=%s\n",Tcl_GetCommandName(in,cmd));*/ +#endif + result = (*Tcl_Command_objProc(cmd))(cp, in, objc, objv); + +#ifdef DISPATCH_TRACE + printExit(in,"callProcCheck cmd", objc,objv, result); + /*fprintf(stderr, " returnCode %d xotcl rc %d\n", + Tcl_Interp_returnCode(in), rst->returnCode);*/ +#endif + + /* + if (obj && obj->teardown && cl && !(obj->flags & XOTCL_DESTROY_CALLED)) { + fprintf(stderr, "Obj= %s ", ObjStr(obj->cmdName)); + fprintf(stderr, "CL= %s ", ObjStr(cl->object.cmdName)); + fprintf(stderr, "method=%s\n", methodName); + } + */ + co = 0; + if (!rst->callIsDestroy && obj->opt) co = obj->opt->checkoptions; + if ((co & CHECK_INVAR) && + ((result = AssertionCheckInvars(in, obj, methodName,co)) == TCL_ERROR)) { + goto finish; + } + } else { + /* isTclProc == 1 + * if this is a filter, check whether its guard applies, + * if not: just step forward to the next filter + */ + if (frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) { + XOTclCmdList *cmdList; + /* + * seek cmd in obj's filterOrder + */ + assert(obj->flags & XOTCL_FILTER_ORDER_VALID); + /* otherwise: FilterComputeDefined(in, obj);*/ + + cmdList = obj->filterOrder; + while (cmdList && cmdList->cmdPtr != cmd) + cmdList = cmdList->next; + + /* + * when it is found, check whether it has a filter guard + */ + if (cmdList) { + int rc = GuardCall(obj, cl, (Tcl_Command) cmdList->cmdPtr, in, + cmdList->clientData, 0); + if (rc != TCL_OK) { + if (rc != TCL_ERROR) { + /* + * call next, use the given objv's, not the callstack objv + * we may not be in a method, thus there may be wrong or + * no callstackobjs + */ + /*fprintf(stderr, "... calling nextmethod\n"); XOTclCallStackDump(in);*/ + + rc = XOTclNextMethod(obj, in, cl, methodName, + objc, objv, /*useCallStackObjs*/ 0); + /*fprintf(stderr, "... after nextmethod\n"); + XOTclCallStackDump(in);*/ + + } + + return rc; + } + } + } + + if (!rst->callIsDestroy && obj->teardown + && !(obj->flags & XOTCL_DESTROY_CALLED)) { + if (obj->opt && + (obj->opt->checkoptions & CHECK_PRE) && + (result = AssertionCheck(in, obj, cl, methodName, CHECK_PRE)) == TCL_ERROR) { + goto finish; + } + } + + if (Tcl_Interp_numLevels(in) <= 2) + rst->returnCode = TCL_OK; +#ifdef DISPATCH_TRACE + printCall(in,"callProcCheck tclCmd", objc,objv); + fprintf(stderr,"\tproc=%s\n",Tcl_GetCommandName(in,cmd)); +#endif + + result = (*Tcl_Command_objProc(cmd))(cp, in, objc, objv); + +#ifdef DISPATCH_TRACE + printExit(in,"callProcCheck tclCmd", objc,objv, result); + /* fprintf(stderr, " returnCode %d xotcl rc %d\n", + Tcl_Interp_returnCode(in), rst->returnCode);*/ +#endif + /*if (Tcl_Interp_numLevels(in) <= 2 && rst->returnCode == TCL_BREAK) + result = TCL_BREAK; + else*/ if (result == TCL_BREAK && rst->returnCode == TCL_OK) + rst->returnCode = result; + + /* we give the information whether the call has destroyed the + object back to the caller, because after CallStackPop it + cannot be retrieved via the call stack */ + /* if the object is destroyed -> the assertion structs's are already + destroyed */ + if (rst->cs.top->callType & XOTCL_CSC_CALL_IS_DESTROY) { + rst->callIsDestroy = 1; + /*fprintf(stderr,"callProcCheck: setting callIsDestroy = 1\n");*/ + } + + if (obj->opt && !rst->callIsDestroy && obj->teardown && + (obj->opt->checkoptions & CHECK_POST) && + (result = AssertionCheck(in, obj, cl, methodName, CHECK_POST) == TCL_ERROR)) { + goto finish; + } + } + + finish: + +#if defined(PROFILE) + if (rst->callIsDestroy == 0) { + XOTclProfileEvaluateData(in, startSec, startUsec, obj, cl, methodName); + } +#endif + + return result; +} + +static int +DoCallProcCheck(ClientData cp, ClientData cd, Tcl_Interp *in, + int objc, Tcl_Obj *CONST objv[], + Tcl_Command cmd, XOTclObject *obj, + XOTclClass *cl, char *methodName, + int frameType, int fromNext) { + int rc, push = 1, isTclProc = 0; + + if (cp) { + Tcl_ObjCmdProc *proc = Tcl_Command_objProc(cmd); + if (proc == XOTclObjDispatch) { + assert((TclIsProc((Command *)cmd) == NULL)); + } else if (proc == XOTclForwardMethod || + proc == XOTclObjscopedMethod) { + tclCmdClientData *tcd = (tclCmdClientData *)cp; + tcd->obj = obj; + assert((TclIsProc((Command *)cmd) == NULL)); + } else if (cp == XOTCL_NONLEAF_METHOD) { + cp = cd; + assert((TclIsProc((Command *)cmd) == NULL)); + } else { + assert((TclIsProc((Command *)cmd) != NULL)); + isTclProc = 1; + } + } else { + push = 0; + assert((TclIsProc((Command *)cmd) == NULL)); + cp = cd; + } + + if (!fromNext) { + objc--; + objv++; + } + + if (push) { + /* push the xotcl info */ + if ((CallStackPush(in, obj, cl, cmd, objc, objv, frameType)) != TCL_OK) + return TCL_ERROR; + } + rc = callProcCheck(cp, in, objc, objv, cmd, obj, cl, + methodName, frameType, isTclProc); + if (push) { + CallStackPop(in); + } + + return rc; +} + + +XOTCLINLINE static int +DoDispatch(ClientData cd, Tcl_Interp *in, int objc, + Tcl_Obj *CONST objv[], int flags) { + register XOTclObject *obj = (XOTclObject*)cd; + int result = TCL_OK, mixinStackPushed = 0, + filterStackPushed = 0, unknown, objflags, + frameType = XOTCL_CSC_TYPE_PLAIN; +#ifdef OBJDELETION_TRACE + Tcl_Obj *method; +#endif + char *methodName, *callMethod; + XOTclClass *cl = 0; + ClientData cp = 0; + Tcl_ObjCmdProc *proc = 0; + Tcl_Command cmd = 0; + XOTclRuntimeState *rst = RUNTIME_STATE(in); + Tcl_Obj *cmdName = obj->cmdName; + XOTclCallStack *cs = &rst->cs; + /*int isdestroy = (objv[1] == XOTclGlobalObjects[XOTE_DESTROY]); */ +#ifdef AUTOVARS + int isNext; +#endif + + assert(objc>0); + methodName = ObjStr(objv[1]); + +#ifdef AUTOVARS + isNext = isNextString(methodName); +#endif +#ifdef DISPATCH_TRACE + printCall(in,"DISPATCH", objc,objv); +#endif + +#ifdef OBJDELETION_TRACE + method = objv[1]; + if (method == XOTclGlobalObjects[XOTE_CLEANUP] || + method == XOTclGlobalObjects[XOTE_DESTROY]) { + fprintf(stderr, "%s->%s id=%p destroyCalled=%d\n", + ObjStr(cmdName), methodName, obj, + (obj->flags & XOTCL_DESTROY_CALLED)); + } +#endif + + objflags = obj->flags; /* avoid stalling */ + INCR_REF_COUNT(cmdName); + + if (!(objflags & XOTCL_FILTER_ORDER_VALID)) + FilterComputeDefined(in, obj); + + if (!(objflags & XOTCL_MIXIN_ORDER_VALID)) + MixinComputeDefined(in, obj); + + callMethod = methodName; +#ifdef AUTOVARS + if (!isNext) { +#endif + /* Only start new filter chain, if + (a) filters are defined and + (b) the toplevel csc entry is not an filter on self + */ + if (RUNTIME_STATE(in)->doFilters && + !(flags & XOTCL_CM_NO_FILTERS) && !cs->guardCount && + ((obj->flags & XOTCL_FILTER_ORDER_DEFINED_AND_VALID) == + XOTCL_FILTER_ORDER_DEFINED_AND_VALID)) { + XOTclObject *self = GetSelfObj(in); + if (obj != self || + cs->top->frameType != XOTCL_CSC_TYPE_ACTIVE_FILTER) { + + filterStackPushed = FilterStackPush(in, obj, objv[1]); + cmd = FilterSearchProc(in, obj, &proc, &cp, + &obj->filterStack->currentCmdPtr,&cl); + if (cmd) { /* 'proc' and the other output vars are set as well */ + frameType = XOTCL_CSC_TYPE_ACTIVE_FILTER; + callMethod = (char *)Tcl_GetCommandName(in, cmd); + } else { + FilterStackPop(obj); + filterStackPushed = 0; + } + } + } + + /* check if a mixin is to be called. + don't use mixins on next method calls, since normally it is not + intercepted (it is used as a primitive command). + don't use mixins on init calls, since init is invoked on mixins + during mixin registration (in XOTclOMixinMethod) + */ + + if ((obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) == + XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { + + mixinStackPushed = MixinStackPush(obj); + + if (frameType != XOTCL_CSC_TYPE_ACTIVE_FILTER) { + cmd = MixinSearchProc(in, obj, methodName, &cl, &proc, &cp, + &obj->mixinStack->currentCmdPtr); + if (cmd) { /* 'proc' and the other output vars are set as well */ + frameType = XOTCL_CSC_TYPE_ACTIVE_MIXIN; + } else { /* the else branch could be deleted */ + MixinStackPop(obj); + mixinStackPushed = 0; + } + } + } +#ifdef AUTOVARS + } +#endif + + /* if no filter/mixin is found => do ordinary method lookup */ + if (proc == 0) { + /* + fprintf(stderr,"ordinary lookup for obj %p method %s nsPtr %p\n", + obj, methodName, obj->nsPtr);*/ + /*if (obj->nsPtr && !(obj->flags & XOTCL_NS_DESTROYED))*/ + if (obj->nsPtr) + cmd = FindMethod(methodName, obj->nsPtr); + /*fprintf(stderr,"findMethod for proc '%s' in %p returned %p\n",methodName, obj->nsPtr, cmd);*/ + + if (cmd == NULL) + cl = SearchCMethod(obj->cl, methodName, &cmd); + + if (cmd) { + proc = Tcl_Command_objProc(cmd); + cp = Tcl_Command_objClientData(cmd); + } else { + assert(cp == 0); + } + } + + if (proc) { + result = TCL_OK; + if ((result = DoCallProcCheck(cp, cd, in, objc, objv, cmd, obj, cl, + callMethod, frameType, 0 /* fromNext */)) == TCL_ERROR) { + result = XOTclErrInProc(in, cmdName, cl ? cl->object.cmdName : NULL, callMethod); + } + unknown = RUNTIME_STATE(in)->unknown; + } else { + unknown = 1; + } + + if (result == TCL_OK) { + /*fprintf(stderr,"after doCallProcCheck unknown == %d\n",unknown);*/ + if (unknown) { + + if (XOTclObjectIsClass(obj) && (flags & XOTCL_CM_NO_UNKNOWN)) { + return XOTclVarErrMsg(in, ObjStr(objv[0]), + ": unable to dispatch method '", + callMethod, "'", (char *) NULL); + } else if (objv[1] != XOTclGlobalObjects[XOTE_UNKNOWN]) { + /* + * back off and try unknown; + */ + XOTclObject *obj = (XOTclObject*)cd; + ALLOC_ON_STACK(Tcl_Obj*,objc+1, tov); + /* + fprintf(stderr,"calling unknown for %s %s, flgs=%02x,%02x isClass=%d %p %s\n", + ObjStr(obj->cmdName), ObjStr(objv[1]), flags, XOTCL_CM_NO_UNKNOWN, + XOTclObjectIsClass(obj), obj, ObjStr(obj->cmdName)); + */ + tov[0] = obj->cmdName; + tov[1] = XOTclGlobalObjects[XOTE_UNKNOWN]; + if (objc>1) + memcpy(tov+2, objv+1, sizeof(Tcl_Obj *)*(objc-1)); + /* + fprintf(stderr,"?? %s unknown %s\n",ObjStr(obj->cmdName), ObjStr(tov[2])); + */ + result = DoDispatch(cd, in, objc+1, tov, flags | XOTCL_CM_NO_UNKNOWN); + FREE_ON_STACK(tov); + + } else { /* unknown failed */ + return XOTclVarErrMsg(in, ObjStr(objv[0]), + ": unable to dispatch method '", + ObjStr(objv[2]), "'", (char *) NULL); + } + + } + } + /* be sure to reset unknown flag */ + if (unknown) + RUNTIME_STATE(in)->unknown = 0; + +#ifdef DISPATCH_TRACE + printExit(in,"DISPATCH", objc,objv, result); + fprintf(stderr,"obj %p mixinStackPushed %d mixinStack %p\n", + obj, mixinStackPushed, obj->mixinStack); +#endif + + + /*if (!rst->callIsDestroy ) + fprintf(stderr, "obj freed? %p destroy %p self %p %s %d [%d] reference=%d,%d\n",obj, + cs->top->destroyedCmd, cs->top->self, ObjStr(objv[1]), + rst->callIsDestroy, + cs->top->callType & XOTCL_CSC_CALL_IS_DESTROY, + !rst->callIsDestroy, + isdestroy);*/ + + + if (!rst->callIsDestroy) { + /*!(obj->flags & XOTCL_DESTROY_CALLED)) {*/ + if (mixinStackPushed && obj->mixinStack) + MixinStackPop(obj); + + if (filterStackPushed && obj->filterStack) + FilterStackPop(obj); + } + + DECR_REF_COUNT(cmdName); /* must be after last dereferencing of obj */ + return result; +} + +static int +ObjDispatch(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[], + int flags) { + int result; + +#ifdef STACK_TRACE + XOTclStackDump(in); +#endif + +#ifdef CALLSTACK_TRACE + XOTclCallStackDump(in); +#endif + + if (objc == 1) { + Tcl_Obj *tov[2]; + tov[0] = objv[0]; + tov[1] = XOTclGlobalObjects[XOTE_DEFAULTMETHOD]; + result = DoDispatch(cd, in, 2, tov, flags); + } else { + /* normal dispatch */ + result = DoDispatch(cd, in, objc, objv, flags); + } + + return result; +} + +#ifdef XOTCL_BYTECODE +int +XOTclDirectSelfDispatch(ClientData cd, Tcl_Interp *in, + int objc, Tcl_Obj *CONST objv[]) { + int result; +#ifdef XOTCLOBJ_TRACE + XOTclObject *obj; +#endif + objTrace("BEFORE SELF DISPATCH", obj); + result = ObjDispatch((ClientData)GetSelfObj(in), in, objc, objv, 0); + objTrace("AFTER SELF DISPATCH", obj); + return result; +} +#endif + +int +XOTclObjDispatch(ClientData cd, Tcl_Interp *in, + int objc, Tcl_Obj *CONST objv[]) { + return ObjDispatch(cd, in, objc, objv, 0); +} + +/* + * Non Positional Args + */ + +static void +NonposArgsDeleteHashEntry(Tcl_HashEntry* hPtr) { + XOTclNonposArgs* nonposArg = (XOTclNonposArgs*) Tcl_GetHashValue(hPtr); + if (nonposArg) { + DECR_REF_COUNT(nonposArg->nonposArgs); + DECR_REF_COUNT(nonposArg->ordinaryArgs); + MEM_COUNT_FREE("nonposArg",nonposArg); + ckfree((char *) nonposArg); + Tcl_DeleteHashEntry(hPtr); + } +} + +static Tcl_HashTable* +NonposArgsCreateTable() { + Tcl_HashTable* nonposArgsTable = + (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); + MEM_COUNT_ALLOC("Tcl_HashTable",nonposArgsTable); + Tcl_InitHashTable(nonposArgsTable, TCL_STRING_KEYS); + MEM_COUNT_ALLOC("Tcl_InitHashTable",nonposArgsTable); + return nonposArgsTable; +} + +static void +NonposArgsFreeTable(Tcl_HashTable* nonposArgsTable) { + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr = nonposArgsTable ? + Tcl_FirstHashEntry(nonposArgsTable, &hSrch) : 0; + for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { + NonposArgsDeleteHashEntry(hPtr); + } +} + +static XOTclNonposArgs* +NonposArgsGet(Tcl_HashTable* nonposArgsTable, char * methodName) { + Tcl_HashEntry* hPtr; + if (nonposArgsTable && + ((hPtr = Tcl_FindHashEntry(nonposArgsTable, methodName)))) { + return (XOTclNonposArgs*) Tcl_GetHashValue(hPtr); + } + return NULL; +} + +static Tcl_Obj* +NonposArgsFormat(Tcl_Interp *in, Tcl_Obj* nonposArgsData) { + int r1, npalistc, npac, checkc, i, j, first; + Tcl_Obj **npalistv, **npav, **checkv, + *list = Tcl_NewListObj(0, NULL), *innerlist, + *nameStringObj; + + /*fprintf(stderr, "nonposargsformat '%s'\n", ObjStr(nonposArgsData));*/ + + r1 = Tcl_ListObjGetElements(in, nonposArgsData, &npalistc, &npalistv); + if (r1 == TCL_OK) { + for (i=0; i < npalistc; i++) { + r1 = Tcl_ListObjGetElements(in, npalistv[i], &npac, &npav); + if (r1 == TCL_OK) { + nameStringObj = Tcl_NewStringObj("-", 1); + Tcl_AppendStringsToObj(nameStringObj, ObjStr(npav[0]), + (char *) NULL); + if (npac > 1 && *(ObjStr(npav[1])) != '\0') { + first = 1; + r1 = Tcl_ListObjGetElements(in, npav[1], &checkc, &checkv); + if (r1 == TCL_OK) { + for (j=0; j < checkc; j++) { + if (first) { + Tcl_AppendToObj(nameStringObj,":",1); + first = 0; + } else { + Tcl_AppendToObj(nameStringObj,",",1); + } + Tcl_AppendToObj(nameStringObj, ObjStr(checkv[j]), -1); + } + } + } + /* fprintf(stderr, "nonposargsformat namestring '%s'\n", + ObjStr(nameStringObj));*/ + +#if 1 + innerlist = Tcl_NewListObj(0, NULL); + Tcl_ListObjAppendElement(in, innerlist, nameStringObj); + if (npac > 2) { + Tcl_ListObjAppendElement(in, innerlist, npav[2]); + } +#else + { + Tcl_DString ds, *dsPtr = &ds; + DSTRING_INIT(dsPtr); + Tcl_DStringAppend(dsPtr, ObjStr(nameStringObj), -1); + if (npac > 2) { + Tcl_DStringAppendElement(dsPtr, ObjStr(npav[2])); + } + innerlist = Tcl_NewStringObj(Tcl_DStringValue(dsPtr), + Tcl_DStringLength(dsPtr)); + DSTRING_FREE(dsPtr); + } +#endif + Tcl_ListObjAppendElement(in, list, innerlist); + } + } + } + return list; +} + +/* + * Proc-Creation + */ + +static Tcl_Obj* addPrefixToBody(Tcl_Obj *body, int nonposArgs) { + Tcl_Obj* resultBody; + resultBody = Tcl_NewStringObj("", 0); + INCR_REF_COUNT(resultBody); + Tcl_AppendStringsToObj(resultBody, "::xotcl::initProcNS\n", (char *) NULL); + if (nonposArgs) { + Tcl_AppendStringsToObj(resultBody, + "::xotcl::interpretNonpositionalArgs $args\n", + (char *) NULL); + } + Tcl_AppendStringsToObj(resultBody, ObjStr(body), (char *) NULL); + return resultBody; +} + +static int +parseNonposArgs(Tcl_Interp *in, + char *procName, Tcl_Obj *npArgs, Tcl_Obj *ordinaryArgs, + Tcl_HashTable **nonposArgsTable, + int *haveNonposArgs) { + int rc, nonposArgsDefc, npac; + Tcl_Obj **nonposArgsDefv; + + rc = Tcl_ListObjGetElements(in, npArgs, &nonposArgsDefc, &nonposArgsDefv); + if (rc != TCL_OK) { + return XOTclVarErrMsg(in, "cannot break down non-positional args: ", + ObjStr(npArgs), (char *) NULL); + } + if (nonposArgsDefc > 0) { + int start, end, length, i, j, nw = 0; + char *arg; + Tcl_Obj *npaObj, **npav, *nonposArgsObj = Tcl_NewListObj(0, NULL); + Tcl_HashEntry *hPtr; + + INCR_REF_COUNT(nonposArgsObj); + for (i=0; i < nonposArgsDefc; i++) { + rc = Tcl_ListObjGetElements(in, nonposArgsDefv[i], &npac, &npav); + if (rc == TCL_ERROR || npac < 1 || npac > 2) { + DECR_REF_COUNT(nonposArgsObj); + return XOTclVarErrMsg(in, "wrong # of elements in non-positional args ", + "(should be 1 or 2 list elements): ", + ObjStr(npArgs), (char *) NULL); + } + npaObj = Tcl_NewListObj(0, NULL); + arg = ObjStr(npav[0]); + if (arg[0] != '-') { + DECR_REF_COUNT(npaObj); + DECR_REF_COUNT(nonposArgsObj); + return XOTclVarErrMsg(in, "non-positional args does not start with '-': ", + arg, " in: ", ObjStr(npArgs), (char *) NULL); + } + + length = strlen(arg); + for (j=0; j0 && isspace((int)arg[end-1]); end--); + Tcl_ListObjAppendElement(in, list, + Tcl_NewStringObj(arg+start, end-start)); + l++; + start = l; + while(start0 && isspace((int)arg[end-1]); end--); + Tcl_ListObjAppendElement(in, list, + Tcl_NewStringObj(arg+start, end-start)); + + /* append the whole thing to the list */ + Tcl_ListObjAppendElement(in, npaObj, list); + } else { + Tcl_ListObjAppendElement(in, npaObj, Tcl_NewStringObj(arg+1, length)); + Tcl_ListObjAppendElement(in, npaObj, Tcl_NewStringObj("", 0)); + } + if (npac == 2) { + Tcl_ListObjAppendElement(in, npaObj, npav[1]); + } + Tcl_ListObjAppendElement(in, nonposArgsObj, npaObj); + *haveNonposArgs = 1; + } + + if (*haveNonposArgs) { + XOTclNonposArgs* nonposArg; + + if (*nonposArgsTable == 0) { + *nonposArgsTable = NonposArgsCreateTable(); + } + + hPtr = Tcl_CreateHashEntry(*nonposArgsTable, procName, &nw); + assert(nw); + + MEM_COUNT_ALLOC("nonposArg",nonposArg); + nonposArg = (XOTclNonposArgs*)ckalloc(sizeof(XOTclNonposArgs)); + nonposArg->nonposArgs = nonposArgsObj; + nonposArg->ordinaryArgs = ordinaryArgs; + INCR_REF_COUNT(ordinaryArgs); + Tcl_SetHashValue(hPtr, (ClientData)nonposArg); + } else { + /* for strange reasons, we did not find nonpos-args, although we + have definitions */ + DECR_REF_COUNT(nonposArgsObj); + } + } + return TCL_OK; +} + + +static int +MakeProc(Tcl_Namespace *ns, XOTclAssertionStore *aStore, + Tcl_HashTable **nonposArgsTable, + Tcl_Interp *in, int objc, Tcl_Obj *objv[], XOTclObject *obj) { + int result, incr, haveNonposArgs=0; + TclCallFrame frame, *framePtr = &frame; + Tcl_Obj *ov[4]; + Tcl_HashEntry* hPtr = NULL; + char *procName = ObjStr(objv[1]); + + if (*nonposArgsTable && (hPtr = Tcl_FindHashEntry(*nonposArgsTable, procName))) { + NonposArgsDeleteHashEntry(hPtr); + } + + ov[0] = objv[0]; + ov[1] = objv[1]; + + if (objc == 5 || objc == 7) { + if ((result = parseNonposArgs(in, procName, objv[2], objv[3], + nonposArgsTable, &haveNonposArgs)) != TCL_OK) + return result; + + if (haveNonposArgs) { + ov[2] = XOTclGlobalObjects[XOTE_ARGS]; + ov[3] = addPrefixToBody(objv[4], 1); + } else { /* no nonpos arguments */ + ov[2] = objv[3]; + ov[3] = addPrefixToBody(objv[4], 0); + } + } else { +#if !defined(XOTCL_DISJOINT_ARGLISTS) + int argsc, i; + Tcl_Obj **argsv; + + /* see, if we have nonposArgs in the ordinary argument list */ + result = Tcl_ListObjGetElements(in, objv[2], &argsc, &argsv); + if (result != TCL_OK) { + return XOTclVarErrMsg(in, "cannot break args into list: ", + ObjStr(objv[2]), (char *) NULL); + } + for (i=0; i 0) { + arg = ObjStr(npav[0]); + /* fprintf(stderr, "*** argparse1 arg='%s' rc=%d\n",arg,rc);*/ + if (*arg == '-') { + haveNonposArgs = 1; + continue; + } + } + break; + } + if (haveNonposArgs) { + int nrOrdinaryArgs = argsc - i; + Tcl_Obj *ordinaryArgs = Tcl_NewListObj(nrOrdinaryArgs, &argsv[i]); + Tcl_Obj *nonposArgs = Tcl_NewListObj(i, &argsv[0]); + INCR_REF_COUNT(ordinaryArgs); + INCR_REF_COUNT(nonposArgs); + /* fprintf(stderr, "nonpos <%s> ordinary <%s>\n", + ObjStr(nonposArgs),ObjStr(ordinaryArgs));*/ + result = parseNonposArgs(in, procName, nonposArgs, ordinaryArgs, + nonposArgsTable, &haveNonposArgs); + DECR_REF_COUNT(ordinaryArgs); + DECR_REF_COUNT(nonposArgs); + if (result != TCL_OK) + return result; + } +#endif + if (haveNonposArgs) { + ov[2] = XOTclGlobalObjects[XOTE_ARGS]; + ov[3] = addPrefixToBody(objv[3], 1); + } else { /* no nonpos arguments */ + ov[2] = objv[2]; + ov[3] = addPrefixToBody(objv[3], 0); + } + + } + +#ifdef AUTOVARS + { char *p, *body; + body = ObjStr(ov[3]); + if ((p = strstr(body, "self")) && p != body && *(p-1) != '[') + Tcl_AppendStringsToObj(ov[3], "::set self [self]\n", (char *) NULL); + if (strstr(body, "proc")) + Tcl_AppendStringsToObj(ov[3], "::set proc [self proc]\n", (char *) NULL); + if (strstr(body, "class")) + Tcl_AppendStringsToObj(ov[3], "::set class [self class]\n", (char *) NULL); + } +#endif + + Tcl_PushCallFrame(in,(Tcl_CallFrame *)framePtr,ns,0); + + result = Tcl_ProcObjCmd(0, in, 4, ov) != TCL_OK; +#if defined(NAMESPACEINSTPROCS) + { + Proc *procPtr = TclFindProc((Interp *)in, procName); + /*fprintf(stderr,"proc=%p cmd=%p ns='%s' objns=%s\n",procPtr,procPtr->cmdPtr, + procPtr->cmdPtr->nsPtr->fullName,cmd->nsPtr->fullName);*/ + /*** patch the command ****/ + if (procPtr) { + /* procPtr->cmdPtr = (Command *)obj->id; OLD*/ + procPtr->cmdPtr->nsPtr = ((Command *)obj->id)->nsPtr; + } + } +#endif + + Tcl_PopCallFrame(in); + + if (objc == 6 || objc == 7) { + incr = (objc == 6) ? 0:1; + AssertionAddProc(in, ObjStr(objv[1]), aStore, objv[4+incr], objv[5+incr]); + } + + DECR_REF_COUNT(ov[3]); + + return result; +} + +/* + * List-Functions for Info + */ +static int +ListInfo(Tcl_Interp *in, int isclass) { + Tcl_ResetResult(in); + Tcl_AppendElement(in, "vars"); Tcl_AppendElement(in, "body"); + Tcl_AppendElement(in, "default"); Tcl_AppendElement(in, "args"); + Tcl_AppendElement(in, "procs"); Tcl_AppendElement(in, "commands"); + Tcl_AppendElement(in, "class"); Tcl_AppendElement(in, "children"); + Tcl_AppendElement(in, "filter"); Tcl_AppendElement(in, "filterguard"); + Tcl_AppendElement(in, "forward"); + Tcl_AppendElement(in, "info"); + Tcl_AppendElement(in, "invar"); Tcl_AppendElement(in, "mixin"); + Tcl_AppendElement(in, "methods"); + Tcl_AppendElement(in, "parent"); + Tcl_AppendElement(in, "pre"); Tcl_AppendElement(in, "post"); + Tcl_AppendElement(in, "precedence"); + if (isclass) { + Tcl_AppendElement(in, "superclass"); Tcl_AppendElement(in, "subclass"); + Tcl_AppendElement(in, "heritage"); Tcl_AppendElement(in, "instances"); + Tcl_AppendElement(in, "instcommands"); Tcl_AppendElement(in, "instprocs"); + Tcl_AppendElement(in, "instdefault"); Tcl_AppendElement(in, "instbody"); + Tcl_AppendElement(in, "instmixin"); + Tcl_AppendElement(in, "instforward"); + Tcl_AppendElement(in, "classchildren"); Tcl_AppendElement(in, "classparent"); + Tcl_AppendElement(in, "instfilter"); Tcl_AppendElement(in, "instfilterguard"); + Tcl_AppendElement(in, "instinvar"); + Tcl_AppendElement(in, "instpre"); Tcl_AppendElement(in, "instpost"); + Tcl_AppendElement(in, "parameter"); + } + return TCL_OK; +} + +XOTCLINLINE static int +noMetaChars(char *pattern) { + register char c, *p = pattern; + assert(pattern); + for (c=*p; c; c = *++p) { + if (c == '*' || c == '[') { + return 0; + } + } + return 1; +} + +static int +ListKeys(Tcl_Interp *in, Tcl_HashTable *table, char *pattern) { + Tcl_HashEntry* hPtr; + char *key; + + if (pattern && noMetaChars(pattern)) { + hPtr = table ? Tcl_FindHashEntry(table, pattern) : 0; + if (hPtr) { + key = Tcl_GetHashKey(table, hPtr); + Tcl_SetResult(in, key, TCL_VOLATILE); + } else { + Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); + } + } else { + Tcl_Obj *list = Tcl_NewListObj(0, NULL); + Tcl_HashSearch hSrch; + hPtr = table ? Tcl_FirstHashEntry(table, &hSrch) : 0; + for (; hPtr; hPtr = Tcl_NextHashEntry(&hSrch)) { + key = Tcl_GetHashKey(table, hPtr); + if (!pattern || Tcl_StringMatch(key, pattern)) { + Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj(key,-1)); + } + } + Tcl_SetObjResult(in, list); + } + return TCL_OK; +} + +#if !defined(PRE85) || FORWARD_COMPATIBLE +static int +ListVarKeys(Tcl_Interp *in, Tcl_HashTable *tablePtr, char *pattern) { + Tcl_HashEntry* hPtr; + + if (pattern && noMetaChars(pattern)) { + Tcl_Obj *patternObj = Tcl_NewStringObj(pattern, -1); + INCR_REF_COUNT(patternObj); + + hPtr = tablePtr ? Tcl_CreateHashEntry(tablePtr, (char *)patternObj, NULL) : 0; + if (hPtr) { + Var *val = VarHashGetValue(hPtr); + Tcl_SetObjResult(in, VarHashGetKey(val)); + } else { + Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); + } + DECR_REF_COUNT(patternObj); + } else { + Tcl_Obj *list = Tcl_NewListObj(0, NULL); + Tcl_HashSearch hSrch; + hPtr = tablePtr ? Tcl_FirstHashEntry(tablePtr, &hSrch) : 0; + for (; hPtr; hPtr = Tcl_NextHashEntry(&hSrch)) { + Var *val = VarHashGetValue(hPtr); + Tcl_Obj *key = VarHashGetKey(val); + if (!pattern || Tcl_StringMatch(ObjStr(key), pattern)) { + Tcl_ListObjAppendElement(in, list, key); + } + } + Tcl_SetObjResult(in, list); + } + return TCL_OK; +} +#endif + + +static int +ListVars(Tcl_Interp *in, XOTclObject *obj, char *pattern) { + Tcl_Obj *varlist, *okList, *element; + int i, length; + TclVarHashTable *varTable = obj->nsPtr ? Tcl_Namespace_varTable(obj->nsPtr) : obj->varTable; + +#if defined(PRE85) +# if FORWARD_COMPATIBLE + if (forwardCompatibleMode) { + ListVarKeys(in, VarHashTable(varTable), pattern); + } else { + ListKeys(in, varTable, pattern); + } +# else + ListKeys(in, varTable, pattern); +# endif +#else + ListVarKeys(in, VarHashTable(varTable), pattern); +#endif + varlist = Tcl_GetObjResult(in); + + Tcl_ListObjLength(in, varlist, &length); + okList = Tcl_NewListObj(0, NULL); + for (i=0; icmdName); + } else { + Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); + } + } else { + Tcl_Obj *list = Tcl_NewListObj(0, NULL); + Tcl_HashSearch hSrch; + hPtr = table ? Tcl_FirstHashEntry(table, &hSrch) : 0; + for (; hPtr; hPtr = Tcl_NextHashEntry(&hSrch)) { + XOTclObject *obj = (XOTclObject*)Tcl_GetHashKey(table, hPtr); + if (!pattern || Tcl_StringMatch(ObjStr(obj->cmdName), pattern)) { + Tcl_ListObjAppendElement(in, list, obj->cmdName); + } + } + Tcl_SetObjResult(in, list); + } + return TCL_OK; +} + +static int +ListMethodKeys(Tcl_Interp *in, Tcl_HashTable *table, char *pattern, + int noProcs, int noCmds, int noDups, int onlyForwarder) { + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr = table ? Tcl_FirstHashEntry(table, &hSrch) : 0; + for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { + char *key = Tcl_GetHashKey(table, hPtr); + Tcl_Command cmd = (Tcl_Command)Tcl_GetHashValue(hPtr); + Tcl_ObjCmdProc* proc = Tcl_Command_objProc(cmd); + + if (pattern && !Tcl_StringMatch(key, pattern)) continue; + if (noCmds && proc != RUNTIME_STATE(in)->objInterpProc) continue; + if (noProcs && proc == RUNTIME_STATE(in)->objInterpProc) continue; + if (onlyForwarder && proc != XOTclForwardMethod) continue; + /* XOTclObjscopedMethod ??? */ + if (noDups) { + int listc, i; + Tcl_Obj **listv; + int result = Tcl_ListObjGetElements(in, Tcl_GetObjResult(in), &listc, &listv); + size_t keylen = strlen(key); + if (result == TCL_OK) { + int found = 0; + for (i=0; iprefix) { + Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj("-methodprefix",-1)); + Tcl_ListObjAppendElement(in, list, tcd->prefix); + } + if (tcd->subcommands) { + Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj("-default",-1)); + Tcl_ListObjAppendElement(in, list, tcd->subcommands); + } + if (tcd->objscope) { + Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj("-objscope",-1)); + } + Tcl_ListObjAppendElement(in, list, tcd->cmdName); + if (tcd->args) { + Tcl_Obj **args; + int nrArgs, i; + Tcl_ListObjGetElements(in, tcd->args, &nrArgs, &args); + for (i=0; insPtr) { + Tcl_HashTable *cmdTable = Tcl_Namespace_cmdTable(obj->nsPtr); + ListMethodKeys(in, cmdTable, pattern, noProcs, noCmds, 0, 0); + } + + if (!noMixins) { + if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) + MixinComputeDefined(in, obj); + if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { + XOTclCmdList *ml = obj->mixinOrder; + XOTclClass *mixin; + while (ml) { + int guardOk = TCL_OK; + mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); + if (inContext) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + if (!cs->guardCount) { + guardOk = GuardCall(obj, 0, 0, in, ml->clientData, 1); + } + } + if (mixin && guardOk == TCL_OK) { + Tcl_HashTable *cmdTable = Tcl_Namespace_cmdTable(mixin->nsPtr); + ListMethodKeys(in, cmdTable, pattern, noProcs, noCmds, 1, 0); + } + ml = ml->next; + } + } + } + + /* append per-class filters */ + for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); pl; pl = pl->next) { + Tcl_HashTable *cmdTable = Tcl_Namespace_cmdTable(pl->cl->nsPtr); + ListMethodKeys(in, cmdTable, pattern, noProcs, noCmds, 1, 0); + } + return TCL_OK; +} + +static int XOTclCInfoMethod(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST v[]); + +static int +ListClass(Tcl_Interp *in, XOTclObject *obj, char *pattern, + int objc, Tcl_Obj *CONST objv[]) { + if (pattern == 0) { + Tcl_SetObjResult(in, obj->cl->object.cmdName); + return TCL_OK; + } else { + int result; + ALLOC_ON_STACK(Tcl_Obj*,objc, ov); + + memcpy(ov, objv, sizeof(Tcl_Obj *)*objc); + ov[1] = Tcl_NewStringObj("superclass", 10); + INCR_REF_COUNT(ov[1]); + result = XOTclCInfoMethod((ClientData)obj->cl, in, objc, ov); + DECR_REF_COUNT(ov[1]); + FREE_ON_STACK(ov); + return result; + } +} + +static int +ListSuperclasses(Tcl_Interp *in, XOTclClass *cl, char *pattern) { + if (pattern == 0) { + XOTclClasses* sl = cl->super; + XOTclClasses* sc = 0; + + /* + * reverse the list to obtain presentation order + */ + + Tcl_ResetResult(in); + while (sc != sl) { + XOTclClasses* nl = sl; + while (nl->next != sc) nl = nl->next; + Tcl_AppendElement(in, className(nl->cl)); + sc = nl; + } + } else { + XOTclClass *isc = XOTclpGetClass(in, pattern); + XOTclClasses* pl; + if (isc == 0) + return XOTclErrBadVal(in, "info superclass", "a class", pattern); + + /* + * search precedence to see if we're related or not + */ + for (pl = ComputeOrder(cl, cl->order, Super); pl; pl = pl->next) { + if (pl->cl == isc) { + Tcl_SetIntObj(Tcl_GetObjResult(in), 1); + break; + } + } + if (pl == 0) + Tcl_SetIntObj(Tcl_GetObjResult(in), 0); + } + return TCL_OK; +} + +static int +ListSubclasses(Tcl_Interp *in, XOTclClass *cl, char *pattern) { + if (pattern == 0) { + XOTclClasses* sl = cl->sub; + XOTclClasses* sc = 0; + + /* + * order unimportant + */ + Tcl_ResetResult(in); + for (sc = sl; sc != 0; sc = sc->next) + Tcl_AppendElement(in, className(sc->cl)); + } else { + XOTclClass *isc = XOTclpGetClass(in, pattern); + XOTclClasses* pl; + XOTclClasses* saved; + + if (isc == 0) + return XOTclErrBadVal(in, "info subclass", "a class", pattern); + saved = cl->order; + cl->order = 0; + + /* + * search precedence to see if we're related or not + */ + for (pl = ComputeOrder(cl, cl->order, Sub); pl; pl = pl->next) { + if (pl->cl == isc) { + Tcl_SetIntObj(Tcl_GetObjResult(in), 1); + break; + } + } + if (pl == 0) + Tcl_SetIntObj(Tcl_GetObjResult(in), 0); + + XOTclFreeClasses(cl->order); + cl->order = saved; + } + return TCL_OK; +} + + + +static int +ListHeritage(Tcl_Interp *in, XOTclClass *cl, char *pattern) { + XOTclClasses* pl = ComputeOrder(cl, cl->order, Super); + Tcl_ResetResult(in); + if (pl) pl=pl->next; + for (; pl != 0; pl = pl->next) { + char *name = className(pl->cl); + if (pattern && !Tcl_StringMatch(name, pattern)) continue; + Tcl_AppendElement(in, name); + } + return TCL_OK; +} + +static int +ListPrecedence(Tcl_Interp *in, XOTclObject *obj, char *pattern) { + XOTclClasses* pl; + Tcl_ResetResult(in); + if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) + MixinComputeDefined(in, obj); + + if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { + XOTclCmdList *ml = obj->mixinOrder; + + while (ml) { + XOTclClass *mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); + char *name = className(mixin); + if (pattern && !Tcl_StringMatch(name, pattern)) continue; + Tcl_AppendElement(in, name); + ml = ml->next; + } + } + pl = ComputeOrder(obj->cl, obj->cl->order, Super); + for (; pl != 0; pl = pl->next) { + char *name = className(pl->cl); + if (pattern && !Tcl_StringMatch(name, pattern)) continue; + Tcl_AppendElement(in, name); + } + return TCL_OK; +} + + +static Proc* +FindProc(Tcl_Interp *in, Tcl_HashTable *table, char *name) { + Tcl_HashEntry* hPtr = table ? Tcl_FindHashEntry(table, name) : 0; + if (hPtr) { + Tcl_Command cmd = (Tcl_Command)Tcl_GetHashValue(hPtr); + Tcl_ObjCmdProc *proc = Tcl_Command_objProc(cmd); + if (proc == RUNTIME_STATE(in)->objInterpProc) + return (Proc*) Tcl_Command_objClientData(cmd); +#if USE_INTERP_PROC + else if ((Tcl_CmdProc*)proc == RUNTIME_STATE(in)->interpProc) + return (Proc*) Tcl_Command_clientData(cmd); +#endif + } + return 0; +} + +static int +ListProcArgs(Tcl_Interp *in, Tcl_HashTable *table, char *name) { + Proc* proc = FindProc(in, table, name); + if (proc) { + CompiledLocal *args = proc->firstLocalPtr; + Tcl_ResetResult(in); + for (;args != NULL; args = args->nextPtr) { + if (TclIsCompiledLocalArgument(args)) + Tcl_AppendElement(in, args->name); + + } + return TCL_OK; + } + return XOTclErrBadVal(in, "info args", "a tcl method name", name); +} + +static int +ListArgsFromOrdinaryArgs(Tcl_Interp *in, XOTclNonposArgs* nonposArgs) { + int i, rc, ordinaryArgsDefc, defaultValueObjc; + Tcl_Obj **ordinaryArgsDefv, **defaultValueObjv, *ordinaryArg, + *argList = Tcl_NewListObj(0, NULL); + rc = Tcl_ListObjGetElements(in, nonposArgs->ordinaryArgs, + &ordinaryArgsDefc, &ordinaryArgsDefv); + if (rc != TCL_OK) + return TCL_ERROR; + + for (i=0; i < ordinaryArgsDefc; i++) { + ordinaryArg = ordinaryArgsDefv[i]; + rc = Tcl_ListObjGetElements(in, ordinaryArg, + &defaultValueObjc, &defaultValueObjv); + if (rc == TCL_OK && defaultValueObjc == 2) { + ordinaryArg = defaultValueObjv[0]; + } + Tcl_ListObjAppendElement(in, argList, ordinaryArg); + } + Tcl_SetObjResult(in, argList); + return TCL_OK; +} + +static int +GetProcDefault(Tcl_Interp *in, Tcl_HashTable *table, + char *name, char *arg, Tcl_Obj **resultObj) { + Proc* proc = FindProc(in, table, name); + *resultObj = 0; + if (proc) { + CompiledLocal *ap; + for (ap = proc->firstLocalPtr; ap != 0; ap = ap->nextPtr) { + if (!TclIsCompiledLocalArgument(ap)) continue; + if (strcmp(arg, ap->name) != 0) continue; + + if (ap->defValuePtr != NULL) { + *resultObj = ap->defValuePtr; + return TCL_OK; + } + return TCL_OK; + } + } + return TCL_ERROR; +} + +static int +SetProcDefault(Tcl_Interp *in, Tcl_Obj *var, Tcl_Obj* defVal) { + int result = TCL_OK; + callFrameContext ctx = {0}; + CallStackUseActiveFrames(in,&ctx); + + if (defVal != 0) { + if (Tcl_ObjSetVar2(in, var, NULL, defVal, 0) != NULL) { + Tcl_SetIntObj(Tcl_GetObjResult(in), 1); + } else { + result = TCL_ERROR; + } + } else { + if (Tcl_ObjSetVar2(in, var, NULL, + XOTclGlobalObjects[XOTE_EMPTY], 0) != NULL) { + Tcl_SetIntObj(Tcl_GetObjResult(in), 0); + } else { + result = TCL_ERROR; + } + } + CallStackRestoreSavedFrames(in, &ctx); + + if (result == TCL_ERROR) { + XOTclVarErrMsg(in, "couldn't store default value in variable '", + var, "'", (char *) NULL); + } + return result; +} + +static int +ListProcDefault(Tcl_Interp *in, Tcl_HashTable *table, + char *name, char *arg, Tcl_Obj *var) { + Tcl_Obj *defVal; + int result; + if (GetProcDefault(in, table, name, arg, &defVal) == TCL_OK) { + result = SetProcDefault(in, var, defVal); + } else { + XOTclVarErrMsg(in, "method '", name, + "' doesn't exist or doesn't have an argument '", + arg, "'", (char *) NULL); + result = TCL_ERROR; + } + return result; +} + +static int +ListDefaultFromOrdinaryArgs(Tcl_Interp *in, char *procName, + XOTclNonposArgs* nonposArgs, char *arg, Tcl_Obj *var) { + int i, rc, ordinaryArgsDefc, defaultValueObjc; + Tcl_Obj **ordinaryArgsDefv, **defaultValueObjv, *ordinaryArg; + + rc = Tcl_ListObjGetElements(in, nonposArgs->ordinaryArgs, + &ordinaryArgsDefc, &ordinaryArgsDefv); + if (rc != TCL_OK) + return TCL_ERROR; + + for (i=0; i < ordinaryArgsDefc; i++) { + ordinaryArg = ordinaryArgsDefv[i]; + rc = Tcl_ListObjGetElements(in, ordinaryArg, + &defaultValueObjc, &defaultValueObjv); + if (rc == TCL_OK && !strcmp(arg, ObjStr(defaultValueObjv[0]))) { + return SetProcDefault(in, var, defaultValueObjc == 2 ? + defaultValueObjv[1] : NULL); + } + } + XOTclVarErrMsg(in, "method '", procName, "' doesn't have an argument '", + arg, "'", (char *) NULL); + return TCL_ERROR; +} + +static char * +StripBodyPrefix(char *body) { + if (strncmp(body, "::xotcl::initProcNS\n",20) == 0) + body+=20; + if (strncmp(body, "::xotcl::interpretNonpositionalArgs $args\n",42) == 0) + body+=42; + return body; +} + +static int +ListProcBody(Tcl_Interp *in, Tcl_HashTable *table, char *name) { + Proc* proc = FindProc(in, table, name); + if (proc) { + char *body = ObjStr(proc->bodyPtr); + Tcl_SetObjResult(in, Tcl_NewStringObj(StripBodyPrefix(body), -1)); + return TCL_OK; + } + return XOTclErrBadVal(in, "info body", "a tcl method name", name); +} + +static int +ListChildren(Tcl_Interp *in, XOTclObject *obj, char *pattern, int classesOnly) { + XOTclObject *childobj; + Tcl_HashTable *cmdTable; + XOTcl_FrameDecls; + + if (!obj->nsPtr) return TCL_OK; + + cmdTable = Tcl_Namespace_cmdTable(obj->nsPtr); + if (pattern && noMetaChars(pattern)) { + XOTcl_PushFrame(in, obj); + if ((childobj = XOTclpGetObject(in, pattern)) && + (!classesOnly || XOTclObjectIsClass(childobj)) && + (childobj->id && Tcl_Command_nsPtr(childobj->id) == obj->nsPtr) /* true children */ + ) { + Tcl_SetObjResult(in, childobj->cmdName); + } else { + Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); + } + XOTcl_PopFrame(in,obj); + } else { + Tcl_Obj *list = Tcl_NewListObj(0, NULL); + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr = Tcl_FirstHashEntry(cmdTable, &hSrch); + char *key; + XOTcl_PushFrame(in, obj); + for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { + key = Tcl_GetHashKey(cmdTable, hPtr); + if (!pattern || Tcl_StringMatch(key, pattern)) { + if ((childobj = XOTclpGetObject(in, key)) && + (!classesOnly || XOTclObjectIsClass(childobj)) && + (childobj->id && Tcl_Command_nsPtr(childobj->id) == obj->nsPtr) /* true children */ + ) { + Tcl_ListObjAppendElement(in, list, childobj->cmdName); + } + } + } + XOTcl_PopFrame(in,obj); + Tcl_SetObjResult(in, list); + } + return TCL_OK; +} + +static int +ListParent(Tcl_Interp *in, XOTclObject *obj) { + if (obj->id) { + Tcl_SetResult(in, NSCmdFullName(obj->id), TCL_VOLATILE); + } + return TCL_OK; +} + +static XOTclClass* +FindCalledClass(Tcl_Interp *in, XOTclObject *obj) { + char *methodName = 0; + XOTclClass *cl; + Tcl_Command cmd = NULL; + XOTclCallStackContent *csc = CallStackGetTopFrame(in); + + if (csc->frameType == XOTCL_CSC_TYPE_PLAIN) + return GetSelfClass(in); + + if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) + methodName = ObjStr(csc->filterStackEntry->calledProc); + else if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_MIXIN && obj->mixinStack) + methodName = (char *) GetSelfProc(in); + + if (!methodName) methodName = ""; + + if (obj->nsPtr) + cmd = FindMethod(methodName, obj->nsPtr); + + if (cmd) { + cl = 0; + } else { + cl = SearchCMethod(obj->cl, methodName, &cmd); + } + return cl; +} + +/* + * Next Primitive Handling + */ +XOTCLINLINE static void +NextSearchMethod(XOTclObject *obj, Tcl_Interp *in, XOTclCallStackContent *csc, + XOTclClass **cl, char **method, Tcl_ObjCmdProc **proc, Tcl_Command *cmd, + ClientData *cp, int* isMixinEntry, int* isFilterEntry, + int* endOfFilterChain, Tcl_Command* currentCmd) { + XOTclClasses *pl = 0; + int endOfChain = 0; + *endOfFilterChain = 0; + + /* + * Next in filters + */ + /*assert(obj->flags & XOTCL_FILTER_ORDER_VALID); *** strange, worked before ****/ + + FilterComputeDefined(in, obj); + + if ((obj->flags & XOTCL_FILTER_ORDER_VALID) && + obj->filterStack && + obj->filterStack->currentCmdPtr) { + *cmd = FilterSearchProc(in, obj, proc, cp, currentCmd,cl); + /*fprintf(stderr,"EndOfChain? proc=%p, cmd=%p\n",*proc,*cmd);*/ + /* XOTclCallStackDump(in); XOTclStackDump(in);*/ + + if (*proc == 0) { + if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) { + /* reset the information to the values of method, cl + to the values they had before calling the filters */ + *method = ObjStr(obj->filterStack->calledProc); + endOfChain = 1; + *endOfFilterChain = 1; + *cl = 0; + /*fprintf(stderr,"EndOfChain resetting cl\n");*/ + } + } else { + *method = (char *) Tcl_GetCommandName(in, *cmd); + *isFilterEntry = 1; + return; + } + } + + /* + * Next in Mixins + */ + assert(obj->flags & XOTCL_MIXIN_ORDER_VALID); + /* otherwise: MixinComputeDefined(in, obj); */ + + /*fprintf(stderr,"nextsearch: mixinorder valid %d stack=%p\n", + obj->flags & XOTCL_MIXIN_ORDER_VALID, obj->mixinStack);*/ + + + if ((obj->flags & XOTCL_MIXIN_ORDER_VALID) && obj->mixinStack) { + *cmd = MixinSearchProc(in, obj, *method, cl, proc, cp, currentCmd); + /*fprintf(stderr,"nextsearch: mixinsearch cmd %p, proc=%p\n",*cmd,*proc);*/ + if (*proc == 0) { + if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_MIXIN) { + endOfChain = 1; + *cl = 0; + } + } else { + *isMixinEntry = 1; + return; + } + } + + /* + * otherwise: normal method dispatch + * + * if we are already in the precedence ordering, then advance + * past our last point; otherwise (if cl==0) begin from the start + */ + + /* if a mixin or filter chain has ended -> we have to search + the obj-specific methods as well */ + + if (obj->nsPtr && endOfChain) { + *cmd = FindMethod(*method, obj->nsPtr); + } else { + *cmd = 0; + } + + + if (!*cmd) { + for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); pl && *cl; pl = pl->next) { + if (pl->cl == *cl) + *cl = 0; + } + + /* + * search for a further class method + */ + *cl = SearchPLMethod(pl, *method, cmd); + /*fprintf(stderr, "no cmd, cl = %p %s\n",*cl, ObjStr((*cl)->object.cmdName));*/ + } else { + *cl = 0; + } + + if (*cmd) { + *proc = Tcl_Command_objProc(*cmd); + *cp = Tcl_Command_objClientData(*cmd); + } + + return; +} + +static int +XOTclNextMethod(XOTclObject *obj, Tcl_Interp *in, XOTclClass *givenCl, + char *givenMethod, int objc, Tcl_Obj *CONST objv[], + int useCallstackObjs) { + XOTclCallStackContent *csc = CallStackGetTopFrame(in); + Tcl_ObjCmdProc *proc = 0; + Tcl_Command cmd, currentCmd = NULL; + ClientData cp = 0; + int result = TCL_OK, + frameType = XOTCL_CSC_TYPE_PLAIN, + isMixinEntry = 0, isFilterEntry = 0, + endOfFilterChain = 0; + int nobjc; Tcl_Obj **nobjv; + XOTclClass **cl = &givenCl; + char **method = &givenMethod; + +#if !defined(NDEBUG) + if (useCallstackObjs) { + Tcl_CallFrame *cf = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(in); + int found = 0; + while (cf) { + /* fprintf(stderr, " ... compare fp = %p and cfp %p procFrame %p oc=%d\n", + cf, csc->currentFramePtr, + Tcl_Interp_framePtr(in), Tcl_CallFrame_objc(Tcl_Interp_framePtr(in)) + );*/ + if (cf == csc->currentFramePtr) { + found = 1; + break; + } + cf = (Tcl_CallFrame *)((CallFrame *)cf)->callerPtr; + } + /* + if (!found) { + if (Tcl_Interp_varFramePtr(in)) { + fprintf(stderr,"found (csc->currentFramePtr %p)= %d cur level=%d\n", + csc->currentFramePtr,found, + Tcl_CallFrame_level(Tcl_Interp_varFramePtr(in))); + } else { + fprintf(stderr,"no varFramePtr\n"); + } + return TCL_OK; + } + */ + } +#endif + /* + fprintf(stderr,"givenMethod = %s, csc = %p, useCallstackObj %d, objc %d\n", + givenMethod, csc, useCallstackObjs, objc); + */ + + /* if no args are given => use args from stack */ + if (objc < 2 && useCallstackObjs && csc->currentFramePtr) { + nobjc = Tcl_CallFrame_objc(csc->currentFramePtr); + nobjv = (Tcl_Obj **)Tcl_CallFrame_objv(csc->currentFramePtr); + } else { + nobjc = objc; + nobjv = (Tcl_Obj **)objv; + } + + /* + * Search the next method & compute its method data + */ + NextSearchMethod(obj, in, csc, cl, method, &proc, &cmd, &cp, + &isMixinEntry, &isFilterEntry, &endOfFilterChain, ¤tCmd); + + /* + fprintf(stderr, "NextSearchMethod -- RETURN: method=%s eoffc=%d,", + *method, endOfFilterChain); + if (obj) + fprintf(stderr, " obj=%s,", ObjStr(obj->cmdName)); + if ((*cl)) + fprintf(stderr, " cl=%s,", (*cl)->nsPtr->fullName); + fprintf(stderr, " mixin=%d, filter=%d, proc=%p\n", + isMixinEntry, isFilterEntry, proc); + */ + + Tcl_ResetResult(in); /* needed for bytecode support */ + + if (proc != 0) { + /* + * change mixin state + */ + if (obj->mixinStack) { + if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_MIXIN) + csc->frameType = XOTCL_CSC_TYPE_INACTIVE_MIXIN; + + /* otherwise move the command pointer forward */ + if (isMixinEntry) { + frameType = XOTCL_CSC_TYPE_ACTIVE_MIXIN; + obj->mixinStack->currentCmdPtr = currentCmd; + } + } + /* + * change filter state + */ + if (obj->filterStack) { + if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) + csc->frameType = XOTCL_CSC_TYPE_INACTIVE_FILTER; + + /* otherwise move the command pointer forward */ + if (isFilterEntry) { + frameType = XOTCL_CSC_TYPE_ACTIVE_FILTER; + obj->filterStack->currentCmdPtr = currentCmd; + } + } + + /* + * now actually call the "next" method + */ + + /* cut the flag, that no stdargs should be used, if it is there */ + if (nobjc > 1) { + char *nobjv1 = ObjStr(nobjv[1]); + if (nobjv1[0] == '-' && !strcmp(nobjv1, "--noArgs")) + nobjc = 1; + } + csc->callType |= XOTCL_CSC_CALL_IS_NEXT; + RUNTIME_STATE(in)->unknown = 0; + + + result = DoCallProcCheck(cp, (ClientData)obj, in, nobjc, nobjv, cmd, + obj, *cl, *method, frameType, 1/*fromNext*/); + + csc->callType &= ~XOTCL_CSC_CALL_IS_NEXT; + + if (csc->frameType == XOTCL_CSC_TYPE_INACTIVE_FILTER) + csc->frameType = XOTCL_CSC_TYPE_ACTIVE_FILTER; + else if (csc->frameType == XOTCL_CSC_TYPE_INACTIVE_MIXIN) + csc->frameType = XOTCL_CSC_TYPE_ACTIVE_MIXIN; + } else if (result == TCL_OK && endOfFilterChain) { + /*fprintf(stderr,"setting unknown to 1\n");*/ + RUNTIME_STATE(in)->unknown = 1; + } + + + return result; +} + +int +XOTclNextObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclCallStackContent *csc = CallStackGetTopFrame(in); + + if (!csc->self) + return XOTclVarErrMsg(in, "next: can't find self", (char *) NULL); + + if (!csc->cmdPtr) + return XOTclErrMsg(in, "next: no executing proc", TCL_STATIC); + + return XOTclNextMethod(csc->self, in, csc->cl, + (char *)Tcl_GetCommandName(in, csc->cmdPtr), + objc, objv, 1); +} + + +int +XOTclQualifyObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + char *string; + if (objc != 2) + return XOTclVarErrMsg(in, "wrong # of args for __qualify", (char *) NULL); + + string = ObjStr(objv[1]); + if (!isAbsolutePath(string)) { + Tcl_SetObjResult(in, NameInNamespaceObj(in,string,callingNameSpace(in))); + } else { + Tcl_SetObjResult(in, objv[1]); + } + return TCL_OK; +} + +/* method for calling e.g. $obj __next */ +static int +XOTclONextMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + XOTclCallStackContent *csc = CallStackGetTopFrame(in); + char *methodName; + + for (; csc >= cs->content; csc--) { + if (csc->self == obj) break; + } + if (csccontent) + return XOTclVarErrMsg(in, "__next: can't find object", + ObjStr(obj->cmdName), (char *) NULL); + methodName = (char *)Tcl_GetCommandName(in, csc->cmdPtr); + /*fprintf(stderr,"******* next for proc %s\n", methodName);*/ + return XOTclNextMethod(obj, in, csc->cl, methodName, objc-1, &objv[1], 0); +} + +#if 0 +/* method next for calling e.g. $obj next */ +static int +XOTclONextMethod2(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + int result, nobjc; + /*XOTclCallStack *cs = &RUNTIME_STATE(in)->cs;*/ + XOTclCallStackContent *csc = CallStackGetTopFrame(in); + Tcl_Obj **nobjv; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + + /* if no args are given => use args from stack */ + if (objc < 2) { + nobjc = Tcl_CallFrame_objc(csc->currentFramePtr); + nobjv = (Tcl_Obj **)Tcl_CallFrame_objv(csc->currentFramePtr); + } else { + nobjc = objc; + nobjv = (Tcl_Obj **)objv; + } + { + ALLOC_ON_STACK(Tcl_Obj*,nobjc + 1, ov); + memcpy(ov+1, nobjv, sizeof(Tcl_Obj *)*nobjc); + ov[0] = obj->cmdName; + result = ObjDispatch(cd, in, nobjc+1, ov, 0); + FREE_ON_STACK(ov); + } + /*fprintf(stderr,"******* next for proc %s\n", methodName);*/ + /*result = Tcl_EvalObjv(in, objc, ov, 0);*/ + return result; +} +#endif + +/* + * "self" object command + */ + +static int +FindSelfNext(Tcl_Interp *in, XOTclObject *obj) { + XOTclCallStackContent *csc = CallStackGetTopFrame(in); + Tcl_ObjCmdProc *proc = 0; + Tcl_Command cmd, currentCmd = 0; + ClientData cp = 0; + int isMixinEntry = 0, + isFilterEntry = 0, + endOfFilterChain = 0; + XOTclClass *cl = csc->cl; + XOTclObject *o = csc->self; + char *methodName; + + Tcl_ResetResult(in); + + methodName = (char *) GetSelfProc(in); + if (!methodName) + return TCL_OK; + + NextSearchMethod(o, in, csc, &cl, &methodName, &proc, &cmd, &cp, + &isMixinEntry, &isFilterEntry, &endOfFilterChain, ¤tCmd); + + if (cmd) { + Tcl_SetObjResult(in, getFullProcQualifier(in, Tcl_GetCommandName(in, cmd), + o, cl, cmd)); + } + return TCL_OK; +} + +static Tcl_Obj * +computeLevelObj(Tcl_Interp *in, CallStackLevel level) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + XOTclCallStackContent *csc; + Tcl_Obj *resultObj; + + switch (level) { + case CALLING_LEVEL: csc = XOTclCallStackFindLastInvocation(in, 1); break; + case ACTIVE_LEVEL: csc = XOTclCallStackFindActiveFrame(in, 1); break; + default: csc = NULL; + } + + if (cs->top->currentFramePtr == ((Tcl_CallFrame *)Tcl_Interp_varFramePtr(in)) + && csc && csc < cs->top && csc->currentFramePtr) { + /* this was from an xotcl frame, return absolute frame number */ + char buffer[LONG_AS_STRING]; + int l; + buffer[0] = '#'; + /* fprintf(stderr,"*** csc=%p\n",csc);*/ + XOTcl_ltoa(buffer+1,(long)Tcl_CallFrame_level(csc->currentFramePtr),&l); + resultObj = Tcl_NewStringObj(buffer,l+1); + } else { + /* If not called from an xotcl frame, return 1 as default */ + resultObj = Tcl_NewIntObj(1); + } + /*XOTclStackDump(in);XOTclCallStackDump(in);*/ + + return resultObj; +} + +static int +XOTclSelfSubCommand(Tcl_Interp *in, XOTclObject *obj, char *option) { + assert(option); + + if (isProcString(option)) { /* proc subcommand */ + char *procName = (char *) GetSelfProc(in); + if (procName) { + Tcl_SetResult(in, procName, TCL_VOLATILE); + return TCL_OK; + } else { + return XOTclVarErrMsg(in, "Can't find proc", (char *) NULL); + } + } else if (isClassString(option)) { /* class subcommand */ + XOTclClass *cl = GetSelfClass(in); + Tcl_SetObjResult(in, cl ? cl->object.cmdName : XOTclGlobalObjects[XOTE_EMPTY]); + return TCL_OK; + } else { + XOTclCallStackContent *csc = NULL; + + switch (*option) { /* other callstack information */ + case 'a': + if (!strcmp(option, "activelevel")) { + Tcl_SetObjResult(in, computeLevelObj(in, ACTIVE_LEVEL)); + return TCL_OK; + } else if (!strcmp(option,"args")) { + int nobjc; + Tcl_Obj **nobjv; + csc = CallStackGetTopFrame(in); + nobjc = Tcl_CallFrame_objc(csc->currentFramePtr); + nobjv = (Tcl_Obj **)Tcl_CallFrame_objv(csc->currentFramePtr); + Tcl_SetObjResult(in, Tcl_NewListObj(nobjc-1,nobjv+1)); + return TCL_OK; + } +#if defined(ACTIVEMIXIN) + else if (!strcmp(option, "activemixin")) { + XOTclObject *o = NULL; + csc = CallStackGetTopFrame(in); + /*CmdListPrint(in,"self a....\n", obj->mixinOrder); + fprintf(stderr,"current cmdPtr = %p cl = %p, mo=%p %p\n", csc->cmdPtr, csc->cl, + obj->mixinOrder, RUNTIME_STATE(in)->cmdPtr);*/ + if (RUNTIME_STATE(in)->cmdPtr) { + o = XOTclGetObjectFromCmdPtr(RUNTIME_STATE(in)->cmdPtr); + } + Tcl_SetObjResult(in, o ? o->cmdName : XOTclGlobalObjects[XOTE_EMPTY]); + return TCL_OK; + } +#endif + break; + case 'c': + if (!strcmp(option, "calledproc")) { + if (!(csc = CallStackFindActiveFilter(in))) + return XOTclVarErrMsg(in, + "self calledproc called from outside of a filter", + (char *) NULL); + Tcl_SetObjResult(in, csc->filterStackEntry->calledProc); + return TCL_OK; + } else if (!strcmp(option, "calledclass")) { + Tcl_SetResult(in, className(FindCalledClass(in, obj)), TCL_VOLATILE); + return TCL_OK; + } else if (!strcmp(option, "callingproc")) { + csc = XOTclCallStackFindLastInvocation(in, 1); + Tcl_SetResult(in, csc ? (char *)Tcl_GetCommandName(in, csc->cmdPtr) : "", + TCL_VOLATILE); + return TCL_OK; + } else if (!strcmp(option, "callingclass")) { + csc = XOTclCallStackFindLastInvocation(in, 1); + Tcl_SetObjResult(in, csc && csc->cl ? csc->cl->object.cmdName : + XOTclGlobalObjects[XOTE_EMPTY]); + return TCL_OK; + } else if (!strcmp(option, "callinglevel")) { + Tcl_SetObjResult(in, computeLevelObj(in, CALLING_LEVEL)); + return TCL_OK; + } else if (!strcmp(option, "callingobject")) { + + /*XOTclStackDump(in); XOTclCallStackDump(in);*/ + + csc = XOTclCallStackFindLastInvocation(in, 1); + Tcl_SetObjResult(in, csc ? csc->self->cmdName : XOTclGlobalObjects[XOTE_EMPTY]); + return TCL_OK; + } + break; + + case 'f': + if (!strcmp(option, "filterreg")) { + if (!(csc = CallStackFindActiveFilter(in))) { + return XOTclVarErrMsg(in, + "self filterreg called from outside of a filter", + (char *) NULL); + } + Tcl_SetObjResult(in, FilterFindReg(in, obj, GetSelfProcCmdPtr(in))); + return TCL_OK; + } + break; + + case 'i': + if (!strcmp(option, "isnextcall")) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + csc = cs->top; + csc--; + Tcl_SetBooleanObj(Tcl_GetObjResult(in), + (csc > cs->content && + (csc->callType & XOTCL_CSC_CALL_IS_NEXT))); + return TCL_OK; + } + break; + + case 'n': + if (!strcmp(option, "next")) + return FindSelfNext(in, obj); + break; + } + } + return XOTclVarErrMsg(in, "unknown option '", option, + "' for self", (char *) NULL); +} + +/* +int +XOTclKObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + if (objc < 2) + return XOTclVarErrMsg(in, "wrong # of args for K", (char *) NULL); + + Tcl_SetObjResult(in, objv[1]); + return TCL_OK; +} +*/ + +int +XOTclGetSelfObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj; + + if (objc > 2) + return XOTclVarErrMsg(in, "wrong # of args for self", (char *) NULL); + + obj = GetSelfObj(in); + + /*fprintf(stderr,"getSelfObj returns %p\n",obj);XOTclCallStackDump(in);*/ + + if (!obj) { + if (objc == 2 && !strcmp(ObjStr(objv[1]),"callinglevel")) { + Tcl_SetIntObj(Tcl_GetObjResult(in), 1); + return TCL_OK; + } else { + return XOTclVarErrMsg(in, "self: no current object", (char *) NULL); + } + } + + if (objc == 1) { + Tcl_SetObjResult(in, obj->cmdName); + return TCL_OK; + } else { + return XOTclSelfSubCommand(in, obj, ObjStr(objv[1])); + } +} + + +/* + * object creation & destruction + */ + +static int +unsetInAllNamespaces(Tcl_Interp *in, Namespace *nsPtr, char *name) { + int rc = 0; + fprintf(stderr, "### unsetInAllNamespaces %s\n",name); + if (nsPtr != NULL) { + Tcl_HashSearch search; + Tcl_HashEntry *entryPtr = Tcl_FirstHashEntry(&nsPtr->childTable, &search); + Tcl_Var *varPtr; + int rc = 0; + + varPtr = (Tcl_Var *) Tcl_FindNamespaceVar(in, name, (Tcl_Namespace *) nsPtr, 0); + /*fprintf(stderr, "found %s in %s -> %p\n",name, nsPtr->fullName, varPtr);*/ + if (varPtr) { + Tcl_DString dFullname, *dsPtr = &dFullname; + Tcl_DStringInit(dsPtr); + Tcl_DStringAppend(dsPtr, "unset ", -1); + Tcl_DStringAppend(dsPtr, nsPtr->fullName, -1); + Tcl_DStringAppend(dsPtr, "::", 2); + Tcl_DStringAppend(dsPtr, name, -1); + /*rc = Tcl_UnsetVar2(in, Tcl_DStringValue(dsPtr), NULL, TCL_LEAVE_ERR_MSG);*/ + rc = Tcl_Eval(in, Tcl_DStringValue(dsPtr)); + /* fprintf(stderr, "fqName = '%s' unset => %d %d\n",Tcl_DStringValue(dsPtr), rc, TCL_OK);*/ + if (rc == TCL_OK) { + rc = 1; + } else { + Tcl_Obj *resultObj = Tcl_GetObjResult(in); + fprintf(stderr, " err = '%s'\n", ObjStr(resultObj)); + } + Tcl_DStringFree(dsPtr); + } + + while (entryPtr != NULL) { + Namespace *childNsPtr = (Namespace *) Tcl_GetHashValue(entryPtr); + /*fprintf(stderr, "child = %s\n", childNsPtr->fullName);*/ + entryPtr = Tcl_NextHashEntry(&search); + rc |= unsetInAllNamespaces(in, childNsPtr, name); + } + } + return rc; +} + +static int +freeUnsetTraceVariable(Tcl_Interp *in, XOTclObject *obj) { + int rc = TCL_OK; + if (obj->opt && obj->opt->volatileVarName) { + /* + Somebody destroys a volatile object manually while + the vartrace is still active. Destroying the object will + be a problem in case the variable is deleted later + and fires the trace. So, we unset the variable here + which will cause a destroy via var trace, which in + turn clears the volatileVarName flag. + */ + /*fprintf(stderr,"### freeUnsetTraceVariable %s\n", obj->opt->volatileVarName);*/ + + rc = Tcl_UnsetVar2(in, obj->opt->volatileVarName, NULL, 0); + if (rc != TCL_OK) { + int rc = Tcl_UnsetVar2(in, obj->opt->volatileVarName, NULL, TCL_GLOBAL_ONLY); + if (rc != TCL_OK) { + Namespace *nsPtr = (Namespace *) Tcl_GetCurrentNamespace(in); + if (unsetInAllNamespaces(in, nsPtr, obj->opt->volatileVarName) == 0) { + fprintf(stderr, "### don't know how to delete variable '%s' of volatile object\n", + obj->opt->volatileVarName); + } + } + } + if (rc == TCL_OK) { + /*fprintf(stderr, "### success unset\n");*/ + } + } + return rc; +} + +static char * +XOTclUnsetTrace(ClientData cd, Tcl_Interp *in, CONST84 char *name, CONST84 char *name2, int flags) +{ + Tcl_Obj *obj = (Tcl_Obj *)cd; + XOTclObject *o; + char *result = NULL; + + /*fprintf(stderr,"XOTclUnsetTrace %s flags %x %x\n", name, flags, + flags & TCL_INTERP_DESTROYED); */ + + if ((flags & TCL_INTERP_DESTROYED) == 0) { + if (XOTclObjConvertObject(in, obj, &o) == TCL_OK) { + Tcl_Obj *res = Tcl_GetObjResult(in); /* save the result */ + INCR_REF_COUNT(res); + + /* clear variable, destroy is called from trace */ + if (o->opt && o->opt->volatileVarName) { + o->opt->volatileVarName = NULL; + } + + if (callMethod((ClientData)o, in, XOTclGlobalObjects[XOTE_DESTROY],2,0,0) != TCL_OK) { + result = "Destroy for volatile object failed"; + } else + result = "No XOTcl Object passed"; + + Tcl_SetObjResult(in, res); /* restore the result */ + DECR_REF_COUNT(res); + } + DECR_REF_COUNT(obj); + } else { + /*fprintf(stderr, "omitting destroy on %s %p\n", name);*/ + } + return result; +} + +/* + * mark an obj on the existing callstack, as not destroyed + */ +static void +UndestroyObj(Tcl_Interp *in, XOTclObject *obj) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + XOTclCallStackContent *csc; + + /* + * mark the object on the whole callstack as not destroyed + */ + for (csc = &cs->content[1]; csc <= cs->top; csc++) { + if (obj == csc->self && csc->destroyedCmd) { + /* + * The ref count was incremented, when csc->destroyedCmd + * was set. We revert this first before forgetting the + * destroyedCmd. + */ + if (Tcl_Command_refCount(csc->destroyedCmd) > 1) { + Tcl_Command_refCount(csc->destroyedCmd)--; + MEM_COUNT_FREE("command refCount",csc->destroyedCmd); + } + csc->destroyedCmd = 0; + } + } + /* + * mark obj->flags XOTCL_DESTROY_CALLED as NOT CALLED (0) + */ + obj->flags &= ~XOTCL_DESTROY_CALLED; +} + +/* + * bring an object into a state, as after initialization + */ +static void +CleanupDestroyObject(Tcl_Interp *in, XOTclObject *obj, int softrecreate) { + XOTclClass *thecls, *theobj; + + thecls = RUNTIME_STATE(in)->theClass; + theobj = RUNTIME_STATE(in)->theObject; + /* remove the instance, but not for ::Class/::Object */ + if (obj != &(thecls->object) && obj != &(theobj->object)) { + + if (!softrecreate) { + (void)RemoveInstance(obj, obj->cl); + } + } + + if (obj->nsPtr) { + NSCleanupNamespace(in, obj->nsPtr); + NSDeleteChildren(in, obj->nsPtr); + } + + if (obj->varTable) { + TclDeleteVars(((Interp *)in), obj->varTable); + ckfree((char *)obj->varTable); + /* + FREE(obj->varTable, obj->varTable);*/ + obj->varTable = 0; + } + + if (obj->opt) { + XOTclObjectOpt *opt = obj->opt; + AssertionRemoveStore(opt->assertions); + opt->assertions = NULL; + +#ifdef XOTCL_METADATA + XOTclMetaDataDestroy(obj); +#endif + + if (!softrecreate) { + CmdListRemoveList(&opt->mixins, GuardDel); + CmdListRemoveList(&opt->filters, GuardDel); + + FREE(XOTclObjectOpt,opt); + opt = obj->opt = 0; + } + } + + if (obj->nonposArgsTable) { + NonposArgsFreeTable(obj->nonposArgsTable); + Tcl_DeleteHashTable(obj->nonposArgsTable); + MEM_COUNT_FREE("Tcl_InitHashTable", obj->nonposArgsTable); + ckfree((char *) obj->nonposArgsTable); + MEM_COUNT_FREE("Tcl_HashTable",obj->nonposArgsTable); + } + + obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; + if (obj->mixinOrder) MixinResetOrder(obj); + obj->flags &= ~XOTCL_FILTER_ORDER_VALID; + if (obj->filterOrder) FilterResetOrder(obj); +} + +/* + * do obj initialization & namespace creation + */ +static void +CleanupInitObject(Tcl_Interp *in, XOTclObject *obj, + XOTclClass *cl, Tcl_Namespace *namespacePtr, int softrecreate) { +#ifdef OBJDELETION_TRACE + fprintf(stderr,"+++ CleanupInitObject\n"); +#endif + obj->teardown = in; + obj->nsPtr = namespacePtr; + if (!softrecreate) { + AddInstance(obj, cl); + } + if (obj->flags & XOTCL_RECREATE) { + obj->opt = 0; + obj->varTable = 0; + obj->nonposArgsTable = 0; + obj->mixinOrder = 0; + obj->filterOrder = 0; + obj->flags = 0; + } +} + +/* + * physical object destroy + */ +static void +PrimitiveODestroy(ClientData cd) { + XOTclObject *obj = (XOTclObject*)cd; + Tcl_Interp *in; + + /*fprintf(stderr, "****** PrimitiveODestroy %p\n",obj);*/ + assert(obj && !(obj->flags & XOTCL_DESTROYED)); + + /* + * check and latch against recurrent calls with obj->teardown + */ + PRINTOBJ("PrimitiveODestroy", obj); + + if (!obj || !obj->teardown) return; + in = obj->teardown; + obj->teardown = 0; + + /* + * Don't destroy, if the interpreter is destroyed already + * e.g. TK calls Tcl_DeleteInterp directly, if the window is killed + */ + if (Tcl_InterpDeleted(in)) return; + /* + * call and latch user destroy with obj->id if we haven't + */ + if (!(obj->flags & XOTCL_DESTROY_CALLED)) { + callDestroyMethod(cd, in, obj, 0); + obj->id = 0; + } + +#ifdef OBJDELETION_TRACE + fprintf(stderr," physical delete of %p id=%p destroyCalled=%d '%s'\n", + obj, obj->id, (obj->flags & XOTCL_DESTROY_CALLED), ObjStr(obj->cmdName)); +#endif + + CleanupDestroyObject(in, obj, 0); + + while (obj->mixinStack != NULL) + MixinStackPop(obj); + while (obj->filterStack != NULL) + FilterStackPop(obj); + +#if 0 + { + /* Prevent that PrimitiveODestroy is called more than once. + This code was used in earlier versions of XOTcl + but does not seem necessary any more. If it has to be used + again in the future, don't use Tcl_GetCommandFromObj() + in Tcl 8.4.* versions. + */ + Tcl_Command cmd = Tcl_FindCommand(in, ObjStr(obj->cmdName), 0, 0); + + if (cmd != NULL) + Tcl_Command_deleteProc(cmd) = 0; + } +#endif + + if (obj->nsPtr) { + /*fprintf(stderr,"primitive odestroy calls deletenamespace for obj %p\n",obj);*/ + XOTcl_DeleteNamespace(in, obj->nsPtr); + obj->nsPtr = 0; + } + + /*fprintf(stderr, " +++ OBJ/CLS free: %s\n", ObjStr(obj->cmdName));*/ + + obj->flags |= XOTCL_DESTROYED; + objTrace("ODestroy", obj); +#if REFCOUNT_TRACE + fprintf(stderr,"ODestroy %p flags %d rc %d destr %d dc %d\n", + obj, obj->flags, + (obj->flags & XOTCL_REFCOUNTED) != 0, + (obj->flags & XOTCL_DESTROYED) != 0, + (obj->flags & XOTCL_DESTROY_CALLED) != 0 + ); +#endif +#if REFCOUNTED + if (!(obj->flags & XOTCL_REFCOUNTED)) { + DECR_REF_COUNT(obj->cmdName); + } +#else + DECR_REF_COUNT(obj->cmdName); +#endif + + XOTclCleanupObject(obj); + +#if !defined(NDEBUG) + if (obj != (XOTclObject*)RUNTIME_STATE(in)->theClass) + checkAllInstances(in, RUNTIME_STATE(in)->theClass,0); +#endif +} + +static void +PrimitiveOInit(void* mem, Tcl_Interp *in, char *name, XOTclClass *cl) { + XOTclObject *obj = (XOTclObject*)mem; + +#ifdef OBJDELETION_TRACE + fprintf(stderr,"+++ PrimitiveOInit\n"); +#endif + +#ifdef XOTCLOBJ_TRACE + fprintf(stderr, "OINIT %s = %p\n", name, obj); +#endif + XOTclObjectRefCountIncr(obj); + + /* if the command of the obj was used before, we have to clean + * up the callstack from set "destroyedCmd" flags + */ + UndestroyObj(in, obj); + + if (Tcl_FindNamespace(in, name, NULL, 0)) { + CleanupInitObject(in, obj, cl, + NSGetFreshNamespace(in, (ClientData)obj, name), 0); + } else { + CleanupInitObject(in, obj, cl, NULL, 0); + } + /*obj->flags = XOTCL_MIXIN_ORDER_VALID | XOTCL_FILTER_ORDER_VALID;*/ + obj->mixinStack = 0; + obj->filterStack = 0; +} + +/* + * Object creation: create object name (full name) and Tcl command + */ +static XOTclObject* +PrimitiveOCreate(Tcl_Interp *in, char *name, XOTclClass *cl) { + XOTclObject *obj = (XOTclObject*)ckalloc(sizeof(XOTclObject)); + unsigned length; + + /*fprintf(stderr, "CKALLOC Object %p %s\n", obj, name);*/ +#if defined(XOTCLOBJ_TRACE) + fprintf(stderr, "CKALLOC Object %p %s\n", obj, name); +#endif +#ifdef OBJDELETION_TRACE + fprintf(stderr,"+++ PrimitiveOCreate\n"); +#endif + + memset(obj, 0, sizeof(XOTclObject)); + MEM_COUNT_ALLOC("XOTclObject/XOTclClass",obj); + assert(obj); /* ckalloc panics, if malloc fails */ + assert(isAbsolutePath(name)); + + length = strlen(name); + if (!NSCheckForParent(in, name, length)) { + ckfree((char *) obj); + return 0; + } + obj->id = Tcl_CreateObjCommand(in, name, XOTclObjDispatch, + (ClientData)obj, PrimitiveODestroy); + + PrimitiveOInit(obj, in, name, cl); +#if 0 + /*defined(KEEP_TCL_CMD_TYPE)*/ + /*TclNewObj(obj->cmdName);*/ + obj->cmdName = Tcl_NewStringObj(name,length); + TclSetCmdNameObj(in, obj->cmdName, (Command*)obj->id); + /*fprintf(stderr, "new command has name '%s'\n", ObjStr(obj->cmdName));*/ +#else + obj->cmdName = NewXOTclObjectObjName(obj, name, length); +#endif + INCR_REF_COUNT(obj->cmdName); + + objTrace("PrimitiveOCreate", obj); + + return obj; +} + +/* + * Cleanup class: remove filters, mixins, assertions, instances ... + * and remove class from class hierarchy + */ +static void +CleanupDestroyClass(Tcl_Interp *in, XOTclClass *cl, int softrecreate) { + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr; + XOTclClass *theobj = RUNTIME_STATE(in)->theObject; + XOTclObject *obj = (XOTclObject*)cl; + XOTclClassOpt* opt = cl->opt; + + if (opt) { + CmdListRemoveList(&opt->instmixins, GuardDel); + MixinInvalidateObjOrders(in, cl); + + CmdListRemoveList(&opt->instfilters, GuardDel); + FilterInvalidateObjOrders(in, cl); + + /* remove dependent filters of this class from all subclasses*/ + FilterRemoveDependentFilterCmds(cl, cl); + AssertionRemoveStore(opt->assertions); +#ifdef XOTCL_OBJECTDATA + XOTclFreeObjectData(cl); +#endif + } + + Tcl_ForgetImport(in, cl->nsPtr, "*"); /* don't destroy namespace imported objects */ + NSCleanupNamespace(in, cl->nsPtr); + NSDeleteChildren(in, cl->nsPtr); + + if (!softrecreate) { + /* reset all instances to the class ::xotcl::Object, that makes no sense + for ::Object itself */ + if (cl != theobj) { + hPtr = &cl->instances ? Tcl_FirstHashEntry(&cl->instances, &hSrch) : 0; + for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { + XOTclObject *inst = (XOTclObject*)Tcl_GetHashKey(&cl->instances, hPtr); + if (inst && (inst != (XOTclObject*)cl) && inst->id) { + if (inst != &(theobj->object)) { + (void)RemoveInstance(inst, obj->cl); + AddInstance(inst, theobj); + } + } + } + } + Tcl_DeleteHashTable(&cl->instances); + MEM_COUNT_FREE("Tcl_InitHashTable",&cl->instances); + } + + if (cl->nonposArgsTable) { + NonposArgsFreeTable(cl->nonposArgsTable); + Tcl_DeleteHashTable(cl->nonposArgsTable); + MEM_COUNT_FREE("Tcl_InitHashTable", cl->nonposArgsTable); + ckfree((char *) cl->nonposArgsTable); + MEM_COUNT_FREE("Tcl_HashTable",cl->nonposArgsTable); + } + + if (cl->parameters) { + DECR_REF_COUNT(cl->parameters); + } + + if (opt) { + if (opt->parameterClass) { + DECR_REF_COUNT(opt->parameterClass); + } + FREE(XOTclClassOpt, opt); + opt = cl->opt = 0; + } + + if (!softrecreate) { + /* + * flush all caches, unlink superclasses + */ + + FlushPrecedences(cl); + while (cl->sub) { + XOTclClass *subClass = cl->sub->cl; + (void)RemoveSuper(subClass, cl); + /* if there are no more super classes add the Object + * class as superclasses + * -> don't do that for Object itself! + */ + if (subClass->super == 0 && cl != theobj) + AddSuper(subClass, theobj); + } + while (cl->super) (void)RemoveSuper(cl, cl->super->cl); + } + +} + +/* + * do class initialization & namespace creation + */ +static void +CleanupInitClass(Tcl_Interp *in, XOTclClass *cl, Tcl_Namespace *namespacePtr, + int softrecreate) { + XOTclObject *obj = (XOTclObject*)cl; + +#ifdef OBJDELETION_TRACE + fprintf(stderr,"+++ CleanupInitClass\n"); +#endif + + /* + * during init of Object and Class the theClass value is not set + */ + /* + if (RUNTIME_STATE(in)->theClass != 0) + obj->type = RUNTIME_STATE(in)->theClass; + */ + XOTclObjectSetClass(obj); + + cl->nsPtr = namespacePtr; + + cl->super = 0; + cl->sub = 0; + AddSuper(cl, RUNTIME_STATE(in)->theObject); + cl->parent = RUNTIME_STATE(in)->theObject; + cl->color = WHITE; + cl->order = 0; + cl->parameters = 0; + + if (!softrecreate) { + Tcl_InitHashTable(&cl->instances, TCL_ONE_WORD_KEYS); + MEM_COUNT_ALLOC("Tcl_InitHashTable",&cl->instances); + } + + cl->opt = 0; + cl->nonposArgsTable = 0; +} + +/* + * class physical destruction + */ +static void +PrimitiveCDestroy(ClientData cd) { + XOTclClass *cl = (XOTclClass*)cd; + XOTclObject *obj = (XOTclObject*)cd; + Tcl_Interp *in; + Tcl_Namespace* saved; + + /* + * check and latch against recurrent calls with obj->teardown + */ + if (!obj || !obj->teardown) return; + in = obj->teardown; + + /* + * Don't destroy, if the interpreted is destroyed already + * e.g. TK calls Tcl_DeleteInterp directly, if Window is killed + */ + if (Tcl_InterpDeleted(in)) return; + + /* + * call and latch user destroy with obj->id if we haven't + */ + /*fprintf(stderr,"PrimitiveCDestroy %s flags %x\n",ObjStr(obj->cmdName),obj->flags);*/ + if (!(obj->flags & XOTCL_DESTROY_CALLED)) + /*fprintf(stderr,"PrimitiveCDestroy call destroy\n");*/ + callDestroyMethod(cd, in, obj, 0); + + obj->teardown = 0; + + CleanupDestroyClass(in, cl, 0); + + /* + * handoff the primitive teardown + */ + + saved = cl->nsPtr; + obj->teardown = in; + + /* + * class object destroy + physical destroy + */ + /*fprintf(stderr,"primitive cdestroy calls primitive odestroy\n");*/ + PrimitiveODestroy(cd); + + /*fprintf(stderr,"primitive cdestroy calls deletenamespace for obj %p\n",cl);*/ + saved->clientData = 0; + XOTcl_DeleteNamespace(in, saved); + + return; +} + +/* + * class init + */ +static void +PrimitiveCInit(XOTclClass *cl, Tcl_Interp *in, char *name) { + TclCallFrame frame, *framePtr = &frame; + Tcl_Namespace* ns; + + /* + * ensure that namespace is newly created during CleanupInitClass + * ie. kill it, if it exists already + */ + if (Tcl_PushCallFrame(in, (Tcl_CallFrame *)framePtr, + RUNTIME_STATE(in)->XOTclClassesNS, 0) != TCL_OK) + return; + ns = NSGetFreshNamespace(in, (ClientData)cl, name); + Tcl_PopCallFrame(in); + + CleanupInitClass(in, cl, ns, 0); + return; +} + +/* + * class create: creation of namespace + class full name + * calls class object creation + */ +static XOTclClass* +PrimitiveCCreate(Tcl_Interp *in, char *name, XOTclClass *class) { + XOTclClass *cl = (XOTclClass*)ckalloc(sizeof(XOTclClass)); + unsigned length; + XOTclObject *obj = (XOTclObject*)cl; + + /*fprintf(stderr, "CKALLOC Class %p %s\n", cl, name);*/ + + memset(cl, 0, sizeof(XOTclClass)); + MEM_COUNT_ALLOC("XOTclObject/XOTclClass",cl); + /* + fprintf(stderr, " +++ CLS alloc: %s\n", name); + */ + assert(isAbsolutePath(name)); + length = strlen(name); + /* + fprintf(stderr,"Class alloc %p '%s'\n", cl, name); + */ + /* check whether Object parent NS already exists, + otherwise: error */ + if (!NSCheckForParent(in, name, length)) { + ckfree((char *) cl); + return 0; + } + obj->id = Tcl_CreateObjCommand(in, name, XOTclObjDispatch, + (ClientData)cl, PrimitiveCDestroy); + + PrimitiveOInit(obj, in, name, class); + + obj->cmdName = NewXOTclObjectObjName(obj,name,length); + INCR_REF_COUNT(obj->cmdName); + PrimitiveCInit(cl, in, name+2); + + objTrace("PrimitiveCCreate", obj); + return cl; +} + +/* change XOTcl class conditionally; obj must not be NULL */ + +XOTCLINLINE static int +changeClass(Tcl_Interp *in, XOTclObject *obj, XOTclClass *cl) { + assert(obj); + + if (cl != obj->cl) { + if (IsMetaClass(in, cl) && !IsMetaClass(in, obj->cl)) { + return XOTclVarErrMsg(in, "cannot change class of object ", + ObjStr(obj->cmdName), + " to metaclass ", + ObjStr(cl->object.cmdName),(char *) NULL); + } + (void)RemoveInstance(obj, obj->cl); + AddInstance(obj, cl); + + MixinComputeDefined(in, obj); + FilterComputeDefined(in, obj); + } + return TCL_OK; +} + + +/* + * Undestroy the object, reclass it, and call "cleanup" afterwards + */ +static int +doCleanup(Tcl_Interp *in, XOTclObject *newobj, XOTclObject *classobj, + int objc, Tcl_Obj *CONST objv[]) { + int destroyed = 0, result; + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + XOTclCallStackContent *csc; + /* + * we check whether the object to be re-created is destroyed or not + */ + for (csc = &cs->content[1]; csc <= cs->top; csc++) { + if (newobj == csc->self && csc->destroyedCmd) { + destroyed = 1; break; + } + } + + if (destroyed) + UndestroyObj(in, newobj); + + /* + * re-create, first ensure correct class for newobj + */ + + result = changeClass(in, newobj, (XOTclClass*) classobj); + + if (result == TCL_OK) { + /* + * dispatch "cleanup" + */ + result = callMethod((ClientData) newobj, in, XOTclGlobalObjects[XOTE_CLEANUP], 2, 0, 0); + } + return result; +} + +/* + * Std object initialization: + * call parameter default values + * apply "-" methods (call "configure" with given arguments) + * call constructor "init", if it was not called before + */ +static int +doObjInitialization(Tcl_Interp *in, XOTclObject *obj, int objc, Tcl_Obj *CONST objv[]) { + int result, initArgsC = objc; + Tcl_Obj *savedObjResult = Tcl_GetObjResult(in); /* save the result */ + INCR_REF_COUNT(savedObjResult); + + /* + * Search for default values of parameter on superclasses + */ + if (!(obj->flags & XOTCL_INIT_CALLED)) { + result = callParameterMethodWithArg(obj, in, XOTclGlobalObjects[XOTE_SEARCH_DEFAULTS], + obj->cmdName, 3, 0, 0); + if (result != TCL_OK) + return result; + } + + /* clear INIT_CALLED_FLAG */ + obj->flags &= ~XOTCL_INIT_CALLED; + + /* + * call configure methods (starting with '-') + */ + + result = callMethod((ClientData) obj, in, + XOTclGlobalObjects[XOTE_CONFIGURE], objc, objv+2, 0); + if (result != TCL_OK) + return result; + + /* check, whether init was called already, and determine where the + * configure (with '-') start (we don't send them as args to + * "init"). */ + + if (!(obj->flags & XOTCL_INIT_CALLED)) { + int newargs; + Tcl_Obj *resultObj = Tcl_GetObjResult(in); + /* + * Call the user-defined constructor 'init' + */ + INCR_REF_COUNT(resultObj); + result = Tcl_GetIntFromObj(in,resultObj,&newargs); + DECR_REF_COUNT(resultObj); + + if (result == TCL_OK && newargs+2 < objc) + initArgsC = newargs+2; + result = callMethod((ClientData) obj, in, XOTclGlobalObjects[XOTE_INIT], + initArgsC, objv+2, 0); + obj->flags |= XOTCL_INIT_CALLED; + } + + if (result == TCL_OK) { + Tcl_SetObjResult(in, savedObjResult); + } + DECR_REF_COUNT(savedObjResult); + + return result; +} + + +/* + * experimental resolver implementation -> not used at the moment + */ +#ifdef NOT_USED +static int +XOTclResolveCmd(Tcl_Interp *in, char *name, Tcl_Namespace *contextNsPtr, + int flags, Tcl_Command *rPtr) { + + Tcl_Namespace *nsPtr[2], *cxtNsPtr; + char *simpleName; + register Tcl_HashEntry *entryPtr; + register Tcl_Command cmd; + register int search; + + /*fprintf(stderr, " ***%s->%s\n", contextNsPtr->fullName, name);*/ + + /* + * Find the namespace(s) that contain the command. + */ + if ((flags & TCL_GLOBAL_ONLY) != 0) { + cxtNsPtr = Tcl_GetGlobalNamespace(in); + } + else if (contextNsPtr != NULL) { + cxtNsPtr = contextNsPtr; + } + else { + cxtNsPtr = Tcl_GetCurrentNamespace(in); + } + + TclGetNamespaceForQualName(in, name, (Namespace *) contextNsPtr, + flags, &nsPtr[0], &nsPtr[1], &cxtNsPtr, &simpleName); + + /*fprintf(stderr, " ***Found %s, %s\n", nsPtr[0]->fullName, nsPtr[0]->fullName);*/ + + /* + * Look for the command in the command table of its namespace. + * Be sure to check both possible search paths: from the specified + * namespace context and from the global namespace. + */ + + cmd = NULL; + for (search = 0; (search < 2) && (cmd == NULL); search++) { + if ((nsPtr[search] != NULL) && (simpleName != NULL)) { + cmdTable = Tcl_Namespace_cmdTable(nsPtr[search]); + entryPtr = Tcl_FindHashEntry(cmdTable, simpleName); + if (entryPtr != NULL) { + cmd = (Tcl_Command) Tcl_GetHashValue(entryPtr); + } + } + } + if (cmd != NULL) { + Tcl_ObjCmdProc* objProc = Tcl_Command_objProc(cmd); + if (cxtNsPtr->deleteProc == NSNamespaceDeleteProc && + objProc != XOTclObjDispatch && + objProc != XOTclNextObjCmd && + objProc != XOTclGetSelfObjCmd) { + + /* + * the cmd is defined in an XOTcl object or class namespace, but + * not an object & not self/next -> redispatch in + * global namespace + */ + cmd = 0; + nsPtr[0] = Tcl_GetGlobalNamespace(in); + if ((nsPtr[0] != NULL) && (simpleName != NULL)) { + cmdTable = Tcl_Namespace_cmdTable(nsPtr[0]); + if ((entryPtr = Tcl_FindHashEntry(cmdTable, simpleName))) { + cmd = (Tcl_Command) Tcl_GetHashValue(entryPtr); + } + } + + /* + XOTclStackDump(in); + XOTclCallStackDump(in); + */ + } + *rPtr = cmd; + return TCL_OK; + } + + return TCL_CONTINUE; +} +static int +XOTclResolveVar(Tcl_Interp *in, char *name, Tcl_Namespace *context, + Tcl_ResolvedVarInfo *rPtr) { + /*fprintf(stderr, "Resolving %s in %s\n", name, context->fullName);*/ + + return TCL_CONTINUE; +} +#endif + +/* + * object method implementations + */ + +static int +XOTclODestroyMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 1) return XOTclObjErrArgCnt(in, obj->cmdName, "destroy"); + PRINTOBJ("XOTclODestroyMethod", obj); + + /* + * call instdestroy for [self] + */ + return XOTclCallMethodWithArgs((ClientData)obj->cl, in, + XOTclGlobalObjects[XOTE_INSTDESTROY], obj->cmdName, + objc, objv+1, 0); +} + +static int +XOTclOCleanupMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + XOTclClass *cl = XOTclObjectToClass(obj); + char *fn; + int softrecreate; + Tcl_Obj *savedNameObj; + +#if defined(OBJDELETION_TRACE) + fprintf(stderr,"+++ XOTclOCleanupMethod\n"); +#endif + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 1) return XOTclObjErrArgCnt(in, obj->cmdName, "cleanup"); + PRINTOBJ("XOTclOCleanupMethod", obj); + + fn = ObjStr(obj->cmdName); + savedNameObj = obj->cmdName; + INCR_REF_COUNT(savedNameObj); + + /* save and pass around softrecreate*/ + softrecreate = obj->flags & XOTCL_RECREATE&& RUNTIME_STATE(in)->doSoftrecreate; + + CleanupDestroyObject(in, obj, softrecreate); + CleanupInitObject(in, obj, obj->cl, obj->nsPtr, softrecreate); + + if (cl) { + CleanupDestroyClass(in, cl, softrecreate); + CleanupInitClass(in, cl, cl->nsPtr, softrecreate); + } + + DECR_REF_COUNT(savedNameObj); + + return TCL_OK; +} + +static int +XOTclOIsClassMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + Tcl_Obj *className; + XOTclObject *obj = (XOTclObject*)cd, *o; + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 1 || objc > 2) return XOTclObjErrArgCnt(in, obj->cmdName, + "isclass ?className?"); + className = (objc == 2) ? objv[1] : obj->cmdName; + + Tcl_SetIntObj(Tcl_GetObjResult(in), + (XOTclObjConvertObject(in, className, &o) == TCL_OK + && XOTclObjectIsClass(o) )); + return TCL_OK; +} + +static int +XOTclOIsObjectMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd, *o; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc != 2) return XOTclObjErrArgCnt(in, obj->cmdName, "isobject "); + + if (XOTclObjConvertObject(in, objv[1], &o) == TCL_OK) { + Tcl_SetIntObj(Tcl_GetObjResult(in), 1); + } else { + Tcl_SetIntObj(Tcl_GetObjResult(in), 0); + } + return TCL_OK; +} + +static int +IsMetaClass(Tcl_Interp *in, XOTclClass *cl) { + /* check if cl is a meta-class by checking is Class is a superclass of cl*/ + XOTclClasses *pl, *checkList=0, *mixinClasses = 0, *mc; + int hasMCM = 0; + + if (cl == RUNTIME_STATE(in)->theClass) + return 1; + + for (pl = ComputeOrder(cl, cl->order, Super); pl; pl = pl->next) { + if (pl->cl == RUNTIME_STATE(in)->theClass) + return 1; + } + + for (pl = ComputeOrder(cl, cl->order, Super); pl; pl = pl->next) { + XOTclClassOpt* opt = pl->cl->opt; + if (opt && opt->instmixins) { + MixinComputeOrderFullList(in, + &opt->instmixins, + &mixinClasses, + &checkList, 0); + } + } + + for (mc=mixinClasses; mc; mc = mc->next) { + /*fprintf(stderr,"- got %s\n",ObjStr(mc->cl->object.cmdName));*/ + if (isSubType(mc->cl, RUNTIME_STATE(in)->theClass)) { + hasMCM = 1; + break; + } + } + XOTclFreeClasses(mixinClasses); + XOTclFreeClasses(checkList); + /*fprintf(stderr,"has MC returns %d, mixinClasses = %p\n", + hasMCM, mixinClasses);*/ + + return hasMCM; +} + +static int +XOTclOIsMetaClassMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd, *o; + Tcl_Obj *className; + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 1 || objc > 2) return XOTclObjErrArgCnt(in, obj->cmdName, + "ismetaclass ?metaClassName?"); + + className = (objc == 2) ? objv[1] : obj->cmdName; + + if (XOTclObjConvertObject(in, className, &o) == TCL_OK + && XOTclObjectIsClass(o) + && IsMetaClass(in, (XOTclClass*)o)) { + Tcl_SetIntObj(Tcl_GetObjResult(in), 1); + } else { + Tcl_SetIntObj(Tcl_GetObjResult(in), 0); + } + return TCL_OK; +} + + +static int +isSubType(XOTclClass *subcl, XOTclClass *cl) { + XOTclClasses *t; + int success = 1; + assert(cl && subcl); + + if (cl != subcl) { + success = 0; + for (t = ComputeOrder(subcl, subcl->order, Super); t && t->cl; t = t->next) { + if (t->cl == cl) { + success = 1; + break; + } + } + } + return success; +} + + + +static int +XOTclOIsTypeMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + XOTclClass *cl; + int success = 0; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc != 2) return XOTclObjErrArgCnt(in, obj->cmdName, "istype "); + if (obj->cl && GetXOTclClassFromObj(in,objv[1],&cl, 1) == TCL_OK) { + success = isSubType(obj->cl,cl); + } + Tcl_ResetResult(in); + Tcl_SetIntObj(Tcl_GetObjResult(in), success); + return TCL_OK; +} + +static int +hasMixin(Tcl_Interp *in, XOTclObject *obj, XOTclClass *cl) { + + if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) + MixinComputeDefined(in, obj); + + if ((obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID)) { + XOTclCmdList *ml; + for (ml = obj->mixinOrder; ml; ml = ml->next) { + XOTclClass *mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); + if (mixin == cl) { + return 1; + } + } + } + return 0; +} + +static int +XOTclOIsMixinMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + XOTclClass *cl; + int success = 0; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc != 2) return XOTclObjErrArgCnt(in, obj->cmdName, "ismixin "); + + if (GetXOTclClassFromObj(in,objv[1],&cl, 1) == TCL_OK) { + success = hasMixin(in, obj, cl); + } + Tcl_ResetResult(in); + Tcl_SetIntObj(Tcl_GetObjResult(in), success); + return TCL_OK; +} + +static int +XOTclOExistsMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc != 2) return XOTclObjErrArgCnt(in, obj->cmdName, "exists var"); + + Tcl_SetIntObj(Tcl_GetObjResult(in), + varExists(in, obj, ObjStr(objv[1]),NULL, 1,1)); + return TCL_OK; +} + +static int +countModifiers(int objc, Tcl_Obj * CONST objv[]) { + int i, count = 0; + char *to; + for (i = 2; i < objc; i++) { + to = ObjStr(objv[i]); + if (to[0] == '-') { + count++; + /* '--' stops modifiers */ + if (to[1] == '-') break; + } + } + return count; +} + +static int +checkForModifier(Tcl_Obj * CONST objv[], int numberModifiers, char *modifier) { + int i; + if (numberModifiers == 0) return 0; + for (i = 2; i-2 < numberModifiers; i++) { + char *ov = ObjStr(objv[i]); + /* all start with a "-", so there must be a ov[1] */ + if (ov[1] == modifier[1] && !strcmp(ov, modifier)) + return 1; + } + return 0; +} + +static int +XOTclOInfoMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + Tcl_Namespace *nsp = obj->nsPtr; + char *cmd, *pattern; + int modifiers = 0; + XOTclObjectOpt *opt; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 2) + return XOTclObjErrArgCnt(in, obj->cmdName, "info ?args?"); + + opt = obj->opt; + cmd = ObjStr(objv[1]); + pattern = (objc > 2) ? ObjStr(objv[2]) : 0; + + /*fprintf(stderr, "OInfo cmd=%s, obj=%s, nsp=%p\n",cmd,ObjStr(obj->cmdName),nsp);*/ + + /* + * check for "-" modifiers + */ + if (pattern && *pattern == '-') { + modifiers = countModifiers(objc, objv); + pattern = (objc > 2+modifiers) ? ObjStr(objv[2+modifiers]) : 0; + } + + switch (*cmd) { + case 'a': + if (isArgsString(cmd)) { + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info args "); + if (obj->nonposArgsTable) { + XOTclNonposArgs* nonposArgs = + NonposArgsGet(obj->nonposArgsTable, pattern); + if (nonposArgs) { + return ListArgsFromOrdinaryArgs(in, nonposArgs); + } + } + if (nsp) + return ListProcArgs(in, Tcl_Namespace_cmdTable(nsp), pattern); + else + return TCL_OK; + } + break; + + case 'b': + if (!strcmp(cmd, "body")) { + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info body "); + if (nsp) + return ListProcBody(in, Tcl_Namespace_cmdTable(nsp), pattern); + else + return TCL_OK; + } + break; + + case 'c': + if (isClassString(cmd)) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info class ?class?"); + return ListClass(in, obj, pattern, objc, objv); + } else if (!strcmp(cmd, "commands")) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info commands ?pat?"); + if (nsp) + return ListKeys(in, Tcl_Namespace_cmdTable(nsp), pattern); + else + return TCL_OK; + } else if (!strcmp(cmd, "children")) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info children ?pat?"); + return ListChildren(in, obj, pattern, 0); + } else if (!strcmp(cmd, "check")) { + if (objc != 2 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info check"); + return AssertionListCheckOption(in, obj); + } + break; + + case 'd': + if (!strcmp(cmd, "default")) { + if (objc != 5 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info default "); + + if (obj->nonposArgsTable) { + XOTclNonposArgs* nonposArgs = + NonposArgsGet(obj->nonposArgsTable, pattern); + if (nonposArgs) { + return ListDefaultFromOrdinaryArgs(in, pattern, nonposArgs, + ObjStr(objv[3]), objv[4]); + } + } + if (nsp) + return ListProcDefault(in, Tcl_Namespace_cmdTable(nsp), pattern, + ObjStr(objv[3]), objv[4]); + else + return TCL_OK; + } + break; + + case 'f': + if (!strcmp(cmd, "filter")) { + int withGuards = 0, withOrder = 0; + if (objc-modifiers > 3) + return XOTclObjErrArgCnt(in, obj->cmdName, + "info filter ?-guards? ?-order? ?pat?"); + if (modifiers > 0) { + withGuards = checkForModifier(objv, modifiers, "-guards"); + withOrder = checkForModifier(objv, modifiers, "-order"); + + if (withGuards == 0 && withOrder == 0) + return XOTclVarErrMsg(in, "info filter: unknown modifier ", + ObjStr(objv[2]), (char *) NULL); + /* + if (withGuards && withOrder) + return XOTclVarErrMsg(in, "info filter: cannot use -guards and -order together", + ObjStr(objv[2]), (char *) NULL); + */ + } + + if (withOrder) { + if (!(obj->flags & XOTCL_FILTER_ORDER_VALID)) + FilterComputeDefined(in, obj); + return FilterInfo(in, obj->filterOrder, pattern, withGuards, 1); + } + + return opt ? FilterInfo(in, opt->filters, pattern, withGuards, 0) : TCL_OK; + + } else if (!strcmp(cmd, "filterguard")) { + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info filterguard filter"); + return opt ? GuardList(in, opt->filters, pattern) : TCL_OK; + } else if (!strcmp(cmd, "forward")) { + int argc = objc-modifiers; + int definition; + if (argc < 2 || argc > 3) + return XOTclObjErrArgCnt(in, obj->cmdName, + "info forward ?-definition? ?name?"); + definition = checkForModifier(objv, modifiers, "-definition"); + if (nsp) + return forwardList(in, Tcl_Namespace_cmdTable(nsp), pattern, definition); + else + return TCL_OK; + } + + break; + + case 'h': + if (!strcmp(cmd, "hasNamespace")) { + Tcl_SetBooleanObj(Tcl_GetObjResult(in), nsp != NULL); + return TCL_OK; + } + break; + + case 'i': + if (!strcmp(cmd, "invar")) { + if (objc != 2 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info invar"); + if (opt && opt->assertions) + Tcl_SetObjResult(in, AssertionList(in, opt->assertions->invariants)); + return TCL_OK; + } else if (!strcmp(cmd, "info")) { + if (objc > 2 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info info"); + return ListInfo(in, GetXOTclClassFromObj(in,obj->cmdName,NULL,0) == TCL_OK); + } + break; + + case 'm': + if (!strcmp(cmd, "mixin")) { + int withOrder = 0, withGuards = 0; + if (objc-modifiers > 3) + return XOTclObjErrArgCnt(in, obj->cmdName, + "info mixin ?-guards? ?-order? ?class?"); + if (modifiers > 0) { + withOrder = checkForModifier(objv, modifiers, "-order"); + withGuards = checkForModifier(objv, modifiers, "-guards"); + + if (withOrder == 0 && withGuards == 0) + return XOTclVarErrMsg(in, "info mixin: unknown modifier . ", + ObjStr(objv[2]), (char *) NULL); + } + + if (withOrder) { + if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) + MixinComputeDefined(in, obj); + return MixinInfo(in, obj->mixinOrder, pattern, withGuards); + } + + return opt ? MixinInfo(in, opt->mixins, pattern, withGuards) : TCL_OK; + + } else if (!strcmp(cmd, "mixinguard")) { + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info mixinguard mixin"); + + return opt ? GuardList(in, opt->mixins, pattern) : TCL_OK; + } else if (!strcmp(cmd, "methods")) { + int noprocs = 0, nocmds = 0, nomixins = 0, inContext = 0; + if (objc-modifiers > 3) + return XOTclObjErrArgCnt(in, obj->cmdName, + "info methods ?-noprocs? ?-nocmds? ?-nomixins? ?-incontext? ?pat?"); + if (modifiers > 0) { + noprocs = checkForModifier(objv, modifiers, "-noprocs"); + nocmds = checkForModifier(objv, modifiers, "-nocmds"); + nomixins = checkForModifier(objv, modifiers, "-nomixins"); + inContext = checkForModifier(objv, modifiers, "-incontext"); + } + return ListMethods(in, obj, pattern, noprocs, nocmds, nomixins, inContext); + } +#ifdef XOTCL_METADATA + else if (!strcmp(cmd, "metadata")) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info metadata ?pat?"); + return ListKeys(in, &obj->metaData, pattern); + } +#endif + break; + + case 'n': + if (!strcmp(cmd, "nonposargs")) { + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info nonposargs "); + if (obj->nonposArgsTable) { + XOTclNonposArgs* nonposArgs = + NonposArgsGet(obj->nonposArgsTable, pattern); + if (nonposArgs) { + Tcl_SetObjResult(in, NonposArgsFormat(in, nonposArgs->nonposArgs)); + } + } + return TCL_OK; + } + break; + + case 'p': + if (!strcmp(cmd, "procs")) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info procs ?pat?"); + if (nsp) + return ListMethodKeys(in, Tcl_Namespace_cmdTable(nsp), pattern, + /*noProcs*/ 0, /*noCmds*/ 1, /* noDups */ 0, 0 ); + else + return TCL_OK; + } else if (!strcmp(cmd, "parent")) { + if (objc > 2 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info parent"); + return ListParent(in, obj); + } else if (!strcmp(cmd, "pre")) { + XOTclProcAssertion* procs; + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info pre "); + if (opt) { + procs = AssertionFindProcs(opt->assertions, ObjStr(objv[2])); + if (procs) Tcl_SetObjResult(in, AssertionList(in, procs->pre)); + } + return TCL_OK; + } else if (!strcmp(cmd, "post")) { + XOTclProcAssertion* procs; + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info post "); + if (opt) { + procs = AssertionFindProcs(opt->assertions, ObjStr(objv[2])); + if (procs) Tcl_SetObjResult(in, AssertionList(in, procs->post)); + } + return TCL_OK; + } else if (!strcmp(cmd, "precedence")) { + return ListPrecedence(in, obj, pattern); + } + break; + case 'v': + if (!strcmp(cmd, "vars")) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, obj->cmdName, "info vars ?pat?"); + return ListVars(in, obj, pattern); + } + break; + } + return XOTclErrBadVal(in, "info", + "an info option (use 'info info' to list all info options)", cmd); +} + + +static int +XOTclOProcMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + char *argStr, *bdyStr, *name; + XOTclObjectOpt *opt; + int incr = 0, result = TCL_OK; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 4 || objc > 7) + return XOTclObjErrArgCnt(in, obj->cmdName, + "proc name ?non-positional-args? args body ?preAssertion postAssertion?"); + + if (objc == 5 || objc == 7) { + incr = 1; + } + + argStr = ObjStr(objv[2 + incr]); + bdyStr = ObjStr(objv[3 + incr]); + name = ObjStr(objv[1 + incr]); + + if (*argStr == 0 && *bdyStr == 0) { + opt = obj->opt; + if (opt) + AssertionRemoveProc(opt->assertions, name); + if (obj->nsPtr) + NSDeleteCmd(in, obj->nsPtr, name); + } else { + XOTclAssertionStore* aStore = NULL; + if (objc > 5) { + opt = XOTclRequireObjectOpt(obj); + if (!opt->assertions) + opt->assertions = AssertionCreateStore(); + aStore = opt->assertions; + } + requireObjNamespace(in, obj); + result = MakeProc(obj->nsPtr, aStore, &(obj->nonposArgsTable), + in, objc, (Tcl_Obj **) objv, obj); + } + + /* could be a filter => recompute filter order */ + FilterComputeDefined(in, obj); + + return result; +} + +static int +XOTclONoinitMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc != 1) return XOTclObjErrArgCnt(in, obj->cmdName, "noninit"); + + obj->flags |= XOTCL_INIT_CALLED; + + return TCL_OK; +} + +Tcl_Obj* +XOTclOSetInstVar(XOTcl_Object *obj, Tcl_Interp *in, + Tcl_Obj *name, Tcl_Obj *value, int flgs) { + return XOTclOSetInstVar2(obj, in, name, (Tcl_Obj *)NULL, value, (flgs|TCL_PARSE_PART1)); +} + +Tcl_Obj* +XOTclOGetInstVar(XOTcl_Object *obj, Tcl_Interp *in, Tcl_Obj *name, int flgs) { + return XOTclOGetInstVar2(obj, in, name, (Tcl_Obj *)NULL, (flgs|TCL_PARSE_PART1)); +} + +int +XOTclUnsetInstVar(XOTcl_Object *obj, Tcl_Interp *in, char *name, int flgs) { + return XOTclUnsetInstVar2 (obj, in, name,(char *)NULL, flgs); +} + +extern int +XOTclCreateObject(Tcl_Interp *in, Tcl_Obj *name, XOTcl_Class *cli) { + XOTclClass *cl = (XOTclClass*) cli; + int result; + INCR_REF_COUNT(name); + result = XOTclCallMethodWithArgs((ClientData)cl, in, + XOTclGlobalObjects[XOTE_CREATE], name, 1, 0, 0); + DECR_REF_COUNT(name); + return result; +} + +extern int +XOTclCreateClass(Tcl_Interp *in, Tcl_Obj *name, XOTcl_Class *cli) { + XOTclClass *cl = (XOTclClass*) cli; + int result; + INCR_REF_COUNT(name); + result = XOTclCallMethodWithArgs((ClientData)cl, in, + XOTclGlobalObjects[XOTE_CREATE], name, 1, 0, 0); + DECR_REF_COUNT(name); + return result; +} + +int +XOTclDeleteObject(Tcl_Interp *in, XOTcl_Object *obji) { + XOTclObject *obj = (XOTclObject*) obji; + return callMethod((ClientData)obj, in, XOTclGlobalObjects[XOTE_DESTROY],2,0,0); +} + +int +XOTclDeleteClass(Tcl_Interp *in, XOTcl_Class *cli) { + XOTclClass *cl = (XOTclClass*) cli; + return callMethod((ClientData)cl, in, XOTclGlobalObjects[XOTE_DESTROY],2,0,0); +} + +extern Tcl_Obj* +XOTclOSetInstVar2(XOTcl_Object *obji, Tcl_Interp *in, Tcl_Obj *name1, Tcl_Obj *name2, + Tcl_Obj *value, int flgs) { + XOTclObject *obj = (XOTclObject*) obji; + Tcl_Obj *result; + XOTcl_FrameDecls; + + XOTcl_PushFrame(in, obj); + if (obj->nsPtr) + flgs |= TCL_NAMESPACE_ONLY; + + result = Tcl_ObjSetVar2(in, name1, name2, value, flgs); + XOTcl_PopFrame(in, obj); + return result; +} + +extern int +XOTclUnsetInstVar2(XOTcl_Object *obji, Tcl_Interp *in, char *name1, char *name2, + int flgs) { + XOTclObject *obj = (XOTclObject*) obji; + int result; + XOTcl_FrameDecls; + + XOTcl_PushFrame(in, obj); + if (obj->nsPtr) + flgs |= TCL_NAMESPACE_ONLY; + + result = Tcl_UnsetVar2(in, name1, name2, flgs); + XOTcl_PopFrame(in, obj); + return result; +} + +static int +GetInstVarIntoCurrentScope(Tcl_Interp *in, XOTclObject *obj, + Tcl_Obj *varName, Tcl_Obj *newName) { + Var *varPtr = NULL, *otherPtr = NULL, *arrayPtr; + int new; + Tcl_CallFrame *varFramePtr; + TclVarHashTable *tablePtr; + XOTcl_FrameDecls; + + int flgs = TCL_LEAVE_ERR_MSG | + /* PARSE_PART1 needed for 8.0.5 */ TCL_PARSE_PART1; + + XOTcl_PushFrame(in, obj); + if (obj->nsPtr) { + flgs = flgs|TCL_NAMESPACE_ONLY; + } + + otherPtr = XOTclObjLookupVar(in, varName, (char *) NULL, flgs, "define", + /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr); + XOTcl_PopFrame(in, obj); + + if (otherPtr == NULL) { + return XOTclVarErrMsg(in, "can't make instvar ", ObjStr(varName), + ": can't find variable on ", ObjStr(obj->cmdName), + (char *) NULL); + } + + /* + * if newName == NULL -> there is no alias, use varName + * as target link name + */ + if (newName == NULL) { + /* + * Variable link into namespace cannot be an element in an array. + * see Tcl_VariableObjCmd ... + */ + if (arrayPtr) { + return XOTclVarErrMsg(in, "can't make instvar ", ObjStr(varName), + " on ", ObjStr(obj->cmdName), + ": variable cannot be an element in an array;", + " use an alias or objeval.", (char *) NULL); + } + + newName = varName; + } + + varFramePtr = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(in); + + /* + * If we are executing inside a Tcl procedure, create a local + * variable linked to the new namespace variable "varName". + */ + if (varFramePtr != NULL && Tcl_CallFrame_isProcCallFrame(varFramePtr)) { + Proc *procPtr = Tcl_CallFrame_procPtr(varFramePtr); + int localCt = procPtr->numCompiledLocals; + CompiledLocal *localPtr = procPtr->firstLocalPtr; + Var *localVarPtr = Tcl_CallFrame_compiledLocals(varFramePtr); + char *newNameString = ObjStr(newName); + int i, nameLen = strlen(newNameString); + + for (i = 0; i < localCt; i++) { /* look in compiled locals */ + + /* fprintf(stderr,"%d of %d %s flags %x not isTemp %d\n",i,localCt, + localPtr->name,localPtr->flags, + !TclIsCompiledLocalTemporary(localPtr));*/ + + if (!TclIsCompiledLocalTemporary(localPtr)) { + char *localName = localPtr->name; + if ((newNameString[0] == localName[0]) + && (nameLen == localPtr->nameLength) + && (strcmp(newNameString, localName) == 0)) { + varPtr = getNthVar(localVarPtr,i); + new = 0; + break; + } + } + localPtr = localPtr->nextPtr; + } + + if (varPtr == NULL) { /* look in frame's local var hashtable */ + tablePtr = Tcl_CallFrame_varTablePtr(varFramePtr); + if (tablePtr == NULL) { + tablePtr = (TclVarHashTable *) ckalloc(varHashTableSize); + InitVarHashTable(tablePtr, NULL); + Tcl_CallFrame_varTablePtr(varFramePtr) = tablePtr; + } + varPtr = VarHashCreateVar(tablePtr, newName, &new); + } + /* + * if we define an alias (newName != varName), be sure that + * the target does not exist already + */ + if (!new) { + if (varPtr == otherPtr) + return XOTclVarErrMsg(in, "can't instvar to variable itself", + (char *) NULL); + + if (TclIsVarLink(varPtr)) { + /* we try to make the same instvar again ... this is ok */ + Var *linkPtr = valueOfVar(Var,varPtr,linkPtr); + if (linkPtr == otherPtr) { + return TCL_OK; + } + + /*fprintf(stderr, "linkvar flags=%x\n",linkPtr->flags); + panic("new linkvar %s... When does this happen?",newNameString,NULL);*/ + + /* We have already a variable with the same name imported + from a different object. Get rid of this old variable + */ + VarHashRefCount(linkPtr)--; + if (TclIsVarUndefined(linkPtr)) { + CleanupVar(linkPtr, (Var *) NULL); + } + + } else if (!TclIsVarUndefined(varPtr)) { + return XOTclVarErrMsg(in, "variable '", ObjStr(newName), + "' exists already", (char *) NULL); + } else if (TclIsVarTraced(varPtr)) { + return XOTclVarErrMsg(in, "variable '", ObjStr(newName), + "' has traces: can't use for instvar", (char *) NULL); + } + } + + TclSetVarLink(varPtr); + TclClearVarUndefined(varPtr); +#if FORWARD_COMPATIBLE + if (forwardCompatibleMode) { + Var85 *vPtr = (Var85 *)varPtr; + vPtr->value.linkPtr = (Var85 *)otherPtr; + } else { + varPtr->value.linkPtr = otherPtr; + } +#else + varPtr->value.linkPtr = otherPtr; +#endif + VarHashRefCount(otherPtr)++; + + /* + { + Var85 *p = (Var85 *)varPtr; + fprintf(stderr,"defining an alias var='%s' in obj %s fwd %d flags %x isLink %d isTraced %d isUndefined %d\n", + ObjStr(newName), ObjStr(obj->cmdName), forwardCompatibleMode, + varFlags(varPtr), + TclIsVarLink(varPtr), TclIsVarTraced(varPtr), TclIsVarUndefined(varPtr)); + } + */ + } + return TCL_OK; +} + +static int +XOTclOInstVarMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]); + +extern int +XOTclInstVar(XOTcl_Object *obji, Tcl_Interp *in, char *name, char *destName) { + XOTclObject *obj = (XOTclObject*) obji; + int result; + Tcl_Obj *alias = 0; + ALLOC_ON_STACK(Tcl_Obj*,2, objv); + + objv[0] = XOTclGlobalObjects[XOTE_INSTVAR]; + objv[1] = Tcl_NewStringObj(name, -1); + INCR_REF_COUNT(objv[1]); + + if (destName != 0) { + alias = Tcl_NewStringObj(destName, -1); + INCR_REF_COUNT(alias); + Tcl_ListObjAppendElement(in, objv[1], alias); + } + + result = XOTclOInstVarMethod((ClientData) obj, in, 2, objv); + + if (destName != 0) { + DECR_REF_COUNT(alias); + } + DECR_REF_COUNT(objv[1]); + FREE_ON_STACK(objv); + return result; +} + +extern void +XOTclRemovePMethod(Tcl_Interp *in, XOTcl_Object *obji, char *nm) { + XOTclObject *obj = (XOTclObject*) obji; + if (obj->nsPtr) + NSDeleteCmd(in, obj->nsPtr, nm); +} + +extern void +XOTclRemoveIMethod(Tcl_Interp *in, XOTcl_Class *cli, char *nm) { + XOTclClass *cl = (XOTclClass*) cli; + NSDeleteCmd(in, cl->nsPtr, nm); +} + +/* + * obj/cl ClientData setter/getter + */ +extern void +XOTclSetObjClientData(XOTcl_Object *obji, ClientData data) { + XOTclObject *obj = (XOTclObject*) obji; + XOTclObjectOpt *opt = XOTclRequireObjectOpt(obj); + opt->clientData = data; +} +extern ClientData +XOTclGetObjClientData(XOTcl_Object *obji) { + XOTclObject *obj = (XOTclObject*) obji; + return (obj && obj->opt) ? obj->opt->clientData : 0; +} +extern void +XOTclSetClassClientData(XOTcl_Class *cli, ClientData data) { + XOTclClass *cl = (XOTclClass*) cli; + XOTclRequireClassOpt(cl); + cl->opt->clientData = data; +} +extern ClientData +XOTclGetClassClientData(XOTcl_Class *cli) { + XOTclClass *cl = (XOTclClass*) cli; + return (cl && cl->opt) ? cl->opt->clientData : 0; +} + +static int +setInstVar(Tcl_Interp *in, XOTclObject *obj, Tcl_Obj *name, Tcl_Obj* value) { + Tcl_Obj *result; + int flags = (obj->nsPtr) ? TCL_LEAVE_ERR_MSG|TCL_NAMESPACE_ONLY : TCL_LEAVE_ERR_MSG; + XOTcl_FrameDecls; + XOTcl_PushFrame(in, obj); + + if (value == NULL) { + result = Tcl_ObjGetVar2(in, name, NULL, flags); + } else { + result = Tcl_ObjSetVar2(in, name, NULL, value, flags); + } + XOTcl_PopFrame(in, obj); + + if (result) { + Tcl_SetObjResult(in, result); + return TCL_OK; + } + return TCL_ERROR; +} + +static int +XOTclOSetMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc > 3) XOTclObjErrArgCnt(in, obj->cmdName, "set var ?value?"); + return setInstVar(in, obj, objv[1], objc == 3 ? objv[2] : NULL); +} + +static int +XOTclSetterMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc > 2) return XOTclObjErrArgCnt(in, obj->cmdName, "parameter ?value?"); + return setInstVar(in, obj, objv[0], objc == 2 ? objv[1] : NULL); +} + + +static int +XOTclOUpvarMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + Tcl_Obj *frameInfoObj = NULL; + int i, result = TCL_ERROR; + char *frameInfo; + callFrameContext ctx = {0}; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 2) return XOTclObjErrArgCnt(in, obj->cmdName, + "?level? otherVar localVar ?otherVar localVar ...?"); + + if (objc % 2 == 0) { + frameInfo = ObjStr(objv[1]); + i = 2; + } else { + frameInfoObj = computeLevelObj(in, CALLING_LEVEL); + INCR_REF_COUNT(frameInfoObj); + frameInfo = ObjStr(frameInfoObj); + i = 1; + } + + if (obj && (obj->filterStack || obj->mixinStack)) { + CallStackUseActiveFrames(in, &ctx); + } + + for ( ; i < objc; i += 2) { + result = Tcl_UpVar2(in, frameInfo, ObjStr(objv[i]), NULL, + ObjStr(objv[i+1]), 0 /*flags*/); + if (result != TCL_OK) + break; + } + + if (frameInfoObj) { + DECR_REF_COUNT(frameInfoObj); + } + CallStackRestoreSavedFrames(in, &ctx); + return result; +} + +static int +XOTclOUplevelMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[]) { + XOTclObject *obj = (XOTclObject *)cd; + int i, result = TCL_ERROR; + char *frameInfo = NULL; + Tcl_CallFrame *framePtr = NULL, *savedVarFramePtr; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 2) { + uplevelSyntax: + return XOTclObjErrArgCnt(in, obj->cmdName, "?level? command ?arg ...?"); + } + /* + * Find the level to use for executing the command. + */ + if (objc>2) { + CallFrame *cf; + frameInfo = ObjStr(objv[1]); + result = TclGetFrame(in, frameInfo, &cf); + if (result == -1) { + return TCL_ERROR; + } + framePtr = (Tcl_CallFrame *)cf; + i = result+1; + } else { + i = 1; + } + + objc -= i; + objv += i; + if (objc == 0) { + goto uplevelSyntax; + } + + if (!framePtr) { + XOTclCallStackContent *csc = XOTclCallStackFindLastInvocation(in, 1); + if (csc) + framePtr = csc->currentFramePtr; + } + + savedVarFramePtr = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(in); + Tcl_Interp_varFramePtr(in) = (CallFrame *)framePtr; + + /* + * Execute the residual arguments as a command. + */ + + if (objc == 1) { + result = Tcl_EvalObjEx(in, objv[0], TCL_EVAL_DIRECT); + } else { + /* + * More than one argument: concatenate them together with spaces + * between, then evaluate the result. Tcl_EvalObjEx will delete + * the object when it decrements its refcount after eval'ing it. + */ + Tcl_Obj *objPtr = Tcl_ConcatObj(objc, objv); + result = Tcl_EvalObjEx(in, objPtr, TCL_EVAL_DIRECT); + } + if (result == TCL_ERROR) { + char msg[32 + TCL_INTEGER_SPACE]; + sprintf(msg, "\n (\"uplevel\" body line %d)", in->errorLine); + Tcl_AddObjErrorInfo(in, msg, -1); + } + + /* + * Restore the variable frame, and return. + */ + + Tcl_Interp_varFramePtr(in) = (CallFrame *)savedVarFramePtr; + return result; +} + +static int +forwardArg(Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[], + Tcl_Obj *o, forwardCmdClientData *tcd, Tcl_Obj **out, + Tcl_Obj **freeList, int *inputarg, int *mapvalue) { + char *element = ObjStr(o), *p; + int totalargs = objc + tcd->nr_args - 1; + char c = *element, c1; + + p = element; + + if (c == '%' && *(element+1) == '@') { + char *remainder = NULL; + long pos; + element += 2; + pos = strtol(element,&remainder,0); + /*fprintf(stderr,"strtol('%s) returned %ld '%s'\n",element,pos,remainder);*/ + if (element == remainder && *element == 'e' && !strncmp(element,"end",3)) { + pos = totalargs; + remainder += 3; + } + if (element == remainder || abs(pos) > totalargs) { + return XOTclVarErrMsg(in, "forward: invalid index specified in argument ", + ObjStr(o), (char *) NULL); + } if (!remainder || *remainder != ' ') { + return XOTclVarErrMsg(in, "forward: invaild syntax in '", ObjStr(o), + "' use: %@ ",(char *) NULL); + } + + element = ++remainder; + if (pos<0) pos = totalargs + pos; + /*fprintf(stderr,"remainder = '%s' pos = %ld\n",remainder,pos);*/ + *mapvalue = pos; + element = remainder; + c = *element; + } + /*fprintf(stderr,"c==%c element = '%s'\n",c,element);*/ + if (c == '%') { + Tcl_Obj *list = 0, **listElements; + int nrargs = objc-1, nrElements = 0; + c = *++element; + c1 = *(element+1); + + if (c == 's' && !strcmp(element,"self")) { + *out = tcd->obj->cmdName; + } else if (c == 'p' && !strcmp(element,"proc")) { + *out = objv[0]; + } else if (c == '1' && (c1 == '\0' || c1 == ' ')) { + /*fprintf(stderr, " nrargs=%d, subcommands=%d inputarg=%d, objc=%d\n", + nrargs, tcd->nr_subcommands, inputarg, objc);*/ + if (c1 != '\0') { + if (Tcl_ListObjIndex(in, o, 1, &list) != TCL_OK) { + return XOTclVarErrMsg(in, "forward: %1 must by a valid list, given: '", + ObjStr(o), "'", (char *) NULL); + } + if (Tcl_ListObjGetElements(in, list, &nrElements, &listElements) != TCL_OK) { + return XOTclVarErrMsg(in, "forward: %1 contains invalid list '", + ObjStr(list),"'", (char *) NULL); + } + } else if (tcd->subcommands) { /* deprecated part */ + if (Tcl_ListObjGetElements(in, tcd->subcommands,&nrElements,&listElements) != TCL_OK) { + return XOTclVarErrMsg(in, "forward: %1 contains invalid list '", + ObjStr(list),"'", (char *) NULL); + } + } + if (nrElements > nrargs) { + /* insert default subcommand depending on number of arguments */ + *out = listElements[nrargs]; + } else if (objc<=1) { + return XOTclObjErrArgCnt(in, objv[0], "no argument given"); + } else { + *out = objv[1]; + *inputarg = 2; + } + } else if (c == 'a' && !strncmp(element,"argcl", 4)) { + if (Tcl_ListObjIndex(in, o, 1, &list) != TCL_OK) { + return XOTclVarErrMsg(in, "forward: %argclindex must by a valid list, given: '", + ObjStr(o), "'", (char *) NULL); + } + if (Tcl_ListObjGetElements(in, list, &nrElements, &listElements) != TCL_OK) { + return XOTclVarErrMsg(in, "forward: %argclindex contains invalid list '", + ObjStr(list),"'", (char *) NULL); + } + if (nrargs >= nrElements) { + return XOTclVarErrMsg(in, "forward: not enough elements in specified list of ARGC argument ", + ObjStr(o), (char *) NULL); + } + *out = listElements[nrargs]; + } else if (c == '%') { + Tcl_Obj *newarg = Tcl_NewStringObj(element,-1); + *out = newarg; + goto add_to_freelist; + } else { + /* evaluating given command */ + int result; + /*fprintf(stderr,"evaluating '%s'\n",element);*/ + if ((result = Tcl_EvalEx(in, element, -1, 0)) != TCL_OK) + return result; + *out = Tcl_DuplicateObj(Tcl_GetObjResult(in)); + /*fprintf(stderr,"result = '%s'\n",ObjStr(*out));*/ + goto add_to_freelist; + } + } else { + if (p == element) + *out = o; + else { + Tcl_Obj *newarg = Tcl_NewStringObj(element,-1); + *out = newarg; + goto add_to_freelist; + } + } + return TCL_OK; + + add_to_freelist: + if (!*freeList) { + *freeList = Tcl_NewListObj(1, out); + INCR_REF_COUNT(*freeList); + } else + Tcl_ListObjAppendElement(in, *freeList, *out); + return TCL_OK; +} + + +static int +callForwarder(forwardCmdClientData *tcd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + ClientData cd; + int result; + XOTcl_FrameDecls; + + if (tcd->verbose) { + Tcl_Obj* cmd = Tcl_NewListObj(objc, objv); + fprintf(stderr,"calling %s\n", ObjStr(cmd)); + DECR_REF_COUNT(cmd); + } + if (tcd->objscope) { + XOTcl_PushFrame(in, tcd->obj); + } + if (tcd->objProc) { + result = (tcd->objProc)(tcd->cd, in, objc, objv); + } else if (tcd->cmdName->typePtr == &XOTclObjectType + && XOTclObjConvertObject(in, tcd->cmdName, (void*)&cd) == TCL_OK) { + /*fprintf(stderr, "XOTcl object %s, objc=%d\n", ObjStr(tcd->cmdName),objc);*/ + result = ObjDispatch(cd, in, objc, objv, 0); + } else { + /*fprintf(stderr, "no XOTcl object %s\n", ObjStr(tcd->cmdName));*/ + result = Tcl_EvalObjv(in, objc, objv, 0); + } + + if (tcd->objscope) { + XOTcl_PopFrame(in, tcd->obj); + } + return result; +} + +static int +XOTclForwardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + forwardCmdClientData *tcd = (forwardCmdClientData *)cd; + int result, j, inputarg=1, outputarg=0; + if (!tcd || !tcd->obj) return XOTclObjErrType(in, objv[0], "Object"); + + /* it is a c-method; establish a value for the currentFramePtr */ + RUNTIME_STATE(in)->cs.top->currentFramePtr = + (Tcl_CallFrame *) Tcl_Interp_varFramePtr(in); + /* + fprintf(stderr,"...setting currentFramePtr %p to %p (ForwardMethod)\n", + RUNTIME_STATE(in)->cs.top->currentFramePtr, + (Tcl_CallFrame *) Tcl_Interp_varFramePtr(in)); */ + + + if (tcd->passthrough) { /* two short cuts for simple cases */ + /* early binding, cmd* resolved, we have to care only for objscope */ + return callForwarder(tcd, in, objc, objv); + } else if (!tcd->args && *(ObjStr(tcd->cmdName)) != '%') { + /* we have ony to replace the method name with the given cmd name */ + ALLOC_ON_STACK(Tcl_Obj*,objc, ov); + memcpy(ov,objv, sizeof(Tcl_Obj *)*objc); + ov[0] = tcd->cmdName; + result = callForwarder(tcd, in, objc, ov); + FREE_ON_STACK(ov); + return result; + } else { + Tcl_Obj **ov, *freeList=NULL; + int totalargs = objc + tcd->nr_args + 3; + ALLOC_ON_STACK(Tcl_Obj*,totalargs, OV); + ALLOC_ON_STACK(int, totalargs, objvmap); + + ov = &OV[1]; + if (tcd->needobjmap) { + memset(objvmap, -1, sizeof(int)*totalargs); + } + +#if 0 + fprintf(stderr,"command %s (%p) objc=%d, subcommand=%d, args=%p, nrargs\n", + ObjStr(objv[0]), tcd, objc, + tcd->nr_subcommands, + tcd->args + ); +#endif + + /* the first argument is always the command, to which we forward */ + + if ((result = forwardArg(in, objc, objv, tcd->cmdName, tcd, + &ov[outputarg], &freeList, &inputarg, + &objvmap[outputarg])) != TCL_OK) { + goto exitforwardmethod; + } + outputarg++; + + if (tcd->args) { + /* copy argument list from definition */ + Tcl_Obj **listElements; + int nrElements; + Tcl_ListObjGetElements(in, tcd->args, &nrElements, &listElements); + + for (j=0; jnr_subcommands=%d size=%d\n", + objc, tcd->nr_subcommands, objc+ 2 );*/ + + if (objc-inputarg>0) { + /*fprintf(stderr, " copying remaining %d args starting at [%d]\n", + objc-inputarg, outputarg);*/ + memcpy(ov+outputarg, objv+inputarg, sizeof(Tcl_Obj *)*(objc-inputarg)); + } else { + /*fprintf(stderr, " nothing to copy, objc=%d, inputarg=%d\n", objc, inputarg);*/ + } + objc += outputarg - inputarg; + +#if 0 + for(j=0; jneedobjmap) + for (j=0; jpos) { + for(i=j; i>pos; i--) { + /*fprintf(stderr,"...moving right %d to %d\n",i-1,i);*/ + ov[i] = ov[i-1]; + objvmap[i] = objvmap[i-1]; + } + } else { + for(i=j; i %s\n",pos,ObjStr(tmp)); */ + ov[pos] = tmp; + objvmap[pos] = -1; + } + + if (tcd->prefix) { + /* prepend a prefix for the subcommands to avoid name clashes */ + Tcl_Obj *methodName = Tcl_DuplicateObj(tcd->prefix); + Tcl_AppendObjToObj(methodName, ov[1]); + ov[1] = methodName; + INCR_REF_COUNT(ov[1]); + } + +#if 0 + for(j=0; jcmdName; + result = callForwarder(tcd, in, objc, ov); + + if (tcd->prefix) {DECR_REF_COUNT(ov[1]);} + exitforwardmethod: + if (freeList) {DECR_REF_COUNT(freeList);} + FREE_ON_STACK(objvmap); + FREE_ON_STACK(OV); + } + return result; +} + + + +static int +XOTclOInstVarMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + Tcl_Obj **ov; + int i, oc, result = TCL_OK; + callFrameContext ctx = {0}; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 2) return XOTclObjErrArgCnt(in, obj->cmdName, "instvar ?vars?"); + + if (obj && (obj->filterStack || obj->mixinStack) ) { + CallStackUseActiveFrames(in, &ctx); + } + if (!Tcl_Interp_varFramePtr(in)) { + CallStackRestoreSavedFrames(in, &ctx); + return XOTclVarErrMsg(in, "instvar used on ", ObjStr(obj->cmdName), + ", but callstack is not in procedure scope", + (char *) NULL); + } + + for (i=1; icmdName, "vwait varname"); + + nameString = ObjStr(objv[1]); + + /* + * Make sure the var table exists and the varname is in there + */ + if (NSRequireVariableOnObj(in, obj, nameString, flgs) == 0) + return XOTclVarErrMsg(in, "Can't lookup (and create) variable ", + nameString, " on ", ObjStr(obj->cmdName), + (char *) NULL); + + XOTcl_PushFrame(in, obj); + /* + * much of this is copied from Tcl, since we must avoid + * access with flag TCL_GLOBAL_ONLY ... doesn't work on + * obj->varTable vars + */ + if (Tcl_TraceVar(in, nameString, flgs, (Tcl_VarTraceProc *)VwaitVarProc, + (ClientData) &done) != TCL_OK) { + return TCL_ERROR; + } + done = 0; + foundEvent = 1; + while (!done && foundEvent) { + foundEvent = Tcl_DoOneEvent(TCL_ALL_EVENTS); + } + Tcl_UntraceVar(in, nameString, flgs, (Tcl_VarTraceProc *)VwaitVarProc, + (ClientData) &done); + XOTcl_PopFrame(in, obj); + /* + * Clear out the interpreter's result, since it may have been set + * by event handlers. + */ + Tcl_ResetResult(in); + + if (!foundEvent) { + return XOTclVarErrMsg(in, "can't wait for variable '", nameString, + "': would wait forever", (char *) NULL); + } + return TCL_OK; +} + +static int +XOTclOInvariantsMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + XOTclObjectOpt *opt; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc != 2) + return XOTclObjErrArgCnt(in, obj->cmdName, "invar "); + + opt = XOTclRequireObjectOpt(obj); + + if (opt->assertions) + TclObjListFreeList(opt->assertions->invariants); + else + opt->assertions = AssertionCreateStore(); + + opt->assertions->invariants = AssertionNewList(in, objv[1]); + return TCL_OK; +} + +static int +XOTclOAutonameMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + int instanceOpt = 0, resetOpt = 0; + Tcl_Obj *autoname; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc == 3) { + instanceOpt = (strcmp(ObjStr(objv[1]), "-instance") == 0); + resetOpt = (strcmp(ObjStr(objv[1]), "-reset") == 0); + } + if ((objc < 2 || objc > 3) || (objc == 3 && !instanceOpt && !resetOpt)) + return XOTclObjErrArgCnt(in, obj->cmdName, "autoname [-instance | -reset] name"); + + autoname = AutonameIncr(in, objv[objc-1], obj, instanceOpt, resetOpt); + if (autoname) { + Tcl_SetObjResult(in, autoname); + DECR_REF_COUNT(autoname); + } + else + return XOTclVarErrMsg(in, + "Autoname failed. Probably format string (with %) was not well-formed", + (char *) NULL); + + return TCL_OK; +} + +static int +XOTclOCheckMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + int ocArgs; Tcl_Obj **ovArgs; + int i; + XOTclObjectOpt *opt; + + /*fprintf(stderr,"checkmethod\n");*/ + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc != 2) + return XOTclObjErrArgCnt(in, obj->cmdName, + "check (?all? ?pre? ?post? ?invar? ?instinvar?)"); + + opt = XOTclRequireObjectOpt(obj); + opt->checkoptions = CHECK_NONE; + + if (Tcl_ListObjGetElements(in, objv[1], &ocArgs, &ovArgs) == TCL_OK + && ocArgs > 0) { + for (i = 0; i < ocArgs; i++) { + char *option = ObjStr(ovArgs[i]); + if (option != 0) { + switch (*option) { + case 'i': + if (strcmp(option, "instinvar") == 0) { + opt->checkoptions |= CHECK_CLINVAR; + } else if (strcmp(option, "invar") == 0) { + opt->checkoptions |= CHECK_OBJINVAR; + } + break; + case 'p': + if (strcmp(option, "pre") == 0) { + opt->checkoptions |= CHECK_PRE; + } else if (strcmp(option, "post") == 0) { + opt->checkoptions |= CHECK_POST; + } + break; + case 'a': + if (strcmp(option, "all") == 0) { + opt->checkoptions |= CHECK_ALL; + } + break; + } + } + } + } + if (opt->checkoptions == CHECK_NONE && ocArgs>0) { + return XOTclVarErrMsg(in, "Unknown check option in command '", + ObjStr(obj->cmdName), " ", ObjStr(objv[0]), + " ", ObjStr(objv[1]), + "', valid: all pre post invar instinvar", + (char *) NULL); + } + + Tcl_ResetResult(in); + return TCL_OK; +} + +static int +XOTclConfigureCommand(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + int bool, opt, result = TCL_OK; + static CONST char *opts[] = { + "filter", "softrecreate", + NULL + }; + enum subCmdIdx { + filterIdx, softrecreateIdx + }; + + if (objc < 2 || objc>3) + return XOTclObjErrArgCnt(in, objv[0], + "::xotcl::configure filter|softrecreate ?on|off?"); + + if (Tcl_GetIndexFromObj(in, objv[1], opts, "option", 0, &opt) != TCL_OK) { + return TCL_ERROR; + } + + if (objc == 3) { + result = Tcl_GetBooleanFromObj(in, objv[2], &bool); + } + if (result == TCL_OK) { + switch (opt) { + case filterIdx: + Tcl_SetBooleanObj(Tcl_GetObjResult(in), + (RUNTIME_STATE(in)->doFilters)); + if (objc == 3) + RUNTIME_STATE(in)->doFilters = bool; + break; + + case softrecreateIdx: + Tcl_SetBooleanObj(Tcl_GetObjResult(in), + (RUNTIME_STATE(in)->doSoftrecreate)); + if (objc == 3) + RUNTIME_STATE(in)->doSoftrecreate = bool; + break; + } + } + return result; +} + +static int +XOTclObjscopedMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + aliasCmdClientData *tcd = (aliasCmdClientData *)cd; + XOTclObject *obj = tcd->obj; + int rc; + XOTcl_FrameDecls; + /*fprintf(stderr,"objscopedMethod obj=%p, ptr=%p\n",obj,tcd->objProc);*/ + XOTcl_PushFrame(in, obj); + rc = (tcd->objProc)(tcd->cd, in, objc, objv); + XOTcl_PopFrame(in, obj); + return rc; +} + +static void aliasCmdDeleteProc(ClientData cd) { + aliasCmdClientData *tcd = (aliasCmdClientData *)cd; + if (tcd->cmdName) {DECR_REF_COUNT(tcd->cmdName);} + /*fprintf(stderr,"aliasCmdDeleteProc\n");*/ + FREE(aliasCmdClientData, tcd); +} + +static int +XOTclAliasCommand(ClientData cd, Tcl_Interp *in, + int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = NULL; + XOTclClass *cl = NULL; + Tcl_Command cmd = NULL; + Tcl_ObjCmdProc *objProc; + char allocation, *methodName, *optionName; + Tcl_CmdDeleteProc* dp = NULL; + aliasCmdClientData *tcd = NULL; + int objscope = 0, i; + + if (objc < 4 || objc > 6) { + return XOTclObjErrArgCnt(in, objv[0], + "| ?-objscope? ?-per-object? "); + } + + GetXOTclClassFromObj(in, objv[1], &cl, 1); + if (!cl) { + XOTclObjConvertObject(in, objv[1], &obj); + if (!obj) + return XOTclObjErrType(in, objv[1], "Class|Object"); + allocation = 'o'; + } else { + allocation = 'c'; + } + + methodName = ObjStr(objv[2]); + + for (i=3; i<5; i++) { + optionName = ObjStr(objv[i]); + if (*optionName != '-') break; + if (!strcmp("-objscope",optionName)) { + objscope = 1; + } else if (!strcmp("-per-object",optionName)) { + allocation = 'o'; + } else { + return XOTclErrBadVal(in, "::xotcl::alias", + "option -objscope or -per-object", optionName); + } + } + + cmd = Tcl_GetCommandFromObj(in, objv[i]); + if (cmd == NULL) + return XOTclVarErrMsg(in, "cannot lookup command '", + ObjStr(objv[i]), "'", (char *) NULL); + objProc = Tcl_Command_objProc(cmd); + + if (objc>i+1) { + return XOTclVarErrMsg(in, "invalid argument '", + ObjStr(objv[i+1]), "'", (char *) NULL); + } + + if (objscope) { + tcd = NEW(aliasCmdClientData); + tcd->cmdName = 0; + tcd->obj = allocation == 'c' ? &cl->object : obj; + tcd->objProc = objProc; + tcd->cd = Tcl_Command_objClientData(cmd); + objProc = XOTclObjscopedMethod; + dp = aliasCmdDeleteProc; + } + + if (allocation == 'c') { + XOTclAddIMethod(in, (XOTcl_Class*)cl, methodName, objProc, tcd, dp); + } else { + XOTclAddPMethod(in, (XOTcl_Object*)obj, methodName, objProc, tcd, dp); + } + return TCL_OK; +} + + +static int +XOTclSetInstvarCommand(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj; + + if (objc < 3 || objc > 4) + return XOTclObjErrArgCnt(in, objv[0], "::xotcl::instvarset obj var ?value?"); + + XOTclObjConvertObject(in, objv[1], &obj); + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + + return setInstVar(in, obj ,objv[2], objc == 4 ? objv[3] : NULL); +} + + +static int +XOTclSetRelationCommand(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + int oc; Tcl_Obj **ov; + XOTclObject *obj = NULL; + XOTclClass *cl = NULL; + XOTclObjectOpt *objopt = NULL; + XOTclClassOpt *clopt = NULL; + int i, opt; + static CONST char *opts[] = { + "mixin", "instmixin", + "filter", "instfilter", + "class", "superclass", + NULL + }; + enum subCmdIdx { + mixinIdx, instmixinIdx, + filterIdx, instfilterIdx, + classIdx, superclassIdx + }; + + if (objc < 3) + return XOTclObjErrArgCnt(in, objv[0], "::xotcl::setrelation obj reltype classes"); + + if (Tcl_GetIndexFromObj(in, objv[2], opts, "relation type", 0, &opt) != TCL_OK) { + return TCL_ERROR; + } + + switch (opt) { + case mixinIdx: + case filterIdx: { + XOTclObjConvertObject(in, objv[1], &obj); + if (!obj) return XOTclObjErrType(in, objv[1], "Object"); + if (Tcl_ListObjGetElements(in, objv[3], &oc, &ov) != TCL_OK) + return TCL_ERROR; + objopt = XOTclRequireObjectOpt(obj); + break; + } + case instmixinIdx: + case instfilterIdx: { + GetXOTclClassFromObj(in, objv[1], &cl, 1); + if (!cl) return XOTclObjErrType(in, objv[1], "Class"); + if (Tcl_ListObjGetElements(in, objv[3], &oc, &ov) != TCL_OK) + return TCL_ERROR; + clopt = XOTclRequireClassOpt(cl); + break; + } + case superclassIdx: + { + GetXOTclClassFromObj(in, objv[1], &cl, 1); + if (!cl) return XOTclObjErrType(in, objv[1], "Class"); + if (Tcl_ListObjGetElements(in, objv[3], &oc, &ov) != TCL_OK) + return TCL_ERROR; + return SuperclassAdd(in, cl, oc, ov, objv[3]); + } + case classIdx: + { + XOTclObjConvertObject(in, objv[1], &obj); + if (!obj) return XOTclObjErrType(in, objv[1], "Object"); + GetXOTclClassFromObj(in, objv[3], &cl, 1); + if (!cl) return XOTclErrBadVal(in, "class", "a class", ObjStr(objv[1])); + return changeClass(in, obj, cl); + } + } + + switch (opt) { + case mixinIdx: + { + if (objopt->mixins) CmdListRemoveList(&objopt->mixins, GuardDel); + + obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; + /* + * since mixin procs may be used as filters -> we have to invalidate + */ + obj->flags &= ~XOTCL_FILTER_ORDER_VALID; + + for (i = 0; i < oc; i++) { + if (MixinAdd(in, &objopt->mixins, ov[i]) != TCL_OK) + return TCL_ERROR; + } + + MixinComputeDefined(in, obj); + FilterComputeDefined(in, obj); + break; + } + case filterIdx: + { + if (objopt->filters) CmdListRemoveList(&objopt->filters, GuardDel); + + obj->flags &= ~XOTCL_FILTER_ORDER_VALID; + for (i = 0; i < oc; i ++) { + if (FilterAdd(in, &objopt->filters, ov[i], obj, 0) != TCL_OK) + return TCL_ERROR; + } + /*FilterComputeDefined(in, obj);*/ + break; + } + + case instmixinIdx: + { + if (clopt->instmixins) CmdListRemoveList(&clopt->instmixins, GuardDel); + + MixinInvalidateObjOrders(in, cl); + /* + * since mixin procs may be used as filters -> we have to invalidate + */ + FilterInvalidateObjOrders(in, cl); + + for (i = 0; i < oc; i++) { + if (MixinAdd(in, &clopt->instmixins, ov[i]) != TCL_OK) + return TCL_ERROR; + } + break; + } + case instfilterIdx: + { + if (clopt->instfilters) CmdListRemoveList(&clopt->instfilters, GuardDel); + + FilterInvalidateObjOrders(in, cl); + + for (i = 0; i < oc; i ++) { + if (FilterAdd(in, &clopt->instfilters, ov[i], 0, cl) != TCL_OK) + return TCL_ERROR; + } + break; + } + } + return TCL_OK; +} + + +static int +XOTclOMixinGuardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + XOTclCmdList* h; + XOTclObjectOpt *opt; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc != 3) + return XOTclObjErrArgCnt(in, obj->cmdName, "mixinguard mixin guards"); + + opt = obj->opt; + if (opt && opt->mixins) { + XOTclClass *mixinCl = XOTclpGetClass(in, ObjStr(objv[1])); + Tcl_Command mixinCmd = NULL; + if (mixinCl) { + mixinCmd = Tcl_GetCommandFromObj(in, mixinCl->object.cmdName); + } + if (mixinCmd) { + h = CmdListFindCmdInList(mixinCmd, opt->mixins); + if (h) { + if (h->clientData) + GuardDel((XOTclCmdList*) h); + GuardAdd(in, h, objv[2]); + obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; + return TCL_OK; + } + } + } + + return XOTclVarErrMsg(in, "Mixinguard: can't find mixin ", + ObjStr(objv[1]), " on ", ObjStr(obj->cmdName), + (char *) NULL); +} + + +static int +XOTclOFilterGuardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + XOTclCmdList* h; + XOTclObjectOpt *opt; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc != 3) + return XOTclObjErrArgCnt(in, obj->cmdName, "filterguard filtername filterGuards"); + + opt = obj->opt; + if (opt && opt->filters) { + h = CmdListFindNameInList(in, ObjStr(objv[1]), opt->filters); + if (h) { + if (h->clientData) + GuardDel((XOTclCmdList*) h); + GuardAdd(in, h, objv[2]); + obj->flags &= ~XOTCL_FILTER_ORDER_VALID; + return TCL_OK; + } + } + + return XOTclVarErrMsg(in, "Filterguard: can't find filter ", + ObjStr(objv[1]), " on ", ObjStr(obj->cmdName), + (char *) NULL); +} + +/* + * Searches for filter on [self] and returns fully qualified name + * if it is not found it returns an empty string + */ +static int +XOTclOFilterSearchMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + char *methodName; + XOTclCmdList *cmdList; + XOTclClass *fcl; + XOTclObject *fobj; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 2) return XOTclObjErrArgCnt(in, obj->cmdName, "filtersearch name"); + Tcl_ResetResult(in); + + if (!(obj->flags & XOTCL_FILTER_ORDER_VALID)) + FilterComputeDefined(in, obj); + if (!(obj->flags & XOTCL_FILTER_ORDER_DEFINED)) + return TCL_OK; + + methodName = ObjStr(objv[1]); + cmdList = obj->filterOrder; + + while (cmdList) { + CONST84 char *filterName = Tcl_GetCommandName(in, cmdList->cmdPtr); + if (filterName[0] == methodName[0] && !strcmp(filterName, methodName)) + break; + cmdList = cmdList->next; + } + + if (!cmdList) + return TCL_OK; + + fcl = cmdList->clorobj; + if (fcl && XOTclObjectIsClass(&fcl->object)) { + fobj = 0; + } else { + fobj = (XOTclObject*)fcl; + fcl = 0; + } + + Tcl_SetObjResult(in, + getFullProcQualifier(in, methodName, fobj, fcl, + cmdList->cmdPtr)); + return TCL_OK; +} + +static int +XOTclOProcSearchMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + XOTclClass *pcl = NULL; + Tcl_Command cmd = 0; + char *simpleName, *methodName; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 2) return XOTclObjErrArgCnt(in, obj->cmdName, "procsearch name"); + + Tcl_ResetResult(in); + + methodName = ObjStr(objv[1]); + + if (obj->nsPtr) + cmd = FindMethod(methodName, obj->nsPtr); + + if (!cmd) { + if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) + MixinComputeDefined(in, obj); + + if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { + XOTclCmdList* mixinList = obj->mixinOrder; + while (mixinList) { + XOTclClass *mcl = XOTclpGetClass(in, (char *)Tcl_GetCommandName(in, mixinList->cmdPtr)); + if (mcl && (pcl = SearchCMethod(mcl, methodName, &cmd))) { + break; + } + mixinList = mixinList->next; + } + } + } + + if (!cmd && obj->cl) + pcl = SearchCMethod(obj->cl, methodName, &cmd); + + if (cmd) { + XOTclObject *pobj = pcl ? NULL : obj; + simpleName = (char *)Tcl_GetCommandName(in, cmd); + Tcl_SetObjResult(in, getFullProcQualifier(in, simpleName, pobj, pcl, cmd)); + } + return TCL_OK; +} + +static int +XOTclORequireNamespaceMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc != 1) return XOTclObjErrArgCnt(in, obj->cmdName, "requireNamespace"); + + requireObjNamespace(in, obj); + return TCL_OK; +} + +typedef enum {NO_DASH, SKALAR_DASH, LIST_DASH} dashArgType; + +static dashArgType +isDashArg(Tcl_Interp *in, Tcl_Obj *obj, char **methodName, int *objc, Tcl_Obj **objv[]) { + char *flag; + static Tcl_ObjType *listType = NULL; + + assert(obj); + + /* fetch list type, if not set already; if used on more places, this should + be moved into the interpreter state + */ + if (listType == NULL) { +#if defined(PRE82) + Tcl_Obj *tmp = Tcl_NewListObj(1, &obj); + listType = tmp->typePtr; + DECR_REF_COUNT(tmp); +#else + static XOTclMutex initMutex = 0; + XOTclMutexLock(&initMutex); + if (listType == NULL) { + listType = Tcl_GetObjType("list"); + /*fprintf(stderr, "fetching listType=%p\n",listType);*/ + } + XOTclMutexUnlock(&initMutex); +#endif + } + + if (obj->typePtr == listType) { + if (Tcl_ListObjGetElements(in, obj, objc, objv) == TCL_OK && *objc>1) { + flag = ObjStr(*objv[0]); + /*fprintf(stderr, "we have a list starting with '%s'\n", flag);*/ + if (*flag == '-') { + *methodName = flag+1; + return LIST_DASH; + } + } + } + flag = ObjStr(obj); + /*fprintf(stderr, "we have a scalar '%s'\n", flag);*/ + if (*flag == '-' && isalpha((int)*((flag)+1))) { + *methodName = flag+1; + *objc = 1; + return SKALAR_DASH; + } + return NO_DASH; +} + +static int +callConfigureMethod(Tcl_Interp *in, XOTclObject *obj, + char *methodName, int argc, Tcl_Obj *CONST argv[]) { + int result; + Tcl_Obj *method = Tcl_NewStringObj(methodName,-1); + + /*fprintf(stderr,"callConfigureMethod method %s->'%s' argc %d\n", + ObjStr(obj->cmdName), methodName, argc);*/ + + if (isInitString(methodName)) + obj->flags |= XOTCL_INIT_CALLED; + + INCR_REF_COUNT(method); + result = callMethod((ClientData)obj, in, method, argc, argv, XOTCL_CM_NO_UNKNOWN); + DECR_REF_COUNT(method); + + /*fprintf(stderr, "method '%s' called args: %d o=%p, result=%d\n", + methodName, argc+1, obj, result); */ + + if (result != TCL_OK) { + Tcl_Obj *res = Tcl_DuplicateObj(Tcl_GetObjResult(in)); /* save the result */ + INCR_REF_COUNT(res); + XOTclVarErrMsg(in, ObjStr(res), " during '", ObjStr(obj->cmdName), " ", + methodName, "'", (char *) NULL); + DECR_REF_COUNT(res); + } + return result; +} + + +static int +XOTclOConfigureMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + Tcl_Obj **argv, **nextArgv; + int i, argc, nextArgc, normalArgs, result = TCL_OK, isdasharg = NO_DASH; + char *methodName, *nextMethodName; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 1) return XOTclObjErrArgCnt(in, obj->cmdName, + "configure ?args?"); + /* find arguments without leading dash */ + for (i=1; i < objc; i++) { + if ((isdasharg = isDashArg(in, objv[i], &methodName, &argc, &argv))) + break; + } + normalArgs = i-1; + + for( ; i < objc; argc=nextArgc, argv=nextArgv, methodName=nextMethodName) { + Tcl_ResetResult(in); + switch (isdasharg) { + case SKALAR_DASH: /* argument is a skalar with a leading dash */ + { int j; + for (j = i+1; j < objc; j++, argc++) { + if ((isdasharg = isDashArg(in, objv[j], &nextMethodName, &nextArgc, &nextArgv))) + break; + } + result = callConfigureMethod(in, obj, methodName, argc+1, objv+i+1); + if (result != TCL_OK) + return result; + i += argc; + break; + } + case LIST_DASH: /* argument is a list with a leading dash, grouping determined by list */ + { i++; + if (icmdName), + " configure: unexpected argument '", + ObjStr(objv[i]), + "' between parameters", (char *) NULL); + } + } + } + Tcl_ResetResult(in); + Tcl_SetIntObj(Tcl_GetObjResult(in), normalArgs); + return result; +} + + + +/* + * class method implementations + */ + +static int +XOTclCInstDestroyMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + XOTclObject *delobj; + int rc; + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc < 2) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "instdestroy "); + + if (XOTclObjConvertObject(in, objv[1], &delobj) != TCL_OK) + return XOTclVarErrMsg(in, "Can't destroy object ", + ObjStr(objv[1]), " that does not exist.", + (char *) NULL); + + /* fprintf(stderr,"instdestroy obj=%s, opt=%p\n",ObjStr(delobj->cmdName),delobj->opt);*/ + + rc = freeUnsetTraceVariable(in, delobj); + if (rc != TCL_OK) { + return rc; + } + + /* + * latch, and call delete command if not already in progress + */ + delobj->flags |= XOTCL_DESTROY_CALLED; + RUNTIME_STATE(in)->callIsDestroy = 1; + /*fprintf(stderr,"instDestroy: setting callIsDestroy = 1\n");*/ + if (RUNTIME_STATE(in)->exitHandlerDestroyRound != + XOTCL_EXITHANDLER_ON_SOFT_DESTROY) { + CallStackDestroyObject(in, delobj); + } + + return TCL_OK; +} + + +static Tcl_Namespace * +callingNameSpace(Tcl_Interp *in) { + Tcl_Namespace *ns = NULL; + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + XOTclCallStackContent *top = cs->top; + XOTclCallStackContent *csc = XOTclCallStackFindLastInvocation(in, 0); + + /*fprintf(stderr," **** use last invocation csc = %p\n", csc);*/ + if (csc && csc->currentFramePtr) { + /* use the callspace from the last invocation */ + XOTclCallStackContent *called = csccurrentFramePtr) : NULL; + /*fprintf(stderr," **** csc use frame= %p\n", f);*/ + if (f) { + ns = f->nsPtr; + } else { + Tcl_CallFrame *f = Tcl_CallFrame_callerPtr(csc->currentFramePtr); + ns = Tcl_GetCurrentNamespace(in); + /* find last incovation outside ::xotcl (for things like relmgr) */ + while (ns == RUNTIME_STATE(in)->XOTclNS) { + if (f) { + ns = f->nsPtr; + f = Tcl_CallFrame_callerPtr(f); + } else { + ns = Tcl_GetGlobalNamespace(in); + } + } + /*fprintf(stderr, "found ns %p '%s'\n",ns, ns?ns->fullName:"NULL");*/ + } + } + if (!ns) { + /* calls on xotcl toplevel */ + XOTclCallStackContent *bot = cs->content + 1; + /*fprintf(stderr, " **** bot=%p diff=%d\n",bot, top-bot);*/ + if (top - bot >= 0 && bot->currentFramePtr) { + /* get calling tcl environment */ + Tcl_CallFrame *f = Tcl_CallFrame_callerPtr(bot->currentFramePtr); + if (f) { + ns = f->nsPtr; + /*fprintf(stderr, "top=%p, bot=%p b->c=%p f=%p ns=%p\n", + top,bot,bot->currentFramePtr, f, ns);*/ + /*fprintf(stderr,"ns from calling tcl environment %p '%s'\n", + ns, ns?ns->fullName : "" );*/ + } else { + /* fprintf(stderr, "nothing found, use ::\n"); */ + ns = Tcl_GetGlobalNamespace(in); + } + } + } + + /*XOTclCallStackDump(in);*/ + /*XOTclStackDump(in);*/ + + /*fprintf(stderr,"callingNameSpace returns %p %s\n",ns,ns?ns->fullName:"");*/ + return ns; +} + + +static int +XOTclCAllocMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + XOTclClass *newcl; + XOTclObject *newobj; + int result; + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc < 2) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "alloc ?args?"); + +#if 0 + fprintf(stderr, "type(%s)=%p %s %d\n", + ObjStr(objv[1]), objv[1]->typePtr, objv[1]->typePtr? + objv[1]->typePtr->name:"NULL", + XOTclObjConvertObject(in, objv[1], &newobj) + ); + /* + * if the lookup via GetObject for the object succeeds, + * the object exists already, + * and we do not overwrite it, but re-create it + */ + if (XOTclObjConvertObject(in, objv[1], &newobj) == TCL_OK) { + fprintf(stderr, "lookup successful\n"); + result = doCleanup(in, newobj, &cl->object, objc, objv); + } else +#endif + { + /* + * create a new object from scratch + */ + char *objName = ObjStr(objv[1]); + Tcl_Obj *tmpName = NULL; + + if (!isAbsolutePath(objName)) { + /*fprintf(stderr, "CallocMethod\n");*/ + tmpName = NameInNamespaceObj(in,objName,callingNameSpace(in)); + /*fprintf(stderr, "NoAbsoluteName for '%s' -> determined = '%s'\n", + objName, ObjStr(tmpName));*/ + objName = ObjStr(tmpName); + + /*fprintf(stderr," **** name is '%s'\n", objName);*/ + INCR_REF_COUNT(tmpName); + } + + if (IsMetaClass(in, cl)) { + /* + * if the base class is a meta-class, we create a class + */ + newcl = PrimitiveCCreate(in, objName, cl); + if (newcl == 0) + result = XOTclVarErrMsg(in, "Class alloc failed for '",objName, + "' (possibly parent namespace does not exist)", + (char *) NULL); + else { + Tcl_SetObjResult(in, newcl->object.cmdName); + result = TCL_OK; + } + } else { + /* + * if the base class is an ordinary class, we create an object + */ + newobj = PrimitiveOCreate(in, objName, cl); + if (newobj == 0) + result = XOTclVarErrMsg(in, "Object alloc failed for '",objName, + "' (possibly parent namespace does not exist)", + (char *) NULL); + else { + result = TCL_OK; + Tcl_SetObjResult(in, newobj->cmdName); + } + } + + if (tmpName) { + DECR_REF_COUNT(tmpName); + } + + } + + return result; +} + + +static int +createMethod(Tcl_Interp *in, XOTclClass *cl, XOTclObject *obj, + int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *newobj = NULL; + Tcl_Obj *nameObj, *tmpObj = NULL; + int result; + char *objName, *specifiedName; + + ALLOC_ON_STACK(Tcl_Obj*,objc, tov); + + memcpy(tov, objv, sizeof(Tcl_Obj *)*(objc)); + specifiedName = objName = ObjStr(objv[1]); + /* + * complete the name if it is not absolute + */ + if (!isAbsolutePath(objName)) { + tmpObj = NameInNamespaceObj(in,objName,callingNameSpace(in)); + objName = ObjStr(tmpObj); + /*fprintf(stderr," **** name is '%s'\n", objName);*/ + + INCR_REF_COUNT(tmpObj); + tov[1] = tmpObj; + } + + /* + * Check whether we have to call recreate (i.e. when the + * object exists already) + */ + newobj = XOTclpGetObject(in, objName); + + /*fprintf(stderr,"+++ create objv[1] '%s', specifiedName '%s', newObj=%p\n", + specifiedName, objName, newobj);*/ + + /* don't allow an object to be recreated as a class */ + if (newobj && (!IsMetaClass(in, cl) || IsMetaClass(in, newobj->cl))) { + /*fprintf(stderr, "%%%% recreate, call recreate method ... %s, objc=%d\n", + ObjStr(tov[1]),objc+1);*/ + /* call recreate --> initialization */ + result = callMethod((ClientData) obj, in, + XOTclGlobalObjects[XOTE_RECREATE], objc+1, tov+1, 0); + if (result != TCL_OK) + goto create_method_exit; + + Tcl_SetObjResult(in, newobj->cmdName); + nameObj = newobj->cmdName; + objTrace("RECREATE", newobj); + + } else { + + if (!NSCheckColons(specifiedName, 0)) { + result = XOTclVarErrMsg(in, "Cannot create object -- illegal name '", + specifiedName, "'", (char *) NULL); + goto create_method_exit; + } + + /* fprintf(stderr, "alloc ... %s\n", ObjStr(tov[1]));*/ + result = callMethod((ClientData) obj, in, + XOTclGlobalObjects[XOTE_ALLOC], objc+1, tov+1, 0); + if (result != TCL_OK) + goto create_method_exit; + + nameObj = Tcl_GetObjResult(in); + if (XOTclObjConvertObject(in, nameObj, &newobj) != TCL_OK) { + result = XOTclErrMsg(in, "couldn't find result of alloc", TCL_STATIC); + goto create_method_exit; + } + + (void)RemoveInstance(newobj, newobj->cl); + AddInstance(newobj, cl); + objTrace("CREATE", newobj); + + /* in case, the object is destroyed during initialization, we incr refcount */ + INCR_REF_COUNT(nameObj); + result = doObjInitialization(in, newobj, objc, objv); + DECR_REF_COUNT(nameObj); + } + create_method_exit: + + /* fprintf(stderr, "create -- end ... %s\n", ObjStr(tov[1]));*/ + if (tmpObj) {DECR_REF_COUNT(tmpObj);} + FREE_ON_STACK(tov); + return result; +} + + +static int +XOTclCCreateMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc < 2) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "create ?args?"); + + if (RUNTIME_STATE(in)->exitHandlerDestroyRound != XOTCL_EXITHANDLER_OFF) { + fprintf(stderr,"### Can't create object %s during shutdown\n",ObjStr(objv[1])); + return TCL_ERROR; + return TCL_OK; /* don't fail, if this happens during destroy, it might be canceled */ + } + + return createMethod(in, cl, &cl->object, objc, objv); +} + + +static int +XOTclCNewMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + XOTclObject *child = NULL; + Tcl_Obj *fullname; + int result, offset = 1, +#if REFCOUNTED + isrefcount = 0, +#endif + i, prefixLength; + Tcl_DString dFullname, *dsPtr = &dFullname; + XOTclStringIncrStruct *iss = &RUNTIME_STATE(in)->iss; + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + + if (objc < 1) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "new [-childof obj] ?args?"); + + for (i=1; icmdName), -1); + Tcl_DStringAppend(dsPtr, "::__#", 5); + } else { + Tcl_DStringAppend(dsPtr, "::xotcl::__#", 12); + } + prefixLength = dsPtr->length; + + while (1) { + (void)XOTclStringIncr(iss); + Tcl_DStringAppend(dsPtr, iss->start, iss->length); + if (!Tcl_FindCommand(in, Tcl_DStringValue(dsPtr), NULL, 0)) { + break; + } + /* in case the value existed already, reset prefix to the + original length */ + Tcl_DStringSetLength(dsPtr, prefixLength); + } + + fullname = Tcl_NewStringObj(Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr)); + + INCR_REF_COUNT(fullname); + + objc -= offset; + { + ALLOC_ON_STACK(Tcl_Obj*,objc+3, ov); + + ov[0] = objv[0]; + ov[1] = XOTclGlobalObjects[XOTE_CREATE]; + ov[2] = fullname; + if (objc >= 1) + memcpy(ov+3, objv+offset, sizeof(Tcl_Obj *)*objc); + + result = DoDispatch(cd, in, objc+3, ov, 0); + FREE_ON_STACK(ov); + } + +#if REFCOUNTED + if (result == TCL_OK) { + if (isrefcount) { + Tcl_Obj *obj = Tcl_GetObjResult(in); + XOTclObject *o = (XOTclObject*) obj->internalRep.otherValuePtr; + o->flags |= XOTCL_REFCOUNTED; + o->teardown = in; + DECR_REF_COUNT(obj); + } + } +#endif + + DECR_REF_COUNT(fullname); + Tcl_DStringFree(dsPtr); + + return result; +} + + +static int +XOTclCRecreateMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + XOTclObject *newobj; + int result; + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc < 2) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "recreate ?args?"); + + if (XOTclObjConvertObject(in, objv[1], &newobj) != TCL_OK) + return XOTclVarErrMsg(in, "can't recreate not existing obj ", + ObjStr(objv[1]), (char *) NULL); + + INCR_REF_COUNT(objv[1]); + newobj->flags |= XOTCL_RECREATE; + + result = doCleanup(in, newobj, &cl->object, objc, objv); + if (result == TCL_OK) { + result = doObjInitialization(in, newobj, objc, objv); + if (result == TCL_OK) + Tcl_SetObjResult(in, objv[1]); + } + DECR_REF_COUNT(objv[1]); + return result; +} + +static int +XOTclCInfoMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + Tcl_Namespace *nsp; + XOTclClassOpt *opt; + char *pattern, *cmd; + int modifiers = 0; + + if (objc < 2) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "info ?args?"); + + if (cl) { + nsp = cl->nsPtr; + opt = cl->opt; + + cmd = ObjStr(objv[1]); + pattern = (objc > 2) ? ObjStr(objv[2]) : 0; + + /* + * check for "-" modifiers + */ + if (pattern && *pattern == '-') { + modifiers = countModifiers(objc, objv); + pattern = (objc > 2+modifiers) ? ObjStr(objv[2+modifiers]) : 0; + } + + switch (*cmd) { + case 'c': + if (!strcmp(cmd, "classchildren")) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "info classchildren ?pat?"); + return ListChildren(in, (XOTclObject*) cl, pattern, 1); + } else if (!strcmp(cmd, "classparent")) { + if (objc > 2 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "info classparent"); + return ListParent(in, &cl->object); + } + break; + + case 'h': + if (!strcmp(cmd, "heritage")) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "info heritage ?pat?"); + return ListHeritage(in, cl, pattern); + } + break; + + case 'i': + if (cmd[1] == 'n' && cmd[2] == 's' && cmd[3] == 't') { + char *cmdTail = cmd + 4; + switch (*cmdTail) { + case 'a': + if (!strcmp(cmdTail, "ances")) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "info instances ?pat?"); + return ListObjPtrHashTable(in, &cl->instances, pattern); + } else if (!strcmp(cmdTail, "args")) { + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instargs "); + if (cl->nonposArgsTable) { + XOTclNonposArgs* nonposArgs = + NonposArgsGet(cl->nonposArgsTable, pattern); + if (nonposArgs) { + return ListArgsFromOrdinaryArgs(in, nonposArgs); + } + } + return ListProcArgs(in, Tcl_Namespace_cmdTable(nsp), pattern); + } + break; + + case 'b': + if (!strcmp(cmdTail, "body")) { + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instbody "); + return ListProcBody(in, Tcl_Namespace_cmdTable(nsp), pattern); + } + break; + + case 'c': + if (!strcmp(cmdTail, "commands")) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instcommands ?pat?"); + return ListKeys(in, Tcl_Namespace_cmdTable(nsp), pattern); + } + break; + + case 'd': + if (!strcmp(cmdTail, "default")) { + if (objc != 5 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instdefault "); + + if (cl->nonposArgsTable) { + XOTclNonposArgs* nonposArgs = + NonposArgsGet(cl->nonposArgsTable, pattern); + if (nonposArgs) { + return ListDefaultFromOrdinaryArgs(in, pattern, nonposArgs, + ObjStr(objv[3]), objv[4]); + } + } + return ListProcDefault(in, Tcl_Namespace_cmdTable(nsp), pattern, + ObjStr(objv[3]), objv[4]); + } + break; + + case 'f': + if (!strcmp(cmdTail, "filter")) { + int withGuards = 0; + if (objc-modifiers > 3) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instfilter ?-guards? ?pat?"); + if (modifiers > 0) { + withGuards = checkForModifier(objv, modifiers, "-guards"); + if (withGuards == 0) + return XOTclVarErrMsg(in, "info instfilter: unknown modifier ", + ObjStr(objv[2]), (char *) NULL); + } + return opt ? FilterInfo(in, opt->instfilters, pattern, withGuards, 0) : TCL_OK; + + } else if (!strcmp(cmdTail, "filterguard")) { + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instfilterguard filter"); + return opt ? GuardList(in, opt->instfilters, pattern) : TCL_OK; + } else if (!strcmp(cmdTail, "forward")) { + int argc = objc-modifiers; + int definition; + if (argc < 2 || argc > 3) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instforward ?-definition? ?name?"); + definition = checkForModifier(objv, modifiers, "-definition"); + if (nsp) + return forwardList(in, Tcl_Namespace_cmdTable(nsp), pattern, definition); + else + return TCL_OK; + } + break; + + case 'i': + if (!strcmp(cmdTail, "invar")) { + XOTclAssertionStore *assertions = opt ? opt->assertions : 0; + if (objc != 2 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instinvar"); + + if (assertions && assertions->invariants) + Tcl_SetObjResult(in, AssertionList(in, assertions->invariants)); + return TCL_OK; + } + break; + + case 'm': + if (!strcmp(cmdTail, "mixin")) { + int withGuards = 0; + + if (objc-modifiers > 3 || modifiers > 1) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instmixin ?-guards? ?class?"); + if (modifiers > 0) { + withGuards = checkForModifier(objv, modifiers, "-guards"); + if (withGuards == 0) + return XOTclVarErrMsg(in, "info instfilter: unknown modifier ", + ObjStr(objv[2]), (char *) NULL); + } + return opt ? MixinInfo(in, opt->instmixins, pattern, withGuards) : TCL_OK; + + } else if (!strcmp(cmdTail, "mixinguard")) { + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instmixinguard mixin"); + return opt ? GuardList(in, opt->instmixins, pattern) : TCL_OK; + } + break; + + case 'n': + if (!strcmp(cmdTail, "nonposargs")) { + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instnonposargs "); + if (cl->nonposArgsTable) { + XOTclNonposArgs* nonposArgs = + NonposArgsGet(cl->nonposArgsTable, pattern); + if (nonposArgs) { + Tcl_SetObjResult(in, NonposArgsFormat(in, + nonposArgs->nonposArgs)); + } + } + return TCL_OK; + } + break; + + case 'p': + if (!strcmp(cmdTail, "procs")) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "info instprocs ?pat?"); + return ListMethodKeys(in, Tcl_Namespace_cmdTable(nsp), pattern, + /*noProcs*/ 0, /*noCmds*/ 1, /* noDups */ 0, 0); + } else if (!strcmp(cmdTail, "pre")) { + XOTclProcAssertion* procs; + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instpre "); + if (opt && opt->assertions) { + procs = AssertionFindProcs(opt->assertions, ObjStr(objv[2])); + if (procs) Tcl_SetObjResult(in, AssertionList(in, procs->pre)); + } + return TCL_OK; + } else if (!strcmp(cmdTail, "post")) { + XOTclProcAssertion* procs; + if (objc != 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info instpost "); + if (opt && opt->assertions) { + procs = AssertionFindProcs(opt->assertions, ObjStr(objv[2])); + if (procs) Tcl_SetObjResult(in, AssertionList(in, procs->post)); + } + return TCL_OK; + } + break; + } + } + break; + + case 'p': + if (!strcmp(cmd, "parameterclass")) { + if (opt && opt->parameterClass) { + Tcl_SetObjResult(in, opt->parameterClass); + } else { + Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_PARAM_CL]); + } + return TCL_OK; + } else if (!strcmp(cmd, "parameter")) { + + Tcl_DString ds, *dsPtr = &ds; + XOTclObject *o; + DSTRING_INIT(dsPtr); + Tcl_DStringAppend(dsPtr, className(cl), -1); + Tcl_DStringAppend(dsPtr, "::slot", 6); + o = XOTclpGetObject(in, Tcl_DStringValue(dsPtr)); + if (o) { + Tcl_Obj *varNameObj = Tcl_NewStringObj("__parameter",-1); + Tcl_Obj *parameters = XOTclOGetInstVar2((XOTcl_Object*)o, + in, varNameObj, NULL, + TCL_LEAVE_ERR_MSG); + if (parameters) { + Tcl_SetObjResult(in, parameters); + } else { + fprintf(stderr, "info parameters: No value for %s\n", + Tcl_DStringValue(dsPtr)); + Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); + } + DECR_REF_COUNT(varNameObj); + } else { + Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); + } + DSTRING_FREE(dsPtr); +#if 0 + if (cl->parameters) { + Tcl_SetObjResult(in, cl->parameters); + } else { + Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); + } +#endif + return TCL_OK; + } + break; + + case 's': + if (!strcmp(cmd, "superclass")) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info superclass ?class?"); + return ListSuperclasses(in, cl, pattern); + } else if (!strcmp(cmd, "subclass")) { + if (objc > 3 || modifiers > 0) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "info subclass ?class?"); + return ListSubclasses(in, cl, pattern); + } else if (!strcmp(cmd, "slots")) { + Tcl_DString ds, *dsPtr = &ds; + XOTclObject *o; + int rc; + DSTRING_INIT(dsPtr); + Tcl_DStringAppend(dsPtr, className(cl), -1); + Tcl_DStringAppend(dsPtr, "::slot", 6); + o = XOTclpGetObject(in, Tcl_DStringValue(dsPtr)); + if (o) { + rc = ListChildren(in, o, NULL, 0); + } else { + rc = TCL_OK; + } + DSTRING_FREE(dsPtr); + return rc; + } + break; + } + } + + return XOTclOInfoMethod(cd, in, objc, (Tcl_Obj **)objv); +} + +static int +XOTclCParameterMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + Tcl_Obj **pv = 0; + int elts, pc, result; + char * params; + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc != 2) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "parameter ?params?"); + if (cl->parameters) { + DECR_REF_COUNT(cl->parameters); + } + + /* did we delete the parameters ? */ + params = ObjStr(objv[1]); + if ((params == NULL) || (*params == '\0')) { + cl->parameters = 0; + return TCL_OK; + } + + /* ok, remember the params */ + cl->parameters = objv[1]; + INCR_REF_COUNT(cl->parameters); + + /* call getter/setter methods in params */ + result = Tcl_ListObjGetElements(in, objv[1], &pc, &pv); + if (result == TCL_OK) { + for (elts = 0; elts < pc; elts++) { + result = callParameterMethodWithArg(&cl->object, in, + XOTclGlobalObjects[XOTE_MKGETTERSETTER], + cl->object.cmdName, 3+1, &pv[elts],0); + if (result != TCL_OK) + break; + } + } + return result; +} + +static int +XOTclCParameterClassMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + char *paramClStr; + XOTclClassOpt *opt; + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc != 2) + return XOTclObjErrArgCnt(in, cl->object.cmdName, "parameterclass cl"); + + paramClStr = ObjStr(objv[1]); + opt = cl->opt; + if (opt && opt->parameterClass) { + DECR_REF_COUNT(opt->parameterClass); + } + if ((paramClStr == NULL) || (*paramClStr == '\0')) { + if (opt) + opt->parameterClass = 0; + } else { + opt = XOTclRequireClassOpt(cl); + opt->parameterClass = objv[1]; + INCR_REF_COUNT(opt->parameterClass); + } + return TCL_OK; +} + +static int +XOTclCInstParameterCmdMethod(ClientData cd, Tcl_Interp *in, + int objc, Tcl_Obj * CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc < 2) return XOTclObjErrArgCnt(in, cl->object.cmdName, "instparametercmd name"); + XOTclAddIMethod(in, (XOTcl_Class*) cl, ObjStr(objv[1]), + (Tcl_ObjCmdProc*)XOTclSetterMethod, 0, 0); + return TCL_OK; +} + +static int +XOTclCParameterCmdMethod(ClientData cd, Tcl_Interp *in, + int objc, Tcl_Obj * CONST objv[]) { + XOTclObject *obj = (XOTclObject*) cd; + + if (objc < 2) return XOTclObjErrArgCnt(in, obj->cmdName, "parametercmd name"); + XOTclAddPMethod(in, (XOTcl_Object*) obj, ObjStr(objv[1]), + (Tcl_ObjCmdProc*)XOTclSetterMethod, 0, 0); + return TCL_OK; +} + +static void forwardCmdDeleteProc(ClientData cd) { + forwardCmdClientData *tcd = (forwardCmdClientData *)cd; + if (tcd->cmdName) {DECR_REF_COUNT(tcd->cmdName);} + if (tcd->subcommands) {DECR_REF_COUNT(tcd->subcommands);} + if (tcd->prefix) {DECR_REF_COUNT(tcd->prefix);} + if (tcd->args) {DECR_REF_COUNT(tcd->args);} + FREE(forwardCmdClientData, tcd); +} + +static int +forwardProcessOptions(Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[], + forwardCmdClientData **tcdp) { + forwardCmdClientData *tcd; + int i, rc = 0, earlybinding = 0; + + tcd = NEW(forwardCmdClientData); + memset(tcd, 0, sizeof(forwardCmdClientData)); + + for (i=2; isubcommands = objv[i+1]; + rc = Tcl_ListObjLength(in,objv[i+1],&tcd->nr_subcommands); + if (rc != TCL_OK) break; + INCR_REF_COUNT(tcd->subcommands); + i++; + } else if (!strcmp(ObjStr(objv[i]),"-methodprefix")) { + if (objc <= i+1) {rc = TCL_ERROR; break;} + tcd->prefix = objv[i+1]; + INCR_REF_COUNT(tcd->prefix); + i++; + } else if (!strcmp(ObjStr(objv[i]),"-objscope")) { + tcd->objscope = 1; + } else if (!strcmp(ObjStr(objv[i]),"-earlybinding")) { + earlybinding = 1; + } else if (!strcmp(ObjStr(objv[i]),"-verbose")) { + tcd->verbose = 1; + } else { + break; + } + } + + tcd->needobjmap = 0; + for (; ineedobjmap |= (*element == '%' && *(element+1) == '@'); + + if (tcd->cmdName == 0) { + tcd->cmdName = objv[i]; + } else if (tcd->args == 0) { + tcd->args = Tcl_NewListObj(1, &objv[i]); + tcd->nr_args++; + INCR_REF_COUNT(tcd->args); + } else { + Tcl_ListObjAppendElement(in, tcd->args, objv[i]); + tcd->nr_args++; + } + } + + if (!tcd->cmdName) { + tcd->cmdName = objv[1]; + } + + if (tcd->objscope) { + /* when we evaluating objscope, and define ... + o forward append -objscope append + a call to + o append ... + would lead to a recursive call; so we add the appropriate namespace + */ + char *name = ObjStr(tcd->cmdName); + if (!isAbsolutePath(name)) { + tcd->cmdName = NameInNamespaceObj(in, name, callingNameSpace(in)); + /*fprintf(stderr,"name %s not absolute, therefore qualifying %s\n", name, + ObjStr(tcd->cmdName));*/ + } + } + INCR_REF_COUNT(tcd->cmdName); + + if (earlybinding) { + Tcl_Command cmd = Tcl_GetCommandFromObj(in, tcd->cmdName); + if (cmd == NULL) + return XOTclVarErrMsg(in, "cannot lookup command '",ObjStr(tcd->cmdName), "'", (char *) NULL); + + tcd->objProc = Tcl_Command_objProc(cmd); + if (tcd->objProc == XOTclObjDispatch /* don't do direct invoke on xotcl objects */ + || tcd->objProc == TclObjInterpProc /* don't do direct invoke on tcl procs */ + ) { + /* silently ignore earlybinding flag */ + tcd->objProc = NULL; + } else { + tcd->cd = Tcl_Command_objClientData(cmd); + } + } + + tcd->passthrough = !tcd->args && *(ObjStr(tcd->cmdName)) != '%' && tcd->objProc != NULL; + + /*fprintf(stderr, "forward args = %p, name = '%s'\n",tcd->args, ObjStr(tcd->cmdName));*/ + if (rc == TCL_OK) { + *tcdp = tcd; + } else { + forwardCmdDeleteProc((ClientData)tcd); + } + return rc; +} + + +static int +XOTclCInstForwardMethod(ClientData cd, Tcl_Interp *in, + int objc, Tcl_Obj * CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + forwardCmdClientData *tcd; + int rc; + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc < 2) goto forward_argc_error; + rc = forwardProcessOptions(in, objc, objv, &tcd); + + if (rc == TCL_OK) { + tcd->obj = &cl->object; + XOTclAddIMethod(in, (XOTcl_Class*) cl, NSTail(ObjStr(objv[1])), + (Tcl_ObjCmdProc*)XOTclForwardMethod, + (ClientData)tcd, forwardCmdDeleteProc); + return TCL_OK; + } else { + forward_argc_error: + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "instforward method ?target? ?-default name? ?-objscope? ?-methodprefix string? ?args?"); + } +} + +static int +XOTclOForwardMethod(ClientData cd, Tcl_Interp *in, + int objc, Tcl_Obj * CONST objv[]) { + XOTcl_Object *obj = (XOTcl_Object*) cd; + forwardCmdClientData *tcd; + int rc; + + if (!obj) return XOTclObjErrType(in, objv[0], "Object"); + if (objc < 2) goto forward_argc_error; + + rc = forwardProcessOptions(in, objc, objv, &tcd); + + if (rc == TCL_OK) { + tcd->obj = (XOTclObject*)obj; + XOTclAddPMethod(in, obj, NSTail(ObjStr(objv[1])), + (Tcl_ObjCmdProc*)XOTclForwardMethod, + (ClientData)tcd, forwardCmdDeleteProc); + return TCL_OK; + } else { + forward_argc_error: + return XOTclObjErrArgCnt(in, obj->cmdName, + "forward method ?target? ?-default name? ?-objscope? ?-methodprefix string? ?args?"); + } +} + + +static int +XOTclOVolatileMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[]) { + XOTclObject *obj = (XOTclObject*) cd; + Tcl_Obj *o = obj->cmdName; + int result = TCL_ERROR; + char *fullName = ObjStr(o); + char *vn; + callFrameContext ctx = {0}; + + if (objc != 1) + return XOTclObjErrArgCnt(in, obj->cmdName, "volatile"); + + if (RUNTIME_STATE(in)->exitHandlerDestroyRound != XOTCL_EXITHANDLER_OFF) { + fprintf(stderr,"### Can't make objects volatile during shutdown\n"); + return XOTclVarErrMsg(in, "Can't make objects volatile during shutdown\n",NULL); + } + + CallStackUseActiveFrames(in, &ctx); + vn = NSTail(fullName); + + if (Tcl_SetVar2(in, vn, NULL, fullName, 0) != NULL) { + XOTclObjectOpt *opt = XOTclRequireObjectOpt(obj); + + /*fprintf(stderr,"### setting trace for %s\n", fullName);*/ + result = Tcl_TraceVar(in, vn, TCL_TRACE_UNSETS, (Tcl_VarTraceProc*)XOTclUnsetTrace, + (ClientData)o); + opt->volatileVarName = vn; + } + CallStackRestoreSavedFrames(in, &ctx); + + if (result == TCL_OK) { + INCR_REF_COUNT(o); + } + return result; +} + +static int +XOTclCInstProcMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + char *argStr, *bdyStr, *name; + XOTclClassOpt* opt; + int incr = 0, result = TCL_OK; + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc < 4 || objc > 7) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "instproc name ?non-positional-args? args body ?preAssertion postAssertion?"); + + if (objc == 5 || objc == 7) { + incr = 1; + } + + argStr = ObjStr(objv[2 + incr]); + bdyStr = ObjStr(objv[3 + incr]); + name = ObjStr(objv[1 + incr]); + + if ((cl == RUNTIME_STATE(in)->theObject && isDestroyString(name)) || + (cl == RUNTIME_STATE(in)->theClass && isInstDestroyString(name)) || + (cl == RUNTIME_STATE(in)->theClass && isAllocString(name)) || + (cl == RUNTIME_STATE(in)->theClass && isCreateString(name))) + return XOTclVarErrMsg(in, className(cl), " instproc: '", name, "' of ", + className(cl), " can not be overwritten. Derive a ", + "sub-class", (char *) NULL); + + if (*argStr == 0 && *bdyStr == 0) { + int rc; + opt = cl->opt; + if (opt && opt->assertions) + AssertionRemoveProc(opt->assertions, name); + rc = NSDeleteCmd(in, cl->nsPtr, name); + if (rc < 0) + return XOTclVarErrMsg(in, className(cl), " cannot delete instproc: '", name, + "' of class ", className(cl), (char *) NULL); + } else { + XOTclAssertionStore* aStore = NULL; + if (objc > 5) { + opt = XOTclRequireClassOpt(cl); + if (!opt->assertions) + opt->assertions = AssertionCreateStore(); + aStore = opt->assertions; + } + result = MakeProc(cl->nsPtr, aStore, &(cl->nonposArgsTable), + in, objc, (Tcl_Obj **) objv, &cl->object); + } + + /* could be a filter or filter inheritance ... update filter orders */ + FilterInvalidateObjOrders(in, cl); + + return result; +} + + +static int +XOTclCInstFilterGuardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + XOTclCmdList* h; + XOTclClassOpt* opt; + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc != 3) return XOTclObjErrArgCnt(in, cl->object.cmdName, + "instfilterguard filtername filterGuard"); + + opt = cl->opt; + if (opt && opt->instfilters) { + h = CmdListFindNameInList(in, ObjStr(objv[1]), opt->instfilters); + if (h) { + if (h->clientData) + GuardDel(h); + GuardAdd(in, h, objv[2]); + FilterInvalidateObjOrders(in, cl); + return TCL_OK; + } + } + + return XOTclVarErrMsg(in, "Instfilterguard: can't find filter ", + ObjStr(objv[1]), " on ", ObjStr(cl->object.cmdName), + (char *) NULL); +} + + +static int +XOTclCInstMixinGuardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + XOTclCmdList* h; + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc != 3) return XOTclObjErrArgCnt(in, cl->object.cmdName, + "instmixinguard mixin guard"); + + if (cl->opt && cl->opt->instmixins) { + XOTclClass *mixinCl = XOTclpGetClass(in, ObjStr(objv[1])); + Tcl_Command mixinCmd = NULL; + if (mixinCl) { + mixinCmd = Tcl_GetCommandFromObj(in, mixinCl->object.cmdName); + } + if (mixinCmd) { + h = CmdListFindCmdInList(mixinCmd, cl->opt->instmixins); + if (h) { + if (h->clientData) + GuardDel((XOTclCmdList*) h); + GuardAdd(in, h, objv[2]); + MixinInvalidateObjOrders(in, cl); + return TCL_OK; + } + } + } + + return XOTclVarErrMsg(in, "Instmixinguard: can't find mixin ", + ObjStr(objv[1]), " on ", ObjStr(cl->object.cmdName), + (char *) NULL); +} + +static int +XOTclCInvariantsMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclClass *cl = XOTclObjectToClass(cd); + XOTclClassOpt* opt; + + if (!cl) return XOTclObjErrType(in, objv[0], "Class"); + if (objc != 2) + return XOTclObjErrArgCnt(in, cl->object.cmdName, + "instinvar "); + opt = XOTclRequireClassOpt(cl); + + if (opt->assertions) + TclObjListFreeList(opt->assertions->invariants); + else + opt->assertions = AssertionCreateStore(); + + opt->assertions->invariants = AssertionNewList(in, objv[1]); + return TCL_OK; +} + +static int +XOTclCUnknownMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*) cd; + char *self = ObjStr(obj->cmdName); + int rc; + + if (objc < 2) return XOTclObjErrArgCnt(in, objv[0], "message ?args .. args?"); + if (isCreateString(self)) + return XOTclVarErrMsg(in, "error ", self, ": unable to dispatch '", + ObjStr(objv[1]), "'", (char *) NULL); + + rc = callMethod(cd, in, XOTclGlobalObjects[XOTE_CREATE], objc+1, objv+1, 0); + return rc; +} + +/* + * New Tcl Commands + */ +static int +XOTcl_NSCopyCmds(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + Tcl_Command cmd; + Tcl_Obj *newFullCmdName, *oldFullCmdName; + char *newName, *oldName, *name; + Tcl_Namespace *ns, *newNs; + Tcl_HashTable *cmdTable; + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr; + + if (objc != 3) + return XOTclObjErrArgCnt(in, NULL, "namespace_copycmds fromNs toNs"); + + ns = ObjFindNamespace(in, objv[1]); + if (!ns) + return TCL_OK; + + newNs = ObjFindNamespace(in, objv[2]); + if (!newNs) + return XOTclVarErrMsg(in, "CopyCmds: Destination namespace ", + ObjStr(objv[2]), " does not exist", (char *) NULL); + /* + * copy all procs & commands in the ns + */ + cmdTable = Tcl_Namespace_cmdTable(ns); + hPtr = Tcl_FirstHashEntry(cmdTable, &hSrch); + while (hPtr != NULL) { + name = Tcl_GetHashKey(cmdTable, hPtr); + + /* + * construct full cmd names + */ + newFullCmdName = Tcl_NewStringObj(newNs->fullName,-1); + oldFullCmdName = Tcl_NewStringObj(ns->fullName,-1); + + INCR_REF_COUNT(newFullCmdName); INCR_REF_COUNT(oldFullCmdName); + Tcl_AppendStringsToObj(newFullCmdName, "::", name, (char *) NULL); + Tcl_AppendStringsToObj(oldFullCmdName, "::", name, (char *) NULL); + newName = ObjStr(newFullCmdName); + oldName = ObjStr(oldFullCmdName); + + /* + * Make sure that the destination command does not already exist. + * Otherwise: do not copy + */ + cmd = Tcl_FindCommand(in, newName, 0, 0); + + if (cmd != NULL) { + /*fprintf(stderr, "%s already exists\n", newName);*/ + if (!XOTclpGetObject(in, newName)) { + /* command or instproc will be deleted & then copied */ + Tcl_DeleteCommandFromToken(in, cmd); + } else { + /* don't overwrite objects -> will be recreated */ + hPtr = Tcl_NextHashEntry(&hSrch); + DECR_REF_COUNT(newFullCmdName); + DECR_REF_COUNT(oldFullCmdName); + continue; + } + } + + /* + * Find the existing command. An error is returned if simpleName can't + * be found + */ + cmd = Tcl_FindCommand(in, oldName, 0, 0); + + if (cmd == NULL) { + Tcl_AppendStringsToObj(Tcl_GetObjResult(in), "can't copy ", " \"", + oldName, "\": command doesn't exist", + (char *) NULL); + DECR_REF_COUNT(newFullCmdName); + DECR_REF_COUNT(oldFullCmdName); + return TCL_ERROR; + } + /* + * Do not copy Objects or Classes + */ + if (!XOTclpGetObject(in, oldName)) { + if (TclIsProc((Command*)cmd)) { + Proc *procPtr = TclFindProc((Interp *)in, oldName); + Tcl_Obj *arglistObj; + CompiledLocal *localPtr; + + /* + * Build a list containing the arguments of the proc + */ + + arglistObj = Tcl_NewListObj(0, NULL); + INCR_REF_COUNT(arglistObj); + + for (localPtr = procPtr->firstLocalPtr; localPtr != NULL; + localPtr = localPtr->nextPtr) { + + if (TclIsCompiledLocalArgument(localPtr)) { + Tcl_Obj *defVal, *defStringObj = Tcl_NewStringObj(localPtr->name, -1); + INCR_REF_COUNT(defStringObj); + /* check for default values */ + if ((GetProcDefault(in, cmdTable, name, + localPtr->name, &defVal) == TCL_OK) && + (defVal != 0)) { + Tcl_AppendStringsToObj(defStringObj, " ", ObjStr(defVal), + (char *) NULL); + } + Tcl_ListObjAppendElement(in, arglistObj, defStringObj); + DECR_REF_COUNT(defStringObj); + } + } + + if (Tcl_Command_objProc(cmd) == RUNTIME_STATE(in)->objInterpProc) { + Tcl_DString ds, *dsPtr = &ds; + + if (isClassName(ns->fullName)) { + /* it started with ::xotcl::classes */ + XOTclClass *cl = XOTclpGetClass(in, NSCutXOTclClasses(ns->fullName)); + XOTclProcAssertion* procs; + + if (cl) { + procs = cl->opt ? + AssertionFindProcs(cl->opt->assertions, name) : 0; + } else { + DECR_REF_COUNT(newFullCmdName); + DECR_REF_COUNT(oldFullCmdName); + DECR_REF_COUNT(arglistObj); + return XOTclVarErrMsg(in, "No class for inst - assertions", (char *) NULL); + } + + /* XOTcl InstProc */ + DSTRING_INIT(dsPtr); + Tcl_DStringAppendElement(dsPtr, NSCutXOTclClasses(newNs->fullName)); + Tcl_DStringAppendElement(dsPtr, "instproc"); + Tcl_DStringAppendElement(dsPtr, name); + Tcl_DStringAppendElement(dsPtr, ObjStr(arglistObj)); + Tcl_DStringAppendElement(dsPtr, StripBodyPrefix(ObjStr(procPtr->bodyPtr))); + if (procs) { + XOTclRequireClassOpt(cl); + AssertionAppendPrePost(in, dsPtr, procs); + } + Tcl_EvalEx(in, Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr),0); + DSTRING_FREE(dsPtr); + } else { + XOTclObject *obj = XOTclpGetObject(in, ns->fullName); + XOTclProcAssertion* procs; + if (obj) { + procs = obj->opt ? + AssertionFindProcs(obj->opt->assertions, name) : 0; + } else { + DECR_REF_COUNT(newFullCmdName); + DECR_REF_COUNT(oldFullCmdName); + DECR_REF_COUNT(arglistObj); + return XOTclVarErrMsg(in, "No object for assertions", (char *) NULL); + } + + /* XOTcl Proc */ + DSTRING_INIT(dsPtr); + Tcl_DStringAppendElement(dsPtr, newNs->fullName); + Tcl_DStringAppendElement(dsPtr, "proc"); + Tcl_DStringAppendElement(dsPtr, name); + Tcl_DStringAppendElement(dsPtr, ObjStr(arglistObj)); + Tcl_DStringAppendElement(dsPtr, StripBodyPrefix(ObjStr(procPtr->bodyPtr))); + if (procs) { + XOTclRequireObjectOpt(obj); + AssertionAppendPrePost(in, dsPtr, procs); + } + Tcl_EvalEx(in, Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr),0); + DSTRING_FREE(dsPtr); + } + DECR_REF_COUNT(arglistObj); + } else { + /* Tcl Proc */ + Tcl_VarEval(in, "proc ", newName, " {", ObjStr(arglistObj),"} {\n", + ObjStr(procPtr->bodyPtr), "}", (char *) NULL); + } + } else { + /* + * Otherwise copy command + */ + Tcl_ObjCmdProc* objProc = Tcl_Command_objProc(cmd); + Tcl_CmdDeleteProc *deleteProc = Tcl_Command_deleteProc(cmd); + ClientData cd; + if (objProc) { + cd = Tcl_Command_objClientData(cmd); + if (cd == 0 || cd == XOTCL_NONLEAF_METHOD) { + /* if client data not null, we would have to copy + the client data; we don't know its size...., so rely + on introspection for copying */ + Tcl_CreateObjCommand(in, newName, objProc, + Tcl_Command_objClientData(cmd), deleteProc); + } + } else { + cd = Tcl_Command_clientData(cmd); + if (cd == 0 || cd == XOTCL_NONLEAF_METHOD) { + Tcl_CreateCommand(in, newName, Tcl_Command_proc(cmd), + Tcl_Command_clientData(cmd), deleteProc); + } + } + } + } + hPtr = Tcl_NextHashEntry(&hSrch); + DECR_REF_COUNT(newFullCmdName); DECR_REF_COUNT(oldFullCmdName); + } + return TCL_OK; +} + +static int +XOTcl_NSCopyVars(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + Tcl_Namespace *ns, *newNs; + Var *varPtr = NULL; + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr; + TclVarHashTable *varTable; + int rc = TCL_OK; + XOTclObject *obj; + char *destFullName; + Tcl_Obj *destFullNameObj; + TclCallFrame frame, *framePtr = &frame; + Tcl_Obj *varNameObj = NULL; + Tcl_Obj *nobjv[4]; + int nobjc; + Tcl_Obj *setObj; + + if (objc != 3) + return XOTclObjErrArgCnt(in, NULL, "namespace_copyvars fromNs toNs"); + + ns = ObjFindNamespace(in, objv[1]); + if (ns) { + newNs = ObjFindNamespace(in, objv[2]); + if (!newNs) + return XOTclVarErrMsg(in, "CopyVars: Destination namespace ", + ObjStr(objv[2]), " does not exist", (char *) NULL); + + obj = XOTclpGetObject(in, ObjStr(objv[1])); + destFullName = newNs->fullName; + destFullNameObj = Tcl_NewStringObj(destFullName, -1); + INCR_REF_COUNT(destFullNameObj); + varTable = Tcl_Namespace_varTable(ns); + Tcl_PushCallFrame(in,(Tcl_CallFrame *)framePtr,newNs,0); + } else { + XOTclObject *newObj; + if (XOTclObjConvertObject(in, objv[1], &obj) != TCL_OK) { + return XOTclVarErrMsg(in, "CopyVars: Origin object/namespace ", + ObjStr(objv[1]), " does not exist", (char *) NULL); + } + if (XOTclObjConvertObject(in, objv[2], &newObj) != TCL_OK) { + return XOTclVarErrMsg(in, "CopyVars: Destination object/namespace ", + ObjStr(objv[2]), " does not exist", (char *) NULL); + } + varTable = obj->varTable; + destFullNameObj = newObj->cmdName; + destFullName = ObjStr(destFullNameObj); + } + + setObj= Tcl_NewStringObj("set", 3); + INCR_REF_COUNT(setObj); + nobjc = 4; + nobjv[0] = destFullNameObj; + nobjv[1] = setObj; + + /* copy all vars in the namespace */ + hPtr = varTable ? Tcl_FirstHashEntry(VarHashTable(varTable), &hSrch) : 0; + while (hPtr != NULL) { + + getVarAndNameFromHash(hPtr, &varPtr, &varNameObj); + INCR_REF_COUNT(varNameObj); + + if (!TclIsVarUndefined(varPtr) && !TclIsVarLink(varPtr)) { + if (TclIsVarScalar(varPtr)) { + /* it may seem odd that we do not copy obj vars with the + * same SetVar2 as normal vars, but we want to dispatch it in order to + * be able to intercept the copying */ + + if (obj) { + nobjv[2] = varNameObj; + nobjv[3] = valueOfVar(Tcl_Obj,varPtr,objPtr); + rc = Tcl_EvalObjv(in, nobjc, nobjv, 0); + } else { + Tcl_ObjSetVar2(in, varNameObj, NULL, + valueOfVar(Tcl_Obj,varPtr,objPtr), + TCL_NAMESPACE_ONLY); + } + } else { + if (TclIsVarArray(varPtr)) { + /* HERE!! PRE85 Why not [array get/set] based? Let the core iterate*/ + TclVarHashTable *aTable = valueOfVar(TclVarHashTable,varPtr,tablePtr); + Tcl_HashSearch ahSrch; + Tcl_HashEntry* ahPtr = aTable ? Tcl_FirstHashEntry(VarHashTable(aTable), &ahSrch) :0; + for (; ahPtr != 0; ahPtr = Tcl_NextHashEntry(&ahSrch)) { + Tcl_Obj *eltNameObj; + Var *eltVar; + + getVarAndNameFromHash(ahPtr, &eltVar, &eltNameObj); + + INCR_REF_COUNT(eltNameObj); + + if (TclIsVarScalar(eltVar)) { + if (obj) { + Tcl_Obj *fullVarNameObj = Tcl_DuplicateObj(varNameObj); + + INCR_REF_COUNT(fullVarNameObj); + Tcl_AppendStringsToObj(fullVarNameObj, "(", + ObjStr(eltNameObj), ")", NULL); + nobjv[2] = fullVarNameObj; + nobjv[3] = valueOfVar(Tcl_Obj,eltVar,objPtr); + + rc = Tcl_EvalObjv(in, nobjc, nobjv, 0); + DECR_REF_COUNT(fullVarNameObj); + } else { + Tcl_ObjSetVar2(in, varNameObj, eltNameObj, + valueOfVar(Tcl_Obj,eltVar,objPtr), + TCL_NAMESPACE_ONLY); + } + } + DECR_REF_COUNT(eltNameObj); + } + } + } + } + DECR_REF_COUNT(varNameObj); + hPtr = Tcl_NextHashEntry(&hSrch); + } + if (ns) { + DECR_REF_COUNT(destFullNameObj); + Tcl_PopCallFrame(in); + } + DECR_REF_COUNT(setObj); + return rc; +} + +int +XOTclSelfDispatchCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *self; + int result; + if (objc < 2) return XOTclObjErrArgCnt(in, objv[0], "::xotcl::my method ?args?"); + if ((self = GetSelfObj(in))) { + result = callMethod((ClientData)self, in, objv[1], objc, objv+2, 0); + } else { + result = XOTclVarErrMsg(in, "Cannot resolve 'self', probably called outside the context of an XOTcl Object", + (char *) NULL); + } + return result; +} + +int +XOTclInitProcNSCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + Tcl_CallFrame *varFramePtr = (Tcl_CallFrame *) Tcl_Interp_varFramePtr(in); + + /*RUNTIME_STATE(in)->varFramePtr = varFramePtr;*/ +#if 0 + Tcl_Namespace *nsPtr = Tcl_Command_nsPtr(RUNTIME_STATE(in)->cs.top->cmdPtr); + fprintf(stderr,"initProcNS self=%s cmd=%p, '%s'\n", + ObjStr(RUNTIME_STATE(in)->cs.top->self->cmdName), + nsPtr, nsPtr->fullName); + fprintf(stderr,"\tsetting currentFramePtr in %p to %p in initProcNS\n", + RUNTIME_STATE(in)->cs.top->currentFramePtr, varFramePtr); + XOTclCallStackDump(in); +#endif + + if (RUNTIME_STATE(in)->cs.top->currentFramePtr == 0) { + RUNTIME_STATE(in)->cs.top->currentFramePtr = varFramePtr; + } /* else { + + fprintf(stderr,"not overwriting currentFramePtr in %p from %p to %p\n", + RUNTIME_STATE(in)->cs.top, + RUNTIME_STATE(in)->cs.top->currentFramePtr, varFramePtr); + } */ + +#if !defined(NAMESPACEINSTPROCS) + if (varFramePtr) { + varFramePtr->nsPtr = GetCallerVarFrame(in,varFramePtr); + } +#endif + return TCL_OK; +} + +/* + * Interpretation of Non-Positional Args + */ +int +isNonposArg(Tcl_Interp *in, char * argStr, + int nonposArgsDefc, Tcl_Obj **nonposArgsDefv, + Tcl_Obj **var, char **type) { + int i, npac; + Tcl_Obj **npav; + char *varName; + if (argStr[0] == '-') { + for (i=0; i < nonposArgsDefc; i++) { + if (Tcl_ListObjGetElements(in, nonposArgsDefv[i], + &npac, &npav) == TCL_OK && npac > 0) { + varName = argStr+1; + if (!strcmp(varName, ObjStr(npav[0]))) { + *var = npav[0]; + *type = ObjStr(npav[1]); + return 1; + } + } + } + } + return 0; +} + +int +XOTclCheckBooleanArgs(ClientData cd, Tcl_Interp *in, int objc, + Tcl_Obj *CONST objv[]) { + int result, bool; + Tcl_Obj* boolean; + + if (objc == 2) { + /* the variable is not yet defined (set), so we cannot check + whether it is boolean or not */ + return TCL_OK; + } else if (objc != 3) { + return XOTclObjErrArgCnt(in, NULL, + "::xotcl::nonposArgs boolean name ?value?"); + } + + boolean = Tcl_DuplicateObj(objv[2]); + INCR_REF_COUNT(boolean); + result = Tcl_GetBooleanFromObj(in, boolean, &bool); + DECR_REF_COUNT(boolean); + /* + result = TCL_OK; + */ + if (result != TCL_OK) + return XOTclVarErrMsg(in, + "non-positional argument: '", ObjStr(objv[1]), "' with value '", + ObjStr(objv[2]), "' is not of type boolean", + (char *) NULL); + return TCL_OK; +} + +int +XOTclCheckRequiredArgs(ClientData cd, Tcl_Interp *in, int objc, + Tcl_Obj *CONST objv[]) { + if (objc != 2 && objc != 3) + return XOTclObjErrArgCnt(in, NULL, + "::xotcl::nonposArgs required ?currentValue?"); + + if (objc != 3) + return XOTclVarErrMsg(in, + "required arg: '", ObjStr(objv[1]), "' missing", + (char *) NULL); + return TCL_OK; +} + +int +XOTclInterpretNonpositionalArgsCmd(ClientData cd, Tcl_Interp *in, int objc, + Tcl_Obj *CONST objv[]) { + Tcl_Obj **npav, **checkv, **checkArgv, **argsv, **nonposArgsDefv, + *invocation[4], **ordinaryArgsDefv, **defaultValueObjv, *list, + *checkObj, *ordinaryArg; + int npac, checkc, checkArgc, argsc, nonposArgsDefc, + ordinaryArgsDefc, defaultValueObjc, argsDefined = 0, + ordinaryArgsCounter = 0, i, j, result, ic; + char * lastDefArg = NULL, *arg, *argStr; + int endOfNonposArgsReached = 0; + Var *varPtr; + + XOTclClass* selfClass = GetSelfClass(in); + char *methodName = (char *) GetSelfProc(in); + Tcl_HashTable* nonposArgsTable; + XOTclNonposArgs* nonposArgs; + XOTclObject* selfObj; + int r1, r2, r3, r4; + + if (objc != 2) + return XOTclObjErrArgCnt(in, NULL, + "::xotcl::interpretNonpositionalArgs "); + + if (selfClass) { + nonposArgsTable = selfClass->nonposArgsTable; + } else if ((selfObj = GetSelfObj(in))) { + nonposArgsTable = selfObj->nonposArgsTable; + } else { + return XOTclVarErrMsg(in, "Non positional args: can't find self/self class", + (char *) NULL); + } + + nonposArgs = NonposArgsGet(nonposArgsTable, methodName); + if (nonposArgs == 0) { + return XOTclVarErrMsg(in, + "Non positional args: can't find hash entry for: ", + methodName, + (char *) NULL); + } + + r1 = Tcl_ListObjGetElements(in, nonposArgs->nonposArgs, + &nonposArgsDefc, &nonposArgsDefv); + r2 = Tcl_ListObjGetElements(in, nonposArgs->ordinaryArgs, + &ordinaryArgsDefc, &ordinaryArgsDefv); + r3 = Tcl_ListObjGetElements(in, objv[1], &argsc, &argsv); + + + if (r1 != TCL_OK || r2 != TCL_OK || r3 != TCL_OK) { + return XOTclVarErrMsg(in, + "Cannot split non positional args list: ", + methodName, + (char *) NULL); + } + + /* setting variables to default values */ + for (i=0; i < nonposArgsDefc; i++) { + r1 = Tcl_ListObjGetElements(in, nonposArgsDefv[i], &npac, &npav); + if (r1 == TCL_OK) { + if (npac == 3) { + Tcl_ObjSetVar2(in, npav[0], NULL, npav[2], 0); + } else if (npac == 2 && !strcmp(ObjStr(npav[1]), "switch")) { + Tcl_ObjSetVar2(in, npav[0], NULL, Tcl_NewBooleanObj(0), 0); + } + } + } + + if (ordinaryArgsDefc > 0) { + lastDefArg = ObjStr(ordinaryArgsDefv[ordinaryArgsDefc-1]); + if (isArgsString(lastDefArg)) { + argsDefined = 1; + } + } + + /* setting specified variables */ + for (i=0; i < argsc; i++) { + + if (!endOfNonposArgsReached) { + char *type; + Tcl_Obj *var; + argStr = ObjStr(argsv[i]); + + if (isDoubleDashString(argStr)) { + endOfNonposArgsReached = 1; + i++; + } + if (isNonposArg(in, argStr, nonposArgsDefc, nonposArgsDefv, &var,&type)) { + if (*type == 's' && !strcmp(type, "switch")) { + int bool; + Tcl_Obj *boolObj = Tcl_ObjGetVar2(in, var, 0, 0); + if (Tcl_GetBooleanFromObj(in, boolObj, &bool) != TCL_OK) { + return XOTclVarErrMsg(in, "Non positional arg '",argStr, + "': no boolean value", (char *) NULL); + } + Tcl_ObjSetVar2(in, var, NULL, Tcl_NewBooleanObj(!bool), 0); + } else { + i++; + if (i >= argsc) + return XOTclVarErrMsg(in, "Non positional arg '", + argStr, "': value missing", (char *) NULL); + Tcl_ObjSetVar2(in, var, NULL, argsv[i], 0); + } + } else { + endOfNonposArgsReached = 1; + } + } + + if (endOfNonposArgsReached && i < argsc) { + if (ordinaryArgsCounter >= ordinaryArgsDefc) { + Tcl_Obj *tmp = NonposArgsFormat(in, nonposArgs->nonposArgs); + XOTclVarErrMsg(in, "unknown argument '", + ObjStr(argsv[i]), + "' for method '", + methodName, + "': valid arguments ", + ObjStr(tmp), + " ", + ObjStr(nonposArgs->ordinaryArgs), + (char *) NULL); + DECR_REF_COUNT(tmp); + return TCL_ERROR; + } + arg = ObjStr(ordinaryArgsDefv[ordinaryArgsCounter]); + /* this is the last arg and 'args' is defined */ + if (argsDefined && ordinaryArgsCounter+1 == ordinaryArgsDefc) { + list = Tcl_NewListObj(0, NULL); + INCR_REF_COUNT(list); + for(; i < argsc; i++) + Tcl_ListObjAppendElement(in, list, argsv[i]); + Tcl_ObjSetVar2(in, ordinaryArgsDefv[ordinaryArgsCounter], NULL, list, 0); + DECR_REF_COUNT(list); + } else { + /* break down this argument, if it has a default value, + use only the first part */ + ordinaryArg = ordinaryArgsDefv[ordinaryArgsCounter]; + r4 = Tcl_ListObjGetElements(in, ordinaryArg, + &defaultValueObjc, &defaultValueObjv); + if (r4 == TCL_OK && defaultValueObjc == 2) { + ordinaryArg = defaultValueObjv[0]; + } + Tcl_ObjSetVar2(in, ordinaryArg, NULL, argsv[i], 0); + } + ordinaryArgsCounter++; + } + } + + /*fprintf(stderr,"... args defined %d argsc=%d oa %d oad %d\n", + argsDefined, argsc, + ordinaryArgsCounter, ordinaryArgsDefc); */ + + if ((!argsDefined && ordinaryArgsCounter != ordinaryArgsDefc) || + (argsDefined && ordinaryArgsCounter < ordinaryArgsDefc-1)) { + + /* we do not have enough arguments, maybe there are default arguments + for the missing args */ + while (ordinaryArgsCounter != ordinaryArgsDefc) { + if (argsDefined && ordinaryArgsCounter+1 == ordinaryArgsDefc) + break; + r4 = Tcl_ListObjGetElements(in, ordinaryArgsDefv[ordinaryArgsCounter], + &defaultValueObjc, &defaultValueObjv); + /*fprintf(stderr,"... try to get default for '%s', rc %d, objc %d\n", + ObjStr(ordinaryArgsDefv[ordinaryArgsCounter]), + r4,defaultValueObjc);*/ + if (r4 == TCL_OK && defaultValueObjc == 2) { + Tcl_ObjSetVar2(in, defaultValueObjv[0], NULL, defaultValueObjv[1], 0); + } else { + Tcl_Obj *tmp = NonposArgsFormat(in, nonposArgs->nonposArgs); + XOTclVarErrMsg(in, "wrong # args for method '", + methodName, "': valid arguments ", ObjStr(tmp), " ", + ObjStr(nonposArgs->ordinaryArgs), + (char *) NULL); + DECR_REF_COUNT(tmp); + return TCL_ERROR; + } + ordinaryArgsCounter++; + } + if (argsDefined) { + Tcl_SetVar2(in, "args", NULL, "", 0); + } + } else if (argsDefined && ordinaryArgsCounter == ordinaryArgsDefc-1) { + Tcl_SetVar2(in, "args", NULL, "", 0); + } + + if (!argsDefined) { + Tcl_UnsetVar2(in, "args", NULL, 0); + } + + /* checking vars */ + for (i=0; i < nonposArgsDefc; i++) { + r1 = Tcl_ListObjGetElements(in, nonposArgsDefv[i], &npac, &npav); + if (r1 == TCL_OK && npac > 1 && *(ObjStr(npav[1])) != '\0') { + r1 = Tcl_ListObjGetElements(in, npav[1], &checkc, &checkv); + if (r1 == TCL_OK) { + checkObj = XOTclGlobalObjects[XOTE_NON_POS_ARGS_OBJ]; + for (j=0; j < checkc; j++) { + r1 = Tcl_ListObjGetElements(in, checkv[j], &checkArgc, &checkArgv); + if (r1 == TCL_OK && checkArgc > 1) { + if (isCheckObjString((ObjStr(checkArgv[0]))) && checkArgc == 2) { + checkObj = checkArgv[1]; + continue; + } + } + invocation[0] = checkObj; + invocation[1] = checkv[j]; + varPtr = TclVarTraceExists(in, ObjStr(npav[0])); + invocation[2] = npav[0]; + ic = 3; + if ((varPtr != NULL) && !TclIsVarUndefined(varPtr)) { + invocation[3] = Tcl_ObjGetVar2(in, npav[0], 0, 0); + ic = 4; + } + result = Tcl_EvalObjv(in, ic, invocation, 0); + /* + objPtr = Tcl_ConcatObj(ic, invocation); + fprintf(stderr,"eval on <%s>\n",ObjStr(objPtr)); + result = Tcl_EvalObjEx(in, objPtr, TCL_EVAL_DIRECT); + */ + if (result != TCL_OK) { + return result; + } + } + } + } + } + return TCL_OK; +} + + +/* create a slave interp that calls XOTcl Init */ +static int +XOTcl_InterpObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + Tcl_Interp *slave; + char *subCmd; + ALLOC_ON_STACK(Tcl_Obj*,objc, ov); + + memcpy(ov, objv, sizeof(Tcl_Obj *)*objc); + if (objc < 1) { + XOTclObjErrArgCnt(in, NULL, "::xotcl::interp name ?args?"); + goto interp_error; + } + + ov[0] = XOTclGlobalObjects[XOTE_INTERP]; + if (Tcl_EvalObjv(in, objc, ov, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) != TCL_OK) { + goto interp_error; + } + + subCmd = ObjStr(ov[1]); + if (isCreateString(subCmd)) { + slave = Tcl_GetSlave(in, ObjStr(ov[2])); + if (!slave) { + XOTclVarErrMsg(in, "Creation of slave interpreter failed", (char *) NULL); + goto interp_error; + } + if (Xotcl_Init(slave) == TCL_ERROR) { + goto interp_error; + } +#ifdef XOTCL_MEM_COUNT + xotclMemCountInterpCounter++; +#endif + } + FREE_ON_STACK(ov); + return TCL_OK; + interp_error: + FREE_ON_STACK(ov); + return TCL_ERROR; +} + +extern Tcl_Obj* +XOTclOGetInstVar2(XOTcl_Object *obj, Tcl_Interp *in, Tcl_Obj *name1, Tcl_Obj *name2, + int flgs) { + Tcl_Obj *result; + XOTcl_FrameDecls; + + XOTcl_PushFrame(in, (XOTclObject*)obj); + if (((XOTclObject*)obj)->nsPtr) + flgs |= TCL_NAMESPACE_ONLY; + + result = Tcl_ObjGetVar2(in, name1, name2, flgs); + XOTcl_PopFrame(in, (XOTclObject*)obj); + + return result; +} + + +#if !defined(NDEBUG) +static void +checkAllInstances(Tcl_Interp *in, XOTclClass *cl, int lvl) { + Tcl_HashSearch search; + Tcl_HashEntry *hPtr; + if (cl && cl->object.refCount>0) { + /*fprintf(stderr,"checkallinstances %d cl=%p '%s'\n", lvl, cl, ObjStr(cl->object.cmdName));*/ + for (hPtr = Tcl_FirstHashEntry(&cl->instances, &search); hPtr != NULL; + hPtr = Tcl_NextHashEntry(&search)) { + XOTclObject *inst = (XOTclObject*) Tcl_GetHashKey(&cl->instances, hPtr); + assert(inst); + assert(inst->refCount>0); + assert(inst->cmdName->refCount>0); + if (XOTclObjectIsClass(inst) && (XOTclClass*)inst != RUNTIME_STATE(in)->theClass) { + checkAllInstances(in, (XOTclClass*) inst, lvl+1); + } + } + } +} +#endif + +#ifdef DO_FULL_CLEANUP +/* delete global variables and procs */ +static void deleteProcsAndVars(Tcl_Interp *in) { + Tcl_Namespace *ns = Tcl_GetGlobalNamespace(in); + Tcl_HashTable *varTable = ns ? Tcl_Namespace_varTable(ns) : NULL; + Tcl_HashTable *cmdTable = ns ? Tcl_Namespace_cmdTable(ns) : NULL; + Tcl_HashSearch search; + Var *varPtr; + Tcl_Command cmd; + register Tcl_HashEntry *entryPtr; + char *varName; + + entryPtr = Tcl_FirstHashEntry(varTable, &search); + while (entryPtr != NULL) { + Tcl_Obj *nameObj; + getVarAndNameFromHash(entryPtr, &varPtr, &nameObj); + if (!TclIsVarUndefined(varPtr) || TclIsVarNamespaceVar(varPtr)) { + /* fprintf(stderr, "unsetting var %s\n", ObjStr(nameObj));*/ + Tcl_UnsetVar2(in, ObjStr(nameObj), (char *)NULL, TCL_GLOBAL_ONLY); + } + entryPtr = Tcl_NextHashEntry(&search); + } + + entryPtr = Tcl_FirstHashEntry(cmdTable, &search); + while (entryPtr) { + cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr); + + if (Tcl_Command_objProc(cmd) == RUNTIME_STATE(in)->objInterpProc) { + char *key = Tcl_GetHashKey(cmdTable, entryPtr); + + /*fprintf(stderr, "cmdname = %s cmd %p proc %p objProc %p %d\n", + key,cmd,Tcl_Command_proc(cmd),Tcl_Command_objProc(cmd), + Tcl_Command_proc(cmd)==RUNTIME_STATE(in)->objInterpProc);*/ + + Tcl_DeleteCommandFromToken(in, cmd); + } + entryPtr = Tcl_NextHashEntry(&search); + } +} +#endif + + +#ifdef DO_CLEANUP +static int +ClassHasSubclasses(XOTclClass *cl) { + return (cl->sub != NULL); +} + +static int +ClassHasInstances(XOTclClass *cl) { + Tcl_HashSearch hSrch; + return (Tcl_FirstHashEntry(&cl->instances, &hSrch) != NULL); +} + +static int +ObjectHasChildren(Tcl_Interp *in, XOTclObject *obj) { + Tcl_Namespace *ns = obj->nsPtr; + int result = 0; + + if (ns) { + Tcl_HashEntry *hPtr; + Tcl_HashSearch hSrch; + Tcl_HashTable *cmdTable = Tcl_Namespace_cmdTable(ns); + XOTcl_FrameDecls; + + XOTcl_PushFrame(in, obj); + for (hPtr = Tcl_FirstHashEntry(cmdTable, &hSrch); hPtr; + hPtr = Tcl_NextHashEntry(&hSrch)) { + char *key = Tcl_GetHashKey(cmdTable, hPtr); + if (XOTclpGetObject(in, key)) { + /*fprintf(stderr,"child = %s\n",key);*/ + result = 1; + break; + } + } + XOTcl_PopFrame(in,obj); + } + return result; +} + +static void freeAllXOTclObjectsAndClasses(Tcl_Interp *in, Tcl_HashTable *commandTable) { + Tcl_HashEntry *hPtr, *hDel; + Tcl_HashSearch hSrch; + XOTclObject *obj; + XOTclClass *thecls, *theobj, *cl; + + /* fprintf(stderr,"??? freeAllXOTclObjectsAndClasses in %p\n", in); */ + + thecls = RUNTIME_STATE(in)->theClass; + theobj = RUNTIME_STATE(in)->theObject; + /***** PHYSICAL DESTROY *****/ + RUNTIME_STATE(in)->exitHandlerDestroyRound = XOTCL_EXITHANDLER_ON_PHYSICAL_DESTROY; + while (1) { + int deleted = 0; + hPtr = Tcl_FirstHashEntry(commandTable, &hSrch); + while (hPtr) { + char *key = Tcl_GetHashKey(commandTable, hPtr); + obj = XOTclpGetObject(in, key); + if (obj && !XOTclObjectIsClass(obj) && !ObjectHasChildren(in,obj)) { + /* fprintf(stderr," ... delete object %s %p, class=%s\n",key,obj, + ObjStr(obj->cl->object.cmdName));*/ + freeUnsetTraceVariable(in, obj); + Tcl_DeleteCommandFromToken(in, obj->id); + hDel = hPtr; + deleted++; + } else { + hDel = NULL; + } + hPtr = Tcl_NextHashEntry(&hSrch); + if (hDel) + Tcl_DeleteHashEntry(hDel); + } + /* fprintf(stderr, "deleted %d Objects\n",deleted);*/ + if (deleted>0) + continue; + + + hPtr = Tcl_FirstHashEntry(commandTable, &hSrch); + while (hPtr) { + char *key = Tcl_GetHashKey(commandTable, hPtr); + cl = XOTclpGetClass(in, key); + /* fprintf(stderr,"cl key = %s %p\n", key, cl); */ + if (cl + && !ObjectHasChildren(in, (XOTclObject*)cl) + && !ClassHasInstances(cl) + && !ClassHasSubclasses(cl) + && cl != RUNTIME_STATE(in)->theClass + && cl != RUNTIME_STATE(in)->theObject + ) { + /* fprintf(stderr," ... delete class %s %p\n",key,cl); */ + freeUnsetTraceVariable(in, &cl->object); + Tcl_DeleteCommandFromToken(in, cl->object.id); + hDel = hPtr; + deleted++; + } else { + hDel = NULL; + } + hPtr = Tcl_NextHashEntry(&hSrch); + if (hDel) + Tcl_DeleteHashEntry(hDel); + } + /* fprintf(stderr, "deleted %d Classes\n",deleted);*/ + if (deleted == 0) { + break; + } + } + +#ifdef DO_FULL_CLEANUP + deleteProcsAndVars(in); +#endif + + RUNTIME_STATE(in)->callDestroy = 0; + RemoveSuper(thecls, theobj); + RemoveInstance((XOTclObject*)thecls, thecls); + RemoveInstance((XOTclObject*)theobj, thecls); + + Tcl_DeleteCommandFromToken(in, theobj->object.id); + RUNTIME_STATE(in)->theObject = NULL; + + Tcl_DeleteCommandFromToken(in, thecls->object.id); + RUNTIME_STATE(in)->theClass = NULL; + + XOTcl_DeleteNamespace(in, RUNTIME_STATE(in)->fakeNS); + XOTcl_DeleteNamespace(in, RUNTIME_STATE(in)->XOTclClassesNS); + XOTcl_DeleteNamespace(in, RUNTIME_STATE(in)->XOTclNS); + +} +#endif /* DO_CLEANUP */ + + +/* + * Exit Handler + */ +static void +ExitHandler(ClientData cd) { + Tcl_Interp *in = (Tcl_Interp *) cd; + XOTclObject *obj; + XOTclClass *cl; + int result, flags, i; + Tcl_HashSearch hSrch; + Tcl_HashEntry *hPtr; + Tcl_HashTable objTable, *commandTable = &objTable; + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + + /* + * Don't use exit handler, if the interpreted is destroyed already + * Call to exit handler comes after freeing namespaces, commands, etc. + * e.g. TK calls Tcl_DeleteInterp directly, if Window is killed + */ + + /* + * Ahem ... + * + * Since we *must* be sure that our destroy methods will run + * we must *cheat* (I mean CHEAT) here: we flip the interp + * flag, saying, "hey boy, you're not deleted any more". + * After our handlers are done, we restore the old state... + * All this is needed so we can do an eval in the interp which + * is potentially marked for delete when we start working here. + * + * I know, I know, this is not really elegant. But... I'd need a + * standard way of invoking some code at interpreter delete time + * but JUST BEFORE the actual deletion process starts. Sadly, + * there is no such hook in Tcl as of Tcl8.3.2, that I know of. + * + * So, for the rest of procedure, assume the interp is alive ! + */ + + /*fprintf(stderr,"+++ EXIT handler\n"); */ + flags = Tcl_Interp_flags(in); + Tcl_Interp_flags(in) &= ~DELETED; +#if defined(PROFILE) + XOTclProfilePrintData(in); +#endif + /* + * evaluate user-defined exit handler + */ + result = callMethod((ClientData)RUNTIME_STATE(in)->theObject, in, + XOTclGlobalObjects[XOTE_EXIT_HANDLER], 2, 0, 0); + if (result != TCL_OK) { + fprintf(stderr,"User defined exit handler contains errors!\n" + "Error in line %d: %s\nExecution interrupted.\n", + in->errorLine, ObjStr(Tcl_GetObjResult(in))); + } + /* + * Pop any callstack entry that is still alive (e.g. + * if "exit" is called and we were jumping out of the + * callframe + */ + while (cs->top > cs->content) + CallStackPop(in); + + while (1) { + Tcl_CallFrame *f = Tcl_Interp_framePtr(in); + if (!f) break; + if (Tcl_CallFrame_level(f) == 0) break; + Tcl_PopCallFrame(in); + } + + /* deleting in two rounds: + * (a) SOFT DESTROY: call all user-defined destroys + * (b) PHYSICAL DESTROY: delete the commands, user-defined + * destroys are not executed anymore + * + * this is to prevent user-defined destroys from overriding physical + * destroy during exit handler, but still ensure that all + * user-defined destroys are called. + */ + + Tcl_InitHashTable(commandTable, TCL_STRING_KEYS); + MEM_COUNT_ALLOC("Tcl_InitHashTable",commandTable); + getAllInstances(commandTable, RUNTIME_STATE(in)->theClass); + /***** SOFT DESTROY *****/ + RUNTIME_STATE(in)->exitHandlerDestroyRound = XOTCL_EXITHANDLER_ON_SOFT_DESTROY; + + hPtr = Tcl_FirstHashEntry(commandTable, &hSrch); + while (hPtr) { + char *key = Tcl_GetHashKey(commandTable, hPtr); + obj = XOTclpGetObject(in, key); + /* fprintf(stderr,"key = %s %p %d\n", + key, obj, obj && !XOTclObjectIsClass(obj)); */ + if (obj && !XOTclObjectIsClass(obj) + && !(obj->flags & XOTCL_DESTROY_CALLED)) + callDestroyMethod((ClientData)obj, in, obj, 0); + hPtr = Tcl_NextHashEntry(&hSrch); + } + hPtr = Tcl_FirstHashEntry(commandTable, &hSrch); + while (hPtr) { + char *key = Tcl_GetHashKey(commandTable, hPtr); + cl = XOTclpGetClass(in, key); + if (cl + && !(cl->object.flags & XOTCL_DESTROY_CALLED)) + callDestroyMethod((ClientData)cl, in, (XOTclObject*)cl, 0); + hPtr = Tcl_NextHashEntry(&hSrch); + } +#ifdef DO_CLEANUP + freeAllXOTclObjectsAndClasses(in, commandTable); +#endif + + /* must be before freeing of XOTclGlobalObjects */ + XOTclShadowTclCommands(in, SHADOW_UNLOAD); + /* free global objects */ + for (i = 0; i < nr_elements(XOTclGlobalStrings); i++) { + DECR_REF_COUNT(XOTclGlobalObjects[i]); + } + XOTclStringIncrFree(&RUNTIME_STATE(in)->iss); + FREE(Tcl_Obj**, XOTclGlobalObjects); + FREE(XOTclRuntimeState, RUNTIME_STATE(in)); + + MEM_COUNT_FREE("Tcl_InitHashTable",commandTable); + Tcl_DeleteHashTable(commandTable); + +#if defined(TCL_MEM_DEBUG) + TclDumpMemoryInfo (stderr); + Tcl_DumpActiveMemory ("./xotclActiveMem"); + /* Tcl_GlobalEval(in, "puts {checkmem to checkmemFile}; + checkmem checkmemFile"); */ +#endif + MEM_COUNT_DUMP(); + + Tcl_Interp_flags(in) = flags; + Tcl_Release((ClientData) in); +} + + +#if defined(TCL_THREADS) +/* + * Gets activated at thread-exit + */ +static void +XOTcl_ThreadExitProc(ClientData cd) { + /*fprintf(stderr,"+++ XOTcl_ThreadExitProc\n");*/ +#if !defined(PRE83) + void XOTcl_ExitProc(ClientData cd); + Tcl_DeleteExitHandler(XOTcl_ExitProc, cd); +#endif + ExitHandler(cd); +} +#endif + +/* + * Gets activated at application-exit + */ +void +XOTcl_ExitProc(ClientData cd) { + /*fprintf(stderr,"+++ XOTcl_ExitProc\n");*/ +#if !defined(PRE83) && defined(TCL_THREADS) + Tcl_DeleteThreadExitHandler(XOTcl_ThreadExitProc, cd); +#endif + ExitHandler(cd); +} + + +/* + * Registers thread/appl exit handlers. + */ +static void +RegisterExitHandlers(ClientData cd) { + Tcl_Preserve(cd); +#if !defined(PRE83) && defined(TCL_THREADS) + Tcl_CreateThreadExitHandler(XOTcl_ThreadExitProc, cd); +#endif + Tcl_CreateExitHandler(XOTcl_ExitProc, cd); +} + + + +/* + * Tcl extension initialization routine + */ + +extern int +Xotcl_Init(Tcl_Interp *in) { + XOTclClass *theobj = 0; + XOTclClass *thecls = 0; + XOTclClass *paramCl = 0; + XOTclClass *nonposArgsCl = 0; + ClientData runtimeState; + int result, i; +#ifdef XOTCL_BYTECODE + XOTclCompEnv *instructions = XOTclGetCompEnv(); +#endif + +#ifndef PRE81 +# ifdef USE_TCL_STUBS + if (Tcl_InitStubs(in, "8.1", 0) == NULL) { + return TCL_ERROR; + } +# endif +#endif + +#if defined(TCL_MEM_DEBUG) + TclDumpMemoryInfo(stderr); +#endif + + MEM_COUNT_INIT(); + + /* + fprintf(stderr, "SIZES: obj=%d, tcl_obj=%d, DString=%d, class=%d, namespace=%d, command=%d, HashTable=%d\n", sizeof(XOTclObject), sizeof(Tcl_Obj), sizeof(Tcl_DString), sizeof(XOTclClass), sizeof(Namespace), sizeof(Command), sizeof(Tcl_HashTable)); + */ + +#if FORWARD_COMPATIBLE + { + int major, minor, patchlvl, type; + Tcl_GetVersion(&major, &minor, &patchlvl, &type); + + if ((major == 8) && (minor < 5)) { + /* + * loading a version of xotcl compiled for 8.4 version + * into a 8.4 Tcl + */ + /* + fprintf(stderr, "loading a version of xotcl compiled for 8.4 version into a 8.4 Tcl\n"); + */ + forwardCompatibleMode = 0; + lookupVarFromTable = LookupVarFromTable84; + tclVarHashCreateVar = VarHashCreateVar84; + tclInitVarHashTable = InitVarHashTable84; + tclCleanupVar = TclCleanupVar84; + varRefCountOffset = TclOffset(Var, refCount); + varHashTableSize = sizeof(Tcl_HashTable); + } else { + /* + * loading a version of xotcl compiled for 8.4 version + * into a 8.5 Tcl + */ + /* + fprintf(stderr, "loading a version of xotcl compiled for 8.4 version into a 8.5 Tcl\n"); + */ + forwardCompatibleMode = 1; + lookupVarFromTable = LookupVarFromTable85; + tclVarHashCreateVar = VarHashCreateVar85; + tclInitVarHashTable = (Tcl_InitVarHashTableFunction*)*((&tclIntStubsPtr->reserved0)+235); + tclCleanupVar = (Tcl_CleanupVarFunction*)*((&tclIntStubsPtr->reserved0)+176); + varRefCountOffset = TclOffset(VarInHash, refCount); + varHashTableSize = sizeof(TclVarHashTable85); + } + + } +#endif + + /* + * Runtime State stored in the client data of the Interp's global + * Namespace in order to avoid global state information + */ + runtimeState = (ClientData) NEW(XOTclRuntimeState); +#if USE_ASSOC_DATA + Tcl_SetAssocData(in, "XOTclRuntimeState", NULL, runtimeState); +#else + Tcl_Interp_globalNsPtr(in)->clientData = runtimeState; +#endif + + /* CallStack initialization */ + memset(RUNTIME_STATE(in), 0, sizeof(XOTclRuntimeState)); + memset(RUNTIME_STATE(in)->cs.content, 0, sizeof(XOTclCallStackContent)); + + RUNTIME_STATE(in)->cs.top = RUNTIME_STATE(in)->cs.content; + RUNTIME_STATE(in)->doFilters = 1; + RUNTIME_STATE(in)->callDestroy = 1; + + /* create xotcl namespace */ + RUNTIME_STATE(in)->XOTclNS = + Tcl_CreateNamespace(in, "::xotcl", (ClientData)NULL, (Tcl_NamespaceDeleteProc*)NULL); + + MEM_COUNT_ALLOC("TclNamespace",RUNTIME_STATE(in)->XOTclNS); + + /* + * init an empty, faked proc structure in the RUNTIME state + */ + RUNTIME_STATE(in)->fakeProc.iPtr = (Interp *)in; + RUNTIME_STATE(in)->fakeProc.refCount = 1; + RUNTIME_STATE(in)->fakeProc.cmdPtr = NULL; + RUNTIME_STATE(in)->fakeProc.bodyPtr = NULL; + RUNTIME_STATE(in)->fakeProc.numArgs = 0; + RUNTIME_STATE(in)->fakeProc.numCompiledLocals = 0; + RUNTIME_STATE(in)->fakeProc.firstLocalPtr = NULL; + RUNTIME_STATE(in)->fakeProc.lastLocalPtr = NULL; + RUNTIME_STATE(in)->fakeNS = + Tcl_CreateNamespace(in, "::xotcl::fakeNS", (ClientData)NULL, + (Tcl_NamespaceDeleteProc*)NULL); + MEM_COUNT_ALLOC("TclNamespace",RUNTIME_STATE(in)->fakeNS); + + /* XOTclClasses in separate Namespace / Objects */ + RUNTIME_STATE(in)->XOTclClassesNS = + Tcl_CreateNamespace(in, "::xotcl::classes", (ClientData)NULL, + (Tcl_NamespaceDeleteProc*)NULL); + MEM_COUNT_ALLOC("TclNamespace",RUNTIME_STATE(in)->XOTclClassesNS); + + + /* cache interpreters proc interpretation functions */ + RUNTIME_STATE(in)->objInterpProc = TclGetObjInterpProc(); +#if USE_INTERP_PROC + RUNTIME_STATE(in)->interpProc = TclGetInterpProc(); +#endif + RUNTIME_STATE(in)->exitHandlerDestroyRound = XOTCL_EXITHANDLER_OFF; + + RegisterObjTypes(); + RegisterExitHandlers((ClientData)in); + + XOTclStringIncrInit(&RUNTIME_STATE(in)->iss); + + /* initialize global Tcl_Obj*/ + XOTclGlobalObjects = NEW_ARRAY(Tcl_Obj*,nr_elements(XOTclGlobalStrings)); + + for (i = 0; i < nr_elements(XOTclGlobalStrings); i++) { + XOTclGlobalObjects[i] = Tcl_NewStringObj(XOTclGlobalStrings[i],-1); + INCR_REF_COUNT(XOTclGlobalObjects[i]); + } + + /* create Object and Class, and store them in the RUNTIME STATE */ + theobj = PrimitiveCCreate(in, "::xotcl::Object", 0); + RUNTIME_STATE(in)->theObject = theobj; + if (!theobj) panic("Cannot create ::xotcl::Object",0); + + thecls = PrimitiveCCreate(in, "::xotcl::Class", 0); + RUNTIME_STATE(in)->theClass = thecls; + if (!thecls) panic("Cannot create ::xotcl::Class",0); + + theobj->parent = 0; + thecls->parent = theobj; + + Tcl_Export(in, RUNTIME_STATE(in)->XOTclNS, "Object", 0); + Tcl_Export(in, RUNTIME_STATE(in)->XOTclNS, "Class", 0); + /*Tcl_AddInterpResolvers(in, "XOTcl", XOTclResolveCmd, 0, 0);*/ + +#if defined(PROFILE) + XOTclProfileInit(in); +#endif + + /* test Object and Class creation */ + if (!theobj || !thecls) { + RUNTIME_STATE(in)->callDestroy = 0; + + if (thecls) PrimitiveCDestroy((ClientData) thecls); + if (theobj) PrimitiveCDestroy((ClientData) theobj); + + for (i = 0; i < nr_elements(XOTclGlobalStrings); i++) { + DECR_REF_COUNT(XOTclGlobalObjects[i]); + } + FREE(Tcl_Obj**, XOTclGlobalObjects); + FREE(XOTclRuntimeState, RUNTIME_STATE(in)); + + return XOTclErrMsg(in, "Object/Class failed", TCL_STATIC); + } + + AddInstance((XOTclObject*)theobj, thecls); + AddInstance((XOTclObject*)thecls, thecls); + AddSuper(thecls, theobj); + { + typedef struct methodDefinition { + char *methodName; + Tcl_ObjCmdProc *proc; + } methodDefinition; + methodDefinition objInstcmds[] = { + {"autoname", XOTclOAutonameMethod}, + {"check", XOTclOCheckMethod}, + {"cleanup", XOTclOCleanupMethod}, + {"configure", XOTclOConfigureMethod}, + {"destroy", XOTclODestroyMethod}, + {"exists", XOTclOExistsMethod}, + {"filterguard", XOTclOFilterGuardMethod}, + {"filtersearch", XOTclOFilterSearchMethod}, + {"info", XOTclOInfoMethod}, + {"instvar", XOTclOInstVarMethod}, + {"invar", XOTclOInvariantsMethod}, + {"isclass", XOTclOIsClassMethod}, + {"ismetaclass", XOTclOIsMetaClassMethod}, + {"isobject", XOTclOIsObjectMethod}, + {"istype", XOTclOIsTypeMethod}, + {"ismixin", XOTclOIsMixinMethod}, +#ifdef XOTCL_METADATA + {"metadata", XOTclOMetaDataMethod}, +#endif + {"mixinguard", XOTclOMixinGuardMethod}, + {"__next", XOTclONextMethod}, + /* {"next", XOTclONextMethod2},*/ + {"noinit", XOTclONoinitMethod}, + {"parametercmd", XOTclCParameterCmdMethod}, + { "proc", XOTclOProcMethod}, + {"procsearch", XOTclOProcSearchMethod}, + {"requireNamespace", XOTclORequireNamespaceMethod}, + {"set", XOTclOSetMethod}, /***??**/ + {"forward", XOTclOForwardMethod}, + {"uplevel", XOTclOUplevelMethod}, + {"upvar", XOTclOUpvarMethod}, + {"volatile", XOTclOVolatileMethod}, + {"vwait", XOTclOVwaitMethod} + }; + methodDefinition classInstcmds[] = { + {"autoname", XOTclOAutonameMethod}, + {"alloc", XOTclCAllocMethod}, + {"create", XOTclCCreateMethod}, + {"new", XOTclCNewMethod}, + {"info", XOTclCInfoMethod}, + {"instdestroy", XOTclCInstDestroyMethod}, + {"instfilterguard", XOTclCInstFilterGuardMethod}, + {"instinvar", XOTclCInvariantsMethod}, + {"instmixinguard", XOTclCInstMixinGuardMethod}, + {"instparametercmd", XOTclCInstParameterCmdMethod}, + {"instproc", XOTclCInstProcMethod}, + {"instforward", XOTclCInstForwardMethod}, + {"parameter", XOTclCParameterMethod}, + {"parameterclass", XOTclCParameterClassMethod}, + {"recreate", XOTclCRecreateMethod}, + {"unknown", XOTclCUnknownMethod} + }; + + int namespacelength; + Tcl_DString ds, *dsPtr = &ds; + + DSTRING_INIT(dsPtr); + Tcl_DStringAppend(dsPtr,"::xotcl::Object::instcmd", -1); + Tcl_CreateNamespace(in, Tcl_DStringValue(dsPtr), 0, (Tcl_NamespaceDeleteProc*)NULL); + Tcl_DStringAppend(dsPtr,"::", 2); + namespacelength = Tcl_DStringLength(dsPtr); + + for (i = 0; i < nr_elements(objInstcmds); i++) { + Tcl_DStringAppend(dsPtr, objInstcmds[i].methodName, -1); + Tcl_CreateObjCommand(in, Tcl_DStringValue(dsPtr), objInstcmds[i].proc, 0, 0); + Tcl_DStringSetLength(dsPtr, namespacelength); + } + Tcl_DStringSetLength(dsPtr, 0); + Tcl_DStringAppend(dsPtr,"::xotcl::Class::instcmd", -1); + Tcl_CreateNamespace(in, Tcl_DStringValue(dsPtr), 0, (Tcl_NamespaceDeleteProc*)NULL); + Tcl_DStringAppend(dsPtr,"::", 2); + namespacelength = Tcl_DStringLength(dsPtr); + + for (i = 0; i < nr_elements(classInstcmds); i++) { + Tcl_DStringAppend(dsPtr, classInstcmds[i].methodName, -1); + Tcl_CreateObjCommand(in, Tcl_DStringValue(dsPtr), classInstcmds[i].proc, 0, 0); + Tcl_DStringSetLength(dsPtr, namespacelength); + } + + DSTRING_FREE(dsPtr); + } + + /* + * overwritten tcl objs + */ + result = XOTclShadowTclCommands(in, SHADOW_LOAD); + if (result != TCL_OK) + return result; + + /* + * new tcl cmds + */ +#ifdef XOTCL_BYTECODE + instructions[INST_SELF_DISPATCH].cmdPtr = (Command *) +#endif + Tcl_CreateObjCommand(in, "::xotcl::my", XOTclSelfDispatchCmd, 0, 0); +#ifdef XOTCL_BYTECODE + instructions[INST_NEXT].cmdPtr = (Command *) +#endif + Tcl_CreateObjCommand(in, "::xotcl::next", XOTclNextObjCmd, 0, 0); +#ifdef XOTCL_BYTECODE + instructions[INST_SELF].cmdPtr = (Command *) +#endif + Tcl_CreateObjCommand(in, "::xotcl::self", XOTclGetSelfObjCmd, 0, 0); + /*Tcl_CreateObjCommand(in, "::xotcl::K", XOTclKObjCmd, 0, 0);*/ + + Tcl_CreateObjCommand(in, "::xotcl::alias", XOTclAliasCommand, 0, 0); + Tcl_CreateObjCommand(in, "::xotcl::configure", XOTclConfigureCommand, 0, 0); + Tcl_CreateObjCommand(in, "::xotcl::deprecated", XOTcl_DeprecatedCmd, 0, 0); +#ifdef XOTCL_BYTECODE + instructions[INST_INITPROC].cmdPtr = (Command *) +#endif + Tcl_CreateObjCommand(in, "::xotcl::initProcNS", XOTclInitProcNSCmd, 0, 0); + Tcl_CreateObjCommand(in, "::xotcl::interpretNonpositionalArgs", + XOTclInterpretNonpositionalArgsCmd, 0, 0); + Tcl_CreateObjCommand(in, "::xotcl::interp", XOTcl_InterpObjCmd, 0, 0); + Tcl_CreateObjCommand(in, "::xotcl::namespace_copyvars", XOTcl_NSCopyVars, 0, 0); + Tcl_CreateObjCommand(in, "::xotcl::namespace_copycmds", XOTcl_NSCopyCmds, 0, 0); + Tcl_CreateObjCommand(in, "::xotcl::__qualify", XOTclQualifyObjCmd, 0,0); + Tcl_CreateObjCommand(in, "::xotcl::setinstvar", XOTclSetInstvarCommand, 0, 0); + Tcl_CreateObjCommand(in, "::xotcl::setrelation", XOTclSetRelationCommand, 0, 0); + Tcl_CreateObjCommand(in, "::xotcl::trace", XOTcl_TraceObjCmd, 0, 0); + + Tcl_Export(in, RUNTIME_STATE(in)->XOTclNS, "self", 0); + Tcl_Export(in, RUNTIME_STATE(in)->XOTclNS, "next", 0); + Tcl_Export(in, RUNTIME_STATE(in)->XOTclNS, "my", 0); + +#ifdef XOTCL_BYTECODE + XOTclBytecodeInit(); +#endif + + /* + * Non-Positional Args Object + */ + + nonposArgsCl = PrimitiveCCreate(in, + XOTclGlobalStrings[XOTE_NON_POS_ARGS_CL], + thecls); + XOTclAddIMethod(in, (XOTcl_Class*) nonposArgsCl, + "required", + (Tcl_ObjCmdProc*) XOTclCheckRequiredArgs, 0, 0); + XOTclAddIMethod(in, (XOTcl_Class*) nonposArgsCl, + "switch", + (Tcl_ObjCmdProc*) XOTclCheckBooleanArgs, 0, 0); + XOTclAddIMethod(in, (XOTcl_Class*) nonposArgsCl, + "boolean", + (Tcl_ObjCmdProc*) XOTclCheckBooleanArgs, 0, 0); + PrimitiveOCreate(in, XOTclGlobalStrings[XOTE_NON_POS_ARGS_OBJ], + nonposArgsCl); + + /* + * Parameter Class + */ + { + XOTclObject *paramObject; + paramCl = PrimitiveCCreate(in, XOTclGlobalStrings[XOTE_PARAM_CL], thecls); + paramObject = ¶mCl->object; + XOTclAddPMethod(in, (XOTcl_Object*) paramObject, + XOTclGlobalStrings[XOTE_SEARCH_DEFAULTS], + (Tcl_ObjCmdProc*) ParameterSearchDefaultsMethod, 0, 0); + } + + /* + * set runtime version information in Tcl variable + */ + Tcl_SetVar(in, "::xotcl::version", XOTCLVERSION, TCL_GLOBAL_ONLY); + Tcl_SetVar(in, "::xotcl::patchlevel", XOTCLPATCHLEVEL, TCL_GLOBAL_ONLY); + + /* + * with some methods and library procs in tcl - they could go in a + * xotcl.tcl file, but they're embedded here with Tcl_GlobalEval + * to avoid the need to carry around a separate file at runtime. + */ + { + +#include "predefined.h" + + /* fprintf(stderr, "predefined=<<%s>>\n",cmd);*/ + if (Tcl_GlobalEval(in, cmd) != TCL_OK) + return TCL_ERROR; + } + +#ifndef AOL_SERVER + /* the AOL server uses a different package loading mechanism */ +# ifdef COMPILE_XOTCL_STUBS + Tcl_PkgProvideEx(in, "XOTcl", PACKAGE_VERSION, (ClientData) &xotclStubs); +# else + Tcl_PkgProvide(in, "XOTcl", PACKAGE_VERSION); +# endif +#endif + +#if !defined(TCL_THREADS) && !defined(PRE81) + if ((Tcl_GetVar2(in, "tcl_platform", "threaded", TCL_GLOBAL_ONLY) != NULL)) { + /* a non threaded XOTcl version is loaded into a threaded environment */ + fprintf(stderr, "\n A non threaded XOTCL version is loaded into threaded environment\n Please reconfigure XOTcl with --enable-threads!\n\n\n"); + } +#endif + + Tcl_ResetResult(in); + Tcl_SetIntObj(Tcl_GetObjResult(in), 1); + + return TCL_OK; +} + + +extern int +Xotcl_SafeInit(Tcl_Interp *interp) { + /*** dummy for now **/ + return Xotcl_Init(interp); +} + Index: generic/xotcl.decls =================================================================== diff -u -N --- generic/xotcl.decls (revision 0) +++ generic/xotcl.decls (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,162 @@ +# xotcl.decls -- +# +# This file contains the declarations for all supported public +# functions that are exported by the XOTcl library via the stubs table. +# This file is used to generate the xotclDecls.h, xotclPlatDecls.h, +# xotclStub.c, and xotclPlatStub.c files. +# +# +# Copyright (c) 1998-1999 by Scriptics Corporation. +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# RCS: $Id: xotcl.decls,v 1.4 2006/09/27 08:12:40 neumann Exp $ + +library xotcl + +interface xotcl +hooks {xotclInt} + +# Declare each of the functions in the public Tcl interface. Note that +# the an index should never be reused for a different function in order +# to preserve backwards compatibility. + +declare 0 generic { + int Xotcl_Init(Tcl_Interp *interp) +} +# 1 is reserved for safe init +#declare 1 generic { +# int Xotcl_SafeInit(Tcl_Interp *interp) +#} +declare 2 generic { + struct XOTcl_Class* XOTclIsClass(Tcl_Interp* in, ClientData cd) +} +#declare 3 generic { +# +#} +declare 4 generic { + struct XOTcl_Object* XOTclGetObject(Tcl_Interp* in, char* name) +} +declare 5 generic { + struct XOTcl_Class* XOTclGetClass(Tcl_Interp* in, char* name) +} +declare 6 generic { + int XOTclCreateObject(Tcl_Interp* in, Tcl_Obj* name, struct XOTcl_Class* cl) +} +#declare 7 generic { +# +#} +declare 8 generic { + int XOTclCreateClass(Tcl_Interp* in, Tcl_Obj* name, struct XOTcl_Class* cl) +} +declare 9 generic { + int XOTclDeleteObject(Tcl_Interp* in, struct XOTcl_Object* obj) +} +declare 10 generic { + int XOTclDeleteClass(Tcl_Interp* in, struct XOTcl_Class* cl) +} +declare 11 generic { + void XOTclAddPMethod(Tcl_Interp* in, struct XOTcl_Object* obj, + char* nm, Tcl_ObjCmdProc* proc, + ClientData cd, Tcl_CmdDeleteProc* dp) +} +declare 12 generic { + void XOTclAddIMethod(Tcl_Interp* in, struct XOTcl_Class* cl, + char* nm, Tcl_ObjCmdProc* proc, + ClientData cd, Tcl_CmdDeleteProc* dp) +} +declare 13 generic { + void XOTclRemovePMethod(Tcl_Interp* in,struct XOTcl_Object* obj, char* nm) +} +declare 14 generic { + void XOTclRemoveIMethod(Tcl_Interp* in, struct XOTcl_Class* cl, char* nm) +} +declare 15 generic { + Tcl_Obj* XOTclOSetInstVar(struct XOTcl_Object* obj, Tcl_Interp* in, + Tcl_Obj* name, Tcl_Obj* value, int flgs) +} +declare 16 generic { + Tcl_Obj* XOTclOGetInstVar(struct XOTcl_Object* obj, Tcl_Interp* in, + Tcl_Obj* name, int flgs) +} +declare 17 generic { + int XOTclInstVar(struct XOTcl_Object* obj, Tcl_Interp* in, + char* name, char* destName) +} +#declare 18 generic { +# +#} +declare 19 generic { + Tcl_Obj* XOTclOSetInstVar2(struct XOTcl_Object* obj, + Tcl_Interp* in,Tcl_Obj* name1,Tcl_Obj* name2, + Tcl_Obj* value,int flgs) +} +declare 20 generic { + Tcl_Obj* XOTclOGetInstVar2(struct XOTcl_Object* obj, + Tcl_Interp* in,Tcl_Obj* name1,Tcl_Obj* name2, + int flgs) +} +declare 21 generic { + int XOTclUnsetInstVar2(struct XOTcl_Object* obj, Tcl_Interp* in, + char* name1, char* name2, + int flgs) +} +declare 22 generic { + int XOTcl_TraceObjCmd(ClientData cd, Tcl_Interp *in, + int objc, Tcl_Obj *CONST objv[]) +} +declare 23 generic { + int XOTclErrMsg(Tcl_Interp* in, char* msg, Tcl_FreeProc* type) +} +declare 24 generic { + int XOTclVarErrMsg(Tcl_Interp * in, ...) +} +declare 25 generic { + int XOTclErrInProc (Tcl_Interp *in, Tcl_Obj* objName, + Tcl_Obj* clName, char* procName) +} +declare 26 generic { + int XOTclObjErrArgCnt(Tcl_Interp *in, Tcl_Obj *cmdname, char *arglist) +} +declare 27 generic { + int XOTclErrBadVal_(Tcl_Interp *in, char *expected, char *value) +} +declare 28 generic { + int XOTclObjErrType(Tcl_Interp *in, Tcl_Obj *nm, char* wt) +} +declare 29 generic { + void XOTclStackDump (Tcl_Interp* in) +} +declare 30 generic { + void XOTclCallStackDump (Tcl_Interp* in) +} +declare 31 generic { + void XOTclDeprecatedMsg(char* oldCmd, char* newCmd) +} +declare 32 generic { + void XOTclSetObjClientData(XOTcl_Object* obj, ClientData data) +} +declare 33 generic { + ClientData XOTclGetObjClientData(XOTcl_Object* obj) +} +declare 34 generic { + void XOTclSetClassClientData(XOTcl_Class* cl, ClientData data) +} +declare 35 generic { + ClientData XOTclGetClassClientData(XOTcl_Class* cl) +} +declare 36 generic { + void XOTclRequireObjNamespace(Tcl_Interp* in, XOTcl_Object* obj) +} +declare 37 generic { + int XOTclErrBadVal(Tcl_Interp *in, char *context, char *expected, char *value) +} +declare 38 generic { + int XOTclNextObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) +} +declare 39 generic { + int XOTclCallMethodWithArgs(ClientData cd, Tcl_Interp *in, + Tcl_Obj *method, Tcl_Obj *arg, + int objc, Tcl_Obj *CONST objv[], int flags) +} + Index: generic/xotcl.h =================================================================== diff -u -N --- generic/xotcl.h (revision 0) +++ generic/xotcl.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,207 @@ +/* -*- Mode: c++ -*- + * + * $Id: xotcl.h,v 1.13 2007/09/18 19:27:33 neumann Exp $ + * + * Extended Object Tcl (XOTcl) + * + * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation, and that the name of + * M.I.T. not be used in advertising or publicity pertaining to + * distribution of the software without specific, written prior + * permission. M.I.T. makes no representations about the suitability + * of this software for any purpose. It is provided "as is" without + * express or implied warranty. + * */ + +#ifndef _xotcl_h_ +#define _xotcl_h_ + +#include "tcl.h" + +#undef TCL_STORAGE_CLASS +#ifdef BUILD_xotcl +# define TCL_STORAGE_CLASS DLLEXPORT +#else +# ifdef USE_XOTCL_STUBS +# define TCL_STORAGE_CLASS +# else +# define TCL_STORAGE_CLASS DLLIMPORT +# endif +#endif + +/* use documented interface to link XOTcl state to an interpreter */ +#define USE_ASSOC_DATA 1 + +/* new namespace support (post 1.2.0 */ +#define NAMESPACEINSTPROCS 1 + +/* activate bytecode support +#define XOTCL_BYTECODE +*/ + +#define KEEP_TCL_CMD_TYPE 1 + +/* activate/deacticate assert +#define NDEBUG 1 +*/ +#define NDEBUG 1 + + +/* activate/deacticate memory tracing +#define XOTCL_MEM_TRACE 1 +#define XOTCL_MEM_COUNT 1 +*/ +/*#define REFCOUNTED 1*/ + +/* +#define XOTCLOBJ_TRACE 1 +#define REFCOUNT_TRACE 1 +#define DISPATCH_TRACE 1 +*/ + +/* activate/deacticate profiling information at the end + of running the program +#define PROFILE +*/ + +/* make self, proc and class in instproc and procs +#define AUTOVARS +*/ + +/* turn tracing output on/off +#define CALLSTACK_TRACE 1 +#define DISPATCH_TRACE 1 +#define NAMESPACE_TRACE 1 +#define OBJDELETION_TRACE 1 +#define STACK_TRACE 1 +*/ + +#ifdef XOTCL_MEM_COUNT +# define DO_FULL_CLEANUP 1 +#endif + +#ifdef AOL_SERVER +# ifndef TCL_THREADS +# define TCL_THREADS +# endif +#endif + +#ifdef TCL_THREADS +# define DO_CLEANUP +#endif + +#ifdef DO_FULL_CLEANUP +# define DO_CLEANUP +#endif + +/* + * prevent old TCL-versions + */ + +#if TCL_MAJOR_VERSION < 8 +# error Tcl distribution is TOO OLD, we require at least tcl8.0 +#endif + +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<1 +# define PRE81 +#else +# if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION==1 +# define V81 +# endif +#endif +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<2 +# define PRE82 +#endif +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<3 +# define PRE83 +#endif +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<4 +# define PRE84 +#endif +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<5 +# define PRE85 +#endif + +#if !defined(FORWARD_COMPATIBLE) +# if defined(PRE85) +# define FORWARD_COMPATIBLE 1 +# else +# define FORWARD_COMPATIBLE 0 +# endif +#endif + +#define XOTCL_NONLEAF_METHOD (ClientData)0x01 + +/* + * A special definition used to allow this header file to be included + * in resource files so that they can get obtain version information from + * this file. Resource compilers don't like all the C stuff, like typedefs + * and procedure declarations, that occur below. + */ + +#ifndef RC_INVOKED + +/* +#ifdef __cplusplus +extern "C" { +#endif +*/ + + +/* + * The structures XOTcl_Object and XOTcl_Class define mostly opaque + * data structures for the internal use strucures XOTclObject and + * XOTclClass (both defined in XOTclInt.h). Modification of elements + * visible elements must be mirrored in both incarnations. + */ + +typedef struct XOTcl_Object { + Tcl_Obj *cmdName; +} XOTcl_Object; + +typedef struct XOTcl_Class { + struct XOTcl_Object object; +} XOTcl_Class; + + +/* + * Include the public function declarations that are accessible via + * the stubs table. + */ +#include "xotclDecls.h" + +/* + * Xotcl_InitStubs is used by extensions that can be linked + * against the xotcl stubs library. If we are not using stubs + * then this reduces to package require. + */ + +#ifdef USE_XOTCL_STUBS + +# ifdef __cplusplus +extern "C" +# endif +CONST char * +Xotcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, CONST char *version, int exact)); +#else +# define Xotcl_InitStubs(interp, version, exact) \ + Tcl_PkgRequire(interp, "XOTcl", version, exact) +#endif + +#endif /* RC_INVOKED */ + +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLIMPORT + +#endif /* _xotcl_h_ */ Index: generic/xotclAccessInt.h =================================================================== diff -u -N --- generic/xotclAccessInt.h (revision 0) +++ generic/xotclAccessInt.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,65 @@ +#define Tcl_Interp_numLevels(in) ((Interp *)in)->numLevels +#define Tcl_Interp_framePtr(in) ((Tcl_CallFrame *)((Interp *)in)->framePtr) +#define Tcl_Interp_varFramePtr(in) (((Interp *)in)->varFramePtr) +#define Tcl_Interp_globalNsPtr(in) ((Tcl_Namespace *)((Interp *)in)->globalNsPtr) +#define Tcl_Interp_flags(in) ((Interp *)in)->flags +#if DISPATCH_TRACE +#define Tcl_Interp_returnCode(in) ((Interp *)in)->returnCode +#endif +#define Tcl_Interp_threadId(in) ((Interp *)in)->threadId + +#define Tcl_CallFrame_callerPtr(cf) ((Tcl_CallFrame*)((CallFrame *)cf)->callerPtr) +#define Tcl_CallFrame_procPtr(cf) ((CallFrame *)cf)->procPtr +#define Tcl_CallFrame_varTablePtr(cf) ((CallFrame *)cf)->varTablePtr +#define Tcl_CallFrame_level(cf) ((CallFrame *)cf)->level +#define Tcl_CallFrame_isProcCallFrame(cf) ((CallFrame *)cf)->isProcCallFrame +#define Tcl_CallFrame_compiledLocals(cf) ((CallFrame *)cf)->compiledLocals +#define Tcl_CallFrame_callerVarPtr(cf) ((Tcl_CallFrame*)((CallFrame *)cf)->callerVarPtr) +#define Tcl_CallFrame_objc(cf) ((CallFrame *)cf)->objc +#define Tcl_CallFrame_objv(cf) ((CallFrame *)cf)->objv + +#define Tcl_Namespace_cmdTable(nsPtr) &((Namespace *)nsPtr)->cmdTable +#define Tcl_Namespace_varTable(nsPtr) &((Namespace *)nsPtr)->varTable +#define Tcl_Namespace_childTable(nsPtr) &((Namespace *)nsPtr)->childTable +#define Tcl_Namespace_activationCount(nsPtr) ((Namespace *)nsPtr)->activationCount +#define Tcl_Namespace_deleteProc(nsPtr) ((Namespace *)nsPtr)->deleteProc + + + +#define Tcl_Command_refCount(cmd) ((Command *)cmd)->refCount +#define Tcl_Command_cmdEpoch(cmd) ((Command *)cmd)->cmdEpoch +/* the following items could be obtained from + Tcl_GetCommandInfoFromToken(cmd, infoPtr) */ +#define Tcl_Command_nsPtr(cmd) ((Tcl_Namespace*)(((Command *)cmd)->nsPtr)) +#define Tcl_Command_objProc(cmd) ((Command *)cmd)->objProc +#define Tcl_Command_objClientData(cmd) ((Command *)cmd)->objClientData +#define Tcl_Command_proc(cmd) ((Command *)cmd)->proc +#define Tcl_Command_clientData(cmd) ((Command *)cmd)->clientData +#define Tcl_Command_deleteProc(cmd) ((Command *)cmd)->deleteProc + +/* + * Conversion from CmdPtr to Class / Object + */ + +static XOTCLINLINE ClientData +XOTclGetCDFromCmdPtr(Tcl_Command cmd) { + assert(cmd); + if (Tcl_Command_objProc(cmd) == XOTclObjDispatch && !Tcl_Command_cmdEpoch(cmd)) + return Tcl_Command_objClientData(cmd); + else + return NULL; +} + +static XOTCLINLINE XOTclClass* +XOTclGetClassFromCmdPtr(Tcl_Command cmd) { + ClientData cd = XOTclGetCDFromCmdPtr(cmd); + if (cd) + return XOTclObjectToClass(cd); + else + return 0; +} + +static XOTCLINLINE XOTclObject* +XOTclGetObjectFromCmdPtr(Tcl_Command cmd) { + return (XOTclObject*) XOTclGetCDFromCmdPtr(cmd); +} Index: generic/xotclAppInit.c =================================================================== diff -u -N --- generic/xotclAppInit.c (revision 0) +++ generic/xotclAppInit.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,151 @@ +/* + * tclAppInit.c -- + * + * Provides a default version of the main program and Tcl_AppInit + * procedure for Tcl applications (without Tk). + * + * Copyright (c) 1993 The Regents of the University of California. + * Copyright (c) 1994-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: @(#) tclAppInit.c 1.20 97/03/24 14:29:43 + */ + +/* include tclInt.h for access to namespace API */ +#include "tclInt.h" + +#include "xotcl.h" + +#if defined(VISUAL_CC) +# include +# include +#endif +#include + +#if TCL_MAJOR_VERSION < 7 + #error Tcl distribution TOO OLD +#endif + +/* + * The following variable is a special hack that is needed in order for + * Sun shared libraries to be used for Tcl. + */ + +#ifdef NEED_MATHERR +extern int matherr(); +int *tclDummyMathPtr = (int *) matherr; +#endif + +/* + *---------------------------------------------------------------------- + * + * main -- + * + * This is the main program for the application. + * + * Results: + * None: Tcl_Main never returns here, so this procedure never + * returns either. + * + * Side effects: + * Whatever the application does. + * + *---------------------------------------------------------------------- + */ + +#if TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION < 4 + +extern int main(); +int *tclDummyMainPtr = (int *) main; + +#else + +int +main(argc, argv) + int argc; /* Number of command-line arguments. */ + char **argv; /* Values of command-line arguments. */ +{ +#if defined(VISUAL_CC) + setlocale(LC_ALL, "C"); +#endif + Tcl_Main(argc, argv, Tcl_AppInit); + return 0; /* Needed only to prevent compiler warning. */ +} + +#endif + + +/* + *---------------------------------------------------------------------- + * + * 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; + } + + /* + * 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 (Xotcl_Init(interp) == TCL_ERROR) { + return TCL_ERROR; + } + + Tcl_StaticPackage(interp, "XOTcl", Xotcl_Init, 0); + */ + + if (Tcl_PkgRequire(interp, "XOTcl", XOTCLVERSION, 1) == NULL) { + return TCL_ERROR; + } + + /* + * This is xotclsh, so import all xotcl commands by + * default into the global namespace. + */ + + if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), + "::xotcl::*", /* allowOverwrite */ 1) != 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", "~/.tclshrc", TCL_GLOBAL_ONLY); + return TCL_OK; +} Index: generic/xotclCompile.c =================================================================== diff -u -N --- generic/xotclCompile.c (revision 0) +++ generic/xotclCompile.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,144 @@ +#include "xotclInt.h" + +#ifdef XOTCL_BYTECODE +#include + +static CompileProc + initProcNsCompile, nextCompile, + selfCompile, selfDispatchCompile; + +static InstructionDesc instructionTable[] = { + {"initProc", 1, 0, {OPERAND_NONE}}, + {"next", 1, 0, {OPERAND_NONE}}, + {"self", 1, 0, {OPERAND_NONE}}, + {"dispatch", 2, 1, {OPERAND_UINT1}}, +}; + +static XOTclCompEnv instructions[] = { + {0, 0, initProcNsCompile, XOTclInitProcNSCmd}, + {0, 0, nextCompile, XOTclNextObjCmd}, + {0, 0, selfCompile, XOTclGetSelfObjCmd}, + {0, 0, selfDispatchCompile, /*XOTclSelfDispatchCmd*/XOTclDirectSelfDispatch}, + 0 +}; + +XOTclCompEnv * +XOTclGetCompEnv() { + return &instructions[0]; +} + + +static int +initProcNsCompile(Tcl_Interp *interp, Tcl_Parse *parsePtr, + CompileEnv *envPtr) { + + if (parsePtr->numWords != 1) { + Tcl_ResetResult(interp); + Tcl_AppendToObj(Tcl_GetObjResult(interp), + "wrong # args: should be '::xotcl::initProcNS'", -1); + envPtr->maxStackDepth = 0; + return TCL_ERROR; + } + + TclEmitOpcode(instructions[INST_INITPROC].bytecode, envPtr); + envPtr->maxStackDepth = 0; + + return TCL_OK; +} + +static int +nextCompile(Tcl_Interp *interp, Tcl_Parse *parsePtr, + CompileEnv *envPtr) { + + if (parsePtr->numWords != 1) + return TCL_OUT_LINE_COMPILE; + + TclEmitOpcode(instructions[INST_NEXT].bytecode, envPtr); + envPtr->maxStackDepth = 0; + + return TCL_OK; +} +static int +selfCompile(Tcl_Interp *interp, Tcl_Parse *parsePtr, + CompileEnv *envPtr) { + + if (parsePtr->numWords != 1) + return TCL_OUT_LINE_COMPILE; + + TclEmitOpcode(instructions[INST_SELF].bytecode, envPtr); + envPtr->maxStackDepth = 0; + + return TCL_OK; +} +static int +selfDispatchCompile(Tcl_Interp *interp, Tcl_Parse *parsePtr, + CompileEnv *envPtr) { + + Tcl_Token *tokenPtr; + int code, wordIdx; + /* + fprintf(stderr, "****** selfDispatchCompile words=%d tokens=%d, avail=%d\n", + parsePtr->numWords,parsePtr->numTokens,parsePtr->tokensAvailable); + */ + + if (parsePtr->numWords > 255) + return TCL_OUT_LINE_COMPILE; + + /*TclEmitOpcode(instructions[INST_SELF].bytecode, envPtr);*/ + + for (wordIdx=0, tokenPtr = parsePtr->tokenPtr + 0; + wordIdx < parsePtr->numWords; + wordIdx++, tokenPtr += (tokenPtr->numComponents + 1)) { + + /* + fprintf(stderr," %d: %p token type=%d size=%d\n", + wordIdx,tokenPtr,tokenPtr->type,tokenPtr->size ); + */ + if (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD) { + TclEmitPush(TclRegisterLiteral(envPtr, tokenPtr->start, + tokenPtr->size, 0), envPtr); + envPtr->maxStackDepth = 1; + /* + fprintf(stderr," %d: simple '%s' components=%d\n", + wordIdx,tokenPtr->start, tokenPtr->numComponents); + */ + } else { + /* + fprintf(stderr," %d NOT simple '%s' components=%d\n", + wordIdx,tokenPtr->start, tokenPtr->numComponents); + */ + code = TclCompileTokens(interp, tokenPtr+1, + tokenPtr->numComponents, envPtr); + if (code != TCL_OK) { + return code; + } + } + } + + /*fprintf(stderr, "maxdepth=%d, onStack=%d\n",envPtr->maxStackDepth,wordIdx); + */ + TclEmitInstInt1(instructions[INST_SELF_DISPATCH].bytecode, wordIdx, envPtr); + envPtr->maxStackDepth = 0; + + return TCL_OK; +} + + + +void +XOTclBytecodeInit() { + int i; + for(i=0; iobjClientData))) { + instructions[i].cmdPtr->compileProc = instructions[i].compileProc; + } + + } + /*tclTraceCompile = 2;*/ + +} + +#endif Index: generic/xotclDecls.h =================================================================== diff -u -N --- generic/xotclDecls.h (revision 0) +++ generic/xotclDecls.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,369 @@ +/* + * xotclDecls.h -- + * + * Declarations of functions in the platform independent public XOTcl 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. + * + */ + +#ifndef _XOTCLDECLS +#define _XOTCLDECLS + +/* + * WARNING: This file is automatically generated by the tools/genStubs.tcl + * script. Any modifications to the function declarations below should be made + * in the xotcl.decls script. + */ + +/* !BEGIN!: Do not edit below this line. */ + +/* + * Exported function declarations: + */ + +/* 0 */ +EXTERN int Xotcl_Init _ANSI_ARGS_((Tcl_Interp * interp)); +/* Slot 1 is reserved */ +/* 2 */ +EXTERN struct XOTcl_Class* XOTclIsClass _ANSI_ARGS_((Tcl_Interp* in, + ClientData cd)); +/* Slot 3 is reserved */ +/* 4 */ +EXTERN struct XOTcl_Object* XOTclGetObject _ANSI_ARGS_((Tcl_Interp* in, + char* name)); +/* 5 */ +EXTERN struct XOTcl_Class* XOTclGetClass _ANSI_ARGS_((Tcl_Interp* in, + char* name)); +/* 6 */ +EXTERN int XOTclCreateObject _ANSI_ARGS_((Tcl_Interp* in, + Tcl_Obj* name, struct XOTcl_Class* cl)); +/* Slot 7 is reserved */ +/* 8 */ +EXTERN int XOTclCreateClass _ANSI_ARGS_((Tcl_Interp* in, + Tcl_Obj* name, struct XOTcl_Class* cl)); +/* 9 */ +EXTERN int XOTclDeleteObject _ANSI_ARGS_((Tcl_Interp* in, + struct XOTcl_Object* obj)); +/* 10 */ +EXTERN int XOTclDeleteClass _ANSI_ARGS_((Tcl_Interp* in, + struct XOTcl_Class* cl)); +/* 11 */ +EXTERN void XOTclAddPMethod _ANSI_ARGS_((Tcl_Interp* in, + struct XOTcl_Object* obj, char* nm, + Tcl_ObjCmdProc* proc, ClientData cd, + Tcl_CmdDeleteProc* dp)); +/* 12 */ +EXTERN void XOTclAddIMethod _ANSI_ARGS_((Tcl_Interp* in, + struct XOTcl_Class* cl, char* nm, + Tcl_ObjCmdProc* proc, ClientData cd, + Tcl_CmdDeleteProc* dp)); +/* 13 */ +EXTERN void XOTclRemovePMethod _ANSI_ARGS_((Tcl_Interp* in, + struct XOTcl_Object* obj, char* nm)); +/* 14 */ +EXTERN void XOTclRemoveIMethod _ANSI_ARGS_((Tcl_Interp* in, + struct XOTcl_Class* cl, char* nm)); +/* 15 */ +EXTERN Tcl_Obj* XOTclOSetInstVar _ANSI_ARGS_(( + struct XOTcl_Object* obj, Tcl_Interp* in, + Tcl_Obj* name, Tcl_Obj* value, int flgs)); +/* 16 */ +EXTERN Tcl_Obj* XOTclOGetInstVar _ANSI_ARGS_(( + struct XOTcl_Object* obj, Tcl_Interp* in, + Tcl_Obj* name, int flgs)); +/* 17 */ +EXTERN int XOTclInstVar _ANSI_ARGS_((struct XOTcl_Object* obj, + Tcl_Interp* in, char* name, char* destName)); +/* Slot 18 is reserved */ +/* 19 */ +EXTERN Tcl_Obj* XOTclOSetInstVar2 _ANSI_ARGS_(( + struct XOTcl_Object* obj, Tcl_Interp* in, + Tcl_Obj* name1, Tcl_Obj* name2, + Tcl_Obj* value, int flgs)); +/* 20 */ +EXTERN Tcl_Obj* XOTclOGetInstVar2 _ANSI_ARGS_(( + struct XOTcl_Object* obj, Tcl_Interp* in, + Tcl_Obj* name1, Tcl_Obj* name2, int flgs)); +/* 21 */ +EXTERN int XOTclUnsetInstVar2 _ANSI_ARGS_(( + struct XOTcl_Object* obj, Tcl_Interp* in, + char* name1, char* name2, int flgs)); +/* 22 */ +EXTERN int XOTcl_TraceObjCmd _ANSI_ARGS_((ClientData cd, + Tcl_Interp * in, int objc, + Tcl_Obj *CONST objv[])); +/* 23 */ +EXTERN int XOTclErrMsg _ANSI_ARGS_((Tcl_Interp* in, char* msg, + Tcl_FreeProc* type)); +/* 24 */ +EXTERN int XOTclVarErrMsg _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,in)); +/* 25 */ +EXTERN int XOTclErrInProc _ANSI_ARGS_((Tcl_Interp * in, + Tcl_Obj* objName, Tcl_Obj* clName, + char* procName)); +/* 26 */ +EXTERN int XOTclObjErrArgCnt _ANSI_ARGS_((Tcl_Interp * in, + Tcl_Obj * cmdname, char * arglist)); +/* 27 */ +EXTERN int XOTclErrBadVal_ _ANSI_ARGS_((Tcl_Interp * in, + char * expected, char * value)); +/* 28 */ +EXTERN int XOTclObjErrType _ANSI_ARGS_((Tcl_Interp * in, + Tcl_Obj * nm, char* wt)); +/* 29 */ +EXTERN void XOTclStackDump _ANSI_ARGS_((Tcl_Interp* in)); +/* 30 */ +EXTERN void XOTclCallStackDump _ANSI_ARGS_((Tcl_Interp* in)); +/* 31 */ +EXTERN void XOTclDeprecatedMsg _ANSI_ARGS_((char* oldCmd, + char* newCmd)); +/* 32 */ +EXTERN void XOTclSetObjClientData _ANSI_ARGS_((XOTcl_Object* obj, + ClientData data)); +/* 33 */ +EXTERN ClientData XOTclGetObjClientData _ANSI_ARGS_((XOTcl_Object* obj)); +/* 34 */ +EXTERN void XOTclSetClassClientData _ANSI_ARGS_((XOTcl_Class* cl, + ClientData data)); +/* 35 */ +EXTERN ClientData XOTclGetClassClientData _ANSI_ARGS_((XOTcl_Class* cl)); +/* 36 */ +EXTERN void XOTclRequireObjNamespace _ANSI_ARGS_((Tcl_Interp* in, + XOTcl_Object* obj)); +/* 37 */ +EXTERN int XOTclErrBadVal _ANSI_ARGS_((Tcl_Interp * in, + char * context, char * expected, + char * value)); +/* 38 */ +EXTERN int XOTclNextObjCmd _ANSI_ARGS_((ClientData cd, + Tcl_Interp * in, int objc, + Tcl_Obj *CONST objv[])); +/* 39 */ +EXTERN int XOTclCallMethodWithArgs _ANSI_ARGS_((ClientData cd, + Tcl_Interp * in, Tcl_Obj * method, + Tcl_Obj * arg, int objc, + Tcl_Obj *CONST objv[], int flags)); + +typedef struct XotclStubHooks { + struct XotclIntStubs *xotclIntStubs; +} XotclStubHooks; + +typedef struct XotclStubs { + int magic; + struct XotclStubHooks *hooks; + + int (*xotcl_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */ + void *reserved1; + struct XOTcl_Class* (*xOTclIsClass) _ANSI_ARGS_((Tcl_Interp* in, ClientData cd)); /* 2 */ + void *reserved3; + struct XOTcl_Object* (*xOTclGetObject) _ANSI_ARGS_((Tcl_Interp* in, char* name)); /* 4 */ + struct XOTcl_Class* (*xOTclGetClass) _ANSI_ARGS_((Tcl_Interp* in, char* name)); /* 5 */ + int (*xOTclCreateObject) _ANSI_ARGS_((Tcl_Interp* in, Tcl_Obj* name, struct XOTcl_Class* cl)); /* 6 */ + void *reserved7; + int (*xOTclCreateClass) _ANSI_ARGS_((Tcl_Interp* in, Tcl_Obj* name, struct XOTcl_Class* cl)); /* 8 */ + int (*xOTclDeleteObject) _ANSI_ARGS_((Tcl_Interp* in, struct XOTcl_Object* obj)); /* 9 */ + int (*xOTclDeleteClass) _ANSI_ARGS_((Tcl_Interp* in, struct XOTcl_Class* cl)); /* 10 */ + void (*xOTclAddPMethod) _ANSI_ARGS_((Tcl_Interp* in, struct XOTcl_Object* obj, char* nm, Tcl_ObjCmdProc* proc, ClientData cd, Tcl_CmdDeleteProc* dp)); /* 11 */ + void (*xOTclAddIMethod) _ANSI_ARGS_((Tcl_Interp* in, struct XOTcl_Class* cl, char* nm, Tcl_ObjCmdProc* proc, ClientData cd, Tcl_CmdDeleteProc* dp)); /* 12 */ + void (*xOTclRemovePMethod) _ANSI_ARGS_((Tcl_Interp* in, struct XOTcl_Object* obj, char* nm)); /* 13 */ + void (*xOTclRemoveIMethod) _ANSI_ARGS_((Tcl_Interp* in, struct XOTcl_Class* cl, char* nm)); /* 14 */ + Tcl_Obj* (*xOTclOSetInstVar) _ANSI_ARGS_((struct XOTcl_Object* obj, Tcl_Interp* in, Tcl_Obj* name, Tcl_Obj* value, int flgs)); /* 15 */ + Tcl_Obj* (*xOTclOGetInstVar) _ANSI_ARGS_((struct XOTcl_Object* obj, Tcl_Interp* in, Tcl_Obj* name, int flgs)); /* 16 */ + int (*xOTclInstVar) _ANSI_ARGS_((struct XOTcl_Object* obj, Tcl_Interp* in, char* name, char* destName)); /* 17 */ + void *reserved18; + Tcl_Obj* (*xOTclOSetInstVar2) _ANSI_ARGS_((struct XOTcl_Object* obj, Tcl_Interp* in, Tcl_Obj* name1, Tcl_Obj* name2, Tcl_Obj* value, int flgs)); /* 19 */ + Tcl_Obj* (*xOTclOGetInstVar2) _ANSI_ARGS_((struct XOTcl_Object* obj, Tcl_Interp* in, Tcl_Obj* name1, Tcl_Obj* name2, int flgs)); /* 20 */ + int (*xOTclUnsetInstVar2) _ANSI_ARGS_((struct XOTcl_Object* obj, Tcl_Interp* in, char* name1, char* name2, int flgs)); /* 21 */ + int (*xOTcl_TraceObjCmd) _ANSI_ARGS_((ClientData cd, Tcl_Interp * in, int objc, Tcl_Obj *CONST objv[])); /* 22 */ + int (*xOTclErrMsg) _ANSI_ARGS_((Tcl_Interp* in, char* msg, Tcl_FreeProc* type)); /* 23 */ + int (*xOTclVarErrMsg) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,in)); /* 24 */ + int (*xOTclErrInProc) _ANSI_ARGS_((Tcl_Interp * in, Tcl_Obj* objName, Tcl_Obj* clName, char* procName)); /* 25 */ + int (*xOTclObjErrArgCnt) _ANSI_ARGS_((Tcl_Interp * in, Tcl_Obj * cmdname, char * arglist)); /* 26 */ + int (*xOTclErrBadVal_) _ANSI_ARGS_((Tcl_Interp * in, char * expected, char * value)); /* 27 */ + int (*xOTclObjErrType) _ANSI_ARGS_((Tcl_Interp * in, Tcl_Obj * nm, char* wt)); /* 28 */ + void (*xOTclStackDump) _ANSI_ARGS_((Tcl_Interp* in)); /* 29 */ + void (*xOTclCallStackDump) _ANSI_ARGS_((Tcl_Interp* in)); /* 30 */ + void (*xOTclDeprecatedMsg) _ANSI_ARGS_((char* oldCmd, char* newCmd)); /* 31 */ + void (*xOTclSetObjClientData) _ANSI_ARGS_((XOTcl_Object* obj, ClientData data)); /* 32 */ + ClientData (*xOTclGetObjClientData) _ANSI_ARGS_((XOTcl_Object* obj)); /* 33 */ + void (*xOTclSetClassClientData) _ANSI_ARGS_((XOTcl_Class* cl, ClientData data)); /* 34 */ + ClientData (*xOTclGetClassClientData) _ANSI_ARGS_((XOTcl_Class* cl)); /* 35 */ + void (*xOTclRequireObjNamespace) _ANSI_ARGS_((Tcl_Interp* in, XOTcl_Object* obj)); /* 36 */ + int (*xOTclErrBadVal) _ANSI_ARGS_((Tcl_Interp * in, char * context, char * expected, char * value)); /* 37 */ + int (*xOTclNextObjCmd) _ANSI_ARGS_((ClientData cd, Tcl_Interp * in, int objc, Tcl_Obj *CONST objv[])); /* 38 */ + int (*xOTclCallMethodWithArgs) _ANSI_ARGS_((ClientData cd, Tcl_Interp * in, Tcl_Obj * method, Tcl_Obj * arg, int objc, Tcl_Obj *CONST objv[], int flags)); /* 39 */ +} XotclStubs; + +#ifdef __cplusplus +extern "C" { +#endif +extern XotclStubs *xotclStubsPtr; +#ifdef __cplusplus +} +#endif + +#if defined(USE_XOTCL_STUBS) && !defined(USE_XOTCL_STUB_PROCS) + +/* + * Inline function declarations: + */ + +#ifndef Xotcl_Init +#define Xotcl_Init \ + (xotclStubsPtr->xotcl_Init) /* 0 */ +#endif +/* Slot 1 is reserved */ +#ifndef XOTclIsClass +#define XOTclIsClass \ + (xotclStubsPtr->xOTclIsClass) /* 2 */ +#endif +/* Slot 3 is reserved */ +#ifndef XOTclGetObject +#define XOTclGetObject \ + (xotclStubsPtr->xOTclGetObject) /* 4 */ +#endif +#ifndef XOTclGetClass +#define XOTclGetClass \ + (xotclStubsPtr->xOTclGetClass) /* 5 */ +#endif +#ifndef XOTclCreateObject +#define XOTclCreateObject \ + (xotclStubsPtr->xOTclCreateObject) /* 6 */ +#endif +/* Slot 7 is reserved */ +#ifndef XOTclCreateClass +#define XOTclCreateClass \ + (xotclStubsPtr->xOTclCreateClass) /* 8 */ +#endif +#ifndef XOTclDeleteObject +#define XOTclDeleteObject \ + (xotclStubsPtr->xOTclDeleteObject) /* 9 */ +#endif +#ifndef XOTclDeleteClass +#define XOTclDeleteClass \ + (xotclStubsPtr->xOTclDeleteClass) /* 10 */ +#endif +#ifndef XOTclAddPMethod +#define XOTclAddPMethod \ + (xotclStubsPtr->xOTclAddPMethod) /* 11 */ +#endif +#ifndef XOTclAddIMethod +#define XOTclAddIMethod \ + (xotclStubsPtr->xOTclAddIMethod) /* 12 */ +#endif +#ifndef XOTclRemovePMethod +#define XOTclRemovePMethod \ + (xotclStubsPtr->xOTclRemovePMethod) /* 13 */ +#endif +#ifndef XOTclRemoveIMethod +#define XOTclRemoveIMethod \ + (xotclStubsPtr->xOTclRemoveIMethod) /* 14 */ +#endif +#ifndef XOTclOSetInstVar +#define XOTclOSetInstVar \ + (xotclStubsPtr->xOTclOSetInstVar) /* 15 */ +#endif +#ifndef XOTclOGetInstVar +#define XOTclOGetInstVar \ + (xotclStubsPtr->xOTclOGetInstVar) /* 16 */ +#endif +#ifndef XOTclInstVar +#define XOTclInstVar \ + (xotclStubsPtr->xOTclInstVar) /* 17 */ +#endif +/* Slot 18 is reserved */ +#ifndef XOTclOSetInstVar2 +#define XOTclOSetInstVar2 \ + (xotclStubsPtr->xOTclOSetInstVar2) /* 19 */ +#endif +#ifndef XOTclOGetInstVar2 +#define XOTclOGetInstVar2 \ + (xotclStubsPtr->xOTclOGetInstVar2) /* 20 */ +#endif +#ifndef XOTclUnsetInstVar2 +#define XOTclUnsetInstVar2 \ + (xotclStubsPtr->xOTclUnsetInstVar2) /* 21 */ +#endif +#ifndef XOTcl_TraceObjCmd +#define XOTcl_TraceObjCmd \ + (xotclStubsPtr->xOTcl_TraceObjCmd) /* 22 */ +#endif +#ifndef XOTclErrMsg +#define XOTclErrMsg \ + (xotclStubsPtr->xOTclErrMsg) /* 23 */ +#endif +#ifndef XOTclVarErrMsg +#define XOTclVarErrMsg \ + (xotclStubsPtr->xOTclVarErrMsg) /* 24 */ +#endif +#ifndef XOTclErrInProc +#define XOTclErrInProc \ + (xotclStubsPtr->xOTclErrInProc) /* 25 */ +#endif +#ifndef XOTclObjErrArgCnt +#define XOTclObjErrArgCnt \ + (xotclStubsPtr->xOTclObjErrArgCnt) /* 26 */ +#endif +#ifndef XOTclErrBadVal_ +#define XOTclErrBadVal_ \ + (xotclStubsPtr->xOTclErrBadVal_) /* 27 */ +#endif +#ifndef XOTclObjErrType +#define XOTclObjErrType \ + (xotclStubsPtr->xOTclObjErrType) /* 28 */ +#endif +#ifndef XOTclStackDump +#define XOTclStackDump \ + (xotclStubsPtr->xOTclStackDump) /* 29 */ +#endif +#ifndef XOTclCallStackDump +#define XOTclCallStackDump \ + (xotclStubsPtr->xOTclCallStackDump) /* 30 */ +#endif +#ifndef XOTclDeprecatedMsg +#define XOTclDeprecatedMsg \ + (xotclStubsPtr->xOTclDeprecatedMsg) /* 31 */ +#endif +#ifndef XOTclSetObjClientData +#define XOTclSetObjClientData \ + (xotclStubsPtr->xOTclSetObjClientData) /* 32 */ +#endif +#ifndef XOTclGetObjClientData +#define XOTclGetObjClientData \ + (xotclStubsPtr->xOTclGetObjClientData) /* 33 */ +#endif +#ifndef XOTclSetClassClientData +#define XOTclSetClassClientData \ + (xotclStubsPtr->xOTclSetClassClientData) /* 34 */ +#endif +#ifndef XOTclGetClassClientData +#define XOTclGetClassClientData \ + (xotclStubsPtr->xOTclGetClassClientData) /* 35 */ +#endif +#ifndef XOTclRequireObjNamespace +#define XOTclRequireObjNamespace \ + (xotclStubsPtr->xOTclRequireObjNamespace) /* 36 */ +#endif +#ifndef XOTclErrBadVal +#define XOTclErrBadVal \ + (xotclStubsPtr->xOTclErrBadVal) /* 37 */ +#endif +#ifndef XOTclNextObjCmd +#define XOTclNextObjCmd \ + (xotclStubsPtr->xOTclNextObjCmd) /* 38 */ +#endif +#ifndef XOTclCallMethodWithArgs +#define XOTclCallMethodWithArgs \ + (xotclStubsPtr->xOTclCallMethodWithArgs) /* 39 */ +#endif + +#endif /* defined(USE_XOTCL_STUBS) && !defined(USE_XOTCL_STUB_PROCS) */ + +/* !END!: Do not edit above this line. */ + +#endif /* _XOTCLDECLS */ + Index: generic/xotclError.c =================================================================== diff -u -N --- generic/xotclError.c (revision 0) +++ generic/xotclError.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,102 @@ +/* -*- Mode: c++ -*- + * $Id: xotclError.c,v 1.5 2006/09/27 08:12:40 neumann Exp $ + * + * Extended Object Tcl (XOTcl) + * + * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun + * + * + * xotclError.c -- + * + * error return functions for XOTcl + * + */ + +#include "xotclInt.h" + +int +XOTclErrMsg(Tcl_Interp *in, char *msg, Tcl_FreeProc* type) { + Tcl_SetResult(in, msg, type); + return TCL_ERROR; +} + +int +XOTclVarErrMsg TCL_VARARGS_DEF (Tcl_Interp *, arg1) +{ + va_list argList; + char *string; + Tcl_Interp *in; + + in = TCL_VARARGS_START(Tcl_Interp *, arg1, argList); + Tcl_ResetResult(in); + while (1) { + string = va_arg(argList, char *); + if (string == NULL) { + break; + } + Tcl_AppendResult(in, string, (char *) NULL); + } + va_end(argList); + return TCL_ERROR; +} + + +int +XOTclErrInProc (Tcl_Interp *in, Tcl_Obj *objName, + Tcl_Obj *clName, char *procName) { + Tcl_DString errMsg; + char *cName, *space; + ALLOC_DSTRING(&errMsg, "\n "); + if (clName) { + cName = ObjStr(clName); + space = " "; + } else { + cName = ""; + space =""; + } + Tcl_DStringAppend(&errMsg, ObjStr(objName),-1); + Tcl_DStringAppend(&errMsg, space, -1); + Tcl_DStringAppend(&errMsg, cName, -1); + Tcl_DStringAppend(&errMsg, "->", 2); + Tcl_DStringAppend(&errMsg, procName, -1); + Tcl_AddErrorInfo (in, Tcl_DStringValue(&errMsg)); + DSTRING_FREE(&errMsg); + return TCL_ERROR; +} + +int +XOTclObjErrArgCnt(Tcl_Interp *in, Tcl_Obj *cmdname, char *arglist) { + Tcl_ResetResult(in); + Tcl_AppendResult(in, "wrong # args: should be {", (char *) NULL); + if (cmdname) { + Tcl_AppendResult(in, ObjStr(cmdname), " ", (char *) NULL); + } + if (arglist != 0) Tcl_AppendResult(in, arglist, (char *) NULL); + Tcl_AppendResult(in, "}", (char *) NULL); + return TCL_ERROR; +} + +int +XOTclErrBadVal(Tcl_Interp *in, char *context, char *expected, char *value) { + Tcl_ResetResult(in); + Tcl_AppendResult(in, context, ": expected ", expected, " but got '", + value, "'", (char *) NULL); + return TCL_ERROR; +} + +int +XOTclErrBadVal_(Tcl_Interp *in, char *expected, char *value) { + fprintf(stderr, "Deprecated call, recompile your program with xotcl 1.5 or newer\n"); + Tcl_ResetResult(in); + Tcl_AppendResult(in, ": expected ", expected, " but got '", + value, "'", (char *) NULL); + return TCL_ERROR; +} + +extern int +XOTclObjErrType(Tcl_Interp *in, Tcl_Obj *nm, char *wt) { + Tcl_ResetResult(in); + Tcl_AppendResult(in,"'",ObjStr(nm), "' method should be called on '", + wt, "'", (char *) NULL); + return TCL_ERROR; +} Index: generic/xotclInt.decls =================================================================== diff -u -N --- generic/xotclInt.decls (revision 0) +++ generic/xotclInt.decls (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,118 @@ +# xotclInt.decls -- +# +# This file contains the declarations for all unsupported +# functions that are exported by the Tcl library. This file +# is used to generate the itclIntDecls.h and itclIntStub.c +# files +# +# Copyright (c) 1998-1999 by Scriptics Corporation. +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# RCS: @(#) $Id: xotclInt.decls,v 1.1 2004/05/23 22:50:39 neumann Exp $ + +library xotcl + +# Define the unsupported generic interfaces. + +interface xotclInt + + +# +# Functions used within the package, but not considered "public" +# + +#declare 0 generic { + +#} +#declare 1 generic { + +#} +# declare 2 generic { +# int XOTclErrInProc (Tcl_Interp *in, Tcl_Obj* objName, +# Tcl_Obj* clName, char* procName) +# } +# declare 3 generic { +# int XOTclObjErrArgCnt(Tcl_Interp *in, Tcl_Obj *cmdname, char *arglist) +# } +# declare 4 generic { +# int XOTclErrBadVal(Tcl_Interp *in, char *expected, char *value) +# } +# declare 5 generic { +# int XOTclObjErrType(Tcl_Interp *in, Tcl_Obj *nm, char* wt) +# } +# declare 6 generic { +# void XOTclStackTrace (Tcl_Interp* in) +# } +# declare 7 generic { +# void XOTclCallStackTrace (Tcl_Interp* in) +# } +#declare 8 generic { +# void XOTclFilterTrace (Tcl_Interp* in) +#} +#declare 9 generic { +# int XOTclIsType(XOTclObject* obj, XOTclClass* type) +#} +#declare 10 generic { +# void XOTclRemoveClasses(XOTclClasses* sl) +#} +# declare 11 generic { +# XOTclClasses** XOTclAddClass(XOTclClasses** cList, XOTclClass* cl, ClientData cd) +# } +# declare 12 generic { +# XOTclClasses* XOTclComputePrecedence(register XOTclClass* cl) +# } +# declare 13 generic { +# XOTclClasses* XOTclComputeDependents(register XOTclClass* cl) +# } +# declare 14 generic { +# void XOTclDeprecatedMsg(char* oldCmd, char* newCmd) +# } +# declare 15 generic { +# void XOTclSetObjClientData(XOTclObject* obj, ClientData data) +# } +# declare 16 generic { +# ClientData XOTclGetObjClientData(XOTclObject* obj) +# } +# declare 17 generic { +# void XOTclSetClassClientData(XOTclClass* cl, ClientData data) +# } +# declare 18 generic { +# ClientData XOTclGetClassClientData(XOTclClass* cl) +# } +# declare 19 generic { +# void XOTclRequireObjectOpt(XOTclObject* obj) +# } +# declare 20 generic { +# void XOTclRequireClassOpt(XOTclClass* cl) +# } +# declare 21 generic { +# void XOTclRequireObjNamespace(Tcl_Interp* in, XOTclObject* obj) +# } +# declare 22 generic { + +# } +# declare 23 generic { + +# } +# declare 24 generic { + +# } +# declare 25 generic { + +# } +# declare 26 generic { + +# } +# declare 27 generic { + +# } +# declare 28 generic { + +# } +# declare 29 generic { + +# } +# declare 30 generic { + +# } Index: generic/xotclInt.h =================================================================== diff -u -N --- generic/xotclInt.h (revision 0) +++ generic/xotclInt.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,775 @@ +/* -*- Mode: c++ -*- + * $Id: xotclInt.h,v 1.27 2007/10/12 19:53:32 neumann Exp $ + * Extended Object Tcl (XOTcl) + * + * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun + * + * xotclInt.h -- + * + * Mostly internally used API Functions + */ + +#ifndef _xotcl_int_h_ +#define _xotcl_int_h_ + +#include +#include "xotcl.h" + +#include +#include +#include + +#if defined(PROFILE) +# include +#endif + +#ifdef DMALLOC +# include "dmalloc.h" +#endif + +#ifdef BUILD_xotcl +# undef TCL_STORAGE_CLASS +# define TCL_STORAGE_CLASS DLLEXPORT +#endif + +/* +#define XOTCL_METADATA +*/ + +/* + * Makros + */ +#if defined(PRE85) +# define TclVarHashTable Tcl_HashTable +#endif + +#ifdef XOTCL_MEM_COUNT +Tcl_HashTable xotclMemCount; +extern int xotclMemCountInterpCounter; +typedef struct XOTclMemCounter { + int peak; + int count; +} XOTclMemCounter; +# define MEM_COUNT_ALLOC(id,p) XOTclMemCountAlloc(id,p) +# define MEM_COUNT_FREE(id,p) XOTclMemCountFree(id,p) +# define MEM_COUNT_INIT() \ + if (xotclMemCountInterpCounter == 0) { \ + Tcl_InitHashTable(&xotclMemCount, TCL_STRING_KEYS); \ + xotclMemCountInterpCounter = 1; \ + } +# define MEM_COUNT_DUMP() XOTclMemCountDump(in) +# define MEM_COUNT_OPEN_FRAME() +/*if (obj->varTable) noTableBefore = 0*/ +# define MEM_COUNT_CLOSE_FRAME() +/* if (obj->varTable && noTableBefore) \ + XOTclMemCountAlloc("obj->varTable",NULL)*/ +#else +# define MEM_COUNT_ALLOC(id,p) +# define MEM_COUNT_FREE(id,p) +# define MEM_COUNT_INIT() +# define MEM_COUNT_DUMP() +# define MEM_COUNT_OPEN_FRAME() +# define MEM_COUNT_CLOSE_FRAME() +#endif + +#define DSTRING_INIT(D) Tcl_DStringInit(D); MEM_COUNT_ALLOC("DString",D) +#define DSTRING_FREE(D) Tcl_DStringFree(D); MEM_COUNT_FREE("DString",D) + +#if USE_ASSOC_DATA +# define RUNTIME_STATE(in) ((XOTclRuntimeState*)Tcl_GetAssocData((in), "XOTclRuntimeState", NULL)) +#else +# define RUNTIME_STATE(in) ((XOTclRuntimeState*)((Interp*) in)->globalNsPtr->clientData) +#endif + + +#define ALLOC_NAME_NS(DSP, NS, NAME) \ + DSTRING_INIT(DSP);\ + Tcl_DStringAppend(DSP, NS, -1),\ + Tcl_DStringAppend(DSP, "::", 2),\ + Tcl_DStringAppend(DSP, NAME, -1) +#define ALLOC_TOP_NS(DSP, NAME) \ + DSTRING_INIT(DSP);\ + Tcl_DStringAppend(DSP, "::", 2),\ + Tcl_DStringAppend(DSP, NAME, -1) +#define ALLOC_DSTRING(DSP,ENTRY) \ + DSTRING_INIT(DSP);\ + Tcl_DStringAppend(DSP, ENTRY, -1) + +#define nr_elements(arr) ((int) (sizeof(arr) / sizeof(arr[0]))) + +# define NEW(type) \ + (type *)ckalloc(sizeof(type)); MEM_COUNT_ALLOC(#type, NULL) +# define NEW_ARRAY(type,n) \ + (type *)ckalloc(sizeof(type)*(n)); MEM_COUNT_ALLOC(#type "*", NULL) +# define FREE(type, var) \ + ckfree((char*) var); MEM_COUNT_FREE(#type,var) + +#define isAbsolutePath(m) (*m == ':' && m[1] == ':') +#define isArgsString(m) (\ + *m == 'a' && m[1] == 'r' && m[2] == 'g' && m[3] == 's' && \ + m[4] == '\0') +#define isDoubleDashString(m) (\ + *m == '-' && m[1] == '-' && m[2] == '\0') +#define isBodyString(m) (\ + *m == 'b' && m[1] == 'o' && m[2] == 'd' && m[3] == 'y' && \ + m[4] == '\0') +#define isClassString(m) (\ + *m == 'c' && m[1] == 'l' && m[2] == 'a' && m[3] == 's' && \ + m[4] == 's' && m[5] == '\0') +#define isCheckString(m) (\ + *m == 'c' && m[1] == 'h' && m[2] == 'e' && m[3] == 'c' && \ + m[4] == 'k' && m[5] == '\0') +#define isCheckObjString(m) (\ + *m == 'c' && m[1] == 'h' && m[2] == 'e' && m[3] == 'c' && \ + m[4] == 'k' && m[5] == 'o' && m[6] == 'b' && m[7] == 'j' && \ + m[8] == '\0') +#define isCreateString(m) (\ + *m == 'c' && m[1] == 'r' && m[2] == 'e' && m[3] == 'a' && \ + m[4] == 't' && m[5] == 'e' && m[6] == '\0') +#define isAllocString(m) (\ + *m == 'a' && m[1] == 'l' && m[2] == 'l' && m[3] == 'o' && \ + m[4] == 'c' && m[5] == '\0') +#define isDestroyString(m) (\ + *m == 'd' && m[1] == 'e' && m[2] == 's' && m[3] == 't' && \ + m[4] == 'r' && m[5] == 'o' && m[6] == 'y' && m[7] == '\0') +#define isInstDestroyString(m) (\ + *m == 'i' && m[1] == 'n' && m[2] == 's' && m[3] == 't' && \ + m[4] == 'd' && m[5] == 'e' && m[6] == 's' && m[7] == 't' && \ + m[8] == 'r' && m[9] == 'o' && m[10] == 'y' && m[11] == '\0') +#define isInitString(m) (\ + *m == 'i' && m[1] == 'n' && m[2] == 'i' && m[3] == 't' && \ + m[4] == '\0') +#define isInfoString(m) (\ + *m == 'i' && m[1] == 'n' && m[2] == 'f' && m[3] == 'o' && \ + m[4] == '\0') +#ifdef AUTOVARS +# define isNextString(m) (\ + *m == 'n' && m[1] == 'e' && m[2] == 'x' && m[3] == 't' && \ + m[4] == '\0') +#endif +#define isInstinvarString(m) (\ + *m == 'i' && m[1] == 'n' && m[2] == 's' && m[3] == 't' && \ + m[4] == 'i' && m[5] == 'n' && m[6] == 'v' && m[7] == 'a' && \ + m[8] == 'r' && m[9] == '\0') +#define isInvarString(m) (\ + *m == 'i' && m[1] == 'n' && m[2] == 'v' && m[3] == 'a' && \ + m[4] == 'r' && m[5] == '\0') +#define isInstprocString(m) (\ + *m == 'i' && m[1] == 'n' && m[2] == 's' && m[3] == 't' && \ + m[4] == 'p' && m[5] == 'r' && m[6] == 'o' && m[7] == 'c' && \ + m[8] == '\0') +#define isProcString(m) (\ + *m == 'p' && m[1] == 'r' && m[2] == 'o' && m[3] == 'c' && \ + m[4] == '\0') + +#if (defined(sun) || defined(__hpux)) && !defined(__GNUC__) +# define USE_ALLOCA +#endif + +#if defined(__IBMC__) && !defined(__GNUC__) +# if __IBMC__ >= 0x0306 +# define USE_ALLOCA +# else +# define USE_MALLOC +# endif +#endif + +#if defined(VISUAL_CC) +# define USE_MALLOC +#endif + +#if defined(__GNUC__) && !defined(USE_ALLOCA) && !defined(USE_MALLOC) +# if !defined(NDEBUG) +# define ALLOC_ON_STACK(type,n,var) \ + int __##var##_count = (n); type __##var[n+2]; \ + type *var = __##var + 1; var[-1] = var[__##var##_count] = (type)0xdeadbeaf +# define FREE_ON_STACK(var) \ + assert(var[-1] == var[__##var##_count] && (void *)var[-1] == (void*)0xdeadbeaf) +# else +# define ALLOC_ON_STACK(type,n,var) type var[(n)] +# define FREE_ON_STACK(var) +# endif +#elif defined(USE_ALLOCA) +# define ALLOC_ON_STACK(type,n,var) type *var = (type *)alloca((n)*sizeof(type)) +# define FREE_ON_STACK(var) +#else +# define ALLOC_ON_STACK(type,n,var) type *var = (type *)ckalloc((n)*sizeof(type)) +# define FREE_ON_STACK(var) ckfree((char*)var) +#endif + +#ifdef USE_ALLOCA +# include +#endif + +#ifdef __WIN32__ +# define XOTCLINLINE +# define XOTclNewObj(A) A=Tcl_NewObj() +# define DECR_REF_COUNT(A) \ + MEM_COUNT_FREE("INCR_REF_COUNT",A); Tcl_DecrRefCount(A) +#else +/* + * This was defined to be inline for anything !sun or __IBMC__ >= 0x0306, + * but __hpux should also be checked - switched to only allow in gcc - JH + */ +# if defined(__GNUC__) +# define XOTCLINLINE inline +# else +# define XOTCLINLINE +# endif +# ifdef USE_TCL_STUBS +# define XOTclNewObj(A) A=Tcl_NewObj() +# define DECR_REF_COUNT(A) \ + MEM_COUNT_FREE("INCR_REF_COUNT",A); assert((A)->refCount > -1); \ + Tcl_DecrRefCount(A) +# else +# define XOTclNewObj(A) TclNewObj(A) +# define DECR_REF_COUNT(A) \ + MEM_COUNT_FREE("INCR_REF_COUNT",A); TclDecrRefCount(A) +# endif +#endif + +#if !defined(PRE83) && defined(TCL_THREADS) +# define XOTclMutex Tcl_Mutex +# define XOTclMutexLock(a) Tcl_MutexLock(a) +# define XOTclMutexUnlock(a) Tcl_MutexUnlock(a) +#else +# define XOTclMutex int +# define XOTclMutexLock(a) (*(a))++ +# define XOTclMutexUnlock(a) (*(a))-- +#endif + +#if defined(PRE84) +# define CONST84 +#else +# define CONST84 CONST +#endif + +#if defined(PRE81) +# define ObjStr(obj) Tcl_GetStringFromObj(obj, ((int*)NULL)) +#else +# define ObjStr(obj) (obj)->bytes ? (obj)->bytes : Tcl_GetString(obj) +/*# define ObjStr(obj) Tcl_GetString(obj) */ +#endif + +#ifdef V81 +# define EvalObj(in,cmd) Tcl_EvalObj(in,cmd,0) +# define TclIsVarArgument(args) (args->isArg) +# define Tcl_ObjSetVar2(in,p1,p2,newval,flags) \ + Tcl_SetObjVar2(in,ObjStr(p1),p2,newval,flags) +#define Tcl_ObjGetVar2(in,name1,name2,flgs) \ + Tcl_GetObjVar2(in, ObjStr(name1), \ + ((name2==NULL) ? (char*)NULL : ObjStr(name2)), flgs) +#else +# if defined(PRE83) +# define EvalObj(in,cmd) Tcl_EvalObj(in,cmd) +# else +# define EvalObj(in,cmd) Tcl_EvalObjEx(in,cmd,0) +# endif +# if defined(PRE81) && TCL_RELEASE_SERIAL<3 +# define TclIsVarArgument(args) (args->isArg) +# endif +#endif + +#if 0 +#define XOTcl_FrameDecls CallFrame *oldFramePtr = 0, frame, *newFramePtr = &frame +#define XOTcl_PushFrame(in,obj) \ + memset(newFramePtr, 0, sizeof(CallFrame)); \ + oldFramePtr = ((Interp *)in)->varFramePtr; \ + if ((obj)->nsPtr) { \ + newFramePtr->nsPtr = (Namespace*) (obj)->nsPtr; \ + } else { \ + newFramePtr->nsPtr = (Namespace*) RUNTIME_STATE(in)->fakeNS; \ + newFramePtr->isProcCallFrame = 1; \ + newFramePtr->procPtr = &RUNTIME_STATE(in)->fakeProc; \ + newFramePtr->varTablePtr = (obj)->varTable; \ + } \ + ((Interp *)in)->varFramePtr = newFramePtr; \ + MEM_COUNT_OPEN_FRAME() +#define XOTcl_PopFrame(in,obj) \ + if (!(obj)->nsPtr && (obj)->varTable == 0) \ + (obj)->varTable = newFramePtr->varTablePtr; \ + ((Interp *)in)->varFramePtr = oldFramePtr; \ + MEM_COUNT_CLOSE_FRAME() + +#else +/* slightly slower version based on Tcl_PushCallFrame. + Note that it is possible that between push and pop + a obj->nsPtr can be created (e.g. during a read trace) +*/ +#define XOTcl_FrameDecls TclCallFrame frame, *framePtr = &frame; int frame_constructed = 1 +#define XOTcl_PushFrame(interp,obj) \ + if ((obj)->nsPtr) { \ + frame_constructed = 0; \ + Tcl_PushCallFrame(interp, (Tcl_CallFrame*)framePtr, (obj)->nsPtr, 0); \ + } else { \ + CallFrame *myframe = (CallFrame *)framePtr; \ + Tcl_PushCallFrame(interp, (Tcl_CallFrame*)framePtr, RUNTIME_STATE(interp)->fakeNS, 1); \ + Tcl_CallFrame_procPtr(myframe) = &RUNTIME_STATE(interp)->fakeProc; \ + Tcl_CallFrame_varTablePtr(myframe) = (obj)->varTable; \ + } +#define XOTcl_PopFrame(interp,obj) \ + if (!(obj)->nsPtr) { \ + CallFrame *myframe = (CallFrame *)framePtr; \ + if ((obj)->varTable == 0) \ + (obj)->varTable = Tcl_CallFrame_varTablePtr(myframe); \ + } \ + if (frame_constructed) { \ + Interp *iPtr = (Interp *) interp; \ + register CallFrame *myframe = iPtr->framePtr; \ + Tcl_CallFrame_varTablePtr(myframe) = 0; \ + Tcl_CallFrame_procPtr(myframe) = 0; \ + } \ + Tcl_PopCallFrame(interp) +#endif + + +#define INCR_REF_COUNT(A) MEM_COUNT_ALLOC("INCR_REF_COUNT",A); Tcl_IncrRefCount(A) + +#ifdef OBJDELETION_TRACE +# define PRINTOBJ(ctx,obj) \ + fprintf(stderr, " %s %p %s oid=%p teardown=%p destroyCalled=%d\n", \ + ctx,obj,ObjStr(obj->cmdName), obj->id, obj->teardown, \ + (obj->flags & XOTCL_DESTROY_CALLED)) +#else +# define PRINTOBJ(ctx,obj) +#endif + +#define className(cl) (cl ? ObjStr(cl->object.cmdName) : "") + + +#define LONG_AS_STRING 32 + +/* TCL_CONTINUE is defined as 4, from 5 on we can + use app-specific return codes */ +#define XOTCL_CHECK_FAILED 6 + +/* flags for call method */ +#define XOTCL_CM_NO_FILTERS 1 +#define XOTCL_CM_NO_UNKNOWN 2 + +/* + * + * XOTcl Structures + * + */ + +/* + * Filter structures + */ +typedef struct XOTclFilterStack { + Tcl_Command currentCmdPtr; + Tcl_Obj* calledProc; + struct XOTclFilterStack* next; +} XOTclFilterStack; + +typedef struct XOTclTclObjList { + Tcl_Obj* content; + struct XOTclTclObjList* next; +} XOTclTclObjList; + +/* + * Assertion structures + */ + +typedef struct XOTclProcAssertion { + XOTclTclObjList* pre; + XOTclTclObjList* post; +} XOTclProcAssertion; + +typedef struct XOTclAssertionStore { + XOTclTclObjList* invariants; + Tcl_HashTable procs; +} XOTclAssertionStore; + +typedef enum { /* powers of 2; add to ALL, if default; */ + CHECK_NONE = 0, CHECK_CLINVAR = 1, CHECK_OBJINVAR = 2, + CHECK_PRE = 4, CHECK_POST = 8, + CHECK_INVAR = CHECK_CLINVAR + CHECK_OBJINVAR, + CHECK_ALL = CHECK_INVAR + CHECK_PRE + CHECK_POST +} CheckOptions; + +void XOTclAssertionRename(Tcl_Interp* in, Tcl_Command cmd, + XOTclAssertionStore *as, + char *oldSimpleCmdName, char *newName); +/* + * mixins + */ +typedef struct XOTclMixinStack { + Tcl_Command currentCmdPtr; + struct XOTclMixinStack* next; +} XOTclMixinStack; + +/* + * Generic command pointer list + */ +typedef struct XOTclCmdList { + Tcl_Command cmdPtr; + ClientData clientData; + struct XOTclClass *clorobj; + struct XOTclCmdList* next; +} XOTclCmdList; + +typedef void (XOTclFreeCmdListClientData) _ANSI_ARGS_((XOTclCmdList*)); + +/* for incr string */ +typedef struct XOTclStringIncrStruct { + char *buffer; + char *start; + size_t bufSize; + int length; +} XOTclStringIncrStruct; + +/* + * object flags ... + */ + +/* DESTROY_CALLED indicates that destroy was called on obj */ +#define XOTCL_DESTROY_CALLED 0x0001 +/* INIT_CALLED indicates that init was called on obj */ +#define XOTCL_INIT_CALLED 0x0002 +/* MIXIN_ORDER_VALID set when mixin order is valid */ +#define XOTCL_MIXIN_ORDER_VALID 0x0004 +/* MIXIN_ORDER_DEFINED set, when mixins are defined for obj */ +#define XOTCL_MIXIN_ORDER_DEFINED 0x0008 +#define XOTCL_MIXIN_ORDER_DEFINED_AND_VALID 0x000c +/* FILTER_ORDER_VALID set, when filter order is valid */ +#define XOTCL_FILTER_ORDER_VALID 0x0010 +/* FILTER_ORDER_DEFINED set, when filters are defined for obj */ +#define XOTCL_FILTER_ORDER_DEFINED 0x0020 +#define XOTCL_FILTER_ORDER_DEFINED_AND_VALID 0x0030 +/* IS_CLASS set, when object is a class */ +#define XOTCL_IS_CLASS 0x0040 +/* DESTROYED set, when object is physically destroyed with PrimitiveODestroy */ +#define XOTCL_DESTROYED 0x0080 +#define XOTCL_REFCOUNTED 0x0100 +#define XOTCL_RECREATE 0x0200 +#define XOTCL_NS_DESTROYED 0x0400 + +#define XOTclObjectSetClass(obj) \ + (obj)->flags |= XOTCL_IS_CLASS +#define XOTclObjectIsClass(obj) \ + ((obj)->flags & XOTCL_IS_CLASS) +#define XOTclObjectToClass(obj) \ + (XOTclClass*)((((XOTclObject*)obj)->flags & XOTCL_IS_CLASS)?obj:0) + + +/* + * object and class internals + */ + +typedef struct XOTclNonposArgs { + Tcl_Obj* nonposArgs; + Tcl_Obj* ordinaryArgs; +} XOTclNonposArgs; + +typedef struct XOTclObjectOpt { + XOTclAssertionStore *assertions; + XOTclCmdList* filters; + XOTclCmdList* mixins; +#ifdef XOTCL_METADATA + Tcl_HashTable metaData; +#endif + ClientData clientData; + char *volatileVarName; + short checkoptions; +} XOTclObjectOpt; + +typedef struct XOTclObject { + Tcl_Obj *cmdName; + Tcl_Command id; + Tcl_Interp *teardown; + struct XOTclClass *cl; + TclVarHashTable *varTable; + Tcl_Namespace *nsPtr; + XOTclObjectOpt *opt; + struct XOTclCmdList *filterOrder; + struct XOTclCmdList *mixinOrder; + XOTclFilterStack *filterStack; + XOTclMixinStack *mixinStack; + int refCount; + short flags; + Tcl_HashTable *nonposArgsTable; +} XOTclObject; + +typedef struct XOTclClassOpt { + XOTclCmdList* instfilters; + XOTclCmdList* instmixins; + XOTclAssertionStore *assertions; + Tcl_Obj* parameterClass; +#ifdef XOTCL_OBJECTDATA + Tcl_HashTable* objectdata; +#endif + ClientData clientData; +} XOTclClassOpt; + +typedef struct XOTclClass { + struct XOTclObject object; + struct XOTclClasses* super; + struct XOTclClasses* sub; + short color; + struct XOTclClasses* order; + struct XOTclClass* parent; + Tcl_HashTable instances; + Tcl_Namespace *nsPtr; + Tcl_Obj* parameters; + XOTclClassOpt* opt; + Tcl_HashTable *nonposArgsTable; +} XOTclClass; + +typedef struct XOTclClasses { + struct XOTclClass* cl; + ClientData clientData; + struct XOTclClasses* next; +} XOTclClasses; + +/* XOTcl global names and strings */ +/* these are names and contents for global (corresponding) Tcl_Objs + and Strings - otherwise these "constants" would have to be built + every time they are used; now they are built once in XOTcl_Init */ +typedef enum { + XOTE_EMPTY, XOTE_UNKNOWN, XOTE_CREATE, XOTE_DESTROY, XOTE_INSTDESTROY, + XOTE_ALLOC, XOTE_INIT, XOTE_INSTVAR, XOTE_INTERP, XOTE_AUTONAMES, + XOTE_ZERO, XOTE_ONE, XOTE_MOVE, XOTE_SELF, XOTE_CLASS, XOTE_RECREATE, + XOTE_SELF_CLASS, XOTE_SELF_PROC, XOTE_PARAM_CL, + XOTE_SEARCH_DEFAULTS, XOTE_EXIT_HANDLER, + XOTE_NON_POS_ARGS_CL, XOTE_NON_POS_ARGS_OBJ, + XOTE_CLEANUP, XOTE_CONFIGURE, XOTE_FILTER, XOTE_INSTFILTER, + XOTE_INSTPROC, XOTE_PROC, XOTE_INSTFORWARD, XOTE_FORWARD, + XOTE_INSTCMD, XOTE_CMD, XOTE_INSTPARAMETERCMD, XOTE_PARAMETERCMD, + XOTE_MKGETTERSETTER, XOTE_FORMAT, + XOTE_NEWOBJ, XOTE_GUARD_OPTION, XOTE_DEFAULTMETHOD, + XOTE___UNKNOWN, XOTE_ARGS, XOTE_SPLIT, XOTE_COMMA, + /** these are the redefined tcl commands; leave them + together at the end */ + XOTE_EXPR, XOTE_INFO, XOTE_RENAME, XOTE_SUBST +} XOTclGlobalNames; +#if !defined(XOTCL_C) +extern char *XOTclGlobalStrings[]; +#else +char *XOTclGlobalStrings[] = { + "", "unknown", "create", "destroy", "instdestroy", + "alloc", "init", "instvar", "interp", "__autonames", + "0", "1", "move", "self", "class", "recreate", + "self class", "self proc", "::xotcl::Class::Parameter", + "searchDefaults", "__exitHandler", + "::xotcl::NonposArgs", "::xotcl::nonposArgs", + "cleanup", "configure", "filter", "instfilter", + "instproc", "proc", "instforward", "forward", + "instcmd", "cmd", "instparametercmd", "parametercmd", + "mkGetterSetter", "format", + "__#", "-guard", "defaultmethod", + "__unknown", "args", "split", ",", + "expr", "info", "rename", "subst", +}; +#endif + +#define XOTclGlobalObjects RUNTIME_STATE(in)->methodObjNames + +/* XOTcl ShadowTclCommands */ +typedef struct XOTclShadowTclCommandInfo { + TclObjCmdProcType proc; + ClientData cd; +} XOTclShadowTclCommandInfo; +typedef enum {SHADOW_LOAD=1, SHADOW_UNLOAD=0, SHADOW_REFETCH=2} XOTclShadowOperations; + +int XOTclCallCommand(Tcl_Interp* in, XOTclGlobalNames name, + int objc, Tcl_Obj *CONST objv[]); +int XOTclShadowTclCommands(Tcl_Interp* in, XOTclShadowOperations load); + + +/* + * XOTcl CallStack + */ +typedef struct XOTclCallStackContent { + XOTclObject *self; + XOTclClass *cl; + Tcl_Command cmdPtr; + Tcl_Command destroyedCmd; + Tcl_CallFrame *currentFramePtr; + unsigned short frameType; + unsigned short callType; + XOTclFilterStack *filterStackEntry; +} XOTclCallStackContent; + +#define XOTCL_CSC_TYPE_PLAIN 0 +#define XOTCL_CSC_TYPE_ACTIVE_MIXIN 1 +#define XOTCL_CSC_TYPE_ACTIVE_FILTER 2 +#define XOTCL_CSC_TYPE_INACTIVE 4 +#define XOTCL_CSC_TYPE_INACTIVE_MIXIN 5 +#define XOTCL_CSC_TYPE_INACTIVE_FILTER 6 +#define XOTCL_CSC_TYPE_GUARD 16 + +#define XOTCL_CSC_CALL_IS_NEXT 1 +#define XOTCL_CSC_CALL_IS_DESTROY 2 + +typedef struct XOTclCallStack { + XOTclCallStackContent content[MAX_NESTING_DEPTH]; + XOTclCallStackContent *top; + short guardCount; +} XOTclCallStack; + +#if defined(PROFILE) +typedef struct XOTclProfile { + long int overallTime; + Tcl_HashTable objectData; + Tcl_HashTable methodData; +} XOTclProfile; +#endif + +typedef struct XOTclRuntimeState { + XOTclCallStack cs; + Tcl_Namespace *XOTclClassesNS; + Tcl_Namespace *XOTclNS; + /* + * definitions of the main xotcl objects + */ + XOTclClass *theObject; + XOTclClass *theClass; +#if USE_INTERP_PROC + Tcl_CmdProc *interpProc; +#endif + Tcl_ObjCmdProc *objInterpProc; + Tcl_Obj **methodObjNames; + struct XOTclShadowTclCommandInfo *tclCommands; + int errorCount; + /* these flags could move into a bitarray, but are used only once per interp*/ + int callDestroy; + int callIsDestroy; + int unknown; + int doFilters; + int doSoftrecreate; + int exitHandlerDestroyRound; + int returnCode; + long newCounter; + XOTclStringIncrStruct iss; + Proc fakeProc; + Tcl_Namespace *fakeNS; + XotclStubs *xotclStubs; + Tcl_CallFrame *varFramePtr; + Command *cmdPtr; +#if defined(PROFILE) + XOTclProfile profile; +#endif + ClientData clientData; +} XOTclRuntimeState; + +#define XOTCL_EXITHANDLER_OFF 0 +#define XOTCL_EXITHANDLER_ON_SOFT_DESTROY 1 +#define XOTCL_EXITHANDLER_ON_PHYSICAL_DESTROY 2 + + +#ifdef XOTCL_OBJECTDATA +extern void +XOTclSetObjectData(struct XOTclObject* obj, struct XOTclClass* cl, + ClientData data); +extern int +XOTclGetObjectData(struct XOTclObject* obj, struct XOTclClass* cl, + ClientData* data); +extern int +XOTclUnsetObjectData(struct XOTclObject* obj, struct XOTclClass* cl); +extern void +XOTclFreeObjectData(XOTclClass* cl); +#endif + +/* + * + * internally used API functions + * + */ + +#include "xotclIntDecls.h" + +/* + * Profiling functions + */ + +#if defined(PROFILE) +extern void +XOTclProfileFillTable(Tcl_HashTable* table, Tcl_DString* key, + double totalMicroSec); +extern void +XOTclProfileEvaluateData(Tcl_Interp* in, long int startSec, long int startUsec, + XOTclObject* obj, XOTclClass *cl, char *methodName); +extern void +XOTclProfilePrintTable(Tcl_HashTable* table); + +extern void +XOTclProfilePrintData(Tcl_Interp* in); + +extern void +XOTclProfileInit(Tcl_Interp* in); +#endif + +/* + * MEM Counting + */ +#ifdef XOTCL_MEM_COUNT +void XOTclMemCountAlloc(char* id, void *); +void XOTclMemCountFree(char* id, void *); +void XOTclMemCountDump(); +#endif /* XOTCL_MEM_COUNT */ +/* + * old, deprecated meta-data command + */ +#if defined(XOTCL_METADATA) +extern void +XOTclMetaDataDestroy(XOTclObject* obj); +extern void +XOTclMetaDataInit(XOTclObject* obj); +extern int +XOTclOMetaDataMethod (ClientData cd, Tcl_Interp* in, + int objc, Tcl_Obj *objv[]); +#endif /* XOTCL_METADATA */ + + +/* + * bytecode support + */ +#ifdef XOTCL_BYTECODE +typedef struct XOTclCompEnv { + int bytecode; + Command *cmdPtr; + CompileProc *compileProc; + Tcl_ObjCmdProc *callProc; +} XOTclCompEnv; + +typedef enum {INST_INITPROC, INST_NEXT, INST_SELF, INST_SELF_DISPATCH, + LAST_INSTRUCTION} XOTclByteCodeInstructions; + + +extern XOTclCompEnv *XOTclGetCompEnv(); + +Tcl_ObjCmdProc XOTclInitProcNSCmd, XOTclSelfDispatchCmd, + XOTclNextObjCmd, XOTclGetSelfObjCmd; + +int XOTclDirectSelfDispatch(ClientData cd, Tcl_Interp* in, + int objc, Tcl_Obj *CONST objv[]); +#endif + +int +XOTclObjDispatch(ClientData cd, Tcl_Interp* in, + int objc, Tcl_Obj *CONST objv[]); + +XOTclCallStackContent * +XOTclCallStackFindActiveFrame(Tcl_Interp* in, int offset); + +XOTclCallStackContent * +XOTclCallStackFindLastInvocation(Tcl_Interp* in, int offset); + +/* functions from xotclUtil.c */ +char *XOTcl_ltoa(char *buf, long i, int *len); +char *XOTclStringIncr(XOTclStringIncrStruct *iss); +void XOTclStringIncrInit(XOTclStringIncrStruct *iss); +void XOTclStringIncrFree(XOTclStringIncrStruct *iss); + + +#if !defined(NDEBUG) +/*# define XOTCLINLINE*/ +#endif + + +/*** common win sermon ***/ +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLIMPORT + +#endif /* _xotcl_int_h_ */ Index: generic/xotclIntDecls.h =================================================================== diff -u -N --- generic/xotclIntDecls.h (revision 0) +++ generic/xotclIntDecls.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,57 @@ +/* + * xotclIntDecls.h -- + * + * This file contains the declarations for all unsupported + * functions that are exported by the Tcl library. These + * interfaces are not guaranteed to remain the same between + * versions. Use at your own risk. + * + * Copyright (c) 1998-1999 by XXXX + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + */ + +#ifndef _XOTCLINTDECLS +#define _XOTCLINTDECLS + +/* + * WARNING: This file is automatically generated by the tools/genStubs.tcl + * script. Any modifications to the function declarations below should be made + * in the xotclInt.decls script. + */ + +/* !BEGIN!: Do not edit below this line. */ + +/* + * Exported function declarations: + */ + + +typedef struct XotclIntStubs { + int magic; + struct XotclIntStubHooks *hooks; + +} XotclIntStubs; + +#ifdef __cplusplus +extern "C" { +#endif +extern XotclIntStubs *xotclIntStubsPtr; +#ifdef __cplusplus +} +#endif + +#if defined(USE_XOTCL_STUBS) && !defined(USE_XOTCL_STUB_PROCS) + +/* + * Inline function declarations: + */ + + +#endif /* defined(USE_XOTCL_STUBS) && !defined(USE_XOTCL_STUB_PROCS) */ + +/* !END!: Do not edit above this line. */ + +#endif /* _XOTCLINTDECLS */ Index: generic/xotclMetaData.c =================================================================== diff -u -N --- generic/xotclMetaData.c (revision 0) +++ generic/xotclMetaData.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,176 @@ +/* -*- Mode: c++ -*- + * $Id: xotclMetaData.c,v 1.5 2006/09/27 08:12:40 neumann Exp $ + * + * Extended Object Tcl (XOTcl) + * + * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun + * + * + * xotclReference.c -- + * + * XOTcl Object References + * + */ + +#include "xotclInt.h" + +#ifdef XOTCL_METADATA +/* + * Meta Data + */ + +void +XOTclMetaDataRemoveDepending(XOTclClass* cl, char* name) { + XOTclClasses *saved = cl->order, *clPtr; + cl->order = 0; + + clPtr = XOTclComputeDependents(cl); + + while (clPtr != 0) { + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr = &clPtr->cl->instances ? + Tcl_FirstHashEntry(&clPtr->cl->instances, &hSrch) : 0; + for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { + XOTclObject* obj = (XOTclObject*) + Tcl_GetHashKey(&clPtr->cl->instances, hPtr); + Tcl_HashEntry* h1Ptr = 0; + if (obj->opt) + h1Ptr = Tcl_FindHashEntry(&obj->opt->metaData, name); + if (h1Ptr) { + Tcl_DeleteHashEntry(h1Ptr); + } + } + clPtr = clPtr->next; + } + + XOTclRemoveClasses(cl->order); + cl->order = saved; +} + +int +XOTclMetaDataInheritance (XOTclObject* obj, char* name) { + XOTclClasses *clPtr; + assert(obj); + + if (!obj->cl->order) + obj->cl->order = XOTclComputePrecedence(obj->cl); + clPtr = obj->cl->order; + if (clPtr) { + while (clPtr != 0) { + if (clPtr->cl->object.opt) { + if (Tcl_FindHashEntry(&clPtr->cl->object.opt->metaData, name)) { + return 1; + } + } + clPtr = clPtr->next; + } + } + return 0; +} + +void +XOTclMetaDataDestroy(XOTclObject* obj) { + if (obj->opt) + Tcl_DeleteHashTable(&obj->opt->metaData); +} + +void +XOTclMetaDataInit(XOTclObject* obj) { + XOTclRequireObjectOpt(obj); + Tcl_InitHashTable(&obj->opt->metaData, TCL_STRING_KEYS); +} + +int +XOTclOMetaDataMethod (ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj *CONST objv[]) { + XOTclObject *obj = (XOTclObject*)cd; + XOTclClass *cl = XOTclObjectToClass(cd); + char* option; int add = -1; + int result = TCL_OK; + int oc; Tcl_Obj** ov; int i; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc < 2) + return XOTclObjErrArgCnt(in,obj->cmdName, + "metadata ?(add|remove)? metaDataList"); + + option = ObjStr(objv[1]); + switch (*option) { + case 'a': + if (strcmp(option,"add") == 0) add = 1; break; + case 'r': + if (strcmp(option,"remove") == 0) add = 0; break; + } + if (add == -1) { + if (objc == 2) { + if (obj->opt) { + Tcl_HashEntry* hPtr = Tcl_FindHashEntry(&obj->opt->metaData, option); + if (hPtr) { + Tcl_Obj* entry = (Tcl_Obj *) Tcl_GetHashValue(hPtr); + if (entry) { + Tcl_SetObjResult(in, (Tcl_Obj *) Tcl_GetHashValue(hPtr)); + } else { + Tcl_ResetResult(in); + } + } + return TCL_OK; + } + } + if (objc == 3) { + if (obj->opt) { + Tcl_HashEntry* hPtr = Tcl_FindHashEntry(&obj->opt->metaData, option); + if (!hPtr) { + int nw; + if (XOTclMetaDataInheritance(obj, option)) { + hPtr = Tcl_CreateHashEntry(&obj->opt->metaData, option, &nw); + if (!nw) + return XOTclVarErrMsg(in, + "MetaData: Can't create MetaData Entry: ", + option, (char*) NULL); + } + } + if (hPtr) { + Tcl_Obj* entry = (Tcl_Obj *) Tcl_GetHashValue(hPtr); + if (entry) + DECR_REF_COUNT(entry); + INCR_REF_COUNT(objv[2]); + Tcl_SetHashValue(hPtr, (ClientData) objv[2]); + return TCL_OK; + } + } + } + return XOTclVarErrMsg(in,"MetaData: Unknown option; given Option: ", + option, (char*) NULL); + } + + if (Tcl_ListObjGetElements(in, objv[2], &oc, &ov) == TCL_OK) { + for (i = 0; i < oc; i ++) { + char* value = ObjStr (ov[i]); + if (obj->opt) { + if (add) { + int nw; + Tcl_HashEntry* hPtr = Tcl_FindHashEntry(&obj->opt->metaData, value); + if (hPtr) + return XOTclVarErrMsg(in, + "Can't add MetaData, MetaData exists: ", + value, + (char*) NULL); + hPtr = Tcl_CreateHashEntry(&obj->opt->metaData, value, &nw); + if (!nw) + return XOTclVarErrMsg(in, + "MetaData: Can't create MetaData Entry: ", + value,(char*) NULL); + } else { + Tcl_HashEntry* hPtr = Tcl_FindHashEntry(&obj->opt->metaData, value); + if (hPtr) { + Tcl_DeleteHashEntry(hPtr); + if (cl) { + XOTclMetaDataRemoveDepending(cl, value); + } + } + } + } + } + } + return result; +} +#endif Index: generic/xotclObjectData.c =================================================================== diff -u -N --- generic/xotclObjectData.c (revision 0) +++ generic/xotclObjectData.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,61 @@ +/* -*- Mode: c++ -*- + * xotclObjectData.c + * + * Extended Object Tcl (XOTcl) + * + * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun + * + * + * xotclObjectData.c -- + * + * XOTcl Object Data, needs XOTCL_OBJECTDATA to be compiled in + * + */ + +#include "xotclInt.h" + +#ifdef XOTCL_OBJECTDATA +extern void +XOTclFreeObjectData(XOTclClass* cl) { + if (cl->opt && cl->opt->objectdata) { + Tcl_DeleteHashTable(cl->opt->objectdata); + ckfree((char*)cl->opt->objectdata); + cl->opt->objectdata = 0; + } +} +extern void +XOTclSetObjectData(XOTclObject* obj, XOTclClass* cl, ClientData data) { + Tcl_HashEntry *hPtr; + int nw; + + XOTclRequireClassOpt(cl); + + if (!cl->opt->objectdata) { + cl->opt->objectdata = (Tcl_HashTable*)ckalloc(sizeof(Tcl_HashTable)); + Tcl_InitHashTable(cl->opt->objectdata, TCL_ONE_WORD_KEYS); + } + hPtr = Tcl_CreateHashEntry(cl->opt->objectdata, (char*)obj, &nw); + Tcl_SetHashValue(hPtr, data); +} + +extern int +XOTclGetObjectData(XOTclObject* obj, XOTclClass* cl, ClientData* data) { + Tcl_HashEntry *hPtr; + if (!cl->opt || !cl->opt->objectdata) + return 0; + hPtr = Tcl_FindHashEntry(cl->opt->objectdata, (char*)obj); + if (data) *data = hPtr ? Tcl_GetHashValue(hPtr) : 0; + return hPtr != 0; +} + +extern int +XOTclUnsetObjectData(XOTclObject* obj, XOTclClass* cl) { + Tcl_HashEntry *hPtr; + + if (!cl->opt || !cl->opt->objectdata) + return 0; + hPtr = Tcl_FindHashEntry(cl->opt->objectdata, (char*)obj); + if (hPtr) Tcl_DeleteHashEntry(hPtr); + return hPtr != 0; +} +#endif Index: generic/xotclProfile.c =================================================================== diff -u -N --- generic/xotclProfile.c (revision 0) +++ generic/xotclProfile.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,145 @@ +/* -*- Mode: c++ -*- + * $Id: xotclProfile.c,v 1.2 2006/02/18 22:17:33 neumann Exp $ + * + * Extended Object Tcl (XOTcl) + * + * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun + * + * + * xotclProfile.c -- + * + * Profiling information printout for XOTcl + * + * For profiling infos PROFILE (xotcl.h) flag must be activated + * + */ + +#include "xotclInt.h" + +#if defined(PROFILE) +void +XOTclProfileFillTable(Tcl_HashTable* table, Tcl_DString* key, + double totalMicroSec) { + Tcl_HashEntry* hPtr; + char* keyStr = Tcl_DStringValue(key); + long int* value; + + hPtr = Tcl_FindHashEntry(table, keyStr); + if (!hPtr) { + int nw; + hPtr = Tcl_CreateHashEntry(table, keyStr, &nw); + if (!nw) + return; + value = (long int*) ckalloc (sizeof(long int)); + *value = 0; + Tcl_SetHashValue(hPtr, (ClientData) value); + } else + value = (long int*) Tcl_GetHashValue (hPtr); + + *value += totalMicroSec; + + + /* { + long int* d = (long int*) Tcl_GetHashValue (hPtr); + fprintf(stderr, "Entered %s ... %ld\n", Tcl_GetHashKey(table, hPtr), *d); + }*/ + +} + +void +XOTclProfileEvaluateData(Tcl_Interp* in, long int startSec, long int startUsec, + XOTclObject* obj, XOTclClass *cl, char *methodName) { + double totalMicroSec; + struct timeval trt; + Tcl_DString objectKey, methodKey; + + XOTclProfile* profile = &RUNTIME_STATE(in)->profile; + + gettimeofday(&trt, NULL); + + totalMicroSec = (trt.tv_sec - startSec) * 1000000 + + (trt.tv_usec - startUsec); + + profile->overallTime += totalMicroSec; + + if (obj->teardown == 0 || !obj->id || obj->destroyCalled) + return; + + ALLOC_DSTRING(&objectKey, ObjStr(obj->cmdName)); + + if (cl) + ALLOC_DSTRING(&methodKey, ObjStr(cl->object.cmdName)); + else + ALLOC_DSTRING(&methodKey, ObjStr(obj->cmdName)); + Tcl_DStringAppend(&methodKey, "->", 2); + Tcl_DStringAppend(&methodKey, methodName, -1); + if (cl) + Tcl_DStringAppend(&methodKey, " (instproc)", 11); + else + Tcl_DStringAppend(&methodKey, " (proc)", 7); + + XOTclProfileFillTable(&profile->objectData, &objectKey, totalMicroSec); + XOTclProfileFillTable(&profile->methodData, &methodKey, totalMicroSec); + DSTRING_FREE(&objectKey); + DSTRING_FREE(&methodKey); +} + +void +XOTclProfilePrintTable(Tcl_HashTable* table) { + Tcl_HashEntry* topValueHPtr; + long int* topValue; + + do { + Tcl_HashSearch hSrch; + Tcl_HashEntry* hPtr = table ? + Tcl_FirstHashEntry(table, &hSrch) : 0; + char* topKey = 0; + + topValueHPtr = 0; + topValue = 0; + + for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { + long int *val = (long int*) Tcl_GetHashValue(hPtr); + if (val && (!topValue || (topValue && *val >= *topValue))) { + topValue = val; + topValueHPtr = hPtr; + topKey = Tcl_GetHashKey(table, hPtr); + } + } + + if (topValueHPtr) { + fprintf(stderr, " %15ld %s\n", *topValue, topKey); + ckfree((char*) topValue); + Tcl_DeleteHashEntry(topValueHPtr); + } + } while (topValueHPtr); +} + +void +XOTclProfilePrintData(Tcl_Interp* in) { + XOTclProfile* profile = &RUNTIME_STATE(in)->profile; + + fprintf(stderr, "------------------------------------------------------------------\n"); + fprintf(stderr, "\nXOTcl Profile Information\n\n"); + fprintf(stderr, "------------------------------------------------------------------\n"); + fprintf(stderr, "Overall Elapsed Time %ld\n", + profile->overallTime); + fprintf(stderr, "------------------------------------------------------------------\n"); + fprintf(stderr, " MICROSECONDS OBJECT-NAME\n"); + XOTclProfilePrintTable(&profile->objectData); + fprintf(stderr, "------------------------------------------------------------------\n"); + fprintf(stderr, " MICROSECONDS (CL/OBJ)->METHOD-NAME\n"); + XOTclProfilePrintTable(&profile->methodData); + fprintf(stderr, "------------------------------------------------------------------\n"); +} + +void +XOTclProfileInit(Tcl_Interp* in) { + RUNTIME_STATE(in)->profile.overallTime = 0; + Tcl_InitHashTable(&RUNTIME_STATE(in)->profile.objectData, + TCL_STRING_KEYS); + Tcl_InitHashTable(&RUNTIME_STATE(in)->profile.methodData, + TCL_STRING_KEYS); +} + +#endif Index: generic/xotclShadow.c =================================================================== diff -u -N --- generic/xotclShadow.c (revision 0) +++ generic/xotclShadow.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,194 @@ +/* -*- Mode: c++ -*- + * $Id: xotclShadow.c,v 1.10 2007/09/05 19:09:23 neumann Exp $ + * + * Extended Object Tcl (XOTcl) + * + * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun + * + * + * xotclShadow.c -- + * + * Shadowing (overloading) and accessing global tcl obj commands + * + */ + +#include "xotclInt.h" +#include "xotclAccessInt.h" + +static int +XOTclReplaceCommandCleanup(Tcl_Interp *in, XOTclGlobalNames name) { + Tcl_Command cmd; + int result = TCL_OK; + XOTclShadowTclCommandInfo *ti = &RUNTIME_STATE(in)->tclCommands[name-XOTE_EXPR]; + + /*fprintf(stderr," cleanup for %s ti=%p in %p\n", XOTclGlobalStrings[name], ti, in);*/ + cmd = Tcl_GetCommandFromObj(in, XOTclGlobalObjects[name]); + if (cmd != NULL) { + Tcl_Command_objProc(cmd) = ti->proc; + ti->proc = NULL; + } else { + result = TCL_ERROR; + } + + return result; +} + +static void +XOTclReplaceCommandCheck(Tcl_Interp *in, XOTclGlobalNames name, Tcl_ObjCmdProc *proc) { + Tcl_Command cmd; + XOTclShadowTclCommandInfo *ti = &RUNTIME_STATE(in)->tclCommands[name-XOTE_EXPR]; + cmd = Tcl_GetCommandFromObj(in, XOTclGlobalObjects[name]); + + if (cmd != NULL && ti->proc && Tcl_Command_objProc(cmd) != proc) { + /* + fprintf(stderr, "we have to do something about %s %p %p\n", + XOTclGlobalStrings[name], Tcl_Command_objProc(cmd), proc); + */ + ti->proc = Tcl_Command_objProc(cmd); + ti->cd = Tcl_Command_objClientData(cmd); + Tcl_Command_objProc(cmd) = proc; + } +} + +static int +XOTclReplaceCommand(Tcl_Interp *in, XOTclGlobalNames name, + Tcl_ObjCmdProc *xotclReplacementProc, int pass) { + Tcl_Command cmd; + XOTclShadowTclCommandInfo *ti = &RUNTIME_STATE(in)->tclCommands[name-XOTE_EXPR]; + int result = TCL_OK; + + /*fprintf(stderr,"XOTclReplaceCommand %d\n",name);*/ + cmd = Tcl_GetCommandFromObj(in, XOTclGlobalObjects[name]); + + if (cmd == NULL) { + result = TCL_ERROR; + } else { + Tcl_ObjCmdProc *objProc = Tcl_Command_objProc(cmd); + if (xotclReplacementProc != objProc) { + if (pass == 0) { /* setting values on first pass (must be locked here) */ + ti->proc = objProc; + ti->cd = Tcl_Command_objClientData(cmd); + } else if (ti->proc != objProc) { + /*fprintf(stderr, "we have to refetch command for %s\n",XOTclGlobalStrings[name]);*/ + ti->proc = objProc; + ti->cd = Tcl_Command_objClientData(cmd); + } + if (xotclReplacementProc) { + Tcl_Command_objProc(cmd) = xotclReplacementProc; + /*Tcl_CreateObjCommand(in, XOTclGlobalStrings[name], xotclReplacementProc, 0, 0);*/ + } + } + } + return result; +} + +static int +XOTcl_RenameObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + /* this call the Tcl_RenameObjCmd, but it ensures before that + the renamed obj, functions, etc. are not part of XOTcl */ + XOTclObject *obj = NULL; + Tcl_Command cmd; + + /* wrong # args => normal Tcl ErrMsg*/ + if (objc != 3) + return XOTclCallCommand(in, XOTE_RENAME, objc, objv); + + /* if an obj/cl should be renamed => call the XOTcl move method */ + cmd = Tcl_FindCommand(in, ObjStr(objv[1]), (Tcl_Namespace *)NULL,0); + + if (cmd != NULL) { + obj = XOTclGetObjectFromCmdPtr(cmd); + if (obj) { + return XOTclCallMethodWithArgs((ClientData)obj, in, + XOTclGlobalObjects[XOTE_MOVE], objv[2], 1, 0, 0); + } + } + + /* Actually rename the cmd using Tcl's rename*/ + return XOTclCallCommand(in, XOTE_RENAME, objc, objv); +} + +static int +XOTcl_InfoObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + int result, isBody = 0; + if (objc > 1) { + char *opt = ObjStr(objv[1]); + if (isBodyString(opt) && objc > 2) + isBody = 1; + } + result = XOTclCallCommand(in, XOTE_INFO, objc, objv); + + if (isBody && result == TCL_OK) { + char *body = ObjStr(Tcl_GetObjResult(in)); + if (strncmp(body, "::xotcl::initProcNS\n",20) == 0) + body += 20; + Tcl_SetObjResult(in, Tcl_NewStringObj(body, -1)); + } + return result; +} + + +/* + * Obtain the names of the tcl commands + * not available through the stub interface and overload some global commands + */ +int +XOTclShadowTclCommands(Tcl_Interp *in, XOTclShadowOperations load) { + int rc = TCL_OK; + if (load == SHADOW_LOAD) { + int initialized = (RUNTIME_STATE(in)->tclCommands != NULL); + assert(initialized == 0); + RUNTIME_STATE(in)->tclCommands = + NEW_ARRAY(XOTclShadowTclCommandInfo, XOTE_SUBST - XOTE_EXPR + 1); + + /*fprintf(stderr, "+++ load tcl commands %d %d\n", load, initialized);*/ + +#ifdef USE_TCL_STUBS + /* no commands are overloaded, these are only used for calling + e.g. Tcl_ExprObjCmd(), Tcl_IncrObjCmd() and Tcl_SubstObjCmd(), + which are not avalailable in through the stub table */ + rc|= XOTclReplaceCommand(in, XOTE_EXPR, 0, initialized); + rc|= XOTclReplaceCommand(in, XOTE_SUBST, 0, initialized); +#endif + /* for the following commands, we have to add our own semantics */ +#if 1 + rc|= XOTclReplaceCommand(in, XOTE_INFO, XOTcl_InfoObjCmd, initialized); +#endif + rc|= XOTclReplaceCommand(in, XOTE_RENAME, XOTcl_RenameObjCmd, initialized); + + } else if (load == SHADOW_REFETCH) { + XOTclReplaceCommandCheck(in, XOTE_INFO, XOTcl_InfoObjCmd); + XOTclReplaceCommandCheck(in, XOTE_RENAME, XOTcl_RenameObjCmd); + } else { + XOTclReplaceCommandCleanup(in, XOTE_INFO); + XOTclReplaceCommandCleanup(in, XOTE_RENAME); + FREE(XOTclShadowTclCommandInfo*, RUNTIME_STATE(in)->tclCommands); + RUNTIME_STATE(in)->tclCommands = NULL; + } + return rc; +} + +/* + * call a Tcl command with given objv's ... replace objv[0] + * with the given command name + */ +int XOTclCallCommand(Tcl_Interp *in, XOTclGlobalNames name, + int objc, Tcl_Obj *CONST objv[]) { + int result; + XOTclShadowTclCommandInfo *ti = &RUNTIME_STATE(in)->tclCommands[name-XOTE_EXPR]; + ALLOC_ON_STACK(Tcl_Obj*,objc, ov); + + /* {int i; + fprintf(stderr,"calling %s (%p %p) in %p, objc=%d ", + XOTclGlobalStrings[name],ti,ti->proc, in, objc); + for(i=0;i 1) + memcpy(ov+1, objv+1, sizeof(Tcl_Obj *)*(objc-1)); + result = (*ti->proc)(ti->cd, in, objc, ov); + FREE_ON_STACK(ov); + return result; +} Index: generic/xotclStubInit.c =================================================================== diff -u -N --- generic/xotclStubInit.c (revision 0) +++ generic/xotclStubInit.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,81 @@ +/* + * xotclStubInit.c -- + * + * This file contains the initializers for the XOTcl stub vectors. + * + * Copyright (c) 1998-1999 by XXX + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + */ + +#include "xotclInt.h" + +/* + * Remove macros that will interfere with the definitions below. + */ + +/* + * WARNING: The contents of this file is automatically generated by the + * tools/genStubs.tcl script. Any modifications to the function declarations + * below should be made in the generic/tcl.decls script. + */ + +/* !BEGIN!: Do not edit below this line. */ + +XotclIntStubs xotclIntStubs = { + TCL_STUB_MAGIC, + NULL, +}; + +static XotclStubHooks xotclStubHooks = { + &xotclIntStubs +}; + +XotclStubs xotclStubs = { + TCL_STUB_MAGIC, + &xotclStubHooks, + Xotcl_Init, /* 0 */ + NULL, /* 1 */ + XOTclIsClass, /* 2 */ + NULL, /* 3 */ + XOTclGetObject, /* 4 */ + XOTclGetClass, /* 5 */ + XOTclCreateObject, /* 6 */ + NULL, /* 7 */ + XOTclCreateClass, /* 8 */ + XOTclDeleteObject, /* 9 */ + XOTclDeleteClass, /* 10 */ + XOTclAddPMethod, /* 11 */ + XOTclAddIMethod, /* 12 */ + XOTclRemovePMethod, /* 13 */ + XOTclRemoveIMethod, /* 14 */ + XOTclOSetInstVar, /* 15 */ + XOTclOGetInstVar, /* 16 */ + XOTclInstVar, /* 17 */ + NULL, /* 18 */ + XOTclOSetInstVar2, /* 19 */ + XOTclOGetInstVar2, /* 20 */ + XOTclUnsetInstVar2, /* 21 */ + XOTcl_TraceObjCmd, /* 22 */ + XOTclErrMsg, /* 23 */ + XOTclVarErrMsg, /* 24 */ + XOTclErrInProc, /* 25 */ + XOTclObjErrArgCnt, /* 26 */ + XOTclErrBadVal_, /* 27 */ + XOTclObjErrType, /* 28 */ + XOTclStackDump, /* 29 */ + XOTclCallStackDump, /* 30 */ + XOTclDeprecatedMsg, /* 31 */ + XOTclSetObjClientData, /* 32 */ + XOTclGetObjClientData, /* 33 */ + XOTclSetClassClientData, /* 34 */ + XOTclGetClassClientData, /* 35 */ + XOTclRequireObjNamespace, /* 36 */ + XOTclErrBadVal, /* 37 */ + XOTclNextObjCmd, /* 38 */ + XOTclCallMethodWithArgs, /* 39 */ +}; + +/* !END!: Do not edit above this line. */ Index: generic/xotclStubLib.c =================================================================== diff -u -N --- generic/xotclStubLib.c (revision 0) +++ generic/xotclStubLib.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,85 @@ +/* + * xotclStubLib.c -- + * + * Stub object that will be statically linked into extensions of XOTcl + * + * Copyright (c) 2001 UZ + * Copyright (c) 1998 Paul Duffin. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + */ + +/* + * We need to ensure that we use the stub macros so that this file contains + * no references to any of the stub functions. This will make it possible + * to build an extension that references Tcl_InitStubs but doesn't end up + * including the rest of the stub functions. + */ + +#ifndef USE_TCL_STUBS +#define USE_TCL_STUBS +#endif +#undef USE_TCL_STUB_PROCS + +/* + * This ensures that the Xotcl_InitStubs has a prototype in + * xotcl.h and is not the macro that turns it into Tcl_PkgRequire + */ + +#ifndef USE_XOTCL_STUBS +#define USE_XOTCL_STUBS +#endif + +#include "xotclInt.h" + +XotclStubs *xotclStubsPtr = NULL; +XotclIntStubs *xotclIntStubsPtr = NULL; + +/* + *---------------------------------------------------------------------- + * + * Xotcl_InitStubs -- + * + * Tries to initialise the stub table pointers and ensures that + * the correct version of XOTcl is loaded. + * + * Results: + * The actual version of XOTcl that satisfies the request, or + * NULL to indicate that an error occurred. + * + * Side effects: + * Sets the stub table pointers. + * + *---------------------------------------------------------------------- + */ + +CONST char * +Xotcl_InitStubs (interp, version, exact) + Tcl_Interp *interp; + CONST char *version; + int exact; +{ + CONST char *actualVersion; + + actualVersion = Tcl_PkgRequireEx(interp, "XOTcl", version, exact, + (ClientData *) &xotclStubsPtr); + + if (actualVersion == NULL) { + xotclStubsPtr = NULL; + return NULL; + } + + if (xotclStubsPtr == NULL) { + return NULL; + } + + if (xotclStubsPtr->hooks) { + xotclIntStubsPtr = xotclStubsPtr->hooks->xotclIntStubs; + } else { + xotclIntStubsPtr = NULL; + } + + return actualVersion; +} Index: generic/xotclTrace.c =================================================================== diff -u -N --- generic/xotclTrace.c (revision 0) +++ generic/xotclTrace.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,220 @@ +/* -*- Mode: c++ -*- + * $Id: xotclTrace.c,v 1.8 2006/09/27 08:12:40 neumann Exp $ + * + * Extended Object Tcl (XOTcl) + * + * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun + * + * + * xotclTrace.c -- + * + * Tracing facilities for XOTcl + * + */ + +#include "xotclInt.h" +#include "xotclAccessInt.h" + +void +XOTclStackDump(Tcl_Interp *in) { + Interp *iPtr = (Interp *) in; + CallFrame *f = iPtr->framePtr, *v = iPtr->varFramePtr; + Tcl_Obj *varCmdObj; + + XOTclNewObj(varCmdObj); + fprintf (stderr, " TCL STACK:\n"); + if (f == 0) fprintf(stderr, "- "); + while (f) { + Tcl_Obj *cmdObj; + XOTclNewObj(cmdObj); + fprintf(stderr, "\tFrame=%p ", f); + if (f && f->isProcCallFrame && f->procPtr && f->procPtr->cmdPtr) { + fprintf(stderr,"caller %p ",Tcl_CallFrame_callerPtr(f)); + fprintf(stderr,"callerV %p ",Tcl_CallFrame_callerVarPtr(f)); + Tcl_GetCommandFullName(in, (Tcl_Command) f->procPtr->cmdPtr, cmdObj); + fprintf(stderr, "%s (%p) lvl=%d\n", ObjStr(cmdObj), f->procPtr->cmdPtr, f->level); + DECR_REF_COUNT(cmdObj); + } else fprintf(stderr, "- \n"); + + f = f->callerPtr; + } + + fprintf (stderr, " VARFRAME:\n"); + fprintf(stderr, "\tFrame=%p", v); + if (v) {fprintf(stderr, "caller %p", v->callerPtr);} + if (v && v->isProcCallFrame && v->procPtr && v->procPtr->cmdPtr) { + Tcl_GetCommandFullName(in, (Tcl_Command) v->procPtr->cmdPtr, varCmdObj); + if (varCmdObj) { + fprintf(stderr, " %s (%d)\n", ObjStr(varCmdObj), v->level); + } + } else fprintf(stderr, "- \n"); + DECR_REF_COUNT(varCmdObj); +} + +void +XOTclCallStackDump(Tcl_Interp *in) { + XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; + XOTclCallStackContent *csc; + int i=1, entries = cs->top - cs->content; + + fprintf (stderr, " XOTCL CALLSTACK: (%d entries, top: %p) \n", entries, cs->top); + for (csc = &cs->content[1]; csc <= cs->top; csc++) { + fprintf(stderr, " %d: %p ",i++,csc); + if (csc->self) + fprintf(stderr, "OBJ %s (%p), ", ObjStr(csc->self->cmdName), csc->self); + if (csc->cl) + fprintf(stderr, "INSTPROC %s->", className(csc->cl)); + else + fprintf(stderr, "PROC "); + + /*fprintf(stderr, " cmd %p, obj %p, ",csc->cmdPtr, csc->self);*/ + + if (csc->cmdPtr && !csc->destroyedCmd) + fprintf(stderr, "%s (%p), ", Tcl_GetCommandName(in, (Tcl_Command)csc->cmdPtr), + csc->cmdPtr); + else + fprintf(stderr, "NULL, "); + + fprintf(stderr, "frameType: %d, ", csc->frameType); + fprintf(stderr, "callType: %d ", csc->callType); + fprintf(stderr, "cframe %p ", csc->currentFramePtr); + + if (csc->currentFramePtr) + fprintf(stderr,"l=%d ",Tcl_CallFrame_level(csc->currentFramePtr)); + + if (csc->destroyedCmd) + fprintf(stderr, "--destroyed cmd set (%p) ", csc->destroyedCmd); + + fprintf(stderr, "\n"); + } + /* + if (entries > 0) { + XOTclCallStackContent *c; + c = XOTclCallStackFindLastInvocation(in); + fprintf(stderr," --- findLastInvocation %p ",c); + if (c) { + if (c <= cs->top && c->currentFramePtr) + fprintf(stderr," l=%d", Tcl_CallFrame_level(c->currentFramePtr)); + } + c = XOTclCallStackFindActiveFrame(in, 1); + fprintf(stderr," findActiveFrame %p ",c); + if (c) { + if (c <= cs->top && c->currentFramePtr) + fprintf(stderr," l=%d", Tcl_CallFrame_level(c->currentFramePtr)); + } + fprintf(stderr," --- \n"); + } + */ +} + +/* helper function to print the vars dynamically created on a + callframe +static void printLocalTable (CallFrame* c) { + Tcl_HashEntry *entryPtr; + Tcl_HashTable *localVarTablePtr = c->varTablePtr; + Tcl_HashSearch search; + + fprintf(stderr, "LocalVars:"); + + if (localVarTablePtr != NULL) { + for (entryPtr = Tcl_FirstHashEntry(localVarTablePtr, &search); + entryPtr != NULL; + entryPtr = Tcl_NextHashEntry(&search)) { + char *varName = Tcl_GetHashKey(localVarTablePtr, entryPtr); + fprintf(stderr, " %s,", varName); + } + } + fprintf(stderr,"\n"); +} +*/ + +int +XOTcl_TraceObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { + char *option; + if (objc != 2) + return XOTclObjErrArgCnt(in, NULL, "::xotcl::trace"); + + option = ObjStr(objv[1]); + if (strcmp(option,"stack") == 0) { + XOTclStackDump(in); + return TCL_OK; + } + if (strcmp(option,"callstack") == 0) { + XOTclCallStackDump(in); + return TCL_OK; + } + return XOTclVarErrMsg(in, "xotcltrace: unknown option", (char*) NULL); +} + +#ifdef XOTCL_MEM_COUNT +void +XOTclMemCountAlloc(char *id, void *p) { + int new; + XOTclMemCounter *entry; + Tcl_HashTable *table = &xotclMemCount; + Tcl_HashEntry *hPtr; + hPtr = Tcl_CreateHashEntry(table, id, &new); +#ifdef XOTCL_MEM_TRACE + fprintf(stderr, "+++ alloc %s %p\n",id,p); +#endif + /*fprintf(stderr,"+++alloc '%s'\n",id);*/ + if (new) { + entry = (XOTclMemCounter*)ckalloc(sizeof(XOTclMemCounter)); + entry->count = 1; + entry->peak = 1; + Tcl_SetHashValue(hPtr, entry); + } else { + entry = (XOTclMemCounter*) Tcl_GetHashValue(hPtr); + entry->count++; + if (entry->count > entry->peak) + entry->peak = entry->count; + } +} + +void +XOTclMemCountFree(char *id, void *p) { + XOTclMemCounter *entry; + Tcl_HashTable *table = &xotclMemCount; + Tcl_HashEntry *hPtr; +#ifdef XOTCL_MEM_TRACE + fprintf(stderr, "+++ free %s %p\n",id,p); +#endif + + hPtr = Tcl_FindHashEntry(table, id); + if (!hPtr) { + fprintf(stderr, "******** MEM COUNT ALERT: Trying to free <%s>, but was not allocated\n", id); + return; + } + entry = (XOTclMemCounter*) Tcl_GetHashValue(hPtr); + entry->count--; +} + +void +XOTclMemCountDump() { + Tcl_HashTable *table = &xotclMemCount; + Tcl_HashSearch search; + Tcl_HashEntry *hPtr; + int count = 0; + + xotclMemCountInterpCounter--; + if (xotclMemCountInterpCounter != 0) { + return; + } + + fprintf(stderr, "******** XOTcl MEM Count *********\n* count peak\n"); + + for (hPtr = Tcl_FirstHashEntry(table, &search); hPtr != NULL; + hPtr = Tcl_NextHashEntry(&search)) { + char *id = Tcl_GetHashKey(table, hPtr); + XOTclMemCounter *entry = (XOTclMemCounter*) Tcl_GetHashValue(hPtr); + count += entry->count; + fprintf(stderr, "* %4d %6d %s\n", entry->count, entry->peak, id); + ckfree ((char*) entry); + } + + Tcl_DeleteHashTable(table); + + fprintf(stderr, "******** Count Overall = %d\n", count); +} + +#endif Index: generic/xotclUtil.c =================================================================== diff -u -N --- generic/xotclUtil.c (revision 0) +++ generic/xotclUtil.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,125 @@ +/* -*- Mode: c++ -*- + * $Id: xotclUtil.c,v 1.3 2006/02/18 22:17:33 neumann Exp $ + * + * Extended Object Tcl (XOTcl) + * + * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun + * + * + * xotclUtil.c -- + * + * Utility functions + * + */ + +#include "xotclInt.h" + +char * +XOTcl_ltoa(char *buf, long i, int *len) /* fast version of sprintf(buf,"%ld",l); */ { + int nr_written, negative; + char tmp[LONG_AS_STRING], *pointer = &tmp[1], *string, *p; + *tmp = 0; + + if (i<0) { + i = -i; + negative = nr_written = 1; + } else + nr_written = negative = 0; + + do { + nr_written++; + *pointer++ = i%10 + '0'; + i/=10; + } while (i); + + p = string = buf; + if (negative) + *p++ = '-'; + + while ((*p++ = *--pointer)); /* copy number (reversed) from tmp to buf */ + if (len) *len = nr_written; + return string; +} + + +static char *alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; +static int blockIncrement = 8; +/* +static char *alphabet = "ab"; +static int blockIncrement = 2; +*/ +static unsigned char chartable[255] = {0}; + + +char * +XOTclStringIncr(XOTclStringIncrStruct *iss) { + char newch, *currentChar; + + currentChar = iss->buffer + iss->bufSize - 2; + newch = *(alphabet + chartable[(unsigned)*currentChar]); + + while (1) { + if (newch) { /* no overflow */ + *currentChar = newch; + break; + } else { /* overflow */ + *currentChar = *alphabet; /* use first char from alphabet */ + currentChar--; + assert(currentChar >= iss->buffer); + + newch = *(alphabet + chartable[(unsigned)*currentChar]); + if (currentChar < iss->start) { + iss->length++; + if (currentChar == iss->buffer) { + size_t newBufSize = iss->bufSize + blockIncrement; + char *newBuffer = ckalloc(newBufSize); + currentChar = newBuffer+blockIncrement; + /*memset(newBuffer, 0, blockIncrement);*/ + memcpy(currentChar, iss->buffer, iss->bufSize); + *currentChar = newch; + iss->start = currentChar; + ckfree(iss->buffer); + iss->buffer = newBuffer; + iss->bufSize = newBufSize; + } else { + iss->start = currentChar; + } + } + } + } + assert(iss->buffer[iss->bufSize-1] == 0); + assert(iss->buffer[iss->bufSize-2] != 0); + assert(iss->length < iss->bufSize); + assert(iss->start + iss->length + 1 == iss->buffer + iss->bufSize); + + return iss->start; +} + + +void +XOTclStringIncrInit(XOTclStringIncrStruct *iss) { + char *p; + int i = 0; + const size_t bufSize = blockIncrement>2 ? blockIncrement : 2; + + for (p=alphabet; *p; p++) { + chartable[(int)*p] = ++i; + } + + iss->buffer = ckalloc(bufSize); + memset(iss->buffer, 0, bufSize); + iss->start = iss->buffer + bufSize-2; + iss->bufSize = bufSize; + iss->length = 1; + /* + for (i=1; i<50; i++) { + XOTclStringIncr(iss); + fprintf(stderr, "string '%s' (%d)\n", iss->start, iss->length); + } + */ +} + +void +XOTclStringIncrFree(XOTclStringIncrStruct *iss) { + ckfree(iss->buffer); +} Index: library/COPYRIGHT =================================================================== diff -u -N --- library/COPYRIGHT (revision 0) +++ library/COPYRIGHT (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + * XOTcl - Extended OTcl + * + * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) + * + * (a) Vienna University of Economics and Business Administration + * Dept. of Information Systems / New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + Index: library/actiweb/Agent.xotcl =================================================================== diff -u -N --- library/actiweb/Agent.xotcl (revision 0) +++ library/actiweb/Agent.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,236 @@ +# $Id: Agent.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::actiweb::agent 0.8 + +package require xotcl::trace +package require xotcl::comm::httpAccess +package require xotcl::actiweb::webObject +package require xotcl::store::persistence + +package require XOTcl + +# +# current response codes for agent requests: +# +# OK -- content arrived (can be retrieved with sinks content method) +# ERROR -- error on the place invocation +# FAILED -- call itself failed, e.g. cancel +# + +namespace eval ::xotcl::actiweb::agent { + namespace import ::xotcl::* + + Class AgentMemSink \ + -superclass MemorySink \ + -parameter {{agent ""} responseCode} + + AgentMemSink instproc startCb {r} { + my set d "" + next + } + AgentMemSink instproc notifyCb {r} {next} + AgentMemSink instproc incCb {r t c} {next} + AgentMemSink instproc endCb {r} { + if {[Agent exists responseCodes([$r set responseCode])]} { + my set responseCode OK + } else { + my set responseCode ERROR + } + next + } + AgentMemSink instproc cancelCb {r} { + my set responseCode FAILED + next + } + AgentMemSink instproc endReq {r} { + my instvar agent + if {[Object isobject $agent]} { + if {[$agent exists sinks($r)]} { + $agent unset sinks($r) + } + } + } + + # sink class that calls the agent's endcmd in async calls + # the sink is destroyed automatically after endCmd is called + Class AgentAsyncSink -superclass AgentMemSink + AgentAsyncSink instproc endCb {r} { + next + my instvar endCmd responseCode + set result [my content] + if {[info exists endCmd]} { + eval [concat $endCmd $responseCode \"$result\"] + } + my endReq $r + } + AgentAsyncSink instproc cancelCb {r} { + my instvar endCmd responseCode + if {[info exists endCmd]} { + eval [concat $endCmd $responseCode ""] + } + next + my endReq $r + } + + # sink type for sync request + # has to be destroyed with endReq when content is + # read (see createSyncRequest) + Class AgentSyncSink -superclass AgentMemSink + + + Class Agent -superclass WebObject + Agent array set responseCodes { + 200 {OK} + } + + Agent instproc init args { + #my showCall + #my exportProcs invoke + my array set endCmds {} + my array set sinks {} + next + } + + # + # method to create async requests + # + # endCmd specifies the command (or object method or proc ...) that + # is to be called, when the request has ended, empty for sync requests + # + # args are to be given in the form -name value, like: + # -contentType text/xml + # -method PUT + # -data XXX + # + # returns the request object name + # + Agent instproc createRequest {endCmd url args} { + #my showCall + puts stderr "[self] [self proc]" + my instvar place + set s [AgentAsyncSink create [$place autoname agentmemsink] \ + -agent [self]] + set cmd [list Access createRequest -caching 0 -url $url \ + -informObject $s] + foreach {n v} $args {lappend cmd $n $v} + $s set endCmd $endCmd + set t ::[string trimleft [::eval $cmd $args] :] + my set sinks($t) $s + return $t + } + # + # method to create sync reqs ... url and args identical to + # async req + # + # returns the result of sync request, if "OK" + # otherwise: Raises an error + # + Agent instproc createSyncRequest {url args} { + #my showCall + puts stderr "[self] [self proc]" + my instvar place + set s [AgentSyncSink [$place autoname agentmemsink] -agent [self]] + set cmd [list Access createRequest \ + -httpVersion 1.0 \ + -caching 0 -url $url -informObject $s -blocking 1] + foreach {n v} $args {lappend cmd $n $v} + set t ::[string trimleft [::eval $cmd] :] + #puts stderr "After SyncRequest t=$t [$s responseCode]" + if {[$s responseCode] eq "OK"} { + set content [$s content] + # kill the sink + $s endReq $t + return $content + } + $s endReq $t + error "[self] -- Sync request failed: url=$url, responseCode=[$s responseCode]" + } + # + # invoke a remote method directly along the places' dispatcher + # + Agent instproc invoke {endCmd host receiver args} { + puts stderr [self proc]----host=$host + #my showCall + set url http://$host/${receiver}+[url encode $args] + my createRequest $endCmd $url + } + Agent instproc syncInvoke {host receiver args} { + puts stderr [self proc]----host=$host + #[self] showCall + set url http://$host/${receiver}+[url encode $args] + my createSyncRequest $url + } + + # + # invoke a cloning migration + # + Agent instproc cloneImpl {async host startcmd {endCmd ""}} { + #my showCall + set ai [my agentInfo] + set place [Place getInstance] + + # get the full name of the agent ns from the places's agent mgr + #set ns [${place}::agentMgr::rdfNS searchPrefix agent] + + $ai set agentData(script) [${place}::scriptCreator makeScript [self]] + $ai append agentData(script) [my makeVarScript] + $ai set agentData(startcmd) $startcmd + + set data [$ai getXMLScript [$ai name]] + ###puts $data + + #set data [[Place getInstance]::rdfCreator createFromTriples [$ai getTriples]] + if {$async} { + return [my createRequest $endCmd http://$host/[my selfName] \ + -contentType text/xml \ + -method PUT \ + -data $data] + } else { + return [my createSyncRequest http://$host/[my selfName] \ + -contentType text/xml \ + -method PUT \ + -data $data] + } + } + Agent instproc clone {host startCmd endCmd} { + my cloneImpl 1 $host $startCmd $endCmd + } + Agent instproc syncClone {host startCmd} { + my cloneImpl 0 $host $startCmd + } + + # + # invoke a migration that destroys the object in the current place + # + Agent instproc migrateImpl {async host startcmd {endCmd ""}} { + ### GN ??? + puts stderr "--- async=$async" + if {$async} { + set r [my clone $host $startcmd $endCmd] + } else { + set r [my syncClone $host $startcmd] + } + puts stderr "--- [self] destroy +++ " + my destroy ;### FIXME: this does not work in the asynchronous case + return $r + } + Agent instproc migrate {host startCmd endCmd} { + #my migrateImpl 1 $host $startCmd $endCmd + my migrateImpl 0 $host $startCmd $endCmd + } + Agent instproc syncMigrate {host startCmd} { + my migrateImpl 0 $host $startCmd + } + # + # query a place with its hostname for its name + # + Agent instproc getPlaceFromHostName {endCb host} { + set r [my autoname __result] + my createRequest "[self]::$r set" http://$host/ + return [set [self]::$r] + } + + namespace export AgentMemSink AgentAsyncSink AgentSyncSink Agent +} + +namespace import ::xotcl::actiweb::agent::* Index: library/actiweb/AgentManagement.xotcl =================================================================== diff -u -N --- library/actiweb/AgentManagement.xotcl (revision 0) +++ library/actiweb/AgentManagement.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,218 @@ +# $Id: AgentManagement.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::actiweb::agentManagement 0.8 + +package require xotcl::rdf::parser +package require xotcl::rdf::triple +package require xotcl::actiweb::agent + +package require XOTcl + +namespace eval ::xotcl::actiweb::agentManagement { + namespace import ::xotcl::* + + Class AgentInfo -parameter { + {name ""} + {changed 1} + } + + AgentInfo instproc init args { + next + # + # array providing info on a (migrated) agent + # + my array set agentData {} + RDFTripleDB [self]::db + my trace variable agentData w [list [self] changeOccured] + my trace variable name w [list [self] changeOccured] + } + + AgentInfo instproc getXMLScript {name} { + #my showCall + set s { + + } + set s [subst -nobackslashes $s] + foreach n [my array name agentData] { + append s " + [my set agentData($n)] " + } + append s " + +" + } + + AgentInfo instproc changeOccured args {my set changed 1} + + AgentInfo instproc getTriples {} { + #my showCall + if {[my set changed]} { + # build up the triple-db + [self]::db reset + set place [Place getInstance] + set subject "http://[$place set host]:[$place set port]/[my name]" + foreach n [my array names agentData] { + [self]::db add $n $subject [my set agentData($n)] + } + } + return [[self]::db getTriples] + } + + AgentInfo instproc print {} { + puts "AGENT-INFO:" + puts "Name == [my set name]" + foreach a [my array names agentData] { + puts "$a == [my set agentData($a)]" + } + } + + Class AgentVisitor -superclass NodeTreeVisitor -parameter { + {openProperty ""} + {agentInfo ""} + {rdfNS {[my info parent]::rdfNS}} + } + + AgentVisitor instproc fullName {obj n} { + set ns [$obj resolveNS] + return [$ns getFullName $n] + } + + AgentVisitor instproc visit {objName} { + #puts stderr "AgentVisitor visit -- $objName" + set ai [my set agentInfo] + set cl [$objName info class] + #puts stderr "AgentVisitor visit -- $objName cl=$cl <[$ai name]>" + if {[$ai name] eq ""} { + #### not fixed yet + puts stderr "my fixme (AgentManagement)" + if {$cl eq "::About" && + [string first "::Description" [[$objName info parent] info class]] == 0} { + $ai name [$objName set content] + } + } else { + #puts stderr C=<[$objName content]> + #$cl showVars + switch -exact $cl { + ::RDFProperty { + set c [$objName content] + #$objName showVars + if {[$objName exists pcdata]} { + $ai set agentData($c) [lindex [$objName getPCdataList] 0] + } else { + #puts stderr "empty PCDATA" + } + } + } + } + } + + AgentVisitor instproc interpretNodeTree node { + if {[my set agentInfo] eq "" } { + error "Agent Visitor: no agent info provided." + } + $node accept [self] + } + + Class AgentMgr -superclass Agent \ + -parameter { + {acceptedData [list script startcmd senderPlace senderPort senderHost]} + } + + AgentMgr instproc init args { + next + my array set agents {} + # + # this ns class holds the prefix/Rdf-ns pairs used by this + # agent mgr (with default values) + # + XMLNamespace [self]::rdfNS + [self]::rdfNS add agent {http://www.xotcl.org/schema/agent#} + [self]::rdfNS add service {http://www.xotcl.org/schema/service#} + [self]::rdfNS add xotcl {http://www.xotcl.org/schema/xotcl#} + RDFParser [self]::rdfParser + AgentVisitor [self]::agentVisitor + + #package require xotcl::xml::printVisitor + #PrintVisitor [self]::pv + } + + AgentMgr instproc register {name} { + set ai [AgentInfo [self]::[my autoname agentInfo]] + my set agents($name) $ai + $ai name $name + return $ai + } + + AgentMgr instproc deregister {name} { + if {[my info agents $name]} { + # destroy the agents info objects + #my showMsg "calling destroy on [my set agents($name)]" + [my set agents($name)] destroy + # unset the var + my unset agents($name) + } + } + + AgentMgr instproc info args { + if {[lindex $args 0] eq "agents"} { + if {[llength $args] > 1} { + return [my exists agents([lindex $args 1])] + } else { + return [my array names agents] + } + } + next + } + + # + # parses the data of a migration request into a new agent + # info object + # + # name must be stringleft : !! + AgentMgr instproc parseData {name data} { + set ai [my register $name] + next + + [self]::rdfParser reset + [self]::rdfParser parse $data + + #puts stderr =========================================================== + #[self]::pv interpretAll [self]::rdfParser + #puts stderr =========================================================== + + [self]::agentVisitor agentInfo $ai + #foreach tn [[self]::rdfParser info children topNode*] { + # [self]::agentVisitor interpretNodeTree $tn + #} + + [self]::agentVisitor interpretAll [self]::rdfParser + + #puts "************** Received Agent:" + #$ai print + + return $ai + } + + AgentMgr instproc immigrate {AI} { + #set ns [[self]::rdfNS searchPrefix agent] + #::eval [$AI set agentData(${ns}script)] + + #puts stderr "immigrate call showVars" + #$AI showVars + #puts stderr "immigrate showVars done" + + ::eval [$AI set agentData(agent:script)] + #puts stderr "immigrate persistentVars = '[[$AI name] persistentVars]'" + #foreach v [[$AI name] info vars] { $n persistent $v } + + if {[$AI exists agentData(agent:startcmd)]} { + ::after 10 [list [$AI name] [$AI set agentData(agent:startcmd)]] + } + return "" + } + + namespace export AgentInfo AgentVisitor AgentMgr +} + +namespace import ::xotcl::actiweb::agentManagement::* Index: library/actiweb/COPYRIGHT =================================================================== diff -u -N --- library/actiweb/COPYRIGHT (revision 0) +++ library/actiweb/COPYRIGHT (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + * XOTcl - Extended OTcl + * + * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) + * + * (a) Vienna University of Economics and Business Administration + * Dept. of Information Systems / New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + Index: library/actiweb/HtmlPlace.xotcl =================================================================== diff -u -N --- library/actiweb/HtmlPlace.xotcl (revision 0) +++ library/actiweb/HtmlPlace.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,47 @@ +# $Id: HtmlPlace.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::actiweb::htmlPlace 0.8 + +package require xotcl::trace +package require xotcl::actiweb::httpPlace +package require xotcl::store::persistence +package require xotcl::actiweb::agent +package require xotcl::actiweb::pageTemplate + +package require XOTcl + +namespace eval ::xotcl::actiweb::htmlPlace { + namespace import ::xotcl::* + + Class HtmlPlace -superclass Place -parameter {allowExit} + + HtmlPlace instproc init args { + next + # + # just define a minimal object that can react + # with HTML decoration, if the called object + # doesn't exist + PageTemplateHtml create [self]::start.html + + my startingObj [self]::start.html + if {[my exists allowExit]} { + set exitObj [WebObject create [self]::[my set allowExit]] + [Place getInstance] exportObjs $exitObj + $exitObj proc default {} {after 500 ::exit; return "Server terminates"} + } + } + HtmlPlace instproc default {} { + set place [string trimleft [self] :] + set msg "Place $place +

Place $place

Try one of the following links:
    " + foreach o [my exportedObjs] { + set o [string trimleft $o :] + append msg "
  • $o
  • " + } + append msg "
\n" + } + + namespace export HtmlPlace +} + +namespace import ::xotcl::actiweb::htmlPlace::* Index: library/actiweb/HttpPlace.xotcl =================================================================== diff -u -N --- library/actiweb/HttpPlace.xotcl (revision 0) +++ library/actiweb/HttpPlace.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,270 @@ +# $Id: HttpPlace.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::actiweb::httpPlace 0.8 + +package require xotcl::trace +package require xotcl::actiweb::invoker +package require xotcl::actiweb::webObject +package require xotcl::comm::httpd +package require xotcl::scriptCreation::scriptCreator +package require xotcl::store::persistence +package require xotcl::pattern::singleton +package require xotcl::registry::registry +package require xotcl::actiweb::agentManagement +package require xotcl::rdf::tripleRecreator + +package require XOTcl + +namespace eval ::xotcl::actiweb::httpPlace { + namespace import ::xotcl::* + + + Singleton Place -superclass Invoker -parameter { + {exportedObjs ""} + {startingObj ""} + {startCommand ""} + {root $::env(HOME)/public_html} + {port 8086} + {redirect [list]} + {logdir $::xotcl::logdir} + {host localhost} + {allowImmigrationHosts ""} + persistenceFile persistenceDir bccFile bccDir dbPackage + {startHTTPServer 1} + } + + # Giving a bccFile (and possibly bccDir) as optional parameter means + # that an identical copy database will be created in that + # location (e.g. for creating a backup on a second hard drive. + + Place instproc exportObjs args { + foreach obj $args { + my lappend exportedObjs [string trimleft $obj :] + puts stderr "*** exporting $obj, self=[self], objs=[my set exportedObjs]" + } + } + Place instproc isExportedObj obj { + expr {[lsearch [my exportedObjs] [string trimleft $obj :]] != -1} + } + Place instproc default {} { + [self] + } + Place instproc init args { + if {[my set startHTTPServer]} { + Httpd [self]::httpd \ + -port [my port] \ + -root [my root] \ + -redirect [my redirect] \ + -logdir [my logdir] \ + -httpdWrk Place::HttpdWrk + } + # + # PersistenceMgr object for web entities + # + ##### so ist das nicht toll ... init args sollten anders konfigurierbar sein + PersistenceMgr [self]::agentPersistenceMgr -dbPackage multi + + if {[my exists dbPackage]} { + set dbp [my set dbPackage] + } else { + set dbp "" + } + + + if {![my exists persistenceDir]} { + my persistenceDir [string trimleft [self] :] + } + if {![my exists persistenceFile]} { + my persistenceFile persistentObjs-[my port] + } + + [self]::agentPersistenceMgr store add $dbp \ + -dirName [my persistenceDir] \ + -fileName [my persistenceFile] + + if {[my exists bccDir] || [my exists bccFile]} { + if {![my exists bccDir]} { + my bccDir [my set persistenceDir] + } + if {![my exists bccFile]} { + my bccFile [my persistenceFile] + } + [self]::agentPersistenceMgr store add $dbp \ + -dirName [my bccDir] \ + -fileName [my bccFile] + } + + AgentMgr create [self]::agentMgr + RDFCreator create [self]::rdfCreator + + # + # minimal obj for default behavior of the place -> calls go + # to web entities default (customize through a redirecting proc + # as in HtmlPlace or changing startingObj) + # + WebObject create [self]::start + my startingObj [self]::start + Registry [self]::registry + ErrorMgr [self]::error + + ScriptCreator [self]::scriptCreator -dependencyChecking 0 + + my exportObjs [self]::start [self]::agentMgr [self]::registry + next + } + + Place instproc startEventLoop args { + if {[llength $args] > 0} { + set startCommand [lindex $args 0] + ::eval $startCommand + } + + vwait forever ;# if we are in xotclsh call the event loop... + } + + ### + ### Mixin-Classes for Http/Wrk that restricts the usable HTTP methods + ### + Class RestrictHTTPMethods -parameter { + {allowedHTTPMethods "GET PUT HEAD POST CGI"} + } + RestrictHTTPMethods instproc init args { + next + my lappend workerMixins RestrictHTTPMethods::Wrk + } + Class RestrictHTTPMethods::Wrk + RestrictHTTPMethods::Wrk instproc respond {} { + my instvar method + [my info parent] instvar allowedHTTPMethods + if {[lsearch $allowedHTTPMethods $method] != -1} { + return [next] + } else { + my log Error "Restricted Method $method called" + my replyCode 405 + my replyErrorMsg + } + } + + Class Place::HttpdWrk -superclass Httpd::Wrk + + Place::HttpdWrk instproc init args { + my set place [Place getInstance] + next + #puts "New Http-Worker: [self class]->[self] on [my set place]" + } + + Place::HttpdWrk instproc parseParams {o m a call} { + upvar [self callinglevel] $o obj $m method $a args + ### + set decodedCall [url decodeItem $call] + #my showMsg decodedCall=$decodedCall + if {[regexp {^([^ ]*) ?([^ ]*) ?(.*)$} $decodedCall _ \ + obj method args]} { + #foreach a [my set formData] {lappend args [$a set content]} + #puts stderr "Parsed -- Obj: $obj, Method: $method, Args: $args" + return 1 + } else { + puts stderr "could not parse <$decodedCall>" + return 0 + } + } + Place::HttpdWrk instproc respond-HEAD {} { + my respond-GET; ### sendMsg inhibits content for method HEAD + } + Place::HttpdWrk instproc respond-GET {} { + my instvar fileName resourceName place + if {$resourceName eq ""} { + my sendMsg [$place default] text/html ;# kind of index.html + } elseif {[my parseParams obj method arguments $resourceName]} { + if {![my isobject $obj] && [file readable $fileName]} { + next ;# let Httpd handle this + } else { + set response [$place invokeCall obj status $method $arguments] + #puts stderr "RESPONSE: $response" + # + # let the object's sending strategy mixin choose + # the appropriate sending mode + # + # $obj showClass + if {[info exists status] && $status >= 300} { + my replyCode $status + my replyErrorMsg $response + } else { + #my lappend replyHeaderFields Cache-Control maxage=0 + my lappend replyHeaderFields Pragma no-cache + $obj send [self] $response + } + } + } else { + my set version 1.0 + my replyCode 400 + my replyErrorMsg [my callError "Could not parse: " $resourceName] + } + } + Place::HttpdWrk instproc respond-POST {} { + my instvar resourceName place + my respond-GET + } + + + Place::HttpdWrk instproc respond-PUT {} { + my instvar resourceName place data + #my showCall + + if {$resourceName ne ""} { + if {[my parseParams obj m a $resourceName]} { + set obj [string trimleft $obj :] + set AMgr ${place}::agentMgr + + if {[info commands $obj] eq "" && + ![$AMgr info agents $obj]} { + #puts stderr "Receiving to put --------------------------------$obj $data" + set AI [$AMgr parseData $obj $data] + #puts stderr "parray --${AI}::agentData------------------------" + #parray ${AI}::agentData + #puts stderr "parray --${AI}::agentData----------------DONE--------" + #$AI showVars + #puts stderr "----[$AI exists agentData(agent:script)]----" + if {[$AI exists agentData(agent:script)]} { + set immigrateResult [$AMgr immigrate $AI] + #puts stderr "immigrateResult=<$immigrateResult>" + my replyCode 200 + my sendMsg $immigrateResult text/plain + } else { + my set version 1.0 + my replyCode 400 + my replyErrorMsg "Migration failed" + } + } else { + my set version 1.0 + my replyCode 400 + my replyErrorMsg "Migration: object name already in use." + } + } else { + my set version 1.0 + my replyCode 400 + my replyErrorMsg "Migration call must provide object name" + } + } else { + # return the own place name -> any client can call the place via + # placename::start ! + my sendMsg $place text/plain + } + } + + namespace export RestrictHTTPMethods Place + namespace eval RestrictHTTPMethods { + namespace export Wrk + } + namespace eval Place { + namespace export HttpdWrk + } +} + +namespace import ::xotcl::actiweb::httpPlace::* +namespace eval RestrictHTTPMethods { + namespace import ::xotcl::actiweb::httpPlace::RestrictHTTPMethods::* +} +namespace eval Place { + namespace import ::xotcl::actiweb::httpPlace::Place::* +} Index: library/actiweb/Invoker.xotcl =================================================================== diff -u -N --- library/actiweb/Invoker.xotcl (revision 0) +++ library/actiweb/Invoker.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,165 @@ +# $Id: Invoker.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::actiweb::invoker 0.8 + +package require XOTcl + +namespace eval ::xotcl::actiweb::invoker { + namespace import ::xotcl::* + + Class AbstractInvoker + AbstractInvoker abstract instproc invokeCall {o method arguments} + AbstractInvoker abstract instproc eval {obj method arguments} + # + # error types are: tclError, invocationError + # + AbstractInvoker abstract instproc callError {type msg obj arguments} + + Class Invoker -superclass AbstractInvoker -parameter {{place [self]}} + + Invoker instproc handleException {response} { + if {[my isExceptionObject $response]} { + set exceptionObj $response + switch [$exceptionObj info class] { + ::RedirectException { + set obj [$exceptionObj obj] + set method [$exceptionObj method] + set arguments [$exceptionObj arguments] + set response [my eval $obj $method $arguments] + } + ::ErrorException { + set response [$exceptionObj set errorText] + } + } + $exceptionObj destroy + } + return $response + } + + Invoker instproc invokeCall {o s method arguments} { + upvar [self callinglevel] $o obj $s status + my instvar place + set response "" + if {[$place isExportedObj $obj]} { + # if method is not given -> call default on the object + if {$method eq ""} { + set method default + } + if {[$obj isExportedProc $method]} { + #puts stderr "ExportedProcs of $obj: [$obj exportedProcs]" + #puts stderr "Call: $obj -- $method -- $arguments" + set response [my eval $obj $method $arguments] + } else { + #puts stderr "ExportedProcs of $obj: [$obj exportedProcs]" + set response [my callError invocationError [$place startingObj] \ + "Method not found or not exported" \ + "$obj $method $arguments"] + set status 405 + } + } else { + set called $obj + set obj [$place startingObj] + set response [my callError invocationError $obj \ + "Object '$called' unknown" ""] + set status 404 + } + + return [my handleException $response] + } + + # + # tests whether "name" is an exception object or not + # + Invoker instproc isExceptionObject name { + if {[Object isobject $name] && [$name istype Exception]} { + return 1 + } + return 0 + } + + # + # central eval -- all remote call + # are invoked through this method + # + Invoker instproc eval {obj method arguments} { + puts stderr "[clock format [clock seconds] \ + -format %Y/%m/%d@%H:%M:%S] \ + Eval Call: $obj $method $arguments" + if {[catch { + set r [::eval $obj $method $arguments] + } ei]} { + set r [my callError tclError $obj $ei "$obj $method $::errorInfo"] + } + return $r + } + + Invoker instproc callError {type obj msg arguments} { + [my set place]::error $type $obj $msg $arguments + } + + Class ErrorMgr + ErrorMgr instproc isHtml o { + if {[my isobject $o]} { + if {[$o exists contentType]} { + if {[$o set contentType] eq "text/html"} { + return 1 + } + } + } + return 0 + } + + ErrorMgr instproc invocationError {obj msg arguments} { + my showCall + set ee [ErrorException [self]::[my autoname ee]] + $ee instvar errorText + if {[my isHtml $obj]} { + set errorText "

invocation error: $msg" + if {[llength $arguments] > 0} { + append errorText ":\n

object: '[lindex $arguments 0]' \n" + } else { + append errorText \n + } + if {[llength $arguments] > 1} { + append errorText "

call: '[lrange $arguments 1 end]' \n" + } + } else { + set errorText "invocation error: $msg $arguments" + } + return $ee + } + + ErrorMgr instproc tclError {obj msg arguments} { + set ee [ErrorException [self]::[my autoname ee]] + if {[my isHtml $obj]} { + $ee errorText "

tcl error: '$msg' \n

$arguments
" + } else { + $ee errorText "tcl error: '$msg'\n$::errorInfo" + } + return $ee + } + + # + # exceptions in invocation behavior + # + Class Exception + # + # Execpetion that tells the invoker to redirect the call to + # parameters + # + Class RedirectException -superclass Exception -parameter { + {obj ""} + {method ""} + {arguments ""} + } + + Class ErrorException -superclass Exception -parameter { + {errorText ""} + } + + namespace export AbstractInvoker \ + Invoker ErrorMgr Exception \ + RedirectException ErrorException +} + +namespace import ::xotcl::actiweb::invoker::* Index: library/actiweb/PlaceAccessControl.xotcl =================================================================== diff -u -N --- library/actiweb/PlaceAccessControl.xotcl (revision 0) +++ library/actiweb/PlaceAccessControl.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,90 @@ +# $Id: PlaceAccessControl.xotcl,v 1.7 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::actiweb::placeAccessControl 0.8 + +package require xotcl::comm::httpd +package require xotcl::actiweb::httpPlace + +package require XOTcl + +# +# Simple Object Pwd Protection with BasicAccessControl +# +#Usage example: +#ConferenceOrgPlace confPlace -port $placeport -root [pwd] \ + # -mixin PlaceAccessControl +# +#confPlace protect conference.html [confData set password] +# +#confPlace setPasswd conference.html xxx + +namespace eval ::xotcl::actiweb::placeAccessControl { + namespace import ::xotcl::* + + Class ObjectAccessControl -superclass BasicAccessControl + + ObjectAccessControl instproc protectedResource {fn method varAuthMethod varRealm} { + # check whether access to $fn via $method is protected + upvar [self callinglevel] $varAuthMethod authMethod $varRealm realm + my instvar root + # we check only the current directory, not the parent directories + set call [url decodeItem $fn] + regsub "^$root" $call "" call + set call [string trimleft $call /] + set call [string trimleft $call :] + regexp {^([^ ]*)} $call _ call + set call "$root/$call" + + foreach i [list $call $call:$method] { + #puts stderr "check <$i>" + if {[my exists protected($i)]} { + set realm [my set protected($i)] + set authMethod Basic + return 1 + } + } + return 0 + } + + Class PlaceAccessControl + PlaceAccessControl instproc init args { + next + [self]::httpd mixin add ObjectAccessControl + [self]::httpd initWorkerMixins + } + + PlaceAccessControl instproc protect {objName id pwd} { + set objName [string trimleft $objName :] + [self]::httpd protectDir $objName $objName {} + if {$pwd ne ""} { + my setPassword $objName $id $pwd + } + } + + PlaceAccessControl instproc credentialsNotOk {credentials authMethod realm} { + #my instvar passwd + #parray passwd + next + } + + PlaceAccessControl instproc setPassword {realm id pwd} { + set httpd [self]::httpd + if {[$httpd exists passwd($realm:$id)]} { + $httpd unset passwd($realm:$id) + $httpd set passwd($realm:$id) $pwd + } else { + $httpd addRealmEntry $realm "$id $pwd" + } + #$httpd set passwd($realm:admin) nimda + } + PlaceAccessControl instproc removeID {realm id} { + set httpd [self]::httpd + if {[$httpd exists passwd($realm:$id)]} { + $httpd unset passwd($realm:$id) + } + } + + namespace export ObjectAccessControl PlaceAccessControl +} + +namespace import ::xotcl::actiweb::placeAccessControl::* Index: library/actiweb/SecureHtmlPlace.xotcl =================================================================== diff -u -N --- library/actiweb/SecureHtmlPlace.xotcl (revision 0) +++ library/actiweb/SecureHtmlPlace.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,18 @@ +# $Id: SecureHtmlPlace.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::actiweb::secureHtmlPlace 0.8 + +package require xotcl::actiweb::secureHttpPlace +package require xotcl::actiweb::htmlPlace + +package require XOTcl + +namespace eval ::xotcl::actiweb::secureHtmlPlace { + namespace import ::xotcl::* + + Class SecureHtmlPlace -superclass {SecurePlace HtmlPlace} + + namespace export SecureHtmlPlace +} + +namespace import ::xotcl::actiweb::secureHtmlPlace::* Index: library/actiweb/SecureHttpPlace.xotcl =================================================================== diff -u -N --- library/actiweb/SecureHttpPlace.xotcl (revision 0) +++ library/actiweb/SecureHttpPlace.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,52 @@ +# $Id: SecureHttpPlace.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::actiweb::secureHttpPlace 0.8 + +package require xotcl::actiweb::httpPlace + +package require XOTcl + +namespace eval ::xotcl::actiweb::secureHttpPlace { + namespace import ::xotcl::* + + Class SecurePlace -superclass Place -parameter { + {port 443} + {requestCert 0} + {requireValidCert 0} + {certfile server.pem} + {keyfile server.key} + {cafile cacert.pem} + {infoCb {}} + } + + SecurePlace instproc startHttpd {} { + my instvar port root requestCert requireValidCert \ + certfile cafile infoCb keyfile + Httpsd h1 -port $port \ + -root $root \ + -httpdWrk SecurePlace::HttpsdWrk \ + -infoCb $infoCb \ + -requestCert $requestCert \ + -requireValidCert $requireValidCert \ + -certfile $certfile -cafile $cafile \ + -keyfile $keyfile + } + + SecurePlace instproc init args { + my set startHTTPServer 0 + next + [self] startHttpd + } + + Class SecurePlace::HttpsdWrk -superclass {Httpsd::Wrk Place::HttpdWrk} + + namespace export SecurePlace + namespace eval SecurePlace { + namespace export HttpsdWrk + } +} + +namespace import ::xotcl::actiweb::secureHttpPlace::* +namespace eval SecurePlace { + namespace import ::xotcl::actiweb::secureHttpPlace::SecurePlace::* +} Index: library/actiweb/SendStrategy.xotcl =================================================================== diff -u -N --- library/actiweb/SendStrategy.xotcl (revision 0) +++ library/actiweb/SendStrategy.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,51 @@ +# $Id: SendStrategy.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::actiweb::sendStrategy 0.8 + +package require XOTcl + +# +# some simple sending strategy classes -- to be used as mixins +# for web objects +# + +namespace eval ::xotcl::actiweb::sendStrategy { + namespace import ::xotcl::* + + Class SendStrategy + SendStrategy abstract instproc send {httpWrk string} + + # + # send the response given from the place as plain text + # + Class Send=PlainString -superclass SendStrategy + Send=PlainString instproc send {httpWrk string} { + $httpWrk sendMsg $string text/plain + } + + # + # send the response given from the place with content + # type of the obj, if it exists + # + Class Send=TypedString -superclass SendStrategy + Send=TypedString instproc send {httpWrk string} { + $httpWrk sendMsg $string [my set contentType] + } + + # + # send file specified in obj's instvar filename + # + Class Send=File -superclass SendStrategy + Send=File instproc send {httpWrk {response ""}} { + if {[my exists contentType]} { + $httpWrk sendFile [my set filename] [my set contentType] + } else { + $httpWrk sendFile [my set filename] "" + } + } + + namespace export \ + SendStrategy Send=PlainString Send=TypedString Send=File +} + +namespace import ::xotcl::actiweb::sendStrategy::* Index: library/actiweb/UserMgt.xotcl =================================================================== diff -u -N --- library/actiweb/UserMgt.xotcl (revision 0) +++ library/actiweb/UserMgt.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,100 @@ +# $Id: UserMgt.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::actiweb::userMgt 0.8 + +package require XOTcl + +namespace eval ::xotcl::actiweb::userMgt { + namespace import ::xotcl::* + + Class UserMgt + Class UserMgt::User -parameter {name password} + + UserMgt instproc addUser {name password} { + [self class]::User [self]::$name -name $name -password $password + } + + UserMgt set exportedInstprocs [list \ + addUser \ + listUsers \ + deleteUser \ + userMgtOptions\ + ] + + UserMgt instproc init args { + next + my exportedProcs [concat [my exportedProcs] [[self class] set exportedInstprocs]] + } + + UserMgt instproc listUsers {} { + #showCall + set users "" + foreach u [my info children] { + lappend users [namespace tail $u] + } + return $users + } + + UserMgt instproc deleteUser {name} { + if {[[self class]::User info instances [self]::$name] != ""} { + [self]::$name destroy + } + } + UserMgt instproc userMgtOptions {} { + return [[self class] set exportedInstprocs] + } + + Class UserMgtHtml -superclass HtmlRep + + UserMgtHtml instproc addUser args { + set place [HtmlPlace getInstance] + if {$args eq ""} { + set action [url encodeItem "[my htmlCall] [my repObj] [self proc]"] + set c { +
+

Name: + +

Password: + +

+ + + } + set c [subst -nobackslashes -nocommands $c] + + return [my simplePage $place "New User" $c] + } else { + if {[llength $args] > 1} { + set name [lindex $args 0] + set password [lindex $args 1] + set user [[my repObj] [self proc] $name $password] + set c "\n$name entered $place successfully\n" + return [my simplePage "New User" "New User" $c] + } else { + # + # error !!! + } + return [my [self proc]] + } + } + + UserMgtHtml instproc listUsers {} { + set c "" + foreach u [[my repObj] [self proc]] { + append c "

$u \n" + } + return [my simplePage "User List" "User List" $c] + } + + UserMgtHtml instproc userMgtOptions {} { + set c "" + foreach u [[my repObj] [self proc]] { + append c "

$u \n" + } + return [my simplePage "User Management Options" "User Management Options" $c] + } + + namespace export UserMgt UserMgtHtml +} + +namespace import ::xotcl::actiweb::userMgt::* Index: library/actiweb/WebAgent.xotcl =================================================================== diff -u -N --- library/actiweb/WebAgent.xotcl (revision 0) +++ library/actiweb/WebAgent.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,61 @@ +# $Id: WebAgent.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::actiweb::webAgent 0.8 + +package require xotcl::actiweb::agent +package require xotcl::actiweb::invoker +package require xotcl::mixinStrategy + +package require XOTcl + +namespace eval ::xotcl::actiweb::webAgent { + namespace import ::xotcl::* + + # + # Web Agent are special agents that allow us to define another + # object in the paramter webfacade as a facade for the web agent + # itself and the sub-system shielded by the web agent with an interface + # for agents + # + Class WebAgent -superclass Agent + + WebAgent instproc init args { + next + } + + # + # let the web agents facade handle the call -> interprete args + # as "method args" + # return result of the invoker + # + #WebAgent instproc invokeFacade {args} { + # set a "" + # set m "" + # set l [llength $args] + # set o [my webfacade] + # if {$l > 0} { + # set m [lindex $args 0] + # } + # if {$l > 1} { + # set a [lrange $args 1 end] + # } + # + # #puts stderr "Web Agent [self]->invoke: OBJ: $o PROC: $m ARGS: $a" + # + # # + # # tell the invoker to redirect the call to the webfacade object + # # + # set re [RedirectException [self]::[my autoname re] \ + # -obj $o -method $m -arguments $a] + # + # return $re + #} + + #WebAgent instproc default args { + # return [next] + #} + + namespace export WebAgent +} + +namespace import ::xotcl::actiweb::webAgent::* Index: library/actiweb/WebDocument.xotcl =================================================================== diff -u -N --- library/actiweb/WebDocument.xotcl (revision 0) +++ library/actiweb/WebDocument.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,226 @@ +# $Id: WebDocument.xotcl,v 1.9 2007/08/14 16:38:26 neumann Exp $ + +package provide xotcl::actiweb::webDocument 0.8 + +package require xotcl::actiweb::webObject +package require xotcl::comm::httpAccess +package require xotcl::mixinStrategy +package require xotcl::actiweb::sendStrategy + +package require XOTcl + +namespace eval ::xotcl::actiweb::webDocument { + namespace import ::xotcl::* + + Class WebDocument -superclass WebObject \ + -parameter { + {content ""} + filename + } + + + WebDocument instproc init args { + my exportProcs content contentType + next + my mixinStrategy ::Send=TypedString + } + + WebDocument instproc attachFile filename { + my filename $filename + my set oldSendStrategy [my mixinStrategy ::Send=File] + my contentType [Mime guessContentType $filename] + } + + WebDocument instproc detachFile {} { + my mixinStrategy [my set oldSendStrategy] + my unset contentType + my unset filename + } + + WebDocument instproc default args { + if {[my exists content]} { + return [my content] + } + return "" + } + #WebDocument instproc contentLength {} { + # my showCall + # return [expr {[string length [my content]] + 1}] + #} + + + Class TextDocument -superclass WebDocument + TextDocument instproc init args { + next + my contentType text/plain + } + + + Class HtmlDocument -superclass TextDocument + HtmlDocument instproc init args { + next + my contentType text/html + } + + Class FileDocument -superclass WebDocument + + # + # class factory creates classes on the fly if they do not exist + # already, otherwise return exisiting class + # + # auch flyweigth + Class DocumentClassFactory + DocumentClassFactory abstract instproc getClass contentType + + Class FileDocumentClassFactory -superclass DocumentClassFactory + FileDocumentClassFactory instproc getClass contentType { + if {[FileDocument info classchildren $contentType] eq ""} { + Class ::FileDocument::${contentType} -superclass FileDocument + } + return ::FileDocument::${contentType} + } + + Class DocumentFactory + DocumentFactory abstract instproc create {name args} + + Class FileDocumentFactory -superclass DocumentFactory + FileDocumentFactory instproc create {name class filename} { + $class $name + #$name contentType [$class set contentType] + $name attachFile $filename + return $name + } + + Class FileObjectifier + + FileObjectifier instproc init args { + next + FileDocumentClassFactory [self]::clFactory + FileDocumentFactory [self]::objFactory + } + + # + # filename must be given with full path -> + # create objects with filename's tail (prefix can be used to + # give object name a preceding dir) + # + FileObjectifier instproc objectifyFile {place filename {prefix ""}} { + set obj "" + if {[file isfile $filename]} { + set type [Mime guessContentType $filename] + #if {$type ne "unknown/unknown"} { + set fn [string trimleft $prefix/[file tail $filename] /] + set class [[self]::clFactory getClass $type] + set obj [[self]::objFactory create $fn $class $filename] + $place exportObjs $obj + #puts stderr "...objectified: $obj of class $class" + #} + } + return $obj + } + + # + # objectify a whole directory tree + # + FileObjectifier instproc objectifyTree {place dir {prefix ""}} { + if {[file isdirectory $dir]} { + foreach f [glob -nocomplain $dir/*] { + if {[file isfile $f]} { + my objectifyFile $place $f $prefix + } elseif {[file isdirectory $f]} { + my objectifyTree $place $f $prefix/[file tail $f] + } + } + } + } + + + Class GraphicDirectoryObjectifier -superclass FileObjectifier \ + -parameter {{thumbnaildir [::xotcl::tmpdir]}} + GraphicDirectoryObjectifier instproc objectifyTree {place dir {prefix ""}} { + if {[file isdirectory $dir]} { + set indexpage "" + set title "" + set date "" + foreach f [lsort [glob -nocomplain $dir/* $dir/{.date,.title}]] { + set exportedfn [string trimleft $prefix/[file tail $f] /] + if {[file isfile $f]} { + set type [Mime guessContentType $f] + if {[string match "image/*" $type]} { + set class [[self]::clFactory getClass $type] + $class $exportedfn -init -attachFile $f + $place exportObjs $exportedfn + #puts stderr "...objectified: FN=$exportedfn cl=$class d=$dir o=$exportedfn" + ###### + set expThumbnaildir [file dirname $exportedfn]/.thumbnail + set thumbnaildir [file dirname $f]/.thumbnail + if {![file isdirectory $thumbnaildir]} { + file mkdir $thumbnaildir + } + set thumbnail $thumbnaildir/[file tail $f] + set expThumbnail $expThumbnaildir/[file tail $f] + if {![file exists $thumbnail]} { + catch {exec djpeg -pnm $f | \ + pnmscale -xscale .2 -yscale .2 | ppmquant 256 | \ + ppmtogif > $thumbnail} + } + $class $expThumbnail -init -attachFile $thumbnail + $place exportObjs $expThumbnail + #### + append indexpage "" \ + "$exportedfn
\n" + } elseif {[string match *.title $exportedfn]} { + set title [my fileContent $f] + } elseif {[string match *.date $exportedfn]} { + set date

[my fileContent $f]

+ } + } elseif {[file isdirectory $f]} { + if {[file exists $f/.title]} { + set desc ": [my fileContent $f/.title]" + } else { + set desc "" + } + append indexpage "" \ + "$exportedfn$desc
\n" + my objectifyTree $place $f $exportedfn + } + set gindex [string trimleft $prefix/gindex.html /] + HtmlDocument $gindex -content \ + "$title

$title

\ + $date$indexpage" + #puts stderr "mixins of HtmlDocument=<[$gindex info mixins]>" + $gindex mixinStrategy ::Send=TypedString + #$gindex showVars + receiver exportObjs $gindex + } + } + } + GraphicDirectoryObjectifier instproc fileContent {f} { + set FILE [open $f r] + set content [read $FILE] + close $FILE + return $content + } + + + + Class HtmlProxy -superclass HtmlDocument -parameter realSubject + HtmlProxy instproc init args { + next + [Place getInstance] exportObjs [self] + } + HtmlProxy instproc unknown {m args} { + my instvar realSubject + ::eval $realSubject $m $args + return [my default] + } + + namespace export \ + WebDocument TextDocument HtmlDocument FileDocument \ + DocumentClassFactory FileDocumentClassFactory \ + DocumentFactory FileDocumentFactory \ + FileObjectifier GraphicDirectoryObjectifier \ + HtmlProxy +} + +namespace import ::xotcl::actiweb::webDocument::* Index: library/actiweb/WebObject.xotcl =================================================================== diff -u -N --- library/actiweb/WebObject.xotcl (revision 0) +++ library/actiweb/WebObject.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,130 @@ +# $Id: WebObject.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::actiweb::webObject 0.8 + +package require xotcl::actiweb::sendStrategy +package require xotcl::mixinStrategy +package require xotcl::store::persistence + +package require XOTcl + +namespace eval ::xotcl::actiweb::webObject { + namespace import ::xotcl::* + + # + # base interface for all web-entitites + # + Class WebObject -parameter { + {exportedProcs {echo default}} + agentInfo + {contentType ""} + {place ""} + } + + # + # default send strategy == send the response from the place + # + WebObject instproc init args { + #my showCall + my mixinStrategy ::Send=PlainString + my registerPlace + my mixinStrategy ::Persistent=Eager + my persistenceMgr [my place]::agentPersistenceMgr + next + } + + WebObject instproc registerPlace {} { + my set place [Place getInstance] + my set agentInfo [[my place]::agentMgr register [my selfName]] + } + + WebObject instproc deregisterPlace {} { + [my place]::agentMgr deregister [my selfName] + } + + # + # seek for the HTTP worker object that has invoked + # the current call + # + WebObject instproc getWorker {} { + for {set level 1} {1} {incr level} { + if {[catch {set worker [uplevel $level self]}]} { + return "" + } elseif {[$worker istype Place::HttpdWrk]} { + return $worker + } + } + } + WebObject instproc getFormData {} { + [my getWorker] formData + } + + # + # code a call for an action on self; + # action is "proc args" + # + WebObject instproc selfAction {action} { + return [url encodeItem "[string trimleft [self] :] $action"] + } + WebObject instproc action {o action} { + return [url encodeItem "[string trimleft $o :] $action"] + } + WebObject instproc echo {} { + return [self] + } + + WebObject instproc error args { + return "Error on [self]: Invocation '$args' failed." + } + + WebObject instproc default {} { + return "No default behaviour on [self]." + } + + WebObject instproc exportProcs args { + my instvar exportedProcs + foreach a $args { + if {[lsearch $exportedProcs $a] == -1} { + lappend exportedProcs $a + } + } + } + + WebObject instproc isExportedProc p { + expr {[lsearch [my set exportedProcs] $p] != -1} + } + + WebObject instproc selfName {} { + return [string trimleft [self] :] + } + + WebObject instproc objName {obj} { + return [string trimleft $obj :] + } + + WebObject instproc buildAdress {} { + my instvar place + set a http://[$place host] + if {[set p [$place port]]} { + append a :$p + } + } + + WebObject instproc destroy args { + my deregisterPlace + next + } + + # + # simple class, to be inherited before WebObject, if + # every remote method should reach the object + # + Class ExportAll + ExportAll instproc isExportedProc p { + return 1 + } + + namespace export WebObject ExportAll +} + +namespace import ::xotcl::actiweb::webObject::* Index: library/actiweb/cacert.pem =================================================================== diff -u -N --- library/actiweb/cacert.pem (revision 0) +++ library/actiweb/cacert.pem (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDKjCCApOgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBwDELMAkGA1UEBhMCQVQx +DzANBgNVBAgTBlZpZW5uYTEPMA0GA1UEBxMGVmllbm5hMR0wGwYDVQQKExRNeSBU +ZXN0IE9yZ2FuaXphdGlvbjETMBEGA1UECxMKTXkgRGVtbyBDQTErMCkGA1UEAxMi +TXkgRGVtbyBDQSBhdCBNeSBUZXN0IE9yZ2FuaXphdGlvbjEuMCwGCSqGSIb3DQEJ +ARYfa2xhdXMua29sb3dyYXRuaWtAd3Utd2llbi5hYy5hdDAeFw0wMzA5MDUxMTEw +MDFaFw0xMzA5MDIxMTEwMDFaMIHAMQswCQYDVQQGEwJBVDEPMA0GA1UECBMGVmll +bm5hMQ8wDQYDVQQHEwZWaWVubmExHTAbBgNVBAoTFE15IFRlc3QgT3JnYW5pemF0 +aW9uMRMwEQYDVQQLEwpNeSBEZW1vIENBMSswKQYDVQQDEyJNeSBEZW1vIENBIGF0 +IE15IFRlc3QgT3JnYW5pemF0aW9uMS4wLAYJKoZIhvcNAQkBFh9rbGF1cy5rb2xv +d3JhdG5pa0B3dS13aWVuLmFjLmF0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB +gQDIKhCgkG/rSDc8NjDGtJBKW1+fQsoPoBSnMeWOjRQ0YiYomHLZo2XHxsfHsDHj +xXE69GkY9SuwYX/UiF7C0H5LhVew5GTACZsZTbqUWR3D0+R4RQTNJRhQzHq4HE0o +cWjKRiQWWMqNE6S/M4Eri4SJyoaXzhkXjkboYTf/+Dks1wIDAQABozIwMDAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBT5lsU8wZ72pP5lB5ezzqxi5mk4KTANBgkq +hkiG9w0BAQQFAAOBgQA8pZPqoSDBduMtKzNP5A6TerIc7Whm/mwBmiMq0sRHFPWe +sCHJkBxF+ryJT6WDsm1RuCdueHgoppnJ6epdqxmtOAcNcn+OQDU5lzSATBu60B5m +bH4zRsxwn4L9ts+Q1IbjWXc0P1G+2oQSNfvduS7esrs1RM64h6gUJErzxU5cfg== +-----END CERTIFICATE----- Index: library/actiweb/pageTemplate.xotcl =================================================================== diff -u -N --- library/actiweb/pageTemplate.xotcl (revision 0) +++ library/actiweb/pageTemplate.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,103 @@ +package provide xotcl::actiweb::pageTemplate 0.8 + +package require xotcl::actiweb::webObject +package require xotcl::actiweb::invoker +package require xotcl::mixinStrategy + +package require XOTcl + +namespace eval ::xotcl::actiweb::pageTemplate { + namespace import ::xotcl::* + + Class PageTemplate -superclass WebObject + PageTemplate instproc init args { + next + my mixinStrategy ::Send=TypedString + } + + PageTemplate abstract instproc listExportedProcs args + PageTemplate abstract instproc simplePage args + + Class PageTemplateHtml -superclass PageTemplate + + PageTemplateHtml instproc init args { + my contentType text/html + next + } + + PageTemplateHtml instproc listExportedProcs args { + # + # place must be a Html place! + # + set place [HtmlPlace getInstance] + set c " + The following options are avaiable on $n: + " + + foreach i [my exportedProcs] { + set href [my selfAction "[self] $i"] + set app { +

$i + } + append c [subst -nobackslashes $app] + } + return [my simplePage $place [self] $c] + } + + PageTemplateHtml instproc simplePage {title heading content {closing ""}} { + set place [Place getInstance] + set c { + +$title + + +

$heading

+
+

+ +$content + +

$closing + +


+ + +} + return [subst -nobackslashes -nocommands $c] + } + + # + # builds a simple Form -- args are tupels of the form + # {text, name, type, default, size} + # + # + PageTemplateHtml instproc simpleForm {action args} { + set action [my selfAction $action] + set c { + + + } + foreach {text name type def size} $args { + append c " + + + + + " + } + append c { + + + + +
$text:
+ +

+ } + return [subst -nobackslashes -nocommands $c] + } + + namespace export PageTemplate PageTemplateHtml +} + +namespace import ::xotcl::actiweb::pageTemplate::* Index: library/actiweb/pkgIndex.tcl =================================================================== diff -u -N --- library/actiweb/pkgIndex.tcl (revision 0) +++ library/actiweb/pkgIndex.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,24 @@ +# Tcl package index file, version 1.1 +# This file is generated by the "pkg_mkIndex -direct" command +# and sourced either when an application starts up or +# by a "package unknown" script. It invokes the +# "package ifneeded" command to set up package-related +# information so that packages will be loaded automatically +# in response to "package require" commands. When this +# script is sourced, the variable $dir must contain the +# full path name of this file's directory. + +package ifneeded xotcl::actiweb::agent 0.8 [list source [file join $dir Agent.xotcl]] +package ifneeded xotcl::actiweb::agentManagement 0.8 [list source [file join $dir AgentManagement.xotcl]] +package ifneeded xotcl::actiweb::htmlPlace 0.8 [list source [file join $dir HtmlPlace.xotcl]] +package ifneeded xotcl::actiweb::httpPlace 0.8 [list source [file join $dir HttpPlace.xotcl]] +package ifneeded xotcl::actiweb::invoker 0.8 [list source [file join $dir Invoker.xotcl]] +package ifneeded xotcl::actiweb::pageTemplate 0.8 [list source [file join $dir pageTemplate.xotcl]] +package ifneeded xotcl::actiweb::placeAccessControl 0.8 [list source [file join $dir PlaceAccessControl.xotcl]] +package ifneeded xotcl::actiweb::secureHtmlPlace 0.8 [list source [file join $dir SecureHtmlPlace.xotcl]] +package ifneeded xotcl::actiweb::secureHttpPlace 0.8 [list source [file join $dir SecureHttpPlace.xotcl]] +package ifneeded xotcl::actiweb::sendStrategy 0.8 [list source [file join $dir SendStrategy.xotcl]] +package ifneeded xotcl::actiweb::userMgt 0.8 [list source [file join $dir UserMgt.xotcl]] +package ifneeded xotcl::actiweb::webAgent 0.8 [list source [file join $dir WebAgent.xotcl]] +package ifneeded xotcl::actiweb::webDocument 0.8 [list source [file join $dir WebDocument.xotcl]] +package ifneeded xotcl::actiweb::webObject 0.8 [list source [file join $dir WebObject.xotcl]] Index: library/comm/Access.xotcl =================================================================== diff -u -N --- library/comm/Access.xotcl (revision 0) +++ library/comm/Access.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1699 @@ +# -*- tcl -*- $Id: Access.xotcl,v 1.9 2007/08/14 16:38:26 neumann Exp $ + +set httpAccessVersion 0.91 +package provide xotcl::comm::httpAccess $httpAccessVersion + +package require xotcl::comm::pcache +package require xotcl::comm::mime +package require xotcl::comm::connection +package require xotcl::trace + +package require XOTcl + +namespace eval ::xotcl::comm::httpAccess { + namespace import ::xotcl::* + + variable os + variable VERSION + + if {[catch {set os [exec uname -sr]}]} { + if {[catch {set os [exec uname -a]}]} { set os unknownOS } + } + if {![info exists VERSION]} { set VERSION 1.0 } + + + # assert is used only for invariants in the source + proc assert {f r} { + set got [eval $f] + if {$got != $r} { + puts stderr "assertion failed: \[$f\] == $r (got $got)" + } + } + + + # resolve and checkUrl implement URL handling (primarily completion) + proc checkUrl {url} { + #puts stderr "checkUrl: <$url>" + if {![regexp {^([^:]+:/)/([^/]+)(/.*)?$} $url _ scheme network path]} { + regexp {^([^:]+:)(/.*)?$} $url _ scheme path + } + if {![info exists path]} { + # no access scheme provided, try some heuristics... + if {[regexp {^[./]} $url]} { + # expand leading "." to pwd + if {[regexp {^\.(.*)$} $url _ url]} { set url [pwd]$url } + return file:$url + } else { + set url http://$url + regsub {///$} $url // url + return $url + } + } + if {$path eq ""} {set path /} + return [expr {[info exists network] ? + "$scheme/$network$path" : "$scheme$path"}] + } + + # resolving a relative url with respect to a base url (based on rfc 1808) + proc resolve {rel base {childTagName ""}} { + if {$base eq ""} { return [checkUrl $rel] } + if {$rel eq ""} { return $base } + if {[regexp {^[^:]+:/} $rel _]} { return [checkUrl $rel] } + if {![regexp {^([^:]+:/)/([^/]+)(/.*)$} $base _ baseScheme baseNetwork basePath]} { + regexp {^([^:]+:)(/.*)$} $base _ baseScheme basePath + } elseif {[regexp {^[^:/]+:} $rel]} { + return $rel + } + regexp {^(.*)\#.*$} $basePath _ basePath + regexp {^(.*)[?].*$} $basePath _ basePath + if {[regexp {^//([^/]+)/(.*)$} $rel _ relNetwork relPath]} { + return $baseScheme/$relNetwork/$relPath + } + if {[info exists baseNetwork]} { + append baseScheme /$baseNetwork + } + #puts stderr rel=<$rel> + if {![string match "/*" $rel]} { + #puts stderr rel<$rel>base<$basePath> + if {[string match \#* $rel]} { + set r $basePath$rel + } elseif {![regsub {/([^/]*)$} $basePath /$rel r]} { + set r /$rel + } + while {[regsub -all {/\./} $r / r]} {} + regsub {/\.$} $r / r + while {[regsub -all {/[^/.]+/\.\./} $r / r]} {} + # remove leading /../ (netscapes navigator does this) + while {[regsub {^/\.\./} $r / r]} {} + set rel $r + #puts stderr finalrel<$r> + } + #if {$childTagName ne ""} + if {1} { + upvar 1 $childTagName childTag + catch {unset childTag} + if {[regexp {^(.+)\#(.+)$} $rel _ rel childTag]} { + #puts stderr childTag=$childTag,url=$baseScheme$rel. + } + } + return $baseScheme$rel + } + + assert {resolve "" http://mohegan/} http://mohegan/ + assert {resolve http://mohegan/ ""} http://mohegan/ + assert {resolve http://mohegan ""} http://mohegan/ + assert {resolve http://mohegan/ http://nestroy} http://mohegan/ + assert {resolve test.html http://127.0.0.1/} http://127.0.0.1/test.html + assert {resolve test http://nestroy/} http://nestroy/test + assert {resolve test file:/u/neumann/old} file:/u/neumann/test + assert {resolve /test http://nestroy/} http://nestroy/test + assert {resolve //mohegan/index.html http://nestroy/} http://mohegan/index.html + assert {resolve //mohegan/index.html http://nestroy/} http://mohegan/index.html + assert {resolve index.html http://nestroy/dir/} http://nestroy/dir/index.html + assert {resolve ./index.html http://nestroy/dir/} http://nestroy/dir/index.html + assert {resolve ././index.html http://nestroy/dir/} http://nestroy/dir/index.html + assert {resolve ../index.html http://nestroy/dir/} http://nestroy/index.html + assert {resolve ../../index.html http://nestroy/dir/} http://nestroy/index.html + assert {resolve ../../../test file:/u/neumann/old} file:/test + assert {resolve newdir/ http://nestroy/dir/} http://nestroy/dir/newdir/ + assert {resolve /newdir/ http://nestroy/dir/} http://nestroy/newdir/ + assert {resolve file:/u/neumann/ice.html ""} file:/u/neumann/ice.html + assert {resolve \#label http://nestroy/h.html} http://nestroy/h.html + assert {resolve mailto:user@host http://nestroy/h.html} mailto:user@host + assert {resolve ../../../../mis2001/folien/081101.ppt http://wwwi.wu-wien.ac.at/Studium/Abschnitt_2/LVA_ws01/IT/index.html} http://wwwi.wu-wien.ac.at/mis2001/folien/081101.ppt + + + ############################################################## + # Every object of class Access informs the (possibly empty) list of + # informObjects during its lifecycle with the following messages + # + # startCb: when the request for the object is created + # and was classified and initialized + # + # notifyCb: when the type of the incming data is dertermined + # (typically after parsing the http header) + # + # incCb: when new data is available + # + # endCb: when the request is finished sucessfully and the object + # is going to be destroyed + # + # cancelCb: when the request is finished nonsucessfully and the object + # is going to be destroyed + # + # All these messages receive the name of the Access object + # as first parameter, incCb has two more arguments (totalsize + # and currentsize) + + # caching: + # 0 no caching + # 1 volatile cache (does not check cache, keeps spool file for back button) + # 2 persistent cache + + Class Access -parameter { + {method GET} {blocking 0} {httpVersion 1.1} {headers {}} + url query data contentType path caching sinkClass parentUrl + } + Access instproc informObject x { + foreach i $x { my lappend informObjects $i } + } + Access instproc method x { + my set method [string toupper $x] + } + Access instproc unknown {m args} { + error "Method '$m' with args '$args' is unknown for [self class]" + } + + Access proc checkRunning {} { + foreach u [my array names running] { + puts stderr "... running: $u" + } + puts stderr "... -----------" + } + Access proc createRequest args { + #my showCall + set informobject {} + set allowJoin 1 + set nargs {} + foreach {a v} $args { + switch -exact -- $a { + -url {set url $v; lappend nargs $a $v} + -informObject {set informobject $v; lappend nargs $a $v} + -parentRequest {set parentRequest $v} + -allowJoin {set allowJoin $v} + default {lappend nargs $a $v} + } + } + #if {[my array exists running]} {parray [self]::running} + if {[my exists running($url)] && $allowJoin} { + my showMsg "we can join running($url)=[my set running($url)]" + # we can join the request. + # requests are joined by adding the informobjects to + # the existing request + set token [my set running($url)] + # delegation to a different request works only so easy + # when loading to a file... + $token informObject $informobject + return $token + } else { + set token [my autoname ::req] + if {[info exists parentRequest]} { + set token ${parentRequest}$token + } + #my showMsg "TOKEN = $token $url" + return [eval my create $token $nargs] + } + } + Access instproc running {} { + #my showCall + [self class] set running([my url]) [self] + } + Access instproc stop {} { + #showCall + my instvar url + if {[[self class] exists running($url)]} { + #puts stderr "my unset [[self class] set running($url)] + [self class] unset running($url) + #if {[my array exists running]} { parray [self class]::running } + } else { + #puts stderr "not running($url)" + #if {[my array exists running]} { parray [self class]::running } + } + } + #Access instproc destroy args { + # my showCall + # next + #} + Access instproc init args { + #my showCall + my instvar method url + if {![my exists informObjects]} { + my set informObjects {} + } + next + if {![my exists caching]} { + if {$method eq "GET"} { + set defaultCaching 2 + } else { + set defaultCaching 1 + } + my caching $defaultCaching + } + #my showVars + + set url [string trim $url] + my initialize + if {[my classify $url]} { + #my showVars + # now inform all interested objects that we have the object + my doCallbacks startCb + #my showVars blocking + # trigger the transfer... (might be blocking or not) + my $method + if {![my exists finished]} { + # the request is not finished + if {[my blocking]} { + #my showMsg "waiting" + my vwait finished + #my showMsg "waiting DONE" + } + } + } + } + Access instproc getContent {} { + [my set sink] content + } + + ######################################### + Access instproc timeout t { + my set timeout [::after $t [self] timeoutOccured] + } + Access instproc timeoutOccured {} { + #my showCall + my unset timeout + my abort "timeout exceeded" + } + Access instproc timeoutFinish {} { + if {[my exists timeout]} { + after cancel [my set timeout] + my unset timeout + } + } + ######################################### + + Access instproc initialize {} { + #my showCall + my set state 0 + my set meta {} + my set currentsize 0 + my set totalsize 0 + } + Access instproc classify {url} { + my instvar host path port method + #my showVars caching + if {[my caching] > 1 && [persistentCache isValidated $url]} { + #puts stderr "*** cacheable && validated" + #showVars + #persistentCache dump + set access CacheAccess + } elseif {[regexp -nocase {^http://([^/:]+)(:([0-9]+))?(/.*)?$} $url \ + _ host y givenPort path]} { + if {$givenPort ne ""} {set port $givenPort } {set port 80} + switch -exact $method { + PROPFIND - + PROPPATCH - + COPY - + MKCOL - + MOVE - + LOCK - + UNLOCK { + package require xotcl::comm::dav + set access Dav + } + default {set access Http} + } + } elseif {[regexp -nocase {^https://([^/:]+)(:([0-9]+))?(/.*)$} $url \ + _ host y givenPort path]} { + if {$givenPort ne ""} {set port $givenPort } {set port 443} + set access Https + } elseif {[regexp -nocase {^file:(.*)$} $url _ path]} { + set access File + } elseif {[regexp -nocase {^ftp://([^/]+)/(.*)$} $url _ host path]} { + package require xotcl::comm::ftp + set access Ftp + } elseif {[regexp -nocase {^imap://([^/]+)/(.*)$} $url _ host path]} { + package require xotcl::comm::imap + set access Imap + } elseif {[regexp -nocase {^cmd:/(.*)$} $url _ path]} { + set access xotcl::Cmd + } elseif {[regexp -nocase {^ldap://([^/:]+)?(:([0-9]+))?(/.*)$} \ + $url _ host y givenPort path]} { + if {$givenPort ne ""} { set port $givenPort } + my showMsg "*** ldap://<$host>:<$port>/<$path>" + package require xotcl::comm::ldap + set access Ldap + } else { + #my set state 0 + my abort "Unsupported URL: '$url'" + return 0 + } + my class $access + #my showMsg "class of request = $access" + return 1 + } + Access instproc revisit {} { + my class ReAccess + my initialize + my [my set method] + } + ### dummy stubs for 'close' and 'GET' for error cases + Access instproc close {} { + } + Access instproc GET {} { + if {[my exists errormsg]} { ;# the error was already reportet + my finish + } else { + my abort "unknown error" + } + } + + Access instproc headerDone {} { + my instvar caching sink + if {[my exists ignoreBody]} return + if {[my exists sinkClass] && $caching>0 } { + error "can´t set both sinkclass and caching" + } + switch $caching { + 2 { + set sink [CacheFileSink create [self]::cfs] + #my showMsg "[self class] result goes to cache" + $sink notifyCb [self] + } + 1 { + set sink [CacheFileSink create [self]::cfs -persistent 0] + #my showMsg "result goes to volatile cache" + $sink notifyCb [self] + } + 0 { + if {[my exists sinkClass]} { + set sink [[my sinkClass] create [self]::s] + } + } + } + my doCallbacks notifyCb + } + Access instproc mkSpoolFile {{name ""}} { + if {![my exists fileName]} { + my set fileName [persistentCache newEntry [my url] [self] [my caching] $name] + } + } + Access instproc block {} { + my set block + } + Access instproc kill {} { + my showCall + my set state -1; #interrupted + my finish + } + Access instproc abort {msg} { + #my showCall + #my showVars + my instvar state errormsg + if {[catch {::printError "[self] ($state): $msg"} err]} { + puts stderr "\n$err\nERROR [self] ($state): $msg\n" + } + #my set error [list $msg $::errorInfo $::errorCode] + my caching 0 + if {[my exists ignoreBody]} { + my unset ignoreBody + } + set state -2 ;# error + set errormsg $msg + my finish + } + Access instproc finish {} { + #my showCall + my timeoutFinish + my close + #my showVars state ignoreBody + # state is "interrupted" or "error" + if {[my set state] < 0} { + set action cancelCb + set success 0 + } else { + set action endCb + #set state ok + set success 1 + } + if {[my exists ignoreBody]} { + my stop + #my set finished $success + set cmd [my set ignoreBody] + my unset ignoreBody + #my showMsg "executing... <$cmd>" + eval my $cmd + } else { + if {[my exists sink]} { + [my set sink] $action [self] + } + #catch {after cancel $after} ;# ???? + my doCallbacks $action + my stop + my set finished $success + } + } + Access instproc eof {} { + #my showCall + #my showMsg "c [my set currentsize]== t [[self set totalsize]]" + #my set state eof + my finish + } + Access instproc doCallbacks {cb} { + #my showCall + if {[my exists ignoreBody]} { + my showMsg "ignoring callback" + } else { + foreach obj [my set informObjects] { + #my showMsg "*** $obj $cb [self]" + #puts stderr "------------ calling: $obj $cb [self]" + if {[catch {$obj $cb [self]} errormsg]} { + puts stderr "--------------$cb:errormsg=$errormsg, \ + errorInfo=$::errorInfo, \ + errorCode=$::errorCode." + } + #puts stderr "------------ calling DONE: $obj $cb [self]" + } + } + } + Access instproc shutdown {} { + #my showMsg "state=[my set state] > 3" + if {[my set state] > 3} { + my set mustDestroy 1 + } else { + #my showVars + #my showStack + #my showMsg "DESTROY !!!" + if {[my set state] > -2} { + my destroy + } + } + } + + + Class FileAccess -superclass Access + FileAccess instproc initialize args { + my caching 0 + next + } + FileAccess instproc close {} { + } + FileAccess instproc block {} { + my showTimeStart + set S [open [my set fileName] r] + fconfigure $S -translation binary + set block [::read $S] + ::close $S + my showTimeEnd + return $block + } + FileAccess instproc GET {} { + my instvar path response totalsize currentsize \ + fileName informObjects + set fileName $path + set totalsize [file size $path] + set response "file 200 OK" + my headerDone + my set state 4 + set currentsize $totalsize + #my showVars informObjects + foreach obj $informObjects { + $obj incCb [self] $totalsize $currentsize + } + my eof + } + + + Class File -superclass FileAccess + File instproc GET {} { + my instvar path + #puts stderr path=$path,exists=[file exists $path] + if {![file exists $path]} { + my abort "No such file '$path'" + return + } + if {![my exists contentType]} { + my contentType [Mime guessContentType $path] + } + my set sink [FileSink create [self]::fas -fileName $path] + #puts stderr ****sink=$sink,[$sink info class] + #puts stderr "*** before next ([self class])" + next + #puts stderr "*** after next ([self class])" + } + + Class CacheAccess -superclass File + CacheAccess instproc GET {} { + my instvar url + my path [persistentCache cacheFileName $url] + my contentType [persistentCache contentType $url] + my set meta [persistentCache meta $url] + next + } + + Class ReAccess -superclass File + ReAccess instproc GET {} { + my instvar fileName sink + my set block "" + my set currentsize 0 + my caching 0 + if {![info exists fileName]} { + set fileName [$sink set fileName] + } + my set path $fileName + next + } + + + + Class Cmd -superclass Access + Cmd instproc init args { + if {![my exists caching]} { + my caching 0 + } + next + } + Cmd instproc GET {} { + my instvar path block totalsize currentsize \ + response informObjects state + if {[catch {set block [eval $path]} error]} { + my contentType text/plain + set block $error + } else { + my contentType text/html + } + set totalsize [string length $block] + set response "cmd 200 OK" + my headerDone + my set state 4 + set currentsize $totalsize + foreach obj $informObjects { + $obj incCb [self] $totalsize $currentsize + #$obj endCb [self] + } + #set state eof + my finish + } + Cmd instproc block args { + my instvar block + return $block + } + + + #Class NetAccess -superclass Access -parameter {host port} + Class NetAccess -superclass Access + NetAccess instproc initialize args { + if {![my exists blocksize]} {my set blocksize 512} + my set readMethod read + next + } + NetAccess instproc read {} { + #my instvar S blocksize block + #set block [::read $S $blocksize] + my instvar S block blocksize + set block [::read $S $blocksize] + } + NetAccess instproc gzread {} { + my instvar S Z blocksize block + puts -nonewline $Z [::read $S $blocksize] + set block [::read $Z] + #puts stderr len=[string length $block],block=<$block> + } + NetAccess instproc gzopen {} { + my instvar Z S readMethod + requireModules {zipchan libzipchan.so} + fconfigure $S -translation binary + set Z [zipchan] + set readMethod gzread + } + NetAccess instproc close {} { + #my showMsg "**** close persistent=[my exists persistent]" + if {![my exists persistent]} { + foreach stream {S Z} { + if {[my exists $stream]} { + ::close [my set $stream] + my unset $stream + } + } + } + my stop + } + NetAccess instproc hold {} { + my instvar S + $S hold + } + NetAccess instproc resume {} { + my instvar S + $S resume + } + NetAccess instproc readData {} { + #my showCall + if {[catch { + #puts stderr "??????????????readMethod=[my set readMethod]" + my [my set readMethod] + my pushBlock + } err]} { + puts stderr ERR=$err + my set block "" + my abort $err + } + } + NetAccess instproc pushBlock {} { + #my showCall + my instvar block + if {[set n [string length $block]]} { + my instvar currentsize totalsize informObjects sink + #my showVars n currentsize totalsize + incr currentsize $n + if {$currentsize > $totalsize} { + set totalsize $currentsize + } + #my showMsg "total=$totalsize current=$currentsize" + if {[my exists ignoreBody]} { + #puts stderr "ignoring: <$block>" + } else { + if {[info exists sink]} { + $sink incCb [self] $totalsize $currentsize + } + foreach obj $informObjects { + #my showMsg "call incbCb $totalsize $currentsize $obj [$obj info class]" + $obj incCb [self] $totalsize $currentsize + #my showMsg "done incbCb $totalsize $currentsize" + } + } + } else { + #my showVars n + return [my eof] + } + } + + Class Http -superclass NetAccess ;### -parameter {query {httpVersion 1.0}} + Http set proxyfilter httpProxyRequired + Http set proxyhost {} + Http set proxyport {} + Http set accept */* + if {[info exists argv0]} { + Http set useragent "[file tail $argv0] httpAccess/$httpAccessVersion xotcl/$::xotcl::version ($os)" + } + Http proc proxyfilter {host phostv pportv} { + my instvar proxyfilter proxyhost proxyport + upvar \#1 $phostv phost $pportv pport + switch -- $proxyfilter { + httpProxyRequired { + if {[string length $proxyhost]} { + if {![string length $proxyport]} { set proxyport 8080 } + set phost $proxyhost + set pport $proxyport + } + } + } + } + + Http instproc initialize args { + if {![my exists port]} {my set port 80} + if {![my exists httpVersion]} {my set httpVersion 1.1} + next + #my showMsg "result queried from net" + } + Http instproc GET {} { + #my showCall + if {[my exists query]} { + my instvar query caching + my append url ?$query + my append path ?$query + if {$caching == 2} {set caching 1} + my showVars caching $query + } + my open + } + Http instproc HEAD {} { + my open + } + Http instproc POST {} { + # we have query and data only for a uniform interface for + # forms that cann pass the attribute value pairs always via + # query. + if {[my exists query]} { + my data [my query] + } + my open + } + Http instproc PUT {} { + my open + } + # Http1.1 + Http instproc OPTIONS {} { + my showCall + my open + } + # Http1.1 + Http instproc TRACE {} { + my showCall + } + # Http1.1 + Http instproc DELETE {} { + #my showCall + my open + } + Http instproc openConnection {host port reuse} { + return [Connection make [self] $host $port $reuse _] + } + Http instproc open {} { + #my showCall + my instvar url S state host port path + if {$state > 0} { + puts stderr "... [self]:$proc ignoring request in state $state" + return + } + Http proxyfilter $host phost pport + if {[info exists phost] && [string length $phost]} { + set usePort $pport + set useHost $phost + set path $url + } else { + set usePort $port + set useHost $host + } + + set S [my openConnection $useHost $usePort [expr {[my httpVersion]>1.0}]] + if {[$S exists error]} { + my abort [$S set error] + return + } + set state 2 + my running + $S event writable [self] ask + } + + Http instproc ask {} { + my instvar url S state host port path \ + method headers data caching + + $S event writable [self] {} + + if {[pwdManager checkAvailableCredentials $url credentials]} { + eval lappend headers $credentials + #my showMsg "*** new headers = <$headers>" + } + if {$caching==2 && [persistentCache ifModifiedHeader $url ifModified]} { + eval lappend headers $ifModified + #puts stderr "new headers = <$headers>" + } + # Send data in cr-lf format, but accept any line terminators + $S translation {auto crlf} + + #my showMsg "'$method $path HTTP/[my httpVersion]' headers {$headers}" + $S puts "$method $path HTTP/[my httpVersion]" + if {[$S exists error]} { + my abort "Connection refused by host '$host' port '$port'\n\ + [$S set error]" + return + } + + $S puts "Accept: [Http set accept]" + $S puts "Host: $host" + $S puts "User-Agent: [Http set useragent]" + foreach {tag value} $headers { + regsub -all \[\n\r\] $value {} value + set tag [string trim $tag] + if {[string length $tag]} { + #my showMsg "+++ <$tag: $value>" + $S puts "$tag: $value" + } + } + if {[my exists data]} { + $S puts "Content-Length: [string length $data]" + $S puts "Content-Type: [my contentType]" + $S puts "" + $S translation {auto binary} + $S puts-nonewline $data + } else { + $S puts "" + } + $S flush + if {[$S exists error]} { + my instvar host port + my abort "Connection refused by host '$host' port '$port'\n\ + [$S set error]" + } else { + set state 3 + $S event readable [self] headerStart + } + } + + Http instproc headerStart {} { + #my showCall + my instvar S response + set n [$S gets response] + #my showVars n response + if {[$S exists error]} { + my instvar host port + my abort "Error on connection to host '$host' port '$port'\n\ + [$S set error]" + return + } + #my showMsg "n=$n, eof=[$S eof]" + if {$n == -1 && ![$S eof]} { + #my showMsg "******************************input pending, no full line" + return + } + my instvar responseCode responseHttpVersion + if {[regexp {^HTTP/([0-9.]+) +([0-9]+) *} $response _ \ + responseHttpVersion responseCode]} { + #my showMsg "response valid: '$response'" + $S event readable [self] header + } else { + my instvar host port + my abort "Unexpected response from $host:$port\n $n: '$response'" + } + } + Http instproc header {} { + my instvar S meta totalsize + if {[$S gets line]} { + #my showMsg "line=$line" + if {[regexp -nocase {^content-type:(.+)$} $line _ type]} { + my contentType [string trim $type] + } elseif {[regexp -nocase {^content-length:(.+)$} $line _ length]} { + set totalsize [string trim $length] + } + if {[regexp -nocase {^([^:]+): *(.+)$} $line _ key value]} { + lappend meta [string tolower $key] $value + } + } else { + my headerDone + } + } + Http array set expectsBody \ + {GET 1 HEAD 0 POST 1 PUT 0 DELETE 1 OPTIONS 0 TRACE 1} + Http instproc headerDone {} { + #my showVars meta + my instvar S meta method responseCode responseHttpVersion + [self class] instvar expectsBody + set expectBody $expectsBody($method) + + array set v [my set meta] + if {([info exists v(connection)] && $v(connection) eq "close") || \ + $responseHttpVersion < 1.1} { + $S makePersistent 0 + } else { + $S makePersistent 1 + } + + switch $responseCode { + 200 {} + 204 { + #set state empty + my finish + set block "" + set expectBody 0 + return + } + 301 - + 302 { + # the request is redirected to another server + my set ignoreBody [list redirect $v(location)] + + # RFC2068 Note: When automatically redirecting a POST request after + # receiving a 302 status code, some existing HTTP/1.0 user agents + # will erroneously change it into a GET request. + #my method GET + + my showMsg "redirect '[my url]' --> '$v(location)'" + } + 304 { ;# Not Modified, use cached version + my set ignoreBody cacheAccess + set expectBody 1 + #my showMsg "result comes from cache" + } + 401 { + my set ignoreBody \ + [list resubmitAuthenticated $v(www-authenticate)] + #my showMsg "resubmitAuthenticated $v(www-authenticate)" + if {[my exists resubmitAuthenticated]} { + if {[my set resubmitAuthenticated] > 5} { + my abort "Too many wrong passwords given" + } else { + my incr resubmitAuthenticated + } + } else { + my set resubmitAuthenticated 1 + } + set expectBody 1 + } + 404 { + my instvar url + #my showVars + my set ignoreBody [list abort "File Not Found on Server '$url'"] + set expectBody 1 + } + default { + #my showVars responseCode + } + } + next + if {![my exists S]} {;# this request was already canceled + return + } + if {[info exists v(transfer-encoding)]} { + if {$v(transfer-encoding) == "chunked"} { + $S translation {auto binary} + my set state 4 + $S event readable [self] readChunkedLength + } else { + my abort "Unexpected Transfer encoding '$v(transfer-encoding)'" + } + } else { + # yahoo does not send a content length for a get request + #if {$totalsize == 0 && ($responseCode > 300 || !$expectsBody($method) )} + #my showVars method totalsize expectsBody($method) expectBody + # the following is used currently for Actiweb-Agents: + # the reponse of a PUTS contains a BODY! + if {!$expectBody && + [::info exists v(content-length)] && + $v(content-length) > 0} { + set expectBody 1 + #my showMsg "setting expectBody 1" + } + + if {!$expectBody} { + #$S event readable [self] "" + #set state eof + my finish + set block "" + } else { + ### To avoid CRLF problmes we set the translation for + ### the body entity to binary + $S translation binary + my set state 4 + $S event readable [self] readData + } + } + } + + Http instproc cacheAccess {} { + # there is an actual version of the document in the cache + #showCall + persistentCache validated [my url] + #my close + my class CacheAccess + #my showMsg "result comes from cache [persistentCache cacheFileName $url]" + my caching 0 ;# should be really: toCache 0 + my GET + } + + Http instproc redirect location { + # the request is redirected to another server + if {$location ne [my url] } { + #my showVars + my url $location + my initialize + my classify $location + my [my set method] + } + } + Http instproc resubmitAuthenticated headerField { + #my showCall + # the server requires authentification + my instvar path method + if {[pwdManager checkRequestedAuthentification $method $path $headerField \ + type realm]} { + my instvar url caching method headers + array set v $headers + #my showVars + catch {unset v(Authorization)} + set headers [array get v] + pwdManager removePasswd $realm + my close + if {[pwdManager requireCredentials $realm $url]} { + my initialize + if {$caching == 2} {set caching 1} + my $method + } + } else { + my abort "unknown authentication method '$headerField'" + } + } + Http instproc readChunkedLength {} { + #my showCall + my instvar S chunkLength totalsize + set length [$S gets lengthString] + if {$length > 0} { + set chunkLength [expr 0x$lengthString] + #my showVars lengthString chunkLength + if {$chunkLength == 0} { + $S event readable [self] readChunkedTrailer + } else { + incr totalsize $chunkLength + $S translation {binary} + $S event readable [self] readChunkedData + } + } + } + Http instproc readChunkedTrailer {} { + #my showCall + my instvar S state block + set size [$S gets line] + if {$size != 0} { + showObj [self] + my abort "expected trailer size 0, got size $size" + } else { + #set state eof + my finish + set block "" + #showObj [self] + } + } + Http instproc readChunkedData {} { + #my showCall + my instvar S block totalsize currentsize chunkLength + set block [$S readSize $chunkLength] + set received [string length $block] + #my showVars block + #my showVars currentsize totalsize chunkLength received + if {$chunkLength == $received} { + $S translation {auto binary} + $S event readable [self] readChunkedLength + } else { + incr chunkLength -$received + } + my pushBlock + } + + Http instproc readData {} { + #my showCall + my instvar S block totalsize currentsize + set block [$S read] + #puts stderr "????? bl=[string length $block]" + if {[$S exists error]} { + set block "" + my abort [$S set error] + return + } + my pushBlock + #my showMsg "c [my set currentsize]== t [[self set totalsize]]" + if {$currentsize == $totalsize && + [my exists S] && [$S exists persistent]} { + #my showMsg "PERSITENT, end of entity reached" + #my set state eof + my finish + set block "" + #showObj [self] + } + if {[my exists mustDestroy]} { + #my showMsg "mustDestroy was set" + my destroy + } + } + Http instproc close {} { + #my showCall + if {[my exists S]} { + [my set S] close + #unset S + } + #next + } + Http instproc freeConnection {} { + #showCall + my instvar S + #::puts stderr "[self] freeing $S !!!!!!!!!!!!!!!!!!!!!!!" + unset S + } + + + #Access instproc makeZombie {} { + # my showMsg "procs= [my info procs], i [Object info instcommands]" + # my class Zombie + #} + #Class Zombie + #Zombie instproc unknown {m args} { + # my showMsg "+++ zombie method '$m' called" + #} + + + Class Https -superclass Http + Https instproc initialize args { + #my showCall + package require tls + if {![my exists port]} { my set port 443} + next + ### temporary solution, FIXME: + ### zur zeit muss man den secure-webserver.xotcl und + ### secure-webclient.xotcl jedenfalls aus dem xotcl/apps/xocomm-apps + ### verzeichnis starten, da haben wir mal die cfg files in unserem + ### baum.... + source .ssl/ssl-configuration.xotcl + ### + } + Https instproc openConnection {host port reuse} { + set S [Connection make [self] $host $port $reuse reused] + if {$reused} { + #my showMsg "reusing $S" + } else { + my showMsg "make the socket ([$S socket]) secure ..." + set cmd [list $S importSSL] + foreach attr {cafile cadir certfile cipher command keyfile \ + model request require ssl2 ssl3 tls1} { + if {[sslClientConfig exists $attr]} { + lappend cmd -$attr [sslClientConfig set $attr] + } + } + my showMsg "the assembled command is... ´$cmd´" + eval $cmd + puts stderr "CHANNELS= [file channels]" + } + return $S + } + + + + ####################################################################### + Object pwdManager + pwdManager proc requirePasswd {realm username password} { + # used by ftp and imap + my instvar user area + upvar [self callinglevel] $password passwd + if {[my exists pwd($realm)]} { + #my showMsg "*** reusing password for $realm" + set passwd [my set pwd($realm)] + return 1 + } else { + userPwd user $username + if {[userPwd show $realm user($realm) passwd]} { + set area($realm/$username) $realm + return 1 + } + } + return 0 + } + pwdManager proc storePasswd {realm username password} { + # used by ftp and imap + my instvar pwd user + set pwd($realm) $password + set user($realm) $username + } + pwdManager proc removePasswd {realm} { + if {[my exists pwd($realm)]} { + my unset pwd($realm) + my unset user($realm) + } + } + pwdManager proc requireCredentials {realm url} { + regexp {^(.*/)[^/]*$} $url _ path + if {[my exists pwd($realm)]} { + #my showMsg "*** register url=$url for ther realm=$realm" + my set area($path) $realm + return 1 + } else { + my instvar pwd user + if {[info exists ::env(USER)]} { + set USER $::env(USER) + } elseif {[info exists ::env(USERNAME)]} { + set USER $::env(USERNAME) + } else { + set USER unknown + } + + userPwd user $USER + if {[userPwd show $realm user($realm) pwd($realm)]} { + #my showMsg "*** setting password for realm '$realm' url=$path" + my set area($path) $realm + return 1 + } + } + return 0 + } + pwdManager proc encodeCredentials {authMethod realm} { + #my showCall + switch $authMethod { + basic {set credential [my encodeCredentialsBasic $realm]} + digest {set credential [my encodeCredentialsDigest $realm]} + } + return $credential + } + pwdManager proc encodeCredentialsBasic {realm} { + my instvar pwd user + return [list Authorization \ + "Basic [base64 encode $user($realm):$pwd($realm)]"] + } + pwdManager proc encodeCredentialsDigest {realm} { + #my showCall + package require tcu; #FIXME: noch nicht in distribution + my instvar digestResponseData + my mkDigestResponseData $realm + set digestResponse {} + foreach {t v} [array get digestResponseData] { + append digestResponse " $t = \"$v\"," + } + return [list Authorization "Digest [string trimright $digestResponse ,]"] + } + pwdManager proc mkDigestResponseData {realm} { + #my showCall + my instvar pwd user digestResponseData requestUri + # RFC 2617 + # credentials = "Digest" digest-response + # digest-response = 1#( username | realm | nonce | digest-uri + # | response | [ algorithm ] | [cnonce] | + # [opaque] | [message-qop] | + # [nonce-count] | [auth-param] ) + # username = "username" "=" username-value + # username-value = quoted-string + # digest-uri = "uri" "=" digest-uri-value + # digest-uri-value = request-uri ; As specified by HTTP/1.1 + # message-qop = "qop" "=" qop-value + # cnonce = "cnonce" "=" cnonce-value + # cnonce-value = nonce-value + # nonce-count = "nc" "=" nc-value + # nc-value = 8LHEX + # response = "response" "=" request-digest + # request-digest = <"> 32LHEX <"> + # LHEX = "0" | "1"| ...| "e" | "f" + set digestResponseData(username) $user($realm) + set digestResponseData(uri) $requestUri + set digestResponseData(cnonce) "TEST" + set digestResponseData(nc) 00000001 + set digestResponseData(response) [my mkRequestDigest] + #parray digestResponseData + } + pwdManager proc mkRequestDigest {} { + # returns a string of 32 hex digits, which proves that the user + # knows a password + + #A1 = unq(username-value) ":" unq(realm-value) ":" passwd + my instvar digestResponseData pwd requestMethod requestUri + append A1 $digestResponseData(username)\ + : $digestResponseData(realm) : $pwd($digestResponseData(realm)) + if {![my exists digestResponseData(qop)] || + $digestResponseData(qop) eq "auth"} { + append A2 $requestMethod : $requestUri + } elseif {$digestResponseData(qop) eq "auth-int"} { + #A2 = Method ":" digest-uri-value ":" H(entity-body) + append A2 $requestMethod : $requestUri: "" + } + if {[my exists digestResponseData(qop)]} { + append reqDigest $digestResponseData(nonce) : \ + $digestResponseData(nc) : \ + $digestResponseData(cnonce): \ + $digestResponseData(qop) + set reqDigest [md5 [md5 $A1]:$reqDigest:[md5 $A2]] + } else { + set reqDigest [md5 [md5 $A1]:$digestResponseData(nonce):[md5 $A2]] + } + return $reqDigest + } + + pwdManager proc checkAvailableCredentials {url returnCredentials} { + # we start a fresh request and check, whether we have sent for this url + # (directory) already some credentials in an earlier reqhest. + my instvar authMethod + regexp {^(.*/)[^/]*$} $url _ path + if {[my exists area($path)]} { + set realm [my set area($path)] + upvar [self callinglevel] $returnCredentials credentials + #my showMsg "*** adding credentials for realm=$realm and $path" + set credentials [my encodeCredentials $authMethod $realm] + return 1 + } + return 0 + } + pwdManager proc checkRequestedAuthentification {reqMethod path headerField + typeVar realmVar} { + # check for which realm with which authentification method the + # server wants an authentification + #my showCall + upvar [self callinglevel] $typeVar type $realmVar realm + my instvar authMethod digestResponseData requestUri requestMethod + set requestUri $path + set requestMethod $reqMethod + if {[regexp {^Basic realm="(.*)"$} $headerField _ realm]} { + set type basic;# FD: musste da lassen wg. call by reference + set authMethod $type + return 1 + } elseif {[regsub {^Digest } $headerField _ headerField]} { + set type digest ;# FD: musste da lassen wg. call by reference + set authMethod $type + foreach pair [split $headerField ,] { + if {[regexp {^(.*) *= *(".*")$} $pair _ n v]} { + set digestResponseData([string trim $n]) [string trim [string trim $v] \"] + } + } + set realm $digestResponseData(realm) + return 1 + } + return 0 + } + + ####################################################################### + # test classes + Class Sink + Sink instproc startCb {r} { + my set contentLength 0 + next + } + Sink instproc notifyCb {r} { + next + } + Sink instproc incCb {r t c} { + my set contentLength $t + next + } + Sink instproc endCb {r} { + next + #showCall + } + Sink instproc cancelCb {r} { + next + #showCall + } + Sink instproc content {} { + next + #showCall + } + Sink instproc contentLength {} { + my set contentLength + #showCall + } + + + Class TimeSink -superclass Sink + TimeSink instproc startCb {r} { + my set startTime [clock clicks] + next + } + TimeSink instproc notifyCb {r} { + my set notifyTime [clock clicks] + next + } + TimeSink instproc endCb {r} { + my set endTime [clock clicks] + next + my reportTimes + } + TimeSink instproc cancelCb {r} { + my set endTime [clock clicks] + next + } + TimeSink instproc reportTimes {} { + my instvar startTime endTime notifyTime + set bytes [my contentLength] + set grossSecs [expr {($endTime-$startTime)/1000000.0}] + set grossKbps [expr {($bytes/1000.0)/$grossSecs}] + set netSecs [expr {($endTime-$notifyTime)/1000000.0}] + set netKbps [expr {($bytes/1000.0)/$netSecs}] + #if {[catch {set netKbps [expr {($bytes/1000.0)/$netSecs}]}]} { + # set netKbps 0 + #} + set headSecs [expr {$grossSecs-$netSecs}] + foreach v {grossSecs grossKbps netSecs netKbps headSecs} { + set $v [format %.2f [set $v]] + } + my showMsg "got $bytes bytes in $grossSecs ($headSecs+$netSecs) seconds,\ + $grossKbps ($netKbps) KB/S" + } + + + Class ParallelSink -superclass Sink -parameter { + {httpVersion 1.1} + {sinkClass TimeSink} + {maxsimultaneous 20} + } + ParallelSink instproc init args { + next + my set running 1 + my set numrequests 0 + my set sumbytes 0 + my set blocked {} + } + ParallelSink instproc startCb r { + #my showCall + my incr running + my incr numrequests + #puts stderr "... running++ [my set running]" + } + ParallelSink instproc endCb r { + #my showCall + my incr sumbytes [$r set currentsize] + my done $r + } + ParallelSink instproc cancelCb r { + #my showCall + my done $r + } + ParallelSink instproc done r { + #my showCall + my instvar blocked + $r shutdown + my incr running -1 + #puts stderr "... running-- [my set running] [llength [Http info instances]]" + #puts stderr [Http info instances] + #foreach i [Http info instances] {puts stderr "\t$i: [$i set method] [$i set url]"} + #puts stderr RUNNING=[my set running] + if {[llength $blocked] > 0} { + set newreq [lindex $blocked 0] + set blocked [lrange $blocked 1 end] + my scheduleRequest [lindex $newreq 0] [lindex $newreq 1] [lindex $newreq 2] + } elseif {[my set running] < 1} { + my set done 1 + } + } + + + ParallelSink instproc scheduleRequest {method url {parentUrl ""}} { + my instvar requests blocked running maxsimultaneous + if {$running > $maxsimultaneous} { + lappend blocked [list $method $url $parentUrl] + } else { + set cmd [list Access createRequest -url $url \ + -sinkClass [my sinkClass] \ + -informObject [self] \ + -method $method \ + -timeout 25000 \ + -caching 0 -allowJoin 0 -httpVersion [my httpVersion]] + if {$parentUrl ne ""} { + lappend cmd -parentUrl $parentUrl + } + set r [eval $cmd] + } + } + + ParallelSink instproc requests {urls} { + my showTimeStart + foreach url $urls { my scheduleRequest GET $url } + my wait + my showTimeEnd + } + + ParallelSink instproc wait {} { + my instvar running + if {$running > 0} { + set savedValue $running + #my showMsg ".......... waiting for initially $running requests" + if {[catch {my vwait done} err]} { + my showMsg "vwait returned: $err " + } + #my showMsg "$savedValue requests FINISHED " + } + } + + Class MemorySink -superclass Sink + MemorySink instproc incCb {r t c} { + my append d [$r block] + next + } + MemorySink instproc content {} { + return [my set d] + } + MemorySink instproc contentLength {} { + if {[my exists d]} { + return [string length [my set d]] + } else { + return 0 + } + } + + Class FileSink -superclass Sink -parameter fileName + ### write methods + #FileSink instproc startCb {r} { + # next + #} + FileSink instproc notifyCb {r} { + #my showVars + next + my instvar file fileName + if {[info exists fileName]} { + set file [::open $fileName w] + fconfigure $file -translation binary + } else { + # we have no filename; we assume the sink must be a dummy sink + # that deletgates its work to some other FileSink + my class ShadowFileSink + my notifyCb $r + } + } + FileSink instproc incCb {r t c} { + next + if {[my exists file]} { + if {$r == "req0"} { + puts stderr "*******************************************************" + puts stderr [$r block] + puts stderr "*******************************************************" + } + puts -nonewline [my set file] [$r block] + } + } + FileSink instproc endCb {r} { + #my showCall + next + my close + } + FileSink instproc cancelCb {r} { + next + my close + } + FileSink instproc close {} { + if {[my exists file]} { + ::close [my set file] + my unset file + } + } + ### read methods + FileSink instproc content {} { + next + my instvar file fileName + set file [::open $fileName r] + fconfigure $file -translation binary + set d [read [my set file]] + my close + return $d + } + FileSink instproc contentLength {} { + next + if {[my exists fileName]} { + return [file size [my set fileName]] + } else { + return 0 + } + } + + + Class ShadowFileSink -superclass Sink + ShadowFileSink instproc notifyCb {r} { + next + my set token $r + } + ShadowFileSink instproc content {} { + my instvar token + next + return [[$token set sink] content] + } + ShadowFileSink instproc contentLength {} { + my instvar token + next + return [[$token set sink] contentLength] + } + + + Class CacheFileSink -superclass FileSink -parameter {{persistent 1}} + CacheFileSink instproc notifyCb req { + #my showCall + if {![my exists fileName]} { + my instvar persistent + set url [$req set url] + my set fileName [persistentCache newEntry $url $req $persistent ""] + } + # it is important to execute next after setting the fileName... + next + } + CacheFileSink instproc endCb req { + #my showCall + my instvar persistent + next + if {$persistent} { + persistentCache entryDone [$req set url] + } + } + CacheFileSink instproc cancelCb req { + next + if {[my exists fileName]} { + file delete [my set fileName] + my unset fileName + } + } + CacheFileSink instproc destroy {} { + #my showCall + if {[my exists fileName] && ![my set persistent]} { + #my showMsg "file delete $fileName" + file delete [my set fileName] + my unset fileName + } + next + } + + + #=========================================================== + + Class SimpleRequest -parameter { + {caching 0} + {useFileSink 0} + {blocking 1} + {timing 0} + url fileName + timeout httpVersion method headers data query contentType informObject + } + SimpleRequest instproc fileName x { + my set fileName $x + my set useFileSink 1 + } + SimpleRequest instproc init args { + my instvar useFileSink fileName sink caching token + #my showMsg "Starting Request" + next + if {[info exists fileName]} { + set sink [FileSink create [self]::sink -fileName $fileName] + } elseif {$useFileSink || $caching > 0} { + set sink [FileSink create [self]::sink] + } else { + set sink [MemorySink create [self]::sink] + } + #my showMsg "class of sink = [$sink info class]" + if {[my set timing]} { + $sink mixin TimeSink + } + set cmd [list Access createRequest \ + -url [my url] \ + -informObject $sink \ + -blocking [my blocking] \ + -caching $caching] + foreach optionalParameter { + timeout httpVersion method headers data query + contentType informObject + } { + if {[my exists $optionalParameter]} { + lappend cmd -$optionalParameter [my set $optionalParameter] + } + } + #my showMsg "cmd=$cmd" + set token [eval $cmd] + #if {[my success]} { + # $sink reportTimes + # #puts stderr <[$sink content]> + #} + } + SimpleRequest instproc success {} { + if {[my exists token]} { + return [expr {[[my set token] set finished] == 1}] + } + return 0 + } + SimpleRequest instproc destroy {} { + if {[my exists token]} { + [my set token] destroy + } + next + } + SimpleRequest instproc getContent {} { + [my set sink] content + } + SimpleRequest instproc getContentLength {} { + [my set sink] contentLength + } + #SimpleRequest instproc destroy args { next } + + ####################################################################### + + namespace export \ + Access FileAccess File CacheAccess ReAccess \ + Cmd NetAccess Http Https Sink TimeSink \ + ParallelSink MemorySink FileSink \ + ShadowFileSink CacheFileSink SimpleRequest +} + +namespace import ::xotcl::comm::httpAccess::* Index: library/comm/COPYRIGHT =================================================================== diff -u -N --- library/comm/COPYRIGHT (revision 0) +++ library/comm/COPYRIGHT (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + * XOTcl - Extended OTcl + * + * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) + * + * (a) Vienna University of Economics and Business Administration + * Dept. of Information Systems / New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + Index: library/comm/Connection.xotcl =================================================================== diff -u -N --- library/comm/Connection.xotcl (revision 0) +++ library/comm/Connection.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,256 @@ +# -*- tcl -*- $Id: Connection.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::comm::connection 1.0 + +package require XOTcl + +namespace eval ::xotcl::comm::connection { + namespace import ::xotcl::* + + Class Connection -parameter {host port req socket handle} + + Connection proc make {r host port reuse reusedVar} { + #my showCall + my instvar openConnections + upvar [self callinglevel] $reusedVar reused + if {$reuse} { + set handle $host:$port-[$r set blocking] + #if {[array exists openConnections]} {parray openConnections} + if {![info exists openConnections($handle)]} { + # there is no persistent connection, we create a new one + set reused 0 + set openConnections($handle) \ + [Connection new -host $host -port $port -req $r -handle $handle] + #my showMsg "$openConnections($handle) CONNECTION add for $handle added" + } else { + # there is a persistent connection + set reused 1 + set c $openConnections($handle) + $c instvar req + #::puts stderr "$c CONNECTION reuse for $handle ($c) new req=$r" + if {[info exists req]} { + # the persistent connection is active with some request $req + #::puts stderr "$c CONNECTION req $req already active" + } else { + # the persistent connection is currently not active + $c set req $r + } + } + return $openConnections($handle) + } else { + set reused 0 + return [Connection new -host $host -port $port -req $r] + } + } + Connection proc removeHandle handle { + #my showVars + #puts stderr "***************** unsetting $handle ***************" + if {[my exists openConnections($handle)]} { + my unset openConnections($handle) + } + } + Connection instproc init args { ;# the constructor creates the socket + my set blocked {} + next + if {[my exists socket]} { + my set keepOpen 1 + } else { + my set keepOpen 0 + if {[catch {my socket [socket -async [my host] [my port]]} msg]} { + my set error $msg + return + } + } + ::fconfigure [my socket] -blocking false -buffersize 16384 + } + #Connection instproc STATUS {ctx} { + # my instvar socket + # ::puts stderr "*** $ctx: $socket blocking=[::fconfigure $socket -blocking]" + #} + Connection instproc destroy {} { ;# the destructor closes the socket + #my showCall + if {[my exists handle]} { + #my showVars handle + # the connection was created via make + [self class] removeHandle [my handle] + #::puts stderr "my CONNECTION close and destroy [my handle]" + } else { + #::puts stderr "my CONNECTION close and destroy" + } + # in cases of errors we might not have a socket yet + if {[my exists socket]} { + close [my socket] + } + next + } + Connection instproc translation {translation} { + #showCall + ::fconfigure [my socket] -translation $translation + } + Connection instproc importSSL args { + #my showCall + package require tls + eval tls::import [my socket] $args + } + Connection instproc fconfigure args { + #my showCall + eval ::fconfigure [my socket] $args + } + Connection instproc event {type r method} { + #my showCall + my instvar req blocked + # is the request in the argument list the currently active request? + if {[info exists req] && $r == $req} { + # a request can overwrite its active request + if {$method eq ""} { + ::fileevent [my socket] $type "" + #my showMsg "CONNECTION clear for [my socket]" + } else { + #my showMsg "CONNECTION register for [my socket]" + ::fileevent [my socket] $type [list $r $method] + } + } else { + #my showMsg "event BLOCKING current request=$req, new=$r $method" + #my showMsg "event BLOCKING rd=[::fileevent [my socket] readable]" + #my showMsg "event BLOCKING wr=[::fileevent [my socket] writable]" + #my showMsg "event BLOCKING bl=$blocked" + ::lappend blocked $r $type $method + } + } + Connection instproc hold {} { + my set continueCmd [list ::fileevent [my socket] readable \ + [::fileevent [my socket] readable]] + ::fileevent $socket readable {} + #my showVars continueCmd + } + Connection instproc resume {} { + #my showCall + if {[my exists continueCmd]} { + eval [my set continueCmd] + my unset continueCmd + } + } + + Connection instproc puts {string} { + #my showCall + if {[catch {::puts [my socket] $string} msg]} { + ::puts stderr message=$msg + } + } + Connection instproc puts-nonewline {string} { + #my showCall + if {[catch {::puts -nonewline [my socket] $string} msg]} { + ::puts stderr message=$msg + } + } + Connection instproc gets {var} { + #my showCall + upvar [self callinglevel] $var result + if {[catch {set n [::gets [my socket] result]} msg]} { + my set error $msg + #my showMsg "CONNECTION error" + return 0 + } + #my showMsg "n=$n, result=<$result>" + return $n + } + Connection instproc read {} { + #my showCall + my instvar socket + if {[catch {set result [::read $socket [::fconfigure $socket -buffersize]]} msg]} { + my set error $msg + return "" + } + #my showMsg Done + return $result + } + Connection instproc readSize {length} { + if {[catch {set result [::read [my socket] $length]} msg]} { + my set error $msg + return 0 + } + return $result + } + Connection instproc flush {} { + #my showCall + if {[catch {::flush [my socket]} msg]} { + my set error $msg + } + } + Connection instproc eof {} { + #my showCall + if {[my exists error]} { + return 1 + } else { + return [::eof [my socket]] + } + } + Connection instproc close {} { + #my showCall + my instvar req socket blocked + if {![info exists socket]} return ;# error during connection open + ::fileevent $socket readable "" + ::fileevent $socket writable "" + $req freeConnection + if {[my exists persistent]} { + my flush + #::puts stderr "[self] PERSISTENT CONNECTION wanna close" + if {$blocked eq ""} { + ::fileevent $socket readable [list [self] destroy] + unset req + } else { + #my showVars blocked + set req [lindex $blocked 0] + set type [lindex $blocked 1] + set method [lindex $blocked 2] + set blocked [lrange $blocked 3 end] + #my showMsg "in persistent connection unblock $type [list $req $method]" + ::fileevent $socket $type [list $req $method] + } + } else { + #my showMsg "in nonpersistent connection blocked=$blocked" + if {$blocked ne ""} { + set req [lindex $blocked 0] + set type [lindex $blocked 1] + set method [lindex $blocked 2] + set nblocked [lrange $blocked 3 end] + close $socket + unset socket + if {[my exists handle]} { + [self class] removeHandle [my handle] + } + if {[my exists error]} { + #my showMsg "UNSETTING ERROR -----------" + my unset error + } + my init + set blocked $nblocked + ::fileevent $socket $type [list $req $method] + #my showMsg "REANIMATE $socket $type [list $req $method]" + #my showVars + } else { + #my showMsg "Nothing blocked: readable=[::fileevent $socket readable]" + + my destroy + } + } + } + Connection instproc makePersistent {p} { + if {$p} { + my set persistent 1 + } else { + if {[my exists persistent]} { + my unset persistent + #my showMsg "no longer persistent" + } + } + } + + namespace export Connection +} + +namespace import ::xotcl::comm::connection::* + +if {[info command bgerror] eq ""} { + proc bgerror {msg} { puts stderr "******* bgerror $msg $::errorInfo*****"} +} Index: library/comm/Dav.xotcl =================================================================== diff -u -N --- library/comm/Dav.xotcl (revision 0) +++ library/comm/Dav.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,175 @@ +# $Id: Dav.xotcl,v 1.4 2006/02/18 22:17:33 neumann Exp $ + +package provide xotcl::comm::dav 0.9 + +package require XOTcl + +namespace eval ::xotcl::comm::dav { + package require xotcl::comm::httpAccess + namespace import ::xotcl::* + + Class Dav -superclass Http + Dav instproc initialize args { + my instvar contentType + #showCall + set contentType text/xml + next + } + + Dav instproc PROPFIND {} { + #showCall + # extra dav headers + # Depth: ("0" | "1" | "infinity") [infinity is the default] + + # body is a propfind XML-Element + # + # + # + # + + # this should be set by the clients + # + # + # + # + my open + } + Dav instproc PROPPATCH {} { + #showCall + # body is a propertyupdate XML-Element + # + # + # + + # set xmlReqBody($method) " + # + # + # + # + # + # + # " + my open + } + Dav instproc MKCOL {} { + #showCall + # invoked without a request body (may contain a message body?) + my open + } + Dav instproc GET {} { + #showCall + # invoked without a request body and without extra header + # back to HTTP class + next + } + Dav instproc HEAD {} { + #showCall + # invoked without a request bodyand without extra header + # back to HTTP class + next + } + Dav instproc POST {} { + #showCall + # the same as in RFC2068 + # back to HTTP class + next + } + Dav instproc DELETE {} { + #showCall + # extra dav headers + # Depth: ("0" | "1" | "infinity") + + # invoked without a request body + my open + } + Dav instproc PUT {} { + #showCall + # PUT for Non-Collection Resources --> RFC2068 + # PUT for Collections --> MKCOL + # next + } + Dav instproc COPY {} { + #showCall + # extra dav headers + # If: [see 9.4 WebDAV] + # Destination: [see RFC2396 for the definition of absolutURI] + # Depth: ("0" | "1" | "infinity") + # Overwrite: ("T" | "F") + + + # body is a propertybehavior XML-Element + # + # + # + # + my open + } + Dav instproc MOVE {} { + #showCall + # extra dav headers + # If: [see 9.4 WebDAV] + # Destination: [see RFC2396 for the definition of absolutURI] + # Depth: "infinity" [see 8.9.2] + # Overwrite: ("T" | "F") + + # body is a propertybehavior XML-Element + # see COPY + my open + } + Dav instproc LOCK {} { + #showCall + # extra dav headers + # If: [see 9.4 WebDAV] + # Destination: [see RFC2396 for the definition of absolutURI] + # Depth: ("0" | "1" | "infinity") + # Timeout: [see 9.8 WebDAV] + # Authorization: (defined in HTTP1.1 in 14.8) + + # body is a lockinfo XML-Element + # + # + # + # + # + # + # + my open + } + + # The Lock-Token request header is used with the UNLOCK method to + # identify the lock to be removed. + Dav instproc UNLOCK {} { + my instvar headers + #showCall + # extra dav headers + # Lock-Token: [see 8.11 in WebDAV] + + # invoked without a request body + my open + } + + #--------------------- + # Utility # + #--------------------- + + #? + Object xmlReqBodyManager + xmlReqBodyManager proc requireXmlReqBody {request} { + } + + #? + Object davHeaderManager + davHeaderManager proc requireDavHeader {request} { + } + + + + #LOCK /DAV/welcome.html HTTP/1.1 + #Host: wawog + #Connection: close + + namespace export Dav \ + xmlReqBodyManager davHeaderManager +} + +namespace import ::xotcl::comm::dav::* Index: library/comm/Ftp.xotcl =================================================================== diff -u -N --- library/comm/Ftp.xotcl (revision 0) +++ library/comm/Ftp.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,175 @@ +# $Id: Ftp.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::comm::ftp 0.9 +package require xotcl::comm::httpAccess + +package require XOTcl + +namespace eval ::xotcl::comm::ftp { + namespace import ::xotcl::* + + Class Ftp -superclass NetAccess -parameter {user passwd} + Ftp instproc initialize args { + #my showCall + my instvar port caching user passwd loginMsg resp blocksize + set port 21 + set blocksize 1024 + set caching 0 + set user ftp + set passwd cineast@ + set loginMsg {} + set resp(connect) {220 provideUser} + set resp(provideUser) {331 providePasswd} + set resp(providePasswd) {230 loginFinished} + set resp(loginFinished) {227 pasv} + set resp(pasv) {200 type} + set resp(type-list) {150 list} + set resp(type-retr) {150 retr 550 retry-retrieve} + set resp(transfer) {226 transferDone} + next + } + Ftp instproc err {state reply} { + my abort "Error in $state: $reply" + } + Ftp instproc queryServer {query state} { + my instvar S + puts $S $query + flush $S + fileevent $S readable [::list [self] response $state] + } + Ftp instproc response {state} { + #my showCall + my instvar S code msg + set reply [gets $S] + #my showVars reply + if {[regexp {^([0-9]+)[-](.*)$} $reply _ code msg]} { + fileevent $S readable [::list [self] responseMulti $state] + } else { + regexp {^([0-9]+) (.*)$} $reply _ code msg + my responseEnd $state + } + } + Ftp instproc responseMulti {state} { + # multi line response + my instvar S code msg + set m [gets $S] + if {[regexp "^$code " $m]} { + my responseEnd $state + } else { + # try to strip code and dash + regexp "^$code-(.*)\$" $m _ m + append msg \n$m + } + } + Ftp instproc responseEnd {state} { + my instvar S code msg resp + fileevent $S readable {} + #puts stderr "code=$code, msg=<$msg>" + foreach {c newState} $resp($state) { + if {$c == $code} { return [my $newState] } + } + my err $state "expected=$resp($state), got $code $msg" + } + Ftp instproc GET {} { + my instvar S host port url + regexp {^(.*):([0-9]+)$} $host _ host port + my running + # rb running my $url ;# ??? + # proxy ? + set S [socket -async $host $port] + fconfigure $S -blocking false -translation {auto crlf} + fileevent $S readable [::list [self] response connect] + } + Ftp instproc provideUser {} { + my instvar user msg loginMsg + set loginMsg $msg + my queryServer "USER $user" provideUser + } + Ftp instproc providePasswd {} { + my instvar passwd + # if {[pwdManager requirePasswd "Ftp $user\@$host" $user password]} { + # my queryServer "PASS $password" providePasswd + # } + my queryServer "PASS $passwd" providePasswd + } + Ftp instproc loginFinished {} { + my instvar msg loginMsg + append loginMsg \n$msg + my queryServer "PASV" loginFinished + } + Ftp instproc pasv {} { + my instvar S D msg + set d {([0-9]+)} + if {[regexp "\[(]$d,$d,$d,$d,$d,$d" $msg _ 1 2 3 4 p1 p2]} { + if {[catch {set D [socket -async $1.$2.$3.$4 [expr {$p1*256 + $p2}]]} err + ]} { + return [my err $proc $err] + } + fconfigure $D -blocking no -translation binary + } else { + return [my err $proc $msg] + } + my queryServer "TYPE I" pasv + } + Ftp instproc type {} { + my instvar path + if {$path=={}} { + my queryServer "LIST" type-list + } elseif {[regexp /$ $path]} { + my queryServer "LIST $path" type-list + } else { + my queryServer "RETR $path" type-retr + } + } + Ftp instproc retry-retrieve {} { + my instvar path url + append url / + my queryServer "LIST $path/" type-list + } + Ftp instproc list {} { + my instvar S D contentType + set contentType text/dirlist + my headerDone + fileevent $S readable [::list [self] response transfer] + fileevent $D readable [::list [self] readData] + } + Ftp instproc read {} { + # the method read is called by the more general method readData + my instvar D block blocksize + if {[::eof $D]} { + set block "" + close $D + unset D + } else { + #puts stderr blocksize=$blocksize + set block [::read $D $blocksize] + #puts stderr read:[string length $block]bytes + } + } + Ftp instproc transferDone {} { + my instvar D S + if {[info exists D]} { + fileevent $S readable {} + set block "" + close $D + unset D + } + my finish + } + Ftp instproc retr {} { + my instvar S D msg totalsize contentType path + regexp {[(]([0-9]+)[ ]+[Bb]ytes} $msg _ totalsize + set contentType [Mime guessContentType $path] + my headerDone + if {[info exists S]} { + # file dialog was not canceled + fileevent $S readable [::list [self] response transfer] + fileevent $D readable [::list [self] readData] + fconfigure $D -translation binary + } + } + + namespace export Ftp +} + +namespace import ::xotcl::comm::ftp::* Index: library/comm/Httpd.xotcl =================================================================== diff -u -N --- library/comm/Httpd.xotcl (revision 0) +++ library/comm/Httpd.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,837 @@ +# -*- tcl -*- $Id: Httpd.xotcl,v 1.9 2007/08/14 16:38:26 neumann Exp $ +# +# The XOTcl class Httpd implements an HTTP/1.0 and HTTP/1.1 server with +# basic functionality. +# +# Gustaf Neumann (neumann@wu-wien.ac.at) + +set VERSION 1.1 +package provide xotcl::comm::httpd $VERSION + +package require XOTcl + +#package require xotcl::comm::httpAccess + +package require xotcl::comm::connection +package require xotcl::trace +package require xotcl::comm::mime + +namespace eval ::xotcl::comm::httpd { + namespace import ::xotcl::* + + Class Httpd -parameter { + {port 80} + ipaddr + {root ./} + {logdir $::xotcl::logdir} + {httpdWrk Httpd::Wrk} + {redirects [list]} + {workerTimeout 10000} + } + Httpd proc Date seconds {clock format $seconds -format {%a, %d %b %Y %T %Z}} + Httpd instproc checkRoot {} { + my instvar root + set root [string trimright $root /] + if {![file isdir $root]} { + puts stderr "Warning: create root directory '$root'" + file mkdir $root + } + # make directory absolute + set currentdir [pwd] + cd $root + set root [pwd] + #puts stderr "[self] root=$root" + cd $currentdir + } + + proc ! string { + set f [open [::xotcl::tmpdir]log w+]; + puts $f "[clock format [clock seconds]] $string" + close $f} + + Httpd instproc init args { + my instvar port logdir logfile redirects + if {![my exists workerMixins]} { + my set workerMixins {} + #puts stderr "resetting workermixins of [self]" + } + next + set proto [string trim [namespace tail [my info class]] :d] + puts stderr "Starting XOTcl [string toupper $proto] server $::VERSION\ + [string tolower $proto]://[info hostname]:$port/" + + # Start a server by listening on the port + if {[my exists ipaddr]} {set ip "-myaddr [my set ipaddr]"} {set ip ""} + my set listen [eval [list socket -server [list [self] accept]] $ip $port] + #my set listen [socket -server [list [self] accept] $port] + + my checkRoot + if {![file isdir $logdir]} {file mkdir $logdir} + set logfile [open $logdir/serverlog-$port a+] + my array set requiresBody \ + {GET 0 HEAD 0 POST 1 PUT 1 DELETE 0 OPTIONS 0 TRACE 0} + } + Httpd instproc destroy {} { # destructor + catch {close [my set listen]} + catch {close [my set logfile]} + next + } + Httpd instproc accept {socket ipaddr port} { # Accept a new connection and set up a handler + #puts stderr "using workermixins of [self] {[my set workerMixins]}" + + [my set httpdWrk] new -childof [self] -socket $socket -ipaddr $ipaddr \ + -port $port -mixin [my set workerMixins] + } + Httpd instproc redirect list { + foreach {pattern hostport} $list { + my lappend redirects $pattern $hostport + } + } + + + Class Httpd::Wrk -parameter {socket port ipaddr} + Httpd::Wrk array set codes { + 200 {Data follows} 201 {Created} 204 {No Content} + 302 {Moved Temporarily} 304 {Not Modified} + 400 {Bad Request} 401 {Unauthorized} 402 {Payment Required} + 403 {Forbidden} 404 {Not Found} 405 {Method Not Allowed} + 406 {Not Acceptable} 408 {Request Timeout} 411 {Length Required} + 500 {Internal Server Error} 503 {Service Unavailable} 504 {Service Temporarily Unavailable} + } + Httpd::Wrk instproc formData {} {my set formData} + Httpd::Wrk instproc init args { # Constructor + my instvar socket port ipaddr + my set formData [list] + my set replyHeaderFields [list] + next + my makeConnection $socket + my log Connect "$ipaddr $port" + my connection translation {auto crlf} + my connection event readable [self] firstLine + } + Httpd::Wrk instproc makeConnection {socket} { + Connection create [self]::connection -socket $socket -req [self] + } + Httpd::Wrk instproc close {} { # logical close of a single request + #my showCall + my instvar version timeout meta + set eof [my connection eof] + if {$version > 1.0 && !$eof} { + #my showMsg "!EOF in http/$version" + my connection flush + set timeout [after [[my info parent] workerTimeout] [self] destroy] + ### reset parameters, worker will be potentially reused + if {[array exists meta]} { + unset meta + array set meta {} + } + unset version + if {[my exists user]} { + my unset user + my unset realm + } + foreach c [my set formData] { $c destroy } + my set replyHeaderFields [list] + my set formData {} + #my showVars + my connection translation {auto crlf} + my connection event readable [self] firstLine + } elseif {$eof} { + #my showMsg "Destroy in http/$version" + # the client side has closed the connection + my destroy + } else { + #my showMsg "!EOF in http/$version ???" + # we close the conneciton actively (e.g. forced by an error) + my connection flush + #puts stderr "DESTROY----this line should never show up" + my destroy + } + } + Httpd::Wrk instproc destroy {} { + #my showCall + if {[my isobject [self]::connection]} { + my connection close + } + next + } + Httpd::Wrk instproc freeConnection {} { + } + Httpd::Wrk instproc firstLine {} { # Read the first line of the request + #my showCall + my instvar method resourceName hasFormData query fileName \ + version timeout + if {[info exists timeout]} { + after cancel $timeout + unset timeout + } + my lappend replyHeaderFields Date [Httpd Date [clock seconds]] + set n [my connection gets firstLine] + if {$n > 0} { + #::puts stderr "[self] firstline=<$firstLine>" + # parse request line, ignore HTTP version for now + if {[regexp {^(POST|GET|PUT|HEAD|OPTIONS) ([^?]+)(\??)([^ ]*) *HTTP/(.*)$} \ + $firstLine _ method resourceName hasFormData query version]} { + set resourceName [string trimright [string trimleft $resourceName ./] " "] + # construct filename + [my info parent] instvar root + set fileName $root/[url decodeName $resourceName] + #puts stderr ---[encoding convertfrom utf-8 $fileName]---- + set fileName [encoding convertfrom utf-8 $fileName] + # + my decode-formData $query + my log Query $firstLine + if {[my exists forceVersion1.0]} { + set version 1.0 + } + my connection makePersistent [expr {$version > 1.0}] + my connection event readable [self] header + } else { + set version 1.0 + set resourceName ??? + set method ??? + my log Error "bad first line:$firstLine" + my replyCode 400 + my replyErrorMsg + } + } elseif {![my connection eof]} { + #my showMsg "+++ not completed EOF=[my connection eof]" + } else { + set version 1.0 + #my showMsg "+++ n=negative ($n) EOF=[my connection eof] version set to 1.0" + my close + } + } + Httpd::Wrk instproc header {} { # Read the header + #my showCall + my instvar method data + if {[my connection gets line] > 0} { + #puts stderr line=$line + if {[regexp -nocase {^([^:]+): *(.+)$} $line _ key value]} { + my set meta([string tolower $key]) $value + } + } else { + #puts stderr line-EMPTY + if {[my exists meta(content-length)] && [my set meta(content-length)]>0} { + #puts stderr "we have content-length [my set meta(content-length)]" + set data "" + my connection translation binary + my connection event readable [self] receive-body + } elseif {[my exists meta(content-type)] && + [regexp -nocase {multipart/form-data; *boundary=} \ + [my set meta(content-type)]]} { + #puts stderr "formdata" + set data "" + my connection event readable [self] receive-body + } else { + #puts stderr "no-content-length, triggering respond" + my connection event readable [self] "" + [my info parent] instvar requiresBody + if {$requiresBody($method)} { + my replyCode 411 + my replyErrorMsg + } else { + my check-redirect + } + } + } + } + Httpd::Wrk instproc receive-body {} { ;# ... now we have to read the body + #my showCall + my instvar method data meta + set d [my connection read] + if {$d ne ""} { + append data $d + #my showMsg "datal=[string length $data], cl=$meta(content-length)" + if {[string length $data] >= $meta(content-length)} { + my connection event readable [self] "" + if {$method eq "POST"} { my decode-POST-query } + my check-redirect + } + } else { ;# 0 byte, must be eof... + my showMsg "received 0 bytes" + my connection event readable [self] "" + if {[string length $data] < $meta(content-length)} { + my replyCode 404 + my replyErrorMsg + } else { + my check-redirect + } + } + } + Httpd::Wrk instproc unmodified mtime { + my instvar meta + if {[info exists meta(if-modified-since)]} { + set ms $meta(if-modified-since) + regexp {^([^;]+);(.*)$} $ms _ ms options + if {[catch {set mss [clock scan $ms]}]} { + regsub -all -- {-} $ms " " ms + if {[catch {set mss [clock scan $ms]}]} { + set ms [lreplace $ms end end] + set mss [clock scan $ms] + } + } + return [expr {$mtime <= $mss}] + } + return 0 + } + Httpd::Wrk instproc check-redirect {} { + [my info parent] instvar redirects + my instvar resourceName hasFormData query + set resource $resourceName$hasFormData$query + foreach {pattern hostport} $redirects { + #puts stderr "match <$pattern> <$resource> [regexp $pattern $resource]" + if {[regexp $pattern $resource]} { + #puts stderr "do redirect to $hostport/$resource" + my replyCode 302 location $hostport/$resource + my replyErrorMsg + return + } + } + my respond + } + Httpd::Wrk instproc respond {} { # Respond to the query + # the request was read completely... This method is wellsuited for mixins! + my respond-[my set method] + } + + Httpd::Wrk instproc respond-GET {} { + #my showCall + my instvar fileName + my sendFile $fileName + } + Httpd::Wrk instproc respond-HEAD {} { # Respond to the query + my instvar fileName + if {[file readable $fileName]} { + my replyCode 200 \ + Last-Modified [Httpd Date [file mtime $fileName]] \ + Content-Type [Mime guessContentType $fileName] \ + Content-Length [file size $fileName] + my connection puts "" + #my log Done "$fileName [Mime guessContentType $fileName]" + my close + } else { + my replyCode 404 + my replyErrorMsg + } + } + Httpd::Wrk instproc respond-OPTIONS {} { # Respond to the query + my replyCode 200 \ + Allow "OPTIONS, GET, HEAD, POST" \ + Public "OPTIONS, GET, HEAD, POST" + my connection puts "" + my close + } + Httpd::Wrk instproc respond-PUT {} { + my instvar data method fileName + my replyCode [expr {[file writable $fileName] ? 200 : 201}] + my connection puts "" + set out [open $fileName w] + fconfigure $out -translation binary + puts -nonewline $out $data + my log Done "$fileName [Mime guessContentType $fileName]" + close $out + my close + } + Httpd::Wrk instproc respond-CGI {} { + my instvar fileName + if {[file executable $fileName]} { + my replyCode 200 + my connection puts [exec $fileName] ;# no parameter handling yet + my close + } else { + my replyCode 403 + my replyErrorMsg + } + } + Httpd::Wrk instproc new-formData {} { + set arg [Object create [self]::[my autoname formData]] + my lappend formData $arg + return $arg + } + Httpd::Wrk instproc decode-formData {query} { + #my showCall + foreach pair [split [string trimleft $query \n] &] { + set arg [my new-formData] + if {[regexp {^(.+)=(.*)$} $pair _ name content]} { + $arg set name [url decodeItem $name] + $arg set content [url decodeItem $content] + } else { + $arg set content [url decodeItem $pair] + } + } + } + Httpd::Wrk instproc decode-POST-query {} { + if {[my exists meta(content-type)]} { + set ct [my set meta(content-type)] + if {[regexp -nocase {application/x-www-form-urlencoded} $ct]} { + #my showMsg "ordinary FORM" + my decode-formData [my set data] + return + } elseif {[regexp -nocase {multipart/form-data; *boundary=(.*)$} $ct \ + _ boundary]} { + #my showMsg "multipart FORM" + set parts [my set data] + set bl [expr {[string length $boundary]+2}] + while {[set endIDX [string first --$boundary $parts]] > -1} { + set part [string range $parts $bl [expr {$endIDX-1}]] + if {[set endHD [string first \r\n\r\n $part]] > -1} { + set arg [my new-formData] + if {[catch {Mime multipart-decode-header \ + [string range $part 0 [expr {$endHD-1}]] \ + $arg} msg]} { + my replyCode 406 + my replyErrorMsg $msg + return 0 + } + $arg set content [string range $part \ + [expr {$endHD + 4}] \ + [expr {[string length $part] -3}]] + #$arg showVars + } + set parts [string range $parts [expr {$endIDX+2}] end] + } + } + } + } + Httpd::Wrk instproc respond-POST {} { + my replyCode 405 + my replyErrorMsg + #my respond-CGI + } + + Httpd::Wrk instproc replyErrorMsg {{msg ""} args} { + my instvar replyCode + [self class] instvar codes + foreach {tag value} $args {my connection puts "$tag: $value"} + my sendText "\nStatus Code: $replyCode\n\ + $msg

\n\ + Status Code $replyCode: $codes($replyCode)
\n\ + Resource Name: [my set resourceName]\n" + my close ;# close must be last call + } + Httpd::Wrk instproc replyCode {code args} { + #my showCall + my instvar version + [self class] instvar codes + my set replyCode $code + my connection puts "HTTP/$version $code $codes($code)" + foreach {tag value} [my set replyHeaderFields] {my connection puts "$tag: $value"} + foreach {tag value} $args {my connection puts "$tag: $value"} + if {$code >= 400} { + my log Error "$code $codes($code)\tmeta: [my array get meta]" + } else { + my log Done "$code $codes($code)" + } + } + Httpd::Wrk instproc sendText {response {type text/html}} { + #my showCall + my connection puts "Content-Type: $type" + # bei einer leeren Responses blockieren Klienten und melden Fehler + if {$response eq ""} { set response " " } + my connection puts "Content-Length: [string length $response]\n" + if {[my set method] ne "HEAD"} { + my connection fconfigure -translation {auto binary} + my connection puts-nonewline $response + } else { + my showMsg HEAD! + } + } + Httpd::Wrk instproc sendMsg {response {type text/html}} { + # my showCall + my replyCode 200 + my sendText $response $type + my close + } + Httpd::Wrk instproc sendDir {dirName} { + [my info parent] instvar root + set title "Directory listing" + set reply "$title

$title

\n\n" + set oldpwd [pwd] + cd $root + set dirs ""; set files "" + foreach f [lsort -dictionary [glob -nocomplain ./$dirName/*]] { + set full [file join $root $f] + set pname [string trimleft $f ./] + if {[file isdir $full]} { + append pname / + } + if {![catch {set size [file size $full]}]} { + # it is not a broken link + set entry "" + append entry \ + \ + " \ + " \ + \n + if {[string match */ $pname]} {append dirs $entry} else {append files $entry} + } + } + append reply $dirs $files "
"$pname" " $size " [clock format [file mtime $full]]
\n" + cd $oldpwd + my sendMsg $reply + return + } + + Httpd::Wrk instproc sendFile {fn {type ""}} { + #my showCall + if {[file isdirectory $fn]} { + set full [file join $fn index.html] + if {[file readable $full]} { + set fn $full + } else { + my sendDir [my set resourceName] + return + } + } + #puts stderr "readable '$fn' [file readable $fn]" + if {[file readable $fn]} { + set mtime [file mtime $fn] + if {[my unmodified $mtime]} { + my replyCode 304 + my replyErrorMsg + return + } + if {$type eq ""} {set type [Mime guessContentType $fn]} + my replyCode 200 \ + Last-Modified [Httpd Date $mtime] \ + Content-Type $type \ + Content-Length [file size $fn] + my connection puts "" + my connection fconfigure -translation binary ;#-buffersize 65536 + set localFile [open $fn] + fconfigure $localFile -translation binary -buffersize 65536 + fcopy $localFile [my connection set socket] \ + -command [list [self] fcopy-end $localFile] + } else { + my replyCode 404 + my replyErrorMsg + } + } + Httpd::Wrk instproc fcopy-end {localFile args} { # End of fcopy + close $localFile + my connection fconfigure -blocking false ;# fconfigure changes blocking in 8.3.2! + my close + } + Httpd::Wrk instproc log {reason arg} { # trivial logging + my instvar port ipaddr + if {[my exists user]} { + set user [my set user]/[my set realm] + } {set user -} + [my info parent] instvar logfile + puts $logfile "[clock format [clock seconds]] $user $ipaddr:$port\t$reason\t$arg" + flush $logfile + } + + + ######################################################################### + Class Httpsd -superclass Httpd -parameter { + {port 443} + {httpdWrk Httpsd::Wrk} + {requestCert 0} + {requireValidCert 0} + {certfile filename.crt} + {keyfile filename.key} + {cafile cacert.pem} + {infoCb {}} + } + Httpsd instproc init args { + package require tls + proc tls::password {} { + puts stderr "getting passwd" + return pemp + } + next + } + + Class Httpsd::Wrk -superclass Httpd::Wrk + Httpsd::Wrk instproc firstLine {} { + my set forceVersion1.0 1 + my lappend replyHeaderFields Connection close + next + } + Httpsd::Wrk instproc makeConnection {socket} { + Connection create [self]::connection -socket $socket -req [self] + [my info parent] instvar \ + keyfile certfile cafile infoCb requestCert requireValidCert + # SSL-enable a regular Tcl channel - it need not be a socket, but + # must provide bi-directional flow. Also setting session parameters + # for SSL handshake. www.sensus.org/tcl/tls.htm + + # -request bool --> Request a certificate from peer during SSL + # handshake. (default: true) + + # -require bool --> Require a valid certificate from peer during SSL + # handshake. If this is set to true then -request must also be set + # to true. (default: false) + + # -server bool --> Handshake as server if true, else handshake as + # client.(default: false) + my connection importSSL -server 1 \ + -certfile $certfile \ + -keyfile $keyfile \ + -cafile $cafile \ + -request $requestCert \ + -require $requireValidCert \ + -command $infoCb + } + ######################################################################### + + + + ### + ### Mixin-Classes for respond patterns + ### mixes into Http and Httpd::Wrk + ### + Class Httpd::Responder + Httpd::Responder instproc init args { + next + my lappend workerMixins Httpd::Responder::Wrk + my set respondpatterns {} + # Example how to register new methods: regexp is matched with the triple + # (HTTP-METHOD URL HASFORMDATA) where HASFORMDATA is empty when no + # parameters are given. The parsed components of the url etc. are + # available as instvars + my actions {^GET cgi[-]bin [?]} respond-CGI + } + Httpd::Responder instproc actions {regexp method} { + my lappend respondpatterns $regexp $method + } + Class Httpd::Responder::Wrk + Httpd::Responder::Wrk instproc respond {} { + my instvar fileName method resourceName hasFormData + [my info parent] instvar respondpatterns + ### auch das ist ein kandidat fuer eine chain of responsibility + foreach {pattern action} $respondpatterns { + if {[regexp $pattern "$method $resourceName $hasFormData"]} { + my $action + return + } + } + next + } + + ### + ### Mixin-Classes for Access Control + ### mixes into Http and Httpd::Wrk + ### + Class Httpd::AccessControl + Httpd::AccessControl abstract instproc protectedResource {fn method varAuthMethod varRealm} + Httpd::AccessControl abstract instproc credentialsNotOk {wrk credentials authMethod realm} + Httpd::AccessControl abstract instproc addRealmFile {realm authFile} + Httpd::AccessControl abstract instproc addRealmEntry {realm passwds} + Httpd::AccessControl abstract instproc protectDir {realm path methods} + + Class Httpd::AccessControl::Wrk + Httpd::AccessControl::Wrk instproc respond {} { + my instvar fileName method digestChallengeData + set controller [my info parent] + if {[$controller protectedResource $fileName $method authMethod realm]} { + #my showMsg "*** Protected resource: $fileName $method" + if {![my exists meta(authorization)] || + [$controller credentialsNotOk [self] \ + [my set meta(authorization)] $authMethod $realm]} { + my unauthorizedAccess $realm + return + } + } + next + } + + ########################################################################### + ## Basic Access Control + ########################################################################### + Class Httpd::BasicAccessControl -superclass Httpd::AccessControl + + Httpd::BasicAccessControl instproc initWorkerMixins {} { + my lappend workerMixins [self class]::Wrk + } + + Httpd::BasicAccessControl instproc init args { + next + my initWorkerMixins + } + + Httpd::BasicAccessControl instproc protectedResource {fn method varAuthMethod varRealm} { + #my showCall + # check whether access to $fn via $method is protected + upvar [self callinglevel] $varAuthMethod authMethod $varRealm realm + # we check only the current directory, not the parent directories + if {[string match */ $fn]} { + set path $fn + } else { + set path [file dirname $fn]/ + } + foreach i [list $path $path:$method] { + if {[my exists protected($i)]} { + set realm [my set protected($i)] + set authMethod Basic + return 1 + } + } + return 0 + } + + Httpd::BasicAccessControl instproc credentialsNotOk {wrk credentials authMethod realm} { + # check whether $credentials are sufficient for $realm + regexp {^(.*):(.*)$} [base64 decode [lindex $credentials 1]] _ user pwd + #puts stderr "passwd($realm:$user)=[my exists passwd($realm:$user)]" + $wrk set user $user + $wrk set realm $realm + if {[my exists passwd($realm:$user)]} { + return [expr {[my set passwd($realm:$user)] != $pwd}] + } + return 1 + } + + Httpd::BasicAccessControl instproc addRealmEntry {realm passwds} { + if {[llength $passwds] == 1} { + my addRealmFile [lindex $passwds 0] + } else { + foreach {name pwd} $passwds { + #puts stderr "realm='$realm' adding user: $name pw: $pwd" + my set passwd($realm:$name) $pwd + } + } + } + Httpd::BasicAccessControl instproc addRealmFile {realm authFile} { + set FILE [open $authFile r] + while {![eof $FILE]} { + foreach {name pwd} [split [gets $FILE] :] { + my addRealmEntry $realm [list $name $pwd] + } + } + close $FILE + } + + Httpd::BasicAccessControl instproc protectDir {realm path methods} { + my instvar root + my checkRoot + set resource $root/$path ;# resources are currently directories + if {$methods == {}} { + my set protected($resource) $realm ;#for every method + } else { + foreach m $methods { + my set protected($resource:$m) $realm ;#for selected methods + } + } + } + Class Httpd::BasicAccessControl::Wrk -superclass Httpd::AccessControl::Wrk + Httpd::BasicAccessControl::Wrk instproc unauthorizedAccess {realm} { + my set digestChallengeData(realm) $realm + my replyCode 401 www-authenticate "Basic realm=\"$realm\"" + my replyErrorMsg "Unauthorized request for realm '$realm'" + } + + + + ########################################################################### + ## Digest Access Control + ########################################################################### + Class Httpd::DigestAccessControl -superclass Httpd::BasicAccessControl + Httpd::DigestAccessControl instproc init args { + package require tcu + next + my lappend workerMixins [self class]::Wrk + } + Httpd::DigestAccessControl instproc credentialsNotOk {wrk credentials authMethod realm} { + # check whether $credentials are sufficient for $realm + my showMsg "Digest Authentication ..." + # HELP FD: hier muss ich noch überprüfen, ob die digest-header + # (credentials) ok sind. Hier habe ich probleme auf die sachen, + # die der worker gesendet (bspw. nonce) hat zu kommen. Ich + # weiß, man kann mit [my info children] daran kommen. Aber, + # was ist, wenn man mehrere Worker hat? + + ## Fredj, das sollte kein Problem sein: das credentialsNotOk wird + ## vom aktuellen worker (respond) aufgerufen. man kann dem *NotOk + ## den worker mitgeben, oder die beiden Methoden etwas umorganisieren. + return + } + Class Httpd::DigestAccessControl::Wrk -superclass Httpd::BasicAccessControl::Wrk + Httpd::DigestAccessControl::Wrk instproc unauthorizedAccess {realm} { + my set digestChallengeData(realm) $realm + my replyCode 401 www-authenticate "Digest [my digestChallenge]" + my replyErrorMsg "Unauthorized request for realm '$realm'" + } + Httpd::DigestAccessControl::Wrk instproc digestChallenge {} { + my showCall + my instvar digestChallengeData + my mkDigestChallengeData + set digestResponse {} + foreach {t v} [array get digestChallengeData] { + append digestResponse "$t = \"$v\", " + } + regsub {, $} $digestResponse {} digestResponse + return $digestResponse + } + Httpd::DigestAccessControl::Wrk instproc mkDigestChallengeData {} { + my showCall + my instvar digestChallengeData + + # RFC 2617 + # challenge = "Digest" digest-challenge + # digest-challenge = 1#( realm | [ domain ] | nonce | + # [ opaque ] |[ stale ] | [ algorithm ] | + # [ qop-options ] | [auth-param] ) + # domain = "domain" "=" <"> URI ( 1*SP URI ) <"> + # URI = absoluteURI | abs_path + # nonce = "nonce" "=" nonce-value + # nonce-value = quoted-string + # opaque = "opaque" "=" quoted-string + # stale = "stale" "=" ( "true" | "false" ) + # algorithm = "algorithm" "=" ( "MD5" | "MD5-sess" | token ) + # qop-options = "qop" "=" <"> 1#qop-value <"> + # qop-value = "auth" | "auth-int" | token + + # FD: hier würde man die nötigen parametern (nonce,domain,opaque, + # etc.) berechnen und in dem asso. Array speichern. + # FD: minimale Anforderung + set digestChallengeData(nonce) [my genNonce] + set digestChallengeData(opaque) [base64 encode [self]:my-self-spcified-string] + set digestChallengeData(algorithm) "MD5" ;#default + set digestChallengeData(qop) "auth" + set digestChallengeData(domain) [array names [my info parent]::protected] + } + + Httpd::DigestAccessControl::Wrk instproc genNonce {} { + my showCall + my instvar digestChallengeData + set timeStamp [clock seconds] + set nonce [base64 encode [md5 $timeStamp:[self]]] + return $nonce + } + + + # + # example usage: + + #Httpd h1 -port 8081 -root [glob ~/wafe] + #Httpd h2 -port 9086 -root $root \ + -mixin {Httpd::Responder Httdp::BasicAccessControl} \ + -addRealmEntry test {test test} -protectDir test "" {} \ + -redirect {^(mailman|pipermail|cgi-bin) http://alice.wu-wien.ac.at:80} + + + namespace export Httpd Httpsd + namespace eval Httpd { + namespace export Wrk \ + AccessControl BasicAccessControl DigestAccessControl \ + Responder + } + namespace eval Httpsd { + namespace export Wrk + } + #namespace eval Responder {namespace export Wrk} + #namespace eval AccessControl {namespace export Wrk} + #namespace eval BasicAccessControl {namespace export Wrk} + #namespace eval DigestAccessControl {namespace export Wrk} +} + +namespace import ::xotcl::comm::httpd::* +namespace eval Httpd {namespace import ::xotcl::comm::httpd::Httpd::*} +namespace eval Httpsd {namespace import ::xotcl::comm::httpd::Httpsd::*} +#namespace eval Responder {namespace import ::xotcl::comm::httpd::Responder::*} +#namespace eval AccessControl {namespace import ::xotcl::comm::httpd::AccessControl::*} +#namespace eval BasicAccessControl {namespace import ::xotcl::comm::httpd::BasicAccessControl::*} +#namespace eval DigestAccessControl {namespace import ::xotcl::comm::httpd::DigestAccessControl::*} Index: library/comm/Imap.xotcl =================================================================== diff -u -N --- library/comm/Imap.xotcl (revision 0) +++ library/comm/Imap.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,175 @@ +# $Id: Imap.xotcl,v 1.4 2006/02/18 22:17:33 neumann Exp $ + +package provide xotcl::comm::imap 0.9 + +package require XOTcl + +namespace eval ::xotcl::comm::imap { + package require xotcl::comm::httpAccess + namespace import ::xotcl::* + + Class Imap -superclass NetAccess -parameter {user} + Imap instproc initialize args { + my instvar port caching tokenCounter resp token + set port 143 + set caching 1 + set resp(connect) {"[*] OK" login} + set resp(login) {"A[0-9]+ OK" loginFinished "A[0-9]+ NO" login} + set resp(loginFinished) {"[*] [0-9]+" inboxSize "[*] OK" inboxSelected} + set resp(mailSelected) {"[*] [0-9]+ FETCH" fetchBody + "A[0-9]+ OK " ignoreLine + "[*] " ignoreLine} + set resp(heads) {"[*] [0-9]+ FETCH" fetchHeaders + "A[0-9]+ OK " ignoreLine + "[*] " ignoreLine} + set tokenCounter 0 + next + set token NONE + } + Imap instproc err {state reply} { + my abort "Error in $state: $reply" + } + Imap instproc token {} { + my instvar tokenCounter + return [format {A%.4d} [incr tokenCounter]] + } + Imap instproc imapString {input} { + regsub -all {(["\])} $input {\\\1} output ;#" + return \"$output\" + } + Imap instproc queryServer {query state} { + #my showCall + my instvar S token + set token [my token] + puts $S "$token $query" + #puts stderr "$token $query" + flush $S + fileevent $S readable [list [self] response $state] + } + Imap instproc response {state} { + my instvar S resp msg token + set msg [gets $S] + #my showVars msg token + foreach {c newState} $resp($state) { + if {![regexp {^[*]} $msg] && ![regexp ^$token $msg]} { + my showMsg "$state: token=$token IGNORING $msg" + return + } + if {[regexp ^$c $msg]} { + #my showMsg "$state NEWSTATE $newState" + return [my $newState] + } + } + my err $state "expected=$resp($state), got $msg" + } + Imap instproc GET {} { + my instvar state S path host port user inbox mailNr + # number at end of path is the message number in the mailbox + if {[regexp {^([^/]+)/([^/]+)/([0-9]+)$} $path _ user inbox mailNr]} { + } elseif {[regexp {^([^/]+)/([^/]+)/?$} $path _ user inbox]} { + } else { + my abort "invalid imap path $path" + } + regexp {^(.*):([0-9]+)$} $host _ host port + # proxy ? + if {[catch {set S [socket -async $host $port]} err]} { + my abort "Could not open connection to host '$host:$port'\n $err" + } else { + fconfigure $S -blocking false + fileevent $S readable [list [self] response connect] + } + } + Imap instproc login {} { + my instvar user host password + if {[pwdManager requirePasswd "Imap $user\@$host" $user password]} { + my queryServer "login $user [my imapString $password]" login + } else { + what now? + } + } + Imap instproc loginFinished {} { + my instvar user host password inbox + pwdManager storePasswd "Imap $user\@$host" $user $password + my queryServer "select $inbox" loginFinished + } + Imap instproc inboxSize {} { + my instvar msg nrMails + regexp {^[*] ([0-9]+) EXISTS} $msg _ nrMails + } + Imap instproc inboxSelected {} { + my instvar msg contentType nrMails mailNr + if {[info exists mailNr]} { + set contentType text/plain + my body-state + my queryServer "fetch $mailNr rfc822" mailSelected + } else { + my instvar header inbox block host user block + set contentType text/html + my body-state + set what "Mailbox $inbox of $user@$host" + set block "$what\n" + append block "

$what

\n" \ + "The following $nrMails messages are in this mailbox:" \ + "

\n

\n" + my pushBlock + my set state 4 + my finish + } + } + } + + namespace export Imap + } + + namespace import ::xotcl::comm::imap::* Index: library/comm/Ldap.xotcl =================================================================== diff -u -N --- library/comm/Ldap.xotcl (revision 0) +++ library/comm/Ldap.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,143 @@ +package provide xotcl::comm::ldap 0.9 + +package require xotcl::wafecompat ; # Get 'requireModules'. + +package require XOTcl + +namespace eval ::xotcl::comm::ldap { + namespace import ::xotcl::* + + requireModules { ldapOpen ldaplibGen.so } + + Class Ldap -superclass NetAccess -parameter {host port dn attributes scope filter} + Ldap instproc initialize args { + my instvar port mapToC useCache + my set port 389 + my set useCache 0 + set mapToC(one) onelevel + set mapToC(sub) subtree + set mapToC(base) base + next + } + Ldap proc urlDecode string { + set toParse $string + set parsed "" + while {1} { + if {[regexp {^([^%]*)%(..)(.*)$} $toParse _ front hex toParse]} { + append parsed $front [binary format c 0x$hex] + } else { + append parsed $toParse + break + } + } + return $parsed + } + Ldap instproc getUrlcomponents {} { + showCall + my instvar path dn attributes scope filter url + set path [Ldap urlDecode $path] + puts stderr "___ path=<$path>" + if {[regexp -nocase {^/([^?]*)(\?([^?]*)(\?([^?]*)(\?([^?]*))?)?)?$} \ + $path _ dn a attributes s scope f filter]} { + if {$scope eq ""} { set scope "base" } + if {$filter eq ""} { set filter "(objectClass=*)" } + } else { + set errmsg "*** Ldap Url trail=<$path> does not match!\n" + append errmsg "___ RFC 1959 says:\n" + append errmsg " ldap://:/\[?\[??\]\]\n" + append errmsg "___ Cineast and Netscape uses:\n" + append errmsg " ldap://:/\[?\[?\[?\]\]\]" + my abort "Unsupported URL: '$url' \n $errmsg" + } + } + Ldap instproc GET {} { + my instvar contentType totalsize state currentsize informObjects block + showCall + set contentType text/html + my getUrlcomponents + if {"start" ne $state } { + puts stderr "... [self]:$proc ignoring request in state $state" + return + } + my open + my search + my body-state + set totalsize [string length $block] + set currentsize $totalsize + foreach obj $informObjects { + $obj incCb [self] $totalsize $currentsize + } + my eof + } + Ldap instproc open {} { + showCall + my instvar port host ldapHandle + set ldapHandle [ldapOpen $host $port] + } + Ldap instproc bind {} { + my instvar ldapHandle + showCall + } + Ldap instproc search {} { + showVars + my instvar url ldapHandle searchHandle dn attributes scope filter results mapToC path + set searchHandle [ldapSearch $ldapHandle $dn \ + $mapToC($scope) $filter [split $attributes ,] false results] + set nentries [ldapCountEntries $ldapHandle $searchHandle] + puts stderr "*** nentries = $nentries" + if {!$nentries} {set results ""} + my response + } + Ldap instproc getAttrs {dn} { + } + Ldap instproc makeUrl {dn} { + showCall + my instvar port host scope filter attributes + set tmpUrl ldap://$host:$port/$dn?$attributes?$scope?$filter + return "$dn" + } + Ldap instproc response {} { + showCall + my instvar block results attrsVals ldapHandle searchHandle + set block " + + LDAP searching result!! + +

Result

\n
    \n" + foreach {resDN} $results { + append block "
  • [my makeUrl $resDN]

    \n

      \n" + ldapAttributes $ldapHandle $searchHandle $resDN attrsVals + foreach {a v} [array get attrsVals] { + append block "
    • $a = $v

      \n" + } + append block "

    \n" + } + append block "
\n \n" + } + + # destructor: Close Connection to LDAP-Server and unbind + Ldap instproc destroy {} { + showCall + my instvar ldapHandle + if {[catch {ldapUnbind $ldapHandle} error]} { + return $error + } + my freeSearchHandle + } + Ldap instproc close {} { + showCall + my destroy + next + } + Ldap instproc freeSearchHandle {} { + showCall + my instvar searchHandle + if {[info exists searchHandle]} { + ldapFreeSearch $searchHandle + } + } + + namespace export Ldap +} + +namespace import ::xotcl::comm::ldap::* Index: library/comm/Mime.xotcl =================================================================== diff -u -N --- library/comm/Mime.xotcl (revision 0) +++ library/comm/Mime.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,274 @@ +# $Id: Mime.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::comm::mime 0.9 + +package require XOTcl + +namespace eval ::xotcl::comm::mime { + namespace import ::xotcl::* + + ####################################################################### + Class MimeTypeLoader + MimeTypeLoader instproc loadMimeTypes {file} { + if {![file exists $file]} return + + puts stderr "Loading Mime types from $file" + set f [open $file r] + set content [read $f] + close $f + regsub -all "\\\\ *\n" $content " " content + foreach line [split $content \n] { + set line [string trim $line] + if {[regexp ^\# $line]} continue + if {$line eq ""} continue + regsub -all " +" $line " " line + #puts stderr <$line> + while {$line ne ""} { + if {[regexp {^ *([^ ]+)=\"([^\"]+)\" *(.*)$} $line _ key value line]} { + set v([string tolower $key]) $value + } elseif {[regexp {^ *([^ ]+)=([^ ]+) *(.*)$} $line _ key value line]} { + set v([string tolower $key]) $value + } else { + set tokens [split $line] + if {![regexp / [lindex $line 0]]} { + puts stderr "Mime: cannot parse line '$line' in $file" + } else { + set v(exts) [join [lrange $tokens 1 end] ,] + set v(type) [lindex $tokens 0] + } + break + } + } + if {[info exists v(exts)] && [info exists v(type)]} { + set v(exts) [string tolower $v(exts)] + set v(type) [string tolower $v(type)] + foreach ext [split $v(exts) ,] { + set ext [string trimleft $ext .] + #puts stderr "ext '$ext', contentType = '$v(type)'" + my set extTable($ext) $v(type) + } + unset v(exts) v(type) + } else { + puts stderr "invalid mime entry in $file" + } + } + } + MimeTypeLoader instproc guessContentType {name} { + my loadMimeTypes ~/.mime.types + my mixin {} + return [next] + } + + Class MIME + MIME instproc guessContentType {name} { + my instvar extTable nameTable + if {[regexp {\.([a-zA-Z0-9]+)$} $name _ ext]} { + catch {set contentType $extTable([string tolower $ext])} + } + if {![info exists contentType]} { + foreach namePattern [array names nameTable] { + if {[regexp $namePattern $name]} { + set contentType text/plain + break + } + } + } + if {![info exists contentType]} { + set contentType unknown/unknown + } + return $contentType + } + MIME instproc multipart-decode-header {header obj} { + $obj instvar name filename contentType + foreach line [split $header \r] { + set line [string trim $line \n] + #puts stderr line=$line + if {[regexp -nocase {^Content-Disposition: *([^;]+);(.*)$} $line _ \ + dispo detail]} { + if {$dispo ne "form-data"} { + error "Unknown Content Disposition '$line'" + } + if {![regexp -nocase { name *= *"([^\"]+)"} $line _ name]} { + error "can't parse form-data name '$line'" + } + regexp -nocase {filename *= *"([^\"]+)"} $line _ filename + } elseif {[regexp -nocase {^Content-Type: *([^; ]+)} $line _ contentType]} { + } else { + my showMsg "ignoring '$line'" + } + } + } + + MIME create Mime -mixin MimeTypeLoader + Mime array set nameTable { + README text/plain + } + Mime array set extTable { + gif image/gif + xpm image/x-xpixmap + xbm image/x-xbitmap + jpg image/jpeg + png image/x-png + html text/html + htm text/html + xml text/xml + css text/css + ps application/postscript + pdf application/pdf + doc application/msword + xls application/msexel + } + + + ################################################################## + Class FormData + FormData instproc encode list {;#RFC 1867 + my showCall + } + FormData formData + ################################################################## + Class Base64 + Base64 instproc init args { + my instvar base64 base64_en + # Emit base64 encoding for a string + set i 0 + foreach char {A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \ + a b c d e f g h i j k l m n o p q r s t u v w x y z \ + 0 1 2 3 4 5 6 7 8 9 + /} { + set base64($char) $i + set base64_en($i) $char + incr i + } + next + } + Base64 instproc encode string { + my instvar base64_en + set result {} + set length 0 + foreach {a b c} [split $string {}] { + scan $a %c x + if {$c ne ""} { + scan $b %c y + scan $c %c z + append result \ + $base64_en([expr {($x>>2) & 0x3F}]) \ + $base64_en([expr {(($x<<4) & 0x30) | (($y>>4) & 0xF)}]) \ + $base64_en([expr {(($y<<2) & 0x3C) | (($z>>6) & 0x3)}]) \ + $base64_en([expr {$z & 0x3F}]) + } elseif {$b ne ""} { + scan $b %c y + append result \ + $base64_en([expr {($x>>2) & 0x3F}]) \ + $base64_en([expr {(($x<<4) & 0x30) | (($y>>4) & 0xF)}]) \ + $base64_en([expr {($y<<2) & 0x3C}]) \ + = + } else { + append result \ + $base64_en([expr {($x>>2) & 0x3F}]) \ + $base64_en([expr {($x<<4) & 0x30}]) \ + == + } + if {[incr length 4] >= 72} { + append result \n + set length 0 + } + } + return $result + } + Base64 instproc decode string { + my instvar base64 + set output {} + set group 0 + set j 18 + foreach char [split $string {}] { + if {$char != "="} { + set group [expr {$group | ($base64($char) << $j)}] + if {[incr j -6] < 0} { + scan [format %06x $group] %2x%2x%2x a b c + append output [format %c%c%c $a $b $c] + set group 0 + set j 18 + } + } else { + scan [format %04x $group] %2x%2x a b + if {$j==6} { + append output [format %c $a] + } else { + append output [format %c%c $a $b] + } + break + } + } + return $output + } + Base64 base64 + ################################################################## + Class Url + Url instproc encode list { + set result "" + set sep "" + foreach i $list { + append result $sep [my encodeItem $i] + if {$sep != "="} { + set sep = + } else { + set sep & + } + } + return $result + } + Url instproc encodeItem string { + my instvar httpFormMap + set alphanumeric a-zA-Z0-9. + if {![info exists httpFormMap]} { + for {set i 1} {$i <= 256} {incr i} { + set c [format %c $i] + if {![string match \[$alphanumeric\] $c]} { + set httpFormMap($c) %[format %.2x $i] + } + } + # these are handled specially + array set httpFormMap { " " + \n %0d%0a } + } + regsub -all \[^$alphanumeric\] $string {$httpFormMap(&)} string + regsub -all \n $string {\\n} string + regsub -all \t $string {\\t} string + regsub -all {[][{})\\]\)} $string {\\&} string + return [subst $string] +} +Url instproc hexToChar hex { + ::scan $hex %x h + #my showMsg "::scan $hex %x h -> $h" + format %c $h +} +Url instproc decodeItem string { + #my showCall + set result "" + regsub -all {\+} $string " " string + regsub -all {%0d%0a} $string "\n" string + regsub -all {%([a-fA-F0-9][a-fA-F0-9])} $string {[my hexToChar \1]} string + return [subst -novariables -nobackslashes $string] +} +Url instproc decodeName string { + #my showCall + set result "" + regsub -all {%0d%0a} $string "\n" string + regsub -all {%([a-fA-F0-9][a-fA-F0-9])} $string {[my hexToChar \1]} string + return [subst -novariables -nobackslashes $string] +} +Url instproc decode string { + #my showCall + set result "" + foreach i [split $string &=] { + lappend result [decodeItem $i] + } + #my showVars result + return $result +} +Url url + +namespace export Mime url base64 +} + +namespace import ::xotcl::comm::mime::* +#puts stderr "importing ::xotcl::comm::mime::* to [namespace current]" Index: library/comm/PCache.xotcl =================================================================== diff -u -N --- library/comm/PCache.xotcl (revision 0) +++ library/comm/PCache.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,259 @@ +# -*- Tcl -*- $Id: PCache.xotcl,v 1.9 2007/08/14 16:38:26 neumann Exp $ +# Persistent Cache object, using gdbm + +# Configuration: +# The persistent cache is kept in a directory which is determined by +# the following three rules. +# +# 1) the global variable "CACHE_DIR", which has to be set, +# before this file is loaded +# 2) If "CACHE_DIR" is not set, the global variable "homedir" +# is checked, which is assumed to be the home directory +# of the Cineast browser +# 3) As a last resource the tmp directory is used as the cache directory +# +# Additionally, the cache directory can be specified after loading of this +# file (before the first open) through the instance variable "dir" +# in the object persistentCache. + +package provide xotcl::comm::pcache 0.9 +#package require xotcl::package + +package require XOTcl + +namespace eval ::xotcl::comm::pcache { + namespace import ::xotcl::* + + variable CACHE_DIR + variable homeDir + + if {![info exists CACHE_DIR]} { + if {![info exists homeDir]} { + set homeDir [::xotcl::tmpdir] + } + set CACHE_DIR $homeDir/cache2 + } + + Object persistentCache + persistentCache set dir $CACHE_DIR + persistentCache proc flush { {cmd {}} } { + my instvar DBID + if {[info exists DBID]} { $DBID close } + if {{} ne $cmd } { + if {[catch {eval $cmd} err]} {puts stderr err=$err} + } + my open ;# UZ: wenn hier das self weggenommen wird, crashed das lintFilter + #open ;# UZ: wenn hier das self weggenommen wird, crashed das lintFilter + + } + # the open method for the first invocation + persistentCache proc open {} { + my instvar dir DBID + package require xotcl::store + set DBID [Storage someNewChildStore] + if {![file isdirectory $dir]} { + # if the cache directory does not exist, create it.. + file mkdir $dir + } + # the open method for later invocations, doing the real work + my proc open {} { + my instvar dir DBID + $DBID open $dir/index + } + # invoke the method + open + } + persistentCache proc clear {} { + my instvar cacheFileName contentType meta entry validated dir + my flush [list eval file delete -force $dir/index \ + [glob -nocomplain $dir/\[0-9\]*::*]] + foreach var {cacheFileName contentType meta entry validated} { + catch {unset $var} + } + } + persistentCache proc clearEntry {url} { + my instvar DBID cacheFileName contentType meta entry validated + my inCache $url + if {[info exists cacheFileName($url)]} { + my flush [list eval file delete -force $cacheFileName($url)] + foreach var {cacheFileName contentType meta entry validated} { + my showMsg "unset ${var}($url)" + catch {unset ${var}($url)} + } + catch {$DBID unset $url} + } + } + persistentCache proc lazyFlush {} { + my instvar flushPending + if {[info exists flushPending]} { after cancel $flushPending } + set flushPending [after 100 [self] flush] + } + persistentCache proc newEntry {url access doCache name} { + my instvar cacheFileName contentType meta dir + if {$name ne ""} { + #$access set caching 0 + return $name + } elseif {$doCache} { + set cacheFileName($url) $dir/[pid]-$access + set contentType($url) [$access set contentType] + set meta($url) [$access set meta] + return $cacheFileName($url) + } else { + # we use the Memory cache only for non-persistent cache entries + # which are deleted when the program terminates + set fileName $dir/v[pid]-$access + MemoryCache + $url $fileName + return $fileName + } + } + persistentCache proc entryDone {url} { + my instvar entry cacheFileName contentType DBID meta + if {![info exists DBID]} { open } + $DBID set $url [list \ + cacheFileName $cacheFileName($url) \ + contentType $contentType($url) \ + meta $meta($url) ] + my lazyFlush + #my showMsg "size=[file size $cacheFileName($url)]" + set entry($url) 1 + my set validated($url) 1 + } + persistentCache proc inCache {url} { + my instvar entry + if {[info exists entry($url)]} { + set result 1 + } else { + my instvar cacheFileName contentType meta DBID + if {![info exists DBID]} { open } + set result [$DBID set $url] + my lazyFlush + if {$result ne ""} { + set entry($url) 1 + array set r $result + set cacheFileName($url) $r(cacheFileName) + set contentType($url) $r(contentType) + set meta($url) $r(meta) + set result 1 + } else { + set result 0 + } + } + return $result + } + persistentCache proc validated {url} { + my set validated($url) 1 + } + persistentCache proc invalidate {url} { + if {[my exists validated($url)]} { + my unset validated($url) + } + } + persistentCache proc isValidated {url} { + if {[my exists validated($url)]} { + return 1 + } + return 0 + } + persistentCache proc ifModifiedHeader {url ifModVar} { + set result 0 + if {[my inCache $url]} { + #puts stderr inCache:$url + upvar [self callinglevel] $ifModVar ifModifiedHeader + my instvar meta + array set m $meta($url) + if {[info exists m(last-modified)]} { + set ifModifiedHeader [list If-Modified-Since $m(last-modified)] + set result 1 + } + } else { + #puts stderr "url=$url is not in cache" + } + return $result + } + persistentCache proc dump {} { + my instvar DBID + puts stderr DUMP: + foreach k [$DBID names] { + puts stderr $k + puts stderr " [$DBID set $k]" + } + } + persistentCache proc cacheFileName {url} { + my instvar cacheFileName + return $cacheFileName($url) + } + persistentCache proc contentType {url} { + my instvar contentType + return $contentType($url) + } + persistentCache proc meta {url} { + my instvar meta + return $meta($url) + } + persistentCache proc destroy {} { + #my showCall + next + } + #persistentCache flush + + + + ########################################################### Cache + Object MemoryCache + MemoryCache proc query {url entry} { + my instvar cache + if {[info exists cache($url)]} { + upvar [self callinglevel] $entry e + #puts stderr "-->[self] [self proc] finds: $url" + set e $cache($url) + return 1 + } + return 0 + } + MemoryCache proc + {url entry} { + #puts stderr "-->[self class]:[self] [self proc] $url" + my set cache($url) $entry + } + MemoryCache proc - {url} { + #puts stderr "-->[self class]:[self] [self proc] $url" + catch {my unset cache($url)} + } + MemoryCache proc destroy {} { + my instvar cache + foreach url [array names cache] { + set f $cache($url) + if {[regexp ^/ $f]} { + #my showMsg "trying to remove $f [file exists $f]" + file delete -force $f + } + } + next + } + + + Object instproc allInstances {} { + # Diese Methode ermittelt rekursiv alle direkten und indirekten + # Instanzen einer Klasse + ::set inst [my info instances] + foreach s [my info subclass] { + foreach i [$s allInstances] { ::lappend inst $i } + } + return $inst + } + + # onExit is automatically called when wafe terminates + proc onExit {} { + #puts stderr "allinstances of Access: [Access allInstances]" + #foreach i [Access allInstances] { + # if {[info command $i] eq ""} continue + # $i destroy + #} + #MemoryCache clear + persistentCache flush + #Trace statReport + } + + namespace export persistentCache MemoryCache +} + +namespace import ::xotcl::comm::pcache::* Index: library/comm/pkgIndex.tcl =================================================================== diff -u -N --- library/comm/pkgIndex.tcl (revision 0) +++ library/comm/pkgIndex.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,19 @@ +# Tcl package index file, version 1.1 +# This file is generated by the "pkg_mkIndex -direct" command +# and sourced either when an application starts up or +# by a "package unknown" script. It invokes the +# "package ifneeded" command to set up package-related +# information so that packages will be loaded automatically +# in response to "package require" commands. When this +# script is sourced, the variable $dir must contain the +# full path name of this file's directory. + +package ifneeded xotcl::comm::connection 1.0 [list source [file join $dir Connection.xotcl]] +package ifneeded xotcl::comm::dav 0.9 [list source [file join $dir Dav.xotcl]] +package ifneeded xotcl::comm::ftp 0.9 [list source [file join $dir Ftp.xotcl]] +package ifneeded xotcl::comm::httpAccess 0.91 [list source [file join $dir Access.xotcl]] +package ifneeded xotcl::comm::httpd 1.1 [list source [file join $dir Httpd.xotcl]] +package ifneeded xotcl::comm::imap 0.9 [list source [file join $dir Imap.xotcl]] +package ifneeded xotcl::comm::ldap 0.9 [list source [file join $dir Ldap.xotcl]] +package ifneeded xotcl::comm::mime 0.9 [list source [file join $dir Mime.xotcl]] +package ifneeded xotcl::comm::pcache 0.9 [list source [file join $dir PCache.xotcl]] Index: library/lib/COPYRIGHT =================================================================== diff -u -N --- library/lib/COPYRIGHT (revision 0) +++ library/lib/COPYRIGHT (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + * XOTcl - Extended OTcl + * + * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) + * + * (a) Vienna University of Economics and Business Administration + * Dept. of Information Systems / New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + Index: library/lib/Script.xotcl =================================================================== diff -u -N --- library/lib/Script.xotcl (revision 0) +++ library/lib/Script.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,40 @@ +#$Id: Script.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::script 0.9 +package require XOTcl + +namespace eval ::xotcl::script { + namespace import ::xotcl::* + + @ @File {description { + A small package to instantiate an object, that + represents a script. + } + } + @ Class Script { + description { + An object of type Script becomes automatically the command + line arguments evaluated as "-" method calls during creation, e.g. + <@pre> + Script s -set r 5 + + and a call with cmd-line "-set v 6" of the script, results in an + object s with two vars set: r to 5, and v to 6. + } + } + + + + Class Script + Script proc create args { + eval lappend args $::argv + eval next $args + } + Script instproc unknown args { + puts stderr "$::argv0: Unknown option �-$args� provided" + } + + namespace export Script +} + +namespace import ::xotcl::script::* Index: library/lib/changeXOTclVersion.xotcl =================================================================== diff -u -N --- library/lib/changeXOTclVersion.xotcl (revision 0) +++ library/lib/changeXOTclVersion.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,95 @@ +# +# this is a maintenance program for XOTcl that allows us to change the +# version information across the whole distribution automatically. +# +# this program assumes that pwd is in xotcl-full-X.X* directory or subdir +# +set XOTCL_MAJOR_VERSION 1 +set XOTCL_MINOR_VERSION 5 +set XOTCL_RELEASE_LEVEL .6 + +# example settings: +# 1.0 +#set XOTCL_MAJOR_VERSION 1 +#set XOTCL_MINOR_VERSION 0 +#set XOTCL_RELEASE_LEVEL .3 +# +# 0.9.3 +#set XOTCL_MAJOR_VERSION 0 +#set XOTCL_MINOR_VERSION 9 +#set XOTCL_RELEASE_LEVEL .3 + +#set XOTCL_MAJOR_VERSION 0 +#set XOTCL_MINOR_VERSION 9 +#set XOTCL_RELEASE_LEVEL .3 +#set XOTCL_RELEASE_LEVEL .4 +#set XOTCL_RELEASE_LEVEL .5 + + +set XOTCL_VERSION $XOTCL_MAJOR_VERSION.$XOTCL_MINOR_VERSION +set FULL_VERSION $XOTCL_VERSION$XOTCL_RELEASE_LEVEL + +if {![regexp {((^.*/xotcl-)([0-9.]*))/?} [pwd] _ topdirname topdirprefix oldversion]} { + error "this program assumes that pwd is in xotcl-X.X* directory" +} + +puts "Prior version is: $oldversion" +puts "New version is: $FULL_VERSION" +puts "Working in: $topdirname" + +cd $topdirname + +puts "... make clean first" +if {[file exists Makefile]} { + exec make clean +} + +foreach file [exec find . -name configure.in] { + puts "... updating $file" + set F [open $file]; set c [read $F]; close $F + set newFile "" + foreach line [split $c \n] { + set newLine $line + if {[regexp {^XOTCL_MAJOR_VERSION=[0-9]} $line]} { + set line "XOTCL_MAJOR_VERSION=$XOTCL_MAJOR_VERSION" + } elseif {[regexp {^XOTCL_MINOR_VERSION=[0-9]} $line]} { + set line "XOTCL_MINOR_VERSION=$XOTCL_MINOR_VERSION" + } elseif {[regexp {^XOTCL_RELEASE_LEVEL=} $line]} { + set line "XOTCL_RELEASE_LEVEL=$XOTCL_RELEASE_LEVEL" + } elseif {[regexp {^define\(XOTclVersion, .*$} $line]} { + set line "define(XOTclVersion, $XOTCL_MAJOR_VERSION.$XOTCL_MINOR_VERSION$XOTCL_RELEASE_LEVEL)" + } + append newFile $line\n + } + set F [open $file w]; puts $F $newFile; close $F +} + +set newtopdirname $topdirprefix$FULL_VERSION +if {$oldversion != $FULL_VERSION} { + puts "topdir: $topdirname->$newtopdirname" + file rename -force $topdirname $newtopdirname +} +cd $newtopdirname + +foreach file [exec find . -name configure.in] { + set dir [file dirname $file] + set oldpwd [pwd] + cd $dir + exec autoconf + cd $oldpwd +} + +# determine last configure command +cd $newtopdirname +if {[catch {set configurecmd [exec fgrep {$ ./configure} config.log]}]} { + set configurecmd "./configure" +} else { + regsub {^ +\$ } $configurecmd "" configurecmd +} +#puts $configurecmd + +cd $newtopdirname/ +puts "Configuring in [pwd]" +eval exec $configurecmd + +puts "ok ... version is now $FULL_VERSION" Index: library/lib/htmllib.xotcl =================================================================== diff -u -N --- library/lib/htmllib.xotcl (revision 0) +++ library/lib/htmllib.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,677 @@ +## $Header: /home/neumann/cvs/xotcl/xotcl/library/lib/htmllib.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +# +# htmllib.xotcl +# +# Author: Antti Salonen, as@fishpool.fi +# +# Copyright: +# +# This software is copyrighted by Fishpool Creations Oy Ltd. The following +# terms apply to all files associated with the software unless explicitly +# disclaimed in individual files. +# +# The authors hereby grant permission to use, copy, modify, distribute, +# and license this software and its documentation for any purpose, provided +# that existing copyright notices are retained in all copies and that this +# notice is included verbatim in any distributions. No written agreement, +# license, or royalty fee is required for any of the authorized uses. +# Modifications to this software may be copyrighted by their authors +# and need not follow the licensing terms described here, provided that +# the new terms are clearly indicated on the first page of each file where +# they apply. +# +# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY +# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY +# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE +# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE +# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR +# MODIFICATIONS. +# + +package provide xotcl::htmllib 0.1 +package require XOTcl + +namespace eval ::xotcl::htmllib { + namespace import ::xotcl::* + + @ @File { + description { + This package provides the class HtmlBuilder, which can be used to + generate HTML documents, or a part of a document. + } + authors { + Antti Salonen, as@fishpool.fi + } + date { + $Date: 2006/09/27 08:12:40 $ + } + } + + # + # the compressed parameter means that minimal HTML page are created + # i.e. that space indentation is turned off + # + Class HtmlBuilder -parameter { + {compressed 0} + } + + ## The constructor. + ## + ## The HtmlBuilder object has two instance variables. The document Tcl list + ## contains the document as a list of strings. The document is stored as a list + ## rather than a single string to allow further indentation of the whole + ## document when necessary. + ## The indentLevel variable is the level of indentation, which is generally + ## increased for the contents of any HTML element that may contain block-level + ## elements. Typical examples would be
    ,
  • , and so forth. + + HtmlBuilder instproc init {} { + my instvar document indentLevel + set document [list] + set indentLevel 0 + return + } + + + HtmlBuilder instproc clear {} { + my instvar document indentLevel + + set document [list] + set indentLevel 0 + return + } + + + HtmlBuilder instproc getDocument {} { + my instvar document + return $document + } + + + HtmlBuilder instproc toString {} { + my instvar document compressed + set rvalue "" + foreach line $document { + if {$compressed == "0"} { + append rvalue "$line\n" + } else { + ## only new line for closing tags at the beginnig + ## of a document element + if {[string equal -length 2 ", for + ## example, is not required by the HTML specification, using the closing method + ## is necessary to have the document properly indented. + + + # Add a string to the document within ... + + HtmlBuilder instproc addStringStrong {str} { + my addString "$str" + return + } + + # Add a string to the document within ... + + HtmlBuilder instproc addStringEmphasized {str} { + my addString "$str" + return + } + + # Add a comment to the document + + HtmlBuilder instproc addComment {str} { + my addString "" + return + } + + HtmlBuilder instproc addLineBreak {} { + my addString "
    " + return + } + + ## startDocument - Start an HTML document. Currently all documents are HTML 4.0 + ## Transitional. HTML, BODY, HEAD and TITLE elements are added/started here. + ## Optional arguments: + ## -title documentTitle (empty if not given) + ## -stylesheet externalStyleSheet + ## -bgcolor backgroundColour (deprecated in HTML 4.0) + + HtmlBuilder instproc startDocument {args} { + set title "" + foreach {name value} $args { + switch -- $name { + -title { + set title $value + } + -stylesheet { + set stylesheet $value + } + -bgcolor { + set bgcolor $value + } + } + } + my addString {} + my addWhiteSpace + my addString {} + my addStringIncr {} + my addString "$title" + if {[info exists stylesheet]} { + my addString "" + } + my addStringDecr {} + my addWhiteSpace + if {[info exists bgcolor]} { + my addStringIncr "" + } else { + my addStringIncr {} + } + return + } + + ## endDocument - end an HTML document + + HtmlBuilder instproc endDocument {} { + my addStringDecr {} + my addString {} + return + } + + ## startParagraph - start a P element + ## Optional arguments: + ## Common HTML arguments + + HtmlBuilder instproc startParagraph {args} { + set attributes [HtmlBuilder parseArguments $args [list] [list]] + my addStringIncr "" + return + } + + ## endParagraph - end a P element + + HtmlBuilder instproc endParagraph {} { + my addStringDecr {

    } + return + } + + ## startAnchor - start an A element + ## Optional arguments: + ## -href URI + ## -name cdata + ## -target frameTarget + ## Common HTML arguments + + HtmlBuilder instproc startAnchor {args} { + set attributes [HtmlBuilder parseArguments $args \ + [list "HREF" "NAME" "TARGET"] [list]] + my addStringIncr "" + return + } + + ## endAnchor - end an A element + + HtmlBuilder instproc endAnchor {args} { + my addStringDecr {} + return + } + + ## addAnchor - add an A element, using content as the visible link. + ## Optional arguments: + ## -href URI + ## -name cdata + ## -target frameTarget + ## Common HTML arguments + + HtmlBuilder instproc addAnchor {content args} { + eval my startAnchor $args + my addString $content + my endAnchor + return + } + + ## startUnorderedList - start a UL element + ## Optional arguments: + ## Commmon HTML arguments + + HtmlBuilder instproc startUnorderedList {args} { + set attributes [HtmlBuilder parseArguments $args [list] [list]] + my addStringIncr "" + return + } + + ## endUnorderedList - end a UL element + + HtmlBuilder instproc endUnorderedList {} { + my addStringDecr {
} + return + } + + ## startListItem - start an LI element + ## Optional arguments: + ## Common HTML arguments + + HtmlBuilder instproc startListItem {args} { + set attributes [HtmlBuilder parseArguments $args [list] [list]] + my addStringIncr "" + return + } + + ## endListItem - end an LI element + + HtmlBuilder instproc endListItem {} { + my addStringDecr {} + return + } + + ## add a simple list item + HtmlBuilder instproc addListItem {content} { + my startListItem + my addString $content + my endListItem + } + + ## startTable - start a TABLE element. Note that if the -border argument isn't + ## used, by default the table are created with borders (). + + ## Optional arguments: + ## -border pixels + ## -cellpadding length + ## -cellspacing length + ## -summary text + ## -width length + ## -bgcolor color spec + ## Common HTML arguments + + HtmlBuilder instproc startTable {args} { + set attributes [HtmlBuilder parseArguments $args \ + [list "BORDER" "CELLPADDING" "CELLSPACING" "SUMMARY" \ + "WIDTH" "BGCOLOR"] [list]] + if {[lsearch $args "-border"] == -1} { + append attributes " BORDER" + } + my addStringIncr "" + return + } + + ## endTable - end a TABLE element + + HtmlBuilder instproc endTable {} { + my addStringDecr {
} + return + } + + ## startTableRow - start a TR element + ## Optional arguments: + ## Common HTML arguments + HtmlBuilder instproc startTableRow {args} { + set attributes [HtmlBuilder parseArguments $args [list "VALIGN"] [list]] + my addStringIncr "" + return + } + + ## endTableRow - end a TR element + + HtmlBuilder instproc endTableRow {} { + my addStringDecr {} + return + } + + ## startTableCell - start a TD element + ## Optional arguments: + ## -colspan number + ## -rowspan number + ## -align left|center|right|justify|char + ## -valign top|middle|bottom|baseline + ## -bgcolor + ## -width + ## Common HTML arguments + + HtmlBuilder instproc startTableCell {args} { + set attributes [HtmlBuilder parseArguments $args \ + [list "COLSPAN" "ROWSPAN" "ALIGN" "VALIGN" \ + "BGCOLOR" "WIDTH"] [list]] + my addStringIncr "" + return + } + + ## endTableCell - end a TD element + + HtmlBuilder instproc endTableCell {} { + my addStringDecr {} + return + } + + # + # add a simple table cell which just contains a string + # + HtmlBuilder instproc addTableCell {{string ""} args} { + eval my startTableCell $args + my addString $string + my endTableCell + } + + ## startTableHeaderCell - start a TH element + ## Optional arguments: + ## -colspan number + ## -rowspan number + ## -align left|center|right|justify|char + ## -valign top|middle|bottom|baseline + ## Common HTML arguments + + HtmlBuilder instproc startTableHeaderCell {args} { + set attributes [HtmlBuilder parseArguments $args \ + [list "COLSPAN" "ROWSPAN" "ALIGN" "VALIGN"] [list]] + my addStringIncr "" + return + } + + ## endTableHeaderCell - end a TH element + + HtmlBuilder instproc endTableHeaderCell {} { + my addStringDecr {} + return + } + + ## startForm - start a FORM element + ## Required arguments: + ## -action URI + ## Optional arguments: + ## -method get|post + ## Common HTML arguments + + HtmlBuilder instproc startForm {args} { + set attributes [HtmlBuilder parseArguments $args \ + [list "ACTION" "METHOD" "ENCTYPE"] [list]] + my addStringIncr "" + return + } + + ## endForm - end a FORM element + + HtmlBuilder instproc endForm {} { + my addStringDecr {} + return + } + + ## addInput - add in INPUT element + ## Required arguments: + ## -type + ## -name + ## Optional arguments: + ## -value + ## -size + ## -maxlength + ## -checked + ## Common HTML arguments + + HtmlBuilder instproc addInput {args} { + set attributes [HtmlBuilder parseArguments $args \ + [list "TYPE" "NAME" "VALUE" "SIZE" "MAXLENGTH"] \ + [list "CHECKED"]] + my addString "" + return + } + + ## addTextArea - start a TEXTAREA element + ## First parameter: value - Default value of the text area + ## Required arguments: + ## -rows + ## -cols + ## Optional arguments: + ## -name + ## Common HTML Arguments + + HtmlBuilder instproc addTextArea {value args} { + set attributes [HtmlBuilder parseArguments $args \ + [list "ROWS" "COLS" "NAME"] [list]] + my addString "$value" + return + } + + ## startOptionSelector - start a SELECT element + ## Optional arguments: + ## -name + ## -size + ## -multiple + ## Common HTML arguments + + HtmlBuilder instproc startOptionSelector {args} { + set attributes [HtmlBuilder parseArguments $args \ + [list "NAME" "SIZE"] [list "MULTIPLE"]] + my addStringIncr "" + return + } + + ## endOptionSelector - end a SELECT element + + HtmlBuilder instproc endOptionSelector {} { + my addStringDecr "" + return + } + + ## startOption - start an OPTION element + ## Optional arguments: + ## -value + ## -selected + ## Common HTML arguments + + HtmlBuilder instproc startOption {args} { + set attributes [HtmlBuilder parseArguments $args \ + [list "VALUE"] [list "SELECTED"]] + my addStringIncr "" + return + } + + ## endOption - end an OPTION element + + HtmlBuilder instproc endOption {} { + my addStringDecr "" + return + } + + ## addImage - add an IMG element + ## Required arguments: + ## -src + ## -alt + ## -align (deprecated in HTML 4.0) + ## Optional arguments: + ## Common HTML arguments + + HtmlBuilder instproc addImage {args} { + set attributes [HtmlBuilder parseArguments $args \ + [list "SRC" "ALT" "ALIGN"] [list]] + my addString "" + return + } + + ## startBlock - start a DIV element (a generic block-level container) + ## Optional arguments: + ## Common HTML attributes + + HtmlBuilder instproc startBlock {args} { + set attributes [HtmlBuilder parseArguments $args [list] [list]] + my addStringIncr "" + return + } + + ## endBlock - end a DIV element + + HtmlBuilder instproc endBlock {} { + my addStringDecr "" + return + } + + ## addHorizontalRule - add an HR element + ## Optional arguments: + ## Common HTML arguments + + HtmlBuilder instproc addHorizontalRule {args} { + set attributes [HtmlBuilder parseArguments $args [list] [list]] + my addString "" + return + } + + namespace export HtmlBuilder +} + +namespace import ::xotcl::htmllib::* Index: library/lib/make.xotcl =================================================================== diff -u -N --- library/lib/make.xotcl (revision 0) +++ library/lib/make.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,156 @@ +# $Id: make.xotcl,v 1.4 2006/09/27 08:12:40 neumann Exp $ +### inEachDir changes now to each directory +### install clears tgarget directory before installing +### Object file added (for better -n processing) +lappend auto_path .. + +package require XOTcl +namespace import -force ::xotcl::* + +### +Object make +# +# shared lib add files for pkgIndex.tcl +# +make proc mkIndex {name} { + #puts stderr "+++ mkIndex in [pwd]" + set fls {} + foreach f [glob -nocomplain *tcl] { + if {![file isdirectory $f]} { + set F [open $f]; set c [read $F]; close $F + if {[string match "*package provide*" $c]} { lappend fls $f } + } + } + + set so [glob -nocomplain *[info sharedlibextension]] + # loading libxotcl into xotclsh crashes on some systems + foreach lib [list libxotcl$::xotcl::version[info sharedlibextension] \ + xotcl$::xotcl::version.dll] { + set p [lsearch -exact $so $lib] + if {$p != -1} { + set so [lreplace $so $p $p] + #puts stderr "new so=<$so>" + } + } + #puts stderr "[pwd]: call so=<$so>" + set fls [concat $fls $so] + + if {$fls ne ""} { + if {[file exists pkgIndex.tcl]} { + file delete -force pkgIndex.tcl + } + #puts stderr "callinglevel <[self callinglevel]> $fls" + #puts stderr "[pwd]:\n\tcall eval pkg_mkIndex -direct . $fls" + if {[catch {eval pkg_mkIndex -direct . $fls} errs]} { + puts stderr "!!! $errs" + } + #puts stderr "[pwd] done" + } + + foreach addFile [glob -nocomplain *.add] { + if {[file exists $addFile]} { + puts stderr "Appending $addFile to pkgIndex.tcl in [pwd]" + set OUT [file open pkgIndex.tcl a] + set IN [file open $addFile] + puts -nonewline $OUT [read $IN] + close $IN; close $OUT + } + } + #puts stderr "+++ mkIndex name=$name, pwd=[pwd] DONE" +} +make proc inEachDir {path cmd} { + #puts stderr "[pwd] inEachDir $path [file isdirectory $path]" + if { [file isdirectory $path] + && ![string match *CVS $path] + && ![string match *SCCS $path] + && ![string match *Attic $path] + && ![string match *dbm* $path] + } { + set olddir [pwd] + cd $path + eval make $cmd $path + set files [glob -nocomplain *] + cd $olddir + foreach p $files { my inEachDir $path/$p $cmd } + #puts stderr "+++ change back to $olddir" + } +} +make proc in {path cmd} { + if {[file isdirectory $path] && ![string match *CVS $path]} { + set olddir [pwd] + cd $path + eval make $cmd $path + cd $olddir + } +} +### tcl file-command +rename file tcl_file +Object file -requireNamespace + +rename open file::open +proc open {f {mode r}} { file open $f $mode } +#file proc open {f {mode r}} { ::open $f $mode } + + +file array set destructive { + atime 0 attributes 0 copy 1 delete 1 dirname 0 + executable 0 exists 0 extension 0 isdirectory 0 isfile 0 + join 0 lstat 0 mkdir 1 mtime 0 nativename 0 + owned 0 pathtype 0 readable 0 readlink 0 rename 1 + rootname 0 size 0 split 0 stat 0 tail 0 + type 0 volumes 0 writable 0 +} +foreach subcmd [file array names destructive] { + file proc $subcmd args { + #puts stderr " [pwd] call: '::tcl_file [self proc] $args'" + eval ::tcl_file [self proc] $args + } +} +### minus n option +Class make::-n +foreach f [file info commands] { + if {$f eq "unknown" || $f eq "next" || $f eq "self"} continue + if {![file exists destructive($f)] || [file set destructive($f)]} { + #puts stderr destruct=$f + make::-n instproc $f args { + puts "--- [pwd]:\t[self proc] $args" + } + } else { + #puts stderr nondestruct=$f + make::-n instproc $f args { + set r [next] + #puts "??? [self proc] $args -> {$r}" + return $r + } + } +} + +### command line parameters +if {![info exists argv] || $argv eq ""} {set argv -all} +if {$argv eq "-n"} {set argv "-n -all"} + +Class Script +Script proc create args { + eval lappend args $::argv + eval next $args +} +Script instproc unknown args { + puts stderr "$::argv0: Unknown option ´-$args´ provided" +} + +Script instproc n {} {file mixin make::-n} +Script instproc all {} { + make inEachDir . mkIndex +} +Script instproc dir {dirName} { + cd $dirName +} +Script instproc target {path} { + make set target $path +} +Script create main + +#puts stderr "+++ make.xotcl finished." +#if {[set ::tcl_platform(platform)] eq "windows"} { +# exit +#} Index: library/lib/makeDoc.xotcl =================================================================== diff -u -N --- library/lib/makeDoc.xotcl (revision 0) +++ library/lib/makeDoc.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,105 @@ +#$Id: makeDoc.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ +package require XOTcl +namespace import ::xotcl::* +@ @File { + description { + Documentation tool for the XOTcl distribution.
+ Usage: 'makeDoc docdir filename ?filename ...?'
+ Called by Makefile. + } +} +lappend auto_path [file dirname [info script]] + +package require xotcl::package +package verbose 1 +package require xotcl::xodoc +set fileList "" + +puts "XOTcl Documentation Tool" +puts "------------------------" +if {$argc > 1} { + set DOCDIR [lindex $argv 0] + puts "Documenting to directory $DOCDIR:" + if {![file isdirectory $DOCDIR]} { + file mkdir $DOCDIR + } + set files [lrange $argv 1 end] + foreach file $files { + puts "...$file" + if {[catch {XODoc documentFileAsHTML $file $DOCDIR} fb]} { + puts stderr "\terror processing $file:\n[string replace $::errorInfo 400 end ...]" + } else { + lappend fileList $file $fb + } + } +} else { + error "usage: xodoc docdir filename ?filename ...?" +} + +set filesHtml "" +set filesDir "" +## write index page +foreach {f fb} $fileList { + set dir . + regexp {^(.*)/[^/]*$} $f _ dir + if {$fb ne "langRef-xotcl"} { + set tail ", " + if {$dir != $filesDir} { + append filesHtml "
  • Directory '$dir':
    " + set filesDir $dir + set tail "" + } + append filesHtml "$tail[file tail $f]" + } +} + +# +# +# XOTcl - Documentation +# +# +#

    Lanuage Reference - Index

    + +set content { + +The Extended Object Tcl (XOTcl) Documentation contains the +following parts: + +

    XOTcl Language Documentation

    + + +

    Package and Script Documentation

    +
    + This section of the documentation is under work... +
    + +
      + $filesHtml +
    +

    + +

    Tcl Online Information

    + + +} + + +set content [subst -nobackslashes -nocommands $content] +set f [open $DOCDIR/index.html w] +puts $f $content +close $f + +puts "Documentation finished" Index: library/lib/metadataAnalyzer.xotcl =================================================================== diff -u -N --- library/lib/metadataAnalyzer.xotcl (revision 0) +++ library/lib/metadataAnalyzer.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,503 @@ +package provide xotcl::metadataAnalyzer 0.84 +package require XOTcl + +namespace eval ::xotcl::metadataAnalyzer { + namespace import ::xotcl::* + + @ @File { + description { + XOTcl file analyzer for @ metadata. E.g.\ used for + doumentation with xoDoc (but in the static variant + StaticMetadataAnalyzer which uses the dynamic + variant in this file). + <@p> + Sample sample usage: + <@pre> + package require xotcl::metadataAnalyzer + + # instantiate metadata analyzer object + MetadataAnalyzer @::m + # make this object be known to @ and turn @ metadata processing on + @ analyzerObj @::m + @ onOff 1 + + # read in some metadata tags (in sample file) & execute the file + source lib/testx.xotcl + + # turn @ metadata processing off again + @ onOff 0 + + # print out all collected metadata + puts [@::m print] + + } + } + + @ Class MetadataToken { + description { + Each collected metadata element is stored in a token object. + MetadataToken is superclass of token object classes. Each metadata token + has two interesting parameters: + <@p> + "properties" contains list of all described metadata properties. E.g. can + be printed with + <@pre> + foreach p [my set properties] { + if {[my exists $p]} { + append c " $p=[my set $p]\n" + } + } + + "name" contains the method, object, ... name of the metadata element. + <@p> + All metadata token are aggregated by @. Therefore, + <@pre> + foreach mdt [@ info children] { + if {[$mdt istype MetadataToken]} {$mdt print} + } + + prints all token. + + } + } + Class MetadataToken -parameter { + {name ""} + {properties ""} + } + + @ MetadataToken proc sortTokenList {l "token list"} { + description {Sort a token list with names. Since names are autonames, + this means order of appearance in the program.} + } + MetadataToken proc sortTokenList l { + foreach t $l { + set names([$t set name]) $t + } + set sortedNames [lsort [array names names]] + set sortedList "" + foreach n $sortedNames { + lappend sortedList $names($n) + } + return $sortedList + } + + MetadataToken instproc evaluateMetadata md { + my instvar properties + foreach {p v} $md { + # only append property, if its not already there + # otherwise just overwrite the value + if {[lsearch $properties $p] == -1} { + my lappend properties $p + } + my set $p $v + } + } + + @ MetadataToken instproc printProperties {} { + description {Print metadata properties to stdout.} + } + MetadataToken instproc printProperties {} { + set c "" + foreach p [my set properties] { + if {[my exists $p]} { + append c " [my capitalize $p]=[my set $p]\n" + } + } + return $c + } + + MetadataToken instproc capitalize string { + if {$::tcl_version >= 8.3} { + string toupper $string 0 0 + } else { + return "[string toupper [string range $string 0 0]][string range $string 1 end]" + } + } + + @ MetadataToken abstract instproc print {} { + description { + Abstract method for printing a token to stdout. + } + } + MetadataToken abstract instproc print {} + + @ Class FileToken -superclass MetadataToken { + description { + Token for @File Metadata. + } + } + Class FileToken -superclass MetadataToken + FileToken instproc print {} { + set c "FILE=[my set name]\n" + append c [my printProperties] + return $c + } + + @ Class ConstraintToken -superclass MetadataToken { + description { + Token for @Constraint Metadata. + } + } + Class ConstraintToken -superclass MetadataToken + ConstraintToken instproc print {} { + set c "CONSTRAINT=[my set name]\n" + append c [my printProperties] + return $c + } + + @ Class PackageToken -superclass MetadataToken { + description { + Token for Package metadata. Contains additional parameters: + "version" of the package and "type"= either "require" or "provide". + + } + } + Class PackageToken -superclass MetadataToken -parameter { + {version ""} + {type ""} + } + + @ Class ObjToken -superclass MetadataToken { + description { + Token for Object metadata. Contains additional parameters: + "procList" = list of all proc token and "cl"= class name. + } + } + Class ObjToken -superclass MetadataToken -parameter { + {procList ""} + cl + } + + ObjToken instproc printProcs {} { + set c " PROCS:\n" + set pl [MetadataToken sortTokenList [my procList]] + if {[my istype ClassToken]} { + set pl [concat [MetadataToken sortTokenList [my instprocList]] $pl] + } + foreach p $pl { + append c " [$p set name]\n" + } + return $c + } + + ObjToken instproc print {} { + set c "OBJECT=[my set name]\n" + if {[my exists cl]} {append c " CLASS=[my set cl]\n"} + if {[my exists heritage]} {append c " HERITAGE=[my set heritage]\n"} + append c [my printProperties] + + set pl [MetadataToken sortTokenList [my procList]] + if {[my istype ClassToken]} { + set pl [concat [MetadataToken sortTokenList [my instprocList]] $pl] + } + foreach p $pl { + append c [$p print] + } + + return $c + } + + @ Class ClassToken -superclass ObjToken { + description { + Token for Class metadata. Contains additional parameters: + "instprocList" = list of all instproc token. + } + } + Class ClassToken -superclass ObjToken -parameter { + {instprocList ""} + } + ClassToken instproc print {} { + regsub "^OBJECT=" [next] "CLASS=" r + return $r + } + + @ Class MetaClassToken -superclass ClassToken { + description { + Token for Meta-Class metadata. + } + } + Class MetaClassToken -superclass ClassToken + MetaClassToken instproc print {} { + regsub "^CLASS=" [next] "META-CLASS=" r + return $r + } + + @ Class MethodToken -superclass MetadataToken { + description { + Token for Method metadata. Contains additional parameters: + "arguments" of the method, "returnValue" of the method, + "obj" name, "abstract" = 0 or 1 (whether its an abstract method or not). + } + } + Class MethodToken -superclass MetadataToken -parameter { + arguments + returnValue + obj + {abstract 0} + } + + # Prints out method information + MethodToken instproc print {} { + set c " METHOD=[my set name], ARGUMENTS= " + + if {[my exists arguments]} { + foreach {arg argDescription} [my set arguments] { + # ignore argDescription and default values + if {[llength $arg] > 1} {set arg [lindex $arg 0]} + append c $arg " " + } + } + append c "\n [my printProperties]" + return $c + } + + @ Class ProcToken -superclass MethodToken { + description { + Token for Proc metadata + } + } + Class ProcToken -superclass MethodToken + ProcToken instproc print {} { + regsub "^ METHOD=" [next] " PROC=" r + return $r + } + + @ Class InstprocToken -superclass MethodToken { + description { + Token for Instproc metadata. + } + } + Class InstprocToken -superclass MethodToken + InstprocToken instproc print {} { + regsub "^ METHOD=" [next] " INSTPROC=" r + return $r + } + + @ Class MetadataAnalyzer { + description "Handler class for building a metadata runtime structure" + } + + Class MetadataAnalyzer -parameter { + {objList ""} + {packageList ""} + {knownMetaclasses "Class"} + {ns ""} + fileToken + {constraintList ""} + } + + MetadataAnalyzer instproc init args { + next + } + + MetadataAnalyzer instproc handleMethod {obj type name {argList ""} {doc ""}} { + #puts stderr "+++Method $type $name $argList $doc" + set procClass ProcToken + set objCl ObjToken + if {$type eq "instproc"} { + set procCl InstprocToken + set objCl ClassToken + } + set t [$procClass create [my autoname ::xotcl::@::t]] + + set n [$t set name [string trimleft $name :]] + $t set obj $obj + + set objFound 0 + foreach o [my set objList] { + if {[$o set name] == $obj} { + set objFound 1 + if {$type eq "instproc" && ![$o istype ClassToken]} { + $o class ClassToken + } + break + } + } + if {$objFound == 0} { + set o [$objCl create [my autoname ::xotcl::@::t]] + $o set name $obj + my lappend objList $o + } + $o lappend ${type}List $t + + $t set arguments $argList + + $t evaluateMetadata $doc + return $t + } + + MetadataAnalyzer instproc handleObj {class name args} { + my instvar knownMetaclasses objList extensions + set objCl ObjToken + if {[lsearch $class $knownMetaclasses] != -1} { + set objCl ClassToken + } + # if an instproc/proc has created an entry for this obj/class + # -> use it and overwrite it with new info + if {[set idx [lsearch $name $objList]] != -1} { + set t [lindex $objList $idx] + $t class $objCl + } else { + set t [$objCl create [my autoname ::xotcl::@::t]] + my lappend objList $t + } + + $t set name $name + + set la [llength $args] + + # evaluate -superclass argument + if {($la == 3 || $la == 2) && [lindex $args 0] eq "-superclass"} { + set heritage [$t set heritage [lindex $args 1]] + foreach h $heritage { + if {[lsearch $h $knownMetaclasses] != -1} { + # A new metaclass was defined + lappend knownMetaclasses $name + $t class MetaClassToken + } + } + } + + # evaluate documentation + set doc "" + if {$la == 1} { + set doc [lindex $args 0] + } elseif {$la == 3} { + set doc [lindex $args 2] + } + $t evaluateMetadata $doc + $t set cl $class + + #puts stderr "+++Obj $name $args" + } + + MetadataAnalyzer instproc handleFile doc { + if {[my exists fileToken]} { + [my set fileToken] evaluateMetadata $doc + } + } + + MetadataAnalyzer instproc handleConstraint {constraint name args} { + set t [ConstraintToken create [my autoname ::xotcl::@::t]] + my lappend constraintList $t + $t set name $name + set doc [lindex $args 0] + $t evaluateMetadata $doc + } + + MetadataAnalyzer instproc handlePackage args { + #puts "$args" + if {[llength $args] > 2} { + set type [lindex $args 1] + if {$type eq "provide" || $type eq "require"} { + set t [PackageToken create [my autoname ::xotcl::@::t]] + my lappend packageList $t + $t set name [lindex $args 2] + $t set type $type + if {[llength $args] > 3} { + $t set version [lindex $args 3] + } + } + } + } + + @ MetadataAnalyzer instproc print {} { + description "Print all collected token information to stdout. + This method is also an exmaple how the tokens can be used." + } + MetadataAnalyzer instproc print {} { + my instvar extensions packageList + set c "" + if {[llength $packageList] > 0} { + append c "PACKAGES:" + foreach t $packageList { + if {[$t type] eq "provide"} { + append c " Package provided: [$t name] [$t version]\n" + } elseif {[$t type] eq "require"} { + append c " Package required: [$t name] [$t version]\n" + } + } + } + + if {[my exists fileToken]} { + append c [[my set fileToken] print] + } + + if {[my exists constraintToken]} { + append c [[my set constraintToken] print] + } + + if {[info exists extensions]} { + # Add list of extensions. + foreach extension $extensions { + append c "\nExtensions: [$extension name], " \ + "Description: [$extension description]" + } + } + + set objList [MetadataToken sortTokenList [my objList]] + + if {[llength $objList]>0} { + foreach obj $objList {append c [$obj print]} + } + return $c + } + + @ Class AnalyzerCmd { + description {Class that overload the unknown mechanism of @ to provide metadata analysis.} + } + Class AnalyzerCmd -parameter { + {analyzerObj ""} + {onOff 0} + } + AnalyzerCmd instproc unknown args { + my instvar analyzerObj onOff + + if {!$onOff} {return [next]} + + if {[llength $args] > 1} { + set abstract 0 + if {[lindex $args 1] eq "abstract"} { + if {[llength $args] > 2} { + set p [lindex $args 2] + if {$p eq "proc" || $p eq "instproc"} { + set args [lreplace $args 1 1] + set abstract 1 + } + } + } + switch [lindex $args 1] { + proc - instproc { + set r [eval $analyzerObj handleMethod $args] + if {$abstract} {$r abstract 1} + return $r + } + default { + switch [lindex $args 0] { + @File { + return [$analyzerObj handleFile [lindex $args 1]] + } + @Constraint { + return [eval $analyzerObj handleConstraint $args] + } + default { + return [eval $analyzerObj handleObj $args] + } + } + } + } + } + puts stderr "Unknown @ metadata: '$args'" + } + @ AnalyzerCmd @ { + description {Recreate @ with metadata analyis funtionality.} + } + AnalyzerCmd @ + + namespace export \ + MetadataToken FileToken ConstraintToken PackageToken ObjToken \ + ClassToken MetaClassToken MethodToken ProcToken InstprocToken \ + MetadataAnalyzer AnalyzerCmd +} + +namespace import ::xotcl::metadataAnalyzer::* Index: library/lib/mixinStrategy.xotcl =================================================================== diff -u -N --- library/lib/mixinStrategy.xotcl (revision 0) +++ library/lib/mixinStrategy.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,98 @@ +#$Id: mixinStrategy.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ +package provide xotcl::mixinStrategy 0.9 + +package require XOTcl + +namespace eval ::xotcl::mixinStrategy { + namespace import ::xotcl::* + + @ @File { description { + These methods provide support for managing "strategies", i.e. + mixin-classes, where only one kind of a family of conformant + mixins should be registered. + <@p> + Naming convertions for strategies: + All strategies must follow the naming convention 'kind=implementation'. + Examples are the persistency strategy 'eager' specfied as + 'persistent=eager' or the persistency strategy 'lazy' (specified as + 'persistent=lazy') + }} + + @ Object instproc mixinStrategy {strategy "Strategy to be added" } { + description { + This method adds or replaces a new strategy from the mixin + list. Strategies are named following the convention mentioned + above. + } + return "old strategy" + } + + Object instproc mixinStrategy {strategy} { + regexp {:?([^:=]+)=} $strategy _ kind + set mixins "" + set oldStrategy "" + foreach mixin [my info mixin] { + if {[string match *${kind}=* $mixin]} { + lappend mixins $strategy + set oldStrategy $mixin + } else { + lappend mixins $mixin + } + } + if {$oldStrategy eq ""} { + lappend mixins $strategy + } + my mixin $mixins + return $oldStrategy + } + + @ Object instproc mixinQueryStrategy {kind "strategy kind"} { + description { + This method searches the mixin list for a mixin of this + kind (starting with $kind=) + } + return "returns the maching strategy" + } + + Object instproc mixinQueryStrategy {kind} { + set m [my info mixin] + return [::lindex $m [::lsearch -glob $m $kind=*]] + } + + @ Object instproc add {construct "(inst) 'filter' or 'mixin'" args "to be added"} { + description "add the specified (inst) 'filters' or 'mixins'" + return "empty" + } + + Object instproc add {kind args} { + if {$kind != {instfilter} && $kind != {instmixin} && + $kind != {filter} && $kind != {mixin}} { + error "Usage: [self proc] ..." + } + ::set classes [my info $kind] + eval ::lappend classes $args + my $kind $classes + #puts stderr "$kind of [self] are now: ´[my info $kind]´" + } + @ Object instproc remove {construct "(inst) 'filter' or 'mixin'" args "to be removed"} { + description "remove the specified (inst) 'filters' or 'mixins'" + return "empty" + } + Object instproc remove {kind args} { + if {$kind != {instfilter} && $kind != {instmixin} && + $kind != {filter} && $kind != {mixin}} { + error "Usage: [self proc] ..." + } + ::set classes [my info $kind] + foreach c $args { + ::set pos [::lsearch $classes $c] + if {$pos == -1} { + error "$kind ´$c´ could not be removed" + } else { + set $classes [::lreplace $classes $pos $pos] + } + } + my $kind $classes + # puts stderr "$kind of [self] are now: ´[my info $kind]´" + } +} Index: library/lib/package.xotcl =================================================================== diff -u -N --- library/lib/package.xotcl (revision 0) +++ library/lib/package.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,156 @@ +#$Id: package.xotcl,v 1.7 2006/09/27 08:12:40 neumann Exp $ +package provide xotcl::package 0.91 + +package require xotcl::mixinStrategy +package require XOTcl + +rename package tcl_package + +namespace eval ::xotcl::package { + namespace import ::xotcl::* + + @ @File {description { + Represent Tcl package loading command by an XOTcl + object. Enables tracking, tracing, and verbose output + of package loading + } + } + @ Object package { + description { + Supports all Tcl package options plus present and verbose. + } + } + @ package proc present {args "packageName or -exact packageName"} { + description { + Check whether a package is present or not. Similar to Tcl's + package present, but works with Tcl < 8.3 + } + } + @ package proc verbose {v "1 or 0"} { + description { + Toggle verbose output on/off. If on, package prints the locations + from where packages are loaded to the screen. Default is off. + } + } + + Object package + package set component . + package set verbose 0 + package proc unknown args { + #puts stderr "unknown: package $args" + namespace eval :: tcl_package $args + } + package proc verbose value { + my set verbose $value + } + package proc present args { + if {$::tcl_version<8.3} { + my instvar loaded + switch -exact -- [lindex $args 0] { + -exact {set pkg [lindex $args 1]} + default {set pkg [lindex $args 0]} + } + if {[info exists loaded($pkg)]} { + return $loaded($pkg) + } else { + error "not found" + } + } else { + namespace eval :: tcl_package present $args + } + } + + package proc require args { + my instvar component verbose uses loaded + set prevComponent $component + if {[catch {set v [eval package present $args]} msg]} { + #puts stderr "we have to load $msg" + switch -exact -- [lindex $args 0] { + -exact {set pkg [lindex $args 1]} + default {set pkg [lindex $args 0]} + } + set component $pkg + lappend uses($prevComponent) $component + set v [namespace eval :: tcl_package require $args] + if {$v ne "" && $verbose} { + set path [lindex [tcl_package ifneeded $pkg $v] 1] + puts "... $pkg $v loaded from '$path'" + set loaded($pkg) $v ;# loaded stuff needed for Tcl 8.0 + } + } + set component $prevComponent + return $v + } + + Object package::tracker + package::tracker set verbose 0 + package::tracker proc storeEntry {table index} { + my instvar verbose $table + set ${table}($index) "[package set component] [info script]" + if {$verbose} { + puts "... $table $index loaded from [info script]" + } + } + package::tracker proc dump {} { + my instvar class object instproc proc + if {[info exist class]} { parray class } + if {[info exist object]} { parray object } + if {[info exist instproc]} { parray instproc } + if {[info exist proc]} { parray proc } + } + package::tracker proc start {} { + ::Class add mixin [self]::M + ::Object add mixin [self]::M + } + + Class package::tracker::M + package::tracker::M instproc create {cls args} { + set table [string tolower [string trimleft [self] :]] + package::tracker storeEntry $table [lindex $args 0] + next + $cls add mixin [self class] + } + package::tracker::M instproc instproc args { + package::tracker storeEntry instproc [self]->[lindex $args 0] + next + } + package::tracker::M instproc proc args { + package::tracker storeEntry proc [self]->[lindex $args 0] + next + } + + #package::tracker set verbose 1 + #package::tracker start + # + #Class A + #A instproc p args { + # puts A + #} + #A proc pp args { + # a call + #} + #Object o + #o proc ppp args { + # another call + #} + #puts stderr ==================================================== + #package::tracker dump + + #puts stderr AUTO_PATH=$auto_path. + + namespace export package + namespace eval package { + namespace export tracker + namespace eval tracker { + namespace export M + } + } +} + +namespace import ::xotcl::package::* +namespace eval package { + namespace import ::xotcl::package::package::* + namespace eval tracker { + namespace import ::xotcl::package::package::tracker::* + } +} Index: library/lib/pkgIndex-package.add =================================================================== diff -u -N --- library/lib/pkgIndex-package.add (revision 0) +++ library/lib/pkgIndex-package.add (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1 @@ +package ifneeded xotcl::package 0.91 [list source [file join $dir package.xotcl]] Index: library/lib/pkgIndex.tcl =================================================================== diff -u -N --- library/lib/pkgIndex.tcl (revision 0) +++ library/lib/pkgIndex.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,21 @@ +# Tcl package index file, version 1.1 +# This file is generated by the "pkg_mkIndex -direct" command +# and sourced either when an application starts up or +# by a "package unknown" script. It invokes the +# "package ifneeded" command to set up package-related +# information so that packages will be loaded automatically +# in response to "package require" commands. When this +# script is sourced, the variable $dir must contain the +# full path name of this file's directory. + +package ifneeded xotcl::htmllib 0.1 [list source [file join $dir htmllib.xotcl]] +package ifneeded xotcl::metadataAnalyzer 0.84 [list source [file join $dir metadataAnalyzer.xotcl]] +package ifneeded xotcl::mixinStrategy 0.9 [list source [file join $dir mixinStrategy.xotcl]] +package ifneeded xotcl::script 0.9 [list source [file join $dir Script.xotcl]] +package ifneeded xotcl::staticMetadataAnalyzer 0.84 [list source [file join $dir staticMetadata.xotcl]] +package ifneeded xotcl::test 1.37 [list source [file join $dir test.xotcl]] +package ifneeded xotcl::trace 0.91 [list source [file join $dir trace.xotcl]] +package ifneeded xotcl::upvar-compat 1.0 [list source [file join $dir upvarcompat.xotcl]] +package ifneeded xotcl::wafecompat 0.9 [list source [file join $dir wafecompat.tcl]] +package ifneeded xotcl::xodoc 0.84 [list source [file join $dir xodoc.xotcl]] +package ifneeded xotcl::package 0.91 [list source [file join $dir package.xotcl]] Index: library/lib/staticMetadata.xotcl =================================================================== diff -u -N --- library/lib/staticMetadata.xotcl (revision 0) +++ library/lib/staticMetadata.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,82 @@ +package require xotcl::metadataAnalyzer +package provide xotcl::staticMetadataAnalyzer 0.84 +package require XOTcl + +namespace eval ::xotcl::staticMetadataAnalyzer { + namespace import ::xotcl::* + + @ @File { + description { + XOTcl file static analyzer for @ metadata. E.g. used for + doumentation with xoDoc. I.e. allows for reading in a + file and evaluating the metadata-related info only. + } + } + + @ Class StaticMetadataAnalyzer -superclass MetadataAnalyzer { + description { + Metadata analyzer class that allows for reading in files + and evaluation of the metadata content in the file. + } + } + + Class StaticMetadataAnalyzer -superclass MetadataAnalyzer \ + -parameter {{namespace ::}} + StaticMetadataAnalyzer instproc cmdsplit {cmd} { + # from Jeffrey's tkcon + set inc {} + set cmds {} + foreach cmd [split [string trimleft $cmd] \n] { + if {{} ne $inc } { + append inc \n$cmd + } else { + append inc [string trimleft $cmd] + } + if {[info complete $inc] && ![regexp {[^\\]\\$} $inc]} { + if {[regexp "^\[^#\]" $inc]} {lappend cmds $inc} + set inc {} + } + } + if {[regexp "^\[^#\]" $inc]} {lappend cmds $inc} + return $cmds + } + StaticMetadataAnalyzer instproc evaluateCommands {c} { + my instvar namespace + foreach command [my cmdsplit $c] { + #puts stderr "$command===========================" + if {[regexp "^ *:*@ " $command]} { + #puts stderr "$command===========================" + namespace eval $namespace $command + } elseif {[regexp "^ *package " $command]} { + #puts stderr "$command===========================" + namespace eval $namespace [list my handlePackage $command] + } elseif {[regexp "^ *namespace *eval *(\[^\{\]*) *\{(.*)\}\[^\}\]*$" $command _ namespace nsc]} { + #puts stderr "$command===========================" + namespace eval $namespace [list my evaluateCommands $nsc] + } + } + } + + + @ StaticMetadataAnalyzer instproc analyzeFile {name "File name"} { + description "Analyze a file and build up a token structure for each metadata token in the file." + } + StaticMetadataAnalyzer instproc analyzeFile name { + my set cmd "" + + set t [FileToken create [my autoname t]] + $t set name $name + my set fileToken $t + + set f [open $name r] + set c [read $f] + close $f + ::@ onOff 1 + my evaluateCommands $c + ::@ onOff 0 + } + + namespace export StaticMetadataAnalyzer +} + +namespace import ::xotcl::staticMetadataAnalyzer::* Index: library/lib/test.xotcl =================================================================== diff -u -N --- library/lib/test.xotcl (revision 0) +++ library/lib/test.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,96 @@ +package provide xotcl::test 1.37 +package require XOTcl + +namespace eval ::xotcl::test { + namespace import ::xotcl::* + + @ @File {description { + Simple regression test support. + }} + + @ Class Test { + description { + Class Test is used to configure test instances, which can + be configured by the following parameters: + <@ul> + <@li>cmd: the command to be executed + <@li>expected: the expected result + <@li>count: number of executions of cmd + <@li>pre: a command to be executed at the begin of the test (before cmd) + <@li>post: a command to be executed after the test (after all cmds) + <@li>namespace in which pre, post and cmd are evaluated; default :: + + The defined tests can be executed by <@tt>Test run + } + } + + Class Test -parameter { + cmd + {namespace ::} + {verbose 0} + {expected 1} + {count 1000} + msg setResult errorReport + pre post + } + Test set count 0 + Test proc new args { + eval my create t[format %.3d [my incr count]] $args + } + Test proc run {} { + set startTime [clock clicks -milliseconds] + foreach example [lsort [my allInstances]] { + $example run + } + puts stderr "Total Time: [expr {[clock clicks -milliseconds]-$startTime}] ms" + } + Test proc _allInstances {C} { + set set [$C info instances] + foreach sc [$C info subclass] { + eval lappend set [my _allInstances $sc] + } + return $set + } + Test proc allInstances {} { + return [my _allInstances Test] + } + + Test instproc call {msg cmd} { + if {[my verbose]} {puts stderr "$msg: $cmd"} + namespace eval [my namespace] $cmd + } + Test instproc run args { + my instvar cmd expected pre post count msg + if {[info exists pre]} {my call "pre" $pre} + if {![info exists msg]} {set msg $cmd} + set r [my call "run" $cmd] + if {[my exists setResult]} {set r [eval [my set setResult]]} + if {$r == $expected} { + if {[info exists count]} {set c $count} {set c 1000} + if {[my verbose]} { + puts stderr "running test $c times" + } + if {$c > 1} { + #set r0 [time $cmd $c] + #puts stderr "time {time $cmd $c}" + set r1 [time {time {namespace eval [my namespace] $cmd} $c}] + #regexp {^(-?[0-9]+) +} $r0 _ mS0 + regexp {^(-?[0-9]+) +} $r1 _ mS1 + set ms [expr {$mS1*1.0/$c}] + puts stderr "[self]:\t[format %6.1f $ms] mms, $msg" + } else { + puts stderr "[self]: $msg ok" + } + } else { + puts stderr "[self]:\tincorrect result for '$msg'" + puts stderr "\texpected: '$expected', got '$r' [my exists errorReport]" + if {[my exists errorReport]} {eval [my set errorReport]} + exit -1 + } + if {[info exists post]} {my call "post" $post} + } + + namespace export Test +} + +namespace import ::xotcl::test::* Index: library/lib/trace.xotcl =================================================================== diff -u -N --- library/lib/trace.xotcl (revision 0) +++ library/lib/trace.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,285 @@ +# -*- Tcl -*- $Id: trace.xotcl,v 1.12 2007/08/14 16:38:26 neumann Exp $ +package provide xotcl::trace 0.91 +package require XOTcl + +namespace eval ::xotcl::trace { + namespace import ::xotcl::* + + @ @File {description { + Various tracing tools for the XOTcl language. + } + } + @ Object instproc traceFilter { + args "arbitrary args" + } { + Description { + Filter to trace every method call on an object or class hierarchy. + Outputs a message befora and after each call of the traced object. + } + return "empty string" + } + @ Object Trace { + Description { + Write trace outputs and produce statistics. Variable traceStream + defines where to write trace output (default: stderr). + } + } + @ Trace proc puts {line "output line"} { + Description { + Define how traceFilter writes to the output stream. Default: + write to trace stream. + } + } + @ Trace proc openTraceFile {name "file name"} { + Description { + Redirect trace output to file. + } + } + @ Trace proc closeTraceFile {name "file name"} { + Description { + Close trace file and redirect output to stderr. + } + } + @ Object instproc lintFilter {} { + Description {Experimental lint filter} + } + @ Object instproc statFilter {} { + Description {Experimental statistics filter} + } + @ Object instproc showVars {args "ist of variables"} { + Description {Show the values of the specified variables (or of all variables) + of an object on stderr.} + } + @ Object instproc showMsg {msg "optional output"} { + Description {Show a message msg with the form "[self] $cls->$method $msg" on stderr.} + } + @ Object instproc showClass {} { Description {Show classes and mixins of the object}} + @ Object instproc showStack {maxDepth "max stack depth, default=100"} { + Description {Show callstack up to the specified calldepth.}} + @ Object instproc showCall {} { Description {Show the current call with the form "[self] $cls->$method $args" on stderr.}} + @ Object instproc showTimeStart {"?handle?" "Handle object name, optional"} {Description {start a timer}} + @ Object instproc showTimeEnd {"?handle?" "Handle object name, optional"} {Description {end a timer and show result}} + + ########################################################################## + + proc showCall {} { Trace deprecated-function showCall} + proc showVars {} { Trace deprecated-function showVars} + proc showObj {o {printObjectName 1}} { Trace deprecated-function showObj} + proc showStack {{m 100}} { Trace deprecated-function showStack} + + + Object Trace + Trace set traceStream stderr + Trace proc openTraceFile name { + my set traceStream [open $name w] + } + Trace proc closeTraceFile {} { + close $Trace::traceStream + my set traceStream stderr + } + Trace proc puts line { + puts $Trace::traceStream $line + } + Trace proc add {type obj} { + if {[my isclass $obj]} { + $obj instfilter add ${type}Filter + } else { + $obj filter add ${type}Filter + } + } + Trace proc delete {type obj} { + if {[my isclass $obj]} { + $obj instfilter delete ${type}Filter + } else { + $obj filter delete ${type}Filter + } + } + Trace proc statReset {} { + catch {my unset stat} + } + Trace proc statReportClass c { + if {[my exists stat($c)]} { + puts "\nClass $c: [my set stat($c)] references" + foreach method [$c info instprocs] { + set key $c->$method + if {[info exists stat($key)]} { + puts "\t$key: [my set stat($key)] references" + } else { + puts "\t$key: not used" + } + } + } else { + puts "\nClass $c: not used" + } + foreach subclass [lsort [$c info subclass]] { + my [self proc] $subclass + } + } + Trace proc statReport {} { + my statReportClass Object + } + Trace proc statCount key { + if {[my exists stat($key)]} { + my incr stat($key) + } else { + my incr set stat($key) 1 + } + } + Trace proc deprecated-function {name} { + puts stderr "Function <$name> is deprecated. Use method with same name instead." + } + + + + Object instproc traceFilter args { + # don't trace the Trace object + if {[self] eq "::Trace"} {return [next]} + set context "[self callingclass]->[self callingproc]" + set method [self calledproc] + switch -- $method { + proc - + instproc {set dargs [list [lindex $args 0] [lindex $args 1] ...] } + default {set dargs $args } + } + #my showStack + Trace puts "CALL $context> [self]->$method $dargs (next=[self next])" + set result [next] + Trace puts "EXIT $context> [self]->$method ($result)" + return $result + } + + Object instproc lintFilter args { + #puts stderr c=[self class],ic[my info class],p=[self calledproc] + #puts stderr " =====================METHOD='[self calledproc]'" + my instvar __reported + switch -exact -- [self calledproc] { + instvar { + set ccls [self callingclass] + set method [self callingproc] + + #puts stderr ccls=$ccls. + if {$ccls eq ""} { ;## instvar in proc + set bod [my info body $method] + set context "proc [self]->$method" + } else { ;## instvar in instproc + set bod [$ccls info instbody $method] + set context "instproc $ccls->$method" + } + foreach v $args { + set vpattern "$v\[^a-zA-Z0-9\]" + if {[regexp "\[\$\]$vpattern" $bod]} continue + if {[regexp " *$vpattern" $bod]} continue + #if {[regexp "info *exists *$vpattern" $bod]} continue + #if {[regexp "append *$vpattern" $bod]} continue + #if {[regexp "array.*$vpattern" $bod]} continue + if {[info exists __reported($v,$context)]} continue + set __reported($v,$context) 1 + puts stderr "'$v' of 'instvar $args' is NOT used in\n\ + $context ... {$bod}" + } + } + } + next + } + Object instproc statFilter args { + # don't return statistics from the Trace object + #puts stderr "self=[self]" + if {[self] eq "::Trace"} {return [next]} + set ccls [self callingclass] + set cmet [self callingproc] + set met [self calledproc] + #::puts stderr "cls=$ccls->$cmet, [self]->$met" + Trace statCount $ccls + Trace statCount $ccls->$cmet + next + } + + + + ###################################################################### + # show**** methods + # + Object instproc showVars args { + set msg {} + if {$args == {}} { + foreach var [lsort [my info vars]] { + if {[my array exists $var]} { + append msg "\n\t$var: " + #puts stderr "ARRAY $var" + #puts stderr "ARRAY names <[[self]array names $var]>" + foreach i [lsort [my array names $var]] { + append msg $i=[my set ${var}($i)] ", " + } + } elseif {[my exists $var]} { + append msg "\n\t$var: " [list [my set $var]] + } else { + append msg "\n\t$var: " UNKNOWN + } + } + } else { + foreach var $args { + if {[my array exists $var]} { + lappend msg $var: ARRAY + } elseif {[my exists $var]} { + lappend msg $var: [my set $var] + } else { + lappend msg $var: UNKNOWN + } + } + } + set method [self callingproc] + set cls [self callingclass] + puts stderr "[self] $cls->$method $msg" + #puts stderr " MIXINS: [my info mixin]" + } + Object instproc showMsg msg { + set method [self callingproc] + set cls [self callingclass] + puts stderr "[self] $cls->$method $msg" + } + Object instproc showClass {} { + set method [self callingproc] + set cls [self callingclass] + puts stderr "[self] $cls->$method class [my info class]\ + mixins {[my info mixin]}" + } + Object instproc showStack {{m 100}} { + set max [info level] + if {$m<$max} {set max $m} + puts stderr "Call Stack (level: command)" + for {set i 0} {$i < $max} {incr i} { + if {[catch {set s [uplevel $i self]} msg]} { + set s "" + } + puts stderr "[format %5d -$i]:\t$s [info level [expr {-$i}]]" + } + } + Object instproc showCall {} { + set method [self callingproc] + set cls [self callingclass] + set args [lreplace [info level -1] 0 0] + puts stderr "[self] $cls->$method $args" + } + Object instproc showTimeStart {{handle __h}} { + upvar [self callinglevel] $handle obj + set obj [Object [self]::[my autoname __time]] + $obj set clicks [clock clicks] + return + } + Object instproc showTimeEnd {{handle __h}} { + upvar [self callinglevel] $handle obj + set method [self callingproc] + set cls [self callingclass] + set elapsed [expr {([clock clicks]-[$obj set clicks])/1000000.0}] + puts stderr "[self] $cls->$method: elapsed [format %.2f $elapsed]secs" + $obj destroy + } + + + ###################################################################### + + + namespace export showCall showVars showObj showStack Trace +} + +namespace import ::xotcl::trace::* Index: library/lib/upvarcompat.xotcl =================================================================== diff -u -N --- library/lib/upvarcompat.xotcl (revision 0) +++ library/lib/upvarcompat.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,42 @@ +#$Id: upvarcompat.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::upvar-compat 1.0 +package require XOTcl + +namespace eval ::xotcl::upvar-compat { + namespace import ::xotcl::* + + @ @File {description { + Provide a version of upvar and uplevel that provide + backward compatibility such that these commands + ignore inactive filter and mixin frames (upvar behaves + the same whether or not a filter is installed). Newer + scripts should use <@TT>upvar/uplevel [self callinglevel] var/command + instead. + } } +} + +# Define upvar and uplevel; use the level, if given explizitely: +# otherwise point to the callinglevel from XOTcl +rename ::uplevel ::xotcl::tcl_uplevel +proc ::uplevel {lvl args} { + # the outer uplevel is needed to leave the scope of this proc + if {[regexp {^\#?[0-9]+$} $lvl]} { + ::xotcl::tcl_uplevel 1 [list eval ::xotcl::tcl_uplevel $lvl $args] + } else { + set cl [::xotcl::tcl_uplevel 1 ::xotcl::self callinglevel] + ::xotcl::tcl_uplevel 1 [list eval ::xotcl::tcl_uplevel $cl [list $lvl] $args] + } +} + +rename ::upvar ::xotcl::tcl_upvar +proc ::upvar {lvl args} { + # the outer uplevel is needed to leave the scope of this proc + if {[regexp {^\#?[0-9]+$} $lvl]} { + ::xotcl::tcl_uplevel 1 [list eval ::xotcl::tcl_upvar $lvl $args] + } else { + set cl [::xotcl::tcl_uplevel 1 ::xotcl::self callinglevel] + ::xotcl::tcl_uplevel 1 [list eval ::xotcl::tcl_upvar $cl [list $lvl] $args] + } +} + Index: library/lib/wafecompat.tcl =================================================================== diff -u -N --- library/lib/wafecompat.tcl (revision 0) +++ library/lib/wafecompat.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,51 @@ +# $Id: wafecompat.tcl,v 1.4 2006/09/27 08:12:40 neumann Exp $ +package provide xotcl::wafecompat 0.9 + +set WAFELIB /usr/lib/X11/wafe/ +set MODULE_PATH "$WAFELIB $auto_path" +set COMPONENT_PATH $WAFELIB/otcl-classes +proc MOTIFPREFIX {} {return {}} +proc requireModules modules { + global MODULE_PATH + foreach {cmd module} $modules { + if {{} ne [info command $cmd] } continue + if {[regexp {([A-Za-z1-9]+)Gen} $module _ n] || + [regexp {lib([a-z]+)} $module _ n] || + [regexp {^(.+)[.]so} $module _ n] + } { + set name [string toupper $n] + } + foreach path $MODULE_PATH { + set f $path/tcllib/bin/$module + if {[set found [file exists $f]]} { + puts stderr "Loading module $name from $f" + load $f $name + break + } + } + if {!$found} { error "Could not find module $module in {$MODULE_PATH}"} +}} +proc requireTclComponents {files} { + global COMPONENT_PATH _componentLoaded + foreach component $files { + if {[info exists _componentLoaded($component)]} continue + foreach path $COMPONENT_PATH { + set f $path/$component + if {[file exists $f]} { + puts stderr "Loading source file $f" + uplevel \#0 source $f + set _componentLoaded($component) $f + break + } + } + if {![info exists _componentLoaded($component)]} { + error "Could not find component $component in {$COMPONENT_PATH}" + } +}} +proc addTimeOut {n cmd} { + after $n $cmd +} +proc removeTimeOut {n} { + after cancel $n +} +proc quit {} { exit } Index: library/lib/xodoc.xotcl =================================================================== diff -u -N --- library/lib/xodoc.xotcl (revision 0) +++ library/lib/xodoc.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,412 @@ +# $Id: xodoc.xotcl,v 1.7 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::xodoc 0.84 +package require xotcl::staticMetadataAnalyzer +package require xotcl::htmllib +#package require xotcl::trace +package require XOTcl + +namespace eval ::xotcl::xodoc { + namespace import ::xotcl::* + + @ @File { + description { + XOTcl documentation tool. Overloads the command @, which is used + as a documentation token. + } + } + + @ Class MetadataTokenHTML { + description {Instmixin to provide HTML printing. Such instmixins + are registered for all token types. + } + } + Class MetadataTokenHTML + @ MetadataTokenHTML abstract instproc printHTML {} { + description {Print token to HTML document object} + } + MetadataTokenHTML abstract instproc printHTML {} + + @ MetadataTokenHTML instproc getDocPropertiesHTML {} { + description { + Returns list of properties as HTML. + } + } + + MetadataTokenHTML instproc getDocPropertiesHTML {htmlDoc} { + foreach p [my set properties] { + $htmlDoc startTableRow -valign top + if {[my exists $p]} { + $htmlDoc startTableCell -valign top + $htmlDoc addString " [my capitalize $p]:" + $htmlDoc endTableCell + + $htmlDoc startTableCell -valign top + if {$p eq "errorCodes"} { + # Build table cell with list of error codes. + foreach {code desc} [my set $p] { + set code [string map [list < <\; > >\;] $code] + set desc [string map [list < <\; > >\;] $desc] + $htmlDoc addString "$code: $desc\n

    " + } + } else { + $htmlDoc addString [my set $p] + } + $htmlDoc endTableCell + } + $htmlDoc endTableRow + } + } + + MetadataTokenHTML instproc reflowHTML {left paragraph} { + #set result "" + #foreach line [split $paragraph \n] { + # if {![regexp {^ *$} $line]} { + # append result "$left$line
    \n" + # } + #} + #return $result + return $paragraph + } + + MetadataToken instmixin [concat [MetadataToken info instmixin] MetadataTokenHTML] + + @ Class FileTokenHTML -superclass MetadataTokenHTML + Class FileTokenHTML -superclass MetadataTokenHTML + FileTokenHTML instproc printHTML {htmlDoc} { + $htmlDoc addLineBreak + $htmlDoc addString " Filename: " + $htmlDoc addAnchor [my set name] -href [my set name] + $htmlDoc addLineBreak + $htmlDoc addLineBreak + $htmlDoc startTable -border 0 + my getDocPropertiesHTML $htmlDoc + $htmlDoc endTable + } + + FileToken instmixin [concat [FileToken info instmixin] FileTokenHTML] + + @ Class ConstraintTokenHTML -superclass MetadataTokenHTML + Class ConstraintTokenHTML -superclass MetadataTokenHTML + ConstraintTokenHTML instproc printHTML {htmlDoc} { + $htmlDoc addAnchor "" -name [my set name] + $htmlDoc addString "

    Constraint: [my set name]

    " + $htmlDoc addLineBreak + $htmlDoc startTable -border 0 + my getDocPropertiesHTML $htmlDoc + $htmlDoc endTable + } + + ConstraintToken instmixin [concat [ConstraintToken info instmixin] ConstraintTokenHTML] + + @ Class ObjTokenHTML -superclass MetadataTokenHTML + Class ObjTokenHTML -superclass MetadataTokenHTML + ObjTokenHTML instproc getProcsHTML {htmlDoc} { + set c "" + set pl [MetadataToken sortTokenList [my procList]] + if {[my istype ClassToken]} { + set pl [concat [MetadataToken sortTokenList [my instprocList]] $pl] + } + foreach p $pl { + set pn [$p set name] + set label($pn) "$pn" + } + foreach l [lsort [array names label]] { + if {$c ne ""} {append c ", "} + append c $label($l) + } + if {$c ne ""} {append c "."} + $htmlDoc addString "$c" + } + + ObjTokenHTML instproc printHTML {htmlDoc} { + $htmlDoc addAnchor "" -name [my set name] + if {[my istype MetaClassToken]} { + set start "

    MetaClass:" + } elseif {[my istype ClassToken]} { + set start "

    Class:" + } else { + set start "

    Object:" + } + $htmlDoc addString "$start [my set name]

    " + if {[my exists cl]} { + $htmlDoc addString "Class: [my set cl]" + $htmlDoc addLineBreak + } + if {[my exists heritage]} { + $htmlDoc addString "Heritage: [my set heritage]" + $htmlDoc addLineBreak + } + + set head "" + if {[my procList] ne ""} {set head " Procs "} + if {[my istype ClassToken]} { + if {[my instprocList] ne ""} {set head " Procs/Instprocs: "} + } + $htmlDoc addString $head + my getProcsHTML $htmlDoc + + $htmlDoc startTable -border 0 + my getDocPropertiesHTML $htmlDoc + $htmlDoc endTable + } + + ObjToken instmixin [concat [ObjToken info instmixin] ObjTokenHTML] + + @ Class MethodTokenHTML -superclass MetadataTokenHTML + Class MethodTokenHTML -superclass MetadataTokenHTML + + # Prints out method information as HTML. + MethodTokenHTML instproc printHTML {htmlDoc} { + #my showVars + set argText "\n" + + HtmlBuilder args + + set a "Arguments:" + + set anchor [my set obj]-[my set name] + $htmlDoc addAnchor "" -name $anchor + + if {[my abstract]} {$htmlDoc addString "abstract"} + $htmlDoc addString "[my set name] " + + args set indentLevel [$htmlDoc set indentLevel] + + if {[my exists arguments]} { + #set argText "\n" + foreach {arg argDescription} [my set arguments] { + if {[llength $arg] > 1} { + # A default value was given to the argument. + $htmlDoc addString "?[lindex $arg 0]?" + set at "?[lindex $arg 0]?:$argDescription Default: \"[lindex $arg 1]\"." + } else { + $htmlDoc addString "$arg" + set at "$arg: $argDescription" + } + args startTableRow -valign top + args startTableCell -valign top + args addString $a + set a "" + args endTableCell + args startTableCell -valign top + args addString $at + args endTableCell + args endTableRow + } + } + $htmlDoc startTable -border 0 + + $htmlDoc addString [args toString] + args destroy + + my getDocPropertiesHTML $htmlDoc + + $htmlDoc endTable + + #$htmlDoc endListItem + } + + MethodToken instmixin [concat [MethodToken info instmixin] MethodTokenHTML] + + @ Class XODoc { description "Handler class for building a documentation database" } + + Class XODoc -superclass StaticMetadataAnalyzer + + @ XODoc proc documentFileAsHTML { + file "filename of the xotcl file to be documented" + docdir "directory to which the html file is written" + } { + description "Uses the xoDoc package to produce an HTML documentation of + a specified file ***.xotcl. The file is written to ***.html + in docdir" + return "file basename without suffix" + } + + XODoc proc documentFileAsHTML {file docdir} { + set docdb [XODoc [XODoc autoname docdb]] + ::@ set analyzerObj $docdb + $docdb analyzeFile $file + set ext [file extension $file] + if {$ext ne ""} {set ext -[string trimleft $ext .]} + set docfilename [file rootname [file tail $file]]$ext + $docdb writeFile ${docdir}/$docfilename.html $file + $docdb destroy + return $docfilename + } + + XODoc instproc printPackages {htmlDoc} { + my instvar packageList + $htmlDoc addString "

    Package/File Information

    " + if {[llength $packageList] > 0} { + foreach t $packageList { + if {[$t type] eq "provide"} { + $htmlDoc addString " Package provided: [$t name] [$t version]" + } elseif {[$t type] eq "require"} { + $htmlDoc addString " Package required: [$t name] [$t version]" + } + $htmlDoc addLineBreak + } + } else { + $htmlDoc addString " No package provided/required " + $htmlDoc addLineBreak + } + } + + XODoc instproc printExtensions {htmlDoc} { + my instvar extensions + if {[info exists extensions]} { + # Add list of extensions. + foreach extension $extensions { + $htmlDoc addLineBreak + $htmlDoc addString "

    Document extension: [$extension name]" + $htmlDoc addString "Description: [$extension description]" + $htmlDoc addLineBreak + } + } + } + + XODoc instproc printObjList {htmlDoc} { + set objList [MetadataToken sortTokenList [my objList]] + + if {[llength $objList]>0} { + $htmlDoc addLineBreak + $htmlDoc addString "Defined Objects/Classes: " + $htmlDoc startUnorderedList + foreach obj $objList { + set on [$obj set name] + $htmlDoc startListItem + $htmlDoc addAnchor "$on:" -href "#$on" + $obj getProcsHTML $htmlDoc + $htmlDoc addLineBreak + $htmlDoc endListItem + } + $htmlDoc endUnorderedList + } + } + + XODoc instproc printFileToken {htmlDoc} { + if {[my exists fileToken]} { + [my set fileToken] printHTML $htmlDoc + } else { + $htmlDoc addString " No file information. \n" + } + $htmlDoc addLineBreak + } + + XODoc instproc printConstraintsList {htmlDoc} { + set constraintList [MetadataToken sortTokenList [my constraintList]] + + if {[llength $constraintList]>0} { + $htmlDoc addLineBreak + $htmlDoc addString "Defined Constraints: " + $htmlDoc startUnorderedList + foreach c $constraintList { + set cn [$c set name] + $htmlDoc startListItem + $htmlDoc addAnchor "$cn:" -href "#$cn" + $htmlDoc addLineBreak + $htmlDoc endListItem + } + $htmlDoc endUnorderedList + } + } + + XODoc instproc printConstraints {htmlDoc} { + foreach c [my set constraintList] { + $htmlDoc addHorizontalRule + $htmlDoc startParagraph + $c printHTML $htmlDoc + $htmlDoc endParagraph + } + $htmlDoc addLineBreak + } + + XODoc instproc printProcsList {htmlDoc list string} { + if {[llength $list] > 0} { + $htmlDoc addString "

    $string

    " + $htmlDoc startUnorderedList + foreach s $list { + $htmlDoc startListItem + $s printHTML $htmlDoc + $htmlDoc endListItem + } + $htmlDoc endUnorderedList + } + } + XODoc instproc printObjs {htmlDoc} { + set objList [MetadataToken sortTokenList [my objList]] + + foreach t $objList { + $htmlDoc addHorizontalRule + $htmlDoc startParagraph + $t printHTML $htmlDoc + if {[$t istype ClassToken]} { + my printProcsList $htmlDoc [$t set instprocList] Instprocs + } + my printProcsList $htmlDoc [$t set procList] Procs + $htmlDoc endParagraph + } + } + + XODoc instproc replaceFormatTags {fc} { + regsub -all <@ $fc < fc + regsub -all " + htmlDoc addImage -src "./logo-100.jpg" -alt "$name" -align MIDDLE + htmlDoc addStringDecr "$name" + htmlDoc addHorizontalRule + htmlDoc startParagraph + + my printPackages htmlDoc + my printExtensions htmlDoc + my printObjList htmlDoc + my printConstraintsList htmlDoc + my printFileToken htmlDoc + my printObjs htmlDoc + my printConstraints htmlDoc + htmlDoc endParagraph + htmlDoc addHorizontalRule + htmlDoc startParagraph + htmlDoc endParagraph + htmlDoc addAnchor "Back to index page." -href "./index.html" + htmlDoc addLineBreak + htmlDoc addHorizontalRule + htmlDoc startParagraph + htmlDoc endParagraph + htmlDoc endDocument + set r [my replaceFormatTags [htmlDoc toString]] + htmlDoc destroy + return $r + } + + @ XODoc instproc writeFile { + filename "file name destination" name "name of the html document" + } { + description "Create HTML docuemntation from metadata token and write to file " + } + XODoc instproc writeFile {filename name} { + set content [my printHTML $name] + set f [open $filename w] + puts $f $content + close $f + } + + namespace export \ + MetadataTokenHTML FileTokenHTML ConstraintTokenHTML ObjTokenHTML \ + MethodTokenHTML XODoc +} + +namespace import ::xotcl::xodoc::* Index: library/patterns/COPYRIGHT =================================================================== diff -u -N --- library/patterns/COPYRIGHT (revision 0) +++ library/patterns/COPYRIGHT (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + * XOTcl - Extended OTcl + * + * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) + * + * (a) Vienna University of Economics and Business Administration + * Dept. of Information Systems / New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + Index: library/patterns/ChainOfResponsibility.xotcl =================================================================== diff -u -N --- library/patterns/ChainOfResponsibility.xotcl (revision 0) +++ library/patterns/ChainOfResponsibility.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,53 @@ +# $Id: ChainOfResponsibility.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::pattern::chainOfResponsibility 0.9 +package require XOTcl + +namespace eval ::xotcl::pattern::chainOfResponsibility { + namespace import ::xotcl::* + + Class ChainOfResponsibility -superclass Class + + ChainOfResponsibility instproc chainingFilter args { + set cp [self calledproc] + set registrationclass [lindex [self filterreg] 0] + $registrationclass instvar operations + #puts stderr "CHAIN [array names [self regclass]::chainedOperations ]---$cp" + if {[$registrationclass exists chainedOperations($cp)]} { + # + # a value is found on the chain, if it differs from the failure value ! + # + set failureValue [$registrationclass set chainedOperations($cp)] + set r [my $cp $args] + if {$r == $failureValue} { + if {[my exists successor] && + [set s [my set successor]] != ""} { + #puts stderr "CHAIN: forwarding to $s" + set r [$s $cp $args] + } + } + set r ;# return $r + } else { + next ;# return [next] + } + } + + ChainOfResponsibility instproc init args { + my instfilter add chainingFilter + my parameter {successor} + # chained operations hold their value of failure + my array set chainedOperations {} + } + + ChainOfResponsibility instproc addChainedOperation {name {failureValue ""}} { + my set chainedOperations($name) $failureValue + } + + ChainOfResponsibility instproc removeChainedOperation {name} { + my unset chainedOperations($name) + } + + namespace export ChainOfResponsibility +} + +namespace import ::xotcl::pattern::chainOfResponsibility::* Index: library/patterns/OnCalleeProxy.xotcl =================================================================== diff -u -N --- library/patterns/OnCalleeProxy.xotcl (revision 0) +++ library/patterns/OnCalleeProxy.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ +# $Id: OnCalleeProxy.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::pattern::onCalleeProxy 0.8 +package require XOTcl + +namespace eval ::xotcl::pattern::onCalleeProxy { + namespace import ::xotcl::* + + Class OnCalleeProxy -superclass Class + + @ @File { + description { + Simple proxy pattern implementation enhanced with the ability to adapt + calls solely for specified calling objects + for each calling obj there may be a different delegator obj + } + } + + OnCalleeProxy instproc onCalleeProxyFilter args { + set o [string trimleft [self callingobject] :] + my instvar callee + #puts stderr "[self class]: checking $o -- [self] -- [self calledproc] " + if {[info exists callee($o)]} { + return [::eval [set callee($o)] [self calledproc] $args] + } else { + next + } + } + + OnCalleeProxy instproc init args { + my instfilter add onCalleeProxyFilter + next + my instproc setCallee {callingObj a} { + my set callee([string trimleft $callingObj :]) $a + } + } + + namespace export OnCalleeProxy +} + +namespace import ::xotcl::pattern::onCalleeProxy::* Index: library/patterns/Singleton.xotcl =================================================================== diff -u -N --- library/patterns/Singleton.xotcl (revision 0) +++ library/patterns/Singleton.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,84 @@ +# $Id: Singleton.xotcl,v 1.7 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::pattern::singleton 0.8 +package require XOTcl + +namespace eval ::xotcl::pattern::singleton { + namespace import ::xotcl::* + + Class SingletonBase + SingletonBase instproc getInstance args { + my instvar _instance + if {[info exists _instance]} { + return $_instance + } + return "" + } + + + # + # A simple pattern mixin that makes a class to a non-specializable singleton + # + Class NonSpecializableSingleton -superclass SingletonBase + + NonSpecializableSingleton instproc create args { + my instvar _instance + if {![info exists _instance]} { + set _instance [self] + next + } + return $_instance + } + + NonSpecializableSingleton instproc getInstance {} { + if {[info exists _instance]} { + my instvar _instance + return $_instance + } + return "" + } + + # + # Specializable Singleton + # + Class Singleton -superclass {SingletonBase Class} + Singleton instproc singletonFilter args { + switch -exact [self calledproc] { + init { + set registrationclass [lindex [self filterreg] 0] + $registrationclass instvar _instance + if {![info exists _instance]} { + set _instance [self] + next + } else { + my destroy + } + return $_instance + } + default { + return [next] + } + } + } + + Singleton instproc init args { + my instfilter add singletonFilter + # + # specialized singletons have to look up the singleton class + # first + Class instproc getInstance {} { + foreach sc [my info superclass] { + if {[$sc info class] eq "::Singleton"} { + return [$sc getInstance] + } else { + return "" + } + } + } + next + } + + namespace export SingletonBase NonSpecializableSingleton Singleton +} + +namespace import ::xotcl::pattern::singleton::* Index: library/patterns/SortedComposite.xotcl =================================================================== diff -u -N --- library/patterns/SortedComposite.xotcl (revision 0) +++ library/patterns/SortedComposite.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,80 @@ +# $Id: SortedComposite.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::pattern::sortedCompositeWithAfter 0.9 +package require XOTcl + +namespace eval ::xotcl::pattern::sortedCompositeWithAfter { + namespace import ::xotcl::* + + Class SortedComposite -superclass Class + + @ @File { + description { + Composite pattern enhanced with sorting + } + } + + SortedComposite instproc remove {array element} { + if {[my exists ${array}($element)]} { + my unset ${array}($element) + } + } + + SortedComposite instproc addOperations args { + foreach pair $args { + foreach {proc op} $pair {my set operations($proc) $op} + } + } + + SortedComposite instproc removeOperations args { + foreach op $args {my remove operations $op} + } + + SortedComposite instproc addAfterOperations args { + foreach pair $args { + foreach {proc op} $pair {my set afterOperations($proc) $op} + } + } + SortedComposite instproc removeAfterOperations args { + foreach op $args {my remove afterOperations $op} + } + + SortedComposite instproc compositeFilter args { + set registrationclass [lindex [self filterreg] 0] + set r [self calledproc] + set result [next] + if {[$registrationclass exists operations($r)] && [my exists children]} { + set method [$registrationclass set operations($r)] + foreach object [my set children] { + eval [self]::$object $method $args + } + } + if {[$registrationclass exists afterOperations($r)]} { + eval my [$registrationclass set afterOperations($r)] $args + } + set result + } + + SortedComposite instproc init args { + my array set operations {} + my array set afterOperations {} + + my instproc setChildren args { + switch [llength $args] { + 0 { return [my set children] } + 1 { return [my set children [lindex $args 0]] } + default {error "wrong # args: [self] setChildren ?children?"} + } + } + my instproc appendChildren args { + eval my lappend children $args + } + + next + my instfilter add compositeFilter + } + + namespace export SortedComposite +} + +namespace import ::xotcl::pattern::sortedCompositeWithAfter::* Index: library/patterns/adapter.xotcl =================================================================== diff -u -N --- library/patterns/adapter.xotcl (revision 0) +++ library/patterns/adapter.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,44 @@ +# $Id: adapter.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::pattern::adapter 0.9 + +package require XOTcl + +namespace eval ::xotcl::pattern::adapter { + namespace import ::xotcl::* + + Class Adapter -superclass Class + + @ @File { + description { + Simple adapter pattern meta-class taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + } + } + + Adapter instproc adapterFilter args { + set r [self calledproc] + my instvar specificRequest adaptee \ + [list specificRequest($r) sr] + if {[info exists sr]} { + return [eval $adaptee $sr $args] + } + next + } + + Adapter instproc init args { + my instfilter add adapterFilter + next + my instproc setRequest {r sr} { + my set specificRequest($r) $sr + } + my instproc setAdaptee {a} { + my set adaptee $a + } + } + + namespace export Adapter +} + +namespace import ::xotcl::pattern::adapter::* Index: library/patterns/composite.xotcl =================================================================== diff -u -N --- library/patterns/composite.xotcl (revision 0) +++ library/patterns/composite.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,62 @@ +# $Id: composite.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::pattern::composite 0.9 +package require XOTcl + +namespace eval ::xotcl::pattern::composite { + namespace import ::xotcl::* + + Class Composite -superclass Class + + @ @File { + description { + Simple composite pattern meta-class taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + } + } + + Composite instproc addOperations args { + foreach op $args { + if {![my exists operations($op)]} { + my set operations($op) $op + } + } + } + + Composite instproc removeOperations args { + foreach op $args { + if {![my exists operations($op)]} { + my unset operations($op) + } + } + } + + Composite instproc compositeFilter args { + # get the operations class variable from the object's class + set registrationclass [lindex [self filterreg] 0] + $registrationclass instvar operations + # get the request + set r [self calledproc] + + # check if the request is a registered operation + if {[info exists operations($r)]} { + foreach object [my info children] { + # forward request + eval $object $r $args + } + } + return [next] + } + + + Composite instproc init {args} { + my array set operations {} + next + my instfilter add compositeFilter + } + + namespace export Composite +} + +namespace import ::xotcl::pattern::composite::* Index: library/patterns/link.xotcl =================================================================== diff -u -N --- library/patterns/link.xotcl (revision 0) +++ library/patterns/link.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,58 @@ +# $Id: link.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::pattern::link 0.9 +package require XOTcl + +namespace eval ::xotcl::pattern::link { + namespace import ::xotcl::* + + # + # establish/introspect 'link' through link-instproc + # + Class Link -parameter { + {link ""} + } + + Link instproc adapterFilter args { + set l [my set link] + set m [self calledproc] + + # let link/destroy requests go through to the link + if {$m eq "link" || $m eq "destroy"} { + return [next] + } + + if {[Object isobject $l]} { + puts stderr "adapting $m on link [self] -> $l" + eval $l $m $args + } else { + # if there is currently no link establish -> return + if {$l eq ""} {return} + error "Link: object $l is no xotcl object" + } + } + + Link instfilter adapterFilter + + # Link L + # Class A + + # L link A + + # L w + + # w set a 45 + + # puts [w set a] + + # puts [L link] + + # #A destroy + # puts ----1 + # L set r 45 + # puts ----2 + + namespace export Link +} + +namespace import ::xotcl::pattern::link::* Index: library/patterns/manager.xotcl =================================================================== diff -u -N --- library/patterns/manager.xotcl (revision 0) +++ library/patterns/manager.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,40 @@ +# $Id: manager.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::pattern::manager 0.8 +package require XOTcl + +namespace eval ::xotcl::pattern::manager { + namespace import ::xotcl::* + + # + # a simle manager pattern following buschmann (164) + # based on dynamic object aggregation and using dynamic code + # for supplier creation (instead of loading) + # + # it shares the suppliers ! + # + + # + # abstract supplier, init starts dynamic code creation + # + Class Supplier + Supplier abstract instproc init args + Supplier abstract instproc m args + + + Class Manager -parameter { + {supplierClass Supplier} + } + + Manager instproc getSupplier {name} { + if {[my info children [namespace tail $name]] != ""} { + return [self]::[namespace tail $name] + } else { + return [my [my supplierClass] [namespace tail $name]] + } + } + + namespace export Supplier Manager +} + +namespace import ::xotcl::pattern::manager::* Index: library/patterns/observer.xotcl =================================================================== diff -u -N --- library/patterns/observer.xotcl (revision 0) +++ library/patterns/observer.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,100 @@ +# $Id: observer.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::pattern::observer 0.8 +package require XOTcl + +namespace eval ::xotcl::pattern::observer { + namespace import ::xotcl::* + + Class Observer -superclass Class + + @ @File { + description { + Simple observer pattern meta-class taken from the paper + 'Filters as a Language Support for Design Patterns in + Object-Oriented Scripting Languages'. + } + } + + Class Observer::Subject -superclass Class + + Observer::Subject instproc notificationFilter {args} { + set procName [self calledproc] + my instvar \ + preObservers [list preObservers($procName) preObs] \ + postObservers [list postObservers($procName) postObs] + + if {[info exists preObs]} { + foreach obj $preObs { $obj update [self] $args } + } + set result [next] + + if {[info exists postObs]} { + foreach obj $postObs { $obj update [self] $args } + } + return $result + } + + Class Observer::SubjectMgt + Observer::SubjectMgt instproc attach {hook objs} { + upvar [self callinglevel] $hook observers + foreach obj $objs { + if {![info exists observers] || [lsearch $observers $obj] == -1} { + lappend observers $obj + } + } + } + Observer::SubjectMgt instproc detach {hook objs} { + upvar [self callinglevel] $hook observers + if {[info exists observers]} { + foreach obj $objs { + set p [lsearch $observers $obj] + set observers [lreplace $observers $p $p] + } + } + } + + Observer::SubjectMgt instproc attachPre {procName args} { + my instvar preObservers + my attach preObservers($procName) $args + } + Observer::SubjectMgt instproc attachPost {procName args} { + my instvar postObservers + my attach postObservers($procName) $args + } + Observer::SubjectMgt instproc detachPre {procName args} { + my instvar preObservers + my detach preObservers($procName) $args + } + Observer::SubjectMgt instproc detachPost {procName args} { + my instvar postObservers + my detach postObservers($procName) $args + } + + Observer::Subject instproc init args { + next + my superclass [list Observer::SubjectMgt [my info superclass]] + my instfilter notificationFilter + } + + Observer instproc timeout t { + my set timeout $t + } + + Observer instproc update {subject args} { + #addTimeOut [my set timeout] "my update $subject $args" + #$subject getResponse + # do something with the response + puts [self]---update + } + + namespace export Observer + namespace eval Observer { + namespace export Subject SubjectMgt + } +} + +namespace import ::xotcl::pattern::observer::* +namespace eval Observer { + namespace import ::xotcl::pattern::observer::Observer::* +} Index: library/patterns/pkgIndex.tcl =================================================================== diff -u -N --- library/patterns/pkgIndex.tcl (revision 0) +++ library/patterns/pkgIndex.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,19 @@ +# Tcl package index file, version 1.1 +# This file is generated by the "pkg_mkIndex -direct" command +# and sourced either when an application starts up or +# by a "package unknown" script. It invokes the +# "package ifneeded" command to set up package-related +# information so that packages will be loaded automatically +# in response to "package require" commands. When this +# script is sourced, the variable $dir must contain the +# full path name of this file's directory. + +package ifneeded xotcl::pattern::adapter 0.9 [list source [file join $dir adapter.xotcl]] +package ifneeded xotcl::pattern::chainOfResponsibility 0.9 [list source [file join $dir ChainOfResponsibility.xotcl]] +package ifneeded xotcl::pattern::composite 0.9 [list source [file join $dir composite.xotcl]] +package ifneeded xotcl::pattern::link 0.9 [list source [file join $dir link.xotcl]] +package ifneeded xotcl::pattern::manager 0.8 [list source [file join $dir manager.xotcl]] +package ifneeded xotcl::pattern::observer 0.8 [list source [file join $dir observer.xotcl]] +package ifneeded xotcl::pattern::onCalleeProxy 0.8 [list source [file join $dir OnCalleeProxy.xotcl]] +package ifneeded xotcl::pattern::singleton 0.8 [list source [file join $dir Singleton.xotcl]] +package ifneeded xotcl::pattern::sortedCompositeWithAfter 0.9 [list source [file join $dir SortedComposite.xotcl]] Index: library/pkgIndex.tcl =================================================================== diff -u -N --- library/pkgIndex.tcl (revision 0) +++ library/pkgIndex.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,10 @@ +set __dir__ $dir +foreach index [concat \ + [glob -nocomplain [file join $dir * pkgIndex.tcl]] \ + [glob -nocomplain [file join $dir * * pkgIndex.tcl]]] { + set dir [file dirname $index] + source $index +} +set dir $__dir__ +unset __dir__ + Index: library/rdf/COPYRIGHT =================================================================== diff -u -N --- library/rdf/COPYRIGHT (revision 0) +++ library/rdf/COPYRIGHT (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + * XOTcl - Extended OTcl + * + * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) + * + * (a) Vienna University of Economics and Business Administration + * Dept. of Information Systems / New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + Index: library/rdf/RDFCreator.xotcl =================================================================== diff -u -N --- library/rdf/RDFCreator.xotcl (revision 0) +++ library/rdf/RDFCreator.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,142 @@ +# $Id: RDFCreator.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::rdf::tripleRecreator 0.9 +package require XOTcl +package require xotcl::rdf::parser + +namespace eval ::xotcl::rdf::tripleRecreator { + namespace import ::xotcl::* + + Class RDFCreator -parameter { + {rdfNS "http://www.w3.org/1999/02/22-rdf-syntax-ns#"} + {openExprs ""} + } + + Class OpenExpr -parameter { + {type ""} + {subject ""} + {closing ""} + } + + RDFCreator instproc init args { + next + } + + RDFCreator instproc free {} { + my instvar openExprs + while {$openExprs ne ""} { + set o [lindex $openExprs 0] + set openExprs [lrange $openExprs 1 end] + $o destroy + } + } + + RDFCreator instproc sort {tl} { + # + # this assumes that the triples are created and named in node tree order, e.g. + # through autonames like triple0, triple1, ... (as in rdfTripleCreator) + # + # => bag types defs are before bag's _1, _2 -- etc. + # + # otherwise overload sorting method ! + # + return [lsort $tl] + } + + RDFCreator instproc createFromTriples {tripleList} { + my instvar openExprs + set heading "\n" + set closing "\n" + } + } + } + + if {[set nsPrefix [[self]::ns searchFullName $ns]] == ""} { + [self]::ns add [set nsPrefix [my autoname $prefix]] $ns + append heading "\n xmlns:${nsPrefix}=\"$ns\"" + } + + set oe [lindex [my set openExprs] 0] + + if {$oe eq "" || [$oe subject] != $s} { + if {$oe ne ""} { + append body [$oe closing] + [lindex [set openExprs] 0] destroy + set openExprs [lrange $openExprs 1 end] + } + if {$opening eq ""} { + append body "\n" + set closing "\n" + set type "Description" + } else { + append body $opening + } + set noe [my OpenExpr [my autoname oe]] + set openExprs [concat $noe $openExprs] + + $noe subject $s + $noe closing $closing + $noe type $type + set oe $noe + } + set tn ${nsPrefix}:$name + + switch -exact [$oe type] { + RDFDescription { + #puts DESCRIPTION + append body "\n<$tn> [$t object] " + } + RDFAlt - RDFSeq { + #puts ALT---$tn + if {[regexp {rdf:_([0-9]*)} $tn _ __]} { + append body "\n" + } + } + RDFBag { + if {[regexp {rdf:_([0-9]*)} $tn _ __]} { + append body "\n<$tn resource=\"[$t object]\"/>" + } + } + } + } else { + puts "Predicate '$p' not matched" + # hier als xmlns behandeln ... + } + } + append heading ">" + set r $heading + while {$openExprs ne ""} { + set oe [lindex $openExprs 0] + set openExprs [lrange $openExprs 1 end] + append body [$oe closing] + $oe destroy + } + append r $body + append r "\n" + return $r + } + + namespace export RDFCreator OpenExpr +} + +namespace import ::xotcl::rdf::tripleRecreator::* Index: library/rdf/RDFTriple.xotcl =================================================================== diff -u -N --- library/rdf/RDFTriple.xotcl (revision 0) +++ library/rdf/RDFTriple.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,545 @@ +# $Id: RDFTriple.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ +package provide xotcl::rdf::triple 1.0 + +package require XOTcl +package require xotcl::rdf::parser + +namespace eval ::xotcl::rdf::triple { + namespace import ::xotcl::* + + Class RDFTriple -parameter { + predicate + subject + object + } + + RDFTriple instproc dump {} { + #set o [my object]; if {[info command $o] ne ""} { $o showVars } + #return "P: [my predicate] S: [my subject] O: [my object]\n" + return "[my subject] -[my predicate]-> '[my object]'\n" + } + + Class NodeInfo -parameter { + lastCurrentNode + {aboutEach 0} + {aboutEachPrefix 0} + topID + {statements ""} + } + + Class DescriptionInfo -superclass NodeInfo -parameter { + {bagID 0} + } + + Class PropertyInfo -superclass NodeInfo -parameter { + {reify 0} + generatedParentID + } + + Class AboutEachMgr + + AboutEachMgr instproc init args { + my array set entries {} + next + } + + AboutEachMgr instproc reset {} { + foreach c [my info children] {$c destroy} + my init + } + + AboutEachMgr instproc addEntry {name} { + my set entries($name) "" + } + + AboutEachMgr instproc isEntry {name} { + my exists entries($name) + } + + AboutEachMgr instproc addTriple {name p s o} { + if {[my exists entries($name)]} { + set r [RDFTriple create [self]::[my autoname name%08d]] + $r set predicate $p + $r set subject $s + $r set object $o + my lappend entries($name) $r + return $r + } + return "" + } + + AboutEachMgr instproc getTriples {name} { + if {[my exists entries($name)]} { + my set entries($name) + } else {return ""} + } + + Class RDFTripleDB + RDFTripleDB instproc add {p s o} { + #my showCall + set r [RDFTriple create [self]::[my autoname triple%08d]] + $r set predicate $p + $r set subject $s + $r set object $o + return $r + } + RDFTripleDB instproc dump {} { + #my showCall + set r "" + foreach fact [my info children] {append r [$fact dump]} + return $r + } + RDFTripleDB instproc getTriples {} { + # for the time being: return only children of type RDFTriple + set ch {} + foreach c [my info children] {if {[$c istype "RDFTriple"]} {lappend ch $c}} + return $ch + #my info children + } + RDFTripleDB instproc reset {} { + #my showCall + foreach c [my info children] {$c destroy} + my autoname -reset triple + #my showMsg "children after reset: <[my info children]>'" + } + # return all triples that match the subject + RDFTripleDB instproc querySubject {s} { + #my showCall + set r "" + foreach t [my info children] { + if {[string match $s [$t subject]]} { + lappend r $t + } + } + return $r + } + + RDFTripleDB instproc queryPredicate {p} { + #my showCall + set r "" + foreach t [my info children] { + if {[string match $p [$t predicate]]} { + lappend r $t + } + } + return $r + } + + RDFTripleDB instproc queryPredicateOnSubject {p s} { + #my showCall + foreach t [my querySubject $s] { + if {[string match $p [$t predicate]]} { + # there may be only one matching P on a S + # return the triple + return $t + } + } + return "" + } + RDFTripleDB instproc prettyTriples {} { + my instvar result + if {[my exists table]} {my unset table} + if {[my exists subjectPrinted]} {my unset subjectPrinted} + set result "" + + foreach triple [lsort [my getTriples]] { + set subject [$triple set subject] + set predicate [$triple set predicate] + set object [$triple set object] + + regexp {^http.*w3[.]org.*(\#.*)$} $predicate _ predicate + regexp {^http.*w3[.]org.*(\#.*)$} $object _ object + my lappend table($subject) $predicate $object + } + foreach subject [lsort [my array names table]] { + if {![regexp {^rdfdoc\#} $subject]} { my prettyStatements "" $subject } + } + set r $result; set result "" + foreach subject [lsort [my array names table]] { + if {![my exists subjectPrinted($subject)]} { + my prettyStatements "" $subject + } + } + if {$result ne ""} { + append r "\n=================== unreferenced:\n$result" + + } + return $r + } + RDFTripleDB instproc prettyStatement {space subject predicate object} { + my append result "$space [format %-35s $subject] [format %-25s $predicate] $object\n" + } + RDFTripleDB instproc prettyStatements {space subject} { + if {![my exists table($subject)]} { + my append result "$space NO VALUE FOR $subject\n" + } else { + if {![my exists subjectPrinted($subject)]} { + my set subjectPrinted($subject) 1 + foreach {predicate object} [my set table($subject)] { + my prettyStatement $space $subject $predicate $object + if {[regexp {^rdfdoc\#} $object]} { + my prettyStatements "$space " $object + } + } + } + } + } + + + Class TripleVisitor -superclass NodeTreeVisitor -parameter { + {descriptionAsBag 0} + {currentNode ""} + parser + rdfNS + } + + TripleVisitor instproc getInfo {} { + my set openNode([my set currentNode]) + } + + TripleVisitor instproc getLastInfo {info} { + my set openNode([$info set lastCurrentNode]) + } + + TripleVisitor instproc popInfo {objName} { + set i [my getInfo] + my set currentNode [$i set lastCurrentNode] + my unset openNode($objName) + return $i + } + + TripleVisitor instproc pushInfo {objName ei} { + set lce [$ei set lastCurrentNode [my set currentNode]] + if {$lce ne ""} { + set lastInfo [my set openNode($lce)] + $ei aboutEach [$lastInfo aboutEach] + $ei aboutEachPrefix [$lastInfo aboutEachPrefix] + } + my set openNode($objName) $ei + my set currentNode $objName + } + + TripleVisitor instproc qualify {obj var} { + [$obj resolveNS] getFullName $var + } + + TripleVisitor instproc init args { + my array set openNode {{} {}} + RDFTripleDB create [self]::db + AboutEachMgr create [self]::aboutEach + AboutEachMgr create [self]::aboutEachPrefix + next + } + + TripleVisitor instproc resetWithoutDB args { + [self]::aboutEach reset + [self]::aboutEachPrefix reset + next + } + + TripleVisitor instproc reset args { + [self]::db reset + my resetWithoutDB + next + } + + TripleVisitor instproc addDB {p s o} { + #puts "ADDDB: P<$p> S<$s> O<$o>" + set info [my getInfo] + if {$info ne ""} { + set topID [$info set topID] + if {[$info aboutEach]} { + return [[self]::aboutEach addTriple $topID $p $s $o] + } elseif {[$info aboutEachPrefix]} { + return [[self]::aboutEachPrefix addTriple $topID $p $s $o] + } + } + return [[self]::db add $p $s $o] + } + + TripleVisitor instproc checkReification {triple node} { + # for statements that nest inside a description/property, we remember + # the statement to be able to reify them + # (e.g., bag created for description) + if {$triple ne "" && $node ne ""} { + set info [my set openNode($node)] + if {[my isobject $info] && [$info istype NodeInfo]} { + ${info} lappend statements $triple + } + } + } + + TripleVisitor instproc qualifyWithBaseURL v { + if {[string match "\#*" $v]} { + return [[my set parser] baseURL]$v + } + return $v + } + + TripleVisitor instproc RDFTag {objName} { + set ns [$objName resolveNS] + set rdfNS [$ns searchNamespaceByPrefix rdf] + if {$rdfNS eq ""} { + set rdfNS [$ns searchNamespaceByPrefix xmlns] + } + my set rdfNS $rdfNS + } + TripleVisitor instproc DescriptionNode objName { + set di [DescriptionInfo create [self]::[my autoname di]] + $di topID [my qualifyWithBaseURL [$objName getSubject]] + my pushInfo $objName $di + # + # if a description nests inside a Member, we need a triple + # for the member index (connected to the Description topId) + # + if {[namespace tail [[set member [$objName info parent]] info class]] \ + == "RDFMember"} { + set bag_ID [[$member info parent] set ID] + my addDB [my qualify $objName [$member set memberIndex]] \ + $bag_ID [$di set topID] + } + } + + TripleVisitor instproc handlePCData {objName pcdata} { + set info [my getInfo] + + if {[set lcn [$info set lastCurrentNode]] == ""} { + #puts stderr "cannot determine lastCurrentNode from $info" + #$info showVars + set selector "" + } else { + set selector [namespace tail [$lcn info class]] + } + + switch -exact $selector { + RDFDescription { + set triple [my addDB \ + [my qualify $objName [$objName set content]] \ + [$info set topID] $pcdata] + my checkReification $triple $lcn + } + RDFProperty { + if {[set rAttr [$lcn getRDFAttribute resource]] != ""} { + set triple [my addDB \ + [my qualify $objName [$objName set content]] \ + [$lcn set $rAttr] $pcdata] + #$lcn showVars + } else { + set lastInfo [my getLastInfo $info] + if {[$lastInfo exists generatedParentID]} { + set parentID [$lastInfo set generatedParentID] + } else { + set parentID [[$objName info parent] set ID] + } + #set parentID [$lastInfo set generatedParentID] + set triple [my addDB \ + [my qualify $objName [$objName set content]] \ + $parentID $pcdata] + } + } + default { + #puts stderr "create a generatedParentID for reification" + $info set generatedParentID [[my set parser] makeID] + set triple [my addDB \ + [my qualify $objName [$objName set content]] \ + [$info set generatedParentID] $pcdata] + my checkReification $triple [my set currentNode] + } + } + $info set tripleWritten 1 + } + + TripleVisitor instproc Property objName { + set info [PropertyInfo create [self]::[my autoname pi]] + ## if we find no subject and are in Container -> + ## reifiy over generatedParentID + set propSubject [$objName getSubject] + + $info topID [my qualifyWithBaseURL $propSubject] + my pushInfo $objName $info + + if {[$objName exists pcdata]} { + my handlePCData $objName [$objName getFirstPCData] + } + } + + TripleVisitor instproc ContainerNode objName { + set ID [my qualifyWithBaseURL [$objName set ID]] + foreach t [$objName array names rdfTypes] { + my addDB [my qualify $objName \ + [$objName qualifyWithRdfNsPrefix type]] $ID $t + } + } + + TripleVisitor instproc Member objName { + set container [$objName info parent] + set resource [$objName qualifyWithRdfNsPrefix resource] + set parseType [$objName qualifyWithRdfNsPrefix parseType] + if {[$objName exists pcdata]} { + set co [$objName getFirstPCData] + } elseif {[$objName exists attributes(resource)]} { + set co [$objName set attributes(resource)] + } elseif {[$objName exists attributes($resource)]} { + set co [$objName set attributes($resource)] + } + #puts stderr "CONTAINER = [info exists co]" + if {[info exists co]} { + my addDB \ + [my qualify $container [$objName set memberIndex]] \ + [$container set ID] $co + } else { + #$objName showVars + } + } + + TripleVisitor instproc visit objName { + set cl [namespace tail [$objName info class]] + $objName instvar attributes + set triple "" + + #puts "********Visit $objName -- $cl" + + switch -exact $cl { + RDFTag {my RDFTag $objName} + RDFDescription {my DescriptionNode $objName} + RDFProperty {my Property $objName} + RDFBag - RDFSeq - RDFAlt {my ContainerNode $objName} + RDFMember {my Member $objName} + } + + foreach a [array names attributes] { + regexp "^([$objName set rdfNSPrefix]:|)(.*)" $a _ __ an + switch -exact $an { + bagID { + set info [my getInfo] + $info set bagID 1 + } + aboutEach { + set info [my getInfo] + if {[DescriptionInfo info instances $info] eq ""} { + error "AboutEach not in description" + } + $info aboutEach 1 + [self]::aboutEach addEntry [my qualifyWithBaseURL [$objName getSubject]] + } + aboutEachPrefix { + set info [my getInfo] + if {[DescriptionInfo info instances $info] eq ""} { + error "AboutEachPrefix not in description" + } + $info aboutEachPrefix 1 + [self]::aboutEachPrefix addEntry [my qualifyWithBaseURL [$objName getSubject]] + } + resource { + if {$cl eq "RDFProperty"} { + my handlePCData $objName [set attributes($a)] + } + } + } + } + } + + TripleVisitor instproc reificate {objName p s o} { + set memberID [[my set parser] makeID] + my addDB [my qualify $objName \ + [$objName qualifyWithRdfNsPrefix predicate]] $memberID $p + my addDB [my qualify $objName \ + [$objName qualifyWithRdfNsPrefix subject]] $memberID $s + my addDB [my qualify $objName \ + [$objName qualifyWithRdfNsPrefix object]] $memberID $o + my addDB [my qualify $objName \ + [$objName qualifyWithRdfNsPrefix type]] $memberID \ + [my qualify $objName [$objName qualifyWithRdfNsPrefix Statement]] + return $memberID + } + + TripleVisitor instproc visitEnd objName { + switch -exact [namespace tail [$objName info class]] { + RDFDescription { + set di [my popInfo $objName] + if {[my descriptionAsBag] || [$di set bagID]} { + set bagID [$objName set bagID] + my addDB [my qualify $objName [$objName qualifyWithRdfNsPrefix type]] \ + $bagID [my qualify $objName [$objName qualifyWithRdfNsPrefix Bag]] + + set bagCount 0 + + foreach s [$di set statements] { + set memberID [my reificate $objName \ + [$s set predicate] [$s set subject] [$s set object]] + my addDB [my qualify $objName \ + [$objName qualifyWithRdfNsPrefix _[incr bagCount]]] \ + $bagID $memberID + } + } + foreach t [$objName array names rdfTypes] { + my addDB [my qualify $objName [$objName qualifyWithRdfNsPrefix "type"]] \ + [$objName getSubject] $t + } + $di destroy + } + RDFProperty { + set info [my popInfo $objName] + if {![$info exists tripleWritten]} { + set triple "" + foreach fc [$objName info children] { + switch -exact [namespace tail [$fc info class]] { + RDFDescription { + set triple [my addDB \ + [my qualify $objName [$objName set content]] \ + [my qualifyWithBaseURL [$objName getSubject]] [$fc getSubject]] + break + } + RDFBag - RDFSeq - RDFAlt { + set triple [my addDB \ + [my qualify $objName [$objName set content]] \ + [my qualifyWithBaseURL [$objName getSubject]] [$fc set ID]] + break + } + } + } + if {$triple ne ""} { + my checkReification $triple [my set currentNode] + } + } + $info destroy + } + } + } + + TripleVisitor instproc evaluateAboutEach {} { + set triplesWritten "" + set rdfNSFullName [[my rdfNS] searchPrefix rdf] + + foreach entry [[self]::aboutEach array names entries] { + # matching entry triples should be bag types and their + # members -> duplication of aboutEach statements for the + # members + foreach entryTriple [lsort [[self]::db querySubject $entry]] { + if {[regexp "^${rdfNSFullName}_\[0-9\]*$" [$entryTriple predicate]]} { + foreach t [[self]::aboutEach getTriples $entry] { + set subject [$t subject] + # if this is a toplevel elt of an about each tree -> its + # subject is the object of the container member + if {$subject eq $entry} { + [self]::db add [$t predicate] [$entryTriple object] [$t object] + } elseif {[lsearch $triplesWritten $t] == -1} { + [self]::db add [$t predicate] $subject [$t object] + lappend triplesWritten $t + } + } + } + } + } + } + + TripleVisitor instproc interpretNodeTree {node} { + my set parser [$node set parser] + $node accept [self] + my evaluateAboutEach + } + + namespace export RDFTriple NodeInfo DescriptionInfo PropertyInfo \ + AboutEachMgr RDFTripleDB TripleVisitor +} +namespace import ::xotcl::rdf::triple::* Index: library/rdf/pkgIndex.tcl =================================================================== diff -u -N --- library/rdf/pkgIndex.tcl (revision 0) +++ library/rdf/pkgIndex.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,14 @@ +# Tcl package index file, version 1.1 +# This file is generated by the "pkg_mkIndex -direct" command +# and sourced either when an application starts up or +# by a "package unknown" script. It invokes the +# "package ifneeded" command to set up package-related +# information so that packages will be loaded automatically +# in response to "package require" commands. When this +# script is sourced, the variable $dir must contain the +# full path name of this file's directory. + +package ifneeded xotcl::rdf::parser 1.0 [list source [file join $dir xoRDF.xotcl]] +package ifneeded xotcl::rdf::recreatorVisitor 0.9 [list source [file join $dir rdfRecreatorVisitor.xotcl]] +package ifneeded xotcl::rdf::triple 1.0 [list source [file join $dir RDFTriple.xotcl]] +package ifneeded xotcl::rdf::tripleRecreator 0.9 [list source [file join $dir RDFCreator.xotcl]] Index: library/rdf/rdfExample.xotcl =================================================================== diff -u -N --- library/rdf/rdfExample.xotcl (revision 0) +++ library/rdf/rdfExample.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,76 @@ +#!/usr/bin/env tclsh +# $Id: rdfExample.xotcl,v 1.2 2006/02/18 22:17:33 neumann Exp $ +# +# small Example for usage of xoXML +# +package require XOTcl; namespace import -force xotcl::* +package require xotcl::package +package require xotcl::trace +package require xotcl::rdf::parser +package require xotcl::rdf::recreatorVisitor +package require xotcl::xml::printVisitor + +# +# instantiate parser and parser an example text into a node tree +# +RDFParser x +x parse { + + + + + Mary Andrew + Jacky Crystal + + + + + + + + + + + + + The Coolest Web Page + Il Pagio di Web Fuba + + + + + some text + + + + +} + +proc run {} { + # + # print the node treee to the std output + # + puts ************************************************************************ + puts "Node Tree:" + puts ************************************************************************ + PrintVisitor pv + foreach tn [x info children topNode*] { + pv interpretNodeTree $tn + } + + # + # recreate xml text and print it to the std output + # + puts \n + puts ************************************************************************ + puts "Recreated RDF Text:" + puts ************************************************************************ + RDFRecreatorVisitor rv + foreach tn [x info children topNode*] { + set result [rv interpretNodeTree $tn] + puts $result + } +} +run Index: library/rdf/rdfRecreatorVisitor.xotcl =================================================================== diff -u -N --- library/rdf/rdfRecreatorVisitor.xotcl (revision 0) +++ library/rdf/rdfRecreatorVisitor.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,45 @@ +#$Id: rdfRecreatorVisitor.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::rdf::recreatorVisitor 0.9 +package require xotcl::rdf::parser +package require xotcl::xml::recreatorVisitor +package require XOTcl + +namespace eval ::xotcl::rdf::recreatorVisitor { + namespace import ::xotcl::* + + ############################################################################## + # + # a visitor that recreates an RDF representation from a + # node tree + # + ############################################################################# + Class RDFRecreatorVisitor -superclass XMLRecreatorVisitor + + RDFRecreatorVisitor instproc appendLineFeed obj { + if {[set parseType [$obj getRDFAttribute parseType]] != ""} { + if {$parseType ne "Resource"} { + # we have parseType == Literal + # -> don't append "\n" + return "" + } + } + return "\n" + } + + RDFRecreatorVisitor instproc visit objName { + next + my instvar result + if {[$objName istype RDFResource]} { + foreach t [$objName array names rdfTypes] { + set ts [$objName prependRDFPrefix type] + append result " [my insertIndent $objName]<$ts resource=\"$t\"/>\n" + } + } + return $result + } + + namespace export RDFRecreatorVisitor +} + +namespace import ::xotcl::rdf::recreatorVisitor::* Index: library/rdf/xoRDF.xotcl =================================================================== diff -u -N --- library/rdf/xoRDF.xotcl (revision 0) +++ library/rdf/xoRDF.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,777 @@ +# $Id: xoRDF.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $ +package provide xotcl::rdf::parser 1.0 + +package require XOTcl +package require xotcl::xml::parser +#package require xotcl::pattern::link +package require xotcl::trace + +namespace eval ::xotcl::rdf::parser { + namespace import ::xotcl::* + + ############################################################################## + # + # RDF Parse Type Handling for RDF Node Class and RDF Parser class + # to be used as mixin. Here, we have decomposed the parse type handling + # + ############################################################################## + + # + # Nodes just call "isParseLiteral", "isParseResource", and "handleParseType" + # by their template methods -> mixins concretizes implementation + # + Class RDFNodeParseTypeHandling + + # + # parseType=literal nodes are not parsed, but handled as literals + # -> the XML parser should parse these nodes -> we have cut them off + # if we encounter "parseType = literal" nextParsedLiterals searches the + # parseLiterals array and returns the content + # + RDFNodeParseTypeHandling instproc nextParsedLiterals {} { + set parser [my set parser] + $parser set parseLiterals([$parser incr parseLiteralsCount]) + } + + # + # handle attributes that determine the parse type + # + RDFNodeParseTypeHandling instproc handleParseType value { + if {$value eq "Resource"} { + my set parseResource 1 + } else { + # with RDF 1.0 all values other than Resource are treated + # as parseType = literal + my set pcdata [list "" [my nextParsedLiterals]] + my set parseLiteral 1 + } + } + + # + # two convinience methods that tell us whether the parse type is literal/resource + # + RDFNodeParseTypeHandling instproc isParseLiteral {} { + # + # if the parse literal var is set -> one child + # is of type ParseTypeLiteral ! + # + my exists parseLiteral + } + RDFNodeParseTypeHandling instproc isParseResource {} { + # + # if the parseResource var is set -> one child + # is of type ParseTypeResource ! + # + my exists parseResource + } + + # + # and we overload the Parser's parse method in order to cut off + # all parseType = "Literal", because we have to hinder the XML + # parser to parse RDF text that is marked as parseType = literal + # we store the result in an array "parseLiterals" that is used + # by the RDFNodeParseTypeHandling Mixin + # + Class RDFParserParseTypeHandling + RDFParserParseTypeHandling instproc parse data { + my array set parseLiterals {} + my set parseLiteralsCount 0 + set count 0 + + set dt $data + + while {[set pt [string first "parseType" $dt]] != -1} { + # we cut the string off manually, because a regexp is slower + if {$::tcl_version > 8.0} { + set last [string first "=" $dt $pt] + } else { + set last [string first "=" [string range $dt $pt end]] + incr last $pt + } + set ptStart [expr {[string last "<" [string range $dt 0 $pt]] + 1}] + set propName [string range $dt $ptStart $pt] + set blank [string first " " $propName] + if {$blank != -1} { + set propName [string range $propName 0 [expr {$blank -1}]] + } + set dt [string range $dt $last end] + # All parse types != Resource treated as literals + if {![regexp {^= *[\"']Resource} $dt]} { + regexp -indices ">" $dt idx + set start [lindex $idx 1] + if {[regexp -indices "" $dt idx]} { + set endTagLeft [lindex $idx 0] + set literal [string range $dt [expr {$start + 1}] [expr {$endTagLeft - 1}]] + set dt [string range $dt $endTagLeft end] + my set parseLiterals([incr count]) $literal + } else { + error "end tag for $propName missing" + } + } + } + next $data + } + + ############################################################################## + # + # RDFNode Node Class + # + ############################################################################## + + Class RDFNode -superclass XMLNode -parameter { + subject + {rdfNSPrefix ""} + } + @ Class RDFNode -superclass XMLNode { + description { + general superclass for RDF nodes + common properties + } + } + + # + # add mixins for parse type handling + # + RDFNode instproc init args { + next + my mixin add RDFNodeParseTypeHandling + set p [my info parent] + if {[$p exists rdfNSPrefix]} { + my set rdfNSPrefix [$p set rdfNSPrefix] + #puts stderr "RDF Prefix defined in [self]->init to [$p set rdfNSPrefix]" + } + } + + RDFNode instproc parseData {text} { + if {[my isParseLiteral]} {return} + next + } + + # + # try to find the "subject" of the RDF statement -> + # if it not found on the actual node search the parents + # + # per default subject is ""; subclasses add subjects, + # when they encounter ID, about, ... attrs + # + RDFNode instproc getSubject {} { + for {set o [self]} {![$o istype RDFTag]} {set o [$o info parent]} { + if {[$o exists subject]} {return [$o set subject]} + } + return "" + } + + + # + # lets the parser construct an unique ID in the parser + # + RDFNode instproc makeID {} { + [my set parser] makeID + } + + # + # abstract methods that have to be concretized with parse type handling + # by a parse type mixin (or in subclass) + # + RDFNode abstract instproc isParseLiteral {} + RDFNode abstract instproc isParseResource {} + RDFNode abstract instproc handleParseType value + + RDFNode instproc appendRDFType t { + set t [[my resolveNS] getFullName $t] + my set rdfTypes($t) 1 + } + + # + # get a typed node abbreviation -> convert it to + # a description + a nested rdf:type property + # + RDFNode instproc getTypedNode {name attrList} { + set r [my getNestingNode RDFDescription \ + [my qualifyWithRdfNsPrefix Description] $attrList] + $r appendRDFType $name + set r + } + + # + # try to parse children corresponding to parse type or if none is given + # try to parse a child of type obj -> Description or Container + # + RDFNode instproc parseNestedChild {name attrList} { + if {[my isParseResource]} { + if {![my exists resourceDescription]} { + my set resourceDescription \ + [my getNestingNode RDFDescription \ + [my qualifyWithRdfNsPrefix Description] {}] + # we have resolved parseType="resource" with a description + # -> remove parse type attribute info ... it is not correct anymore, + # but remember parseResource flag + if {[my exists attributes(parseType)]} { + my unset attributes(parseType) + } + if {[my exists attributes([set parseType [my qualifyWithRdfNsPrefix parseType]])]} { + my unset attributes($parseType) + } + } + + set r [[my set resourceDescription] getPropertyNodeChild $name $attrList] + } elseif {[my isParseLiteral]} { + set r [self] + # literal -> do nothing + } else { + if {[set node [my isNestingNode $name]] ne ""} { + set r [my getNestingNode $node $name $attrList] + } else { + set r [my getTypedNode $name $attrList] + } + } + return $r + } + + # + # step forward in the attrList + # + RDFNode instproc nextAttrNode {node attrList index} { + upvar [self callinglevel] $index i $attrList a + if {$node ne ""} { + set a [lreplace $a $i [expr {$i + 1}]] + } else { + incr i 2 + } + } + + # + # create a child node of Property type and return it + # + # don't build a node for "type" properties, but append them to + # the list + # + RDFNode instproc getPropertyNodeChild {name attrList} { + regexp "^[my set rdfNSPrefix]:(.*)" $name _ name + set parser [my set parser] + if {$name eq "type" && [my istype RDFResource]} { + # seek for resource attribute and append type to list + set rp [my prependRDFPrefix resource] + set rdfns [$parser set rdfNamespace] + foreach {n v} $attrList { + if {![my istype RDFContainerNodeClass]} { + if {$n eq $rp || $n eq "resource"} { + foreach c {Bag Alt Seq} { + if {$v eq "$rdfns$c"} { + my class RDF$c + my set memberNr 0 + my set ID [my set bagID] + my unset bagID + my set content [my prependRDFPrefix $c] + # reclass existing li props to member + set li [my prependRDFPrefix li] + foreach child [lsort [my info children]] { + if {[namespace tail [$child info class]] eq "RDFProperty"} { + if {[$child set content] eq $li || + [$child set content] eq "li"} { + $child class RDFMember + my giveMemberNr $child + $child set content $li + } + } + } + } + } + } + } + my appendRDFType $v + } + return [self] + } else { + set nf [$parser set nodeFactory] + set r [$nf getNode RDFProperty [self]::[my nextChild prop] $parser] + $r set content $name + $r parseAttributes $name $attrList + set r + } + } + + # + # property in abbr syntax (as attribute) + # + RDFNode instproc propertyAttribute {n v} { + set r [my getPropertyNodeChild $n ""] + $r parseData $v + set r + } + + # + # check whether an attribute name matches an attributed RDFNode + # of this class or not + # return the corresponding node class + # + RDFNode instproc isAttribute {n} { + regexp "^[my set rdfNSPrefix]:(.*)" $n _ n + if {[lsearch [[my info class] set attributeList] $n] != -1} { + return $n + } elseif {$n eq "xml:lang"} { + # we create attribute for xml_lang (for recreation purposes) + return $n + } + return "" + } + + # + # check if name matches an node class that may be nested in [self] + # + RDFNode instproc isNestingNode {n} { + regexp "^[my set rdfNSPrefix]:(.*)" $n _ n + set cl [my info class] + if {[$cl exists nestingList($n)]} { + return [$cl set nestingList($n)] + } + return "" + } + + RDFNode instproc getNestingNode {node name attrList} { + set parser [my set parser] + set nf [$parser set nodeFactory] + switch [namespace tail $node] { + "RDFMember" - "RDFProperty" {set objName prop} + default {set objName res} + } + set r [$nf getNode $node [self]::[my nextChild $objName] $parser] + $r set content $name + $r parseAttributes $name $attrList + set r + } + + # + # check whether the RDF namespace is redefined to another prefix + # + RDFNode instproc makeIndividualNSEntry {prefix entry} { + if {$entry eq [[my set parser] rdfNamespace]} { + if {[my set rdfNSPrefix] eq "" || $prefix ne "xmlns"} { + my set rdfNSPrefix $prefix + } + #puts stderr "RDF Prefix redefined in [self] to $prefix" + } + next + } + + RDFNode instproc qualifyWithRdfNsPrefix t { + set ns [my set rdfNSPrefix] + if {$ns eq "xmlns"} {return $t} + return $ns:$t + } + + # + # checks whether a given attribute is part of the attributes array + # and returns the varname, otherwise "" + # + RDFNode instproc getAttribute {n nsFullName} { + set ns [my resolveNS] + set xmlns [$ns searchPrefix xmlns] + if {$xmlns eq $nsFullName && [my exists attributes($n)]} { + return attributes($n) + } + set prefix [$ns searchFullName $nsFullName] + if {$prefix ne "" && + [my exists attributes($prefix:$n)]} { + return attributes($prefix:$n) + } + return "" + } + + # + # searches for attribute "n" with rdf namespace prefix + # + RDFNode instproc getRDFAttribute {n} { + if {[my exists attributes($n)]} { + return [my set attributes($n)] + } + set rdfNSPrefix [my set rdfNSPrefix] + if {$rdfNSPrefix ne "xmlns"} { + set n $rdfNSPrefix:$n + if {[my exists attributes($n)]} { + return [my set attributes($n)] + } + } + return "" + } + + RDFNode instproc prependRDFPrefix ts { + set rdfNSPrefix [my set rdfNSPrefix] + if {$rdfNSPrefix ne "xmlns"} {set ts $rdfNSPrefix:$ts} + return $ts + } + + ############################################################################## + # + # superclass for all resources (like Description, Alt, Seq, Beg) + # used directly in the parse tree ... resource nodes are mixed in + # + ############################################################################## + + Class RDFResource -superclass RDFNode + + RDFResource instproc print {} { + set t [my array names rdfTypes] + if {$t eq ""} {return [next]} else {return "[next]\nTYPES: $t"} + } + + + ############################################################################## + # + # superclasses for container node classes (alt seq bag) + # + ############################################################################## + Class RDFContainerNodeClass -superclass RDFResource + + RDFContainerNodeClass instproc init args { + # cache the member number + # 0 inidicates, there is currently no member + next + + my set memberNr 0 + my set ID [my makeID] + my appendRDFType [my qualifyWithRdfNsPrefix \ + [[my info class] set content]] + } + + RDFContainerNodeClass instproc parseAttributes {name attrList} { + #set index 0 + foreach {n v} $attrList { + if {[set an [my isAttribute $n]] ne ""} { + my set attributes($n) $v + if {$an eq "ID"} { + my set subject $v + my set ID [[my set parser] set baseURL]\#$v + } + } + #set attrList [my nextAttrNode $an attrList index] + } + } + + RDFContainerNodeClass instproc giveMemberNr {member} { + set pf [my getContentPrefix] + if {$pf ne ""} {append pf ":"} + $member set memberIndex "${pf}_[my incr memberNr]" + } + + RDFContainerNodeClass instproc parseStart {name attrList} { + set r [self] + next + if {[set node [my isNestingNode $name]] ne ""} { + set r [my getNestingNode $node $name $attrList] + if {[namespace tail [$r info class]] eq "RDFMember"} { + my giveMemberNr $r + } + } else { + set r [my getPropertyNodeChild $name $attrList] + } + return $r + } + + ############################################################################## + # + # Concrete Factory for creating RDF-style nodes + # + ############################################################################## + Class RDFNodeClassFactory -superclass XMLNodeClassFactory + RDFNodeClassFactory instproc content content { + my set content $content + } + RDFNodeClassFactory instproc attributeList attributeList { + my set attributeList $attributeList + } + RDFNodeClassFactory instproc nestingTo nestingTo { + set name [string trimleft [self] :] + foreach cl $nestingTo { + $cl set nestingList([my set content]) $name + } + } + + RDFNodeClassFactory proc create args { + # create the class + set name [next] + switch -exact $name { + RDFDescription - RDFProperty - RDFMember { + my array set attributeList {} + } + RDFMember - RDFProperty { + my array set nestingList {} + } + } + } + ########################################################################## + # + # now create a factory and build all the node classes + # needed for the RDF Parser/Interpreter + # + ########################################################################## + RDFNodeClassFactory proc createFactories {} { + foreach {name superclasses content attributeList} { + RDFTag RDFNode RDF {} + RDFBag RDFContainerNodeClass Bag {ID} + RDFSeq RDFContainerNodeClass Seq {ID} + RDFAlt RDFContainerNodeClass Alt {ID} + RDFProperty RDFNode "" {bagID ID resource parseType} + RDFMember RDFProperty li {resource parseType} + RDFDescription RDFResource Description {ID bagID about type aboutEach aboutEachPrefix} + } { + #puts "Create class: $name -superclass $superclasses" + RDFNodeClassFactory create $name -superclass $superclasses \ + -content $content \ + -attributeList $attributeList + } + } + RDFNodeClassFactory createFactories + + # + # define nesting constraints + # + RDFTag nestingTo {} + RDFBag nestingTo {RDFTag RDFProperty} + RDFSeq nestingTo {RDFTag RDFProperty} + RDFAlt nestingTo {RDFTag RDFProperty} + RDFMember nestingTo {RDFContainerNodeClass RDFBag RDFSeq RDFAlt} + RDFProperty nestingTo {} + RDFDescription nestingTo {RDFTag RDFMember RDFProperty} + + ############################################################################## + # + # add some methods to the property node class + # + ############################################################################## + + RDFProperty instproc parseAttributes {name attrList} { + set r [self] + #set index 0 + foreach {n v} $attrList { + if {[my checkForXmlNS $n $v]} {continue} + if {[set an [my isAttribute $n]] ne ""} { + my set attributes($n) $v + if {$an eq "parseType"} {my handleParseType $v} + } else { + if {![info exists abbrvPropResource]} { + set abbrvPropResource \ + [my getNestingNode RDFDescription \ + [my qualifyWithRdfNsPrefix Description] {}] + } + $abbrvPropResource propertyAttribute $n $v + } + #set attrList [my nextAttrNode $an attrList index] + } + + if {[info exists abbrvPropResource]} { + # if resource attribute is given -> use it for abbr property + # description as about attr + if {[my exists attributes(resource)]} { + set about [my set attributes(resource)] + my unset attributes(resource) + } + if {[my exists attributes([set resource [my qualifyWithRdfNsPrefix resource]])]} { + set about [my set attributes($resource)] + my unset attributes($resource) + } + if {[info exists about]} { + $abbrvPropResource set attributes(about) $about + $abbrvPropResource set subject $about + } + } + } + RDFProperty instproc parseStart {name attrList} { + if {[my isParseLiteral]} {return [self]} + next + return [my parseNestedChild $name $attrList] + } + + ############################################################################## + # + # add methods to the member class + # + ############################################################################## + + RDFMember parameter { + memberIndex + } + + RDFMember instproc parseAttributes {name attrList} { + #set index 0 + foreach {n v} $attrList { + if {[set an [my isAttribute $n]] ne ""} { + my set attributes($n) $v + if {$an eq "parseType"} {my handleParseType $v} + } + #set attrList [my nextAttrNode $an attrList index] + } + } + + RDFMember instproc print {} { + return "[next]\nMEMBER-INDEX: [my set memberIndex]" + } + + ############################################################################## + # + # add methods to the description node class + # + ############################################################################## + + RDFDescription instproc init {args} { + next + set ID [my makeID] + my set subject $ID + my set bagID $ID + } + + RDFDescription instproc parseAttributes {name attrList} { + set r [self] + + # if the parent is a property with an ID -> use it + # as description subject + set ID [my qualifyWithRdfNsPrefix ID] + set parent [my info parent] + if {[$parent exists attributes(ID)]} { + my set subject [$parent set attributes(ID)] + } elseif {[$parent exists attributes($ID)]} { + my set subject [$parent set attributes($ID)] + } + + foreach {n v} $attrList { + if {[my checkForXmlNS $n $v]} {continue} + if {[set an [my isAttribute $n]] ne ""} { + my set attributes($n) $v + switch -exact $an { + about - + ID - + aboutEach - + aboutEachPrefix { + my set subject $v + } + bagID { + my set bagID [[my set parser] set baseURL]\#$v + } + type { + my appendRDFType $v + } + } + } else { + set r [my propertyAttribute $n $v] + } + } + return $r + } + + RDFDescription instproc parseStart {name attrList} { + next + return [my getPropertyNodeChild $name $attrList] + } + + ############################################################################## + # + # add some methods to the node class + # + ############################################################################## + + RDFTag parameter {{startTagOn 0}} + + RDFTag instproc match {c} { + # the prefix of the topnode determines initially how the RDF + # namespace is named ... since several examples don't have a + # namespace definition for this ns, we set here a default, which + # may be overridden by ns definitions in the XML text + if {[regexp {^([^:]*):(.*)} $c _ pre c]} { + my makeIndividualNSEntry $pre [[my set parser] rdfNamespace] + #puts stderr "Making RDF namespace entry for <$pre>" + } + #puts "Match for $c --- Content: [[my info class] set content]" + expr {$c eq [[my info class] set content]} + } + + RDFTag instproc parseStart {name attrList} { + set parsed 0 + if {[set node [my isNestingNode $name]] ne ""} { + set r [my getNestingNode $node $name $attrList] + } else { + set r [my getTypedNode $name $attrList] + } + next + return $r + } + + RDFTag instproc parseEnd content { + if {!([my startTagOn] && [my match $content])} { + [my errorChild $content] + } + next + self ;# return [self] + } + + ############################################################################## + # + # RDF Factory for creating node objects + # + ############################################################################## + Class RDFNodeFactory -superclass XMLNodeFactory + RDFNodeFactory create rdfNodeFactory -sharedNodes {RDFDescription RDFTag} + + + ############################################################################## + # + # RDF parser class used to access the xml parser and produce the + # rdf node tree + # + ############################################################################## + Class RDFParser -superclass XMLParser -parameter { + {baseURL "rdfdoc"} + {rdfNamespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#"} + } + + RDFParser instproc init args { + my mixin add RDFParserParseTypeHandling + + ### this special parser handles rdf:RDF tags + my topLevelHandlerPattern {^([^:]*):RDF|RDF} RDFTag + + next + my set nodeFactory "rdfNodeFactory" + } + + RDFParser instproc makeID {} { + my autoname [my baseURL]\#id + } + + RDFParser instproc reset {} { + next + set id [my baseURL]\#id + my autoname -reset $id + } + + RDFParser instproc createTopLevelNode {name attrList} { + set tn [next] + #$tn makeIndividualNSEntry xmlns [my set rdfNamespace] + ### toplevel node must be of type RDFTag + if {![$tn istype RDFTag]} { + error "Top level node must be of type RDFTag" + } + if {[$tn match $name]} { + $tn set content $name + $tn startTagOn 1 + + ### use default values for rdf/default (xmlns) namespace + #my makeIndividualNSEntry rdfs "http://www.w3.org/TR/1999/PR-rdf-schema-19990303#" + + foreach {n v} $attrList { + if {[$tn checkForXmlNS $n $v]} {continue} + } + } + return $tn + } + + #RDFParser instproc parse data { + # next + #} + + namespace export RDFNodeParseTypeHandling RDFParserParseTypeHandling \ + RDFNode RDFResource RDFContainerNodeClass RDFNodeClassFactory \ + RDFNodeFactory RDFParser rdfNodeFactory \ + RDFTag RDFBag RDFSeq RDFAlt RDFProperty RDFMember RDFDescription +} + +namespace import ::xotcl::rdf::parser::* Index: library/registry/COPYRIGHT =================================================================== diff -u -N --- library/registry/COPYRIGHT (revision 0) +++ library/registry/COPYRIGHT (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + * XOTcl - Extended OTcl + * + * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) + * + * (a) Vienna University of Economics and Business Administration + * Dept. of Information Systems / New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + Index: library/registry/Registry.xotcl =================================================================== diff -u -N --- library/registry/Registry.xotcl (revision 0) +++ library/registry/Registry.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,73 @@ +package provide xotcl::registry::registry 0.8 + +package require xotcl::trace +package require xotcl::rdf::triple +package require xotcl::rdf::tripleRecreator +package require xotcl::actiweb::agent +package require XOTcl + +namespace eval ::xotcl::registry::registry { + namespace import ::xotcl::* + + Class Registry -superclass Agent + + Registry instproc init args { + next + my exportProcs register query queryProperty + RDFParser [self]::parser + TripleVisitor [self]::tripleVisitor -parser [self]::parser + [self]::tripleVisitor descriptionAsBag 0 + my array set services {} + } + + Registry instproc register {rdfScript} { + #my showCall + [[self]::tripleVisitor set parser] parse $rdfScript + [self]::tripleVisitor interpretNodeTree [self]::parser::topNode + [self]::tripleVisitor resetWithoutDB + foreach serviceTriple [[self]::tripleVisitor::db queryPredicate \ + "http://nestroy.wi-inf.uni-essen.de/schema/service#name"] { + set service [$serviceTriple object] + if {[info exists services($service)]} { + puts stderr "we have already such a service '$service'" + # hier koennte man ueberlegen, den service zu loeschen oder nicht + # zZT: loesche altes service + } + puts stderr "REGISTRY: registering $service with [$serviceTriple subject]" + my set services($service) [$serviceTriple subject]; + } + } + + Registry instproc query {service} { + my showCall + if {[info exists services($service)]} { + set s [my set services($service)] + return [[Place getInstance]::rdfCreator createFromTriples [[self]::tripleVisitor::db querySubject $s]] + } + } + + Registry instproc queryProperty {args} { + # returns first service with matching properties + my showCall + foreach s [my array names services] { + set success 1 + foreach {att value} $args { + set t [[self]::tripleVisitor::db queryPredicateOnSubject $att [my set services($s)]] + if {$t eq "" || [$t object] != $value} { + set success 0 + break + } + } + if {$success} { + set r [my query $s] + return $r + } else { + return "" + } + } + } + + namespace export Registry +} + +namespace import ::xotcl::registry::registry::* Index: library/registry/pkgIndex.tcl =================================================================== diff -u -N --- library/registry/pkgIndex.tcl (revision 0) +++ library/registry/pkgIndex.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,11 @@ +# Tcl package index file, version 1.1 +# This file is generated by the "pkg_mkIndex -direct" command +# and sourced either when an application starts up or +# by a "package unknown" script. It invokes the +# "package ifneeded" command to set up package-related +# information so that packages will be loaded automatically +# in response to "package require" commands. When this +# script is sourced, the variable $dir must contain the +# full path name of this file's directory. + +package ifneeded xotcl::registry::registry 0.8 [list source [file join $dir Registry.xotcl]] Index: library/serialize/COPYRIGHT =================================================================== diff -u -N --- library/serialize/COPYRIGHT (revision 0) +++ library/serialize/COPYRIGHT (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + * XOTcl - Extended OTcl + * + * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) + * + * (a) Vienna University of Economics and Business Administration + * Dept. of Information Systems / New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + Index: library/serialize/RecoveryPoint.xotcl =================================================================== diff -u -N --- library/serialize/RecoveryPoint.xotcl (revision 0) +++ library/serialize/RecoveryPoint.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,441 @@ +# $Id: RecoveryPoint.xotcl,v 1.4 2006/02/18 22:17:33 neumann Exp $ + +package provide xotcl::scriptCreation::recoveryPoint 0.8 +package require XOTcl + +namespace eval ::xotcl::scriptCreation::recoveryPoint { + namespace import ::xotcl::* + + ## fehlt noch: filter, mixins, metadata, ass, assoption, etc + ## beim recover Class's,Object's proc instproc vars nicht ueberschreiben + ## filter dann anhaengen etc ... + ## der Recovery Filter darf durch Object filter "" nicht gelöscht werden + + # + # filter to ensure that recovering doesn't overwrite + # existing objs/classes + # + + Object instproc recoveryFilter args { + ::set method [self calledproc] + + switch -- $method { + create { + # don't overwrite objects + if {![::Object isobject [lindex $args 0]]} { + next + } else { + # puts stderr "Recovery Filter: omitting [lindex $args 0]" + } + } + proc { + if {[lsearch [my info procs] [lindex $args 0]] == -1} { + next + } else { + # puts stderr "Recovery Filter: omitting proc [self]::[lindex $args 0]" + } + } + instproc { + if {[lsearch [my info instprocs] [lindex $args 0]] == -1} { + next + } else { + # puts stderr "Recovery Filter: omitting instproc [self]::[lindex $args 0]" + } + } + set { + if {[lsearch [my info vars] [lindex $args 0]] == -1} { + next + } else { + # puts stderr "Recovery Filter: omitting var [self]::[lindex $args 0]" + } + } + default {next} + } + } + + # + # remove filter from object + # + Object instproc filterremove f { + ::set fl [my info filter] + puts stderr "filterremove on [self] with $f; fullName: [my filtersearch $f]" + while {[::set index [lsearch $fl [my filtersearch $f]]] != -1} { + ::set fl [lreplace $fl $index $index] + } + my filter $fl + } + + # + # remove mixin from object + # + Object instproc mixinremove m { + puts stderr "mixinremove on [self] with $m" + ::set ml [my info mixins] + while {[::set index [lsearch $ml $m]] != -1} { + ::set ml [lreplace $ml $index $index] + } + my mixin $ml + } + + Class RecoveryPoint \ + -parameter { + {appendedObjs ""} + {appendedCls ""} + {appendedNamespaces ""} + {withState 0} + {appendToFile 0} + {definedObjs [list Object \ + Class \ + Class::Parameter]} + {excludeNames ""} + } + + # + # queries the definedObjs variable whether a given object + # is already defined/predefined or not + # -> a way to exclude classes/objs from saving + # + RecoveryPoint instproc isDefined {n} { + my instvar definedObjs + puts stderr "Checking Defined: $n in $definedObjs" + if {[lsearch $definedObjs [string trimleft $n :]] == -1} { + return 0 + } else { + return 1 + } + } + + RecoveryPoint instproc appendDefined {n} { + my instvar definedObjs + lappend definedObjs [string trimleft $n :] + } + + # + # check whether an obj/cls/namespace is appended already + # append obj/cls/namespace + # + foreach method {Obj Cl Namespace} { + set r { + my instvar {appended${method}s name}} + set r [subst -nocommands -nobackslash $r] + + set s $r + append s { + if {[lsearch $name [string trimleft $n :]] == -1} { + return 0 + } else { + return 1 + } + } + + RecoveryPoint instproc isAppended$method {n} $s + + append r { + lappend name [string trimleft $n :] + } + RecoveryPoint instproc append$method {n} $r + } + + + # + # compare command for lsort + # + RecoveryPoint instproc namespaceDepth {a b} { + set aCount 0 + set bCount 0 + for {set i 0} {$i < [string length $a]} {incr i} { + if {[string index $a $i] eq ":"} { + incr aCount + } + } + for {set i 0} {$i < [string length $b]} {incr i} { + if {[string index $b $i] eq ":"} { + incr bCount + } + } + if {$aCount == $bCount} { + return 0 + } elseif {$aCount > $bCount} { + return 1 + } + + return -1 + } + + # + # produces a script containing the current state of + # the given obj + # + RecoveryPoint instproc stateScript {obj} { + set script "" + foreach v [$obj info vars] { + if {[lsearch [my set excludeNames] $v] == -1} { + $obj instvar $v + if {[array exists $v]} { + foreach name [array names $v] { + set arr ${v}($name) + set value [$obj set $arr] + append script "$obj set $arr \"$value\"\n" + } + } else { + set value [set $v] + append script "$obj set $v \"$value\"\n" + } + } + } + return $script + } + + # + # produces a script containing the procs of the given obj + # + RecoveryPoint instproc procScript {obj} { + set script "" + foreach p [$obj info procs] { + if {[lsearch [my set excludeNames] $v] == -1} { + append script \ + "$obj proc $p \{[$obj info args $p]\} \{[$obj info body $p]\}\n" + } + } + return $script + } + + # + # produces a script containing the instprocs of the given class + # + RecoveryPoint instproc instprocScript {cl} { + set script "" + foreach p [$cl info instprocs] { + if {[lsearch [my set excludeNames] $v] == -1} { + append script \ + "$cl instproc $p \{[$cl info instargs $p]\} \{[$cl info instbody $p]\}\n" + } + } + return $script + } + + # + # append parent obj/classes/namespaces of an object completly + # + + RecoveryPoint instproc appendParents {name} { + # puts stderr "Recovery -- appendParents $name " + set p "" + set script "" + + set n $name + while {[set np [namespace parent ::$n]] != "::"} { + lappend p $np + set n $np + } + set p [lsort -command {[self] namespaceDepth} $p] + + foreach n $p { + if {[Object isobject $n]} { + if {[$n isclass]} { + append script [my classScript $n] + } else { + append script [my objectScript $n] + } + } else { + if {![my isAppendedNamespace $n]} { + append script "namespace eval $n \{\}\n" + # puts stderr "Recovery -- Appending Namespace: $n" + my appendedNamespace $n + } + } + } + return $script + } + + + # + # produces a script recovering the given obj with all children + # without state + # + RecoveryPoint instproc objectScript {obj} { + # puts stderr "Recovery -- Object Script $obj" + my instvar withState + set script "" + if {![my isDefined $obj] && + ![my isAppendedObj $obj]} { + # if the object's class is not yet appended => do it now + set objClass [$obj info class] + append script [my classScript $objClass] + + # append all parent namespaces + append script [my appendParents $obj] + + # append the obj + append script "$objClass $obj\n" + append script [my procScript $obj] + if {$withState == 1} { + append script [my stateScript $obj] + } + # puts stderr "Recovery -- Appending Object: $obj" + my appendObj $obj + + # append its children + foreach o [$obj info children] { + append script [my objectScript $o] + } + } + return $script + } + + # + # produces a script recovering the given class with all children + # without state + # + RecoveryPoint instproc classScript {cl} { + # puts stderr "Recovery -- Class Script $cl" + my instvar withState + set script "" + if {![my isDefined $cl] && + ![my isAppendedCl $cl]} { + # if the class's meta-class is not yet appended => do it now + set metaClass [$cl info class] + append script [my classScript $metaClass] + + # append all parent namespaces + append script [my appendParents $cl] + + # append the class + append script "$metaClass $cl" + + set sl [$cl info superclass] + if {$sl ne ""} { + append script " -superclass \{$sl\}\n" + } else { + append script "\n" + } + + append script [my instprocScript $cl] + append script [my procScript $cl] + + if {$withState == 1} { + append script [my stateScript $cl] + } + + # puts stderr "Recovery -- Appending Class: $cl \n $script" + my appendCl $cl + + # append children + set children [$cl info children] + set classChildren [$cl info classchildren] + + foreach c $children { + if {[lsearch $classChildren $c] != -1} { + append script [my classScript $c] + } else { + append script [my objectScript $c] + } + } + } + return $script + } + + # + # produces a script recovering the given class and all subclasses + # with all their children and all instances + # + # + RecoveryPoint instproc hierarchyScript {cl} { + set script [my classScript $cl] + set sortedInstances \ + [lsort -command {[self] namespaceDepth} [$cl info instances]] + + foreach o $sortedInstances { + append script [my objectScript $o] + } + + foreach c [$cl info subclass] { + append script [my hierarchyScript $c] + } + + return $script + } + + # + # saves a script to a file + # + RecoveryPoint instproc saveScript {filename script} { + my instvar appendToFile + if {$appendToFile} { + set mode a + } else { + set mode w + } + set f [open $filename $mode] + puts $f $script + close $f + } + + # + # load a script from a file + # + RecoveryPoint instproc loadScript {filename} { + set f [open $filename r] + set r [read $f] + close $f + return $r + } + + # + # produce methods to save/recover an object script to/from a file + # with/without state/only state + # + + foreach method { + Object ObjectState ObjectWithState Class ClassWithState \ + Hierarchy HierarchyWithState + } { + set s { + my set withState + } + + if {[regexp {(.*)WithState} $method _ m]} { + set call $m + append s "1" + } else { + set call $method + append s "0" + } + + scan $call %c l + set ::low "[format %c [expr {$l + 32}]][string range $call 1 end]" + + append s { + my appendedObjs "" + my appendedCls "" + my appendedNamespaces "" + } + append s " + foreach a \$args \{" + set r { + set script [my ${low}Script } + set r [subst -nocommands -nobackslash $r] + append s $r + append s {$a] + my saveScript $filename $script} + append s " + \} + " + + RecoveryPoint instproc save$method {filename args} $s + } + + RecoveryPoint instproc recover {filename} { + set r [my loadScript $filename] + Object filterappend recoveryFilter + # puts stderr "RecoveryFilter appended for $filename" + eval $r + Object filterremove recoveryFilter + # puts stderr "RecoveryFilter removed for $filename" + return + } + + namespace export RecoveryPoint +} + +namespace import ::xotcl::scriptCreation::recoveryPoint::* Index: library/serialize/ScriptCreator.xotcl =================================================================== diff -u -N --- library/serialize/ScriptCreator.xotcl (revision 0) +++ library/serialize/ScriptCreator.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,228 @@ +# $Id: ScriptCreator.xotcl,v 1.4 2006/02/18 22:17:33 neumann Exp $ + +package provide xotcl::scriptCreation::scriptCreator 0.8 +package require XOTcl + +namespace eval ::xotcl::scriptCreation::scriptCreator { + namespace import ::xotcl::* + + Class ScriptCreator \ + -parameter { + {excludedObjs {Object Class Class::Parameter}} + {excludeNames ""} + {dependencyChecking 1} + } + + + # + # queries the excludedObjs variable whether a given object + # is already defined/predefined or not + # -> a way to exclude classes/objs from saving + # + ScriptCreator instproc isExcluded {n} { + my instvar excludedObjs + #puts stderr "Checking Excluded: $n in $excludedObjs" + if {[lsearch $excludedObjs [string trimleft $n :]] == -1} { + return 0 + } else { + return 1 + } + } + + ScriptCreator instproc appendExcluded {n} { + my instvar excludedObjs + lappend excludedObjs [string trimleft $n :] + } + + # + # compare command for lsort + # + ScriptCreator instproc namespaceDepth {a b} { + set aCount 0 + set bCount 0 + for {set i 0} {$i < [string length $a]} {incr i} { + if {[string index $a $i] eq ":"} { + incr aCount + } + } + for {set i 0} {$i < [string length $b]} {incr i} { + if {[string index $b $i] eq ":"} { + incr bCount + } + } + if {$aCount == $bCount} { + return 0 + } elseif {$aCount > $bCount} { + return 1 + } + + return -1 + } + + # + # produces a script containing the current state of + # the given obj + # + ScriptCreator instproc stateScript {obj} { + set script "" + foreach v [$obj info vars] { + if {[lsearch [my set excludeNames] $v] == -1} { + if {[$obj array exists $v]} { + foreach name [$obj array names $v] { + set arr ${v}($name) + set value [$obj set $arr] + append script "$obj set $arr \"$value\"\n" + } + } else { + set value [$obj set $v] + append script "$obj set $v \"$value\"\n" + } + } + } + return $script + } + + # + # produces a script containing the procs of the given obj + # + ScriptCreator instproc procScript {obj} { + set script "" + foreach p [$obj info procs] { + if {[lsearch [my set excludeNames] $p] == -1} { + append script \ + "$obj proc $p \{[$obj info args $p]\} \{[$obj info body $p]\}\n" + } + } + return $script + } + + # + # produces a script containing the instprocs of the given class + # + ScriptCreator instproc instprocScript {cl} { + set script "" + foreach p [$cl info instprocs] { + if {[lsearch [my set excludeNames] $p] == -1} { + append script \ + "$cl instproc $p \{[$cl info instargs $p]\} \{[$cl info instbody $p]\}\n" + } + } + return $script + } + + + + # + # saves a script to a file + # + ScriptCreator instproc saveScript {filename script} { + set f [open $filename w] + puts $f $script + close $f + } + + # + # load a script from a file + # + ScriptCreator instproc loadScript {filename} { + set f [open $filename r] + set r [read $f] + close $f + return $r + } + + # + # check parent obj/classes/namespaces of an object completly + # + ScriptCreator instproc checkParents {name} { + set p "" + + set n $name + while {[set np [namespace parent ::$n]] != "::"} { + lappend p $np + set n $np + } + set p [lsort -command {my namespaceDepth} $p] + + foreach n $p { + if {![my isExcluded $n] && + ![my isAppended $n]} { + error "ScriptCreator: $name needs parent $n, neither appended nor excluded yet." + } + } + } + + ScriptCreator instproc checkClass {obj class} { + if {![my isExcluded $class] && + ![my isAppended $class]} { + error "ScriptCreator: $obj depends on $class, neither appended nor excluded yet." + } + } + + ScriptCreator instproc isAppended name { + set n [string trimleft $name :] + if {[lsearch [my set appendedNames] $n]!=-1} { + return 1 + } else { + return 0 + } + } + + ScriptCreator instproc appendName name { + set n [string trimleft $name :] + my lappend appendedNames $n + } + + ScriptCreator instproc makeScript args { + my instvar dependencyChecking + my set appendedNames "" + set script "" + foreach name $args { + #puts stderr "Script Creator -- $name" + if {![my isExcluded $name] && + ![my isAppended $name]} { + + if {$dependencyChecking} { + my checkParents $name + } + if {[Object isobject $name]} { + set class [$name info class] + if {$dependencyChecking} { + my checkClass $name $class + } + if {[Object isclass $name]} { + # append the class + #puts stderr "Appending Class: $name" + append script "[$name info class] $name" + set sl [$name info superclass] + if {$dependencyChecking} { + foreach c $sl { + my checkClass $name $c + } + } + if {$sl ne ""} { + append script " -superclass \{$sl\}\n" + } else { + append script "\n" + } + append script [my instprocScript $name] + } else { + # append the obj + #puts stderr "Appending Object: $name" + append script "[$name info class] $name\n" + } + append script [my procScript $name] + } else { + append script "namespace eval $name \{\}\n" + #puts stderr "Appending Namespace: $name" + } + my appendName $name + } + } + return $script + } + + namespace export ScriptCreator +} + +namespace import ::xotcl::scriptCreation::scriptCreator::* Index: library/serialize/Serializer.xotcl =================================================================== diff -u -N --- library/serialize/Serializer.xotcl (revision 0) +++ library/serialize/Serializer.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,546 @@ +# $Id: Serializer.xotcl,v 1.19 2007/10/05 09:06:00 neumann Exp $ +package require XOTcl 1.5 +package provide xotcl::serializer 1.0 + +namespace eval ::xotcl::serializer { + + namespace import -force ::xotcl::* + + @ @File { + description { + This package provides the class Serializer, which can be used to + generate a snapshot of the current state of the workspace + in the form of XOTcl source code. + } + authors { + Gustaf Neumann, Gustaf.Neumann@wu-wien.ac.at + } + date { $Date: 2007/10/05 09:06:00 $ } + } + + @ Serializer proc all { + ?-ignoreVarsRE RE? + "provide regular expression; matching vars are ignored" + ?-ignore obj1 obj2 ...? + "provide a list of objects to be omitted"} { + Description { + Serialize all objects and classes that are currently + defined (except the specified omissions and the current + Serializer object). +

    Examples:<@br> + <@pre class='code'>Serializer all -ignoreVarsRE {::b$} + Do not serialize any instance variable named b (of any object).

    + <@pre class='code'>Serializer all -ignoreVarsRE {^::o1::.*text.*$|^::o2::x$} + Do not serialize any variable of c1 whose name contains + the string "text" and do not serialze the variable x of o2.

    + <@pre class='code'>Serializer all -ignore obj1 obj2 ... + do not serizalze the specified objects + } + return "script" + } + + @ Serializer proc deepSerialize { + objs "Objects to be serialized" + ?-ignoreVarsRE RE? + "provide regular expression; matching vars are ignored" + ?-ignore obj1 obj2 ...? + "provide a list of objects to be omitted" + ?-map list? "translate object names in serialized code" + } { + Description { + Serialize object with all child objects (deep operation) + except the specified omissions. For the description of + <@tt>ignore and <@tt>igonoreVarsRE see + <@tt>Serizalizer all. <@tt>map can be used + in addition to provide pairs of old-string and new-string + (like in the tcl command <@tt>string map). This option + can be used to regenerate the serialized object under a different + object or under an different name, or to translate relative + object names in the serialized code.

    + + Examples: + <@pre class='code'>Serializer deepSerialize ::a::b::c -map {::a::b ::x::y} + Serialize the object <@tt>c which is a child of <@tt>a::b; + the object will be reinitialized as object <@tt>::x::y::c, + all references <@tt>::a::b will be replaced by <@tt>::x::y.

    + + <@pre class='code'>Serializer deepSerialize ::a::b::c -map {::a::b [self]} + The serizalized object can be reinstantiated under some current object, + under which the script is evaluated.

    + + <@pre class='code'>Serializer deepSerialize ::a::b::c -map {::a::b::c ${var}} + The serizalized object will be reinstantiated under a name specified + by the variable <@tt>var<@tt> in the recreation context. + } + return "script" + } + + @ Serializer proc methodSerialize { + object "object or class" + method "name of method" + prefix "either empty or 'inst' (latter for instprocs)" + } { + Description { + Serialize the specified method. In order to serialize + an instproc, <@tt>prefix should be 'inst'; to serialze + procs, it should be empty.

    + + Examples: + <@pre class='code'>Serializer methodSerialize Serializer deepSerialize "" + This command serializes the proc <@tt>deepSerialize + of the Class <@tt>Serializer.

    + + <@pre class='code'>Serializer methodSerialize Serializer serialize inst + This command serializes the instproc <@tt>serialize + of the Class <@tt>Serializer.

    + } + return {Script, which can be used to recreate the specified method} + } + @ Serializer proc exportMethods { + list "list of methods of the form 'object proc|instproc methodname'" + } { + Description { + This method can be used to specify methods that should be + exported in every <@tt>Serializer all<@/tt>. The rationale + behind this is that the serializer does not serialize objects + from the ::xotcl:: namespace, which is used for XOTcl internals + and volatile objects. It is however often useful to define + methods on ::xotcl::Class or ::xotcl::Objects, which should + be exported. One can export procs, instprocs, forward and instforward

    + Example: + <@pre class='code'> Serializer exportMethods { + ::xotcl::Object instproc __split_arguments + ::xotcl::Object instproc __make_doc + ::xotcl::Object instproc ad_proc + ::xotcl::Class instproc ad_instproc + ::xotcl::Object forward expr + }<@/pre> + } + } + + + @ Serializer instproc serialize {entity "Object or Class"} { + Description { + Serialize the specified object or class. + } + return {Object or Class with all currently defined methods, + variables, invariants, filters and mixins} + } + + ################################################################################## + # real clode starts here..... + # ################################################################################ + Class Serializer -parameter {ignoreVarsRE map} + namespace export Serializer + + Serializer proc ignore args { + my set skip $args + } + Serializer instproc ignore args { + foreach i $args { + my set skip($i) 1 + # skip children of ignored objects as well + foreach j [$i info children] { + my ignore $j + } + } + } + Serializer instproc init {} { + my ignore [self] + if {[[self class] exists skip]} { + eval my ignore [[self class] set skip] + } + } + Serializer instproc method-serialize {o m prefix} { + my pcmd [my unescaped-method-serialize $o $m $prefix] + } + Serializer instproc unescaped-method-serialize {o m prefix} { + set arglist [list] + foreach v [$o info ${prefix}args $m] { + if {[$o info ${prefix}default $m $v x]} { + lappend arglist [list $v $x] } {lappend arglist $v} + } + lappend r ${prefix}proc $m \ + [concat [$o info ${prefix}nonposargs $m] $arglist] \ + [$o info ${prefix}body $m] + foreach p {pre post} { + if {[$o info ${prefix}$p $m]!=""} {lappend r [$o info ${prefix}$p $m]} + } + return $r + } + Serializer instproc pcmd list { + foreach a $list { + if {[regexp -- {^-[[:alpha:]]} $a]} { + set mustEscape 1 + break + } + } + if {[info exists mustEscape]} { + return "\[list -$list\]" + } else { + return -$list + } + } + Serializer instproc collect-var-traces o { + my instvar traces + foreach v [$o info vars] { + set t [$o __trace__ info variable $v] + if {$t ne ""} { + foreach ops $t { + foreach {op cmd} $ops break + # save traces in post_cmds + my append post_cmds [list $o trace add variable $v $op $cmd] "\n" + # remove trace from object + $o trace remove variable $v $op $cmd + } + } + } + } + Serializer instproc Object-serialize o { + my collect-var-traces $o + append cmd [list [$o info class] create [$o self]] + # slots needs to be initialized when optimized, since + # parametercmds are not serialized + if {![$o istype ::xotcl::Slot]} {append cmd " -noinit"} + append cmd " \\\n" + foreach i [$o info procs] { + append cmd " " [my method-serialize $o $i ""] " \\\n" + } + foreach i [$o info forward] { + set fwd [concat [list forward $i] [$o info forward -definition $i]] + append cmd \t [my pcmd $fwd] " \\\n" + } + set vset {} + set nrVars 0 + foreach v [$o info vars] { + set setcmd [list] + if {![my exists ignoreVarsRE] || + ![regexp [my set ignoreVarsRE] ${o}::$v]} { + if {[$o array exists $v]} { + lappend setcmd array set $v [$o array get $v] + } else { + lappend setcmd set $v [$o set $v] + } + incr nrVars + append cmd \t [my pcmd $setcmd] " \\\n" + } + } + foreach x {mixin invar} { + set v [$o info $x] + if {$v ne ""} {my append post_cmds [list $o $x set $v] "\n"} + } + set v [$o info filter -guards] + if {$v ne ""} {append cmd [my pcmd [list filter $v]] " \\\n"} + return $cmd + } + Serializer instproc Class-serialize o { + set cmd [my Object-serialize $o] + #set p [$o info parameter] + #if {$p ne ""} { + # append cmd " " [my pcmd [list parameter $p]] " \\\n" + #} + foreach i [$o info instprocs] { + append cmd " " [my method-serialize $o $i inst] " \\\n" + } + foreach i [$o info instforward] { + set fwd [concat [list instforward $i] [$o info instforward -definition $i]] + append cmd \t [my pcmd $fwd] " \\\n" + } + foreach x {superclass instinvar} { + set v [$o info $x] + if {$v ne "" && "::xotcl::Object" ne $v } { + append cmd " " [my pcmd [list $x $v]] " \\\n" + } + } + foreach x {instmixin} { + set v [$o info $x] + if {$v ne "" && "::xotcl::Object" ne $v } { + my append post_cmds [list $o $x set $v] "\n" + #append cmd " " [my pcmd [list $x $v]] " \\\n" + } + } + set v [$o info instfilter -guards] + if {$v ne ""} {append cmd [my pcmd [list instfilter $v]] " \\\n"} + return $cmd\n + } + + Serializer instproc args {o prefix m} { + foreach v [$o info ${prefix}args $m] { + if {[$o info ${prefix}default $m $v x]} { + lappend arglist [list $v $x] } { + lappend arglist $v } + } + return $arglist + } + Serializer instproc category c { + if {[$c istype ::xotcl::Class]} {return Class} {return Object} + } + Serializer instproc allChildren o { + set set $o + foreach c [$o info children] { + eval lappend set [my allChildren $c] + } + return $set + } + Serializer instproc allInstances C { + set set [$C info instances] + foreach sc [$C info subclass] { + eval lappend set [my allInstances $sc] + } + return $set + } + Serializer instproc exportedObject o { + # check, whether o is exported. for exported objects. + # we export the object tree. + set oo $o + while {1} { + if {[[self class] exists exportObjects($o)]} { + #puts stderr "exported: $o -> exported $oo" + return 1 + } + # we do this for object trees without object-less name spaces + if {![my isobject $o]} {return 0} + set o [$o info parent] + } + } + + Serializer instproc topoSort {set all} { + if {[my array exists s]} {my array unset s} + if {[my array exists level]} {my array unset level} + foreach c $set { + if {!$all && + [string match "::xotcl::*" $c] && + ![my exportedObject $c]} continue + if {[my exists skip($c)]} continue + my set s($c) 1 + } + set stratum 0 + while {1} { + set set [my array names s] + if {[llength $set] == 0} break + incr stratum + #my warn "$stratum set=$set" + my set level($stratum) {} + foreach c $set { + if {[my [my category $c]-needsNothing $c]} { + my lappend level($stratum) $c + } + } + if {[my set level($stratum)] eq ""} { + my set level($stratum) $set + my warn "Cyclic dependency in $set" + } + foreach i [my set level($stratum)] {my unset s($i)} + } + } + Serializer instproc warn msg { + if {[info command ns_log] ne ""} { + ns_log Notice $msg + } else { + puts stderr "!!! $msg" + } + } + + Serializer instproc Class-needsNothing x { + if {![my Object-needsNothing $x]} {return 0} + set scs [$x info superclass] + if {[my needsOneOf $scs]} {return 0} + foreach sc $scs {if {[my needsOneOf [$sc info slots]]} {return 0}} + #if {[my needsOneOf [$x info instmixin ]]} {return 0} + return 1 + } + Serializer instproc Object-needsNothing x { + set p [$x info parent] + if {$p ne "::" && [my needsOneOf $p]} {return 0} + if {[my needsOneOf [$x info class]]} {return 0} + if {[my needsOneOf [[$x info class] info slots]]} {return 0} + #if {[my needsOneOf [$x info mixin ]]} {return 0} + return 1 + } + Serializer instproc needsOneOf list { + foreach e $list {if {[my exists s($e)]} { + #upvar x x; puts stderr "$x needs $e" + return 1 + }} + return 0 + } + Serializer instproc serialize {objectOrClass} { + string trimright [my [my category $objectOrClass]-serialize $objectOrClass] "\\\n" + } + Serializer instproc serialize-objects {list all} { + my instvar post_cmds + set post_cmds "" + # register for introspection purposes "trace" under a different name + ::xotcl::alias ::xotcl::Object __trace__ -objscope ::trace + my topoSort $list $all + #foreach i [lsort [my array names level]] {my warn "$i: [my set level($i)]"} + set result "" + foreach l [lsort -integer [my array names level]] { + foreach i [my set level($l)] { + #my warn "serialize $i" + #append result "# Stratum $l\n" + append result [my serialize $i] \n + } + } + foreach e $list { + set namespace($e) 1 + set namespace([namespace qualifiers $e]) 1 + } + ::xotcl::Object proc __trace__ {} {} + + # Handling of variable traces: traces might require a + # different topological sort, which is hard to handle. + # Similar as with filters, we deactivate the variable + # traces during initialization. This happens by + # (1) replacing the XOTcl's trace method by a no-op + # (2) collecting variable traces through collect-var-traces + # (3) re-activating the traces after variable initialization + + set exports "" + set pre_cmds "" + + # delete ::xotcl from the namespace list, if it exists... + catch {unset namespace(::xotcl)} + foreach ns [array name namespace] { + if {![namespace exists $ns]} continue + if {![my isobject $ns]} { + append pre_cmds "namespace eval $ns {}\n" + } elseif {$ns ne [namespace origin $ns] } { + append pre_cmds "namespace eval $ns {}\n" + } + set exp [namespace eval $ns {namespace export}] + if {$exp ne ""} { + append exports "namespace eval $ns {namespace export $exp}" \n + } + } + + #append post_cmds "::xotcl::alias ::xotcl::Object trace -objscope ::trace\n" + return $pre_cmds$result$post_cmds$exports + } + Serializer instproc deepSerialize o { + # assumes $o to be fully qualified + my serialize-objects [my allChildren $o] 1 + } + Serializer instproc serializeMethod {object kind name} { + set code "" + switch $kind { + proc { + if {[$object info procs $name] ne ""} { + set code [my method-serialize $object $name ""] + } + } + instproc { + if {[$object info instprocs $name] ne ""} { + set code [my method-serialize $object $name inst] + } + } + forward - instforward { + if {[$object info $kind $name] ne ""} { + set fwd [concat [list $kind $name] [$object info $kind -definition $name]] + set code [my pcmd $fwd] + } + } + } + return $code + } + + + Serializer proc exportMethods list { + foreach {o p m} $list {my set exportMethods($o,$p,$m) 1} + } + Serializer proc exportObjects list { + foreach o $list {my set exportObjects($o) 1} + } + + Serializer proc serializeExportedMethods {s} { + set r "" + foreach k [my array names exportMethods] { + foreach {o p m} [split $k ,] break + #if {$o ne "::xotcl::Object" && $o ne "::xotcl::Class"} { + #error "method export only for ::xotcl::Object and\ + # ::xotcl::Class implemented, not for $o" + #} + if {![string match "::xotcl::*" $o]} { + error "method export is only for ::xotcl::* \ + object an classes implemented, not for $o" + } + append methods($o) [$s serializeMethod $o $p $m] " \\\n " + } + set objects [array names methods] + foreach o [list ::xotcl::Object ::xotcl::Class] { + set p [lsearch $o $objects] + if {$p == -1} continue + set objects [lreplace $objects $p $p] + } + foreach o [concat ::xotcl::Object ::xotcl::Class $objects] { + if {![info exists methods($o)]} continue + append r \n "$o configure \\\n " \ + [string trimright $methods($o) "\\\n "] + } + #puts stderr "... exportedMethods <$r\n>" + return "$r\n" + } + + Serializer proc all {args} { + # don't filter anything during serialization + set filterstate [::xotcl::configure filter off] + set s [eval my new -childof [self] -volatile $args] + # always export __exitHandler + my exportMethods [list ::xotcl::Object proc __exitHandler] + set r { + set ::xotcl::__filterstate [::xotcl::configure filter off] + ::xotcl::Object instproc trace args {} + ::xotcl::Slot instmixin add ::xotcl::Slot::Nocheck + } + append r "::xotcl::configure softrecreate [::xotcl::configure softrecreate]" + append r \n [my serializeExportedMethods $s] + # export the objects and classes + #$s warn "export objects = [my array names exportObjects]" + #$s warn "export objects = [my array names exportMethods]" + append r [$s serialize-objects [$s allInstances ::xotcl::Object] 0] + foreach o [list ::xotcl::Object ::xotcl::Class] { + foreach x {mixin instmixin invar instinvar} { + set v [$o info $x] + if {$v ne "" && $v ne "::xotcl::Object"} { + append r "$o configure " [$s pcmd [list $x $v]] "\n" + } + } + } + append r { + ::xotcl::alias ::xotcl::Object trace -objscope ::trace + ::xotcl::Slot instmixin delete ::xotcl::Slot::Nocheck + ::xotcl::configure filter $::xotcl::__filterstate + unset ::xotcl::__filterstate + } + ::xotcl::configure filter $filterstate + return $r + } + Serializer proc methodSerialize {object method prefix} { + set s [my new -childof [self] -volatile] + concat $object [$s unescaped-method-serialize $object $method $prefix] + } + Serializer proc deepSerialize args { + set s [my new -childof [self] -volatile] + set nr [eval $s configure $args] + foreach o [lrange $args 0 [incr nr -1]] { + append r [$s deepSerialize [$o]] + } + if {[$s exists map]} {return [string map [$s map] $r]} + return $r + } + + # register serialize a global method + ::xotcl::Object instproc serialize {} { + ::Serializer deepSerialize [self] + } + + # include this method in the serialized code + Serializer exportMethods { + ::xotcl::Object instproc contains + } + + # include Serializer in the serialized code + Serializer exportObjects [namespace current]::Serializer + + namespace eval :: "namespace import -force [namespace current]::*" +} Index: library/serialize/Serializer2.xotcl =================================================================== diff -u -N --- library/serialize/Serializer2.xotcl (revision 0) +++ library/serialize/Serializer2.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,290 @@ +# $Id: Serializer2.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +package require XOTcl 1.0 +package provide xotcl::serializer 0.4 + +@ @File { + description { + This package provides the class Serializer, which can be used to + generate a snapshot of the current state of the workspace + in the form of XOTcl source code. + } + authors { + Gustaf Neumann, Gustaf.Neumann@wu-wien.ac.at + } + date { $Date: 2004/05/23 22:50:39 $ } +} + +@ Serializer proc all { + ?-ignoreVarsRE RE? + "provide regular expression; matching vars are ignored" + ?-ignore obj1 obj2 ...? + "provide a list of objects to be omitted"} { + Description { + Serialize all objects and classes that are currently + defined (except the specified omissions and the current + Serializer object). +

    Examples:<@br> + <@tt>Serializer all -ignoreVarsRE {::b$}<@br> + do not serialize any instance variable named b (of any object)

    + <@tt>Serializer all -ignoreVarsRE {^::o1::.*text.*$|^::o2::x$}<@br> + do not serialize any variable of c1 whose name contains + the string "text" and do not serialze the variable x of o2

    + <@tt>Serializer all - ignore obj1 obj2 ... <@br> + do not serizalze the specified objects + } + return "script" +} + +@ Serializer proc deepSerialize { + objs "Objects to be serialized" + ?-ignoreVarsRE RE? + "provide regular expression; matching vars are ignored" + ?-ignore obj1 obj2 ...? + "provide a list of objects to be omitted" + ?-map list? "translate object names in serialized code" +} { + Description { + Serialize object with all child objects (deep operation) + except the specified omissions. For the description of + <@tt>ignore and <@tt>igonoreVarsRE see + <@tt>Serizalizer all. <@tt>map can be used + in addition to provide pairs of old-string and new-string + (like in the tcl command <@tt>string map). This option + can be used to regenerate the serialized object under a different + object or under an different name, or to translate relative + object names in the serialized code.

    + + Examples: + <@tt>Serializer deepSerialize ::a::b::c -map {::a::b ::x::y}<@br> + Serialize the object <@tt>c which is a child of <@tt>a::b; + the object will be reinitialized as object <@tt>::x::y::c, + all references <@tt>::a::b will be replaced by <@tt>::x::y.

    + + <@tt>Serializer deepSerialize ::a::b::c -map {::a::b [self]}<@br> + The serizalized object can be reinstantiated under some current object, + under which the script is evaluated.

    + + <@tt>Serializer deepSerialize ::a::b::c -map {::a::b::c ${var}}<@br> + The serizalized object will be reinstantiated under a name specified + by the variable <@tt>var<@tt> in the recreation context. + } + return "script" +} + +@ Serializer instproc serialize {entity "Object or Class"} { + Description { + Serialize the specified object or class. + } + return {Object or Class with all currently defined methods, + variables, invariants, filters and mixins} +} + +######################################################################################## +Class Serializer -parameter {ignoreVarsRE map} +Serializer proc ignore args { + my set skip $args +} +Serializer instproc ignore args { + foreach i $args { my set skip($i) 1 } +} +Serializer instproc init {} { + my ignore [self] + if {[[self class] exists skip]} { + eval my ignore [[self class] set skip] + } +} +Serializer instproc method-serialize {o m prefix} { + set arglist "" + foreach v [$o info ${prefix}args $m] { + if {[$o info ${prefix}default $m $v x]} { + lappend arglist [list $v $x] } { + lappend arglist $v } + } + lappend r ${prefix}proc $m $arglist [$o info ${prefix}body $m] + foreach p {pre post} { + if {[$o info ${prefix}$p $m]!=""} {lappend r [$o info ${prefix}$p $m]} + } + return [my pcmd $r] +} +Serializer instproc pcmd list { + foreach a $list { + if {[regexp -- {^-[[:alpha:]]} $a]} { + set mustEscape 1 + break + } + } + if {[info exists mustEscape]} { + return "\[list -$list\]" + } else { + return -$list + } +} +Serializer instproc Object-serialize o { + append alloc [list [$o info class] alloc $o] + foreach i [$o info procs] { + append cmd " " [my method-serialize $o $i ""] " \\\n" + } + set vset {} + set nrVars 0 + foreach v [$o info vars] { + set setcmd [list] + if {![my exists ignoreVarsRE] || + ![regexp [my set ignoreVarsRE] ${o}::$v]} { + if {[$o array exists $v]} { + lappend setcmd array set $v [$o array get $v] + } else { + lappend setcmd set $v [$o set $v] + } + incr nrVars + append cmd \t [my pcmd $setcmd] " \\\n" + } + } + foreach x {mixin invar} { + set v [$o info $x] + if {[string compare "" $v]} {append cmd [my pcmd [list $x $v]] " \\\n"} + } + set v [$o info filter -guards] + if {[string compare "" $v]} {append cmd [my pcmd [list filter $v]] " \\\n"} + if {[info exists cmd]} { + return "\[$alloc\] configure $cmd\\\n" + } else { + return $alloc + } + return $cmd +} +Serializer instproc Class-serialize o { + set cmd [my Object-serialize $o] + set p [$o info parameter] + if {[string compare "" $p]} { + append cmd " " [my pcmd [list parameter $p]] " \\\n" + } + foreach i [$o info instprocs] { + append cmd " " [my method-serialize $o $i inst] " \\\n" + } + foreach x {superclass instmixin instinvar} { + set v [$o info $x] + if {[string compare "" $v] && [string compare "::xotcl::Object" $v]} { + append cmd " " [my pcmd [list $x $v]] " \\\n" + } + } + set v [$o info instfilter -guards] + if {[string compare "" $v]} {append cmd [my pcmd [list instfilter $v]] " \\\n"} + return $cmd\n +} + +Serializer instproc args {o prefix m} { + foreach v [$o info ${prefix}args $m] { + if {[$o info ${prefix}default $m $v x]} { + lappend arglist [list $v $x] } { + lappend arglist $v } + } + return $arglist +} +Serializer instproc category c { + if {[$c istype ::Class]} {return Class} {return Object} +} +Serializer instproc allChildren o { + set set $o + foreach c [$o info children] { + eval lappend set [my allChildren $c] + } + return $set +} +Serializer instproc allInstances C { + set set [$C info instances] + foreach sc [$C info subclass] { + eval lappend set [my allInstances $sc] + } + return $set +} + +Serializer instproc topoSort {set} { + if {[my array exists s]} {my array unset s} + if {[my array exists level]} {my array unset level} + foreach c $set { + if {[regexp ^::xotcl:: $c]} continue + if {[my exists skip($c)]} continue + my set s($c) 1 + } + set stratum 0 + while {1} { + set set [my array names s] + if {[llength $set] == 0} break + incr stratum + #puts "$stratum set=$set" + my set level($stratum) {} + foreach c $set { + if {[my [my category $c]-needsNothing $c]} { + my lappend level($stratum) $c + } + } + if {[string equal "" [my set level($stratum)]]} { + my set level($stratum) $set + my warn "Cyclic dependency in $set" + } + foreach i [my set level($stratum)] {my unset s($i)} + } +} +Serializer instproc warn msg { + if {[string compare "" [info command ns_log]]} { + ns_log Notice $msg + } else { + puts stderr "!!! Warning: $msg" + } +} + +Serializer instproc Class-needsNothing x { + if {![my Object-needsNothing $x]} {return 0} + if {[my needsOneOf [$x info superclass]]} {return 0} + if {[my needsOneOf [$x info instmixin ]]} {return 0} + return 1 +} +Serializer instproc Object-needsNothing x { + set p [$x info parent] + if {[string compare $p "::"] && [my needsOneOf $p]} {return 0} + if {[my needsOneOf [$x info class]]} {return 0} + if {[my needsOneOf [$x info mixin ]]} {return 0} + return 1 +} +Serializer instproc needsOneOf list { + foreach e $list {if {[my exists s($e)]} {return 1}} + return 0 +} +Serializer instproc serialize {objectOrClass} { + my [my category $objectOrClass]-serialize $objectOrClass +} +Serializer instproc serializeList {list} { + my topoSort $list + #foreach i [lsort [my array names level]] {puts "$i: [my set level($i)]"} + set result "" + foreach l [lsort [my array names level]] { + foreach i [my set level($l)] { + append result [string trimright [my serialize $i] "\\\n"] \n + } + } + return $result +} +Serializer instproc deepSerialize o { + # assumes $o to be fully qualified + my serializeList [my allChildren $o] +} + +Serializer proc all {args} { + set s [eval my new -childof [self] -volatile $args] + set r [$s serializeList [$s allInstances ::Object]] + if {[string compare [::xotcl::Object info body __exitHandler] "\n;"]} { + append r \n "::xotcl::Object configure " \ + [$s method-serialize ::xotcl::Object __exitHandler ""] \n + } + return $r +} +Serializer proc deepSerialize args { + set s [my new -childof [self] -volatile] + set nr [eval $s configure $args] + foreach o [lrange $args 0 [incr nr -1]] { + append r [$s deepSerialize [$o]] + } + if {[$s exists map]} {return [string map [$s map] $r]} + return $r +} + Index: library/serialize/pkgIndex.tcl =================================================================== diff -u -N --- library/serialize/pkgIndex.tcl (revision 0) +++ library/serialize/pkgIndex.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,13 @@ +# Tcl package index file, version 1.1 +# This file is generated by the "pkg_mkIndex -direct" command +# and sourced either when an application starts up or +# by a "package unknown" script. It invokes the +# "package ifneeded" command to set up package-related +# information so that packages will be loaded automatically +# in response to "package require" commands. When this +# script is sourced, the variable $dir must contain the +# full path name of this file's directory. + +package ifneeded xotcl::scriptCreation::recoveryPoint 0.8 [list source [file join $dir RecoveryPoint.xotcl]] +package ifneeded xotcl::scriptCreation::scriptCreator 0.8 [list source [file join $dir ScriptCreator.xotcl]] +package ifneeded xotcl::serializer 1.0 [list source [file join $dir Serializer.xotcl]] Index: library/store/COPYRIGHT =================================================================== diff -u -N --- library/store/COPYRIGHT (revision 0) +++ library/store/COPYRIGHT (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + * XOTcl - Extended OTcl + * + * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) + * + * (a) Vienna University of Economics and Business Administration + * Dept. of Information Systems / New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + Index: library/store/JufGdbmStorage.xotcl =================================================================== diff -u -N --- library/store/JufGdbmStorage.xotcl (revision 0) +++ library/store/JufGdbmStorage.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,50 @@ +# $Id: JufGdbmStorage.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::store::jufgdbm 0.81 + +package require xotcl::store::juf_gdbm +package require xotcl::store +package require XOTcl + +namespace eval ::xotcl::store::jufgdbm { + namespace import ::xotcl::* + + # + # a simple GNU Gdbm DB Store Access + # + Class Storage=JufGdbm -superclass Storage + Storage=JufGdbm instproc open f { + my set persistenceDB [juf_gdbm open $f rwc] + } + + Storage=JufGdbm instproc store {k v} { + #my showCall + juf_gdbm store [my set persistenceDB] $k $v + } + + Storage=JufGdbm instproc list {} { + juf_gdbm list [my set persistenceDB] + } + + Storage=JufGdbm instproc fetch {k var} { + my instvar persistenceDB + if {[juf_gdbm exists $persistenceDB $k]} { + upvar [self callinglevel] $var value + set value [juf_gdbm fetch $persistenceDB $k] + return 1 + } + return 0 + } + + Storage=JufGdbm instproc close args { + juf_gdbm close [my set persistenceDB] + } + + Storage=JufGdbm instproc delete k { + juf_gdbm delete [my set persistenceDB] $k + } + + namespace export Storage=JufGdbm +} + +namespace import ::xotcl::store::jufgdbm::* Index: library/store/MemStorage.xotcl =================================================================== diff -u -N --- library/store/MemStorage.xotcl (revision 0) +++ library/store/MemStorage.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,102 @@ +# $Id: MemStorage.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::store::mem 0.84 +package require xotcl::store 0.84 +package require XOTcl + +namespace eval ::xotcl::store::mem { + namespace import ::xotcl::* + + Object ::xotcl::memStoragePool + ::xotcl::memStoragePool proc add {filename} { + my set memStores($filename) [Object new -childof [self]] + } + ::xotcl::memStoragePool proc get {filename} { + if {[my exists memStores($filename)]} { + return [my set memStores($filename)] + } + return "" + } + ::xotcl::memStoragePool proc remove {filename} { + catch { + set store [my set memStores($filename)] + $store destroy + my unset memStores($filename) + } + } + + # + # a class using an XOTcl Object for memory storage + Class Storage=Mem -superclass Storage + Storage=Mem instproc init args { + my instvar searchID + ::set searchID "" + } + Storage=Mem instproc names {} { + my instvar store + $store array names v + } + Storage=Mem instproc exists name { + my instvar store + $store exists v($name) + } + Storage=Mem instproc unset name { + my instvar store + $store unset v($name) + } + Storage=Mem instproc set args { + my instvar store + ::set l [llength $args] + if {$l == 1} { + $store set v([lindex $args 0]) + } elseif {$l == 2} { + $store set v([lindex $args 0]) [lindex $args 1] + } else { + eval $store set $args + } + } + Storage=Mem instproc close {} { + my instvar store + ::unset store + } + Storage=Mem instproc open filename { + my instvar store + if {[::set store [::xotcl::memStoragePool get $filename]] == ""} { + ::set store [::xotcl::memStoragePool add $filename] + } + } + Storage=Mem instproc firstkey {} { + my instvar store + $store instvar v + my instvar searchID + if {$searchID ne ""} { + array donesearch v $searchID + } + ::set searchID [array startsearch v] + return [array nextelement v $searchID] + } + Storage=Mem instproc nextkey {} { + my instvar store + $store instvar v + my instvar searchID + if {$searchID eq ""} { + error "[self class]: firstkey was not invoked on storage search" + } + + ::set elt [array nextelement v $searchID] + if {$elt eq ""} { + # if array end is reach search is terminated automatically!! + ::set searchID "" + } + return $elt + } + + ### warum geht eigentlich folgendes nicht: + ## Object o; o set a::b::c 1 + ### dann koennte man sich das set und exists schenken... + + namespace export Storage=Mem +} + +namespace import ::xotcl::store::mem::* +#namespace eval ::xotcl {namespace import ::xotcl::store::mem::*} Index: library/store/MultiStorage.xotcl =================================================================== diff -u -N --- library/store/MultiStorage.xotcl (revision 0) +++ library/store/MultiStorage.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,74 @@ + +package provide xotcl::store::multi 0.9 +package require xotcl::store 0.84 +package require XOTcl + +namespace eval ::xotcl::store::multi { + namespace import ::xotcl::* + + Class Storage=multi -superclass Storage + Storage=multi instproc add {dbPackage args} { + my instvar storages names + if {$dbPackage eq ""} { + set dbPackage [Storage defaultPackage] + } + package require xotcl::store::[string tolower $dbPackage] + lappend storages [eval Storage=$dbPackage new -childof [self] $args] + } + Storage=multi instproc init args { + my instvar storages + set storages {} + } + Storage=multi instproc names {} { + my instvar storages + [lindex $storages 0] $names + } + Storage=multi instproc exists name { + my instvar storages + [lindex $storages 0] exists $name + } + Storage=multi instproc unset name { + my instvar storages + foreach s $storages {$s [self proc] $name} + } + Storage=multi instproc set args { + my instvar storages + set l [llength $args] + set name [lindex $args 0] + if {$l == 1} { + [lindex $storages 0] set $name + } elseif {$l == 2} { + foreach s $storages { $s set $name [lindex $args 1]} + } else { + eval set $args + } + } + Storage=multi instproc close {} { + my instvar storages + foreach s $storages {$s [self proc]} + } + Storage=multi instproc dbOpen {} { + my instvar storages + foreach s $storages {$s [self proc]} + } + Storage=multi instproc firstkey {} { + my instvar storages + [lindex $storages 0] firstkey + } + Storage=multi instproc nextkey {} { + my instvar storages + [lindex $storages 0] nextkey + } + Storage=multi instproc checkdir {} { + my instvar storages + foreach s $storages {$s [self proc]} + } + Storage=multi instproc dbOpen {} { + my instvar storages + foreach s $storages {$s [self proc]} + } + + namespace export Storage=multi +} + +namespace import ::xotcl::store::multi::* Index: library/store/Persistence.xotcl =================================================================== diff -u -N --- library/store/Persistence.xotcl (revision 0) +++ library/store/Persistence.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,365 @@ +# $Id: Persistence.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::store::persistence 0.8 + +package require xotcl::trace +package require xotcl::package +package require xotcl::mixinStrategy +package require xotcl::store +package require XOTcl + +namespace eval ::xotcl::store::persistence { + namespace import ::xotcl::* + + @ @File { + description { + Persistent store for XOTcl objects with Eager and Lazy persistence. + Take a look at "persistenceExample.xotcl" for exmaple of usage. + } + } + + @ Class PersistenceMgr { + description { + A persistent store requires a persistent manager. The persistent + manager implements the Storage interface via storage mixin. With + the parameter "dbPackage" we can specify which storage will be used. + The persistent manager than tries to load the package + "xotcl::${dbPackage}Storage". Default is Sdbm. + + Example: + <@pre> + PersistenceMgr pmgr -persistenceDir . -persistenceFile example-db + + + } + } + + # + # base class for persistent managers -- just register corresponding + # storage mixin and open DB + # + Class PersistenceMgr -parameter { + {fileName {[string trimleft [self] :]}} + {dbPackage Sdbm} + trace + dirName + } + + PersistenceMgr instproc init args { + my instvar dbPackage + package require xotcl::store::[string tolower $dbPackage] + + Storage=$dbPackage [self]::store $args + foreach v {dirName fileName} { + if {[my exists $v]} { + [self]::store $v [my set $v] + } + } + + if {[my exists trace]} { + [self]::store filter traceFilter + } + my array set persistentObjs {} + next + } + # delegate methods to the store object + PersistenceMgr instproc store args { + eval [self]::store $args + } + + + PersistenceMgr instproc destroy args { + foreach obj [my array names persistentObjs] { + $obj storeall + $obj persistenceMgr "" + } + [self]::store close + next + } + PersistenceMgr instproc assureOpenDb {} { + if {![my exists dbOpen]} { + [self]::store dbOpen + my set dbOpen 1 + } + } + PersistenceMgr instproc addPersistentObj {obj} { + my set persistentObjs($obj) "" + } + PersistenceMgr instproc removePersistentObj {obj} { + if {[my exists persistentObjs($obj)]} { + my unset persistentObjs($obj) + } + } + + @ Class Persistent { + description { + Superclass or mixin class for all persistent objects. Normally + subclasses are used as mixins or instmixins on object, like: + <@pre> + o mixin Persistent=Eager + p mixin Persistent=Lazy + + } + } + # + # Persistence (mixin) classes# + Class Persistent -parameter { + persistenceMgr + } + + # can be overloaded by subclasses, that need a cleanup on + # persistenceMgr->destroy (like Lazy) + Persistent instproc storeall {} {;} + + @ Persistent instproc persistenceMgr {args "persistent manager name"} { + description { + Specify which persistence manager to use for [self] object, like: + <@pre> + o persistenceMgr pmgr + + Each persistent object must have a persistence manager specified, + before vars can be made persistent. + } + } + + # + # turn off persistence with ... persistenceMgr "", but + # persistent vars stay persistent + # + Persistent instproc persistenceMgr args { + if {[llength $args] == 0} { + return [my set [self proc]] + } elseif {[llength $args] == 1} { + set pmgr [lindex $args 0] + if {$pmgr eq "" && [my exists persistenceMgr]} { + [my set persistenceMgr] removePersistentObj [self] + my unset persistenceMgr + return "" + } + $pmgr addPersistentObj [self] + return [my set [self proc] $pmgr] + } else { + error "wrong # args: [self] [self proc] ?value?" + } + } + + @ Persistent instproc persistentVars {} { + description { + Returns list of persistent vars. + } + } + + Persistent instproc persistentVars {} { + if {[my exists __persistentVars]} { + return [my set __persistentVars] + } + return "" + } + + @ Persistent instproc persistent {list "persistent variables" } { + description { + Make a list of object variables persistent. If a persistent + DB exists, the values are read from this DB, overwriting the current value. + E.g.: + <@pre> + o persistent {x y} + + + } + } + + Persistent instproc persistent {list} { + my instvar persistenceMgr + if {![info exists persistenceMgr]} {return} + set store ${persistenceMgr}::store + + $persistenceMgr assureOpenDb + foreach var $list { + my lappend __persistentVars $var + # try to refetch vars from db + if {[$store exists [self]::${var}(_____arraynames)]} { + #puts stderr array=[self]::${var} + foreach i [$store set [self]::${var}(_____arraynames)] { + my set ${var}($i) [$store set [self]::${var}($i)] + } + } elseif {[$store exists [self]::$var]} { + #puts stderr "---store=$store exists [self]::$var" + #puts stderr "---set [self]::$var <[$store set [self]::$var]>" + my instvar $var + #set name [$store set [self]::$var] + #puts ***name*[set name]--$var + set $var [$store set [self]::$var] + } elseif {[my exists $var]} { + # + # first store of the variable in persistent store + if {[my array exists $var]} { + # this variable is an array + #puts stderr array=[self]::$var + set anames [my array names $var] + foreach n $anames { + $store set [self]::${var}($n) [my set ${var}($n)] + } + $store set [self]::${var}(_____arraynames) $anames + } else { + #puts stderr "+++set [self]::$var [$store set [self]::$var]" + $store set [self]::$var [my set $var] + } + } else { + error "persistent: $var is not a variable on [self]" + } + } + } + + @ Persistent instproc persistent+init {list "persistent variables" } { + description { + Initialize all data in the list as empty strings, + if they do not exist yet, and then make them persistent + using the 'persistent' method + } + } + + Persistent instproc persistent+init {list} { + foreach pd $list { + if {![my exists $pd]} { + my set $pd "" + } + } + my persistent $list + } + + + @ Persistent instproc unPersistent {list "persistent variables" } { + description { + Make a list of object variables not persistent. + } + } + + Persistent instproc unPersistent {list} { + my instvar __persistentVars + set pMgr [my set persistenceMgr] + foreach v $list { + set i [lsearch -exact $__persistentVars $v] + catch { + set __persistentVars [lreplace $__persistentVars $i $i] + ${pMgr}::store unset [self]::$v + } + } + } + + @ Persistent instproc makeVarScript {} { + description { + Build a Tcl script of "set ..." statements reflecting the current situation in the database. + } + } + Persistent instproc makeVarScript {} { + set script "" + foreach v [my persistentVars] { + set vt [namespace tail $v] + append script [list my set $vt [my set $vt]]\n + } + #set script [concat [next] $script] + return $script + } + + Persistent instproc destroy args { + if {[my exists persistenceMgr]} { + [my set persistenceMgr] removePersistentObj [self] + my unset persistenceMgr + } + next + #my showMsg "Persistent object [self] destroyed." + } + + @ Class Persistent=Eager { + description { + Eager persistence strategy. Store everything at the same moment to the database + } + } + Class Persistent=Eager -superclass Persistent + + # + # we use 'strange' argument names to avoid name clashes with given + # variable names, when we have to instvar "[self] instvar $nametail" + # + Persistent=Eager instproc vartrace {__name_vartrace __sub_vartrace __op_vartrace} { + #my showCall + if {$__op_vartrace eq "w"} { + my instvar persistenceMgr + if {![info exists persistenceMgr]} {return} + set store ${persistenceMgr}::store + + set nametail [namespace tail $__name_vartrace] + set key [self]::$nametail + if {$__sub_vartrace eq ""} { + my instvar $nametail + #puts stderr "+++VT: $store set $key [set $nametail]" + $store set $key [set $nametail] + } else { + if {$__sub_vartrace ne "_____arraynames"} { + my instvar "${nametail}($__sub_vartrace) subname" + $store set ${key}($__sub_vartrace) $subname + $store set ${key}(_____arraynames) [my array names $nametail] + } else { + error "With persistent arrays you may not use '_____arraynames' as index" + } + } + } + } + + Persistent=Eager instproc persistent {list} { + #my showCall + next + foreach v $list { + #puts stderr "***trace variable [self]::$v w [list my vartrace]" + my trace variable $v w [list [self] vartrace] + } + } + + Persistent=Eager instproc unPersistent {list} { + foreach v $list { + my trace vdelete $v w [list [self] vartrace] + } + next + } + + @ Class Persistent=Lazy { + description { + Lazy persistence strategy. Store everything on object destroy (or program termination). + } + } + + Class Persistent=Lazy -superclass Persistent + Persistent=Lazy instproc storeall {} { + my instvar persistenceMgr + if {![info exists persistenceMgr]} {return} + set store ${persistenceMgr}::store + + foreach v [my persistentVars] { + if {[my array exists $v]} { + set anames "" + foreach sub [my array names $v] { + if {[my exists ${v}($sub)]} { + set key [self]::${v}($sub) + $store set $key [my set ${v}($sub)] + lappend anames $sub + } + } + $store set [self]::${v}(_____arraynames) $anames + } else { + if {[my exists $v]} { + set key [self]::$v + $store set $key [my set $v] + } + } + } + } + + Persistent=Lazy instproc destroy args { + my storeall + next + } + + namespace export PersistenceMgr Persistent Persistent=Eager Persistent=Lazy +} + +namespace import ::xotcl::store::persistence::* Index: library/store/Storage.xotcl =================================================================== diff -u -N --- library/store/Storage.xotcl (revision 0) +++ library/store/Storage.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,175 @@ +# $Id: Storage.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::store 0.84 +package require XOTcl + +namespace eval ::xotcl::store { + namespace import ::xotcl::* + + @ @File { + description { + Simple generic storage interface for hashtable-like (persistent) + storages. There are several different existing stores, including + a memory storage, a GDBM storage, a SDBM storage, and a + TextFile storage. + } + date { $Date: 2005/09/09 21:09:01 $ } + } + + # + # abstract interface for storage access + # + @ Class Storage { + description { + Abstract storage interface class (superclass of all storages). + } + } + Class Storage -parameter {{dirName .} fileName} + + ### + @ Storage instproc open { + filename "database filename (or filename base, if more + than one file has to be created)" + } { + Description { + Each storage object represents exactly one database table. The db + has to be opened, before it can it used. If it is not opened all + other methods return errors. + } + return "empty string" + } + Storage abstract instproc open filename + + ### + @ Storage instproc close {} { + Description { + Close associated database. + } + return "empty string" + } + Storage abstract instproc close {} + + ### + @ Storage instproc exists { + key {Key to be searched for.} + } { + Description { + Search for a key whether it exists or not. + } + return {1, if key exists in the database, otherwise 0} + } + Storage abstract instproc exists key + + ### + @ Storage instproc set { + key {Key to be set.} + ?value? {Optional value that might be set} + } { + Description { + Set or query a database key in the same way as Tcl's set functions. + } + return {Key value.} + } + Storage abstract instproc set {key ?value?} + + ### + @ Storage instproc unset { + key {Key to be unset.} + } { + Description { + Unset a database key in the same way as Tcl's unset functions. + } + return {empty string} + } + Storage abstract instproc unset key + + ### + @ Storage instproc names {} { + Description { + Return a list of keys in the database (functions in the same + way as Tcl's array names) + } + return {List of keys in the db.} + } + Storage abstract instproc names {} + + ### + @ Storage instproc firstkey {} { + Description { + Start a traversal of the database, starting with any key. + } + return {Name of first key.} + } + Storage abstract instproc firstkey {} + + ### + @ Storage instproc nextkey {} { + Description { + Proceed with the db traversal. Requires a firstkey before + first usage, otherwise it returns an error. + } + return {Name of next key, if one exists. Otherwise an empty string is returned.} + } + Storage abstract instproc nextkey {} + + Storage instproc traceFilter args { + set context "[self callingclass]->[self callingproc]" + set method [self calledproc] + set dargs $args + puts "CALL $context> [self]->$method $dargs" + set result [next] + puts "EXIT $context> [self]->$method ($result)" + return $result + } + + ### + @ Storage proc someNewChildStore {} { + Description { + Create a childStore according to a preference list depending on + which storages are available. Currently the preference list has + the following order: Gdbm, Sdbm and TextFile. + } + return {name of the created storage object.} + } + Storage proc someNewChildStore {} { + foreach store {Gdbm Sdbm TextFile} { + if {![catch {package require xotcl::store::[string tolower $store]}]} { + set s [Storage=$store new -childof [self]] + break + } + } + return $s + } + + Storage instproc checkDir {} { + my instvar dirName + if {[info exists dirName]} { + if {![file exists $dirName]} { + file mkdir $dirName + } elseif {![file isdirectory $dirName]} { + error "specified directory $dirName is no directory!" + } + } + } + Storage instproc mkFileName {} { + my instvar dirName fileName + if {[info exists dirName]} { + return [file join $dirName $fileName] + } else { + return $fileName + } + } + Storage instproc dbOpen {} { + my checkDir + my open [my mkFileName] + } + + + Storage proc defaultPackage {} { + return Sdbm + } + + namespace export Storage +} + +namespace import ::xotcl::store::* Index: library/store/TclGdbmStorage.xotcl =================================================================== diff -u -N --- library/store/TclGdbmStorage.xotcl (revision 0) +++ library/store/TclGdbmStorage.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,61 @@ +# $Id: TclGdbmStorage.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::store::tclgdbm 0.84 + +package require xotcl::store::gdbm +package require xotcl::store +package require XOTcl + +namespace eval ::xotcl::store::tclgdbm { + namespace import ::xotcl::* + + # + # a simple GNU Gdbm DB Store Access based on TclGdbm + # + Class Storage=TclGdbm -superclass Storage + Storage=TclGdbm instproc open f { + my instvar persistenceDB + ::set persistenceDB [gdbm_open -wrcreat $f] + } + + Storage=TclGdbm instproc set args { + my instvar persistenceDB + ::set l [llength $args] + if {$l == 1} {[::set persistenceDB] fetch [lindex $args 0] + } elseif {$l == 2} {[::set persistenceDB] -replace store \ + [lindex $args 0] [lindex $args 1] + } else { next } + } + + Storage=TclGdbm instproc exists k { + my instvar persistenceDB + $persistenceDB exists $k + } + + Storage=TclGdbm instproc names {} { + my instvar persistenceDB + ::set list "" + if {[::set key [$persistenceDB firstkey]] != ""} { + lappend list $key + while {[::set key [$persistenceDB nextkey $key]] != ""} { + lappend list $key + } + } + return $list + } + + + Storage=TclGdbm instproc close args { + my instvar persistenceDB + $persistenceDB close + } + + Storage=TclGdbm instproc unset k { + my instvar persistenceDB + $persistenceDB delete $k + } + + namespace export Storage=TclGdbm +} + +namespace import ::xotcl::store::tclgdbm::* Index: library/store/TextFileStorage.xotcl =================================================================== diff -u -N --- library/store/TextFileStorage.xotcl (revision 0) +++ library/store/TextFileStorage.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,160 @@ +package provide xotcl::store::textfile 0.84 +package require xotcl::store +package require XOTcl + +namespace eval ::xotcl::store::textfile { + namespace import ::xotcl::* + + Class Storage=TextFile -superclass Storage -parameter { + filename + reorgCounter + reorgMaxValue + } + + Storage=TextFile instproc init args { + my instvar reorgCounter reorgMaxValue searchID + ::set reorgCounter 0 + ::set reorgMaxValue 1000 + ::set searchID "" + next + } + Storage=TextFile instproc reorganizeDB {} { + my instvar noreorg reorgCounter reorgMaxValue filename keys + ::set reorgCounter -1 + #puts "***reorganizeDB" + if {[::info exists filename]} { + ::set noreorg 1 + ::array set bkeys [::array get keys] + ::array set keys {} + # parray bkeys + + ::set bak $filename.orig + file rename -force $filename $bak + foreach k [::array names bkeys] { + ::set bf [::open $bak r] + seek $bf [lindex $bkeys($k) 0] + ::set c [read $bf [lindex $bkeys($k) 1]] + ::close $bf + #puts "***STORING $k [lindex $c 1]" + my set $k [lindex $c 1] + } + file delete -force $bak + ::unset noreorg + } + } + Storage=TextFile instproc open fn { + my instvar keys filename + ::array set keys {} + ::set position 0 + ::set filename $fn + if {[file exists $filename]} { + ::set f [::open $filename r] + ::set c [read $f] + ::close $f + foreach {k v} $c { + lappend keyList $k + } + ::set f [::open $filename r] + while {1} { + set position [tell $f] + if {!([gets $f line] >= 0)} { + break + } + + set k [lindex $keyList 0] + if {[string match $k* $line]} { + set lastLength [string length $line] + set keys($k) [concat $position $lastLength] + set lastKey $k + set lastPosition $position + set keyList [lreplace $keyList 0 0] + } elseif {[info exists lastKey]} { + set lastLength [expr $lastLength + [string length $line] + 1] + set keys($lastKey) [concat $lastPosition $lastLength] + } + } + ::close $f + + #parray keys + } + } + Storage=TextFile instproc exists key { + my instvar keys + info exists keys($key) + } + + Storage=TextFile instproc set args { + my instvar keys noreorg reorgCounter reorgMaxValue filename + ::set key [lindex $args 0] + ::set l [llength $args] + if {$l == 1} { ;# fetch + if {[::info exists keys($key)]} { + ::set f [::open $filename r] + #puts "***fetch -- $keys($key)" + seek $f [lindex $keys($key) 0] + ::set c [read $f [lindex $keys($key) 1]] + ::close $f + return [lindex $c 1] + } else { + error "no such variable '$key'" + } + } elseif {$l == 2} { ;# store + if {![::info exists noreorg] && [::info exists keys($key)]} { + ::incr reorgCounter + } + ::set f [::open $filename a+] + ::set position [tell $f] + #puts "***store -- putting [::list $key [lindex $args 1]] at $position" + ::set c [::list $key [lindex $args 1]] + puts $f $c + ::close $f + ::set keys($key) [::list $position [expr {[string length $c] + 1}]] + # parray keys + if {$reorgCounter > $reorgMaxValue} { + my reorganizeDB + } + } else { next } + } + + Storage=TextFile instproc names {} { + my array names keys + } + Storage=TextFile instproc close {} { + my instvar filename keys + my reorganizeDB + ::unset filename + ::unset keys + } + Storage=TextFile instproc unset key { + my instvar keys + if {[::info exists keys($key)]} { + ::unset keys($key) + } + my reorganizeDB + } + + Storage=TextFile instproc firstkey {} { + my instvar keys searchID + if {$searchID ne ""} { + array donesearch keys $searchID + } + ::set searchID [array startsearch keys] + return [array nextelement keys $searchID] + } + Storage=TextFile instproc nextkey {} { + my instvar keys searchID + if {$searchID eq ""} { + error "[self class]: firstkey was not invoked on storage search" + } + ::set elt [array nextelement keys $searchID] + if {$elt eq ""} { + # if array end is reach search is terminated automatically!! + ::set searchID "" + } + return $elt + } + + namespace export Storage=TextFile +} + +namespace import ::xotcl::store::textfile::* Index: library/store/XOTclGdbm/Makefile =================================================================== diff -u -N --- library/store/XOTclGdbm/Makefile (revision 0) +++ library/store/XOTclGdbm/Makefile (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,433 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# Copyright (c) 2002-2003 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,v 1.27 2007/09/13 15:21:54 neumann 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. +#======================================================================== + +#======================================================================== +# The names of the source files is defined in the configure script. +# The object files are used for linking into the final library. +# 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 = xotclgdbm.c +PKG_OBJECTS = xotclgdbm.o + +PKG_STUB_SOURCES = +PKG_STUB_OBJECTS = + +#======================================================================== +# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with +# this package that need to be installed, if any. +#======================================================================== + +PKG_TCL_SOURCES = + +#======================================================================== +# This is a list of public header files to be installed, if any. +#======================================================================== + +PKG_HEADERS = + +#======================================================================== +# "PKG_LIB_FILE" refers to the library (dynamic or static as per +# configuration options) composed of the named objects. +#======================================================================== + +PKG_LIB_FILE = libxotclgdbm1.2.dylib +PKG_STUB_LIB_FILE = libxotclgdbmstub1.2.a + +lib_BINARIES = $(PKG_LIB_FILE) +BINARIES = $(lib_BINARIES) + +SHELL = /bin/sh + +srcdir = . +prefix = /usr/local/aolserver-4.5 +exec_prefix = /usr/local/aolserver-4.5 + +bindir = ${exec_prefix}/bin +libdir = ${exec_prefix}/lib +datadir = ${prefix}/share +mandir = ${prefix}/man +includedir = ${prefix}/include + +DESTDIR = + +PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) +pkgdatadir = $(datadir)/$(PKG_DIR) +pkglibdir = $(libdir)/$(PKG_DIR) +pkgincludedir = $(includedir)/$(PKG_DIR) + +top_builddir = . + +INSTALL = /usr/bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} + +PACKAGE_NAME = xotclgdbm +PACKAGE_VERSION = 1.2 +CC = gcc +CFLAGS_DEFAULT = -Os +CFLAGS_WARNING = -Wall -Wno-implicit-int +CLEANFILES = pkgIndex.tcl +EXEEXT = +LDFLAGS_DEFAULT = -prebind -headerpad_max_install_names -Wl,-search_paths_first +MAKE_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} +MAKE_SHARED_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} +MAKE_STATIC_LIB = ${STLIB_LD} $@ $(PKG_OBJECTS) +MAKE_STUB_LIB = ${STLIB_LD} $@ $(PKG_STUB_OBJECTS) +OBJEXT = o +RANLIB = : +RANLIB_STUB = ranlib +SHLIB_CFLAGS = -fno-common +SHLIB_LD = ${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT} -Wl,-single_module +SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@ +SHLIB_LD_LIBS = ${LIBS} -L/usr/local/aolserver-4.5/lib -ltclstub8.4 +STLIB_LD = ${AR} cr +TCL_DEFS = -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DHAVE_COREFOUNDATION=1 -DMAC_OSX_TCL=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_MTSAFE_GETHOSTBYNAME=1 -DHAVE_MTSAFE_GETHOSTBYADDR=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_COPYFILE=1 -DHAVE_LIBKERN_OSATOMIC_H=1 -DHAVE_OSSPINLOCKLOCK=1 -DHAVE_PTHREAD_ATFORK=1 -DUSE_VFORK=1 -DTCL_DEFAULT_ENCODING=\"utf-8\" -DTCL_LOAD_FROM_MEMORY=1 -DHAVE_AVAILABILITYMACROS_H=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 +TCL_BIN_DIR = /usr/local/aolserver-4.5/lib +TCL_SRC_DIR = /usr/local/src/tcl8.4.14 +# This is necessary for packages that use private Tcl headers +#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ +# Not used, but retained for reference of what libs Tcl required +TCL_LIBS = ${DL_LIBS} ${LIBS} ${MATH_LIBS} + +#======================================================================== +# 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). +#======================================================================== + +EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) +TCLSH_ENV = TCL_LIBRARY=`echo $(TCL_SRC_DIR)/library` \ + DYLD_LIBRARY_PATH="$(EXTRA_PATH):$(DYLD_LIBRARY_PATH)" \ + PATH="$(EXTRA_PATH):$(PATH)" \ + TCLLIBPATH="$(top_builddir)" +TCLSH_PROG = /usr/local/aolserver-4.5/bin/tclsh8.4 +TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) +SHARED_BUILD = 1 + +INCLUDES = -I/Users/neumann/src/xotcl-1.5.5/generic -I./generic -I"/usr/local/aolserver-4.5/include" + +EXTRA_CFLAGS = + +# TCL_DEFS is not strictly need here, but if you remove it, then you +# must make sure that configure.in 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) -DPACKAGE_NAME=\"xotclgdbm\" -DPACKAGE_TARNAME=\"xotclgdbm\" -DPACKAGE_VERSION=\"1.2\" -DPACKAGE_STRING=\"xotclgdbm\ 1.2\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 $(EXTRA_CFLAGS) +DEFS = -DPACKAGE_NAME=\"xotclgdbm\" -DPACKAGE_TARNAME=\"xotclgdbm\" -DPACKAGE_VERSION=\"1.2\" -DPACKAGE_STRING=\"xotclgdbm\ 1.2\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 $(EXTRA_CFLAGS) + +CONFIG_CLEAN_FILES = Makefile + +CPPFLAGS = +LIBS = -L/Users/neumann/src/xotcl-1.5.5 -lxotclstub1.5.5 -L/Users/neumann/src/xotcl-1.5.5 -lxotcl1.5.5 -lgdbm +AR = ar +CFLAGS = -pipe ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: $(BINARIES) pkgIndex.tcl + +libraries: + +doc: + @echo "If you have documentation to create, place the commands to" + @echo "build the docs in the 'doc:' target. For example:" + @echo " xml2nroff sample.xml > sample.n" + @echo " xml2html sample.xml > sample.html" + +install: all install-binaries install-libraries install-doc + +install-binaries: binaries install-lib-binaries install-bin-binaries + if test "x$(SHARED_BUILD)" = "x1"; then \ + $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ + fi + +#======================================================================== +# This rule installs platform-independent files, such as header files. +#======================================================================== + +install-libraries: libraries + @mkdir -p $(DESTDIR)$(includedir) + @echo "Installing header files in $(DESTDIR)$(includedir)" + @if test -n "$(PKG_HEADERS)" ; then \ + for i in "$(PKG_HEADERS)" ; do \ + echo "Installing $(srcdir)/$$i" ; \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ + done; \ + fi + +#======================================================================== +# Install documentation. Unix manpages should go in the $(mandir) +# directory. +#======================================================================== + +install-doc: doc +#install-doc: doc +# @mkdir -p $(DESTDIR)$(mandir)/mann +# @echo "Installing documentation in $(DESTDIR)$(mandir)" +# @for i in $(srcdir)/doc/*.n; do \ +# echo "Installing $$i"; \ +# rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ +# $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ +# done + +test: binaries libraries + $(TCLSH) `echo $(srcdir)/tests/all.tcl` $(TESTFLAGS) + +shell: binaries libraries + @$(TCLSH) $(SCRIPT) + +gdb: + $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) + +depend: + +#======================================================================== +# $(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". +# +# 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. +#======================================================================== + +$(PKG_LIB_FILE): $(PKG_OBJECTS) + -rm -f $(PKG_LIB_FILE) + ${MAKE_LIB} + $(RANLIB) $(PKG_LIB_FILE) + +$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) + -rm -f $(PKG_STUB_LIB_FILE) + ${MAKE_STUB_LIB} + $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# +# 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 `echo $(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:.... +#======================================================================== + +VPATH = $(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win + +.c.o: + $(COMPILE) -c `echo $<` -o $@ + +#======================================================================== +# Create the pkgIndex.tcl file. +# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but +# you may find that you need to customize the package. If so, either +# modify the -hand version, or create a pkgIndex.tcl.in file and have +# the configure script output the pkgIndex.tcl by editing configure.in. +#======================================================================== + +#pkgIndex.tcl: +# ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) + +pkgIndex.tcl: + (echo 'package ifneeded xotcl::store::gdbm $(PACKAGE_VERSION) \ + [list load [file join $$dir $(PKG_LIB_FILE)]]'\ + ) > pkgIndex.tcl + +#======================================================================== +# Distribution creation +# You may need to tweak this target to make it work correctly. +#======================================================================== + +#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar +COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) +DIST_ROOT = /tmp/dist +DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) + +dist-clean: + rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* + +dist: dist-clean + mkdir -p $(DIST_DIR) + cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ + $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ + $(DIST_DIR)/ + chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 + chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in + + cp -p $(srcdir)/*.[ch] $(DIST_DIR)/ + + mkdir $(DIST_DIR)/tclconfig + cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ + $(DIST_DIR)/tclconfig/ + chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 + chmod +x $(DIST_DIR)/tclconfig/install-sh + + list='demos doc generic library mac tests unix win'; \ + for p in $$list; do \ + if test -d $(srcdir)/$$p ; then \ + mkdir $(DIST_DIR)/$$p; \ + cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ + fi; \ + done + + (cd $(DIST_ROOT); $(COMPRESS);) + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + -test -z "$(BINARIES)" || rm -f $(BINARIES) + -rm -f *.$(OBJEXT) core *.core + -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 + +#======================================================================== +# 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) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: + @mkdir -p $(DESTDIR)$(pkglibdir) + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ + stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ + if test "x$$stub" = "xstub"; then \ + echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ + else \ + echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ + fi; \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + 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; \ + fi; \ + fi; \ + 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; \ + done + +#======================================================================== +# 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. +# +# You should not have to modify this target, except to define bin_BINARIES +# above if necessary. +#======================================================================== + +install-bin-binaries: + @mkdir -p $(DESTDIR)$(bindir) + @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; \ + done + +.SUFFIXES: .c .$(OBJEXT) + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +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; \ + done + +.PHONY: all binaries clean depend distclean doc install libraries test + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: library/store/XOTclGdbm/Makefile.in =================================================================== diff -u -N --- library/store/XOTclGdbm/Makefile.in (revision 0) +++ library/store/XOTclGdbm/Makefile.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,433 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# Copyright (c) 2002-2003 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.5 2007/08/14 16:38:26 neumann 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. +#======================================================================== + +#======================================================================== +# The names of the source files is defined in the configure script. +# The object files are used for linking into the final library. +# 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@ + +PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ +PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ + +#======================================================================== +# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with +# this package that need to be installed, if any. +#======================================================================== + +PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ + +#======================================================================== +# This is a list of public header files to be installed, if any. +#======================================================================== + +PKG_HEADERS = @PKG_HEADERS@ + +#======================================================================== +# "PKG_LIB_FILE" refers to the library (dynamic or static as per +# configuration options) composed of the named objects. +#======================================================================== + +PKG_LIB_FILE = @PKG_LIB_FILE@ +PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ + +lib_BINARIES = $(PKG_LIB_FILE) +BINARIES = $(lib_BINARIES) + +SHELL = @SHELL@ + +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +libdir = @libdir@ +datadir = @datadir@ +mandir = @mandir@ +includedir = @includedir@ + +DESTDIR = + +PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) +pkgdatadir = $(datadir)/$(PKG_DIR) +pkglibdir = $(libdir)/$(PKG_DIR) +pkgincludedir = $(includedir)/$(PKG_DIR) + +top_builddir = . + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ + +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +CC = @CC@ +CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ +CFLAGS_WARNING = @CFLAGS_WARNING@ +CLEANFILES = @CLEANFILES@ +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_FLAGS = @SHLIB_LD_FLAGS@ +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@ +# This is necessary for packages that use private Tcl headers +#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ +# Not used, but retained for reference of what libs Tcl required +TCL_LIBS = @TCL_LIBS@ + +#======================================================================== +# 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). +#======================================================================== + +EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) +TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ + @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ + PATH="$(EXTRA_PATH):$(PATH)" \ + TCLLIBPATH="$(top_builddir)" +TCLSH_PROG = @TCLSH_PROG@ +TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) +SHARED_BUILD = @SHARED_BUILD@ + +INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ + +EXTRA_CFLAGS = @PKG_CFLAGS@ + +# TCL_DEFS is not strictly need here, but if you remove it, then you +# must make sure that configure.in 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@ $(EXTRA_CFLAGS) +DEFS = @DEFS@ $(EXTRA_CFLAGS) + +CONFIG_CLEAN_FILES = Makefile + +CPPFLAGS = @CPPFLAGS@ +LIBS = @PKG_LIBS@ @LIBS@ +AR = ar +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: $(BINARIES) pkgIndex.tcl + +libraries: + +doc: + @echo "If you have documentation to create, place the commands to" + @echo "build the docs in the 'doc:' target. For example:" + @echo " xml2nroff sample.xml > sample.n" + @echo " xml2html sample.xml > sample.html" + +install: all install-binaries install-libraries install-doc + +install-binaries: binaries install-lib-binaries install-bin-binaries + if test "x$(SHARED_BUILD)" = "x1"; then \ + $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ + fi + +#======================================================================== +# This rule installs platform-independent files, such as header files. +#======================================================================== + +install-libraries: libraries + @mkdir -p $(DESTDIR)$(includedir) + @echo "Installing header files in $(DESTDIR)$(includedir)" + @if test -n "$(PKG_HEADERS)" ; then \ + for i in "$(PKG_HEADERS)" ; do \ + echo "Installing $(srcdir)/$$i" ; \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ + done; \ + fi + +#======================================================================== +# Install documentation. Unix manpages should go in the $(mandir) +# directory. +#======================================================================== + +install-doc: doc +#install-doc: doc +# @mkdir -p $(DESTDIR)$(mandir)/mann +# @echo "Installing documentation in $(DESTDIR)$(mandir)" +# @for i in $(srcdir)/doc/*.n; do \ +# echo "Installing $$i"; \ +# rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ +# $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ +# done + +test: binaries libraries + $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) + +shell: binaries libraries + @$(TCLSH) $(SCRIPT) + +gdb: + $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) + +depend: + +#======================================================================== +# $(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". +# +# 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. +#======================================================================== + +$(PKG_LIB_FILE): $(PKG_OBJECTS) + -rm -f $(PKG_LIB_FILE) + ${MAKE_LIB} + $(RANLIB) $(PKG_LIB_FILE) + +$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) + -rm -f $(PKG_STUB_LIB_FILE) + ${MAKE_STUB_LIB} + $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# +# 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:.... +#======================================================================== + +VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win + +.c.@OBJEXT@: + $(COMPILE) -c `@CYGPATH@ $<` -o $@ + +#======================================================================== +# Create the pkgIndex.tcl file. +# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but +# you may find that you need to customize the package. If so, either +# modify the -hand version, or create a pkgIndex.tcl.in file and have +# the configure script output the pkgIndex.tcl by editing configure.in. +#======================================================================== + +#pkgIndex.tcl: +# ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) + +pkgIndex.tcl: + (echo 'package ifneeded xotcl::store::gdbm $(PACKAGE_VERSION) \ + [list load [file join $$dir $(PKG_LIB_FILE)]]'\ + ) > pkgIndex.tcl + +#======================================================================== +# Distribution creation +# You may need to tweak this target to make it work correctly. +#======================================================================== + +#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar +COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) +DIST_ROOT = /tmp/dist +DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) + +dist-clean: + rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* + +dist: dist-clean + mkdir -p $(DIST_DIR) + cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ + $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ + $(DIST_DIR)/ + chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 + chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in + + cp -p $(srcdir)/*.[ch] $(DIST_DIR)/ + + mkdir $(DIST_DIR)/tclconfig + cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ + $(DIST_DIR)/tclconfig/ + chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 + chmod +x $(DIST_DIR)/tclconfig/install-sh + + list='demos doc generic library mac tests unix win'; \ + for p in $$list; do \ + if test -d $(srcdir)/$$p ; then \ + mkdir $(DIST_DIR)/$$p; \ + cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ + fi; \ + done + + (cd $(DIST_ROOT); $(COMPRESS);) + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + -test -z "$(BINARIES)" || rm -f $(BINARIES) + -rm -f *.$(OBJEXT) core *.core + -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 + +#======================================================================== +# 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) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: + @mkdir -p $(DESTDIR)$(pkglibdir) + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ + stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ + if test "x$$stub" = "xstub"; then \ + echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ + else \ + echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ + fi; \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + 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; \ + fi; \ + fi; \ + 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; \ + done + +#======================================================================== +# 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. +# +# You should not have to modify this target, except to define bin_BINARIES +# above if necessary. +#======================================================================== + +install-bin-binaries: + @mkdir -p $(DESTDIR)$(bindir) + @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; \ + done + +.SUFFIXES: .c .$(OBJEXT) + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +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; \ + done + +.PHONY: all binaries clean depend distclean doc install libraries test + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: library/store/XOTclGdbm/Makefile.in--ok =================================================================== diff -u -N --- library/store/XOTclGdbm/Makefile.in--ok (revision 0) +++ library/store/XOTclGdbm/Makefile.in--ok (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,379 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# RCS: @(#) $Id: Makefile.in--ok,v 1.1 2004/05/23 22:50:39 neumann Exp $ + +#======================================================================== +# Edit the following few lines when writing a new extension +#======================================================================== + +configdir=$(srcdir)/../../../config + +#======================================================================== +# 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= +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. +#======================================================================== + +xotclgdbm_SOURCES = $(srcdir)/xotclgdbm.c +SOURCES = $(xotclgdbm_SOURCES) + +#======================================================================== +# Enumerate the names of the object files included in this package. +# These objects are created and linked into the final library. In +# most cases these object files will correspond to the source files +# above. +# +#======================================================================== + +xotclgdbm_OBJECTS = xotclgdbm.$(OBJEXT) +OBJECTS = $(xotclgdbm_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. +#======================================================================== + +xotclgdbm_LIB_FILE = @xotclgdbm_LIB_FILE@ +$(xotclgdbm_LIB_FILE)_OBJECTS = $(xotclgdbm_OBJECTS) + +#======================================================================== +# This is a list of header files to be installed +#======================================================================== + +GENERIC_HDRS= + +#======================================================================== +# Add additional lines to handle any additional AC_SUBST cases that +# have been added to the configure script. +#======================================================================== + +SAMPLE_NEW_VAR=@SAMPLE_NEW_VAR@ + +#======================================================================== +# Nothing of the variables below this line need to be changed. Please +# check the TARGETS section below to make sure the make targets are +# correct. +#======================================================================== + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_FLAG = +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +CC = @CC@ +CFLAGS_DEBUG = @CFLAGS_DEBUG@ +CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ +CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ +CLEANFILES = @CLEANFILES@ +EXEEXT = @EXEEXT@ +LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ +LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ +LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ +MAKE_LIB = @MAKE_LIB@ +MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ +MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ +OBJEXT = @OBJEXT@ +RANLIB = @RANLIB@ +SHLIB_CFLAGS = @SHLIB_CFLAGS@ +SHLIB_LD = @SHLIB_LD@ +SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ +SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ +STLIB_LD = @STLIB_LD@ +TCL_BIN_DIR = @TCL_BIN_DIR@ +TCL_DEFS = @TCL_DEFS@ +TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ +TCL_LD_FLAGS = @TCL_LD_FLAGS@ +TCL_LIBS = @TCL_LIBS@ +TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ +TCL_SRC_DIR = @TCL_SRC_DIR@ +TCL_DBGX = @TCL_DBGX@ +TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ +TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ +TCL_TOOL_DIR_NATIVE = @TCL_TOOL_DIR_NATIVE@ +TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ +TCL_UNIX_DIR_NATIVE = @TCL_UNIX_DIR_NATIVE@ +TCL_WIN_DIR_NATIVE = @TCL_WIN_DIR_NATIVE@ +INCLUDE_DIR_NATIVE = @INCLUDE_DIR_NATIVE@ +TCL_BMAP_DIR_NATIVE = @TCL_BMAP_DIR_NATIVE@ +TCL_PLATFORM_DIR_NATIVE = @TCL_PLATFORM_DIR_NATIVE@ +TCL_GENERIC_DIR_NATIVE = @TCL_GENERIC_DIR_NATIVE@ +TCLSH_PROG = @TCLSH_PROG@ + +AUTOCONF = autoconf + +LDFLAGS = $(LDFLAGS_DEFAULT) + +INCLUDES = @TCL_INCLUDES@ + +EXTRA_CFLAGS = $(TCL_DEFS) $(PROTO_FLAGS) $(SECURITY_FLAGS) $(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) $(NO_DEPRECATED_FLAGS) + +DEFS = @DEFS@ $(EXTRA_CFLAGS) + +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(configdir)/mkinstalldirs +CONFIG_CLEAN_FILES = $(configdir)/mkIndex.tcl + +CPPFLAGS = @CPPFLAGS@ +LIBS = @LIBS@ +AR = ar +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -I@XOTCL_SRC_DIR@/generic +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: + +libraries: $(srcdir)/../$(xotclgdbm_LIB_FILE) + +doc: + +install: all install-binaries install-libraries install-doc + +install-binaries: binaries install-lib-binaries install-bin-binaries + +#======================================================================== +# This rule installs platform-independent files, such as header files. +#======================================================================== + +install-libraries: libraries $(DESTDIR)$(includedir) + @if test ! -z $(GENERIC_HDRS) ; then \ + echo "Installing header files in $(DESTDIR)$(includedir)" ; \ + fi + @for i in $(GENERIC_HDRS) ; do \ + echo "Installing $$i" ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(includedir) ; \ + done; + +#======================================================================== +# Install documentation. Unix manpages should go in the $(mandir) +# directory. +#======================================================================== + +install-doc: + +test: + +depend: + +#======================================================================== +# Enumerate the names of the object files included in this package. +# These objects are created and linked into the final library. In +# most cases these object files will correspond to the source files +# above. +# +# $(exampleA_LIB_FILE) should be listed as part of the BINARIES variable +# at the top of the Makefile. That will ensure that this target is built +# when you run "make binaries". +# +# You shouldn't need to modify this target, except to change the package +# name from "exampleA" to your package's name. +#======================================================================== + +$(xotclgdbm_LIB_FILE): $(xotclgdbm_OBJECTS) + -rm -f $@ + @MAKE_LIB@ -lgdbm + $(RANLIB) $@ + +$(srcdir)/../$(xotclgdbm_LIB_FILE): $(xotclgdbm_LIB_FILE) + cp $< $@ + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# Unfortunately, there does not seem to be any other way to do this +# in a Makefile-independent way. We can't use VPATH because it picks up +# object files that may be located in the source directory. +# +# In the following lines, $(srcdir) refers to the toplevel directory +# containing your extension. If your sources are in a subdirectory, +# you will have to modify the paths to reflect this: +# +# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c +# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@ +#======================================================================== + +%.o: $(srcdir)/%.c + $(COMPILE) -c `@CYGPATH@ $<` -o $@ + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + @rm -f $(xotclgdbm_LIB_FILE) $(srcdir)/../$(xotclgdbm_LIB_FILE) \ + *.o core *.core *.$(OBJEXT) $(CLEANFILES) config.log + +distclean: clean + -rm -f *.tab.c + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -rm -f config.status + +#======================================================================== +# Install binary object libraries. On Windows this includes both .dll and +# .lib files. Because the .lib files are not explicitly listed anywhere, +# we need to deduce their existence from the .dll file of the same name. +# Additionally, the .dll files go into the bin directory, but the .lib +# files go into the lib directory. On Unix platforms, all library files +# go into the lib directory. In addition, this will generate the pkgIndex.tcl +# file in the install location (assuming it can find a usable tclsh8.2 shell) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + echo " $(INSTALL_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)$(libdir)/$$lib"; \ + $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \ + fi; \ + else \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \ + fi; \ + else :; fi; \ + done + @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 +# $(TCLSH_PROG) $(configdir)/mkIndex.tcl + +#======================================================================== +# Install binary executables (e.g. .exe files) +# +# You should not have to modify this target. +#======================================================================== + +install-bin-binaries: $(DESTDIR)$(bindir) + @list='$(BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \ + else :; fi; \ + done + +.SUFFIXES: .c .o .obj + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + + +uninstall-binaries: + @$(NORMAL_UNINSTALL) + list='$(BINARIES)'; for p in $$list; do \ + rm -f $(DESTDIR)$(libdir)/$$p; \ + done + +$(DESTDIR)$(includedir): + $(mkinstalldirs) $@ +$(DESTDIR)$(libdir): + $(mkinstalldirs) $@ +$(DESTDIR)$(bindir): + $(mkinstalldirs) $@ + +.PHONY: all binaries clean depend distclean doc install libraries test + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: library/store/XOTclGdbm/aclocal.m4 =================================================================== diff -u -N --- library/store/XOTclGdbm/aclocal.m4 (revision 0) +++ library/store/XOTclGdbm/aclocal.m4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,3 @@ +builtin(include,xotcl.m4) +builtin(include,tcl.m4) + Index: library/store/XOTclGdbm/config.log =================================================================== diff -u -N --- library/store/XOTclGdbm/config.log (revision 0) +++ library/store/XOTclGdbm/config.log (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1026 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by xotclgdbm configure 1.2, which was +generated by GNU Autoconf 2.57. Invocation command line was + + $ ./configure --prefix=/usr --enable-threads --prefix=/usr --with-all --cache-file=/dev/null --srcdir=. + +## --------- ## +## Platform. ## +## --------- ## + +hostname = localhost.localdomain +uname -m = i686 +uname -r = 2.4.22-1.2188.nptl +uname -s = Linux +uname -v = #1 Wed Apr 21 20:36:05 EDT 2004 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = i686 +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: . +PATH: /home/neumann/bin +PATH: . +PATH: /home/neumann/bin +PATH: /usr/local/bin +PATH: /usr/bin +PATH: /bin +PATH: /usr/X11R6/bin +PATH: /usr/X11R6/bin +PATH: /sbin +PATH: /usr/sbin +PATH: /opt/bin +PATH: /usr/X11R6/bin +PATH: /sbin +PATH: /usr/sbin +PATH: /opt/bin + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:1294: checking for correct TEA configuration +configure:1313: result: ok +configure:1433: checking for Tcl configuration +configure:1505: result: found /usr/lib/tclConfig.sh +configure:1511: checking for existence of /usr/lib/tclConfig.sh +configure:1515: result: loading +configure:1670: checking for gcc +configure:1686: found /usr/bin/gcc +configure:1696: result: gcc +configure:1940: checking for C compiler version +configure:1943: gcc --version &5 +gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1) +Copyright (C) 2003 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +configure:1946: $? = 0 +configure:1948: gcc -v &5 +Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs +Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux +Thread model: posix +gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) +configure:1951: $? = 0 +configure:1953: gcc -V &5 +gcc: `-V' option must have argument +configure:1956: $? = 1 +configure:1980: checking for C compiler default output +configure:1983: gcc conftest.c >&5 +configure:1986: $? = 0 +configure:2032: result: a.out +configure:2037: checking whether the C compiler works +configure:2043: ./a.out +configure:2046: $? = 0 +configure:2063: result: yes +configure:2070: checking whether we are cross compiling +configure:2072: result: no +configure:2075: checking for suffix of executables +configure:2077: gcc -o conftest conftest.c >&5 +configure:2080: $? = 0 +configure:2105: result: +configure:2111: checking for suffix of object files +configure:2133: gcc -c conftest.c >&5 +configure:2136: $? = 0 +configure:2158: result: o +configure:2162: checking whether we are using the GNU C compiler +configure:2187: gcc -c conftest.c >&5 +configure:2190: $? = 0 +configure:2193: test -s conftest.o +configure:2196: $? = 0 +configure:2209: result: yes +configure:2215: checking whether gcc accepts -g +configure:2237: gcc -c -g conftest.c >&5 +configure:2240: $? = 0 +configure:2243: test -s conftest.o +configure:2246: $? = 0 +configure:2257: result: yes +configure:2274: checking for gcc option to accept ANSI C +configure:2335: gcc -c conftest.c >&5 +configure:2338: $? = 0 +configure:2341: test -s conftest.o +configure:2344: $? = 0 +configure:2362: result: none needed +configure:2380: gcc -c conftest.c >&5 +conftest.c:2: error: syntax error before "me" +configure:2383: $? = 1 +configure: failed program was: +| #ifndef __cplusplus +| choke me +| #endif +configure:2497: checking how to run the C preprocessor +configure:2533: gcc -E conftest.c +configure:2539: $? = 0 +configure:2571: gcc -E conftest.c +configure:2570:28: ac_nonexistent.h: No such file or directory +configure:2577: $? = 1 +configure: failed program was: +| #line 2562 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclgdbm" +| #define PACKAGE_TARNAME "xotclgdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclgdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| /* end confdefs.h. */ +| #include +configure:2615: result: gcc -E +configure:2640: gcc -E conftest.c +configure:2646: $? = 0 +configure:2678: gcc -E conftest.c +configure:2677:28: ac_nonexistent.h: No such file or directory +configure:2684: $? = 1 +configure: failed program was: +| #line 2669 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclgdbm" +| #define PACKAGE_TARNAME "xotclgdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclgdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| /* end confdefs.h. */ +| #include +configure:2739: checking for a BSD-compatible install +configure:2793: result: /usr/bin/install -c +configure:2809: checking whether make sets $(MAKE) +configure:2829: result: yes +configure:2884: checking for ranlib +configure:2900: found /usr/bin/ranlib +configure:2911: result: ranlib +configure:2933: checking for egrep +configure:2943: result: grep -E +configure:2948: checking for ANSI C header files +configure:2974: gcc -c conftest.c >&5 +configure:2977: $? = 0 +configure:2980: test -s conftest.o +configure:2983: $? = 0 +configure:3072: gcc -o conftest conftest.c >&5 +configure:3075: $? = 0 +configure:3077: ./conftest +configure:3080: $? = 0 +configure:3095: result: yes +configure:3119: checking for sys/types.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for sys/stat.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for stdlib.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for string.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for memory.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for strings.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for inttypes.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for stdint.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for unistd.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3178: checking if the compiler understands -pipe +configure:3199: gcc -pipe -c conftest.c >&5 +configure:3202: $? = 0 +configure:3205: test -s conftest.o +configure:3208: $? = 0 +configure:3210: result: yes +configure:3228: checking for required early compiler flags +configure:3252: gcc -pipe -c conftest.c >&5 +configure:3255: $? = 0 +configure:3258: test -s conftest.o +configure:3261: $? = 0 +configure:3338: gcc -pipe -c conftest.c >&5 +configure: In function `main': +configure:3343: error: storage size of `buf' isn't known +configure:3341: $? = 1 +configure: failed program was: +| #line 3321 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclgdbm" +| #define PACKAGE_TARNAME "xotclgdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclgdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| /* end confdefs.h. */ +| #include +| int +| main () +| { +| struct stat64 buf; int i = stat64("/", &buf); +| ; +| return 0; +| } +configure:3372: gcc -pipe -c conftest.c >&5 +configure:3375: $? = 0 +configure:3378: test -s conftest.o +configure:3381: $? = 0 +configure:3407: result: _LARGEFILE64_SOURCE +configure:3412: checking for 64-bit integer type +configure:3435: gcc -pipe -c conftest.c >&5 +configure: In function `main': +configure:3441: error: `__int64' undeclared (first use in this function) +configure:3441: error: (Each undeclared identifier is reported only once +configure:3441: error: for each function it appears in.) +configure:3441: error: syntax error before "value" +configure:3438: $? = 1 +configure: failed program was: +| #line 3418 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclgdbm" +| #define PACKAGE_TARNAME "xotclgdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclgdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| /* end confdefs.h. */ +| +| int +| main () +| { +| __int64 value = (__int64) 0; +| ; +| return 0; +| } +configure:3471: gcc -pipe -o conftest conftest.c >&5 +configure:3474: $? = 0 +configure:3476: ./conftest +configure:3479: $? = 0 +configure:3507: result: long long +configure:3511: checking for struct dirent64 +configure:3535: gcc -pipe -c conftest.c >&5 +configure:3538:24: sys/dirent.h: No such file or directory +configure: In function `main': +configure:3542: error: storage size of `p' isn't known +configure:3538: $? = 1 +configure: failed program was: +| #line 3517 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclgdbm" +| #define PACKAGE_TARNAME "xotclgdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclgdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| /* end confdefs.h. */ +| #include +| #include +| int +| main () +| { +| struct dirent64 p; +| ; +| return 0; +| } +configure:3562: result: no +configure:3565: checking for struct stat64 +configure:3589: gcc -pipe -c conftest.c >&5 +configure:3592: $? = 0 +configure:3595: test -s conftest.o +configure:3598: $? = 0 +configure:3616: result: yes +configure:3619: checking for off64_t +configure:3643: gcc -pipe -c conftest.c >&5 +configure:3646: $? = 0 +configure:3649: test -s conftest.o +configure:3652: $? = 0 +configure:3670: result: yes +configure:3674: checking whether byte ordering is bigendian +configure:3702: gcc -pipe -c conftest.c >&5 +configure:3705: $? = 0 +configure:3708: test -s conftest.o +configure:3711: $? = 0 +configure:3736: gcc -pipe -c conftest.c >&5 +configure: In function `main': +configure:3743: error: `not' undeclared (first use in this function) +configure:3743: error: (Each undeclared identifier is reported only once +configure:3743: error: for each function it appears in.) +configure:3743: error: syntax error before "big" +configure:3739: $? = 1 +configure: failed program was: +| #line 3714 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclgdbm" +| #define PACKAGE_TARNAME "xotclgdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclgdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| #include +| #include +| +| int +| main () +| { +| #if BYTE_ORDER != BIG_ENDIAN +| not big endian +| #endif +| +| ; +| return 0; +| } +configure:3859: result: no +configure:3887: checking for sin +configure:3937: gcc -pipe -o conftest conftest.c >&5 +configure:3930: warning: conflicting types for built-in function `sin' +/tmp/ccNx6b7V.o(.text+0x16): In function `main': +: undefined reference to `sin' +/tmp/ccNx6b7V.o(.data+0x0): undefined reference to `sin' +collect2: ld returned 1 exit status +configure:3940: $? = 1 +configure: failed program was: +| #line 3892 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclgdbm" +| #define PACKAGE_TARNAME "xotclgdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclgdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| /* System header to define __stub macros and hopefully few prototypes, +| which can conflict with char sin (); below. +| Prefer to if __STDC__ is defined, since +| exists even on freestanding compilers. */ +| #ifdef __STDC__ +| # include +| #else +| # include +| #endif +| /* Override any gcc2 internal prototype to avoid an error. */ +| #ifdef __cplusplus +| extern "C" +| { +| #endif +| /* We use char because int might match the return type of a gcc2 +| builtin and then its argument prototype would still apply. */ +| char sin (); +| /* The GNU C library defines this for functions which it implements +| to always fail with ENOSYS. Some functions are actually named +| something starting with __ and the normal name is an alias. */ +| #if defined (__stub_sin) || defined (__stub___sin) +| choke me +| #else +| char (*f) () = sin; +| #endif +| #ifdef __cplusplus +| } +| #endif +| +| int +| main () +| { +| return f != sin; +| ; +| return 0; +| } +configure:3957: result: no +configure:3965: checking for main in -lieee +configure:3990: gcc -pipe -o conftest conftest.c -lieee >&5 +configure:3993: $? = 0 +configure:3996: test -s conftest +configure:3999: $? = 0 +configure:4011: result: yes +configure:4023: checking for main in -linet +configure:4048: gcc -pipe -o conftest conftest.c -linet >&5 +/usr/bin/ld: cannot find -linet +collect2: ld returned 1 exit status +configure:4051: $? = 1 +configure: failed program was: +| #line 4030 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclgdbm" +| #define PACKAGE_TARNAME "xotclgdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclgdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| +| +| int +| main () +| { +| main (); +| ; +| return 0; +| } +configure:4069: result: no +configure:4085: checking net/errno.h usability +configure:4098: gcc -pipe -c conftest.c >&5 +configure:4143:23: net/errno.h: No such file or directory +configure:4101: $? = 1 +configure: failed program was: +| #line 4087 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclgdbm" +| #define PACKAGE_TARNAME "xotclgdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclgdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| #include +| #if HAVE_SYS_TYPES_H +| # include +| #endif +| #if HAVE_SYS_STAT_H +| # include +| #endif +| #if STDC_HEADERS +| # include +| # include +| #else +| # if HAVE_STDLIB_H +| # include +| # endif +| #endif +| #if HAVE_STRING_H +| # if !STDC_HEADERS && HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #if HAVE_STRINGS_H +| # include +| #endif +| #if HAVE_INTTYPES_H +| # include +| #else +| # if HAVE_STDINT_H +| # include +| # endif +| #endif +| #if HAVE_UNISTD_H +| # include +| #endif +| #include +configure:4117: result: no +configure:4121: checking net/errno.h presence +configure:4132: gcc -E conftest.c +configure:4145:23: net/errno.h: No such file or directory +configure:4138: $? = 1 +configure: failed program was: +| #line 4123 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclgdbm" +| #define PACKAGE_TARNAME "xotclgdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclgdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| #include +configure:4157: result: no +configure:4193: checking for net/errno.h +configure:4200: result: no +configure:4232: checking for connect +configure:4282: gcc -pipe -o conftest conftest.c >&5 +configure:4285: $? = 0 +configure:4288: test -s conftest +configure:4291: $? = 0 +configure:4302: result: yes +configure:4531: checking for gethostbyname +configure:4581: gcc -pipe -o conftest conftest.c >&5 +configure:4584: $? = 0 +configure:4587: test -s conftest +configure:4590: $? = 0 +configure:4601: result: yes +configure:4675: checking dirent.h +configure:4713: gcc -pipe -o conftest conftest.c >&5 +configure:4716: $? = 0 +configure:4719: test -s conftest +configure:4722: $? = 0 +configure:4740: result: yes +configure:4752: checking errno.h usability +configure:4765: gcc -pipe -c conftest.c >&5 +configure:4768: $? = 0 +configure:4771: test -s conftest.o +configure:4774: $? = 0 +configure:4784: result: yes +configure:4788: checking errno.h presence +configure:4799: gcc -E conftest.c +configure:4805: $? = 0 +configure:4824: result: yes +configure:4860: checking for errno.h +configure:4867: result: yes +configure:4891: checking float.h usability +configure:4904: gcc -pipe -c conftest.c >&5 +configure:4907: $? = 0 +configure:4910: test -s conftest.o +configure:4913: $? = 0 +configure:4923: result: yes +configure:4927: checking float.h presence +configure:4938: gcc -E conftest.c +configure:4944: $? = 0 +configure:4963: result: yes +configure:4999: checking for float.h +configure:5006: result: yes +configure:5030: checking values.h usability +configure:5043: gcc -pipe -c conftest.c >&5 +configure:5046: $? = 0 +configure:5049: test -s conftest.o +configure:5052: $? = 0 +configure:5062: result: yes +configure:5066: checking values.h presence +configure:5077: gcc -E conftest.c +configure:5083: $? = 0 +configure:5102: result: yes +configure:5138: checking for values.h +configure:5145: result: yes +configure:5169: checking limits.h usability +configure:5182: gcc -pipe -c conftest.c >&5 +configure:5185: $? = 0 +configure:5188: test -s conftest.o +configure:5191: $? = 0 +configure:5201: result: yes +configure:5205: checking limits.h presence +configure:5216: gcc -E conftest.c +configure:5222: $? = 0 +configure:5241: result: yes +configure:5277: checking for limits.h +configure:5284: result: yes +configure:5299: checking for stdlib.h +configure:5304: result: yes +configure:5495: checking for string.h +configure:5500: result: yes +configure:5687: checking sys/wait.h usability +configure:5700: gcc -pipe -c conftest.c >&5 +configure:5703: $? = 0 +configure:5706: test -s conftest.o +configure:5709: $? = 0 +configure:5719: result: yes +configure:5723: checking sys/wait.h presence +configure:5734: gcc -E conftest.c +configure:5740: $? = 0 +configure:5759: result: yes +configure:5795: checking for sys/wait.h +configure:5802: result: yes +configure:5826: checking dlfcn.h usability +configure:5839: gcc -pipe -c conftest.c >&5 +configure:5842: $? = 0 +configure:5845: test -s conftest.o +configure:5848: $? = 0 +configure:5858: result: yes +configure:5862: checking dlfcn.h presence +configure:5873: gcc -E conftest.c +configure:5879: $? = 0 +configure:5898: result: yes +configure:5934: checking for dlfcn.h +configure:5941: result: yes +configure:5967: checking for limits.h +configure:5972: result: yes +configure:5967: checking for unistd.h +configure:5972: result: yes +configure:5976: checking sys/param.h usability +configure:5989: gcc -pipe -c conftest.c >&5 +configure:5992: $? = 0 +configure:5995: test -s conftest.o +configure:5998: $? = 0 +configure:6008: result: yes +configure:6012: checking sys/param.h presence +configure:6023: gcc -E conftest.c +configure:6029: $? = 0 +configure:6048: result: yes +configure:6084: checking for sys/param.h +configure:6091: result: yes +configure:6181: checking for XOTcl configuration +configure:6242: result: found /home/neumann/xotcl-1.2.1/xotclConfig.sh +configure:6248: checking for existence of /home/neumann/xotcl-1.2.1/xotclConfig.sh +configure:6252: result: loading +configure:6421: checking for Tcl public headers +configure:6476: result: /usr/include +configure:6524: checking for pthread_mutex_init in -lpthread +configure:6555: gcc -pipe -o conftest conftest.c -lpthread >&5 +configure:6558: $? = 0 +configure:6561: test -s conftest +configure:6564: $? = 0 +configure:6576: result: yes +configure:6863: checking for pthread_attr_setstacksize +configure:6913: gcc -pipe -o conftest conftest.c -lpthread >&5 +configure:6916: $? = 0 +configure:6919: test -s conftest +configure:6922: $? = 0 +configure:6933: result: yes +configure:6948: checking for readdir_r +configure:6998: gcc -pipe -o conftest conftest.c >&5 +configure:7001: $? = 0 +configure:7004: test -s conftest +configure:7007: $? = 0 +configure:7018: result: yes +configure:7033: checking for building with threads +configure:7040: result: yes +configure:7079: checking how to build libraries +configure:7097: result: shared +configure:7123: checking if 64bit support is enabled +configure:7132: result: no +configure:7137: checking if 64bit Sparc VIS support is requested +configure:7146: result: no +configure:7174: checking system version (for dynamic loading) +configure:7197: result: Linux-2.4.22-1.2188.nptl +configure:7205: checking for dlopen in -ldl +configure:7236: gcc -pipe -o conftest conftest.c -ldl >&5 +configure:7239: $? = 0 +configure:7242: test -s conftest +configure:7245: $? = 0 +configure:7257: result: yes +configure:7287: checking for ar +configure:7303: found /usr/bin/ar +configure:7313: result: ar +configure:9199: checking for build with symbols +configure:9213: result: no +configure:9348: checking for tclsh +configure:9379: result: /usr/lib/../bin/tclsh8.4 +configure:9523: creating ./config.status + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by xotclgdbm config.status 1.2, which was +generated by GNU Autoconf 2.57. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on localhost.localdomain + +config.status:675: creating Makefile + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_c_bigendian=no +ac_cv_c_compiler_gnu=yes +ac_cv_c_tclconfig=/usr/lib +ac_cv_c_tclh=/usr/include +ac_cv_c_xotclconfig=/home/neumann/xotcl-1.2.1 +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_exeext= +ac_cv_func_connect=yes +ac_cv_func_gethostbyname=yes +ac_cv_func_pthread_attr_setstacksize=yes +ac_cv_func_readdir_r=yes +ac_cv_func_sin=no +ac_cv_header_dlfcn_h=yes +ac_cv_header_errno_h=yes +ac_cv_header_float_h=yes +ac_cv_header_inttypes_h=yes +ac_cv_header_limits_h=yes +ac_cv_header_memory_h=yes +ac_cv_header_net_errno_h=no +ac_cv_header_stdc=yes +ac_cv_header_stdint_h=yes +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_param_h=yes +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_sys_wait_h=yes +ac_cv_header_unistd_h=yes +ac_cv_header_values_h=yes +ac_cv_lib_dl_dlopen=yes +ac_cv_lib_ieee_main=yes +ac_cv_lib_inet_main=no +ac_cv_lib_pthread_pthread_mutex_init=yes +ac_cv_objext=o +ac_cv_path_install='/usr/bin/install -c' +ac_cv_path_tclsh=/usr/lib/../bin/tclsh8.4 +ac_cv_prog_AR=ar +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_RANLIB=ranlib +ac_cv_prog_cc_g=yes +ac_cv_prog_cc_stdc= +ac_cv_prog_egrep='grep -E' +ac_cv_prog_make_make_set=yes +tcl_cv_flag__isoc99_source=no +tcl_cv_flag__largefile64_source=yes +tcl_cv_struct_dirent64=no +tcl_cv_struct_stat64=yes +tcl_cv_type_64bit='long long' +tcl_cv_type_off64_t=yes + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +AR='ar' +CC='gcc -pipe' +CFLAGS=' ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' +CFLAGS_DEBUG='-g' +CFLAGS_DEFAULT='-O' +CFLAGS_OPTIMIZE='-O' +CFLAGS_WARNING='-Wall -Wconversion -Wno-implicit-int' +CLEANFILES='pkgIndex.tcl' +CPP='gcc -E' +CPPFLAGS='' +CYGPATH='echo' +DEFS='-DPACKAGE_NAME=\"xotclgdbm\" -DPACKAGE_TARNAME=\"xotclgdbm\" -DPACKAGE_VERSION=\"1.2\" -DPACKAGE_STRING=\"xotclgdbm\ 1.2\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -DTCL_THREADS=1 -DUSE_TCL_STUBS=1 ' +DL_LIBS='-ldl' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='grep -E' +EXEEXT='' +EXTRA_CFLAGS='' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +LDFLAGS='-rdynamic' +LDFLAGS_DEBUG='' +LDFLAGS_DEFAULT='-rdynamic' +LDFLAGS_OPTIMIZE='' +LD_LIBRARY_PATH_VAR='LD_LIBRARY_PATH' +LIBOBJS='' +LIBS='' +LTLIBOBJS='' +MAKE_LIB='${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_FLAGS} ${SHLIB_LD_LIBS} ' +MAKE_SHARED_LIB='${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_FLAGS} ${SHLIB_LD_LIBS}' +MAKE_STATIC_LIB='${STLIB_LD} $@ $(PKG_OBJECTS)' +MAKE_STUB_LIB='${STLIB_LD} $@ $(PKG_STUB_OBJECTS)' +MATH_LIBS='-lieee -lm' +OBJEXT='o' +PACKAGE_BUGREPORT='' +PACKAGE_NAME='xotclgdbm' +PACKAGE_STRING='xotclgdbm 1.2' +PACKAGE_TARNAME='xotclgdbm' +PACKAGE_VERSION='1.2' +PATH_SEPARATOR=':' +PKG_CFLAGS=' ' +PKG_HEADERS='' +PKG_INCLUDES=' -I/home/neumann/xotcl-1.2.1/generic' +PKG_LIBS=' -L/home/neumann/xotcl-1.2.1 -lxotclstub1.2.1 -lgdbm' +PKG_LIB_FILE='libxotclgdbm1.2.so' +PKG_OBJECTS=' xotclgdbm.o' +PKG_SOURCES=' xotclgdbm.c' +PKG_STUB_LIB_FILE='libxotclgdbmstub1.2.a' +PKG_STUB_OBJECTS='' +PKG_STUB_SOURCES='' +PKG_TCL_SOURCES='' +RANLIB=':' +RANLIB_STUB='ranlib' +SET_MAKE='' +SHARED_BUILD='1' +SHELL='/bin/sh' +SHLIB_CFLAGS='-fPIC' +SHLIB_LD='gcc -pipe -shared' +SHLIB_LD_FLAGS='' +SHLIB_LD_LIBS='${LIBS} -L/usr/lib -ltclstub8.4' +STLIB_LD='${AR} cr' +TCLSH_PROG='/usr/lib/../bin/tclsh8.4' +TCL_BIN_DIR='/usr/lib' +TCL_DBGX='' +TCL_DEFS=' -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DPEEK_XCLOSEIM=1 -DHAVE_SYS_IOCTL_H=1 ' +TCL_EXTRA_CFLAGS='' +TCL_INCLUDES='-I"/usr/include"' +TCL_LD_FLAGS='-rdynamic' +TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' +TCL_LIB_FILE='libtcl8.4.so' +TCL_LIB_FLAG='-ltcl8.4' +TCL_LIB_SPEC='-L/usr/lib -ltcl8.4' +TCL_SHLIB_LD_LIBS='${LIBS}' +TCL_SRC_DIR='/home/neumann/tcl8.4.5' +TCL_STUB_LIB_FILE='libtclstub8.4.a' +TCL_STUB_LIB_FLAG='-ltclstub8.4' +TCL_STUB_LIB_SPEC='-L/usr/lib -ltclstub8.4' +TCL_THREADS='1' +TCL_VERSION='8.4' +XOTCL_BUILD_LIB_SPEC='-L/home/neumann/xotcl-1.2.1 -lxotcl1.2.1' +XOTCL_BUILD_STUB_LIB_SPEC='-L/home/neumann/xotcl-1.2.1 -lxotclstub1.2.1' +XOTCL_LIB_FILE='libxotcl1.2.1.so' +XOTCL_LIB_SPEC='-L/usr/lib -lxotcl1.2.1' +XOTCL_MAJOR_VERSION='1' +XOTCL_MINOR_VERSION='2' +XOTCL_RELEASE_LEVEL='.1' +XOTCL_SRC_DIR='/home/neumann/xotcl-1.2.1' +XOTCL_STUB_LIB_FILE='' +XOTCL_STUB_LIB_SPEC='-L/usr/lib -lxotclstub1.2.1' +XOTCL_VERSION='1.2' +ac_ct_CC='gcc' +ac_ct_RANLIB='ranlib' +bindir='${exec_prefix}/bin' +build_alias='' +datadir='${prefix}/share' +exec_prefix='/usr' +host_alias='' +includedir='${prefix}/include' +infodir='${prefix}/info' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localstatedir='${prefix}/var' +mandir='${prefix}/man' +oldincludedir='/usr/include' +prefix='/usr' +program_transform_name='s,x,x,' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target_alias='' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 +#define HAVE_READDIR_R 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRUCT_STAT64 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_TYPE_OFF64_T 1 +#define HAVE_UNISTD_H 1 +#define HAVE_UNISTD_H 1 +#define PACKAGE_BUGREPORT "" +#define PACKAGE_NAME "xotclgdbm" +#define PACKAGE_STRING "xotclgdbm 1.2" +#define PACKAGE_TARNAME "xotclgdbm" +#define PACKAGE_VERSION "1.2" +#define STDC_HEADERS 1 +#define TCL_THREADS 1 +#define TCL_WIDE_INT_TYPE long long +#define USE_TCL_STUBS 1 +#define USE_THREAD_ALLOC 1 +#define _LARGEFILE64_SOURCE 1 +#define _REENTRANT 1 +#define _THREAD_SAFE 1 + +configure: exit 0 Index: library/store/XOTclGdbm/configure =================================================================== diff -u -N --- library/store/XOTclGdbm/configure (revision 0) +++ library/store/XOTclGdbm/configure (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,11000 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for xotclgdbm 1.2. +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='xotclgdbm' +PACKAGE_TARNAME='xotclgdbm' +PACKAGE_VERSION='1.2' +PACKAGE_STRING='xotclgdbm 1.2' +PACKAGE_BUGREPORT='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures xotclgdbm 1.2 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of xotclgdbm 1.2:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-threads build with threads + --enable-shared build and link with shared libraries (default: on) + --enable-64bit enable 64bit support (default: off) + --enable-64bit-vis enable 64bit Sparc VIS support (default: off) + --enable-wince enable Win/CE support (where applicable) + --enable-load allow dynamic loading and "load" command (default: + on) + --enable-symbols build with debugging symbols (default: off) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gdbm=GDBM_INCLUDE_DIR,GDBM_LIB_DIR + absolute path to gdbm.h and optionally the path to the library, + --without-gdbm disables build of Tcl Gdbm + --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH + absolute path to xotclConfig.sh, + --without-xotcl disables, but this is pointless + --with-tcl directory containing tcl configuration + (tclConfig.sh) + --with-tclinclude directory containing the public Tcl header files + --with-celib=DIR use Windows/CE support library from DIR + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +xotclgdbm configure 1.2 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by xotclgdbm $as_me 1.2, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#-------------------------------------------------------------------- +# 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 extensions pass this us the version of TEA they think they + # are compatible with. + TEA_VERSION="3.6" + + echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 +echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 + if test x"${PACKAGE_NAME}" = x ; then + { { echo "$as_me:$LINENO: error: +The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 +echo "$as_me: error: +The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} + { (exit 1); exit 1; }; } + fi + if test x"3.5" = x ; then + { { echo "$as_me:$LINENO: error: +TEA version not specified." >&5 +echo "$as_me: error: +TEA version not specified." >&2;} + { (exit 1); exit 1; }; } + elif test "3.5" != "${TEA_VERSION}" ; then + echo "$as_me:$LINENO: result: warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&5 +echo "${ECHO_T}warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&6 + else + echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 +echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 + fi + case "`uname -s`" in + *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) + # Extract the first word of "cygpath", so it can be a program name with args. +set dummy cygpath; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CYGPATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CYGPATH"; then + ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CYGPATH="cygpath -w" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" +fi +fi +CYGPATH=$ac_cv_prog_CYGPATH +if test -n "$CYGPATH"; then + echo "$as_me:$LINENO: result: $CYGPATH" >&5 +echo "${ECHO_T}$CYGPATH" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + EXEEXT=".exe" + TEA_PLATFORM="windows" + ;; + *) + CYGPATH=echo + EXEEXT="" + TEA_PLATFORM="unix" + ;; + esac + + # Check if exec_prefix is set. If not use fall back to prefix. + # Note when adjusted, so that TEA_PREFIX can correct for this. + # This is needed for recursive configures, since autoconf propagates + # $prefix, but not $exec_prefix (doh!). + if test x$exec_prefix = xNONE ; then + exec_prefix_default=yes + exec_prefix=$prefix + fi + + + + + # This package name must be replaced statically for AC_SUBST to work + + # Substitute STUB_LIB_FILE in case package creates a stub library too. + + + # We AC_SUBST these here to ensure they are subst'ed, + # in case the user doesn't call TEA_ADD_... + + + + + + + + + +ac_aux_dir= +for ac_dir in ../../../config $srcdir/../../../config; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../../config $srcdir/../../../config" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in ../../../config $srcdir/../../../config" >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + + +#-------------------------------------------------------------------- +# specify some extra flags +#-------------------------------------------------------------------- + +# Check whether --with-gdbm or --without-gdbm was given. +if test "${with_gdbm+set}" = set; then + withval="$with_gdbm" + with_gdbm=$withval +else + with_gdbm=no +fi; + + +# Check whether --with-xotcl or --without-xotcl was given. +if test "${with_xotcl+set}" = set; then + withval="$with_xotcl" + with_xotcl=$withval +else + { { echo "$as_me:$LINENO: error: --with-xotcl is required" >&5 +echo "$as_me: error: --with-xotcl is required" >&2;} + { (exit 1); exit 1; }; } +fi; + +#-------------------------------------------------------------------- +# Load the tclConfig.sh file +#-------------------------------------------------------------------- + + + + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + with_tclconfig=${withval} +fi; + echo "$as_me:$LINENO: checking for Tcl configuration" >&5 +echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 + if test "${ac_cv_c_tclconfig+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case ${with_tclconfig} in + */tclConfig.sh ) + if test -f ${with_tclconfig}; then + { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 +echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} + with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 +echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tcl.framework/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + +fi + + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 +echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} + exit 0 + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 + fi + fi + + + echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 + + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then + echo "$as_me:$LINENO: result: loading" >&5 +echo "${ECHO_T}loading" >&6 + . "${TCL_BIN_DIR}/tclConfig.sh" + else + echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tcl.framework installed in an arbitary location. + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then + for i in "`cd ${TCL_BIN_DIR}; pwd`" \ + "`cd ${TCL_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then + TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" + break + fi + done + fi + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then + TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + + + + + + + + + + + + + + + + + + + +#-------------------------------------------------------------------- +# Load the tkConfig.sh file if necessary (Tk extension) +#-------------------------------------------------------------------- + +#TEA_PATH_TKCONFIG +#TEA_LOAD_TKCONFIG + +#----------------------------------------------------------------------- +# Handle the --prefix=... option by defaulting to what Tcl gave. +# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. +#----------------------------------------------------------------------- + + + if test "${prefix}" = "NONE"; then + prefix_default=yes + if test x"${TCL_PREFIX}" != x; then + { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 +echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} + prefix=${TCL_PREFIX} + else + { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 +echo "$as_me: --prefix defaulting to /usr/local" >&6;} + prefix=/usr/local + fi + fi + if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ + -o x"${exec_prefix_default}" = x"yes" ; then + if test x"${TCL_EXEC_PREFIX}" != x; then + { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 +echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} + exec_prefix=${TCL_EXEC_PREFIX} + else + { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 +echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} + exec_prefix=$prefix + fi + fi + + +#----------------------------------------------------------------------- +# Standard compiler checks. +# This sets up CC by using the CC env var, or looks for gcc otherwise. +# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create +# the basic setup necessary to compile executables. +#----------------------------------------------------------------------- + + + # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) + # in this macro, they need to go into TEA_SETUP_COMPILER instead. + + # If the user did not set CFLAGS, set it now to keep + # the AC_PROG_CC macro from adding "-g -O2". + if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" + fi + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + + #-------------------------------------------------------------------- + # Checks to see if the make program sets the $MAKE variable. + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + + #-------------------------------------------------------------------- + # Find ranlib + #-------------------------------------------------------------------- + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + #-------------------------------------------------------------------- + # Determines the correct binary file extension (.o, .obj, .exe etc.) + #-------------------------------------------------------------------- + + + + + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. + + + #------------------------------------------------------------------------ + # If we're using GCC, see if the compiler understands -pipe. If so, use it. + # It makes compiling go faster. (This is only a performance feature.) + #------------------------------------------------------------------------ + + if test -z "$no_pipe" -a -n "$GCC"; then + echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 +echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 +if test "${tcl_cv_cc_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_pipe=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_pipe=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 +echo "${ECHO_T}$tcl_cv_cc_pipe" >&6 + if test $tcl_cv_cc_pipe = yes; then + CFLAGS="$CFLAGS -pipe" + fi + fi + + #-------------------------------------------------------------------- + # Common compiler flag setup + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + + if test "${TEA_PLATFORM}" = "unix" ; then + + #-------------------------------------------------------------------- + # On a few very rare systems, all of the libm.a stuff is + # already in libc.a. Set compiler flags accordingly. + # Also, Linux requires the "ieee" library for math to work + # right (and it must appear before "-lm"). + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking for sin" >&5 +echo $ECHO_N "checking for sin... $ECHO_C" >&6 +if test "${ac_cv_func_sin+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define sin to an innocuous variant, in case declares sin. + For example, HP-UX 11i declares gettimeofday. */ +#define sin innocuous_sin + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char sin (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef sin + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char sin (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_sin) || defined (__stub___sin) +choke me +#else +char (*f) () = sin; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != sin; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_sin=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_sin=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 +echo "${ECHO_T}$ac_cv_func_sin" >&6 +if test $ac_cv_func_sin = yes; then + MATH_LIBS="" +else + MATH_LIBS="-lm" +fi + + echo "$as_me:$LINENO: checking for main in -lieee" >&5 +echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 +if test "${ac_cv_lib_ieee_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lieee $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ieee_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ieee_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 +echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 +if test $ac_cv_lib_ieee_main = yes; then + MATH_LIBS="-lieee $MATH_LIBS" +fi + + + #-------------------------------------------------------------------- + # Interactive UNIX requires -linet instead of -lsocket, plus it + # needs net/errno.h to define the socket-related error codes. + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking for main in -linet" >&5 +echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 +if test "${ac_cv_lib_inet_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-linet $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_inet_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_inet_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 +echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 +if test $ac_cv_lib_inet_main = yes; then + LIBS="$LIBS -linet" +fi + + if test "${ac_cv_header_net_errno_h+set}" = set; then + echo "$as_me:$LINENO: checking for net/errno.h" >&5 +echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_net_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking net/errno.h usability" >&5 +echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking net/errno.h presence" >&5 +echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclgdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for net/errno.h" >&5 +echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_net_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_net_errno_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 + +fi +if test $ac_cv_header_net_errno_h = yes; then + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NET_ERRNO_H 1 +_ACEOF + +fi + + + + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- + + tcl_checkBoth=0 + echo "$as_me:$LINENO: checking for connect" >&5 +echo $ECHO_N "checking for connect... $ECHO_C" >&6 +if test "${ac_cv_func_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef connect + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_connect) || defined (__stub___connect) +choke me +#else +char (*f) () = connect; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != connect; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_connect=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +echo "${ECHO_T}$ac_cv_func_connect" >&6 +if test $ac_cv_func_connect = yes; then + tcl_checkSocket=0 +else + tcl_checkSocket=1 +fi + + if test "$tcl_checkSocket" = 1; then + echo "$as_me:$LINENO: checking for setsockopt" >&5 +echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 +if test "${ac_cv_func_setsockopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define setsockopt to an innocuous variant, in case declares setsockopt. + For example, HP-UX 11i declares gettimeofday. */ +#define setsockopt innocuous_setsockopt + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char setsockopt (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef setsockopt + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setsockopt (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_setsockopt) || defined (__stub___setsockopt) +choke me +#else +char (*f) () = setsockopt; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != setsockopt; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_setsockopt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_setsockopt=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 +echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 +if test $ac_cv_func_setsockopt = yes; then + : +else + echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 +echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_setsockopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setsockopt (); +int +main () +{ +setsockopt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_setsockopt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_socket_setsockopt=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 +if test $ac_cv_lib_socket_setsockopt = yes; then + LIBS="$LIBS -lsocket" +else + tcl_checkBoth=1 +fi + +fi + + fi + if test "$tcl_checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + echo "$as_me:$LINENO: checking for accept" >&5 +echo $ECHO_N "checking for accept... $ECHO_C" >&6 +if test "${ac_cv_func_accept+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define accept to an innocuous variant, in case declares accept. + For example, HP-UX 11i declares gettimeofday. */ +#define accept innocuous_accept + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char accept (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef accept + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char accept (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_accept) || defined (__stub___accept) +choke me +#else +char (*f) () = accept; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != accept; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_accept=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_accept=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 +echo "${ECHO_T}$ac_cv_func_accept" >&6 +if test $ac_cv_func_accept = yes; then + tcl_checkNsl=0 +else + LIBS=$tk_oldLibs +fi + + fi + echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_func_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef gethostbyname + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +char (*f) () = gethostbyname; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != gethostbyname; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 +if test $ac_cv_func_gethostbyname = yes; then + : +else + echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_nsl_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_nsl_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 +if test $ac_cv_lib_nsl_gethostbyname = yes; then + LIBS="$LIBS -lnsl" +fi + +fi + + + # Don't perform the eval of the libraries here because DL_LIBS + # won't be set until we call TEA_CONFIG_CFLAGS + + TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' + + + + + echo "$as_me:$LINENO: checking dirent.h" >&5 +echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 +if test "${tcl_cv_dirent_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ + +#ifndef _POSIX_SOURCE +# ifdef __Lynx__ + /* + * Generate compilation error to make the test fail: Lynx headers + * are only valid if really in the POSIX environment. + */ + + missing_procedure(); +# endif +#endif +DIR *d; +struct dirent *entryPtr; +char *p; +d = opendir("foobar"); +entryPtr = readdir(d); +p = entryPtr->d_name; +closedir(d); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_dirent_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_dirent_h=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 +echo "${ECHO_T}$tcl_cv_dirent_h" >&6 + + if test $tcl_cv_dirent_h = no; then + +cat >>confdefs.h <<\_ACEOF +#define NO_DIRENT_H 1 +_ACEOF + + fi + + if test "${ac_cv_header_errno_h+set}" = set; then + echo "$as_me:$LINENO: checking for errno.h" >&5 +echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_errno_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking errno.h usability" >&5 +echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking errno.h presence" >&5 +echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclgdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for errno.h" >&5 +echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_errno_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_errno_h" >&6 + +fi +if test $ac_cv_header_errno_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_ERRNO_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_float_h+set}" = set; then + echo "$as_me:$LINENO: checking for float.h" >&5 +echo $ECHO_N "checking for float.h... $ECHO_C" >&6 +if test "${ac_cv_header_float_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 +echo "${ECHO_T}$ac_cv_header_float_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking float.h usability" >&5 +echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking float.h presence" >&5 +echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclgdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for float.h" >&5 +echo $ECHO_N "checking for float.h... $ECHO_C" >&6 +if test "${ac_cv_header_float_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_float_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 +echo "${ECHO_T}$ac_cv_header_float_h" >&6 + +fi +if test $ac_cv_header_float_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_FLOAT_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_values_h+set}" = set; then + echo "$as_me:$LINENO: checking for values.h" >&5 +echo $ECHO_N "checking for values.h... $ECHO_C" >&6 +if test "${ac_cv_header_values_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 +echo "${ECHO_T}$ac_cv_header_values_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking values.h usability" >&5 +echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking values.h presence" >&5 +echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclgdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for values.h" >&5 +echo $ECHO_N "checking for values.h... $ECHO_C" >&6 +if test "${ac_cv_header_values_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_values_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 +echo "${ECHO_T}$ac_cv_header_values_h" >&6 + +fi +if test $ac_cv_header_values_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_VALUES_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_limits_h+set}" = set; then + echo "$as_me:$LINENO: checking for limits.h" >&5 +echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 +if test "${ac_cv_header_limits_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +echo "${ECHO_T}$ac_cv_header_limits_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking limits.h usability" >&5 +echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking limits.h presence" >&5 +echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclgdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for limits.h" >&5 +echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 +if test "${ac_cv_header_limits_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_limits_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +echo "${ECHO_T}$ac_cv_header_limits_h" >&6 + +fi +if test $ac_cv_header_limits_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIMITS_H 1 +_ACEOF + +else + +cat >>confdefs.h <<\_ACEOF +#define NO_LIMITS_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_stdlib_h+set}" = set; then + echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking stdlib.h usability" >&5 +echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking stdlib.h presence" >&5 +echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclgdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_stdlib_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 + +fi +if test $ac_cv_header_stdlib_h = yes; then + tcl_ok=1 +else + tcl_ok=0 +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtol" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtoul" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtod" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + if test $tcl_ok = 0; then + +cat >>confdefs.h <<\_ACEOF +#define NO_STDLIB_H 1 +_ACEOF + + fi + if test "${ac_cv_header_string_h+set}" = set; then + echo "$as_me:$LINENO: checking for string.h" >&5 +echo $ECHO_N "checking for string.h... $ECHO_C" >&6 +if test "${ac_cv_header_string_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +echo "${ECHO_T}$ac_cv_header_string_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking string.h usability" >&5 +echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking string.h presence" >&5 +echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclgdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for string.h" >&5 +echo $ECHO_N "checking for string.h... $ECHO_C" >&6 +if test "${ac_cv_header_string_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_string_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +echo "${ECHO_T}$ac_cv_header_string_h" >&6 + +fi +if test $ac_cv_header_string_h = yes; then + tcl_ok=1 +else + tcl_ok=0 +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strstr" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strerror" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + + # See also memmove check below for a place where NO_STRING_H can be + # set and why. + + if test $tcl_ok = 0; then + +cat >>confdefs.h <<\_ACEOF +#define NO_STRING_H 1 +_ACEOF + + fi + + if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo "$as_me:$LINENO: checking for sys/wait.h" >&5 +echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 +echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 +echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclgdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for sys/wait.h" >&5 +echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_wait_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 + +fi +if test $ac_cv_header_sys_wait_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_SYS_WAIT_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_dlfcn_h+set}" = set; then + echo "$as_me:$LINENO: checking for dlfcn.h" >&5 +echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 +if test "${ac_cv_header_dlfcn_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 +echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 +echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 +echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclgdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for dlfcn.h" >&5 +echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 +if test "${ac_cv_header_dlfcn_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_dlfcn_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 +echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 + +fi +if test $ac_cv_header_dlfcn_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_DLFCN_H 1 +_ACEOF + +fi + + + + # OS/390 lacks sys/param.h (and doesn't need it, by chance). + +for ac_header in sys/param.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclgdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + # Let the user call this, because if it triggers, they will + # need a compat/strtod.c that is correct. Users can also + # use Tcl_GetDouble(FromObj) instead. + #TEA_BUGGY_STRTOD + fi + + +#----------------------------------------------------------------------- +# __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. +#----------------------------------------------------------------------- +if test ! "${with_gdbm}" = no; then + GDBM_INC_DIR="`echo $with_gdbm |cut -f1 -d,`" + GDBM_LIB_DIR="`echo $with_gdbm |cut -f2 -d, -s`" +fi +if test -z "$GDBM_INC_DIR" ; then + gdbm_h_ok=1 + GDBM_INC_SPEC="" +else + GDBM_INC_SPEC="-I${GDBM_INC_DIR}" + echo "Checking ${GDBM_INC_DIR}/gdbm.h" + if test -f "${GDBM_INC_DIR}/gdbm.h" ; then + gdbm_h_ok=1 + else + gdbm_h_ok=0 + fi +fi + +if test "${gdbm_h_ok}" == "0" ; then + { { echo "$as_me:$LINENO: error: + Could not locate gdbm.h on your machine to build XOTclGdbm. + You can download a precompiled lib 'libgdbm' + and the header file 'gdbm.h' from http://www.gnu.org/software/gdbm/ + and compile again. Alternatively, you can compile XOTcl without gdbm. + " >&5 +echo "$as_me: error: + Could not locate gdbm.h on your machine to build XOTclGdbm. + You can download a precompiled lib 'libgdbm' + and the header file 'gdbm.h' from http://www.gnu.org/software/gdbm/ + and compile again. Alternatively, you can compile XOTcl without gdbm. + " >&2;} + { (exit 1); exit 1; }; } +fi + +if test -z "${GDBM_LIB_DIR}" ; then + GDBM_LIB_SPEC="" +else + GDBM_LIB_SPEC="-L${GDBM_LIB_DIR}" +fi + +#echo "Gdbm include spec = '${GDBM_INC_SPEC}'" +#echo "Gdbm lib spec = '${GDBM_LIB_SPEC}'" + +#-------------------------------------------------------------------- +# Load the xotclConfig.sh file +#-------------------------------------------------------------------- + +{ echo "$as_me:$LINENO: Reading file ${with_xotcl}/xotclConfig.sh" >&5 +echo "$as_me: Reading file ${with_xotcl}/xotclConfig.sh" >&6;} +source ${with_xotcl}/xotclConfig.sh + + + vars="xotclgdbm.c" + for i in $vars; do + case $i in + \$*) + # allow $-var names + PKG_SOURCES="$PKG_SOURCES $i" + PKG_OBJECTS="$PKG_OBJECTS $i" + ;; + *) + # check for existence - allows for generic/win/unix VPATH + # To add more dirs here (like 'src'), you have to update VPATH + # in Makefile.in as well + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 +echo "$as_me: error: could not find source file '$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_SOURCES="$PKG_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" + fi + PKG_OBJECTS="$PKG_OBJECTS $j" + ;; + esac + done + + + + + vars="" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 +echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_HEADERS="$PKG_HEADERS $i" + done + + + + vars="-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC} ${GDBM_INC_SPEC}" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + + + + vars="$XOTCL_BUILD_STUB_LIB_SPEC $XOTCL_BUILD_LIB_SPEC $GDBM_LIB_SPEC -lgdbm" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + + PKG_CFLAGS="$PKG_CFLAGS " + + + + vars="" + for i in $vars; do + # check for existence - allows for generic/win/unix VPATH + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 +echo "$as_me: error: could not find stub source file '$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" + fi + PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" + done + + + + + vars="" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 +echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" + done + + + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_sample in this case) so +# that we create the export library with the dll. +# +# 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. +# +# TEA_ADD_* any platform specific compiler/build info here. +#-------------------------------------------------------------------- + +if test "${TEA_PLATFORM}" = "windows" ; then + cat >>confdefs.h <<\_ACEOF +#define BUILD_sample 1 +_ACEOF + + CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" + #TEA_ADD_SOURCES([win/winFile.c]) + #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) +else + CLEANFILES="pkgIndex.tcl" + #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 +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking for Tcl public headers" >&5 +echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 + + +# Check whether --with-tclinclude or --without-tclinclude was given. +if test "${with_tclinclude+set}" = set; then + withval="$with_tclinclude" + with_tclinclude=${withval} +fi; + + if test "${ac_cv_c_tclh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + # Use the value from --with-tclinclude, if it was given + + if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + ac_cv_c_tclh=${with_tclinclude} + else + { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 +echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} + { (exit 1); exit 1; }; } + fi + else + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers directory + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tcl is not installed, + # and in that situation, look there before installed locations. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + if test x"${TCL_INCLUDE_SPEC}" != x ; then + d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` + list="$list `ls -d ${d} 2>/dev/null`" + fi + fi + for i in $list ; do + if test -f "$i/tcl.h" ; then + ac_cv_c_tclh=$i + break + fi + done + fi + +fi + + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tclh}" = x ; then + { { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 +echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} + { (exit 1); exit 1; }; } + else + echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 +echo "${ECHO_T}${ac_cv_c_tclh}" >&6 + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` + + TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + + +#TEA_PRIVATE_TCL_HEADERS + +#TEA_PUBLIC_TK_HEADERS +#TEA_PRIVATE_TK_HEADERS +#TEA_PATH_X + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +#-------------------------------------------------------------------- + + + # Check whether --enable-threads or --disable-threads was given. +if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + + if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then + TCL_THREADS=1 + + if test "${TEA_PLATFORM}" != "windows" ; then + # We are always OK on Windows, so check what this platform wants: + + # USE_THREAD_ALLOC tells us to try the special thread-based + # allocator that significantly reduces lock contention + +cat >>confdefs.h <<\_ACEOF +#define USE_THREAD_ALLOC 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + if test "`uname -s`" = "SunOS" ; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + fi + +cat >>confdefs.h <<\_ACEOF +#define _THREAD_SAFE 1 +_ACEOF + + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 +if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 +echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char __pthread_mutex_init (); +int +main () +{ +__pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread___pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread___pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 +if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 +if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthreads $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthreads_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthreads_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 +if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 +if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_c_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 +if test $ac_cv_lib_c_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 +if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_c_r_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_r_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 +if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -pthread" + else + TCL_THREADS=0 + { echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 +echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} + fi + fi + fi + fi + fi + else + TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + echo "$as_me:$LINENO: checking for building with threads" >&5 +echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 + if test "${TCL_THREADS}" = 1; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_THREADS 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes (default)" >&5 +echo "${ECHO_T}yes (default)" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + # TCL_THREADS sanity checking. See if our request for building with + # threads is the same as the way Tcl was built. If not, warn the user. + case ${TCL_DEFS} in + *THREADS=1*) + if test "${TCL_THREADS}" = "0"; then + { echo "$as_me:$LINENO: WARNING: + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads." >&5 +echo "$as_me: WARNING: + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads." >&2;} + fi + ;; + *) + if test "${TCL_THREADS}" = "1"; then + { echo "$as_me:$LINENO: WARNING: + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core." >&5 +echo "$as_me: WARNING: + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core." >&2;} + fi + ;; + esac + + + +#-------------------------------------------------------------------- +# The statement below defines a collection of symbols related to +# building as a shared library instead of a static library. +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking how to build libraries" >&5 +echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 + # Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + + if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" ; then + echo "$as_me:$LINENO: result: shared" >&5 +echo "${ECHO_T}shared" >&6 + SHARED_BUILD=1 + else + echo "$as_me:$LINENO: result: static" >&5 +echo "${ECHO_T}static" >&6 + SHARED_BUILD=0 + +cat >>confdefs.h <<\_ACEOF +#define STATIC_BUILD 1 +_ACEOF + + fi + + + +#-------------------------------------------------------------------- +# 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. +#-------------------------------------------------------------------- + + + + + # Step 0.a: Enable 64 bit support? + + echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 +echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 + # Check whether --enable-64bit or --disable-64bit was given. +if test "${enable_64bit+set}" = set; then + enableval="$enable_64bit" + do64bit=$enableval +else + do64bit=no +fi; + echo "$as_me:$LINENO: result: $do64bit" >&5 +echo "${ECHO_T}$do64bit" >&6 + + # Step 0.b: Enable Solaris 64 bit VIS support? + + echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 +echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 + # Check whether --enable-64bit-vis or --disable-64bit-vis was given. +if test "${enable_64bit_vis+set}" = set; then + enableval="$enable_64bit_vis" + do64bitVIS=$enableval +else + do64bitVIS=no +fi; + echo "$as_me:$LINENO: result: $do64bitVIS" >&5 +echo "${ECHO_T}$do64bitVIS" >&6 + + if test "$do64bitVIS" = "yes"; then + # Force 64bit on with VIS + do64bit=yes + fi + + # Step 0.c: Cross-compiling options for Windows/CE builds? + + if test "${TEA_PLATFORM}" = "windows" ; then + echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 +echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 + # Check whether --enable-wince or --disable-wince was given. +if test "${enable_wince+set}" = set; then + enableval="$enable_wince" + doWince=$enableval +else + doWince=no +fi; + echo "$as_me:$LINENO: result: $doWince" >&5 +echo "${ECHO_T}$doWince" >&6 + fi + + # Step 1: set the variable "system" to hold the name and version number + # for the system. + + + echo "$as_me:$LINENO: checking system version" >&5 +echo $ECHO_N "checking system version... $ECHO_C" >&6 +if test "${tcl_cv_sys_version+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "${TEA_PLATFORM}" = "windows" ; then + tcl_cv_sys_version=windows + elif test -f /usr/lib/NextStep/software_version; then + tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + tcl_cv_sys_version=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 +echo "$as_me: WARNING: can't find uname command" >&2;} + tcl_cv_sys_version=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi + fi + fi + +fi +echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 +echo "${ECHO_T}$tcl_cv_sys_version" >&6 + system=$tcl_cv_sys_version + + + # Step 2: check for existence of -ldl library. This is needed because + # Linux can use either -ldl or -ldld for dynamic loading. + + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + have_dl=yes +else + have_dl=no +fi + + + # Require ranlib early so we can override it in special cases below. + + + + # Step 3: set configuration options based on system name and version. + # This is similar to Tcl's unix/tcl.m4 except that we've added a + # "windows" case. + + do64bit_ok=no + LDFLAGS_ORIG="$LDFLAGS" + # When ld needs options to work in 64-bit mode, put them in + # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] + # is disabled by the user. [Bug 1016796] + LDFLAGS_ARCH="" + TCL_EXPORT_FILE_SUFFIX="" + UNSHARED_LIB_SUFFIX="" + TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' + ECHO_VERSION='`echo ${PACKAGE_VERSION}`' + TCL_LIB_VERSIONS_OK=ok + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE=-O + if test "$GCC" = "yes" ; then + CFLAGS_OPTIMIZE=-O2 + CFLAGS_WARNING="-Wall -Wno-implicit-int" + else + CFLAGS_WARNING="" + fi + TCL_NEEDS_EXP_FILE=0 + TCL_BUILD_EXP_FILE="" + TCL_EXP_FILE="" + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STLIB_LD='${AR} cr' + LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" + case $system in + windows) + # This is a 2-stage check to make sure we have the 64-bit SDK + # We have to know where the SDK is installed. + # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs + # MACHINE is IX86 for LINK, but this is used by the manifest, + # which requires x86|amd64|ia64. + MACHINE="X86" + if test "$do64bit" != "no" ; then + if test "x${MSSDK}x" = "xx" ; then + MSSDK="C:/Progra~1/Microsoft Platform SDK" + fi + MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` + PATH64="" + case "$do64bit" in + amd64|x64|yes) + MACHINE="AMD64" ; # default to AMD64 64-bit build + PATH64="${MSSDK}/Bin/Win64/x86/AMD64" + ;; + ia64) + MACHINE="IA64" + PATH64="${MSSDK}/Bin/Win64" + ;; + esac + if test ! -d "${PATH64}" ; then + { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 +echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} + { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 +echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} + do64bit="no" + else + echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 +echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 + do64bit_ok="yes" + fi + fi + + if test "$doWince" != "no" ; then + if test "$do64bit" != "no" ; then + { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 +echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} + { (exit 1); exit 1; }; } + fi + if test "$GCC" = "yes" ; then + { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 +echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} + { (exit 1); exit 1; }; } + fi + + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-celib + + if test x"${no_celib}" = x ; then + # we reset no_celib in case something fails here + no_celib=true + +# Check whether --with-celib or --without-celib was given. +if test "${with_celib+set}" = set; then + withval="$with_celib" + with_celibconfig=${withval} +fi; + echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 +echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 + if test "${ac_cv_c_celibconfig+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + # First check to see if --with-celibconfig was specified. + if test x"${with_celibconfig}" != x ; then + if test -d "${with_celibconfig}/inc" ; then + ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` + else + { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 +echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a celib library + if test x"${ac_cv_c_celibconfig}" = x ; then + for i in \ + ../celib-palm-3.0 \ + ../celib \ + ../../celib-palm-3.0 \ + ../../celib \ + `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ + ${srcdir}/../celib-palm-3.0 \ + ${srcdir}/../celib \ + `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ + ; do + if test -d "$i/inc" ; then + ac_cv_c_celibconfig=`(cd $i; pwd)` + break + fi + done + fi + +fi + + if test x"${ac_cv_c_celibconfig}" = x ; then + { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 +echo "$as_me: error: Cannot find celib support library directory" >&2;} + { (exit 1); exit 1; }; } + else + no_celib= + CELIB_DIR=${ac_cv_c_celibconfig} + CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` + echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 +echo "${ECHO_T}found $CELIB_DIR" >&6 + fi + fi + + # Set defaults for common evc4/PPC2003 setup + # Currently Tcl requires 300+, possibly 420+ for sockets + CEVERSION=420; # could be 211 300 301 400 420 ... + TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... + ARCH=ARM; # could be ARM MIPS X86EM ... + PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" + if test "$doWince" != "yes"; then + # If !yes then the user specified something + # Reset ARCH to allow user to skip specifying it + ARCH= + eval `echo $doWince | awk -F, '{ \ + if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ + if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ + if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ + if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ + if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ + }'` + if test "x${ARCH}" = "x" ; then + ARCH=$TARGETCPU; + fi + fi + OSVERSION=WCE$CEVERSION; + if test "x${WCEROOT}" = "x" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" + if test ! -d "${WCEROOT}" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded Tools" + fi + fi + if test "x${SDKROOT}" = "x" ; then + SDKROOT="C:/Program Files/Windows CE Tools" + if test ! -d "${SDKROOT}" ; then + SDKROOT="C:/Windows CE Tools" + fi + fi + WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` + SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` + if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ + -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then + { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 +echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} + { (exit 1); exit 1; }; } + doWince="no" + else + # We could PATH_NOSPACE these, but that's not important, + # as long as we quote them when used. + CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" + if test -d "${CEINCLUDE}/${TARGETCPU}" ; then + CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" + fi + CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" + fi + fi + + if test "$GCC" != "yes" ; then + if test "${SHARED_BUILD}" = "0" ; then + runtime=-MT + else + runtime=-MD + fi + + if test "$do64bit" != "no" ; then + # All this magic is necessary for the Win64 SDK RC1 - hobbs + CC="\"${PATH64}/cl.exe\"" + CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" + RC="\"${MSSDK}/bin/rc.exe\"" + lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + LINKBIN="\"${PATH64}/link.exe\"" + CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + # Avoid 'unresolved external symbol __security_cookie' + # errors, c.f. http://support.microsoft.com/?id=894573 + + vars="bufferoverflowU.lib" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + elif test "$doWince" != "no" ; then + CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" + if test "${TARGETCPU}" = "X86"; then + CC="\"${CEBINROOT}/cl.exe\"" + else + CC="\"${CEBINROOT}/cl${ARCH}.exe\"" + fi + CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" + RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" + arch=`echo ${ARCH} | awk '{print tolower($0)}'` + defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" + if test "${SHARED_BUILD}" = "1" ; then + # Static CE builds require static celib as well + defs="${defs} _DLL" + fi + for i in $defs ; do + +cat >>confdefs.h <<_ACEOF +#define $i 1 +_ACEOF + + done + +cat >>confdefs.h <<_ACEOF +#define _WIN32_WCE $CEVERSION +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define UNDER_CE $CEVERSION +_ACEOF + + CFLAGS_DEBUG="-nologo -Zi -Od" + CFLAGS_OPTIMIZE="-nologo -Ox" + lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` + lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" + LINKBIN="\"${CEBINROOT}/link.exe\"" + + else + RC="rc" + lflags="-nologo" + LINKBIN="link" + CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + fi + fi + + if test "$GCC" = "yes"; then + # mingw gcc mode + RC="windres" + CFLAGS_DEBUG="-g" + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + SHLIB_LD="$CC -shared" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" + LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" + else + SHLIB_LD="${LINKBIN} -dll ${lflags}" + # link -lib only works when -lib is the first arg + STLIB_LD="${LINKBIN} -lib ${lflags}" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' + PATHTYPE=-w + # For information on what debugtype is most useful, see: + # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp + # This essentially turns it all on. + LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" + LDFLAGS_OPTIMIZE="-release" + if test "$doWince" != "no" ; then + LDFLAGS_CONSOLE="-link ${lflags}" + LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} + else + LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" + LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" + fi + fi + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dll" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' + + TCL_LIB_VERSIONS_OK=nodots + # Bogus to avoid getting this turned off + DL_OBJS="tclLoadNone.obj" + ;; + AIX-*) + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then + # AIX requires the _r compiler when gcc isn't being used + case "${CC}" in + *_r) + # ok ... + ;; + *) + CC=${CC}_r + ;; + esac + echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 +echo "${ECHO_T}Using $CC for compiling with threads" >&6 + fi + LIBS="$LIBS -lc" + SHLIB_CFLAGS="" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + DL_OBJS="tclLoadDl.o" + LD_LIBRARY_PATH_VAR="LIBPATH" + + # Check to enable 64-bit flags for compiler/linker on AIX 4+ + if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then + if test "$GCC" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + else + do64bit_ok=yes + CFLAGS="$CFLAGS -q64" + LDFLAGS_ARCH="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + else + SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' + fi + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then + case $LIBOBJS in + "tclLoadAix.$ac_objext" | \ + *" tclLoadAix.$ac_objext" | \ + "tclLoadAix.$ac_objext "* | \ + *" tclLoadAix.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; +esac + + DL_LIBS="-lld" + fi + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 +echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gettimeofday (); +int +main () +{ +gettimeofday (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bsd_gettimeofday=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bsd_gettimeofday=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 +if test $ac_cv_lib_bsd_gettimeofday = yes; then + libbsd=yes +else + libbsd=no +fi + + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + +cat >>confdefs.h <<\_ACEOF +#define USE_DELTA_FOR_TZ 1 +_ACEOF + + fi + ;; + BeOS*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="${CC} -nostart" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + + #----------------------------------------------------------- + # Check for inet_ntoa in -lbind, for BeOS (which also needs + # -lsocket, even if the network functions are in -lnet which + # is always linked to, for compatibility. + #----------------------------------------------------------- + echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 +echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 +if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbind $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inet_ntoa (); +int +main () +{ +inet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bind_inet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bind_inet_ntoa=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 +if test $ac_cv_lib_bind_inet_ntoa = yes; then + LIBS="$LIBS -lbind -lsocket" +fi + + ;; + BSD/OS-2.1*|BSD/OS-3*) + SHLIB_CFLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD="cc -shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + HP-UX-*.11.*) + # Use updated header definitions where possible + +cat >>confdefs.h <<\_ACEOF +#define _XOPEN_SOURCE_EXTENDED 1 +_ACEOF + + # Needed by Tcl, but not most extensions + #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) + #LIBS="$LIBS -lxnet" # Use the XOPEN network library + + if test "`uname -m`" = "ia64" ; then + SHLIB_SUFFIX=".so" + # Use newer C++ library for C++ extensions + #if test "$GCC" != "yes" ; then + # CPPFLAGS="-AA" + #fi + else + SHLIB_SUFFIX=".sl" + fi + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + SHLIB_LD_LIBS='${LIBS}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc + #CFLAGS="$CFLAGS +DAportable" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + hpux_arch=`${CC} -dumpmachine` + case $hpux_arch in + hppa64*) + # 64-bit gcc in use. Fix flags for GNU ld. + do64bit_ok=yes + SHLIB_LD="${CC} -shared" + SHLIB_LD_LIBS='${LIBS}' + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + *) + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + ;; + esac + else + do64bit_ok=yes + CFLAGS="$CFLAGS +DD64" + LDFLAGS_ARCH="+DD64" + fi + fi + ;; + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + SHLIB_SUFFIX=".sl" + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + ;; + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + ;; + IRIX-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mabi=n32" + LDFLAGS="$LDFLAGS -mabi=n32" + else + case $system in + IRIX-6.3) + # Use to build 6.2 compatible binaries on 6.3. + CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" + ;; + *) + CFLAGS="$CFLAGS -n32" + ;; + esac + LDFLAGS="$LDFLAGS -n32" + fi + ;; + IRIX64-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + + # Check to enable 64-bit flags for compiler/linker + + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 +echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} + else + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS_ARCH="-64" + fi + fi + ;; + Linux*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings + # when you inline the string and math operations. Turn this off to + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + if test $do64bit = yes; then + echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_m64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_m64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_m64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 +echo "${ECHO_T}$tcl_cv_cc_m64" >&6 + if test $tcl_cv_cc_m64 = yes; then + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + fi + fi + + # The combo of gcc + glibc has a bug related + # to inlining of functions like strtod(). The + # -fno-builtin flag should address this problem + # but it does not work. The -fno-inline flag + # is kind of overkill but it works. + # Disable inlining only when one of the + # files in compat/*.c is being linked in. + if test x"${USE_COMPAT}" != x ; then + CFLAGS="$CFLAGS -fno-inline" + fi + + ;; + GNU*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + SHLIB_LD="${CC} -shared" + DL_OBJS="" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + ;; + Lynx*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + CFLAGS_OPTIMIZE=-02 + SHLIB_LD="${CC} -shared " + DL_OBJS="tclLoadDl.o" + DL_LIBS="-mshared -ldl" + LD_FLAGS="-Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + ;; + MP-RAS-02*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + MP-RAS-*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,-Bexport" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + NetBSD-*|FreeBSD-[1-2].*) + # NetBSD/SPARC needs -fPIC, -fpic will not do. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + echo "$as_me:$LINENO: checking for ELF" >&5 +echo $ECHO_N "checking for ELF... $ECHO_C" >&6 +if test "${tcl_cv_ld_elf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef __ELF__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + tcl_cv_ld_elf=yes +else + tcl_cv_ld_elf=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 +echo "${ECHO_T}$tcl_cv_ld_elf" >&6 + if test $tcl_cv_ld_elf = yes; then + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + else + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + fi + + # Ancient FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + OpenBSD-*) + # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. + case `machine` in + sparc|sparc64) + SHLIB_CFLAGS="-fPIC";; + *) + SHLIB_CFLAGS="-fpic";; + esac + SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + echo "$as_me:$LINENO: checking for ELF" >&5 +echo $ECHO_N "checking for ELF... $ECHO_C" >&6 +if test "${tcl_cv_ld_elf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef __ELF__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + tcl_cv_ld_elf=yes +else + tcl_cv_ld_elf=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 +echo "${ECHO_T}$tcl_cv_ld_elf" >&6 + if test $tcl_cv_ld_elf = yes; then + LDFLAGS=-Wl,-export-dynamic + else + LDFLAGS="" + fi + + # OpenBSD doesn't do version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "${TCL_THREADS}" = "1" ; then + # The -pthread needs to go in the CFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + case $system in + FreeBSD-3.*) + # FreeBSD-3 doesn't handle version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + TCL_LIB_VERSIONS_OK=nodots + ;; + esac + ;; + Darwin-*) + CFLAGS_OPTIMIZE="-Os" + SHLIB_CFLAGS="-fno-common" + # To avoid discrepancies between what headers configure sees during + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: + CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" + if test $do64bit = yes; then + case `arch` in + ppc) + echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_ppc64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_arch_ppc64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_ppc64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 + if test $tcl_cv_cc_arch_ppc64 = yes; then + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + do64bit_ok=yes + fi;; + i386) + echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_x86_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch x86_64" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_arch_x86_64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_x86_64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 + if test $tcl_cv_cc_arch_x86_64 = yes; then + CFLAGS="$CFLAGS -arch x86_64" + do64bit_ok=yes + fi;; + *) + { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 +echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; + esac + else + # Check for combined 32-bit and 64-bit fat build + echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ + echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ + fat_32_64=yes + fi + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' + echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 +echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_single_module+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_single_module=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_single_module=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 +echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 + if test $tcl_cv_ld_single_module = yes; then + SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + fi + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" + DL_LIBS="" + # Don't use -prebind when building for Mac OS X 10.4 or later only: + test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \ + LDFLAGS="$LDFLAGS -prebind" + LDFLAGS="$LDFLAGS -headerpad_max_install_names" + echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 +echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_search_paths_first+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_search_paths_first=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_search_paths_first=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 +echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 + if test $tcl_cv_ld_search_paths_first = yes; then + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + + # TEA specific: for Tk extensions, remove 64-bit arch flags from + # CFLAGS et al. for combined 32 & 64 bit fat builds as neither + # TkAqua nor TkX11 can be built for 64-bit at present. + test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done + ;; + NEXTSTEP-*) + SHLIB_CFLAGS="" + SHLIB_LD="cc -nostdlib -r" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadNext.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OS/390-*) + CFLAGS_OPTIMIZE="" # Optimizer is buggy + +cat >>confdefs.h <<\_ACEOF +#define _OE_SOCKETS 1 +_ACEOF + + ;; + OSF1-1.0|OSF1-1.1|OSF1-1.2) + # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + SHLIB_CFLAGS="" + # Hack: make package name same as library name + SHLIB_LD='ld -R -export :' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadOSF.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-1.*) + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SHLIB_CFLAGS="-fPIC" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD="ld -shared" + else + SHLIB_LD="ld -non_shared" + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-V*) + # Digital OSF/1 + SHLIB_CFLAGS="" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD='ld -shared -expect_unresolved "*"' + else + SHLIB_LD='ld -non_shared -expect_unresolved "*"' + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mieee" + else + CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" + fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = "1" ; then + CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" + CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + LIBS=`echo $LIBS | sed s/-lpthreads//` + if test "$GCC" = "yes" ; then + LIBS="$LIBS -lpthread -lmach -lexc" + else + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + fi + + ;; + QNX-6*) + # QNX RTP + # This may work for all QNX, but it was only reported for v6. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + # dlopen is in -lc on QNX + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SCO_SV-3.2*) + # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # this test works, since "uname -s" was non-standard in 3.2.4 and + # below. + if test "$GCC" = "yes" ; then + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + else + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + fi + SHLIB_LD="ld -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SINIX*5.4*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SunOS-4*) + SHLIB_CFLAGS="-PIC" + SHLIB_LD="ld" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + + # SunOS can't handle version numbers with dots in them in library + # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it + # requires an extra version number at the end of .so file names. + # So, the library has to have a name like libtcl75.so.1.0 + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + SunOS-5.[0-6]) + # Careful to not let 5.10+ fall into this case + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + + SHLIB_CFLAGS="-KPIC" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + ;; + SunOS-5*) + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + + SHLIB_CFLAGS="-KPIC" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + arch=`isainfo` + if test "$arch" = "sparcv9 sparc" ; then + if test "$GCC" = "yes" ; then + if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} + else + do64bit_ok=yes + CFLAGS="$CFLAGS -m64 -mcpu=v9" + LDFLAGS="$LDFLAGS -m64 -mcpu=v9" + SHLIB_CFLAGS="-fPIC" + fi + else + do64bit_ok=yes + if test "$do64bitVIS" = "yes" ; then + CFLAGS="$CFLAGS -xarch=v9a" + LDFLAGS_ARCH="-xarch=v9a" + else + CFLAGS="$CFLAGS -xarch=v9" + LDFLAGS_ARCH="-xarch=v9" + fi + # Solaris 64 uses this as well + #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" + fi + elif test "$arch" = "amd64 i386" ; then + if test "$GCC" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + else + do64bit_ok=yes + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64" + fi + else + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 +echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} + fi + fi + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "$do64bit_ok" = "yes" ; then + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + fi + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + fi + ;; + UNIX_SV* | UnixWare-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 +echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_Bexport+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-Bexport" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_Bexport=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_Bexport=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 +echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 + if test $tcl_cv_ld_Bexport = yes; then + LDFLAGS="$LDFLAGS -Wl,-Bexport" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + esac + + if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then + { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 +echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} + fi + + + + # Step 4: disable dynamic loading if requested via a command-line switch. + + # Check whether --enable-load or --disable-load was given. +if test "${enable_load+set}" = set; then + enableval="$enable_load" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + if test "$tcl_ok" = "no"; then + DL_OBJS="" + fi + + if test "x$DL_OBJS" != "x" ; then + BUILD_DLTEST="\$(DLTEST_TARGETS)" + else + echo "Can't figure out how to do dynamic loading or shared libraries" + echo "on this system." + SHLIB_CFLAGS="" + SHLIB_LD="" + SHLIB_SUFFIX="" + DL_OBJS="tclLoadNone.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS_ORIG" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + BUILD_DLTEST="" + fi + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" + + # If we're running gcc, then change the C flags for compiling shared + # libraries to the right flags for gcc, instead of those for the + # standard manufacturer compiler. + + if test "$DL_OBJS" != "tclLoadNone.o" ; then + if test "$GCC" = "yes" ; then + case $system in + AIX-*) + ;; + BSD/OS*) + ;; + IRIX*) + ;; + NetBSD-*|FreeBSD-*) + ;; + Darwin-*) + ;; + SCO_SV-3.2*) + ;; + windows) + ;; + *) + SHLIB_CFLAGS="-fPIC" + ;; + esac + fi + fi + + if test "$SHARED_LIB_SUFFIX" = "" ; then + SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' + fi + if test "$UNSHARED_LIB_SUFFIX" = "" ; then + UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' + fi + + + + + + + + + + + + + + + + # These must be called after we do the basic CFLAGS checks and + # verify any possible 64-bit or similar switches are necessary + + echo "$as_me:$LINENO: checking for required early compiler flags" >&5 +echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 + tcl_flags="" + + if test "${tcl_cv_flag__isoc99_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *)strtoll; char *q = (char *)strtoull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__isoc99_source=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _ISOC99_SOURCE 1 +#include +int +main () +{ +char *p = (char *)strtoll; char *q = (char *)strtoull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__isoc99_source=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__isoc99_source=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _ISOC99_SOURCE 1 +_ACEOF + + tcl_flags="$tcl_flags _ISOC99_SOURCE" + fi + + + if test "${tcl_cv_flag__largefile64_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile64_source=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE64_SOURCE 1 +#include +int +main () +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile64_source=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__largefile64_source=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _LARGEFILE64_SOURCE 1 +_ACEOF + + tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" + fi + + + if test "${tcl_cv_flag__largefile_source64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *)open64; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile_source64=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE64 1 +#include +int +main () +{ +char *p = (char *)open64; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile_source64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__largefile_source64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _LARGEFILE_SOURCE64 1 +_ACEOF + + tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" + fi + + if test "x${tcl_flags}" = "x" ; then + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 + else + echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 +echo "${ECHO_T}${tcl_flags}" >&6 + fi + + + echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 +echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 + if test "${tcl_cv_type_64bit+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +__int64 value = (__int64) 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_type_64bit=__int64 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_type_64bit="long long" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +switch (0) { + case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; + } + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_type_64bit=${tcl_type_64bit} +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "${tcl_cv_type_64bit}" = none ; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_WIDE_INT_IS_LONG 1 +_ACEOF + + echo "$as_me:$LINENO: result: using long" >&5 +echo "${ECHO_T}using long" >&6 + elif test "${tcl_cv_type_64bit}" = "__int64" \ + -a "${TEA_PLATFORM}" = "windows" ; then + # We actually want to use the default tcl.h checks in this + # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* + echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 +echo "${ECHO_T}using Tcl header defaults" >&6 + else + +cat >>confdefs.h <<_ACEOF +#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} +_ACEOF + + echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 +echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 + + # Now check for auxiliary declarations + echo "$as_me:$LINENO: checking for struct dirent64" >&5 +echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 +if test "${tcl_cv_struct_dirent64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +struct dirent64 p; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_struct_dirent64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_struct_dirent64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 +echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_DIRENT64 1 +_ACEOF + + fi + + echo "$as_me:$LINENO: checking for struct stat64" >&5 +echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 +if test "${tcl_cv_struct_stat64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +struct stat64 p; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_struct_stat64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_struct_stat64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 +echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_STAT64 1 +_ACEOF + + fi + + + +for ac_func in open64 lseek64 +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + echo "$as_me:$LINENO: checking for off64_t" >&5 +echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 + if test "${tcl_cv_type_off64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +off64_t offset; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_type_off64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_type_off64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_type_off64_t}" = "xyes" && \ + test "x${ac_cv_func_lseek64}" = "xyes" && \ + test "x${ac_cv_func_open64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_TYPE_OFF64_T 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + fi + + + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols option. +#-------------------------------------------------------------------- + + + + echo "$as_me:$LINENO: checking for build with symbols" >&5 +echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 + # Check whether --enable-symbols or --disable-symbols was given. +if test "${enable_symbols+set}" = set; then + enableval="$enable_symbols" + tcl_ok=$enableval +else + tcl_ok=no +fi; + DBGX="" + if test "$tcl_ok" = "no"; then + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + else + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" + if test "$tcl_ok" = "yes"; then + echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 +echo "${ECHO_T}yes (standard debugging)" >&6 + fi + fi + if test "${TEA_PLATFORM}" != "windows" ; then + LDFLAGS_DEFAULT="${LDFLAGS}" + fi + + + + + + if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_MEM_DEBUG 1 +_ACEOF + + fi + + if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then + if test "$tcl_ok" = "all"; then + echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 +echo "${ECHO_T}enabled symbols mem debugging" >&6 + else + echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 +echo "${ECHO_T}enabled $tcl_ok debugging" >&6 + fi + 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. Add Tk too if necessary. +#-------------------------------------------------------------------- + +cat >>confdefs.h <<\_ACEOF +#define USE_TCL_STUBS 1 +_ACEOF + +#AC_DEFINE(USE_TK_STUBS) + +#-------------------------------------------------------------------- +# 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. +#-------------------------------------------------------------------- + + + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then + MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" + MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" + else + MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" + MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" + fi + + if test "${SHARED_BUILD}" = "1" ; then + MAKE_LIB="${MAKE_SHARED_LIB} " + else + MAKE_LIB="${MAKE_STATIC_LIB} " + fi + + #-------------------------------------------------------------------- + # Shared libraries and static libraries have different names. + # Use the double eval to make sure any variables in the suffix is + # substituted. (@@@ Might not be necessary anymore) + #-------------------------------------------------------------------- + + if test "${TEA_PLATFORM}" = "windows" ; then + if test "${SHARED_BUILD}" = "1" ; then + # We force the unresolved linking of symbols that are really in + # the private libraries of Tcl and Tk. + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" + fi + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + else + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + if test "$GCC" = "yes"; then + PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} + fi + # These aren't needed on Windows (either MSVC or gcc) + RANLIB=: + RANLIB_STUB=: + else + RANLIB_STUB="${RANLIB}" + if test "${SHARED_BUILD}" = "1" ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" + fi + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + fi + + # These are escaped so that only CFLAGS is picked up at configure time. + # The other values will be substituted at make time. + CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" + if test "${SHARED_BUILD}" = "1" ; then + CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" + fi + + + + + + + + +#-------------------------------------------------------------------- +# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl +# file during the install process. Don't run the TCLSH_PROG through +# ${CYGPATH} because it's being used directly by make. +# Require that we use a tclsh shell version 8.2 or later since earlier +# versions have bugs in the pkg_mkIndex routine. +# Add WISH as well if this is a Tk extension. +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking for tclsh" >&5 +echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 + if test -f "${TCL_BIN_DIR}/Makefile" ; then + # tclConfig.sh is in Tcl build directory + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="${TCL_BIN_DIR}/tclsh" + fi + else + # tclConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" + fi + list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${TCLSH_PROG}" ; then + REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" + fi + echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 +echo "${ECHO_T}${TCLSH_PROG}" >&6 + + +#TEA_PROG_WISH + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile. +# You may alternatively have a special pkgIndex.tcl.in or other files +# which require substituting th AC variables in. Include these here. +#-------------------------------------------------------------------- + + ac_config_files="$ac_config_files Makefile" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by xotclgdbm $as_me 1.2, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +xotclgdbm config.status 1.2 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@CYGPATH@,$CYGPATH,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t +s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t +s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t +s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t +s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t +s,@PKG_HEADERS@,$PKG_HEADERS,;t t +s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t +s,@PKG_LIBS@,$PKG_LIBS,;t t +s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t +s,@TCL_VERSION@,$TCL_VERSION,;t t +s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t +s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t +s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t +s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t +s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t +s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t +s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t +s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t +s,@TCL_LIBS@,$TCL_LIBS,;t t +s,@TCL_DEFS@,$TCL_DEFS,;t t +s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t +s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t +s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@EGREP@,$EGREP,;t t +s,@MATH_LIBS@,$MATH_LIBS,;t t +s,@PKG_SOURCES@,$PKG_SOURCES,;t t +s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t +s,@CLEANFILES@,$CLEANFILES,;t t +s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t +s,@TCL_THREADS@,$TCL_THREADS,;t t +s,@SHARED_BUILD@,$SHARED_BUILD,;t t +s,@AR@,$AR,;t t +s,@CELIB_DIR@,$CELIB_DIR,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@DL_LIBS@,$DL_LIBS,;t t +s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t +s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t +s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t +s,@STLIB_LD@,$STLIB_LD,;t t +s,@SHLIB_LD@,$SHLIB_LD,;t t +s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t +s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t +s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t +s,@TCL_DBGX@,$TCL_DBGX,;t t +s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t +s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t +s,@MAKE_LIB@,$MAKE_LIB,;t t +s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t +s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t +s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t +s,@RANLIB_STUB@,$RANLIB_STUB,;t t +s,@TCLSH_PROG@,$TCLSH_PROG,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: library/store/XOTclGdbm/configure.in =================================================================== diff -u -N --- library/store/XOTclGdbm/configure.in (revision 0) +++ library/store/XOTclGdbm/configure.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,285 @@ +#!/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. +# +# RCS: @(#) $Id: configure.in,v 1.20 2007/10/12 19:53:32 neumann Exp $ + +#----------------------------------------------------------------------- +# Sample configure.in for Tcl Extensions. The only places you should +# need to modify this file are marked by the string __CHANGE__ +#----------------------------------------------------------------------- + +configdir=$(srcdir)/../../../config + +#----------------------------------------------------------------------- +# __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. +#----------------------------------------------------------------------- + +AC_INIT([xotclgdbm], [1.2]) + +#-------------------------------------------------------------------- +# 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([3.5]) + +AC_CONFIG_AUX_DIR(../../../config) + +#-------------------------------------------------------------------- +# specify some extra flags +#-------------------------------------------------------------------- +AC_ARG_WITH(gdbm, + [ --with-gdbm=GDBM_INCLUDE_DIR[,GDBM_LIB_DIR] + absolute path to gdbm.h and optionally the path to the library, + --without-gdbm disables build of Tcl Gdbm], + [with_gdbm=$withval], [with_gdbm=no]) + +AC_ARG_WITH(xotcl, + [ --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH + absolute path to xotclConfig.sh, + --without-xotcl disables, but this is pointless], + [with_xotcl=$withval], [AC_MSG_ERROR([--with-xotcl is required])]) + +#-------------------------------------------------------------------- +# 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 + +#----------------------------------------------------------------------- +# 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, AC_PROG_INSTALL 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. +#----------------------------------------------------------------------- +if test ! "${with_gdbm}" = no; then + GDBM_INC_DIR="`echo $with_gdbm |cut -f1 -d,`" + GDBM_LIB_DIR="`echo $with_gdbm |cut -f2 -d, -s`" +fi +if test -z "$GDBM_INC_DIR" ; then + gdbm_h_ok=1 + GDBM_INC_SPEC="" +else + GDBM_INC_SPEC="-I${GDBM_INC_DIR}" + echo "Checking ${GDBM_INC_DIR}/gdbm.h" + if test -f "${GDBM_INC_DIR}/gdbm.h" ; then + gdbm_h_ok=1 + else + gdbm_h_ok=0 + fi +fi + +if test "${gdbm_h_ok}" == "0" ; then + AC_MSG_ERROR([ + Could not locate gdbm.h on your machine to build XOTclGdbm. + You can download a precompiled lib 'libgdbm' + and the header file 'gdbm.h' from http://www.gnu.org/software/gdbm/ + and compile again. Alternatively, you can compile XOTcl without gdbm. + ]) +fi + +if test -z "${GDBM_LIB_DIR}" ; then + GDBM_LIB_SPEC="" +else + GDBM_LIB_SPEC="-L${GDBM_LIB_DIR}" +fi + +#echo "Gdbm include spec = '${GDBM_INC_SPEC}'" +#echo "Gdbm lib spec = '${GDBM_LIB_SPEC}'" + +#-------------------------------------------------------------------- +# Load the xotclConfig.sh file +#-------------------------------------------------------------------- + +AC_MSG_NOTICE([Reading file ${with_xotcl}/xotclConfig.sh]) +source ${with_xotcl}/xotclConfig.sh + +TEA_ADD_SOURCES([xotclgdbm.c]) +TEA_ADD_HEADERS([]) +TEA_ADD_INCLUDES([-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC} ${GDBM_INC_SPEC}]) +TEA_ADD_LIBS([$XOTCL_BUILD_STUB_LIB_SPEC $XOTCL_BUILD_LIB_SPEC $GDBM_LIB_SPEC -lgdbm]) +TEA_ADD_CFLAGS([]) +TEA_ADD_STUB_SOURCES([]) +TEA_ADD_TCL_SOURCES([]) + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_sample in this case) so +# that we create the export library with the dll. +# +# 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. +# +# TEA_ADD_* any platform specific compiler/build info here. +#-------------------------------------------------------------------- + +if test "${TEA_PLATFORM}" = "windows" ; then + AC_DEFINE(BUILD_sample) + CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" + #TEA_ADD_SOURCES([win/winFile.c]) + #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) +else + CLEANFILES="pkgIndex.tcl" + #TEA_ADD_SOURCES([unix/unixFile.c]) + #TEA_ADD_LIBS([-lsuperfly]) +fi +AC_SUBST(CLEANFILES) + +#-------------------------------------------------------------------- +# __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 + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +#-------------------------------------------------------------------- + +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 + +#-------------------------------------------------------------------- +# 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. Add Tk too if necessary. +#-------------------------------------------------------------------- + +AC_DEFINE(USE_TCL_STUBS) +#AC_DEFINE(USE_TK_STUBS) + +#-------------------------------------------------------------------- +# 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 + +#-------------------------------------------------------------------- +# 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. +# Add WISH as well if this is a Tk extension. +#-------------------------------------------------------------------- + +TEA_PROG_TCLSH +#TEA_PROG_WISH + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile. +# You may alternatively have a special pkgIndex.tcl.in or other files +# which require substituting th AC variables in. Include these here. +#-------------------------------------------------------------------- + +AC_CONFIG_FILES([Makefile]) + +AC_OUTPUT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: library/store/XOTclGdbm/tcl.m4 =================================================================== diff -u -N --- library/store/XOTclGdbm/tcl.m4 (revision 0) +++ library/store/XOTclGdbm/tcl.m4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,4041 @@ +# tcl.m4 -- +# +# This file provides a set of autoconf macros to help TEA-enable +# a Tcl extension. +# +# Copyright (c) 1999-2000 Ajuba Solutions. +# 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: tcl.m4,v 1.2 2007/10/12 19:53:32 neumann Exp $ + +AC_PREREQ(2.57) + +dnl TEA extensions pass us the version of TEA they think they +dnl are compatible with (must be set in TEA_INIT below) +dnl TEA_VERSION="3.6" + +# Possible values for key variables defined: +# +# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') +# TEA_PLATFORM - windows unix +# + +#------------------------------------------------------------------------ +# TEA_PATH_TCLCONFIG -- +# +# Locate the tclConfig.sh file and perform a sanity check on +# the Tcl compile flags +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-tcl=... +# +# Defines the following vars: +# TCL_BIN_DIR Full path to the directory containing +# the tclConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_TCLCONFIG], [ + dnl Make sure we are initialized + AC_REQUIRE([TEA_INIT]) + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + AC_ARG_WITH(tcl, + AC_HELP_STRING([--with-tcl], + [directory containing tcl configuration (tclConfig.sh)]), + with_tclconfig=${withval}) + AC_MSG_CHECKING([for Tcl configuration]) + AC_CACHE_VAL(ac_cv_c_tclconfig,[ + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case ${with_tclconfig} in + */tclConfig.sh ) + if test -f ${with_tclconfig}; then + AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) + with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tcl.framework/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + AC_MSG_WARN([Can't find Tcl configuration definitions]) + exit 0 + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_PATH_TKCONFIG -- +# +# Locate the tkConfig.sh file +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-tk=... +# +# Defines the following vars: +# TK_BIN_DIR Full path to the directory containing +# the tkConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_TKCONFIG], [ + # + # Ok, lets find the tk configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tk + # + + if test x"${no_tk}" = x ; then + # we reset no_tk in case something fails here + no_tk=true + AC_ARG_WITH(tk, + AC_HELP_STRING([--with-tk], + [directory containing tk configuration (tkConfig.sh)]), + with_tkconfig=${withval}) + AC_MSG_CHECKING([for Tk configuration]) + AC_CACHE_VAL(ac_cv_c_tkconfig,[ + + # First check to see if --with-tkconfig was specified. + if test x"${with_tkconfig}" != x ; then + case ${with_tkconfig} in + */tkConfig.sh ) + if test -f ${with_tkconfig}; then + AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) + with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tkconfig}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` + else + AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) + fi + fi + + # then check for a private Tk library + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ../tk \ + `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../tk \ + `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../../tk \ + `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tk.framework/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_tkconfig}" = x ; then + TK_BIN_DIR="# no Tk configs found" + AC_MSG_WARN([Can't find Tk configuration definitions]) + exit 0 + else + no_tk= + TK_BIN_DIR=${ac_cv_c_tkconfig} + AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_TCLCONFIG -- +# +# Load the tclConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# TCL_BIN_DIR +# +# Results: +# +# Subst the following vars: +# TCL_BIN_DIR +# TCL_SRC_DIR +# TCL_LIB_FILE +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_TCLCONFIG], [ + AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) + + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then + AC_MSG_RESULT([loading]) + . "${TCL_BIN_DIR}/tclConfig.sh" + else + AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tcl.framework installed in an arbitary location. + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then + for i in "`cd ${TCL_BIN_DIR}; pwd`" \ + "`cd ${TCL_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then + TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" + break + fi + done + fi + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then + TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + AC_SUBST(TCL_VERSION) + AC_SUBST(TCL_BIN_DIR) + AC_SUBST(TCL_SRC_DIR) + + AC_SUBST(TCL_LIB_FILE) + AC_SUBST(TCL_LIB_FLAG) + AC_SUBST(TCL_LIB_SPEC) + + AC_SUBST(TCL_STUB_LIB_FILE) + AC_SUBST(TCL_STUB_LIB_FLAG) + AC_SUBST(TCL_STUB_LIB_SPEC) + + AC_SUBST(TCL_LIBS) + AC_SUBST(TCL_DEFS) + AC_SUBST(TCL_EXTRA_CFLAGS) + AC_SUBST(TCL_LD_FLAGS) + AC_SUBST(TCL_SHLIB_LD_LIBS) +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_TKCONFIG -- +# +# Load the tkConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# TK_BIN_DIR +# +# Results: +# +# Sets the following vars that should be in tkConfig.sh: +# TK_BIN_DIR +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_TKCONFIG], [ + AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) + + if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then + AC_MSG_RESULT([loading]) + . "${TK_BIN_DIR}/tkConfig.sh" + else + AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" + eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" + + # If the TK_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TK_LIB_SPEC will be set to the value + # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC + # instead of TK_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TK_BIN_DIR}/Makefile" ; then + TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} + TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} + TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tk.framework installed in an arbitary location. + case ${TK_DEFS} in + *TK_FRAMEWORK*) + if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then + for i in "`cd ${TK_BIN_DIR}; pwd`" \ + "`cd ${TK_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then + TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" + break + fi + done + fi + if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then + TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" + TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" + eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" + eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" + eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" + + # Ensure windowingsystem is defined + if test "${TEA_PLATFORM}" = "unix" ; then + case ${TK_DEFS} in + *MAC_OSX_TK*) + AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) + TEA_WINDOWINGSYSTEM="aqua" + ;; + *) + TEA_WINDOWINGSYSTEM="x11" + ;; + esac + elif test "${TEA_PLATFORM}" = "windows" ; then + TEA_WINDOWINGSYSTEM="win32" + fi + + AC_SUBST(TK_VERSION) + AC_SUBST(TK_BIN_DIR) + AC_SUBST(TK_SRC_DIR) + + AC_SUBST(TK_LIB_FILE) + AC_SUBST(TK_LIB_FLAG) + AC_SUBST(TK_LIB_SPEC) + + AC_SUBST(TK_STUB_LIB_FILE) + AC_SUBST(TK_STUB_LIB_FLAG) + AC_SUBST(TK_STUB_LIB_SPEC) + + AC_SUBST(TK_LIBS) + AC_SUBST(TK_XINCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_SHARED -- +# +# Allows the building of shared libraries +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-shared=yes|no +# +# Defines the following vars: +# STATIC_BUILD Used for building import/export libraries +# on Windows. +# +# Sets the following vars: +# SHARED_BUILD Value of 1 or 0 +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_SHARED], [ + AC_MSG_CHECKING([how to build libraries]) + AC_ARG_ENABLE(shared, + AC_HELP_STRING([--enable-shared], + [build and link with shared libraries (default: on)]), + [tcl_ok=$enableval], [tcl_ok=yes]) + + if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" ; then + AC_MSG_RESULT([shared]) + SHARED_BUILD=1 + else + AC_MSG_RESULT([static]) + SHARED_BUILD=0 + AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) + fi + AC_SUBST(SHARED_BUILD) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_THREADS -- +# +# Specify if thread support should be enabled. If "yes" is specified +# as an arg (optional), threads are enabled by default, "no" means +# threads are disabled. "yes" is the default. +# +# TCL_THREADS is checked so that if you are compiling an extension +# against a threaded core, your extension must be compiled threaded +# as well. +# +# Note that it is legal to have a thread enabled extension run in a +# threaded or non-threaded Tcl core, but a non-threaded extension may +# only run in a non-threaded Tcl core. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-threads +# +# Sets the following vars: +# THREADS_LIBS Thread library(s) +# +# Defines the following vars: +# TCL_THREADS +# _REENTRANT +# _THREAD_SAFE +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_THREADS], [ + AC_ARG_ENABLE(threads, + AC_HELP_STRING([--enable-threads], + [build with threads]), + [tcl_ok=$enableval], [tcl_ok=yes]) + + if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then + TCL_THREADS=1 + + if test "${TEA_PLATFORM}" != "windows" ; then + # We are always OK on Windows, so check what this platform wants: + + # USE_THREAD_ALLOC tells us to try the special thread-based + # allocator that significantly reduces lock contention + AC_DEFINE(USE_THREAD_ALLOC, 1, + [Do we want to use the threaded memory allocator?]) + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + if test "`uname -s`" = "SunOS" ; then + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + fi + AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) + AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + AC_CHECK_LIB(pthread, __pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + AC_CHECK_LIB(pthreads, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + AC_CHECK_LIB(c, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "no"; then + AC_CHECK_LIB(c_r, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -pthread" + else + TCL_THREADS=0 + AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) + fi + fi + fi + fi + fi + else + TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + AC_MSG_CHECKING([for building with threads]) + if test "${TCL_THREADS}" = 1; then + AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) + AC_MSG_RESULT([yes (default)]) + else + AC_MSG_RESULT([no]) + fi + # TCL_THREADS sanity checking. See if our request for building with + # threads is the same as the way Tcl was built. If not, warn the user. + case ${TCL_DEFS} in + *THREADS=1*) + if test "${TCL_THREADS}" = "0"; then + AC_MSG_WARN([ + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads.]) + fi + ;; + *) + if test "${TCL_THREADS}" = "1"; then + AC_MSG_WARN([ + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core.]) + fi + ;; + esac + AC_SUBST(TCL_THREADS) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_SYMBOLS -- +# +# Specify if debugging symbols should be used. +# Memory (TCL_MEM_DEBUG) debugging can also be enabled. +# +# Arguments: +# none +# +# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives +# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. +# Requires the following vars to be set in the Makefile: +# CFLAGS_DEFAULT +# LDFLAGS_DEFAULT +# +# Results: +# +# Adds the following arguments to configure: +# --enable-symbols +# +# Defines the following vars: +# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true +# Sets to $(CFLAGS_OPTIMIZE) if false +# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true +# Sets to $(LDFLAGS_OPTIMIZE) if false +# DBGX Formerly used as debug library extension; +# always blank now. +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_SYMBOLS], [ + dnl Make sure we are initialized + AC_REQUIRE([TEA_CONFIG_CFLAGS]) + AC_MSG_CHECKING([for build with symbols]) + AC_ARG_ENABLE(symbols, + AC_HELP_STRING([--enable-symbols], + [build with debugging symbols (default: off)]), + [tcl_ok=$enableval], [tcl_ok=no]) + DBGX="" + if test "$tcl_ok" = "no"; then + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" + AC_MSG_RESULT([no]) + else + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" + if test "$tcl_ok" = "yes"; then + AC_MSG_RESULT([yes (standard debugging)]) + fi + fi + if test "${TEA_PLATFORM}" != "windows" ; then + LDFLAGS_DEFAULT="${LDFLAGS}" + fi + + AC_SUBST(TCL_DBGX) + AC_SUBST(CFLAGS_DEFAULT) + AC_SUBST(LDFLAGS_DEFAULT) + + if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then + AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) + fi + + if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then + if test "$tcl_ok" = "all"; then + AC_MSG_RESULT([enabled symbols mem debugging]) + else + AC_MSG_RESULT([enabled $tcl_ok debugging]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_LANGINFO -- +# +# Allows use of modern nl_langinfo check for better l10n. +# This is only relevant for Unix. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-langinfo=yes|no (default is yes) +# +# Defines the following vars: +# HAVE_LANGINFO Triggers use of nl_langinfo if defined. +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_LANGINFO], [ + AC_ARG_ENABLE(langinfo, + AC_HELP_STRING([--enable-langinfo], + [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), + [langinfo_ok=$enableval], [langinfo_ok=yes]) + + HAVE_LANGINFO=0 + if test "$langinfo_ok" = "yes"; then + AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) + fi + AC_MSG_CHECKING([whether to use nl_langinfo]) + if test "$langinfo_ok" = "yes"; then + AC_CACHE_VAL(tcl_cv_langinfo_h, [ + AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], + [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) + AC_MSG_RESULT([$tcl_cv_langinfo_h]) + if test $tcl_cv_langinfo_h = yes; then + AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) + fi + else + AC_MSG_RESULT([$langinfo_ok]) + fi +]) + +#-------------------------------------------------------------------- +# TEA_CONFIG_SYSTEM +# +# Determine what the system is (some things cannot be easily checked +# on a feature-driven basis, alas). This can usually be done via the +# "uname" command, but there are a few systems, like Next, where +# this doesn't work. +# +# Arguments: +# none +# +# Results: +# Defines the following var: +# +# system - System/platform/version identification code. +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_CONFIG_SYSTEM], [ + AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ + if test "${TEA_PLATFORM}" = "windows" ; then + tcl_cv_sys_version=windows + elif test -f /usr/lib/NextStep/software_version; then + tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + tcl_cv_sys_version=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + AC_MSG_WARN([can't find uname command]) + tcl_cv_sys_version=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi + fi + fi + ]) + system=$tcl_cv_sys_version +]) + +#-------------------------------------------------------------------- +# TEA_CONFIG_CFLAGS +# +# Try to determine the proper flags to pass to the compiler +# for building shared libraries and other such nonsense. +# +# Arguments: +# none +# +# Results: +# +# Defines and substitutes the following vars: +# +# DL_OBJS - Name of the object file that implements dynamic +# loading for Tcl on this system. +# DL_LIBS - Library file(s) to include in tclsh and other base +# applications in order for the "load" command to work. +# LDFLAGS - Flags to pass to the compiler when linking object +# files into an executable application binary such +# as tclsh. +# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", +# that tell the run-time dynamic linker where to look +# for shared libraries such as libtcl.so. Depends on +# the variable LIB_RUNTIME_DIR in the Makefile. Could +# be the same as CC_SEARCH_FLAGS if ${CC} is used to link. +# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", +# that tell the run-time dynamic linker where to look +# for shared libraries such as libtcl.so. Depends on +# the variable LIB_RUNTIME_DIR in the Makefile. +# SHLIB_CFLAGS - Flags to pass to cc when compiling the components +# of a shared library (may request position-independent +# code, among other things). +# SHLIB_LD - Base command to use for combining object files +# into a shared library. +# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when +# creating shared libraries. This symbol typically +# goes at the end of the "ld" commands that build +# shared libraries. The value of the symbol is +# "${LIBS}" if all of the dependent libraries should +# be specified when creating a shared library. If +# dependent libraries should not be specified (as on +# SunOS 4.x, where they cause the link to fail, or in +# general if Tcl and Tk aren't themselves shared +# libraries), then this symbol has an empty string +# as its value. +# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable +# extensions. An empty string means we don't know how +# to use shared libraries on this platform. +# LIB_SUFFIX - Specifies everything that comes after the "libfoo" +# in a static or shared library name, using the $VERSION variable +# to put the version in the right place. This is used +# by platforms that need non-standard library names. +# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs +# to have a version after the .so, and ${VERSION}.a +# on AIX, since a shared library needs to have +# a .a extension whereas shared objects for loadable +# extensions have a .so extension. Defaults to +# ${VERSION}${SHLIB_SUFFIX}. +# TCL_NEEDS_EXP_FILE - +# 1 means that an export file is needed to link to a +# shared library. +# TCL_EXP_FILE - The name of the installed export / import file which +# should be used to link to the Tcl shared library. +# Empty if Tcl is unshared. +# TCL_BUILD_EXP_FILE - +# The name of the built export / import file which +# should be used to link to the Tcl shared library. +# Empty if Tcl is unshared. +# CFLAGS_DEBUG - +# Flags used when running the compiler in debug mode +# CFLAGS_OPTIMIZE - +# Flags used when running the compiler in optimize mode +# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_CONFIG_CFLAGS], [ + dnl Make sure we are initialized + AC_REQUIRE([TEA_INIT]) + + # Step 0.a: Enable 64 bit support? + + AC_MSG_CHECKING([if 64bit support is requested]) + AC_ARG_ENABLE(64bit, + AC_HELP_STRING([--enable-64bit], + [enable 64bit support (default: off)]), + [do64bit=$enableval], [do64bit=no]) + AC_MSG_RESULT([$do64bit]) + + # Step 0.b: Enable Solaris 64 bit VIS support? + + AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) + AC_ARG_ENABLE(64bit-vis, + AC_HELP_STRING([--enable-64bit-vis], + [enable 64bit Sparc VIS support (default: off)]), + [do64bitVIS=$enableval], [do64bitVIS=no]) + AC_MSG_RESULT([$do64bitVIS]) + + if test "$do64bitVIS" = "yes"; then + # Force 64bit on with VIS + do64bit=yes + fi + + # Step 0.c: Cross-compiling options for Windows/CE builds? + + if test "${TEA_PLATFORM}" = "windows" ; then + AC_MSG_CHECKING([if Windows/CE build is requested]) + AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) + AC_MSG_RESULT([$doWince]) + fi + + # Step 1: set the variable "system" to hold the name and version number + # for the system. + + TEA_CONFIG_SYSTEM + + # Step 2: check for existence of -ldl library. This is needed because + # Linux can use either -ldl or -ldld for dynamic loading. + + AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) + + # Require ranlib early so we can override it in special cases below. + + AC_REQUIRE([AC_PROG_RANLIB]) + + # Step 3: set configuration options based on system name and version. + # This is similar to Tcl's unix/tcl.m4 except that we've added a + # "windows" case. + + do64bit_ok=no + LDFLAGS_ORIG="$LDFLAGS" + # When ld needs options to work in 64-bit mode, put them in + # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] + # is disabled by the user. [Bug 1016796] + LDFLAGS_ARCH="" + TCL_EXPORT_FILE_SUFFIX="" + UNSHARED_LIB_SUFFIX="" + TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' + ECHO_VERSION='`echo ${PACKAGE_VERSION}`' + TCL_LIB_VERSIONS_OK=ok + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE=-O + if test "$GCC" = "yes" ; then + CFLAGS_OPTIMIZE=-O2 + CFLAGS_WARNING="-Wall -Wno-implicit-int" + else + CFLAGS_WARNING="" + fi + TCL_NEEDS_EXP_FILE=0 + TCL_BUILD_EXP_FILE="" + TCL_EXP_FILE="" +dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. +dnl AC_CHECK_TOOL(AR, ar) + AC_CHECK_PROG(AR, ar, ar) + STLIB_LD='${AR} cr' + LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" + case $system in + windows) + # This is a 2-stage check to make sure we have the 64-bit SDK + # We have to know where the SDK is installed. + # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs + # MACHINE is IX86 for LINK, but this is used by the manifest, + # which requires x86|amd64|ia64. + MACHINE="X86" + if test "$do64bit" != "no" ; then + if test "x${MSSDK}x" = "xx" ; then + MSSDK="C:/Progra~1/Microsoft Platform SDK" + fi + MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` + PATH64="" + case "$do64bit" in + amd64|x64|yes) + MACHINE="AMD64" ; # default to AMD64 64-bit build + PATH64="${MSSDK}/Bin/Win64/x86/AMD64" + ;; + ia64) + MACHINE="IA64" + PATH64="${MSSDK}/Bin/Win64" + ;; + esac + if test ! -d "${PATH64}" ; then + AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) + AC_MSG_WARN([Ensure latest Platform SDK is installed]) + do64bit="no" + else + AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) + do64bit_ok="yes" + fi + fi + + if test "$doWince" != "no" ; then + if test "$do64bit" != "no" ; then + AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) + fi + if test "$GCC" = "yes" ; then + AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) + fi + TEA_PATH_CELIB + # Set defaults for common evc4/PPC2003 setup + # Currently Tcl requires 300+, possibly 420+ for sockets + CEVERSION=420; # could be 211 300 301 400 420 ... + TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... + ARCH=ARM; # could be ARM MIPS X86EM ... + PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" + if test "$doWince" != "yes"; then + # If !yes then the user specified something + # Reset ARCH to allow user to skip specifying it + ARCH= + eval `echo $doWince | awk -F, '{ \ + if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ + if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ + if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ + if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ + if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ + }'` + if test "x${ARCH}" = "x" ; then + ARCH=$TARGETCPU; + fi + fi + OSVERSION=WCE$CEVERSION; + if test "x${WCEROOT}" = "x" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" + if test ! -d "${WCEROOT}" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded Tools" + fi + fi + if test "x${SDKROOT}" = "x" ; then + SDKROOT="C:/Program Files/Windows CE Tools" + if test ! -d "${SDKROOT}" ; then + SDKROOT="C:/Windows CE Tools" + fi + fi + WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` + SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` + if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ + -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then + AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) + doWince="no" + else + # We could PATH_NOSPACE these, but that's not important, + # as long as we quote them when used. + CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" + if test -d "${CEINCLUDE}/${TARGETCPU}" ; then + CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" + fi + CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" + fi + fi + + if test "$GCC" != "yes" ; then + if test "${SHARED_BUILD}" = "0" ; then + runtime=-MT + else + runtime=-MD + fi + + if test "$do64bit" != "no" ; then + # All this magic is necessary for the Win64 SDK RC1 - hobbs + CC="\"${PATH64}/cl.exe\"" + CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" + RC="\"${MSSDK}/bin/rc.exe\"" + lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + LINKBIN="\"${PATH64}/link.exe\"" + CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + # Avoid 'unresolved external symbol __security_cookie' + # errors, c.f. http://support.microsoft.com/?id=894573 + TEA_ADD_LIBS([bufferoverflowU.lib]) + elif test "$doWince" != "no" ; then + CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" + if test "${TARGETCPU}" = "X86"; then + CC="\"${CEBINROOT}/cl.exe\"" + else + CC="\"${CEBINROOT}/cl${ARCH}.exe\"" + fi + CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" + RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" + arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` + defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" + if test "${SHARED_BUILD}" = "1" ; then + # Static CE builds require static celib as well + defs="${defs} _DLL" + fi + for i in $defs ; do + AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) + done + AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) + AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) + CFLAGS_DEBUG="-nologo -Zi -Od" + CFLAGS_OPTIMIZE="-nologo -Ox" + lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` + lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" + LINKBIN="\"${CEBINROOT}/link.exe\"" + AC_SUBST(CELIB_DIR) + else + RC="rc" + lflags="-nologo" + LINKBIN="link" + CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + fi + fi + + if test "$GCC" = "yes"; then + # mingw gcc mode + RC="windres" + CFLAGS_DEBUG="-g" + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + SHLIB_LD="$CC -shared" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" + LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" + else + SHLIB_LD="${LINKBIN} -dll ${lflags}" + # link -lib only works when -lib is the first arg + STLIB_LD="${LINKBIN} -lib ${lflags}" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' + PATHTYPE=-w + # For information on what debugtype is most useful, see: + # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp + # This essentially turns it all on. + LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" + LDFLAGS_OPTIMIZE="-release" + if test "$doWince" != "no" ; then + LDFLAGS_CONSOLE="-link ${lflags}" + LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} + else + LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" + LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" + fi + fi + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dll" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' + + TCL_LIB_VERSIONS_OK=nodots + # Bogus to avoid getting this turned off + DL_OBJS="tclLoadNone.obj" + ;; + AIX-*) + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then + # AIX requires the _r compiler when gcc isn't being used + case "${CC}" in + *_r) + # ok ... + ;; + *) + CC=${CC}_r + ;; + esac + AC_MSG_RESULT([Using $CC for compiling with threads]) + fi + LIBS="$LIBS -lc" + SHLIB_CFLAGS="" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + DL_OBJS="tclLoadDl.o" + LD_LIBRARY_PATH_VAR="LIBPATH" + + # Check to enable 64-bit flags for compiler/linker on AIX 4+ + if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + else + do64bit_ok=yes + CFLAGS="$CFLAGS -q64" + LDFLAGS_ARCH="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + else + SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' + fi + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then + AC_LIBOBJ([tclLoadAix]) + DL_LIBS="-lld" + fi + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) + fi + ;; + BeOS*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="${CC} -nostart" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + + #----------------------------------------------------------- + # Check for inet_ntoa in -lbind, for BeOS (which also needs + # -lsocket, even if the network functions are in -lnet which + # is always linked to, for compatibility. + #----------------------------------------------------------- + AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) + ;; + BSD/OS-2.1*|BSD/OS-3*) + SHLIB_CFLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD="cc -shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + HP-UX-*.11.*) + # Use updated header definitions where possible + AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) + # Needed by Tcl, but not most extensions + #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) + #LIBS="$LIBS -lxnet" # Use the XOPEN network library + + if test "`uname -m`" = "ia64" ; then + SHLIB_SUFFIX=".so" + # Use newer C++ library for C++ extensions + #if test "$GCC" != "yes" ; then + # CPPFLAGS="-AA" + #fi + else + SHLIB_SUFFIX=".sl" + fi + AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + SHLIB_LD_LIBS='${LIBS}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc + #CFLAGS="$CFLAGS +DAportable" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + hpux_arch=`${CC} -dumpmachine` + case $hpux_arch in + hppa64*) + # 64-bit gcc in use. Fix flags for GNU ld. + do64bit_ok=yes + SHLIB_LD="${CC} -shared" + SHLIB_LD_LIBS='${LIBS}' + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + *) + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + ;; + esac + else + do64bit_ok=yes + CFLAGS="$CFLAGS +DD64" + LDFLAGS_ARCH="+DD64" + fi + fi + ;; + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + SHLIB_SUFFIX=".sl" + AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + ;; + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + ;; + IRIX-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mabi=n32" + LDFLAGS="$LDFLAGS -mabi=n32" + else + case $system in + IRIX-6.3) + # Use to build 6.2 compatible binaries on 6.3. + CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" + ;; + *) + CFLAGS="$CFLAGS -n32" + ;; + esac + LDFLAGS="$LDFLAGS -n32" + fi + ;; + IRIX64-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + + # Check to enable 64-bit flags for compiler/linker + + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN([64bit mode not supported by gcc]) + else + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS_ARCH="-64" + fi + fi + ;; + Linux*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings + # when you inline the string and math operations. Turn this off to + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + if test $do64bit = yes; then + AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_m64 = yes; then + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + fi + fi + + # The combo of gcc + glibc has a bug related + # to inlining of functions like strtod(). The + # -fno-builtin flag should address this problem + # but it does not work. The -fno-inline flag + # is kind of overkill but it works. + # Disable inlining only when one of the + # files in compat/*.c is being linked in. + if test x"${USE_COMPAT}" != x ; then + CFLAGS="$CFLAGS -fno-inline" + fi + + ;; + GNU*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + SHLIB_LD="${CC} -shared" + DL_OBJS="" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + ;; + Lynx*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + CFLAGS_OPTIMIZE=-02 + SHLIB_LD="${CC} -shared " + DL_OBJS="tclLoadDl.o" + DL_LIBS="-mshared -ldl" + LD_FLAGS="-Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + ;; + MP-RAS-02*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + MP-RAS-*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,-Bexport" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + NetBSD-*|FreeBSD-[[1-2]].*) + # NetBSD/SPARC needs -fPIC, -fpic will not do. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ + AC_EGREP_CPP(yes, [ +#ifdef __ELF__ + yes +#endif + ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) + if test $tcl_cv_ld_elf = yes; then + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + else + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + fi + + # Ancient FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + OpenBSD-*) + # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. + case `machine` in + sparc|sparc64) + SHLIB_CFLAGS="-fPIC";; + *) + SHLIB_CFLAGS="-fpic";; + esac + SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ + AC_EGREP_CPP(yes, [ +#ifdef __ELF__ + yes +#endif + ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) + if test $tcl_cv_ld_elf = yes; then + LDFLAGS=-Wl,-export-dynamic + else + LDFLAGS="" + fi + + # OpenBSD doesn't do version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "${TCL_THREADS}" = "1" ; then + # The -pthread needs to go in the CFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + case $system in + FreeBSD-3.*) + # FreeBSD-3 doesn't handle version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + TCL_LIB_VERSIONS_OK=nodots + ;; + esac + ;; + Darwin-*) + CFLAGS_OPTIMIZE="-Os" + SHLIB_CFLAGS="-fno-common" + # To avoid discrepancies between what headers configure sees during + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: + CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" + if test $do64bit = yes; then + case `arch` in + ppc) + AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], + tcl_cv_cc_arch_ppc64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes, + tcl_cv_cc_arch_ppc64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_arch_ppc64 = yes; then + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + do64bit_ok=yes + fi;; + i386) + AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], + tcl_cv_cc_arch_x86_64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch x86_64" + AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes, + tcl_cv_cc_arch_x86_64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_arch_x86_64 = yes; then + CFLAGS="$CFLAGS -arch x86_64" + do64bit_ok=yes + fi;; + *) + AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; + esac + else + # Check for combined 32-bit and 64-bit fat build + echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ + echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ + fat_32_64=yes + fi + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' + AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" + AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_single_module = yes; then + SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + fi + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" + DL_LIBS="" + # Don't use -prebind when building for Mac OS X 10.4 or later only: + test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \ + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \ + LDFLAGS="$LDFLAGS -prebind" + LDFLAGS="$LDFLAGS -headerpad_max_install_names" + AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_search_paths_first = yes; then + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + + # TEA specific: for Tk extensions, remove 64-bit arch flags from + # CFLAGS et al. for combined 32 & 64 bit fat builds as neither + # TkAqua nor TkX11 can be built for 64-bit at present. + test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done + ;; + NEXTSTEP-*) + SHLIB_CFLAGS="" + SHLIB_LD="cc -nostdlib -r" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadNext.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OS/390-*) + CFLAGS_OPTIMIZE="" # Optimizer is buggy + AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h + [Should OS/390 do the right thing with sockets?]) + ;; + OSF1-1.0|OSF1-1.1|OSF1-1.2) + # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + SHLIB_CFLAGS="" + # Hack: make package name same as library name + SHLIB_LD='ld -R -export $@:' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadOSF.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-1.*) + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SHLIB_CFLAGS="-fPIC" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD="ld -shared" + else + SHLIB_LD="ld -non_shared" + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-V*) + # Digital OSF/1 + SHLIB_CFLAGS="" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD='ld -shared -expect_unresolved "*"' + else + SHLIB_LD='ld -non_shared -expect_unresolved "*"' + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mieee" + else + CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" + fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = "1" ; then + CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" + CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + LIBS=`echo $LIBS | sed s/-lpthreads//` + if test "$GCC" = "yes" ; then + LIBS="$LIBS -lpthread -lmach -lexc" + else + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + fi + + ;; + QNX-6*) + # QNX RTP + # This may work for all QNX, but it was only reported for v6. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + # dlopen is in -lc on QNX + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SCO_SV-3.2*) + # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # this test works, since "uname -s" was non-standard in 3.2.4 and + # below. + if test "$GCC" = "yes" ; then + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + else + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + fi + SHLIB_LD="ld -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SINIX*5.4*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SunOS-4*) + SHLIB_CFLAGS="-PIC" + SHLIB_LD="ld" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + + # SunOS can't handle version numbers with dots in them in library + # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it + # requires an extra version number at the end of .so file names. + # So, the library has to have a name like libtcl75.so.1.0 + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + SunOS-5.[[0-6]]) + # Careful to not let 5.10+ fall into this case + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + + SHLIB_CFLAGS="-KPIC" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + ;; + SunOS-5*) + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + + SHLIB_CFLAGS="-KPIC" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + arch=`isainfo` + if test "$arch" = "sparcv9 sparc" ; then + if test "$GCC" = "yes" ; then + if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then + AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) + else + do64bit_ok=yes + CFLAGS="$CFLAGS -m64 -mcpu=v9" + LDFLAGS="$LDFLAGS -m64 -mcpu=v9" + SHLIB_CFLAGS="-fPIC" + fi + else + do64bit_ok=yes + if test "$do64bitVIS" = "yes" ; then + CFLAGS="$CFLAGS -xarch=v9a" + LDFLAGS_ARCH="-xarch=v9a" + else + CFLAGS="$CFLAGS -xarch=v9" + LDFLAGS_ARCH="-xarch=v9" + fi + # Solaris 64 uses this as well + #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" + fi + elif test "$arch" = "amd64 i386" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + else + do64bit_ok=yes + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64" + fi + else + AC_MSG_WARN([64bit mode not supported for $arch]) + fi + fi + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "$do64bit_ok" = "yes" ; then + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + fi + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + fi + ;; + UNIX_SV* | UnixWare-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-Bexport" + AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_Bexport = yes; then + LDFLAGS="$LDFLAGS -Wl,-Bexport" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + esac + + if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then + AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) + fi + +dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so +dnl # until the end of configure, as configure's compile and link tests use +dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's +dnl # preprocessing tests use only CPPFLAGS. + AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) + + # Step 4: disable dynamic loading if requested via a command-line switch. + + AC_ARG_ENABLE(load, + AC_HELP_STRING([--enable-load], + [allow dynamic loading and "load" command (default: on)]), + [tcl_ok=$enableval], [tcl_ok=yes]) + if test "$tcl_ok" = "no"; then + DL_OBJS="" + fi + + if test "x$DL_OBJS" != "x" ; then + BUILD_DLTEST="\$(DLTEST_TARGETS)" + else + echo "Can't figure out how to do dynamic loading or shared libraries" + echo "on this system." + SHLIB_CFLAGS="" + SHLIB_LD="" + SHLIB_SUFFIX="" + DL_OBJS="tclLoadNone.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS_ORIG" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + BUILD_DLTEST="" + fi + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" + + # If we're running gcc, then change the C flags for compiling shared + # libraries to the right flags for gcc, instead of those for the + # standard manufacturer compiler. + + if test "$DL_OBJS" != "tclLoadNone.o" ; then + if test "$GCC" = "yes" ; then + case $system in + AIX-*) + ;; + BSD/OS*) + ;; + IRIX*) + ;; + NetBSD-*|FreeBSD-*) + ;; + Darwin-*) + ;; + SCO_SV-3.2*) + ;; + windows) + ;; + *) + SHLIB_CFLAGS="-fPIC" + ;; + esac + fi + fi + + if test "$SHARED_LIB_SUFFIX" = "" ; then + SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' + fi + if test "$UNSHARED_LIB_SUFFIX" = "" ; then + UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' + fi + + AC_SUBST(DL_LIBS) + + AC_SUBST(CFLAGS_DEBUG) + AC_SUBST(CFLAGS_OPTIMIZE) + AC_SUBST(CFLAGS_WARNING) + + AC_SUBST(STLIB_LD) + AC_SUBST(SHLIB_LD) + + AC_SUBST(SHLIB_LD_LIBS) + AC_SUBST(SHLIB_CFLAGS) + + AC_SUBST(LD_LIBRARY_PATH_VAR) + + # These must be called after we do the basic CFLAGS checks and + # verify any possible 64-bit or similar switches are necessary + TEA_TCL_EARLY_FLAGS + TEA_TCL_64BIT_FLAGS +]) + +#-------------------------------------------------------------------- +# TEA_SERIAL_PORT +# +# Determine which interface to use to talk to the serial port. +# Note that #include lines must begin in leftmost column for +# some compilers to recognize them as preprocessor directives, +# and some build environments have stdin not pointing at a +# pseudo-terminal (usually /dev/null instead.) +# +# Arguments: +# none +# +# Results: +# +# Defines only one of the following vars: +# HAVE_SYS_MODEM_H +# USE_TERMIOS +# USE_TERMIO +# USE_SGTTY +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_SERIAL_PORT], [ + AC_CHECK_HEADERS(sys/modem.h) + AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ + AC_TRY_RUN([ +#include + +int main() { + struct termios t; + if (tcgetattr(0, &t) == 0) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include + +int main() { + struct termio t; + if (ioctl(0, TCGETA, &t) == 0) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include + +int main() { + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct termios t; + if (tcgetattr(0, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct termio t; + if (ioctl(0, TCGETA, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; + }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) + fi]) + case $tcl_cv_api_serial in + termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; + termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; + sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; + esac +]) + +#-------------------------------------------------------------------- +# TEA_MISSING_POSIX_HEADERS +# +# Supply substitutes for missing POSIX header files. Special +# notes: +# - stdlib.h doesn't define strtol, strtoul, or +# strtod insome versions of SunOS +# - some versions of string.h don't declare procedures such +# as strstr +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# NO_DIRENT_H +# NO_ERRNO_H +# NO_VALUES_H +# HAVE_LIMITS_H or NO_LIMITS_H +# NO_STDLIB_H +# NO_STRING_H +# NO_SYS_WAIT_H +# NO_DLFCN_H +# HAVE_SYS_PARAM_H +# +# HAVE_STRING_H ? +# +# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and +# CHECK on limits.h +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ + AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ + AC_TRY_LINK([#include +#include ], [ +#ifndef _POSIX_SOURCE +# ifdef __Lynx__ + /* + * Generate compilation error to make the test fail: Lynx headers + * are only valid if really in the POSIX environment. + */ + + missing_procedure(); +# endif +#endif +DIR *d; +struct dirent *entryPtr; +char *p; +d = opendir("foobar"); +entryPtr = readdir(d); +p = entryPtr->d_name; +closedir(d); +], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) + + if test $tcl_cv_dirent_h = no; then + AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) + fi + + AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(limits.h, + [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], + [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) + AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) + AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) + AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) + if test $tcl_ok = 0; then + AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) + fi + AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) + AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) + AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) + + # See also memmove check below for a place where NO_STRING_H can be + # set and why. + + if test $tcl_ok = 0; then + AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) + fi + + AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) + + # OS/390 lacks sys/param.h (and doesn't need it, by chance). + AC_HAVE_HEADERS(sys/param.h) +]) + +#-------------------------------------------------------------------- +# TEA_PATH_X +# +# Locate the X11 header files and the X11 library archive. Try +# the ac_path_x macro first, but if it doesn't find the X stuff +# (e.g. because there's no xmkmf program) then check through +# a list of possible directories. Under some conditions the +# autoconf macro will return an include directory that contains +# no include files, so double-check its result just to be safe. +# +# This should be called after TEA_CONFIG_CFLAGS as setting the +# LIBS line can confuse some configure macro magic. +# +# Arguments: +# none +# +# Results: +# +# Sets the following vars: +# XINCLUDES +# XLIBSW +# PKG_LIBS (appends to) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_PATH_X], [ + if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then + TEA_PATH_UNIX_X + fi +]) + +AC_DEFUN([TEA_PATH_UNIX_X], [ + AC_PATH_X + not_really_there="" + if test "$no_x" = ""; then + if test "$x_includes" = ""; then + AC_TRY_CPP([#include ], , not_really_there="yes") + else + if test ! -r $x_includes/X11/Intrinsic.h; then + not_really_there="yes" + fi + fi + fi + if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then + AC_MSG_CHECKING([for X11 header files]) + found_xincludes="no" + AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") + if test "$found_xincludes" = "no"; then + dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" + for i in $dirs ; do + if test -r $i/X11/Intrinsic.h; then + AC_MSG_RESULT([$i]) + XINCLUDES=" -I$i" + found_xincludes="yes" + break + fi + done + fi + else + if test "$x_includes" != ""; then + XINCLUDES="-I$x_includes" + found_xincludes="yes" + fi + fi + if test found_xincludes = "no"; then + AC_MSG_RESULT([couldn't find any!]) + fi + + if test "$no_x" = yes; then + AC_MSG_CHECKING([for X11 libraries]) + XLIBSW=nope + dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" + for i in $dirs ; do + if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then + AC_MSG_RESULT([$i]) + XLIBSW="-L$i -lX11" + x_libraries="$i" + break + fi + done + else + if test "$x_libraries" = ""; then + XLIBSW=-lX11 + else + XLIBSW="-L$x_libraries -lX11" + fi + fi + if test "$XLIBSW" = nope ; then + AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) + fi + if test "$XLIBSW" = nope ; then + AC_MSG_RESULT([could not find any! Using -lX11.]) + XLIBSW=-lX11 + fi + if test x"${XLIBSW}" != x ; then + PKG_LIBS="${PKG_LIBS} ${XLIBSW}" + fi +]) + +#-------------------------------------------------------------------- +# TEA_BLOCKING_STYLE +# +# The statements below check for systems where POSIX-style +# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. +# On these systems (mostly older ones), use the old BSD-style +# FIONBIO approach instead. +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# HAVE_SYS_IOCTL_H +# HAVE_SYS_FILIO_H +# USE_FIONBIO +# O_NONBLOCK +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_BLOCKING_STYLE], [ + AC_CHECK_HEADERS(sys/ioctl.h) + AC_CHECK_HEADERS(sys/filio.h) + TEA_CONFIG_SYSTEM + AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) + case $system in + # There used to be code here to use FIONBIO under AIX. However, it + # was reported that FIONBIO doesn't work under AIX 3.2.5. Since + # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO + # code (JO, 5/31/97). + + OSF*) + AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) + AC_MSG_RESULT([FIONBIO]) + ;; + SunOS-4*) + AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) + AC_MSG_RESULT([FIONBIO]) + ;; + *) + AC_MSG_RESULT([O_NONBLOCK]) + ;; + esac +]) + +#-------------------------------------------------------------------- +# TEA_TIME_HANLDER +# +# Checks how the system deals with time.h, what time structures +# are used on the system, and what fields the structures have. +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# USE_DELTA_FOR_TZ +# HAVE_TM_GMTOFF +# HAVE_TM_TZADJ +# HAVE_TIMEZONE_VAR +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TIME_HANDLER], [ + AC_CHECK_HEADERS(sys/time.h) + AC_HEADER_TIME + AC_STRUCT_TIMEZONE + + AC_CHECK_FUNCS(gmtime_r localtime_r) + + AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ + AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], + tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) + if test $tcl_cv_member_tm_tzadj = yes ; then + AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) + fi + + AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ + AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], + tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) + if test $tcl_cv_member_tm_gmtoff = yes ; then + AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) + fi + + # + # Its important to include time.h in this check, as some systems + # (like convex) have timezone functions, etc. + # + AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ + AC_TRY_COMPILE([#include ], + [extern long timezone; + timezone += 1; + exit (0);], + tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) + if test $tcl_cv_timezone_long = yes ; then + AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) + else + # + # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. + # + AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ + AC_TRY_COMPILE([#include ], + [extern time_t timezone; + timezone += 1; + exit (0);], + tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) + if test $tcl_cv_timezone_time = yes ; then + AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) + fi + fi +]) + +#-------------------------------------------------------------------- +# TEA_BUGGY_STRTOD +# +# Under Solaris 2.4, strtod returns the wrong value for the +# terminating character under some conditions. Check for this +# and if the problem exists use a substitute procedure +# "fixstrtod" (provided by Tcl) that corrects the error. +# Also, on Compaq's Tru64 Unix 5.0, +# strtod(" ") returns 0.0 instead of a failure to convert. +# +# Arguments: +# none +# +# Results: +# +# Might defines some of the following vars: +# strtod (=fixstrtod) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_BUGGY_STRTOD], [ + AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) + if test "$tcl_strtod" = 1; then + AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ + AC_TRY_RUN([ + extern double strtod(); + int main() { + char *infString="Inf", *nanString="NaN", *spaceString=" "; + char *term; + double value; + value = strtod(infString, &term); + if ((term != infString) && (term[-1] == 0)) { + exit(1); + } + value = strtod(nanString, &term); + if ((term != nanString) && (term[-1] == 0)) { + exit(1); + } + value = strtod(spaceString, &term); + if (term == (spaceString+1)) { + exit(1); + } + exit(0); + }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, + tcl_cv_strtod_buggy=buggy)]) + if test "$tcl_cv_strtod_buggy" = buggy; then + AC_LIBOBJ([fixstrtod]) + USE_COMPAT=1 + AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) + fi + fi +]) + +#-------------------------------------------------------------------- +# TEA_TCL_LINK_LIBS +# +# Search for the libraries needed to link the Tcl shell. +# Things like the math library (-lm) and socket stuff (-lsocket vs. +# -lnsl) are dealt with here. +# +# Arguments: +# Requires the following vars to be set in the Makefile: +# DL_LIBS +# LIBS +# MATH_LIBS +# +# Results: +# +# Subst's the following var: +# TCL_LIBS +# MATH_LIBS +# +# Might append to the following vars: +# LIBS +# +# Might define the following vars: +# HAVE_NET_ERRNO_H +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_LINK_LIBS], [ + #-------------------------------------------------------------------- + # On a few very rare systems, all of the libm.a stuff is + # already in libc.a. Set compiler flags accordingly. + # Also, Linux requires the "ieee" library for math to work + # right (and it must appear before "-lm"). + #-------------------------------------------------------------------- + + AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") + AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) + + #-------------------------------------------------------------------- + # Interactive UNIX requires -linet instead of -lsocket, plus it + # needs net/errno.h to define the socket-related error codes. + #-------------------------------------------------------------------- + + AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) + AC_CHECK_HEADER(net/errno.h, [ + AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) + + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- + + tcl_checkBoth=0 + AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) + if test "$tcl_checkSocket" = 1; then + AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, + LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) + fi + if test "$tcl_checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) + fi + AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, + [LIBS="$LIBS -lnsl"])]) + + # Don't perform the eval of the libraries here because DL_LIBS + # won't be set until we call TEA_CONFIG_CFLAGS + + TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' + AC_SUBST(TCL_LIBS) + AC_SUBST(MATH_LIBS) +]) + +#-------------------------------------------------------------------- +# TEA_TCL_EARLY_FLAGS +# +# Check for what flags are needed to be passed so the correct OS +# features are available. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# _ISOC99_SOURCE +# _LARGEFILE64_SOURCE +# _LARGEFILE_SOURCE64 +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_EARLY_FLAG],[ + AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), + AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, + AC_TRY_COMPILE([[#define ]$1[ 1 +]$2], $3, + [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, + [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) + if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then + AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) + tcl_flags="$tcl_flags $1" + fi +]) + +AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ + AC_MSG_CHECKING([for required early compiler flags]) + tcl_flags="" + TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], + [char *p = (char *)strtoll; char *q = (char *)strtoull;]) + TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], + [struct stat64 buf; int i = stat64("/", &buf);]) + TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ], + [char *p = (char *)open64;]) + if test "x${tcl_flags}" = "x" ; then + AC_MSG_RESULT([none]) + else + AC_MSG_RESULT([${tcl_flags}]) + fi +]) + +#-------------------------------------------------------------------- +# TEA_TCL_64BIT_FLAGS +# +# Check for what is defined in the way of 64-bit features. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# TCL_WIDE_INT_IS_LONG +# TCL_WIDE_INT_TYPE +# HAVE_STRUCT_DIRENT64 +# HAVE_STRUCT_STAT64 +# HAVE_TYPE_OFF64_T +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ + AC_MSG_CHECKING([for 64-bit integer type]) + AC_CACHE_VAL(tcl_cv_type_64bit,[ + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], + tcl_type_64bit=__int64, tcl_type_64bit="long long") + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + AC_TRY_COMPILE(,[switch (0) { + case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; + }],tcl_cv_type_64bit=${tcl_type_64bit})]) + if test "${tcl_cv_type_64bit}" = none ; then + AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) + AC_MSG_RESULT([using long]) + elif test "${tcl_cv_type_64bit}" = "__int64" \ + -a "${TEA_PLATFORM}" = "windows" ; then + # We actually want to use the default tcl.h checks in this + # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* + AC_MSG_RESULT([using Tcl header defaults]) + else + AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, + [What type should be used to define wide integers?]) + AC_MSG_RESULT([${tcl_cv_type_64bit}]) + + # Now check for auxiliary declarations + AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ + AC_TRY_COMPILE([#include +#include ],[struct dirent64 p;], + tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) + fi + + AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ + AC_TRY_COMPILE([#include ],[struct stat64 p; +], + tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) + fi + + AC_CHECK_FUNCS(open64 lseek64) + AC_MSG_CHECKING([for off64_t]) + AC_CACHE_VAL(tcl_cv_type_off64_t,[ + AC_TRY_COMPILE([#include ],[off64_t offset; +], + tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) + dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the + dnl functions lseek64 and open64 are defined. + if test "x${tcl_cv_type_off64_t}" = "xyes" && \ + test "x${ac_cv_func_lseek64}" = "xyes" && \ + test "x${ac_cv_func_open64}" = "xyes" ; then + AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + fi +]) + +## +## Here ends the standard Tcl configuration bits and starts the +## TEA specific functions +## + +#------------------------------------------------------------------------ +# TEA_INIT -- +# +# Init various Tcl Extension Architecture (TEA) variables. +# This should be the first called TEA_* macro. +# +# Arguments: +# none +# +# Results: +# +# Defines and substs the following vars: +# CYGPATH +# EXEEXT +# Defines only: +# TEA_VERSION +# TEA_INITED +# TEA_PLATFORM (windows or unix) +# +# "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. +# +# EXEEXT +# Select the executable extension based on the host type. This +# is a lightweight replacement for AC_EXEEXT that doesn't require +# a compiler. +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_INIT], [ + # TEA extensions pass this us the version of TEA they think they + # are compatible with. + TEA_VERSION="3.6" + + AC_MSG_CHECKING([for correct TEA configuration]) + if test x"${PACKAGE_NAME}" = x ; then + AC_MSG_ERROR([ +The PACKAGE_NAME variable must be defined by your TEA configure.in]) + fi + if test x"$1" = x ; then + AC_MSG_ERROR([ +TEA version not specified.]) + elif test "$1" != "${TEA_VERSION}" ; then + AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) + else + AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) + fi + case "`uname -s`" in + *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) + AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) + EXEEXT=".exe" + TEA_PLATFORM="windows" + ;; + *) + CYGPATH=echo + EXEEXT="" + TEA_PLATFORM="unix" + ;; + esac + + # Check if exec_prefix is set. If not use fall back to prefix. + # Note when adjusted, so that TEA_PREFIX can correct for this. + # This is needed for recursive configures, since autoconf propagates + # $prefix, but not $exec_prefix (doh!). + if test x$exec_prefix = xNONE ; then + exec_prefix_default=yes + exec_prefix=$prefix + fi + + AC_SUBST(EXEEXT) + AC_SUBST(CYGPATH) + + # This package name must be replaced statically for AC_SUBST to work + AC_SUBST(PKG_LIB_FILE) + # Substitute STUB_LIB_FILE in case package creates a stub library too. + AC_SUBST(PKG_STUB_LIB_FILE) + + # We AC_SUBST these here to ensure they are subst'ed, + # in case the user doesn't call TEA_ADD_... + AC_SUBST(PKG_STUB_SOURCES) + AC_SUBST(PKG_STUB_OBJECTS) + AC_SUBST(PKG_TCL_SOURCES) + AC_SUBST(PKG_HEADERS) + AC_SUBST(PKG_INCLUDES) + AC_SUBST(PKG_LIBS) + AC_SUBST(PKG_CFLAGS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_SOURCES -- +# +# Specify one or more source files. Users should check for +# the right platform before adding to their list. +# It is not important to specify the directory, as long as it is +# in the generic, win or unix subdirectory of $(srcdir). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_SOURCES +# PKG_OBJECTS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_SOURCES], [ + vars="$@" + for i in $vars; do + case $i in + [\$]*) + # allow $-var names + PKG_SOURCES="$PKG_SOURCES $i" + PKG_OBJECTS="$PKG_OBJECTS $i" + ;; + *) + # check for existence - allows for generic/win/unix VPATH + # To add more dirs here (like 'src'), you have to update VPATH + # in Makefile.in as well + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + AC_MSG_ERROR([could not find source file '$i']) + fi + PKG_SOURCES="$PKG_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" + fi + PKG_OBJECTS="$PKG_OBJECTS $j" + ;; + esac + done + AC_SUBST(PKG_SOURCES) + AC_SUBST(PKG_OBJECTS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_STUB_SOURCES -- +# +# Specify one or more source files. Users should check for +# the right platform before adding to their list. +# It is not important to specify the directory, as long as it is +# in the generic, win or unix subdirectory of $(srcdir). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_STUB_SOURCES +# PKG_STUB_OBJECTS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_STUB_SOURCES], [ + vars="$@" + for i in $vars; do + # check for existence - allows for generic/win/unix VPATH + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + AC_MSG_ERROR([could not find stub source file '$i']) + fi + PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" + fi + PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" + done + AC_SUBST(PKG_STUB_SOURCES) + AC_SUBST(PKG_STUB_OBJECTS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_TCL_SOURCES -- +# +# Specify one or more Tcl source files. These should be platform +# independent runtime files. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_TCL_SOURCES +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_TCL_SOURCES], [ + vars="$@" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) + fi + PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" + done + AC_SUBST(PKG_TCL_SOURCES) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_HEADERS -- +# +# Specify one or more source headers. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_HEADERS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_HEADERS], [ + vars="$@" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + AC_MSG_ERROR([could not find header file '${srcdir}/$i']) + fi + PKG_HEADERS="$PKG_HEADERS $i" + done + AC_SUBST(PKG_HEADERS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_INCLUDES -- +# +# Specify one or more include dirs. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_INCLUDES +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_INCLUDES], [ + vars="$@" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + AC_SUBST(PKG_INCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_LIBS -- +# +# Specify one or more libraries. Users should check for +# the right platform before adding to their list. For Windows, +# libraries provided in "foo.lib" format will be converted to +# "-lfoo" when using GCC (mingw). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_LIBS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_LIBS], [ + vars="$@" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + AC_SUBST(PKG_LIBS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_CFLAGS -- +# +# Specify one or more CFLAGS. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_CFLAGS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_CFLAGS], [ + PKG_CFLAGS="$PKG_CFLAGS $@" + AC_SUBST(PKG_CFLAGS) +]) + +#------------------------------------------------------------------------ +# TEA_PREFIX -- +# +# Handle the --prefix=... option by defaulting to what Tcl gave +# +# Arguments: +# none +# +# Results: +# +# If --prefix or --exec-prefix was not specified, $prefix and +# $exec_prefix will be set to the values given to Tcl when it was +# configured. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_PREFIX], [ + if test "${prefix}" = "NONE"; then + prefix_default=yes + if test x"${TCL_PREFIX}" != x; then + AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) + prefix=${TCL_PREFIX} + else + AC_MSG_NOTICE([--prefix defaulting to /usr/local]) + prefix=/usr/local + fi + fi + if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ + -o x"${exec_prefix_default}" = x"yes" ; then + if test x"${TCL_EXEC_PREFIX}" != x; then + AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) + exec_prefix=${TCL_EXEC_PREFIX} + else + AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) + exec_prefix=$prefix + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_SETUP_COMPILER_CC -- +# +# Do compiler checks the way we want. This is just a replacement +# for AC_PROG_CC in TEA configure.in files to make them cleaner. +# +# Arguments: +# none +# +# Results: +# +# Sets up CC var and other standard bits we need to make executables. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_SETUP_COMPILER_CC], [ + # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) + # in this macro, they need to go into TEA_SETUP_COMPILER instead. + + # If the user did not set CFLAGS, set it now to keep + # the AC_PROG_CC macro from adding "-g -O2". + if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" + fi + + AC_PROG_CC + AC_PROG_CPP + + AC_PROG_INSTALL + + #-------------------------------------------------------------------- + # Checks to see if the make program sets the $MAKE variable. + #-------------------------------------------------------------------- + + AC_PROG_MAKE_SET + + #-------------------------------------------------------------------- + # Find ranlib + #-------------------------------------------------------------------- + + AC_PROG_RANLIB + + #-------------------------------------------------------------------- + # Determines the correct binary file extension (.o, .obj, .exe etc.) + #-------------------------------------------------------------------- + + AC_OBJEXT + AC_EXEEXT +]) + +#------------------------------------------------------------------------ +# TEA_SETUP_COMPILER -- +# +# Do compiler checks that use the compiler. This must go after +# TEA_SETUP_COMPILER_CC, which does the actual compiler check. +# +# Arguments: +# none +# +# Results: +# +# Sets up CC var and other standard bits we need to make executables. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_SETUP_COMPILER], [ + # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. + AC_REQUIRE([TEA_SETUP_COMPILER_CC]) + + #------------------------------------------------------------------------ + # If we're using GCC, see if the compiler understands -pipe. If so, use it. + # It makes compiling go faster. (This is only a performance feature.) + #------------------------------------------------------------------------ + + if test -z "$no_pipe" -a -n "$GCC"; then + AC_CACHE_CHECK([if the compiler understands -pipe], + tcl_cv_cc_pipe, [ + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" + AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_pipe = yes; then + CFLAGS="$CFLAGS -pipe" + fi + fi + + #-------------------------------------------------------------------- + # Common compiler flag setup + #-------------------------------------------------------------------- + + AC_C_BIGENDIAN + if test "${TEA_PLATFORM}" = "unix" ; then + TEA_TCL_LINK_LIBS + TEA_MISSING_POSIX_HEADERS + # Let the user call this, because if it triggers, they will + # need a compat/strtod.c that is correct. Users can also + # use Tcl_GetDouble(FromObj) instead. + #TEA_BUGGY_STRTOD + fi +]) + +#------------------------------------------------------------------------ +# TEA_MAKE_LIB -- +# +# Generate a line that can be used to build a shared/unshared library +# in a platform independent manner. +# +# Arguments: +# none +# +# Requires: +# +# Results: +# +# Defines the following vars: +# CFLAGS - Done late here to note disturb other AC macros +# MAKE_LIB - Command to execute to build the Tcl library; +# differs depending on whether or not Tcl is being +# compiled as a shared library. +# MAKE_SHARED_LIB Makefile rule for building a shared library +# MAKE_STATIC_LIB Makefile rule for building a static library +# MAKE_STUB_LIB Makefile rule for building a stub library +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_MAKE_LIB], [ + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then + MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" + MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" + else + MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" + MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" + fi + + if test "${SHARED_BUILD}" = "1" ; then + MAKE_LIB="${MAKE_SHARED_LIB} " + else + MAKE_LIB="${MAKE_STATIC_LIB} " + fi + + #-------------------------------------------------------------------- + # Shared libraries and static libraries have different names. + # Use the double eval to make sure any variables in the suffix is + # substituted. (@@@ Might not be necessary anymore) + #-------------------------------------------------------------------- + + if test "${TEA_PLATFORM}" = "windows" ; then + if test "${SHARED_BUILD}" = "1" ; then + # We force the unresolved linking of symbols that are really in + # the private libraries of Tcl and Tk. + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" + fi + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + else + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + if test "$GCC" = "yes"; then + PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} + fi + # These aren't needed on Windows (either MSVC or gcc) + RANLIB=: + RANLIB_STUB=: + else + RANLIB_STUB="${RANLIB}" + if test "${SHARED_BUILD}" = "1" ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" + fi + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + fi + + # These are escaped so that only CFLAGS is picked up at configure time. + # The other values will be substituted at make time. + CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" + if test "${SHARED_BUILD}" = "1" ; then + CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" + fi + + AC_SUBST(MAKE_LIB) + AC_SUBST(MAKE_SHARED_LIB) + AC_SUBST(MAKE_STATIC_LIB) + AC_SUBST(MAKE_STUB_LIB) + AC_SUBST(RANLIB_STUB) +]) + +#------------------------------------------------------------------------ +# TEA_LIB_SPEC -- +# +# Compute the name of an existing object library located in libdir +# from the given base name and produce the appropriate linker flags. +# +# Arguments: +# basename The base name of the library without version +# numbers, extensions, or "lib" prefixes. +# extra_dir Extra directory in which to search for the +# library. This location is used first, then +# $prefix/$exec-prefix, then some defaults. +# +# Requires: +# TEA_INIT and TEA_PREFIX must be called first. +# +# Results: +# +# Defines the following vars: +# ${basename}_LIB_NAME The computed library name. +# ${basename}_LIB_SPEC The computed linker flags. +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LIB_SPEC], [ + AC_MSG_CHECKING([for $1 library]) + + # Look in exec-prefix for the library (defined by TEA_PREFIX). + + tea_lib_name_dir="${exec_prefix}/lib" + + # Or in a user-specified location. + + if test x"$2" != x ; then + tea_extra_lib_dir=$2 + else + tea_extra_lib_dir=NONE + fi + + for i in \ + `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do + if test -f "$i" ; then + tea_lib_name_dir=`dirname $i` + $1_LIB_NAME=`basename $i` + $1_LIB_PATH_NAME=$i + break + fi + done + + if test "${TEA_PLATFORM}" = "windows"; then + $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" + else + # Strip off the leading "lib" and trailing ".a" or ".so" + + tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` + $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" + fi + + if test "x${$1_LIB_NAME}" = x ; then + AC_MSG_ERROR([not found]) + else + AC_MSG_RESULT([${$1_LIB_SPEC}]) + fi +]) + +#------------------------------------------------------------------------ +# TEA_PRIVATE_TCL_HEADERS -- +# +# Locate the private Tcl include files +# +# Arguments: +# +# Requires: +# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has +# already been called. +# +# Results: +# +# Substs the following vars: +# TCL_TOP_DIR_NATIVE +# TCL_GENERIC_DIR_NATIVE +# TCL_UNIX_DIR_NATIVE +# TCL_WIN_DIR_NATIVE +# TCL_BMAP_DIR_NATIVE +# TCL_TOOL_DIR_NATIVE +# TCL_PLATFORM_DIR_NATIVE +# TCL_BIN_DIR_NATIVE +# TCL_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ + AC_MSG_CHECKING([for Tcl private include files]) + + TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` + TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" + TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" + TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" + TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" + TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" + TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" + TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" + + if test "${TEA_PLATFORM}" = "windows"; then + TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} + else + TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} + fi + # We want to ensure these are substituted so as not to require + # any *_NATIVE vars be defined in the Makefile + TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers and PrivateHeaders directories + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then + TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else + TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi + ;; + esac + else + if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then + AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) + fi + fi + + + AC_SUBST(TCL_TOP_DIR_NATIVE) + AC_SUBST(TCL_GENERIC_DIR_NATIVE) + AC_SUBST(TCL_UNIX_DIR_NATIVE) + AC_SUBST(TCL_WIN_DIR_NATIVE) + AC_SUBST(TCL_BMAP_DIR_NATIVE) + AC_SUBST(TCL_TOOL_DIR_NATIVE) + AC_SUBST(TCL_PLATFORM_DIR_NATIVE) + + AC_SUBST(TCL_INCLUDES) + AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) +]) + +#------------------------------------------------------------------------ +# TEA_PUBLIC_TCL_HEADERS -- +# +# Locate the installed public Tcl header files +# +# Arguments: +# None. +# +# Requires: +# CYGPATH must be set +# +# Results: +# +# Adds a --with-tclinclude switch to configure. +# Result is cached. +# +# Substs the following vars: +# TCL_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ + AC_MSG_CHECKING([for Tcl public headers]) + + AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) + + AC_CACHE_VAL(ac_cv_c_tclh, [ + # Use the value from --with-tclinclude, if it was given + + if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + ac_cv_c_tclh=${with_tclinclude} + else + AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) + fi + else + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers directory + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tcl is not installed, + # and in that situation, look there before installed locations. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + if test x"${TCL_INCLUDE_SPEC}" != x ; then + d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` + list="$list `ls -d ${d} 2>/dev/null`" + fi + fi + for i in $list ; do + if test -f "$i/tcl.h" ; then + ac_cv_c_tclh=$i + break + fi + done + fi + ]) + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tclh}" = x ; then + AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) + else + AC_MSG_RESULT([${ac_cv_c_tclh}]) + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` + + TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + AC_SUBST(TCL_INCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_PRIVATE_TK_HEADERS -- +# +# Locate the private Tk include files +# +# Arguments: +# +# Requires: +# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has +# already been called. +# +# Results: +# +# Substs the following vars: +# TK_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ + AC_MSG_CHECKING([for Tk private include files]) + + TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` + TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" + TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" + TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" + TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" + TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" + if test "${TEA_PLATFORM}" = "windows"; then + TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} + else + TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} + fi + # We want to ensure these are substituted so as not to require + # any *_NATIVE vars be defined in the Makefile + TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" + # Detect and add ttk subdir + if test -d ${TK_SRC_DIR_NATIVE}/generic/ttk; then + TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" + fi + if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ + -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" + fi + if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" + fi + if test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use + # the framework's Headers and PrivateHeaders directories + case ${TK_DEFS} in + *TK_FRAMEWORK*) + if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then + TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi + ;; + esac + else + if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then + AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) + fi + fi + + AC_SUBST(TK_TOP_DIR_NATIVE) + AC_SUBST(TK_UNIX_DIR_NATIVE) + AC_SUBST(TK_WIN_DIR_NATIVE) + AC_SUBST(TK_GENERIC_DIR_NATIVE) + AC_SUBST(TK_XLIB_DIR_NATIVE) + AC_SUBST(TK_PLATFORM_DIR_NATIVE) + + AC_SUBST(TK_INCLUDES) + AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) +]) + +#------------------------------------------------------------------------ +# TEA_PUBLIC_TK_HEADERS -- +# +# Locate the installed public Tk header files +# +# Arguments: +# None. +# +# Requires: +# CYGPATH must be set +# +# Results: +# +# Adds a --with-tkinclude switch to configure. +# Result is cached. +# +# Substs the following vars: +# TK_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ + AC_MSG_CHECKING([for Tk public headers]) + + AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) + + AC_CACHE_VAL(ac_cv_c_tkh, [ + # Use the value from --with-tkinclude, if it was given + + if test x"${with_tkinclude}" != x ; then + if test -f "${with_tkinclude}/tk.h" ; then + ac_cv_c_tkh=${with_tkinclude} + else + AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) + fi + else + if test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use + # the framework's Headers directory. + case ${TK_DEFS} in + *TK_FRAMEWORK*) + list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tk is not installed, + # and in that situation, look there before installed locations. + if test -f "${TK_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tk's --prefix location, + # relative to directory of tkConfig.sh, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TK_PREFIX}/include 2>/dev/null` \ + `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + fi + for i in $list ; do + if test -f "$i/tk.h" ; then + ac_cv_c_tkh=$i + break + fi + done + fi + ]) + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tkh}" = x ; then + AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) + else + AC_MSG_RESULT([${ac_cv_c_tkh}]) + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` + + TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + AC_SUBST(TK_INCLUDES) + + if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ + -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + # On Windows and Aqua, we need the X compat headers + AC_MSG_CHECKING([for X11 header files]) + if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then + INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" + TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + AC_SUBST(TK_XINCLUDES) + fi + AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) + fi +]) + +#------------------------------------------------------------------------ +# TEA_PROG_TCLSH +# Determine the fully qualified path name of the tclsh executable +# in the Tcl build directory or the tclsh installed in a bin +# directory. This macro will correctly determine the name +# of the tclsh executable even if tclsh has not yet been +# built in the build directory. The tclsh found is always +# associated with a tclConfig.sh file. This tclsh should be used +# only for running extension test cases. It should never be +# or generation of files (like pkgIndex.tcl) at build time. +# +# Arguments +# none +# +# Results +# Subst's the following values: +# TCLSH_PROG +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PROG_TCLSH], [ + AC_MSG_CHECKING([for tclsh]) + if test -f "${TCL_BIN_DIR}/Makefile" ; then + # tclConfig.sh is in Tcl build directory + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="${TCL_BIN_DIR}/tclsh" + fi + else + # tclConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" + fi + list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${TCLSH_PROG}" ; then + REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" + fi + AC_MSG_RESULT([${TCLSH_PROG}]) + AC_SUBST(TCLSH_PROG) +]) + +#------------------------------------------------------------------------ +# TEA_PROG_WISH +# Determine the fully qualified path name of the wish executable +# in the Tk build directory or the wish installed in a bin +# directory. This macro will correctly determine the name +# of the wish executable even if wish has not yet been +# built in the build directory. The wish found is always +# associated with a tkConfig.sh file. This wish should be used +# only for running extension test cases. It should never be +# or generation of files (like pkgIndex.tcl) at build time. +# +# Arguments +# none +# +# Results +# Subst's the following values: +# WISH_PROG +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PROG_WISH], [ + AC_MSG_CHECKING([for wish]) + if test -f "${TK_BIN_DIR}/Makefile" ; then + # tkConfig.sh is in Tk build directory + if test "${TEA_PLATFORM}" = "windows"; then + WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" + else + WISH_PROG="${TK_BIN_DIR}/wish" + fi + else + # tkConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" + else + WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" + fi + list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TK_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${WISH_PROG}" ; then + REAL_TK_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" + fi + AC_MSG_RESULT([${WISH_PROG}]) + AC_SUBST(WISH_PROG) +]) + +#------------------------------------------------------------------------ +# TEA_PATH_CONFIG -- +# +# Locate the ${1}Config.sh file and perform a sanity check on +# the ${1} compile flags. These are used by packages like +# [incr Tk] that load *Config.sh files from more than Tcl and Tk. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-$1=... +# +# Defines the following vars: +# $1_BIN_DIR Full path to the directory containing +# the $1Config.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_CONFIG], [ + # + # Ok, lets find the $1 configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-$1 + # + + if test x"${no_$1}" = x ; then + # we reset no_$1 in case something fails here + no_$1=true + AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) + AC_MSG_CHECKING([for $1 configuration]) + AC_CACHE_VAL(ac_cv_c_$1config,[ + + # First check to see if --with-$1 was specified. + if test x"${with_$1config}" != x ; then + case ${with_$1config} in + */$1Config.sh ) + if test -f ${with_$1config}; then + AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) + with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` + fi;; + esac + if test -f "${with_$1config}/$1Config.sh" ; then + ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` + else + AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) + fi + fi + + # then check for a private $1 installation + if test x"${ac_cv_c_$1config}" = x ; then + for i in \ + ../$1 \ + `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ../../$1 \ + `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ../../../$1 \ + `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ${srcdir}/../$1 \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ; do + if test -f "$i/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i; pwd)` + break + fi + if test -f "$i/unix/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i/unix; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_$1config}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_$1config}" = x ; then + $1_BIN_DIR="# no $1 configs found" + AC_MSG_WARN([Cannot find $1 configuration definitions]) + exit 0 + else + no_$1= + $1_BIN_DIR=${ac_cv_c_$1config} + AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_CONFIG -- +# +# Load the $1Config.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# $1_BIN_DIR +# +# Results: +# +# Subst the following vars: +# $1_SRC_DIR +# $1_LIB_FILE +# $1_LIB_SPEC +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_CONFIG], [ + AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) + + if test -f "${$1_BIN_DIR}/$1Config.sh" ; then + AC_MSG_RESULT([loading]) + . "${$1_BIN_DIR}/$1Config.sh" + else + AC_MSG_RESULT([file not found]) + fi + + # + # If the $1_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable $1_LIB_SPEC will be set to the value + # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC + # instead of $1_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + # + + if test -f "${$1_BIN_DIR}/Makefile" ; then + AC_MSG_WARN([Found Makefile - using build library specs for $1]) + $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} + $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} + $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} + fi + + AC_SUBST($1_VERSION) + AC_SUBST($1_BIN_DIR) + AC_SUBST($1_SRC_DIR) + + AC_SUBST($1_LIB_FILE) + AC_SUBST($1_LIB_SPEC) + + AC_SUBST($1_STUB_LIB_FILE) + AC_SUBST($1_STUB_LIB_SPEC) + AC_SUBST($1_STUB_LIB_PATH) +]) + +#------------------------------------------------------------------------ +# TEA_PATH_CELIB -- +# +# Locate Keuchel's celib emulation layer for targeting Win/CE +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-celib=... +# +# Defines the following vars: +# CELIB_DIR Full path to the directory containing +# the include and platform lib files +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_CELIB], [ + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-celib + + if test x"${no_celib}" = x ; then + # we reset no_celib in case something fails here + no_celib=true + AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) + AC_MSG_CHECKING([for Windows/CE celib directory]) + AC_CACHE_VAL(ac_cv_c_celibconfig,[ + # First check to see if --with-celibconfig was specified. + if test x"${with_celibconfig}" != x ; then + if test -d "${with_celibconfig}/inc" ; then + ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` + else + AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) + fi + fi + + # then check for a celib library + if test x"${ac_cv_c_celibconfig}" = x ; then + for i in \ + ../celib-palm-3.0 \ + ../celib \ + ../../celib-palm-3.0 \ + ../../celib \ + `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ + ${srcdir}/../celib-palm-3.0 \ + ${srcdir}/../celib \ + `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ + ; do + if test -d "$i/inc" ; then + ac_cv_c_celibconfig=`(cd $i; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_celibconfig}" = x ; then + AC_MSG_ERROR([Cannot find celib support library directory]) + else + no_celib= + CELIB_DIR=${ac_cv_c_celibconfig} + CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` + AC_MSG_RESULT([found $CELIB_DIR]) + fi + fi +]) + + +# Local Variables: +# mode: autoconf +# End: Index: library/store/XOTclGdbm/xotcl.m4 =================================================================== diff -u -N --- library/store/XOTclGdbm/xotcl.m4 (revision 0) +++ library/store/XOTclGdbm/xotcl.m4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,139 @@ +# xotcl.m4 -- +# +# This file provides a set of autoconf macros to help TEA-enable +# a Tcl extension. +# +# Copyright (c) 1999 Scriptics Corporation. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. + +#------------------------------------------------------------------------ +# SC_PATH_XOTCLCONFIG -- +# +# Locate the xotclConfig.sh file and perform a sanity check on +# the Tcl compile flags +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-xotcl=... +# +# Defines the following vars: +# XOTCL_BIN_DIR Full path to the directory containing +# the xotclConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN(SC_PATH_XOTCLCONFIG, [ + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + if test x"${no_xotcl}" = x ; then + # we reset no_xotcl in case something fails here + no_xotcl=true + AC_ARG_WITH(xotcl, [ --with-xotcl directory containing xotcl configuration (xotclConfig.sh)], with_xotclconfig=${withval}) + AC_MSG_CHECKING([for XOTcl configuration]) + AC_CACHE_VAL(ac_cv_c_xotclconfig,[ + + # First check to see if --with-xotcl was specified. + if test x"${with_xotclconfig}" != x ; then + if test -f "${with_xotclconfig}/xotclConfig.sh" ; then + ac_cv_c_xotclconfig=`(cd ${with_xotclconfig}; pwd)` + else + AC_MSG_ERROR([${with_xotclconfig} directory doesn't contain xotclConfig.sh]) + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_xotclconfig}" = x ; then + for i in \ + ${srcdir}/../xotcl \ + `ls -dr ${srcdir}/../xotcl-* 2>/dev/null` \ + ${srcdir}/../../xotcl \ + `ls -dr ${srcdir}/../../xotcl-* 2>/dev/null` \ + ${srcdir}/../../../xotcl \ + `ls -dr ${srcdir}/../../../xotcl-* 2>/dev/null` \ + ${srcdir}/../../../../xotcl \ + `ls -dr ${srcdir}/../../../../xotcl-* 2>/dev/null` \ + ${srcdir}/../../../../../xotcl \ + `ls -dr ${srcdir}/../../../../../xotcl-* 2>/dev/null` ; do + if test -f "$i/xotclConfig.sh" ; then + ac_cv_c_xotclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_xotclconfig}" = x ; then + for i in `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` ; do + if test -f "$i/xotclConfig.sh" ; then + ac_cv_c_xotclconfig=`(cd $i; pwd)` + break + fi + done + fi + + ]) + + if test x"${ac_cv_c_xotclconfig}" = x ; then + XOTCL_BIN_DIR="# no XOTcl configs found" + AC_MSG_WARN(Can't find XOTcl configuration definitions) + exit 0 + else + no_xotcl= + XOTCL_BIN_DIR=${ac_cv_c_xotclconfig} + AC_MSG_RESULT(found $XOTCL_BIN_DIR/xotclConfig.sh) + fi + fi +]) + +#------------------------------------------------------------------------ +# SC_LOAD_XOTCLCONFIG -- +# +# Load the tclConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# XOTCL_BIN_DIR +# +# Results: +# +# Subst the vars: +# +#------------------------------------------------------------------------ + +AC_DEFUN(SC_LOAD_XOTCLCONFIG, [ + AC_MSG_CHECKING([for existence of $XOTCL_BIN_DIR/xotclConfig.sh]) + + if test -f "$XOTCL_BIN_DIR/xotclConfig.sh" ; then + AC_MSG_RESULT([loading]) + . $XOTCL_BIN_DIR/xotclConfig.sh + else + AC_MSG_RESULT([file not found]) + fi + + # + # The eval is required to do the TCL_DBGX substitution in the + # TCL_LIB_FILE variable + # + AC_SUBST(XOTCL_VERSION) + AC_SUBST(XOTCL_MAJOR_VERSION) + AC_SUBST(XOTCL_MINOR_VERSION) + AC_SUBST(XOTCL_RELEASE_LEVEL) + AC_SUBST(XOTCL_LIB_FILE) + AC_SUBST(XOTCL_BUILD_LIB_SPEC) + AC_SUBST(XOTCL_LIB_SPEC) + AC_SUBST(XOTCL_STUB_LIB_FILE) + AC_SUBST(XOTCL_BUILD_STUB_LIB_SPEC) + AC_SUBST(XOTCL_STUB_LIB_SPEC) + AC_SUBST(XOTCL_SRC_DIR) +]) + Index: library/store/XOTclGdbm/xotclgdbm.c =================================================================== diff -u -N --- library/store/XOTclGdbm/xotclgdbm.c (revision 0) +++ library/store/XOTclGdbm/xotclgdbm.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,369 @@ +/* + * xotclgdbm.c + * + * based on Tclndbm 0.5 by John Ellson (ellson@lucent.com) + */ + +#include +#include +#include +#include +#include +#include + +#if (TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<1) +# define TclObjStr(obj) Tcl_GetStringFromObj(obj, ((int*)NULL)) +#else +# define TclObjStr(obj) Tcl_GetString(obj) +#endif + +typedef struct db_s { + datum* lastSearchKey; + GDBM_FILE db; +} db_t; + +void +gdbmFatalFunc(char* message) { + fprintf(stderr, "GDBM FATAL:\n%s\n", message); + exit(1); +} + +static int +XOTclGdbmOpenMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + db_t *db; + XOTcl_Object* obj = (XOTcl_Object*) cd; + int flags, block_size, mode; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 2) + return XOTclObjErrArgCnt(in, obj->cmdName, "open filename"); + + /* name not in hashtab - create new db */ + if (XOTclGetObjClientData(obj)) + return XOTclVarErrMsg(in, "Called open on '", TclObjStr(obj->cmdName), + "', but open database was not closed before.", 0); + + db = (db_t*) ckalloc (sizeof(db_t)); + db->lastSearchKey = NULL; + + flags = GDBM_WRCREAT; + block_size = 0; + mode = 0644; + + db->db = gdbm_open(TclObjStr(objv[1]), block_size, flags, mode, gdbmFatalFunc); + + if (db->db == NULL) { + ckfree ((char*) db); + db = (db_t*) NULL ; + return XOTclVarErrMsg(in, "Open on '", TclObjStr(obj->cmdName), + "' failed with '", TclObjStr(objv[1]),"': ", + gdbm_strerror(gdbm_errno), 0); + } + /* + * success + */ + XOTclSetObjClientData(obj, (ClientData) db); + return TCL_OK; +} + +static int +XOTclGdbmCloseMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + db_t *db; + XOTcl_Object* obj = (XOTcl_Object *) cd; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 1) + return XOTclObjErrArgCnt(in, obj->cmdName, "close"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called close on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + gdbm_close(db->db); + ckfree ((char*)db); + XOTclSetObjClientData(obj, 0); + + return TCL_OK; +} + +static int +XOTclGdbmNamesMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + XOTcl_Object* obj = (XOTcl_Object *) cd; + Tcl_Obj *list; + db_t *db; + Tcl_DString result; + datum del, key; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 1) + return XOTclObjErrArgCnt(in, obj->cmdName, "names"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called names on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + Tcl_DStringInit(&result); + + key = gdbm_firstkey(db->db); + if (!key.dptr) { + /* empty db */ + return TCL_OK ; + } + + /* + * copy key to result and go to next key + */ + list = Tcl_NewListObj(0, NULL); + do { + Tcl_ListObjAppendElement(in,list,Tcl_NewStringObj(key.dptr,key.dsize-1)); + del.dptr = key.dptr; + key = gdbm_nextkey(db->db, key); + free(del.dptr); + } while (key.dptr); + Tcl_SetObjResult(in, list); + + return TCL_OK; +} + +static int +XOTclGdbmSetMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + XOTcl_Object* obj = (XOTcl_Object *)cd; + db_t *db; + datum key, content; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc <2 || objc > 3) + return XOTclObjErrArgCnt(in, obj->cmdName, "set key ?value?"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called set on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + + key.dptr = TclObjStr(objv[1]); + key.dsize = objv[1]->length + 1; + + if (objc == 2) { + /* get value */ + content = gdbm_fetch(db->db, key); + if (content.dptr) { + /* found */ + Tcl_Obj *r = Tcl_NewStringObj(content.dptr, content.dsize-1); + Tcl_SetObjResult(in, r); + free(content.dptr); + } else { + /* key not found */ + return XOTclVarErrMsg(in, "no such variable '", key.dptr, + "'", 0); + } + } else { + /* set value */ + content.dptr = TclObjStr(objv[2]); + content.dsize = objv[2]->length + 1; + if (gdbm_store(db->db, key, content, GDBM_REPLACE) == 0) { + /*fprintf(stderr,"setting %s to '%s'\n",key.dptr,content.dptr);*/ + Tcl_SetObjResult(in, objv[2]); + } else { + return XOTclVarErrMsg(in, "set of variable '", TclObjStr(obj->cmdName), + "' failed.", 0); + } + } + return TCL_OK; +} + +static int +XOTclGdbmExistsMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + XOTcl_Object* obj = (XOTcl_Object *) cd; + db_t *db; + datum key; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 2) + return XOTclObjErrArgCnt(in, obj->cmdName, "exists variable"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called exists on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + + key.dptr = TclObjStr(objv[1]); + key.dsize = objv[1]->length + 1; + + if (gdbm_exists(db->db, key)) + Tcl_SetIntObj(Tcl_GetObjResult(in), 1); + else + Tcl_SetIntObj(Tcl_GetObjResult(in), 0); + + return TCL_OK; +} + +static int +XOTclGdbmUnsetMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + XOTcl_Object* obj = (XOTcl_Object *) cd; + db_t *db; + datum key; + int ret; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 2) + return XOTclObjErrArgCnt(in, obj->cmdName, "unset key"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + + key.dptr = TclObjStr(objv[1]); + key.dsize = objv[1]->length + 1; + + ret = gdbm_delete(db->db, key); + + if (ret == 0) { + return TCL_OK; + } else { + return XOTclVarErrMsg(in, "Tried to unset '", TclObjStr(objv[1]), + "' but key does not exist.", 0); + } +} + +static int +XOTclGdbmFirstKeyMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + XOTcl_Object* obj = (XOTcl_Object *) cd; + db_t *db; + datum key; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 1) + return XOTclObjErrArgCnt(in, obj->cmdName, "firstkey"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + + if (db->lastSearchKey != 0) { + ckfree((char*) db->lastSearchKey->dptr); + ckfree((char*) db->lastSearchKey); + db->lastSearchKey = 0; + } + + key = gdbm_firstkey(db->db); + if (!key.dptr) { + /* + * empty db + */ + return TCL_OK; + } + + Tcl_AppendResult (in, key.dptr, (char*)0); + + db->lastSearchKey = (datum*) ckalloc(sizeof(datum)); + db->lastSearchKey->dptr = key.dptr; + db->lastSearchKey->dsize = key.dsize; + + return TCL_OK; +} + +static int +XOTclGdbmNextKeyMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + XOTcl_Object* obj = (XOTcl_Object *) cd; + db_t *db; + datum newkey; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 1) + return XOTclObjErrArgCnt(in, obj->cmdName, "nextkey"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + if (db->lastSearchKey == 0) + return XOTclVarErrMsg(in, + "nextkey invoked, but no search was started on '", + TclObjStr(obj->cmdName), "'", 0); + + newkey = gdbm_nextkey(db->db, *db->lastSearchKey); + + if (!newkey.dptr) { + /* + * end of search + */ + if (db->lastSearchKey != 0) { + free((char*) db->lastSearchKey->dptr); + ckfree((char*) db->lastSearchKey); + db->lastSearchKey = 0; + } + return TCL_OK ; + } + + Tcl_AppendResult (in, newkey.dptr, (char*)0); + if (db->lastSearchKey != 0) { + free((char*) db->lastSearchKey->dptr); + } + db->lastSearchKey->dptr = newkey.dptr; + db->lastSearchKey->dsize = newkey.dsize; + return TCL_OK; +} + + +/* + * Xotclgdbm_Init + * register commands, init data structures + */ + +extern int +Xotclgdbm_Init(Tcl_Interp * in) { + XOTcl_Class* cl; + int result; + +#ifdef USE_TCL_STUBS + if (Tcl_InitStubs(in, TCL_VERSION, 0) == NULL) { + return TCL_ERROR; + } +# ifdef USE_XOTCL_STUBS + if (Xotcl_InitStubs(in, "1.1", 0) == NULL) { + return TCL_ERROR; + } +# endif +#else + if (Tcl_PkgRequire(in, "Tcl", TCL_VERSION, 0) == NULL) { + return TCL_ERROR; + } +#endif + Tcl_PkgProvide(in, "xotcl::store::gdbm", PACKAGE_VERSION); + +#ifdef PACKAGE_REQUIRE_XOTL_FROM_SLAVE_INTERP_WORKS_NOW + if (Tcl_PkgRequire(in, "XOTcl", XOTCLVERSION, 0) == NULL) { + return TCL_ERROR; + } +#endif + if (Tcl_PkgRequire(in, "xotcl::store", 0, 0) == NULL) { + return TCL_ERROR; + } + result = Tcl_VarEval (in, + "::xotcl::Class Storage=Gdbm -superclass Storage", + (char *) NULL); + if (result != TCL_OK) + return result; + + cl = XOTclGetClass(in, "Storage=Gdbm"); + XOTclAddIMethod(in, cl, "open", XOTclGdbmOpenMethod, 0, 0); + XOTclAddIMethod(in, cl, "close", XOTclGdbmCloseMethod, 0, 0); + XOTclAddIMethod(in, cl, "set", XOTclGdbmSetMethod, 0, 0); + XOTclAddIMethod(in, cl, "exists", XOTclGdbmExistsMethod, 0, 0); + XOTclAddIMethod(in, cl, "names", XOTclGdbmNamesMethod, 0, 0); + XOTclAddIMethod(in, cl, "unset", XOTclGdbmUnsetMethod, 0, 0); + XOTclAddIMethod(in, cl, "firstkey", XOTclGdbmFirstKeyMethod, 0, 0); + XOTclAddIMethod(in, cl, "nextkey", XOTclGdbmNextKeyMethod, 0, 0); + + Tcl_SetIntObj(Tcl_GetObjResult(in), 1); + return TCL_OK; +} + +extern int +Xotclgdbm_SafeInit(interp) + Tcl_Interp *interp; +{ + return Xotclgdbm_Init(interp); +} Index: library/store/XOTclSdbm/Makefile =================================================================== diff -u -N --- library/store/XOTclSdbm/Makefile (revision 0) +++ library/store/XOTclSdbm/Makefile (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,433 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# Copyright (c) 2002-2003 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,v 1.30 2007/09/13 15:21:54 neumann 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. +#======================================================================== + +#======================================================================== +# The names of the source files is defined in the configure script. +# The object files are used for linking into the final library. +# 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 = hash.c pair.c sdbm.c xotclsdbm.c +PKG_OBJECTS = hash.o pair.o sdbm.o xotclsdbm.o + +PKG_STUB_SOURCES = +PKG_STUB_OBJECTS = + +#======================================================================== +# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with +# this package that need to be installed, if any. +#======================================================================== + +PKG_TCL_SOURCES = + +#======================================================================== +# This is a list of public header files to be installed, if any. +#======================================================================== + +PKG_HEADERS = + +#======================================================================== +# "PKG_LIB_FILE" refers to the library (dynamic or static as per +# configuration options) composed of the named objects. +#======================================================================== + +PKG_LIB_FILE = libxotclsdbm1.2.dylib +PKG_STUB_LIB_FILE = libxotclsdbmstub1.2.a + +lib_BINARIES = $(PKG_LIB_FILE) +BINARIES = $(lib_BINARIES) + +SHELL = /bin/sh + +srcdir = . +prefix = /usr/local/aolserver-4.5 +exec_prefix = /usr/local/aolserver-4.5 + +bindir = ${exec_prefix}/bin +libdir = ${exec_prefix}/lib +datadir = ${prefix}/share +mandir = ${prefix}/man +includedir = ${prefix}/include + +DESTDIR = + +PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) +pkgdatadir = $(datadir)/$(PKG_DIR) +pkglibdir = $(libdir)/$(PKG_DIR) +pkgincludedir = $(includedir)/$(PKG_DIR) + +top_builddir = . + +INSTALL = /usr/bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} + +PACKAGE_NAME = xotclsdbm +PACKAGE_VERSION = 1.2 +CC = gcc +CFLAGS_DEFAULT = -Os +CFLAGS_WARNING = -Wall -Wno-implicit-int +CLEANFILES = pkgIndex.tcl +EXEEXT = +LDFLAGS_DEFAULT = -prebind -headerpad_max_install_names -Wl,-search_paths_first +MAKE_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} +MAKE_SHARED_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} +MAKE_STATIC_LIB = ${STLIB_LD} $@ $(PKG_OBJECTS) +MAKE_STUB_LIB = ${STLIB_LD} $@ $(PKG_STUB_OBJECTS) +OBJEXT = o +RANLIB = : +RANLIB_STUB = ranlib +SHLIB_CFLAGS = -fno-common +SHLIB_LD = ${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT} -Wl,-single_module +SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@ +SHLIB_LD_LIBS = ${LIBS} -L/usr/local/aolserver-4.5/lib -ltclstub8.4 +STLIB_LD = ${AR} cr +TCL_DEFS = -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DHAVE_COREFOUNDATION=1 -DMAC_OSX_TCL=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_MTSAFE_GETHOSTBYNAME=1 -DHAVE_MTSAFE_GETHOSTBYADDR=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_COPYFILE=1 -DHAVE_LIBKERN_OSATOMIC_H=1 -DHAVE_OSSPINLOCKLOCK=1 -DHAVE_PTHREAD_ATFORK=1 -DUSE_VFORK=1 -DTCL_DEFAULT_ENCODING=\"utf-8\" -DTCL_LOAD_FROM_MEMORY=1 -DHAVE_AVAILABILITYMACROS_H=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 +TCL_BIN_DIR = /usr/local/aolserver-4.5/lib +TCL_SRC_DIR = /usr/local/src/tcl8.4.14 +# This is necessary for packages that use private Tcl headers +#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ +# Not used, but retained for reference of what libs Tcl required +TCL_LIBS = ${DL_LIBS} ${LIBS} ${MATH_LIBS} + +#======================================================================== +# 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). +#======================================================================== + +EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) +TCLSH_ENV = TCL_LIBRARY=`echo $(TCL_SRC_DIR)/library` \ + DYLD_LIBRARY_PATH="$(EXTRA_PATH):$(DYLD_LIBRARY_PATH)" \ + PATH="$(EXTRA_PATH):$(PATH)" \ + TCLLIBPATH="$(top_builddir)" +TCLSH_PROG = /usr/local/aolserver-4.5/bin/tclsh8.4 +TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) +SHARED_BUILD = 1 + +INCLUDES = -I/Users/neumann/src/xotcl-1.5.5/generic -I./generic -I"/usr/local/aolserver-4.5/include" + +EXTRA_CFLAGS = + +# TCL_DEFS is not strictly need here, but if you remove it, then you +# must make sure that configure.in 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) -DPACKAGE_NAME=\"xotclsdbm\" -DPACKAGE_TARNAME=\"xotclsdbm\" -DPACKAGE_VERSION=\"1.2\" -DPACKAGE_STRING=\"xotclsdbm\ 1.2\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 $(EXTRA_CFLAGS) +DEFS = -DPACKAGE_NAME=\"xotclsdbm\" -DPACKAGE_TARNAME=\"xotclsdbm\" -DPACKAGE_VERSION=\"1.2\" -DPACKAGE_STRING=\"xotclsdbm\ 1.2\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 $(EXTRA_CFLAGS) + +CONFIG_CLEAN_FILES = Makefile + +CPPFLAGS = +LIBS = -L/Users/neumann/src/xotcl-1.5.5 -lxotclstub1.5.5 -L/Users/neumann/src/xotcl-1.5.5 -lxotcl1.5.5 +AR = ar +CFLAGS = -pipe ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: $(BINARIES) pkgIndex.tcl + +libraries: + +doc: + @echo "If you have documentation to create, place the commands to" + @echo "build the docs in the 'doc:' target. For example:" + @echo " xml2nroff sample.xml > sample.n" + @echo " xml2html sample.xml > sample.html" + +install: all install-binaries install-libraries install-doc + +install-binaries: binaries install-lib-binaries install-bin-binaries + if test "x$(SHARED_BUILD)" = "x1"; then \ + $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ + fi + +#======================================================================== +# This rule installs platform-independent files, such as header files. +#======================================================================== + +install-libraries: libraries + @mkdir -p $(DESTDIR)$(includedir) + @echo "Installing header files in $(DESTDIR)$(includedir)" + @if test -n "$(PKG_HEADERS)" ; then \ + for i in "$(PKG_HEADERS)" ; do \ + echo "Installing $(srcdir)/$$i" ; \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ + done; \ + fi + +#======================================================================== +# Install documentation. Unix manpages should go in the $(mandir) +# directory. +#======================================================================== + +install-doc: doc +#install-doc: doc +# @mkdir -p $(DESTDIR)$(mandir)/mann +# @echo "Installing documentation in $(DESTDIR)$(mandir)" +# @for i in $(srcdir)/doc/*.n; do \ +# echo "Installing $$i"; \ +# rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ +# $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ +# done + +test: binaries libraries + $(TCLSH) `echo $(srcdir)/tests/all.tcl` $(TESTFLAGS) + +shell: binaries libraries + @$(TCLSH) $(SCRIPT) + +gdb: + $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) + +depend: + +#======================================================================== +# $(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". +# +# 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. +#======================================================================== + +$(PKG_LIB_FILE): $(PKG_OBJECTS) + -rm -f $(PKG_LIB_FILE) + ${MAKE_LIB} + $(RANLIB) $(PKG_LIB_FILE) + +$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) + -rm -f $(PKG_STUB_LIB_FILE) + ${MAKE_STUB_LIB} + $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# +# 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 `echo $(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:.... +#======================================================================== + +VPATH = $(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win + +.c.o: + $(COMPILE) -c `echo $<` -o $@ + +#======================================================================== +# Create the pkgIndex.tcl file. +# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but +# you may find that you need to customize the package. If so, either +# modify the -hand version, or create a pkgIndex.tcl.in file and have +# the configure script output the pkgIndex.tcl by editing configure.in. +#======================================================================== + +#pkgIndex.tcl: +# ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) + +pkgIndex.tcl: + (echo 'package ifneeded xotcl::store::sdbm $(PACKAGE_VERSION) \ + [list load [file join $$dir $(PKG_LIB_FILE)]]'\ + ) > pkgIndex.tcl + +#======================================================================== +# Distribution creation +# You may need to tweak this target to make it work correctly. +#======================================================================== + +#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar +COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) +DIST_ROOT = /tmp/dist +DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) + +dist-clean: + rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* + +dist: dist-clean + mkdir -p $(DIST_DIR) + cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ + $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ + $(DIST_DIR)/ + chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 + chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in + + cp -p $(srcdir)/*.[ch] $(DIST_DIR)/ + + mkdir $(DIST_DIR)/tclconfig + cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ + $(DIST_DIR)/tclconfig/ + chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 + chmod +x $(DIST_DIR)/tclconfig/install-sh + + list='demos doc generic library mac tests unix win'; \ + for p in $$list; do \ + if test -d $(srcdir)/$$p ; then \ + mkdir $(DIST_DIR)/$$p; \ + cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ + fi; \ + done + + (cd $(DIST_ROOT); $(COMPRESS);) + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + -test -z "$(BINARIES)" || rm -f $(BINARIES) + -rm -f *.$(OBJEXT) core *.core + -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 + +#======================================================================== +# 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) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: + @mkdir -p $(DESTDIR)$(pkglibdir) + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ + stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ + if test "x$$stub" = "xstub"; then \ + echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ + else \ + echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ + fi; \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + 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; \ + fi; \ + fi; \ + 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; \ + done + +#======================================================================== +# 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. +# +# You should not have to modify this target, except to define bin_BINARIES +# above if necessary. +#======================================================================== + +install-bin-binaries: + @mkdir -p $(DESTDIR)$(bindir) + @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; \ + done + +.SUFFIXES: .c .$(OBJEXT) + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +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; \ + done + +.PHONY: all binaries clean depend distclean doc install libraries test + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: library/store/XOTclSdbm/Makefile.in =================================================================== diff -u -N --- library/store/XOTclSdbm/Makefile.in (revision 0) +++ library/store/XOTclSdbm/Makefile.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,433 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# Copyright (c) 2002-2003 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.5 2007/08/14 16:38:26 neumann 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. +#======================================================================== + +#======================================================================== +# The names of the source files is defined in the configure script. +# The object files are used for linking into the final library. +# 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@ + +PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ +PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ + +#======================================================================== +# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with +# this package that need to be installed, if any. +#======================================================================== + +PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ + +#======================================================================== +# This is a list of public header files to be installed, if any. +#======================================================================== + +PKG_HEADERS = @PKG_HEADERS@ + +#======================================================================== +# "PKG_LIB_FILE" refers to the library (dynamic or static as per +# configuration options) composed of the named objects. +#======================================================================== + +PKG_LIB_FILE = @PKG_LIB_FILE@ +PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ + +lib_BINARIES = $(PKG_LIB_FILE) +BINARIES = $(lib_BINARIES) + +SHELL = @SHELL@ + +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +libdir = @libdir@ +datadir = @datadir@ +mandir = @mandir@ +includedir = @includedir@ + +DESTDIR = + +PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) +pkgdatadir = $(datadir)/$(PKG_DIR) +pkglibdir = $(libdir)/$(PKG_DIR) +pkgincludedir = $(includedir)/$(PKG_DIR) + +top_builddir = . + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ + +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +CC = @CC@ +CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ +CFLAGS_WARNING = @CFLAGS_WARNING@ +CLEANFILES = @CLEANFILES@ +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_FLAGS = @SHLIB_LD_FLAGS@ +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@ +# This is necessary for packages that use private Tcl headers +#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ +# Not used, but retained for reference of what libs Tcl required +TCL_LIBS = @TCL_LIBS@ + +#======================================================================== +# 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). +#======================================================================== + +EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) +TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ + @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ + PATH="$(EXTRA_PATH):$(PATH)" \ + TCLLIBPATH="$(top_builddir)" +TCLSH_PROG = @TCLSH_PROG@ +TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) +SHARED_BUILD = @SHARED_BUILD@ + +INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ + +EXTRA_CFLAGS = @PKG_CFLAGS@ + +# TCL_DEFS is not strictly need here, but if you remove it, then you +# must make sure that configure.in 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@ $(EXTRA_CFLAGS) +DEFS = @DEFS@ $(EXTRA_CFLAGS) + +CONFIG_CLEAN_FILES = Makefile + +CPPFLAGS = @CPPFLAGS@ +LIBS = @PKG_LIBS@ @LIBS@ +AR = ar +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: $(BINARIES) pkgIndex.tcl + +libraries: + +doc: + @echo "If you have documentation to create, place the commands to" + @echo "build the docs in the 'doc:' target. For example:" + @echo " xml2nroff sample.xml > sample.n" + @echo " xml2html sample.xml > sample.html" + +install: all install-binaries install-libraries install-doc + +install-binaries: binaries install-lib-binaries install-bin-binaries + if test "x$(SHARED_BUILD)" = "x1"; then \ + $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ + fi + +#======================================================================== +# This rule installs platform-independent files, such as header files. +#======================================================================== + +install-libraries: libraries + @mkdir -p $(DESTDIR)$(includedir) + @echo "Installing header files in $(DESTDIR)$(includedir)" + @if test -n "$(PKG_HEADERS)" ; then \ + for i in "$(PKG_HEADERS)" ; do \ + echo "Installing $(srcdir)/$$i" ; \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ + done; \ + fi + +#======================================================================== +# Install documentation. Unix manpages should go in the $(mandir) +# directory. +#======================================================================== + +install-doc: doc +#install-doc: doc +# @mkdir -p $(DESTDIR)$(mandir)/mann +# @echo "Installing documentation in $(DESTDIR)$(mandir)" +# @for i in $(srcdir)/doc/*.n; do \ +# echo "Installing $$i"; \ +# rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ +# $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ +# done + +test: binaries libraries + $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) + +shell: binaries libraries + @$(TCLSH) $(SCRIPT) + +gdb: + $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) + +depend: + +#======================================================================== +# $(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". +# +# 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. +#======================================================================== + +$(PKG_LIB_FILE): $(PKG_OBJECTS) + -rm -f $(PKG_LIB_FILE) + ${MAKE_LIB} + $(RANLIB) $(PKG_LIB_FILE) + +$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) + -rm -f $(PKG_STUB_LIB_FILE) + ${MAKE_STUB_LIB} + $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# +# 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:.... +#======================================================================== + +VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win + +.c.@OBJEXT@: + $(COMPILE) -c `@CYGPATH@ $<` -o $@ + +#======================================================================== +# Create the pkgIndex.tcl file. +# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but +# you may find that you need to customize the package. If so, either +# modify the -hand version, or create a pkgIndex.tcl.in file and have +# the configure script output the pkgIndex.tcl by editing configure.in. +#======================================================================== + +#pkgIndex.tcl: +# ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) + +pkgIndex.tcl: + (echo 'package ifneeded xotcl::store::sdbm $(PACKAGE_VERSION) \ + [list load [file join $$dir $(PKG_LIB_FILE)]]'\ + ) > pkgIndex.tcl + +#======================================================================== +# Distribution creation +# You may need to tweak this target to make it work correctly. +#======================================================================== + +#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar +COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) +DIST_ROOT = /tmp/dist +DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) + +dist-clean: + rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* + +dist: dist-clean + mkdir -p $(DIST_DIR) + cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ + $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ + $(DIST_DIR)/ + chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 + chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in + + cp -p $(srcdir)/*.[ch] $(DIST_DIR)/ + + mkdir $(DIST_DIR)/tclconfig + cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ + $(DIST_DIR)/tclconfig/ + chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 + chmod +x $(DIST_DIR)/tclconfig/install-sh + + list='demos doc generic library mac tests unix win'; \ + for p in $$list; do \ + if test -d $(srcdir)/$$p ; then \ + mkdir $(DIST_DIR)/$$p; \ + cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ + fi; \ + done + + (cd $(DIST_ROOT); $(COMPRESS);) + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + -test -z "$(BINARIES)" || rm -f $(BINARIES) + -rm -f *.$(OBJEXT) core *.core + -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 + +#======================================================================== +# 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) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: + @mkdir -p $(DESTDIR)$(pkglibdir) + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ + stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ + if test "x$$stub" = "xstub"; then \ + echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ + else \ + echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ + fi; \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + 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; \ + fi; \ + fi; \ + 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; \ + done + +#======================================================================== +# 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. +# +# You should not have to modify this target, except to define bin_BINARIES +# above if necessary. +#======================================================================== + +install-bin-binaries: + @mkdir -p $(DESTDIR)$(bindir) + @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; \ + done + +.SUFFIXES: .c .$(OBJEXT) + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +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; \ + done + +.PHONY: all binaries clean depend distclean doc install libraries test + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: library/store/XOTclSdbm/Makefile.in-ok =================================================================== diff -u -N --- library/store/XOTclSdbm/Makefile.in-ok (revision 0) +++ library/store/XOTclSdbm/Makefile.in-ok (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,389 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# RCS: @(#) $Id: Makefile.in-ok,v 1.1 2004/05/23 22:50:39 neumann Exp $ + +#======================================================================== +# Edit the following few lines when writing a new extension +#======================================================================== + +configdir=$(srcdir)/../../../config + +#======================================================================== +# 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= +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. +#======================================================================== + +xotclsdbm_SOURCES = \ + $(srcdir)/hash.c \ + $(srcdir)/pair.c \ + $(srcdir)/sdbm.c \ + $(srcdir)/xotclsdbm.c +SOURCES = $(xotclsdbm_SOURCES) + +#======================================================================== +# Enumerate the names of the object files included in this package. +# These objects are created and linked into the final library. In +# most cases these object files will correspond to the source files +# above. +# +#======================================================================== + +xotclsdbm_OBJECTS = \ + ./hash.$(OBJEXT) \ + ./pair.$(OBJEXT) \ + ./sdbm.$(OBJEXT) \ + ./xotclsdbm.$(OBJEXT) +OBJECTS = $(xotclsdbm_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. +#======================================================================== + +xotclsdbm_LIB_FILE = @xotclsdbm_LIB_FILE@ +$(xotclsdbm_LIB_FILE)_OBJECTS = $(xotclsdbm_OBJECTS) + +#======================================================================== +# This is a list of header files to be installed +#======================================================================== + +#GENERIC_HDRS= pair.h sdbm.h tune.h +GENERIC_HDRS= + +#======================================================================== +# Add additional lines to handle any additional AC_SUBST cases that +# have been added to the configure script. +#======================================================================== + +SAMPLE_NEW_VAR=@SAMPLE_NEW_VAR@ + +#======================================================================== +# Nothing of the variables below this line need to be changed. Please +# check the TARGETS section below to make sure the make targets are +# correct. +#======================================================================== + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_FLAG = +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +CC = @CC@ +CFLAGS_DEBUG = @CFLAGS_DEBUG@ +CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ +CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ +CLEANFILES = @CLEANFILES@ +EXEEXT = @EXEEXT@ +LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ +LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ +LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ +MAKE_LIB = @MAKE_LIB@ +MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ +MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ +OBJEXT = @OBJEXT@ +RANLIB = @RANLIB@ +SHLIB_CFLAGS = @SHLIB_CFLAGS@ +SHLIB_LD = @SHLIB_LD@ +SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ +SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ +STLIB_LD = @STLIB_LD@ +TCL_BIN_DIR = @TCL_BIN_DIR@ +TCL_DEFS = @TCL_DEFS@ +TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ +TCL_LD_FLAGS = @TCL_LD_FLAGS@ +TCL_LIBS = @TCL_LIBS@ +TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ +TCL_SRC_DIR = @TCL_SRC_DIR@ +TCL_DBGX = @TCL_DBGX@ +TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ +TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ +TCL_TOOL_DIR_NATIVE = @TCL_TOOL_DIR_NATIVE@ +TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ +TCL_UNIX_DIR_NATIVE = @TCL_UNIX_DIR_NATIVE@ +TCL_WIN_DIR_NATIVE = @TCL_WIN_DIR_NATIVE@ +INCLUDE_DIR_NATIVE = @INCLUDE_DIR_NATIVE@ +TCL_BMAP_DIR_NATIVE = @TCL_BMAP_DIR_NATIVE@ +TCL_PLATFORM_DIR_NATIVE = @TCL_PLATFORM_DIR_NATIVE@ +TCL_GENERIC_DIR_NATIVE = @TCL_GENERIC_DIR_NATIVE@ +TCLSH_PROG = @TCLSH_PROG@ + +AUTOCONF = autoconf + +LDFLAGS = $(LDFLAGS_DEFAULT) + +INCLUDES = @TCL_INCLUDES@ + +EXTRA_CFLAGS = $(TCL_DEFS) $(PROTO_FLAGS) $(SECURITY_FLAGS) $(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) $(NO_DEPRECATED_FLAGS) + +DEFS = @DEFS@ $(EXTRA_CFLAGS) + +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(configdir)/mkinstalldirs +CONFIG_CLEAN_FILES = $(configdir)/mkIndex.tcl + +CPPFLAGS = @CPPFLAGS@ +LIBS = @LIBS@ +AR = ar +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -I@XOTCL_SRC_DIR@/generic +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: + +libraries: $(srcdir)/../$(xotclsdbm_LIB_FILE) + +doc: + +install: all install-binaries install-libraries install-doc + +install-binaries: binaries install-lib-binaries install-bin-binaries + +#======================================================================== +# This rule installs platform-independent files, such as header files. +#======================================================================== + +install-libraries: libraries $(DESTDIR)$(includedir) + @if test ! -z $(GENERIC_HDRS) ; then \ + echo "Installing header files in $(DESTDIR)$(includedir)" ; \ + fi + @for i in $(GENERIC_HDRS) ; do \ + echo "Installing $$i" ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(includedir) ; \ + done; + +#======================================================================== +# Install documentation. Unix manpages should go in the $(mandir) +# directory. +#======================================================================== + +install-doc: + +test: + +depend: + +#======================================================================== +# Enumerate the names of the object files included in this package. +# These objects are created and linked into the final library. In +# most cases these object files will correspond to the source files +# above. +# +# $(exampleA_LIB_FILE) should be listed as part of the BINARIES variable +# at the top of the Makefile. That will ensure that this target is built +# when you run "make binaries". +# +# You shouldn't need to modify this target, except to change the package +# name from "exampleA" to your package's name. +#======================================================================== + +$(xotclsdbm_LIB_FILE): $(xotclsdbm_OBJECTS) + rm -f $@ + @MAKE_LIB@ + $(RANLIB) $@ + +$(srcdir)/../$(xotclsdbm_LIB_FILE): $(xotclsdbm_LIB_FILE) + cp $< $@ + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# Unfortunately, there does not seem to be any other way to do this +# in a Makefile-independent way. We can't use VPATH because it picks up +# object files that may be located in the source directory. +# +# In the following lines, $(srcdir) refers to the toplevel directory +# containing your extension. If your sources are in a subdirectory, +# you will have to modify the paths to reflect this: +# +# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c +# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@ +#======================================================================== + +%.o: $(srcdir)/%.c + $(COMPILE) -c `@CYGPATH@ $<` -o $@ + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + @rm -f $(xotclsdbm_LIB_FILE) $(srcdir)/../$(xotclsdbm_LIB_FILE) \ + *.o core *.core *.$(OBJEXT) $(CLEANFILES) config.log + +distclean: clean + -rm -f *.tab.c + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -rm -f config.status + +#======================================================================== +# Install binary object libraries. On Windows this includes both .dll and +# .lib files. Because the .lib files are not explicitly listed anywhere, +# we need to deduce their existence from the .dll file of the same name. +# Additionally, the .dll files go into the bin directory, but the .lib +# files go into the lib directory. On Unix platforms, all library files +# go into the lib directory. In addition, this will generate the pkgIndex.tcl +# file in the install location (assuming it can find a usable tclsh8.2 shell) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + echo " $(INSTALL_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)$(libdir)/$$lib"; \ + $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \ + fi; \ + else \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \ + fi; \ + else :; fi; \ + done + @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 +# $(TCLSH_PROG) $(configdir)/mkIndex.tcl + +#======================================================================== +# Install binary executables (e.g. .exe files) +# +# You should not have to modify this target. +#======================================================================== + +install-bin-binaries: $(DESTDIR)$(bindir) + @list='$(BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \ + else :; fi; \ + done + +.SUFFIXES: .c .o .obj + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + + +uninstall-binaries: + @$(NORMAL_UNINSTALL) + list='$(BINARIES)'; for p in $$list; do \ + rm -f $(DESTDIR)$(libdir)/$$p; \ + done + +$(DESTDIR)$(includedir): + $(mkinstalldirs) $@ +$(DESTDIR)$(libdir): + $(mkinstalldirs) $@ +$(DESTDIR)$(bindir): + $(mkinstalldirs) $@ + +.PHONY: all binaries clean depend distclean doc install libraries test \ + install-binaries install-bin-binaries install-lib-binaries + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: library/store/XOTclSdbm/Makefile.vc =================================================================== diff -u -N --- library/store/XOTclSdbm/Makefile.vc (revision 0) +++ library/store/XOTclSdbm/Makefile.vc (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,224 @@ +###################################################################### +# +# XOTclSdbm Makefile for Visual C++ +# +###################################################################### + +# Be sure to adapt the "configs.vc" file in the toplevel directory +# to your system settings. +!include "..\..\..\win\configs.vc" + +BINROOT = . +ROOT = .. +NAMEPREFIX = lib +NAME = xotclsdbm +XOTCL_DIR = ..\..\.. +GENERICDIR = . +WINDIR = . + +###################################################################### + +!if $(DEBUG) +TMPNAME = Debug +DBGX = d +!else +TMPNAME = Release +DBGX = +!endif + +TMP_DIR = $(BINROOT)\$(TMPNAME) +OUT_DIR = $(TMP_DIR) + +!if $(STATIC_BUILD) +OUTNAME = $(NAMEPREFIX)$(NAME)$(XOTCL_VERSION)$(DBGX) +TARGET = "$(OUT_DIR)\$(OUTNAME).lib" +!else +OUTNAME = $(NAMEPREFIX)$(NAME)$(XOTCL_VERSION)$(DBGX) +IMPLIB = "$(OUT_DIR)\$(OUTNAME).lib" +TARGET = "$(OUT_DIR)\$(OUTNAME).dll" +!endif + +TCLSTUBLIB = "$(TCLROOT)\win\Release\tclstub$(TCL_VERSION).lib" +TCLIMPLIB = "$(TCLROOT)\win\$(OUT_DIR)\tcl$(TCL_VERSION)$(DBGX).lib" +TCLSH = "$(TCLROOT)\win\$(OUT_DIR)\tclsh$(TCL_VERSION)$(DBGX).exe" + +XOTCLSTUBLIB = "$(XOTCL_DIR)\win\Release\libxotclstub$(XOTCL_VERSION).lib" +XOTCLIMPLIB = "$(XOTCL_DIR)\win\$(OUT_DIR)\libxotcl$(XOTCL_VERSION)$(DBGX).lib" + +LIB_INSTALL_DIR = $(INSTALLDIR)\lib +BIN_INSTALL_DIR = $(INSTALLDIR)\bin +SCRIPT_INSTALL_DIR = $(INSTALLDIR)\lib\xotcl$(XOTCL_VERSION) +INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include + +OBJS = $(TMP_DIR)\hash.obj \ + $(TMP_DIR)\pair.obj \ + $(TMP_DIR)\sdbm.obj \ + $(TMP_DIR)\xotclsdbm.obj \ +!if $(STATIC_BUILD) == 0 + $(TMP_DIR)\dllEntryPoint.obj +!endif + +###################################################################### +# Link flags +###################################################################### + +!if $(DEBUG) +ldebug = -debug:full -debugtype:cv -pdb:none +!else +ldebug = -release -opt:ref +!endif + +# declarations common to all linker options +lcommon = -nologo -link50compat -machine:$(MACHINE) + +LFLAGS = $(lcommon) -subsystem:windows -dll + +!if $(USE_TCL_STUBS) == 0 +LLIBS = $(TCLIMPLIB) $(XOTCLIMPLIB) +!else +### should be: +### LLIBS = $(TCLSTUBLIB) $(XOTCLSTUBLIB) when xotcl stub lib is mature +### LLIBS = $(TCLSTUBLIB) $(XOTCLIMPLIB) +LLIBS = $(TCLSTUBLIB) $(XOTCLSTUBLIB) +!endif + +###################################################################### +# Compile flags +###################################################################### + +!IF $(DEBUG) == 0 +!IF "$(MACHINE)" == "ALPHA" +# MSVC on Alpha doesn't understand -Ot +cdebug = -O2i +!ELSE +cdebug = -Ox +!ENDIF +!ELSE +!if $(MSDEV_VER) < 6 +cdebug = -Zi -Od -WX +!else +cdebug = -ZI -Od -WX +!endif +!ENDIF + +!if $(STATIC_BUILD) +cdll = +!else +cdll = -GD +!endif + +# declarations common to all compiler options +ccommon = -nologo -c -W3 -YX \ + + +!if $(STATIC_BUILD) && $(NOMSVCRT) +crt = -MT$(DBGX) +!else +crt = -MD$(DBGX) +!endif + +INCLUDES = -I"$(TCLROOT)\generic" -I"$(XOTCL_DIR)\generic" + +DEFINES = -DBUILD_$(NAME) -DTCL_THREADS=1 \ + -DXOLIBPKG=$(INST_XOLIBPKG) \ + -DXOTCLVERSION=$(XOTCLVERSION) \ + -DPACKAGE_VERSION=$(XOTCLVERSION) \ + -DVERSION=$(XOTCLVERSION) \ + -DXOTCLPATCHLEVEL=$(XOTCLPATCHLEVEL) \ + -D__WIN32__ -DVISUAL_CC + +EXE_CFLAGS = $(ccommon) $(cdebug) $(crt) $(cdll) $(INCLUDES) $(DEFINES) + +!if $(USE_TCL_STUBS) +#CFLAGS = $(EXE_CFLAGS) -DUSE_TCL_STUBS +CFLAGS = $(EXE_CFLAGS) -DUSE_TCL_STUBS -DUSE_XOTCL_STUBS +!else +CFLAGS = $(EXE_CFLAGS) +!endif + +###################################################################### +# Project specific targets +###################################################################### + +all : libs ./pkgIndex.tcl + +libs : setup $(TARGET) + copy $(TARGET) .. + +setup : + @$(vcvars) > nul + @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) &\ + echo Created directory '$(TMP_DIR)' + @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) &\ + echo Created directory '$(OUT_DIR)' + +$(TARGET) : $(OBJS) +!if $(STATIC_BUILD) + $(lib32) -nologo -machine:$(MACHINE) -out:$@ @<< +!else + $(link32) $(LFLAGS) -base:@$(XOTCL_DIR)\win\dllBase.txt,$@ -out:$@ $(LLIBS) @<< +!endif + $(OBJS) +<< + +./pkgIndex.tcl : $(TARGET) + echo package ifneeded xotcl::store::sdbm $(XOTCL_VERSION) [list load [file join $$dir $(TMPNAME)/$(OUTNAME).dll]] > \ + ".\pkgIndex.tcl" + +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 $(TARGET) "$(SCRIPT_INSTALL_DIR)" + +###################################################################### +# Inference rules. Use batch-mode when supported. +###################################################################### + +!if $(_NMAKE_VER) < 162 +{$(WINDIR)}.c{$(TMP_DIR)}.obj : +!else +{$(WINDIR)}.c{$(TMP_DIR)}.obj :: +!endif + $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +!if $(_NMAKE_VER) < 162 +{$(GENERICDIR)}.c{$(TMP_DIR)}.obj : +!else +{$(GENERICDIR)}.c{$(TMP_DIR)}.obj :: +!endif + $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +#{$(RCDIR)}.rc{$(TMP_DIR)}.res : +# $(rc32) -fo $@ -DDEBUG=$(DEBUG) $(XOTCL_VERSION_DEFINES) $(XOTCL_INCLUDES) $(TCL_INCLUDES) $(XOTCL_DEFINES) $< + +###################################################################### +# Clean up +###################################################################### + +tidy : + -del $(TMP_DIR)\*.pch + -del $(TMP_DIR)\*.obj + -del $(TMP_DIR)\*.res + -del .\*.pch + -del .\*.pdb + +clean : tidy + -del $(OUT_DIR)\*.exp + -del $(OUT_DIR)\*.lib + -del $(OUT_DIR)\*.dll + -del $(OUT_DIR)\*.tcl + -del ..\*.exp + -del ..\*.lib + -del ..\*.dll + +distclean : clean + -rmdir $(OUT_DIR) + -rmdir $(TMP_DIR) + Index: library/store/XOTclSdbm/aclocal.m4 =================================================================== diff -u -N --- library/store/XOTclSdbm/aclocal.m4 (revision 0) +++ library/store/XOTclSdbm/aclocal.m4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,3 @@ +builtin(include,xotcl.m4) +builtin(include,tcl.m4) + Index: library/store/XOTclSdbm/config.log =================================================================== diff -u -N --- library/store/XOTclSdbm/config.log (revision 0) +++ library/store/XOTclSdbm/config.log (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1026 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by xotclsdbm configure 1.2, which was +generated by GNU Autoconf 2.57. Invocation command line was + + $ ./configure --prefix=/usr --enable-threads --prefix=/usr --with-all --cache-file=/dev/null --srcdir=. + +## --------- ## +## Platform. ## +## --------- ## + +hostname = localhost.localdomain +uname -m = i686 +uname -r = 2.4.22-1.2188.nptl +uname -s = Linux +uname -v = #1 Wed Apr 21 20:36:05 EDT 2004 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = i686 +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: . +PATH: /home/neumann/bin +PATH: . +PATH: /home/neumann/bin +PATH: /usr/local/bin +PATH: /usr/bin +PATH: /bin +PATH: /usr/X11R6/bin +PATH: /usr/X11R6/bin +PATH: /sbin +PATH: /usr/sbin +PATH: /opt/bin +PATH: /usr/X11R6/bin +PATH: /sbin +PATH: /usr/sbin +PATH: /opt/bin + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:1294: checking for correct TEA configuration +configure:1313: result: ok +configure:1433: checking for Tcl configuration +configure:1505: result: found /usr/lib/tclConfig.sh +configure:1511: checking for existence of /usr/lib/tclConfig.sh +configure:1515: result: loading +configure:1670: checking for gcc +configure:1686: found /usr/bin/gcc +configure:1696: result: gcc +configure:1940: checking for C compiler version +configure:1943: gcc --version &5 +gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1) +Copyright (C) 2003 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +configure:1946: $? = 0 +configure:1948: gcc -v &5 +Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs +Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux +Thread model: posix +gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) +configure:1951: $? = 0 +configure:1953: gcc -V &5 +gcc: `-V' option must have argument +configure:1956: $? = 1 +configure:1980: checking for C compiler default output +configure:1983: gcc conftest.c >&5 +configure:1986: $? = 0 +configure:2032: result: a.out +configure:2037: checking whether the C compiler works +configure:2043: ./a.out +configure:2046: $? = 0 +configure:2063: result: yes +configure:2070: checking whether we are cross compiling +configure:2072: result: no +configure:2075: checking for suffix of executables +configure:2077: gcc -o conftest conftest.c >&5 +configure:2080: $? = 0 +configure:2105: result: +configure:2111: checking for suffix of object files +configure:2133: gcc -c conftest.c >&5 +configure:2136: $? = 0 +configure:2158: result: o +configure:2162: checking whether we are using the GNU C compiler +configure:2187: gcc -c conftest.c >&5 +configure:2190: $? = 0 +configure:2193: test -s conftest.o +configure:2196: $? = 0 +configure:2209: result: yes +configure:2215: checking whether gcc accepts -g +configure:2237: gcc -c -g conftest.c >&5 +configure:2240: $? = 0 +configure:2243: test -s conftest.o +configure:2246: $? = 0 +configure:2257: result: yes +configure:2274: checking for gcc option to accept ANSI C +configure:2335: gcc -c conftest.c >&5 +configure:2338: $? = 0 +configure:2341: test -s conftest.o +configure:2344: $? = 0 +configure:2362: result: none needed +configure:2380: gcc -c conftest.c >&5 +conftest.c:2: error: syntax error before "me" +configure:2383: $? = 1 +configure: failed program was: +| #ifndef __cplusplus +| choke me +| #endif +configure:2497: checking how to run the C preprocessor +configure:2533: gcc -E conftest.c +configure:2539: $? = 0 +configure:2571: gcc -E conftest.c +configure:2570:28: ac_nonexistent.h: No such file or directory +configure:2577: $? = 1 +configure: failed program was: +| #line 2562 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclsdbm" +| #define PACKAGE_TARNAME "xotclsdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclsdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| /* end confdefs.h. */ +| #include +configure:2615: result: gcc -E +configure:2640: gcc -E conftest.c +configure:2646: $? = 0 +configure:2678: gcc -E conftest.c +configure:2677:28: ac_nonexistent.h: No such file or directory +configure:2684: $? = 1 +configure: failed program was: +| #line 2669 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclsdbm" +| #define PACKAGE_TARNAME "xotclsdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclsdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| /* end confdefs.h. */ +| #include +configure:2739: checking for a BSD-compatible install +configure:2793: result: /usr/bin/install -c +configure:2809: checking whether make sets $(MAKE) +configure:2829: result: yes +configure:2884: checking for ranlib +configure:2900: found /usr/bin/ranlib +configure:2911: result: ranlib +configure:2933: checking for egrep +configure:2943: result: grep -E +configure:2948: checking for ANSI C header files +configure:2974: gcc -c conftest.c >&5 +configure:2977: $? = 0 +configure:2980: test -s conftest.o +configure:2983: $? = 0 +configure:3072: gcc -o conftest conftest.c >&5 +configure:3075: $? = 0 +configure:3077: ./conftest +configure:3080: $? = 0 +configure:3095: result: yes +configure:3119: checking for sys/types.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for sys/stat.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for stdlib.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for string.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for memory.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for strings.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for inttypes.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for stdint.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for unistd.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3178: checking if the compiler understands -pipe +configure:3199: gcc -pipe -c conftest.c >&5 +configure:3202: $? = 0 +configure:3205: test -s conftest.o +configure:3208: $? = 0 +configure:3210: result: yes +configure:3228: checking for required early compiler flags +configure:3252: gcc -pipe -c conftest.c >&5 +configure:3255: $? = 0 +configure:3258: test -s conftest.o +configure:3261: $? = 0 +configure:3338: gcc -pipe -c conftest.c >&5 +configure: In function `main': +configure:3343: error: storage size of `buf' isn't known +configure:3341: $? = 1 +configure: failed program was: +| #line 3321 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclsdbm" +| #define PACKAGE_TARNAME "xotclsdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclsdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| /* end confdefs.h. */ +| #include +| int +| main () +| { +| struct stat64 buf; int i = stat64("/", &buf); +| ; +| return 0; +| } +configure:3372: gcc -pipe -c conftest.c >&5 +configure:3375: $? = 0 +configure:3378: test -s conftest.o +configure:3381: $? = 0 +configure:3407: result: _LARGEFILE64_SOURCE +configure:3412: checking for 64-bit integer type +configure:3435: gcc -pipe -c conftest.c >&5 +configure: In function `main': +configure:3441: error: `__int64' undeclared (first use in this function) +configure:3441: error: (Each undeclared identifier is reported only once +configure:3441: error: for each function it appears in.) +configure:3441: error: syntax error before "value" +configure:3438: $? = 1 +configure: failed program was: +| #line 3418 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclsdbm" +| #define PACKAGE_TARNAME "xotclsdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclsdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| /* end confdefs.h. */ +| +| int +| main () +| { +| __int64 value = (__int64) 0; +| ; +| return 0; +| } +configure:3471: gcc -pipe -o conftest conftest.c >&5 +configure:3474: $? = 0 +configure:3476: ./conftest +configure:3479: $? = 0 +configure:3507: result: long long +configure:3511: checking for struct dirent64 +configure:3535: gcc -pipe -c conftest.c >&5 +configure:3538:24: sys/dirent.h: No such file or directory +configure: In function `main': +configure:3542: error: storage size of `p' isn't known +configure:3538: $? = 1 +configure: failed program was: +| #line 3517 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclsdbm" +| #define PACKAGE_TARNAME "xotclsdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclsdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| /* end confdefs.h. */ +| #include +| #include +| int +| main () +| { +| struct dirent64 p; +| ; +| return 0; +| } +configure:3562: result: no +configure:3565: checking for struct stat64 +configure:3589: gcc -pipe -c conftest.c >&5 +configure:3592: $? = 0 +configure:3595: test -s conftest.o +configure:3598: $? = 0 +configure:3616: result: yes +configure:3619: checking for off64_t +configure:3643: gcc -pipe -c conftest.c >&5 +configure:3646: $? = 0 +configure:3649: test -s conftest.o +configure:3652: $? = 0 +configure:3670: result: yes +configure:3674: checking whether byte ordering is bigendian +configure:3702: gcc -pipe -c conftest.c >&5 +configure:3705: $? = 0 +configure:3708: test -s conftest.o +configure:3711: $? = 0 +configure:3736: gcc -pipe -c conftest.c >&5 +configure: In function `main': +configure:3743: error: `not' undeclared (first use in this function) +configure:3743: error: (Each undeclared identifier is reported only once +configure:3743: error: for each function it appears in.) +configure:3743: error: syntax error before "big" +configure:3739: $? = 1 +configure: failed program was: +| #line 3714 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclsdbm" +| #define PACKAGE_TARNAME "xotclsdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclsdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| #include +| #include +| +| int +| main () +| { +| #if BYTE_ORDER != BIG_ENDIAN +| not big endian +| #endif +| +| ; +| return 0; +| } +configure:3859: result: no +configure:3887: checking for sin +configure:3937: gcc -pipe -o conftest conftest.c >&5 +configure:3930: warning: conflicting types for built-in function `sin' +/tmp/ccK1sUVc.o(.text+0x16): In function `main': +: undefined reference to `sin' +/tmp/ccK1sUVc.o(.data+0x0): undefined reference to `sin' +collect2: ld returned 1 exit status +configure:3940: $? = 1 +configure: failed program was: +| #line 3892 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclsdbm" +| #define PACKAGE_TARNAME "xotclsdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclsdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| /* System header to define __stub macros and hopefully few prototypes, +| which can conflict with char sin (); below. +| Prefer to if __STDC__ is defined, since +| exists even on freestanding compilers. */ +| #ifdef __STDC__ +| # include +| #else +| # include +| #endif +| /* Override any gcc2 internal prototype to avoid an error. */ +| #ifdef __cplusplus +| extern "C" +| { +| #endif +| /* We use char because int might match the return type of a gcc2 +| builtin and then its argument prototype would still apply. */ +| char sin (); +| /* The GNU C library defines this for functions which it implements +| to always fail with ENOSYS. Some functions are actually named +| something starting with __ and the normal name is an alias. */ +| #if defined (__stub_sin) || defined (__stub___sin) +| choke me +| #else +| char (*f) () = sin; +| #endif +| #ifdef __cplusplus +| } +| #endif +| +| int +| main () +| { +| return f != sin; +| ; +| return 0; +| } +configure:3957: result: no +configure:3965: checking for main in -lieee +configure:3990: gcc -pipe -o conftest conftest.c -lieee >&5 +configure:3993: $? = 0 +configure:3996: test -s conftest +configure:3999: $? = 0 +configure:4011: result: yes +configure:4023: checking for main in -linet +configure:4048: gcc -pipe -o conftest conftest.c -linet >&5 +/usr/bin/ld: cannot find -linet +collect2: ld returned 1 exit status +configure:4051: $? = 1 +configure: failed program was: +| #line 4030 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclsdbm" +| #define PACKAGE_TARNAME "xotclsdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclsdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| +| +| int +| main () +| { +| main (); +| ; +| return 0; +| } +configure:4069: result: no +configure:4085: checking net/errno.h usability +configure:4098: gcc -pipe -c conftest.c >&5 +configure:4143:23: net/errno.h: No such file or directory +configure:4101: $? = 1 +configure: failed program was: +| #line 4087 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclsdbm" +| #define PACKAGE_TARNAME "xotclsdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclsdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| #include +| #if HAVE_SYS_TYPES_H +| # include +| #endif +| #if HAVE_SYS_STAT_H +| # include +| #endif +| #if STDC_HEADERS +| # include +| # include +| #else +| # if HAVE_STDLIB_H +| # include +| # endif +| #endif +| #if HAVE_STRING_H +| # if !STDC_HEADERS && HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #if HAVE_STRINGS_H +| # include +| #endif +| #if HAVE_INTTYPES_H +| # include +| #else +| # if HAVE_STDINT_H +| # include +| # endif +| #endif +| #if HAVE_UNISTD_H +| # include +| #endif +| #include +configure:4117: result: no +configure:4121: checking net/errno.h presence +configure:4132: gcc -E conftest.c +configure:4145:23: net/errno.h: No such file or directory +configure:4138: $? = 1 +configure: failed program was: +| #line 4123 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclsdbm" +| #define PACKAGE_TARNAME "xotclsdbm" +| #define PACKAGE_VERSION "1.2" +| #define PACKAGE_STRING "xotclsdbm 1.2" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| #include +configure:4157: result: no +configure:4193: checking for net/errno.h +configure:4200: result: no +configure:4232: checking for connect +configure:4282: gcc -pipe -o conftest conftest.c >&5 +configure:4285: $? = 0 +configure:4288: test -s conftest +configure:4291: $? = 0 +configure:4302: result: yes +configure:4531: checking for gethostbyname +configure:4581: gcc -pipe -o conftest conftest.c >&5 +configure:4584: $? = 0 +configure:4587: test -s conftest +configure:4590: $? = 0 +configure:4601: result: yes +configure:4675: checking dirent.h +configure:4713: gcc -pipe -o conftest conftest.c >&5 +configure:4716: $? = 0 +configure:4719: test -s conftest +configure:4722: $? = 0 +configure:4740: result: yes +configure:4752: checking errno.h usability +configure:4765: gcc -pipe -c conftest.c >&5 +configure:4768: $? = 0 +configure:4771: test -s conftest.o +configure:4774: $? = 0 +configure:4784: result: yes +configure:4788: checking errno.h presence +configure:4799: gcc -E conftest.c +configure:4805: $? = 0 +configure:4824: result: yes +configure:4860: checking for errno.h +configure:4867: result: yes +configure:4891: checking float.h usability +configure:4904: gcc -pipe -c conftest.c >&5 +configure:4907: $? = 0 +configure:4910: test -s conftest.o +configure:4913: $? = 0 +configure:4923: result: yes +configure:4927: checking float.h presence +configure:4938: gcc -E conftest.c +configure:4944: $? = 0 +configure:4963: result: yes +configure:4999: checking for float.h +configure:5006: result: yes +configure:5030: checking values.h usability +configure:5043: gcc -pipe -c conftest.c >&5 +configure:5046: $? = 0 +configure:5049: test -s conftest.o +configure:5052: $? = 0 +configure:5062: result: yes +configure:5066: checking values.h presence +configure:5077: gcc -E conftest.c +configure:5083: $? = 0 +configure:5102: result: yes +configure:5138: checking for values.h +configure:5145: result: yes +configure:5169: checking limits.h usability +configure:5182: gcc -pipe -c conftest.c >&5 +configure:5185: $? = 0 +configure:5188: test -s conftest.o +configure:5191: $? = 0 +configure:5201: result: yes +configure:5205: checking limits.h presence +configure:5216: gcc -E conftest.c +configure:5222: $? = 0 +configure:5241: result: yes +configure:5277: checking for limits.h +configure:5284: result: yes +configure:5299: checking for stdlib.h +configure:5304: result: yes +configure:5495: checking for string.h +configure:5500: result: yes +configure:5687: checking sys/wait.h usability +configure:5700: gcc -pipe -c conftest.c >&5 +configure:5703: $? = 0 +configure:5706: test -s conftest.o +configure:5709: $? = 0 +configure:5719: result: yes +configure:5723: checking sys/wait.h presence +configure:5734: gcc -E conftest.c +configure:5740: $? = 0 +configure:5759: result: yes +configure:5795: checking for sys/wait.h +configure:5802: result: yes +configure:5826: checking dlfcn.h usability +configure:5839: gcc -pipe -c conftest.c >&5 +configure:5842: $? = 0 +configure:5845: test -s conftest.o +configure:5848: $? = 0 +configure:5858: result: yes +configure:5862: checking dlfcn.h presence +configure:5873: gcc -E conftest.c +configure:5879: $? = 0 +configure:5898: result: yes +configure:5934: checking for dlfcn.h +configure:5941: result: yes +configure:5967: checking for limits.h +configure:5972: result: yes +configure:5967: checking for unistd.h +configure:5972: result: yes +configure:5976: checking sys/param.h usability +configure:5989: gcc -pipe -c conftest.c >&5 +configure:5992: $? = 0 +configure:5995: test -s conftest.o +configure:5998: $? = 0 +configure:6008: result: yes +configure:6012: checking sys/param.h presence +configure:6023: gcc -E conftest.c +configure:6029: $? = 0 +configure:6048: result: yes +configure:6084: checking for sys/param.h +configure:6091: result: yes +configure:6139: checking for XOTcl configuration +configure:6200: result: found /home/neumann/xotcl-1.2.1/xotclConfig.sh +configure:6206: checking for existence of /home/neumann/xotcl-1.2.1/xotclConfig.sh +configure:6210: result: loading +configure:6379: checking for Tcl public headers +configure:6434: result: /usr/include +configure:6482: checking for pthread_mutex_init in -lpthread +configure:6513: gcc -pipe -o conftest conftest.c -lpthread >&5 +configure:6516: $? = 0 +configure:6519: test -s conftest +configure:6522: $? = 0 +configure:6534: result: yes +configure:6821: checking for pthread_attr_setstacksize +configure:6871: gcc -pipe -o conftest conftest.c -lpthread >&5 +configure:6874: $? = 0 +configure:6877: test -s conftest +configure:6880: $? = 0 +configure:6891: result: yes +configure:6906: checking for readdir_r +configure:6956: gcc -pipe -o conftest conftest.c >&5 +configure:6959: $? = 0 +configure:6962: test -s conftest +configure:6965: $? = 0 +configure:6976: result: yes +configure:6991: checking for building with threads +configure:6998: result: yes +configure:7037: checking how to build libraries +configure:7055: result: shared +configure:7081: checking if 64bit support is enabled +configure:7090: result: no +configure:7095: checking if 64bit Sparc VIS support is requested +configure:7104: result: no +configure:7132: checking system version (for dynamic loading) +configure:7155: result: Linux-2.4.22-1.2188.nptl +configure:7163: checking for dlopen in -ldl +configure:7194: gcc -pipe -o conftest conftest.c -ldl >&5 +configure:7197: $? = 0 +configure:7200: test -s conftest +configure:7203: $? = 0 +configure:7215: result: yes +configure:7245: checking for ar +configure:7261: found /usr/bin/ar +configure:7271: result: ar +configure:9157: checking for build with symbols +configure:9171: result: no +configure:9306: checking for tclsh +configure:9337: result: /usr/lib/../bin/tclsh8.4 +configure:9481: creating ./config.status + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by xotclsdbm config.status 1.2, which was +generated by GNU Autoconf 2.57. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on localhost.localdomain + +config.status:675: creating Makefile + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_c_bigendian=no +ac_cv_c_compiler_gnu=yes +ac_cv_c_tclconfig=/usr/lib +ac_cv_c_tclh=/usr/include +ac_cv_c_xotclconfig=/home/neumann/xotcl-1.2.1 +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_exeext= +ac_cv_func_connect=yes +ac_cv_func_gethostbyname=yes +ac_cv_func_pthread_attr_setstacksize=yes +ac_cv_func_readdir_r=yes +ac_cv_func_sin=no +ac_cv_header_dlfcn_h=yes +ac_cv_header_errno_h=yes +ac_cv_header_float_h=yes +ac_cv_header_inttypes_h=yes +ac_cv_header_limits_h=yes +ac_cv_header_memory_h=yes +ac_cv_header_net_errno_h=no +ac_cv_header_stdc=yes +ac_cv_header_stdint_h=yes +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_param_h=yes +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_sys_wait_h=yes +ac_cv_header_unistd_h=yes +ac_cv_header_values_h=yes +ac_cv_lib_dl_dlopen=yes +ac_cv_lib_ieee_main=yes +ac_cv_lib_inet_main=no +ac_cv_lib_pthread_pthread_mutex_init=yes +ac_cv_objext=o +ac_cv_path_install='/usr/bin/install -c' +ac_cv_path_tclsh=/usr/lib/../bin/tclsh8.4 +ac_cv_prog_AR=ar +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_RANLIB=ranlib +ac_cv_prog_cc_g=yes +ac_cv_prog_cc_stdc= +ac_cv_prog_egrep='grep -E' +ac_cv_prog_make_make_set=yes +tcl_cv_flag__isoc99_source=no +tcl_cv_flag__largefile64_source=yes +tcl_cv_struct_dirent64=no +tcl_cv_struct_stat64=yes +tcl_cv_type_64bit='long long' +tcl_cv_type_off64_t=yes + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +AR='ar' +CC='gcc -pipe' +CFLAGS=' ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' +CFLAGS_DEBUG='-g' +CFLAGS_DEFAULT='-O' +CFLAGS_OPTIMIZE='-O' +CFLAGS_WARNING='-Wall -Wconversion -Wno-implicit-int' +CLEANFILES='pkgIndex.tcl' +CPP='gcc -E' +CPPFLAGS='' +CYGPATH='echo' +DEFS='-DPACKAGE_NAME=\"xotclsdbm\" -DPACKAGE_TARNAME=\"xotclsdbm\" -DPACKAGE_VERSION=\"1.2\" -DPACKAGE_STRING=\"xotclsdbm\ 1.2\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -DTCL_THREADS=1 -DUSE_TCL_STUBS=1 ' +DL_LIBS='-ldl' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='grep -E' +EXEEXT='' +EXTRA_CFLAGS='' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +LDFLAGS='-rdynamic' +LDFLAGS_DEBUG='' +LDFLAGS_DEFAULT='-rdynamic' +LDFLAGS_OPTIMIZE='' +LD_LIBRARY_PATH_VAR='LD_LIBRARY_PATH' +LIBOBJS='' +LIBS='' +LTLIBOBJS='' +MAKE_LIB='${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_FLAGS} ${SHLIB_LD_LIBS} ' +MAKE_SHARED_LIB='${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_FLAGS} ${SHLIB_LD_LIBS}' +MAKE_STATIC_LIB='${STLIB_LD} $@ $(PKG_OBJECTS)' +MAKE_STUB_LIB='${STLIB_LD} $@ $(PKG_STUB_OBJECTS)' +MATH_LIBS='-lieee -lm' +OBJEXT='o' +PACKAGE_BUGREPORT='' +PACKAGE_NAME='xotclsdbm' +PACKAGE_STRING='xotclsdbm 1.2' +PACKAGE_TARNAME='xotclsdbm' +PACKAGE_VERSION='1.2' +PATH_SEPARATOR=':' +PKG_CFLAGS=' ' +PKG_HEADERS='' +PKG_INCLUDES=' -I/home/neumann/xotcl-1.2.1/generic' +PKG_LIBS=' -L/home/neumann/xotcl-1.2.1 -lxotclstub1.2.1' +PKG_LIB_FILE='libxotclsdbm1.2.so' +PKG_OBJECTS=' hash.o pair.o sdbm.o xotclsdbm.o' +PKG_SOURCES=' hash.c pair.c sdbm.c xotclsdbm.c' +PKG_STUB_LIB_FILE='libxotclsdbmstub1.2.a' +PKG_STUB_OBJECTS='' +PKG_STUB_SOURCES='' +PKG_TCL_SOURCES='' +RANLIB=':' +RANLIB_STUB='ranlib' +SET_MAKE='' +SHARED_BUILD='1' +SHELL='/bin/sh' +SHLIB_CFLAGS='-fPIC' +SHLIB_LD='gcc -pipe -shared' +SHLIB_LD_FLAGS='' +SHLIB_LD_LIBS='${LIBS} -L/usr/lib -ltclstub8.4' +STLIB_LD='${AR} cr' +TCLSH_PROG='/usr/lib/../bin/tclsh8.4' +TCL_BIN_DIR='/usr/lib' +TCL_DBGX='' +TCL_DEFS=' -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DPEEK_XCLOSEIM=1 -DHAVE_SYS_IOCTL_H=1 ' +TCL_EXTRA_CFLAGS='' +TCL_INCLUDES='-I"/usr/include"' +TCL_LD_FLAGS='-rdynamic' +TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' +TCL_LIB_FILE='libtcl8.4.so' +TCL_LIB_FLAG='-ltcl8.4' +TCL_LIB_SPEC='-L/usr/lib -ltcl8.4' +TCL_SHLIB_LD_LIBS='${LIBS}' +TCL_SRC_DIR='/home/neumann/tcl8.4.5' +TCL_STUB_LIB_FILE='libtclstub8.4.a' +TCL_STUB_LIB_FLAG='-ltclstub8.4' +TCL_STUB_LIB_SPEC='-L/usr/lib -ltclstub8.4' +TCL_THREADS='1' +TCL_VERSION='8.4' +XOTCL_BUILD_LIB_SPEC='-L/home/neumann/xotcl-1.2.1 -lxotcl1.2.1' +XOTCL_BUILD_STUB_LIB_SPEC='-L/home/neumann/xotcl-1.2.1 -lxotclstub1.2.1' +XOTCL_LIB_FILE='libxotcl1.2.1.so' +XOTCL_LIB_SPEC='-L/usr/lib -lxotcl1.2.1' +XOTCL_MAJOR_VERSION='1' +XOTCL_MINOR_VERSION='2' +XOTCL_RELEASE_LEVEL='.1' +XOTCL_SRC_DIR='/home/neumann/xotcl-1.2.1' +XOTCL_STUB_LIB_FILE='' +XOTCL_STUB_LIB_SPEC='-L/usr/lib -lxotclstub1.2.1' +XOTCL_VERSION='1.2' +ac_ct_CC='gcc' +ac_ct_RANLIB='ranlib' +bindir='${exec_prefix}/bin' +build_alias='' +datadir='${prefix}/share' +exec_prefix='/usr' +host_alias='' +includedir='${prefix}/include' +infodir='${prefix}/info' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localstatedir='${prefix}/var' +mandir='${prefix}/man' +oldincludedir='/usr/include' +prefix='/usr' +program_transform_name='s,x,x,' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target_alias='' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 +#define HAVE_READDIR_R 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRUCT_STAT64 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_TYPE_OFF64_T 1 +#define HAVE_UNISTD_H 1 +#define HAVE_UNISTD_H 1 +#define PACKAGE_BUGREPORT "" +#define PACKAGE_NAME "xotclsdbm" +#define PACKAGE_STRING "xotclsdbm 1.2" +#define PACKAGE_TARNAME "xotclsdbm" +#define PACKAGE_VERSION "1.2" +#define STDC_HEADERS 1 +#define TCL_THREADS 1 +#define TCL_WIDE_INT_TYPE long long +#define USE_TCL_STUBS 1 +#define USE_THREAD_ALLOC 1 +#define _LARGEFILE64_SOURCE 1 +#define _REENTRANT 1 +#define _THREAD_SAFE 1 + +configure: exit 0 Index: library/store/XOTclSdbm/configure =================================================================== diff -u -N --- library/store/XOTclSdbm/configure (revision 0) +++ library/store/XOTclSdbm/configure (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,10946 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for xotclsdbm 1.2. +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='xotclsdbm' +PACKAGE_TARNAME='xotclsdbm' +PACKAGE_VERSION='1.2' +PACKAGE_STRING='xotclsdbm 1.2' +PACKAGE_BUGREPORT='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures xotclsdbm 1.2 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of xotclsdbm 1.2:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-threads build with threads + --enable-shared build and link with shared libraries (default: on) + --enable-64bit enable 64bit support (default: off) + --enable-64bit-vis enable 64bit Sparc VIS support (default: off) + --enable-wince enable Win/CE support (where applicable) + --enable-load allow dynamic loading and "load" command (default: + on) + --enable-symbols build with debugging symbols (default: off) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH + absolute path to xotclConfig.sh, + --without-xotcl disables, but this is pointless + --with-tcl directory containing tcl configuration + (tclConfig.sh) + --with-tclinclude directory containing the public Tcl header files + --with-celib=DIR use Windows/CE support library from DIR + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +xotclsdbm configure 1.2 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by xotclsdbm $as_me 1.2, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#-------------------------------------------------------------------- +# 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 extensions pass this us the version of TEA they think they + # are compatible with. + TEA_VERSION="3.6" + + echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 +echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 + if test x"${PACKAGE_NAME}" = x ; then + { { echo "$as_me:$LINENO: error: +The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 +echo "$as_me: error: +The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} + { (exit 1); exit 1; }; } + fi + if test x"3.5" = x ; then + { { echo "$as_me:$LINENO: error: +TEA version not specified." >&5 +echo "$as_me: error: +TEA version not specified." >&2;} + { (exit 1); exit 1; }; } + elif test "3.5" != "${TEA_VERSION}" ; then + echo "$as_me:$LINENO: result: warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&5 +echo "${ECHO_T}warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&6 + else + echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 +echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 + fi + case "`uname -s`" in + *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) + # Extract the first word of "cygpath", so it can be a program name with args. +set dummy cygpath; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CYGPATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CYGPATH"; then + ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CYGPATH="cygpath -w" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" +fi +fi +CYGPATH=$ac_cv_prog_CYGPATH +if test -n "$CYGPATH"; then + echo "$as_me:$LINENO: result: $CYGPATH" >&5 +echo "${ECHO_T}$CYGPATH" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + EXEEXT=".exe" + TEA_PLATFORM="windows" + ;; + *) + CYGPATH=echo + EXEEXT="" + TEA_PLATFORM="unix" + ;; + esac + + # Check if exec_prefix is set. If not use fall back to prefix. + # Note when adjusted, so that TEA_PREFIX can correct for this. + # This is needed for recursive configures, since autoconf propagates + # $prefix, but not $exec_prefix (doh!). + if test x$exec_prefix = xNONE ; then + exec_prefix_default=yes + exec_prefix=$prefix + fi + + + + + # This package name must be replaced statically for AC_SUBST to work + + # Substitute STUB_LIB_FILE in case package creates a stub library too. + + + # We AC_SUBST these here to ensure they are subst'ed, + # in case the user doesn't call TEA_ADD_... + + + + + + + + + +ac_aux_dir= +for ac_dir in ../../../config $srcdir/../../../config; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../../config $srcdir/../../../config" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in ../../../config $srcdir/../../../config" >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + + +#-------------------------------------------------------------------- +# specify some extra flags +#-------------------------------------------------------------------- + + +# Check whether --with-xotcl or --without-xotcl was given. +if test "${with_xotcl+set}" = set; then + withval="$with_xotcl" + with_xotcl=$withval +else + { { echo "$as_me:$LINENO: error: --with-xotcl is required" >&5 +echo "$as_me: error: --with-xotcl is required" >&2;} + { (exit 1); exit 1; }; } +fi; + +#-------------------------------------------------------------------- +# Load the tclConfig.sh file +#-------------------------------------------------------------------- + + + + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + with_tclconfig=${withval} +fi; + echo "$as_me:$LINENO: checking for Tcl configuration" >&5 +echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 + if test "${ac_cv_c_tclconfig+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case ${with_tclconfig} in + */tclConfig.sh ) + if test -f ${with_tclconfig}; then + { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 +echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} + with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 +echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tcl.framework/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + +fi + + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 +echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} + exit 0 + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 + fi + fi + + + echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 + + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then + echo "$as_me:$LINENO: result: loading" >&5 +echo "${ECHO_T}loading" >&6 + . "${TCL_BIN_DIR}/tclConfig.sh" + else + echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tcl.framework installed in an arbitary location. + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then + for i in "`cd ${TCL_BIN_DIR}; pwd`" \ + "`cd ${TCL_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then + TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" + break + fi + done + fi + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then + TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + + + + + + + + + + + + + + + + + + + +#-------------------------------------------------------------------- +# Load the tkConfig.sh file if necessary (Tk extension) +#-------------------------------------------------------------------- + +#TEA_PATH_TKCONFIG +#TEA_LOAD_TKCONFIG + +#----------------------------------------------------------------------- +# Handle the --prefix=... option by defaulting to what Tcl gave. +# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. +#----------------------------------------------------------------------- + + + if test "${prefix}" = "NONE"; then + prefix_default=yes + if test x"${TCL_PREFIX}" != x; then + { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 +echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} + prefix=${TCL_PREFIX} + else + { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 +echo "$as_me: --prefix defaulting to /usr/local" >&6;} + prefix=/usr/local + fi + fi + if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ + -o x"${exec_prefix_default}" = x"yes" ; then + if test x"${TCL_EXEC_PREFIX}" != x; then + { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 +echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} + exec_prefix=${TCL_EXEC_PREFIX} + else + { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 +echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} + exec_prefix=$prefix + fi + fi + + +#----------------------------------------------------------------------- +# Standard compiler checks. +# This sets up CC by using the CC env var, or looks for gcc otherwise. +# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create +# the basic setup necessary to compile executables. +#----------------------------------------------------------------------- + + + # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) + # in this macro, they need to go into TEA_SETUP_COMPILER instead. + + # If the user did not set CFLAGS, set it now to keep + # the AC_PROG_CC macro from adding "-g -O2". + if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" + fi + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + + #-------------------------------------------------------------------- + # Checks to see if the make program sets the $MAKE variable. + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + + #-------------------------------------------------------------------- + # Find ranlib + #-------------------------------------------------------------------- + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + #-------------------------------------------------------------------- + # Determines the correct binary file extension (.o, .obj, .exe etc.) + #-------------------------------------------------------------------- + + + + + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. + + + #------------------------------------------------------------------------ + # If we're using GCC, see if the compiler understands -pipe. If so, use it. + # It makes compiling go faster. (This is only a performance feature.) + #------------------------------------------------------------------------ + + if test -z "$no_pipe" -a -n "$GCC"; then + echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 +echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 +if test "${tcl_cv_cc_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_pipe=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_pipe=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 +echo "${ECHO_T}$tcl_cv_cc_pipe" >&6 + if test $tcl_cv_cc_pipe = yes; then + CFLAGS="$CFLAGS -pipe" + fi + fi + + #-------------------------------------------------------------------- + # Common compiler flag setup + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + + if test "${TEA_PLATFORM}" = "unix" ; then + + #-------------------------------------------------------------------- + # On a few very rare systems, all of the libm.a stuff is + # already in libc.a. Set compiler flags accordingly. + # Also, Linux requires the "ieee" library for math to work + # right (and it must appear before "-lm"). + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking for sin" >&5 +echo $ECHO_N "checking for sin... $ECHO_C" >&6 +if test "${ac_cv_func_sin+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define sin to an innocuous variant, in case declares sin. + For example, HP-UX 11i declares gettimeofday. */ +#define sin innocuous_sin + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char sin (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef sin + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char sin (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_sin) || defined (__stub___sin) +choke me +#else +char (*f) () = sin; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != sin; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_sin=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_sin=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 +echo "${ECHO_T}$ac_cv_func_sin" >&6 +if test $ac_cv_func_sin = yes; then + MATH_LIBS="" +else + MATH_LIBS="-lm" +fi + + echo "$as_me:$LINENO: checking for main in -lieee" >&5 +echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 +if test "${ac_cv_lib_ieee_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lieee $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ieee_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ieee_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 +echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 +if test $ac_cv_lib_ieee_main = yes; then + MATH_LIBS="-lieee $MATH_LIBS" +fi + + + #-------------------------------------------------------------------- + # Interactive UNIX requires -linet instead of -lsocket, plus it + # needs net/errno.h to define the socket-related error codes. + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking for main in -linet" >&5 +echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 +if test "${ac_cv_lib_inet_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-linet $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_inet_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_inet_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 +echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 +if test $ac_cv_lib_inet_main = yes; then + LIBS="$LIBS -linet" +fi + + if test "${ac_cv_header_net_errno_h+set}" = set; then + echo "$as_me:$LINENO: checking for net/errno.h" >&5 +echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_net_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking net/errno.h usability" >&5 +echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking net/errno.h presence" >&5 +echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclsdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for net/errno.h" >&5 +echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_net_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_net_errno_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 + +fi +if test $ac_cv_header_net_errno_h = yes; then + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NET_ERRNO_H 1 +_ACEOF + +fi + + + + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- + + tcl_checkBoth=0 + echo "$as_me:$LINENO: checking for connect" >&5 +echo $ECHO_N "checking for connect... $ECHO_C" >&6 +if test "${ac_cv_func_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef connect + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_connect) || defined (__stub___connect) +choke me +#else +char (*f) () = connect; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != connect; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_connect=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +echo "${ECHO_T}$ac_cv_func_connect" >&6 +if test $ac_cv_func_connect = yes; then + tcl_checkSocket=0 +else + tcl_checkSocket=1 +fi + + if test "$tcl_checkSocket" = 1; then + echo "$as_me:$LINENO: checking for setsockopt" >&5 +echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 +if test "${ac_cv_func_setsockopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define setsockopt to an innocuous variant, in case declares setsockopt. + For example, HP-UX 11i declares gettimeofday. */ +#define setsockopt innocuous_setsockopt + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char setsockopt (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef setsockopt + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setsockopt (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_setsockopt) || defined (__stub___setsockopt) +choke me +#else +char (*f) () = setsockopt; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != setsockopt; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_setsockopt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_setsockopt=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 +echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 +if test $ac_cv_func_setsockopt = yes; then + : +else + echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 +echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_setsockopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setsockopt (); +int +main () +{ +setsockopt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_setsockopt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_socket_setsockopt=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 +if test $ac_cv_lib_socket_setsockopt = yes; then + LIBS="$LIBS -lsocket" +else + tcl_checkBoth=1 +fi + +fi + + fi + if test "$tcl_checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + echo "$as_me:$LINENO: checking for accept" >&5 +echo $ECHO_N "checking for accept... $ECHO_C" >&6 +if test "${ac_cv_func_accept+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define accept to an innocuous variant, in case declares accept. + For example, HP-UX 11i declares gettimeofday. */ +#define accept innocuous_accept + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char accept (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef accept + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char accept (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_accept) || defined (__stub___accept) +choke me +#else +char (*f) () = accept; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != accept; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_accept=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_accept=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 +echo "${ECHO_T}$ac_cv_func_accept" >&6 +if test $ac_cv_func_accept = yes; then + tcl_checkNsl=0 +else + LIBS=$tk_oldLibs +fi + + fi + echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_func_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef gethostbyname + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +char (*f) () = gethostbyname; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != gethostbyname; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 +if test $ac_cv_func_gethostbyname = yes; then + : +else + echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_nsl_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_nsl_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 +if test $ac_cv_lib_nsl_gethostbyname = yes; then + LIBS="$LIBS -lnsl" +fi + +fi + + + # Don't perform the eval of the libraries here because DL_LIBS + # won't be set until we call TEA_CONFIG_CFLAGS + + TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' + + + + + echo "$as_me:$LINENO: checking dirent.h" >&5 +echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 +if test "${tcl_cv_dirent_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ + +#ifndef _POSIX_SOURCE +# ifdef __Lynx__ + /* + * Generate compilation error to make the test fail: Lynx headers + * are only valid if really in the POSIX environment. + */ + + missing_procedure(); +# endif +#endif +DIR *d; +struct dirent *entryPtr; +char *p; +d = opendir("foobar"); +entryPtr = readdir(d); +p = entryPtr->d_name; +closedir(d); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_dirent_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_dirent_h=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 +echo "${ECHO_T}$tcl_cv_dirent_h" >&6 + + if test $tcl_cv_dirent_h = no; then + +cat >>confdefs.h <<\_ACEOF +#define NO_DIRENT_H 1 +_ACEOF + + fi + + if test "${ac_cv_header_errno_h+set}" = set; then + echo "$as_me:$LINENO: checking for errno.h" >&5 +echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_errno_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking errno.h usability" >&5 +echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking errno.h presence" >&5 +echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclsdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for errno.h" >&5 +echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_errno_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_errno_h" >&6 + +fi +if test $ac_cv_header_errno_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_ERRNO_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_float_h+set}" = set; then + echo "$as_me:$LINENO: checking for float.h" >&5 +echo $ECHO_N "checking for float.h... $ECHO_C" >&6 +if test "${ac_cv_header_float_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 +echo "${ECHO_T}$ac_cv_header_float_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking float.h usability" >&5 +echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking float.h presence" >&5 +echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclsdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for float.h" >&5 +echo $ECHO_N "checking for float.h... $ECHO_C" >&6 +if test "${ac_cv_header_float_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_float_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 +echo "${ECHO_T}$ac_cv_header_float_h" >&6 + +fi +if test $ac_cv_header_float_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_FLOAT_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_values_h+set}" = set; then + echo "$as_me:$LINENO: checking for values.h" >&5 +echo $ECHO_N "checking for values.h... $ECHO_C" >&6 +if test "${ac_cv_header_values_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 +echo "${ECHO_T}$ac_cv_header_values_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking values.h usability" >&5 +echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking values.h presence" >&5 +echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclsdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for values.h" >&5 +echo $ECHO_N "checking for values.h... $ECHO_C" >&6 +if test "${ac_cv_header_values_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_values_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 +echo "${ECHO_T}$ac_cv_header_values_h" >&6 + +fi +if test $ac_cv_header_values_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_VALUES_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_limits_h+set}" = set; then + echo "$as_me:$LINENO: checking for limits.h" >&5 +echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 +if test "${ac_cv_header_limits_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +echo "${ECHO_T}$ac_cv_header_limits_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking limits.h usability" >&5 +echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking limits.h presence" >&5 +echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclsdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for limits.h" >&5 +echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 +if test "${ac_cv_header_limits_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_limits_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +echo "${ECHO_T}$ac_cv_header_limits_h" >&6 + +fi +if test $ac_cv_header_limits_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIMITS_H 1 +_ACEOF + +else + +cat >>confdefs.h <<\_ACEOF +#define NO_LIMITS_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_stdlib_h+set}" = set; then + echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking stdlib.h usability" >&5 +echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking stdlib.h presence" >&5 +echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclsdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_stdlib_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 + +fi +if test $ac_cv_header_stdlib_h = yes; then + tcl_ok=1 +else + tcl_ok=0 +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtol" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtoul" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtod" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + if test $tcl_ok = 0; then + +cat >>confdefs.h <<\_ACEOF +#define NO_STDLIB_H 1 +_ACEOF + + fi + if test "${ac_cv_header_string_h+set}" = set; then + echo "$as_me:$LINENO: checking for string.h" >&5 +echo $ECHO_N "checking for string.h... $ECHO_C" >&6 +if test "${ac_cv_header_string_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +echo "${ECHO_T}$ac_cv_header_string_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking string.h usability" >&5 +echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking string.h presence" >&5 +echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclsdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for string.h" >&5 +echo $ECHO_N "checking for string.h... $ECHO_C" >&6 +if test "${ac_cv_header_string_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_string_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +echo "${ECHO_T}$ac_cv_header_string_h" >&6 + +fi +if test $ac_cv_header_string_h = yes; then + tcl_ok=1 +else + tcl_ok=0 +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strstr" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strerror" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + + # See also memmove check below for a place where NO_STRING_H can be + # set and why. + + if test $tcl_ok = 0; then + +cat >>confdefs.h <<\_ACEOF +#define NO_STRING_H 1 +_ACEOF + + fi + + if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo "$as_me:$LINENO: checking for sys/wait.h" >&5 +echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 +echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 +echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclsdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for sys/wait.h" >&5 +echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_wait_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 + +fi +if test $ac_cv_header_sys_wait_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_SYS_WAIT_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_dlfcn_h+set}" = set; then + echo "$as_me:$LINENO: checking for dlfcn.h" >&5 +echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 +if test "${ac_cv_header_dlfcn_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 +echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 +echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 +echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclsdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for dlfcn.h" >&5 +echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 +if test "${ac_cv_header_dlfcn_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_dlfcn_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 +echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 + +fi +if test $ac_cv_header_dlfcn_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_DLFCN_H 1 +_ACEOF + +fi + + + + # OS/390 lacks sys/param.h (and doesn't need it, by chance). + +for ac_header in sys/param.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to the xotclsdbm lists. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + # Let the user call this, because if it triggers, they will + # need a compat/strtod.c that is correct. Users can also + # use Tcl_GetDouble(FromObj) instead. + #TEA_BUGGY_STRTOD + fi + + +#-------------------------------------------------------------------- +# Load the xotclConfig.sh file +#-------------------------------------------------------------------- + +{ echo "$as_me:$LINENO: Reading file ${with_xotcl}/xotclConfig.sh" >&5 +echo "$as_me: Reading file ${with_xotcl}/xotclConfig.sh" >&6;} +source ${with_xotcl}/xotclConfig.sh + +#----------------------------------------------------------------------- +# __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. +#----------------------------------------------------------------------- + + + vars="hash.c pair.c sdbm.c xotclsdbm.c" + for i in $vars; do + case $i in + \$*) + # allow $-var names + PKG_SOURCES="$PKG_SOURCES $i" + PKG_OBJECTS="$PKG_OBJECTS $i" + ;; + *) + # check for existence - allows for generic/win/unix VPATH + # To add more dirs here (like 'src'), you have to update VPATH + # in Makefile.in as well + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 +echo "$as_me: error: could not find source file '$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_SOURCES="$PKG_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" + fi + PKG_OBJECTS="$PKG_OBJECTS $j" + ;; + esac + done + + + + + vars="" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 +echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_HEADERS="$PKG_HEADERS $i" + done + + + + vars="-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC}" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + + + + vars="$XOTCL_BUILD_STUB_LIB_SPEC $XOTCL_BUILD_LIB_SPEC" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + + PKG_CFLAGS="$PKG_CFLAGS " + + + + vars="" + for i in $vars; do + # check for existence - allows for generic/win/unix VPATH + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 +echo "$as_me: error: could not find stub source file '$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" + fi + PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" + done + + + + + vars="" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 +echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" + done + + + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_sample in this case) so +# that we create the export library with the dll. +# +# 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. +# +# TEA_ADD_* any platform specific compiler/build info here. +#-------------------------------------------------------------------- + +if test "${TEA_PLATFORM}" = "windows" ; then + cat >>confdefs.h <<\_ACEOF +#define BUILD_sample 1 +_ACEOF + + CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" + #TEA_ADD_SOURCES([win/winFile.c]) + #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) +else + CLEANFILES="pkgIndex.tcl" + #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 +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking for Tcl public headers" >&5 +echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 + + +# Check whether --with-tclinclude or --without-tclinclude was given. +if test "${with_tclinclude+set}" = set; then + withval="$with_tclinclude" + with_tclinclude=${withval} +fi; + + if test "${ac_cv_c_tclh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + # Use the value from --with-tclinclude, if it was given + + if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + ac_cv_c_tclh=${with_tclinclude} + else + { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 +echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} + { (exit 1); exit 1; }; } + fi + else + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers directory + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tcl is not installed, + # and in that situation, look there before installed locations. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + if test x"${TCL_INCLUDE_SPEC}" != x ; then + d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` + list="$list `ls -d ${d} 2>/dev/null`" + fi + fi + for i in $list ; do + if test -f "$i/tcl.h" ; then + ac_cv_c_tclh=$i + break + fi + done + fi + +fi + + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tclh}" = x ; then + { { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 +echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} + { (exit 1); exit 1; }; } + else + echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 +echo "${ECHO_T}${ac_cv_c_tclh}" >&6 + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` + + TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + + +#TEA_PRIVATE_TCL_HEADERS + +#TEA_PUBLIC_TK_HEADERS +#TEA_PRIVATE_TK_HEADERS +#TEA_PATH_X + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +#-------------------------------------------------------------------- + + + # Check whether --enable-threads or --disable-threads was given. +if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + + if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then + TCL_THREADS=1 + + if test "${TEA_PLATFORM}" != "windows" ; then + # We are always OK on Windows, so check what this platform wants: + + # USE_THREAD_ALLOC tells us to try the special thread-based + # allocator that significantly reduces lock contention + +cat >>confdefs.h <<\_ACEOF +#define USE_THREAD_ALLOC 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + if test "`uname -s`" = "SunOS" ; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + fi + +cat >>confdefs.h <<\_ACEOF +#define _THREAD_SAFE 1 +_ACEOF + + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 +if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 +echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char __pthread_mutex_init (); +int +main () +{ +__pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread___pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread___pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 +if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 +if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthreads $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthreads_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthreads_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 +if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 +if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_c_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 +if test $ac_cv_lib_c_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 +if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_c_r_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_r_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 +if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -pthread" + else + TCL_THREADS=0 + { echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 +echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} + fi + fi + fi + fi + fi + else + TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + echo "$as_me:$LINENO: checking for building with threads" >&5 +echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 + if test "${TCL_THREADS}" = 1; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_THREADS 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes (default)" >&5 +echo "${ECHO_T}yes (default)" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + # TCL_THREADS sanity checking. See if our request for building with + # threads is the same as the way Tcl was built. If not, warn the user. + case ${TCL_DEFS} in + *THREADS=1*) + if test "${TCL_THREADS}" = "0"; then + { echo "$as_me:$LINENO: WARNING: + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads." >&5 +echo "$as_me: WARNING: + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads." >&2;} + fi + ;; + *) + if test "${TCL_THREADS}" = "1"; then + { echo "$as_me:$LINENO: WARNING: + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core." >&5 +echo "$as_me: WARNING: + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core." >&2;} + fi + ;; + esac + + + +#-------------------------------------------------------------------- +# The statement below defines a collection of symbols related to +# building as a shared library instead of a static library. +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking how to build libraries" >&5 +echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 + # Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + + if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" ; then + echo "$as_me:$LINENO: result: shared" >&5 +echo "${ECHO_T}shared" >&6 + SHARED_BUILD=1 + else + echo "$as_me:$LINENO: result: static" >&5 +echo "${ECHO_T}static" >&6 + SHARED_BUILD=0 + +cat >>confdefs.h <<\_ACEOF +#define STATIC_BUILD 1 +_ACEOF + + fi + + + +#-------------------------------------------------------------------- +# 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. +#-------------------------------------------------------------------- + + + + + # Step 0.a: Enable 64 bit support? + + echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 +echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 + # Check whether --enable-64bit or --disable-64bit was given. +if test "${enable_64bit+set}" = set; then + enableval="$enable_64bit" + do64bit=$enableval +else + do64bit=no +fi; + echo "$as_me:$LINENO: result: $do64bit" >&5 +echo "${ECHO_T}$do64bit" >&6 + + # Step 0.b: Enable Solaris 64 bit VIS support? + + echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 +echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 + # Check whether --enable-64bit-vis or --disable-64bit-vis was given. +if test "${enable_64bit_vis+set}" = set; then + enableval="$enable_64bit_vis" + do64bitVIS=$enableval +else + do64bitVIS=no +fi; + echo "$as_me:$LINENO: result: $do64bitVIS" >&5 +echo "${ECHO_T}$do64bitVIS" >&6 + + if test "$do64bitVIS" = "yes"; then + # Force 64bit on with VIS + do64bit=yes + fi + + # Step 0.c: Cross-compiling options for Windows/CE builds? + + if test "${TEA_PLATFORM}" = "windows" ; then + echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 +echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 + # Check whether --enable-wince or --disable-wince was given. +if test "${enable_wince+set}" = set; then + enableval="$enable_wince" + doWince=$enableval +else + doWince=no +fi; + echo "$as_me:$LINENO: result: $doWince" >&5 +echo "${ECHO_T}$doWince" >&6 + fi + + # Step 1: set the variable "system" to hold the name and version number + # for the system. + + + echo "$as_me:$LINENO: checking system version" >&5 +echo $ECHO_N "checking system version... $ECHO_C" >&6 +if test "${tcl_cv_sys_version+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "${TEA_PLATFORM}" = "windows" ; then + tcl_cv_sys_version=windows + elif test -f /usr/lib/NextStep/software_version; then + tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + tcl_cv_sys_version=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 +echo "$as_me: WARNING: can't find uname command" >&2;} + tcl_cv_sys_version=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi + fi + fi + +fi +echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 +echo "${ECHO_T}$tcl_cv_sys_version" >&6 + system=$tcl_cv_sys_version + + + # Step 2: check for existence of -ldl library. This is needed because + # Linux can use either -ldl or -ldld for dynamic loading. + + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + have_dl=yes +else + have_dl=no +fi + + + # Require ranlib early so we can override it in special cases below. + + + + # Step 3: set configuration options based on system name and version. + # This is similar to Tcl's unix/tcl.m4 except that we've added a + # "windows" case. + + do64bit_ok=no + LDFLAGS_ORIG="$LDFLAGS" + # When ld needs options to work in 64-bit mode, put them in + # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] + # is disabled by the user. [Bug 1016796] + LDFLAGS_ARCH="" + TCL_EXPORT_FILE_SUFFIX="" + UNSHARED_LIB_SUFFIX="" + TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' + ECHO_VERSION='`echo ${PACKAGE_VERSION}`' + TCL_LIB_VERSIONS_OK=ok + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE=-O + if test "$GCC" = "yes" ; then + CFLAGS_OPTIMIZE=-O2 + CFLAGS_WARNING="-Wall -Wno-implicit-int" + else + CFLAGS_WARNING="" + fi + TCL_NEEDS_EXP_FILE=0 + TCL_BUILD_EXP_FILE="" + TCL_EXP_FILE="" + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STLIB_LD='${AR} cr' + LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" + case $system in + windows) + # This is a 2-stage check to make sure we have the 64-bit SDK + # We have to know where the SDK is installed. + # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs + # MACHINE is IX86 for LINK, but this is used by the manifest, + # which requires x86|amd64|ia64. + MACHINE="X86" + if test "$do64bit" != "no" ; then + if test "x${MSSDK}x" = "xx" ; then + MSSDK="C:/Progra~1/Microsoft Platform SDK" + fi + MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` + PATH64="" + case "$do64bit" in + amd64|x64|yes) + MACHINE="AMD64" ; # default to AMD64 64-bit build + PATH64="${MSSDK}/Bin/Win64/x86/AMD64" + ;; + ia64) + MACHINE="IA64" + PATH64="${MSSDK}/Bin/Win64" + ;; + esac + if test ! -d "${PATH64}" ; then + { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 +echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} + { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 +echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} + do64bit="no" + else + echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 +echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 + do64bit_ok="yes" + fi + fi + + if test "$doWince" != "no" ; then + if test "$do64bit" != "no" ; then + { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 +echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} + { (exit 1); exit 1; }; } + fi + if test "$GCC" = "yes" ; then + { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 +echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} + { (exit 1); exit 1; }; } + fi + + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-celib + + if test x"${no_celib}" = x ; then + # we reset no_celib in case something fails here + no_celib=true + +# Check whether --with-celib or --without-celib was given. +if test "${with_celib+set}" = set; then + withval="$with_celib" + with_celibconfig=${withval} +fi; + echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 +echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 + if test "${ac_cv_c_celibconfig+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + # First check to see if --with-celibconfig was specified. + if test x"${with_celibconfig}" != x ; then + if test -d "${with_celibconfig}/inc" ; then + ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` + else + { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 +echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a celib library + if test x"${ac_cv_c_celibconfig}" = x ; then + for i in \ + ../celib-palm-3.0 \ + ../celib \ + ../../celib-palm-3.0 \ + ../../celib \ + `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ + ${srcdir}/../celib-palm-3.0 \ + ${srcdir}/../celib \ + `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ + ; do + if test -d "$i/inc" ; then + ac_cv_c_celibconfig=`(cd $i; pwd)` + break + fi + done + fi + +fi + + if test x"${ac_cv_c_celibconfig}" = x ; then + { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 +echo "$as_me: error: Cannot find celib support library directory" >&2;} + { (exit 1); exit 1; }; } + else + no_celib= + CELIB_DIR=${ac_cv_c_celibconfig} + CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` + echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 +echo "${ECHO_T}found $CELIB_DIR" >&6 + fi + fi + + # Set defaults for common evc4/PPC2003 setup + # Currently Tcl requires 300+, possibly 420+ for sockets + CEVERSION=420; # could be 211 300 301 400 420 ... + TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... + ARCH=ARM; # could be ARM MIPS X86EM ... + PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" + if test "$doWince" != "yes"; then + # If !yes then the user specified something + # Reset ARCH to allow user to skip specifying it + ARCH= + eval `echo $doWince | awk -F, '{ \ + if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ + if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ + if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ + if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ + if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ + }'` + if test "x${ARCH}" = "x" ; then + ARCH=$TARGETCPU; + fi + fi + OSVERSION=WCE$CEVERSION; + if test "x${WCEROOT}" = "x" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" + if test ! -d "${WCEROOT}" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded Tools" + fi + fi + if test "x${SDKROOT}" = "x" ; then + SDKROOT="C:/Program Files/Windows CE Tools" + if test ! -d "${SDKROOT}" ; then + SDKROOT="C:/Windows CE Tools" + fi + fi + WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` + SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` + if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ + -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then + { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 +echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} + { (exit 1); exit 1; }; } + doWince="no" + else + # We could PATH_NOSPACE these, but that's not important, + # as long as we quote them when used. + CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" + if test -d "${CEINCLUDE}/${TARGETCPU}" ; then + CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" + fi + CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" + fi + fi + + if test "$GCC" != "yes" ; then + if test "${SHARED_BUILD}" = "0" ; then + runtime=-MT + else + runtime=-MD + fi + + if test "$do64bit" != "no" ; then + # All this magic is necessary for the Win64 SDK RC1 - hobbs + CC="\"${PATH64}/cl.exe\"" + CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" + RC="\"${MSSDK}/bin/rc.exe\"" + lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + LINKBIN="\"${PATH64}/link.exe\"" + CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + # Avoid 'unresolved external symbol __security_cookie' + # errors, c.f. http://support.microsoft.com/?id=894573 + + vars="bufferoverflowU.lib" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + elif test "$doWince" != "no" ; then + CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" + if test "${TARGETCPU}" = "X86"; then + CC="\"${CEBINROOT}/cl.exe\"" + else + CC="\"${CEBINROOT}/cl${ARCH}.exe\"" + fi + CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" + RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" + arch=`echo ${ARCH} | awk '{print tolower($0)}'` + defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" + if test "${SHARED_BUILD}" = "1" ; then + # Static CE builds require static celib as well + defs="${defs} _DLL" + fi + for i in $defs ; do + +cat >>confdefs.h <<_ACEOF +#define $i 1 +_ACEOF + + done + +cat >>confdefs.h <<_ACEOF +#define _WIN32_WCE $CEVERSION +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define UNDER_CE $CEVERSION +_ACEOF + + CFLAGS_DEBUG="-nologo -Zi -Od" + CFLAGS_OPTIMIZE="-nologo -Ox" + lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` + lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" + LINKBIN="\"${CEBINROOT}/link.exe\"" + + else + RC="rc" + lflags="-nologo" + LINKBIN="link" + CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + fi + fi + + if test "$GCC" = "yes"; then + # mingw gcc mode + RC="windres" + CFLAGS_DEBUG="-g" + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + SHLIB_LD="$CC -shared" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" + LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" + else + SHLIB_LD="${LINKBIN} -dll ${lflags}" + # link -lib only works when -lib is the first arg + STLIB_LD="${LINKBIN} -lib ${lflags}" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' + PATHTYPE=-w + # For information on what debugtype is most useful, see: + # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp + # This essentially turns it all on. + LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" + LDFLAGS_OPTIMIZE="-release" + if test "$doWince" != "no" ; then + LDFLAGS_CONSOLE="-link ${lflags}" + LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} + else + LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" + LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" + fi + fi + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dll" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' + + TCL_LIB_VERSIONS_OK=nodots + # Bogus to avoid getting this turned off + DL_OBJS="tclLoadNone.obj" + ;; + AIX-*) + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then + # AIX requires the _r compiler when gcc isn't being used + case "${CC}" in + *_r) + # ok ... + ;; + *) + CC=${CC}_r + ;; + esac + echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 +echo "${ECHO_T}Using $CC for compiling with threads" >&6 + fi + LIBS="$LIBS -lc" + SHLIB_CFLAGS="" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + DL_OBJS="tclLoadDl.o" + LD_LIBRARY_PATH_VAR="LIBPATH" + + # Check to enable 64-bit flags for compiler/linker on AIX 4+ + if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then + if test "$GCC" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + else + do64bit_ok=yes + CFLAGS="$CFLAGS -q64" + LDFLAGS_ARCH="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + else + SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' + fi + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then + case $LIBOBJS in + "tclLoadAix.$ac_objext" | \ + *" tclLoadAix.$ac_objext" | \ + "tclLoadAix.$ac_objext "* | \ + *" tclLoadAix.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; +esac + + DL_LIBS="-lld" + fi + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 +echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gettimeofday (); +int +main () +{ +gettimeofday (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bsd_gettimeofday=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bsd_gettimeofday=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 +if test $ac_cv_lib_bsd_gettimeofday = yes; then + libbsd=yes +else + libbsd=no +fi + + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + +cat >>confdefs.h <<\_ACEOF +#define USE_DELTA_FOR_TZ 1 +_ACEOF + + fi + ;; + BeOS*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="${CC} -nostart" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + + #----------------------------------------------------------- + # Check for inet_ntoa in -lbind, for BeOS (which also needs + # -lsocket, even if the network functions are in -lnet which + # is always linked to, for compatibility. + #----------------------------------------------------------- + echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 +echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 +if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbind $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inet_ntoa (); +int +main () +{ +inet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bind_inet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bind_inet_ntoa=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 +if test $ac_cv_lib_bind_inet_ntoa = yes; then + LIBS="$LIBS -lbind -lsocket" +fi + + ;; + BSD/OS-2.1*|BSD/OS-3*) + SHLIB_CFLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD="cc -shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + HP-UX-*.11.*) + # Use updated header definitions where possible + +cat >>confdefs.h <<\_ACEOF +#define _XOPEN_SOURCE_EXTENDED 1 +_ACEOF + + # Needed by Tcl, but not most extensions + #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) + #LIBS="$LIBS -lxnet" # Use the XOPEN network library + + if test "`uname -m`" = "ia64" ; then + SHLIB_SUFFIX=".so" + # Use newer C++ library for C++ extensions + #if test "$GCC" != "yes" ; then + # CPPFLAGS="-AA" + #fi + else + SHLIB_SUFFIX=".sl" + fi + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + SHLIB_LD_LIBS='${LIBS}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc + #CFLAGS="$CFLAGS +DAportable" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + hpux_arch=`${CC} -dumpmachine` + case $hpux_arch in + hppa64*) + # 64-bit gcc in use. Fix flags for GNU ld. + do64bit_ok=yes + SHLIB_LD="${CC} -shared" + SHLIB_LD_LIBS='${LIBS}' + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + *) + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + ;; + esac + else + do64bit_ok=yes + CFLAGS="$CFLAGS +DD64" + LDFLAGS_ARCH="+DD64" + fi + fi + ;; + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + SHLIB_SUFFIX=".sl" + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + ;; + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + ;; + IRIX-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mabi=n32" + LDFLAGS="$LDFLAGS -mabi=n32" + else + case $system in + IRIX-6.3) + # Use to build 6.2 compatible binaries on 6.3. + CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" + ;; + *) + CFLAGS="$CFLAGS -n32" + ;; + esac + LDFLAGS="$LDFLAGS -n32" + fi + ;; + IRIX64-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + + # Check to enable 64-bit flags for compiler/linker + + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 +echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} + else + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS_ARCH="-64" + fi + fi + ;; + Linux*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings + # when you inline the string and math operations. Turn this off to + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + if test $do64bit = yes; then + echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_m64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_m64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_m64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 +echo "${ECHO_T}$tcl_cv_cc_m64" >&6 + if test $tcl_cv_cc_m64 = yes; then + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + fi + fi + + # The combo of gcc + glibc has a bug related + # to inlining of functions like strtod(). The + # -fno-builtin flag should address this problem + # but it does not work. The -fno-inline flag + # is kind of overkill but it works. + # Disable inlining only when one of the + # files in compat/*.c is being linked in. + if test x"${USE_COMPAT}" != x ; then + CFLAGS="$CFLAGS -fno-inline" + fi + + ;; + GNU*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + SHLIB_LD="${CC} -shared" + DL_OBJS="" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + ;; + Lynx*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + CFLAGS_OPTIMIZE=-02 + SHLIB_LD="${CC} -shared " + DL_OBJS="tclLoadDl.o" + DL_LIBS="-mshared -ldl" + LD_FLAGS="-Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + ;; + MP-RAS-02*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + MP-RAS-*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,-Bexport" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + NetBSD-*|FreeBSD-[1-2].*) + # NetBSD/SPARC needs -fPIC, -fpic will not do. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + echo "$as_me:$LINENO: checking for ELF" >&5 +echo $ECHO_N "checking for ELF... $ECHO_C" >&6 +if test "${tcl_cv_ld_elf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef __ELF__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + tcl_cv_ld_elf=yes +else + tcl_cv_ld_elf=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 +echo "${ECHO_T}$tcl_cv_ld_elf" >&6 + if test $tcl_cv_ld_elf = yes; then + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + else + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + fi + + # Ancient FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + OpenBSD-*) + # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. + case `machine` in + sparc|sparc64) + SHLIB_CFLAGS="-fPIC";; + *) + SHLIB_CFLAGS="-fpic";; + esac + SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + echo "$as_me:$LINENO: checking for ELF" >&5 +echo $ECHO_N "checking for ELF... $ECHO_C" >&6 +if test "${tcl_cv_ld_elf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef __ELF__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + tcl_cv_ld_elf=yes +else + tcl_cv_ld_elf=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 +echo "${ECHO_T}$tcl_cv_ld_elf" >&6 + if test $tcl_cv_ld_elf = yes; then + LDFLAGS=-Wl,-export-dynamic + else + LDFLAGS="" + fi + + # OpenBSD doesn't do version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "${TCL_THREADS}" = "1" ; then + # The -pthread needs to go in the CFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + case $system in + FreeBSD-3.*) + # FreeBSD-3 doesn't handle version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + TCL_LIB_VERSIONS_OK=nodots + ;; + esac + ;; + Darwin-*) + CFLAGS_OPTIMIZE="-Os" + SHLIB_CFLAGS="-fno-common" + # To avoid discrepancies between what headers configure sees during + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: + CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" + if test $do64bit = yes; then + case `arch` in + ppc) + echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_ppc64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_arch_ppc64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_ppc64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 + if test $tcl_cv_cc_arch_ppc64 = yes; then + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + do64bit_ok=yes + fi;; + i386) + echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_x86_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch x86_64" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_arch_x86_64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_x86_64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 + if test $tcl_cv_cc_arch_x86_64 = yes; then + CFLAGS="$CFLAGS -arch x86_64" + do64bit_ok=yes + fi;; + *) + { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 +echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; + esac + else + # Check for combined 32-bit and 64-bit fat build + echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ + echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ + fat_32_64=yes + fi + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' + echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 +echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_single_module+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_single_module=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_single_module=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 +echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 + if test $tcl_cv_ld_single_module = yes; then + SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + fi + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" + DL_LIBS="" + # Don't use -prebind when building for Mac OS X 10.4 or later only: + test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \ + LDFLAGS="$LDFLAGS -prebind" + LDFLAGS="$LDFLAGS -headerpad_max_install_names" + echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 +echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_search_paths_first+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_search_paths_first=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_search_paths_first=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 +echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 + if test $tcl_cv_ld_search_paths_first = yes; then + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + + # TEA specific: for Tk extensions, remove 64-bit arch flags from + # CFLAGS et al. for combined 32 & 64 bit fat builds as neither + # TkAqua nor TkX11 can be built for 64-bit at present. + test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done + ;; + NEXTSTEP-*) + SHLIB_CFLAGS="" + SHLIB_LD="cc -nostdlib -r" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadNext.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OS/390-*) + CFLAGS_OPTIMIZE="" # Optimizer is buggy + +cat >>confdefs.h <<\_ACEOF +#define _OE_SOCKETS 1 +_ACEOF + + ;; + OSF1-1.0|OSF1-1.1|OSF1-1.2) + # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + SHLIB_CFLAGS="" + # Hack: make package name same as library name + SHLIB_LD='ld -R -export :' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadOSF.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-1.*) + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SHLIB_CFLAGS="-fPIC" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD="ld -shared" + else + SHLIB_LD="ld -non_shared" + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-V*) + # Digital OSF/1 + SHLIB_CFLAGS="" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD='ld -shared -expect_unresolved "*"' + else + SHLIB_LD='ld -non_shared -expect_unresolved "*"' + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mieee" + else + CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" + fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = "1" ; then + CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" + CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + LIBS=`echo $LIBS | sed s/-lpthreads//` + if test "$GCC" = "yes" ; then + LIBS="$LIBS -lpthread -lmach -lexc" + else + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + fi + + ;; + QNX-6*) + # QNX RTP + # This may work for all QNX, but it was only reported for v6. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + # dlopen is in -lc on QNX + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SCO_SV-3.2*) + # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # this test works, since "uname -s" was non-standard in 3.2.4 and + # below. + if test "$GCC" = "yes" ; then + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + else + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + fi + SHLIB_LD="ld -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SINIX*5.4*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SunOS-4*) + SHLIB_CFLAGS="-PIC" + SHLIB_LD="ld" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + + # SunOS can't handle version numbers with dots in them in library + # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it + # requires an extra version number at the end of .so file names. + # So, the library has to have a name like libtcl75.so.1.0 + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + SunOS-5.[0-6]) + # Careful to not let 5.10+ fall into this case + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + + SHLIB_CFLAGS="-KPIC" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + ;; + SunOS-5*) + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + + SHLIB_CFLAGS="-KPIC" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + arch=`isainfo` + if test "$arch" = "sparcv9 sparc" ; then + if test "$GCC" = "yes" ; then + if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} + else + do64bit_ok=yes + CFLAGS="$CFLAGS -m64 -mcpu=v9" + LDFLAGS="$LDFLAGS -m64 -mcpu=v9" + SHLIB_CFLAGS="-fPIC" + fi + else + do64bit_ok=yes + if test "$do64bitVIS" = "yes" ; then + CFLAGS="$CFLAGS -xarch=v9a" + LDFLAGS_ARCH="-xarch=v9a" + else + CFLAGS="$CFLAGS -xarch=v9" + LDFLAGS_ARCH="-xarch=v9" + fi + # Solaris 64 uses this as well + #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" + fi + elif test "$arch" = "amd64 i386" ; then + if test "$GCC" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + else + do64bit_ok=yes + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64" + fi + else + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 +echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} + fi + fi + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "$do64bit_ok" = "yes" ; then + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + fi + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + fi + ;; + UNIX_SV* | UnixWare-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 +echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_Bexport+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-Bexport" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_Bexport=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_Bexport=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 +echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 + if test $tcl_cv_ld_Bexport = yes; then + LDFLAGS="$LDFLAGS -Wl,-Bexport" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + esac + + if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then + { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 +echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} + fi + + + + # Step 4: disable dynamic loading if requested via a command-line switch. + + # Check whether --enable-load or --disable-load was given. +if test "${enable_load+set}" = set; then + enableval="$enable_load" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + if test "$tcl_ok" = "no"; then + DL_OBJS="" + fi + + if test "x$DL_OBJS" != "x" ; then + BUILD_DLTEST="\$(DLTEST_TARGETS)" + else + echo "Can't figure out how to do dynamic loading or shared libraries" + echo "on this system." + SHLIB_CFLAGS="" + SHLIB_LD="" + SHLIB_SUFFIX="" + DL_OBJS="tclLoadNone.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS_ORIG" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + BUILD_DLTEST="" + fi + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" + + # If we're running gcc, then change the C flags for compiling shared + # libraries to the right flags for gcc, instead of those for the + # standard manufacturer compiler. + + if test "$DL_OBJS" != "tclLoadNone.o" ; then + if test "$GCC" = "yes" ; then + case $system in + AIX-*) + ;; + BSD/OS*) + ;; + IRIX*) + ;; + NetBSD-*|FreeBSD-*) + ;; + Darwin-*) + ;; + SCO_SV-3.2*) + ;; + windows) + ;; + *) + SHLIB_CFLAGS="-fPIC" + ;; + esac + fi + fi + + if test "$SHARED_LIB_SUFFIX" = "" ; then + SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' + fi + if test "$UNSHARED_LIB_SUFFIX" = "" ; then + UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' + fi + + + + + + + + + + + + + + + + # These must be called after we do the basic CFLAGS checks and + # verify any possible 64-bit or similar switches are necessary + + echo "$as_me:$LINENO: checking for required early compiler flags" >&5 +echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 + tcl_flags="" + + if test "${tcl_cv_flag__isoc99_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *)strtoll; char *q = (char *)strtoull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__isoc99_source=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _ISOC99_SOURCE 1 +#include +int +main () +{ +char *p = (char *)strtoll; char *q = (char *)strtoull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__isoc99_source=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__isoc99_source=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _ISOC99_SOURCE 1 +_ACEOF + + tcl_flags="$tcl_flags _ISOC99_SOURCE" + fi + + + if test "${tcl_cv_flag__largefile64_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile64_source=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE64_SOURCE 1 +#include +int +main () +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile64_source=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__largefile64_source=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _LARGEFILE64_SOURCE 1 +_ACEOF + + tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" + fi + + + if test "${tcl_cv_flag__largefile_source64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *)open64; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile_source64=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE64 1 +#include +int +main () +{ +char *p = (char *)open64; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile_source64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__largefile_source64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _LARGEFILE_SOURCE64 1 +_ACEOF + + tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" + fi + + if test "x${tcl_flags}" = "x" ; then + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 + else + echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 +echo "${ECHO_T}${tcl_flags}" >&6 + fi + + + echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 +echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 + if test "${tcl_cv_type_64bit+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +__int64 value = (__int64) 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_type_64bit=__int64 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_type_64bit="long long" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +switch (0) { + case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; + } + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_type_64bit=${tcl_type_64bit} +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "${tcl_cv_type_64bit}" = none ; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_WIDE_INT_IS_LONG 1 +_ACEOF + + echo "$as_me:$LINENO: result: using long" >&5 +echo "${ECHO_T}using long" >&6 + elif test "${tcl_cv_type_64bit}" = "__int64" \ + -a "${TEA_PLATFORM}" = "windows" ; then + # We actually want to use the default tcl.h checks in this + # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* + echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 +echo "${ECHO_T}using Tcl header defaults" >&6 + else + +cat >>confdefs.h <<_ACEOF +#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} +_ACEOF + + echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 +echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 + + # Now check for auxiliary declarations + echo "$as_me:$LINENO: checking for struct dirent64" >&5 +echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 +if test "${tcl_cv_struct_dirent64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +struct dirent64 p; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_struct_dirent64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_struct_dirent64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 +echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_DIRENT64 1 +_ACEOF + + fi + + echo "$as_me:$LINENO: checking for struct stat64" >&5 +echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 +if test "${tcl_cv_struct_stat64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +struct stat64 p; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_struct_stat64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_struct_stat64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 +echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_STAT64 1 +_ACEOF + + fi + + + +for ac_func in open64 lseek64 +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + echo "$as_me:$LINENO: checking for off64_t" >&5 +echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 + if test "${tcl_cv_type_off64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +off64_t offset; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_type_off64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_type_off64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_type_off64_t}" = "xyes" && \ + test "x${ac_cv_func_lseek64}" = "xyes" && \ + test "x${ac_cv_func_open64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_TYPE_OFF64_T 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + fi + + + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols option. +#-------------------------------------------------------------------- + + + + echo "$as_me:$LINENO: checking for build with symbols" >&5 +echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 + # Check whether --enable-symbols or --disable-symbols was given. +if test "${enable_symbols+set}" = set; then + enableval="$enable_symbols" + tcl_ok=$enableval +else + tcl_ok=no +fi; + DBGX="" + if test "$tcl_ok" = "no"; then + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + else + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" + if test "$tcl_ok" = "yes"; then + echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 +echo "${ECHO_T}yes (standard debugging)" >&6 + fi + fi + if test "${TEA_PLATFORM}" != "windows" ; then + LDFLAGS_DEFAULT="${LDFLAGS}" + fi + + + + + + if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_MEM_DEBUG 1 +_ACEOF + + fi + + if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then + if test "$tcl_ok" = "all"; then + echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 +echo "${ECHO_T}enabled symbols mem debugging" >&6 + else + echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 +echo "${ECHO_T}enabled $tcl_ok debugging" >&6 + fi + 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. Add Tk too if necessary. +#-------------------------------------------------------------------- + +cat >>confdefs.h <<\_ACEOF +#define USE_TCL_STUBS 1 +_ACEOF + +#AC_DEFINE(USE_TK_STUBS) + +#-------------------------------------------------------------------- +# 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. +#-------------------------------------------------------------------- + + + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then + MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" + MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" + else + MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" + MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" + fi + + if test "${SHARED_BUILD}" = "1" ; then + MAKE_LIB="${MAKE_SHARED_LIB} " + else + MAKE_LIB="${MAKE_STATIC_LIB} " + fi + + #-------------------------------------------------------------------- + # Shared libraries and static libraries have different names. + # Use the double eval to make sure any variables in the suffix is + # substituted. (@@@ Might not be necessary anymore) + #-------------------------------------------------------------------- + + if test "${TEA_PLATFORM}" = "windows" ; then + if test "${SHARED_BUILD}" = "1" ; then + # We force the unresolved linking of symbols that are really in + # the private libraries of Tcl and Tk. + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" + fi + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + else + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + if test "$GCC" = "yes"; then + PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} + fi + # These aren't needed on Windows (either MSVC or gcc) + RANLIB=: + RANLIB_STUB=: + else + RANLIB_STUB="${RANLIB}" + if test "${SHARED_BUILD}" = "1" ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" + fi + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + fi + + # These are escaped so that only CFLAGS is picked up at configure time. + # The other values will be substituted at make time. + CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" + if test "${SHARED_BUILD}" = "1" ; then + CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" + fi + + + + + + + + +#-------------------------------------------------------------------- +# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl +# file during the install process. Don't run the TCLSH_PROG through +# ${CYGPATH} because it's being used directly by make. +# Require that we use a tclsh shell version 8.2 or later since earlier +# versions have bugs in the pkg_mkIndex routine. +# Add WISH as well if this is a Tk extension. +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking for tclsh" >&5 +echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 + if test -f "${TCL_BIN_DIR}/Makefile" ; then + # tclConfig.sh is in Tcl build directory + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="${TCL_BIN_DIR}/tclsh" + fi + else + # tclConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" + fi + list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${TCLSH_PROG}" ; then + REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" + fi + echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 +echo "${ECHO_T}${TCLSH_PROG}" >&6 + + +#TEA_PROG_WISH + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile. +# You may alternatively have a special pkgIndex.tcl.in or other files +# which require substituting th AC variables in. Include these here. +#-------------------------------------------------------------------- + + ac_config_files="$ac_config_files Makefile" +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by xotclsdbm $as_me 1.2, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +xotclsdbm config.status 1.2 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@CYGPATH@,$CYGPATH,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t +s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t +s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t +s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t +s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t +s,@PKG_HEADERS@,$PKG_HEADERS,;t t +s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t +s,@PKG_LIBS@,$PKG_LIBS,;t t +s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t +s,@TCL_VERSION@,$TCL_VERSION,;t t +s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t +s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t +s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t +s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t +s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t +s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t +s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t +s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t +s,@TCL_LIBS@,$TCL_LIBS,;t t +s,@TCL_DEFS@,$TCL_DEFS,;t t +s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t +s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t +s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@EGREP@,$EGREP,;t t +s,@MATH_LIBS@,$MATH_LIBS,;t t +s,@PKG_SOURCES@,$PKG_SOURCES,;t t +s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t +s,@CLEANFILES@,$CLEANFILES,;t t +s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t +s,@TCL_THREADS@,$TCL_THREADS,;t t +s,@SHARED_BUILD@,$SHARED_BUILD,;t t +s,@AR@,$AR,;t t +s,@CELIB_DIR@,$CELIB_DIR,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@DL_LIBS@,$DL_LIBS,;t t +s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t +s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t +s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t +s,@STLIB_LD@,$STLIB_LD,;t t +s,@SHLIB_LD@,$SHLIB_LD,;t t +s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t +s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t +s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t +s,@TCL_DBGX@,$TCL_DBGX,;t t +s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t +s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t +s,@MAKE_LIB@,$MAKE_LIB,;t t +s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t +s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t +s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t +s,@RANLIB_STUB@,$RANLIB_STUB,;t t +s,@TCLSH_PROG@,$TCLSH_PROG,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: library/store/XOTclSdbm/configure.in =================================================================== diff -u -N --- library/store/XOTclSdbm/configure.in (revision 0) +++ library/store/XOTclSdbm/configure.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,244 @@ +#!/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. +# +# RCS: @(#) $Id: configure.in,v 1.20 2007/10/12 19:53:32 neumann Exp $ + +#----------------------------------------------------------------------- +# Sample configure.in for Tcl Extensions. The only places you should +# need to modify this file are marked by the string __CHANGE__ +#----------------------------------------------------------------------- + +configdir=$(srcdir)/../../../config + +#----------------------------------------------------------------------- +# __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. +#----------------------------------------------------------------------- + +AC_INIT([xotclsdbm], [1.2]) + +#-------------------------------------------------------------------- +# 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([3.5]) + +AC_CONFIG_AUX_DIR(../../../config) + +#-------------------------------------------------------------------- +# specify some extra flags +#-------------------------------------------------------------------- + +AC_ARG_WITH(xotcl, + [ --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH + absolute path to xotclConfig.sh, + --without-xotcl disables, but this is pointless], + [with_xotcl=$withval], [AC_MSG_ERROR([--with-xotcl is required])]) + +#-------------------------------------------------------------------- +# 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 + +#----------------------------------------------------------------------- +# 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, AC_PROG_INSTALL and a few others to create +# the basic setup necessary to compile executables. +#----------------------------------------------------------------------- + +TEA_SETUP_COMPILER + +#-------------------------------------------------------------------- +# Load the xotclConfig.sh file +#-------------------------------------------------------------------- + +AC_MSG_NOTICE([Reading file ${with_xotcl}/xotclConfig.sh]) +source ${with_xotcl}/xotclConfig.sh + +#----------------------------------------------------------------------- +# __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([hash.c pair.c sdbm.c xotclsdbm.c]) +TEA_ADD_HEADERS([]) +TEA_ADD_INCLUDES([-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC}]) +TEA_ADD_LIBS([$XOTCL_BUILD_STUB_LIB_SPEC $XOTCL_BUILD_LIB_SPEC]) +TEA_ADD_CFLAGS([]) +TEA_ADD_STUB_SOURCES([]) +TEA_ADD_TCL_SOURCES([]) + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_sample in this case) so +# that we create the export library with the dll. +# +# 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. +# +# TEA_ADD_* any platform specific compiler/build info here. +#-------------------------------------------------------------------- + +if test "${TEA_PLATFORM}" = "windows" ; then + AC_DEFINE(BUILD_sample) + CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" + #TEA_ADD_SOURCES([win/winFile.c]) + #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) +else + CLEANFILES="pkgIndex.tcl" + #TEA_ADD_SOURCES([unix/unixFile.c]) + #TEA_ADD_LIBS([-lsuperfly]) +fi +AC_SUBST(CLEANFILES) + +#-------------------------------------------------------------------- +# __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 + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +#-------------------------------------------------------------------- + +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 + +#-------------------------------------------------------------------- +# 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. Add Tk too if necessary. +#-------------------------------------------------------------------- + +AC_DEFINE(USE_TCL_STUBS) +#AC_DEFINE(USE_TK_STUBS) + +#-------------------------------------------------------------------- +# 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 + +#-------------------------------------------------------------------- +# 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. +# Add WISH as well if this is a Tk extension. +#-------------------------------------------------------------------- + +TEA_PROG_TCLSH +#TEA_PROG_WISH + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile. +# You may alternatively have a special pkgIndex.tcl.in or other files +# which require substituting th AC variables in. Include these here. +#-------------------------------------------------------------------- + +AC_OUTPUT([Makefile]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: library/store/XOTclSdbm/configure.in-ok =================================================================== diff -u -N --- library/store/XOTclSdbm/configure.in-ok (revision 0) +++ library/store/XOTclSdbm/configure.in-ok (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,312 @@ +#-------------------------------------------------------------------- +# 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(./xotclsdbm.c) +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=xotclsdbm + +# do not modify the following lines manually, they are generated with changeXOTclVersion +XOTCL_MAJOR_VERSION=1 +XOTCL_MINOR_VERSION=2 +XOTCL_RELEASE_LEVEL=.1 + +MAJOR_VERSION=${XOTCL_MAJOR_VERSION} +MINOR_VERSION=${XOTCL_MINOR_VERSION} +PATCHLEVEL=${XOTCL_RELEASE_LEVEL} + +VERSION=${MAJOR_VERSION}.${MINOR_VERSION} +NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION} + +AC_SUBST(PATCHLEVEL) +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" + ;; + *) + CYGPATH=echo + ;; +esac + +AC_SUBST(CYGPATH) + +#-------------------------------------------------------------------- +# __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 before SC_PATH_TCLCONFIG/SC_LOAD_TCLCONFIG +#-------------------------------------------------------------------- + +#SC_PUBLIC_TCL_HEADERS +SC_PRIVATE_TCL_HEADERS + +if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + TCL_INCLUDES="-I${with_tclinclude} ${TCL_INCLUDES}" + else + AC_MSG_ERROR([${with_tclinclude} directory does not contain Tcl header file tcl.h]) + fi +fi + +#-------------------------------------------------------------------- +# Load the tclConfig.sh file +#-------------------------------------------------------------------- + +SC_PATH_TCLCONFIG +SC_LOAD_TCLCONFIG + +#-------------------------------------------------------------------- +# Load the xotclConfig.sh file +#-------------------------------------------------------------------- + +SC_PATH_XOTCLCONFIG +SC_LOAD_XOTCLCONFIG + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_exampleA 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(BUILD_xotclsdbm) + CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch vc60.pch" + AC_SUBST(CLEANFILES) + ;; + *) + CLEANFILES= + ;; +esac + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +# So far only Tcl responds to this one. +#-------------------------------------------------------------------- + +SC_ENABLE_THREADS + +#-------------------------------------------------------------------- +# The statement below defines a collection of symbols related to +# building as a shared library instead of a static library. +#-------------------------------------------------------------------- + +SC_ENABLE_SHARED + +#-------------------------------------------------------------------- +# This macro figures out what flags to use with the compiler/linker +# when building shared/static debug/optimized objects. This information +# is all taken from the tclConfig.sh file. +#-------------------------------------------------------------------- + +CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG} +CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE} +LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG} +LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE} +SHLIB_LD=${TCL_SHLIB_LD} +STLIB_LD=${TCL_STLIB_LD} +SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS} + +AC_SUBST(CFLAGS_DEBUG) +AC_SUBST(CFLAGS_OPTIMIZE) +AC_SUBST(STLIB_LD) +AC_SUBST(SHLIB_LD) +AC_SUBST(SHLIB_CFLAGS) +AC_SUBST(SHLIB_LDFLAGS) + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols +# option. +#-------------------------------------------------------------------- + +SC_ENABLE_SYMBOLS + +if test "${SHARED_BUILD}" = "1" ; then + CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' +else + CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}' +fi + +#-------------------------------------------------------------------- +# Everyone should be linking against the Tcl stub library. If you +# can't for some reason, remove this definition. If you aren't using +# stubs, you also need to modify the SHLIB_LD_LIBS setting below to +# link against the non-stubbed Tcl library. +#-------------------------------------------------------------------- + +if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then + echo "Tcl 8.0, no stubs used" + USE_TCL_STUBS="" +else + AC_DEFINE(USE_TCL_STUBS) + AC_DEFINE(USE_XOTCL_STUBS) +fi + +#-------------------------------------------------------------------- +# This macro generates a line to use when building a library. It +# depends on values set by the SC_ENABLE_SHARED, SC_ENABLE_SYMBOLS, +# and SC_LOAD_TCLCONFIG macros above. +#-------------------------------------------------------------------- + +SC_MAKE_LIB + +#-------------------------------------------------------------------- +# eval these two values to dereference the ${DBGX} variable. +#-------------------------------------------------------------------- + +#eval "SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" +#eval "UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" + +SHARED_LIB_SUFFIX=${XOTCL_SHARED_LIB_SUFFIX} +UNSHARED_LIB_SUFFIX=${XOTCL_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}`\" \"`cygpath -w ${XOTCL_BUILD_STUB_LIB_PATH}`\" ${TCL_SHLIB_LD_LIBS}" + eval "${PACKAGE}_LIB_FILE=${PACKAGE}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval "${PACKAGE}_LIB_FILE=${PACKAGE}${UNSHARED_LIB_SUFFIX}" + fi + ;; + *) + if test "${SHARED_BUILD}" = "1" ; then + #SHLIB_LD_LIBS="${TCL_BUILD_STUB_LIB_SPEC} ${XOTCL_BUILD_STUB_LIB_SPEC}" + SHLIB_LD_LIBS="${TCL_STUB_LIB_SPEC} ${XOTCL_BUILD_STUB_LIB_SPEC}" + eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${UNSHARED_LIB_SUFFIX}" + fi + ;; +esac + +#-------------------------------------------------------------------- +# __CHANGE__ +# Change the name from exampeA_LIB_FILE to match your package name. +#-------------------------------------------------------------------- + +AC_SUBST(xotclsdbm_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-sdbm.add) + + + + + + + + + + Index: library/store/XOTclSdbm/dllEntryPoint.c =================================================================== diff -u -N --- library/store/XOTclSdbm/dllEntryPoint.c (revision 0) +++ library/store/XOTclSdbm/dllEntryPoint.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,39 @@ +/* + * dllEntryPoint.c -- + * $Id: dllEntryPoint.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ + * + * This file implements the Dll entry point as needed by Windows. + */ + +#define WIN32_LEAN_AND_MEAN +#include +#if defined(_MSC_VER) +# define DllEntryPoint DllMain +#endif + +/* + *---------------------------------------------------------------------- + * + * DllEntryPoint -- + * + * This wrapper function is used by Windows to invoke the + * initialization code for the DLL. If we are compiling + * with Visual C++, this routine will be renamed to DllMain. + * + * Results: + * Returns TRUE; + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +BOOL APIENTRY +DllEntryPoint(hInst, reason, reserved) + HINSTANCE hInst; /* Library instance handle. */ + DWORD reason; /* Reason this function is being called. */ + LPVOID reserved; /* Not used. */ +{ + return TRUE; +} Index: library/store/XOTclSdbm/hash.c =================================================================== diff -u -N --- library/store/XOTclSdbm/hash.c (revision 0) +++ library/store/XOTclSdbm/hash.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,51 @@ +/* + * sdbm - ndbm work-alike hashed database library + * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). + * author: oz@nexus.yorku.ca + * status: public domain. keep it that way. + * + * hashing routine + */ + +#include "sdbm.h" +/* + * polynomial conversion ignoring overflows + * [this seems to work remarkably well, in fact better + * then the ndbm hash function. Replace at your own risk] + * use: 65599 nice. + * 65587 even better. + */ +long +sdbm_hash(str, len) +register char *str; +#ifdef VISUAL_CC +register int len; +#else +register size_t len; +#endif +{ + register unsigned long n = 0; + +#ifdef HAVE_DUFF + +#define HASHC n = *str++ + 65599 * n + + if (len > 0) { + register int loop = (len + 8 - 1) >> 3; + + switch(len & (8 - 1)) { + case 0: do { + HASHC; case 7: HASHC; + case 6: HASHC; case 5: HASHC; + case 4: HASHC; case 3: HASHC; + case 2: HASHC; case 1: HASHC; + } while (--loop); + } + + } +#else + while (len--) + n = *str++ + 65599 * n; +#endif + return n; +} Index: library/store/XOTclSdbm/pair.c =================================================================== diff -u -N --- library/store/XOTclSdbm/pair.c (revision 0) +++ library/store/XOTclSdbm/pair.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,308 @@ +/* + * sdbm - ndbm work-alike hashed database library + * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). + * author: oz@nexus.yorku.ca + * status: public domain. + * + * page-level routines + */ + +#ifndef lint +static char rcsid[] = "$Id: pair.c,v 1.3 2006/09/27 08:12:40 neumann Exp $"; +#endif + +#include "sdbm.h" +#include "tune.h" +#include "pair.h" + +#include +#include + +#define exhash(item) sdbm_hash((item).dptr, (item).dsize) + +/* + * forward + */ +static int seepair proto((char *, int, char *, size_t)); + +/* + * page format: + * +------------------------------+ + * ino | n | keyoff | datoff | keyoff | + * +------------+--------+--------+ + * | datoff | - - - ----> | + * +--------+---------------------+ + * | F R E E A R E A | + * +--------------+---------------+ + * | <---- - - - | data | + * +--------+-----+----+----------+ + * | key | data | key | + * +--------+----------+----------+ + * + * calculating the offsets for free area: if the number + * of entries (ino[0]) is zero, the offset to the END of + * the free area is the block size. Otherwise, it is the + * nth (ino[ino[0]]) entry's offset. + */ + +int +fitpair(pag, need) +char *pag; +int need; +{ + register int n; + register int off; + register int free_space; + /* this cast "increases the alignment". Its not the only one, though.*/ + register short *ino = (short *) pag; + + off = ((n = ino[0]) > 0) ? ino[n] : PBLKSIZ; + free_space = off - (n + 1) * sizeof(short); + need += 2 * sizeof(short); + + debug(("free %d need %d\n", free_space, need)); + + return need <= free_space; +} + +void +putpair(pag, key, val) +char *pag; +datum key; +datum val; +{ + register int n; + register int off; + register short *ino = (short *) pag; + + off = ((n = ino[0]) > 0) ? ino[n] : PBLKSIZ; +/* + * enter the key first + */ + off -= key.dsize; + (void) memcpy(pag + off, key.dptr, key.dsize); + ino[n + 1] = off; +/* + * now the data + */ + off -= val.dsize; + (void) memcpy(pag + off, val.dptr, val.dsize); + ino[n + 2] = off; +/* + * adjust item count + */ + ino[0] += 2; +} + +datum +getpair(pag, key) +char *pag; +datum key; +{ + register int i; + register int n; + datum val; + register short *ino = (short *) pag; + + if ((n = ino[0]) == 0) + return nullitem; + + if ((i = seepair(pag, n, key.dptr, key.dsize)) == 0) + return nullitem; + + val.dptr = pag + ino[i + 1]; + val.dsize = ino[i] - ino[i + 1]; + return val; +} + +#ifdef SEEDUPS +int +duppair(pag, key) +char *pag; +datum key; +{ + register short *ino = (short *) pag; + return ino[0] > 0 && seepair(pag, ino[0], key.dptr, key.dsize) > 0; +} +#endif + +datum +getnkey(pag, num) +char *pag; +int num; +{ + datum key; + register int off; + register short *ino = (short *) pag; + + num = num * 2 - 1; + if (ino[0] == 0 || num > ino[0]) + return nullitem; + + off = (num > 1) ? ino[num - 1] : PBLKSIZ; + + key.dptr = pag + ino[num]; + key.dsize = off - ino[num]; + + return key; +} + +int +delpair(pag, key) +char *pag; +datum key; +{ + register int n; + register int i; + register short *ino = (short *) pag; + + if ((n = ino[0]) == 0) + return 0; + + if ((i = seepair(pag, n, key.dptr, key.dsize)) == 0) + return 0; +/* + * found the key. if it is the last entry + * [i.e. i == n - 1] we just adjust the entry count. + * hard case: move all data down onto the deleted pair, + * shift offsets onto deleted offsets, and adjust them. + * [note: 0 < i < n] + */ + if (i < n - 1) { + register int m; + register char *dst = pag + (i == 1 ? PBLKSIZ : ino[i - 1]); + register char *src = pag + ino[i + 1]; + register int zoo = dst - src; + + debug(("free-up %d ", zoo)); +/* + * shift data/keys down + */ + m = ino[i + 1] - ino[n]; +#ifdef DUFF +#define MOVB *--dst = *--src + + if (m > 0) { + register int loop = (m + 8 - 1) >> 3; + + switch (m & (8 - 1)) { + case 0: do { + MOVB; case 7: MOVB; + case 6: MOVB; case 5: MOVB; + case 4: MOVB; case 3: MOVB; + case 2: MOVB; case 1: MOVB; + } while (--loop); + } + } +#else +#ifdef MEMMOVE + memmove(dst, src, m); +#else + while (m--) + *--dst = *--src; +#endif +#endif +/* + * adjust offset index up + */ + while (i < n - 1) { + ino[i] = ino[i + 2] + zoo; + i++; + } + } + ino[0] -= 2; + return 1; +} + +/* + * search for the key in the page. + * return offset index in the range 0 < i < n. + * return 0 if not found. + */ +static int +seepair(pag, n, key, siz) +char *pag; +register int n; +register char *key; +register size_t siz; +{ + register int i; + register int off = PBLKSIZ; + register short *ino = (short *) pag; + + for (i = 1; i < n; i += 2) { + if ((int)siz == off - ino[i] && + memcmp(key, pag + ino[i], siz) == 0) + return i; + off = ino[i + 1]; + } + return 0; +} + +void +splpage(pag, new, sbit) +char *pag; +char *new; +long sbit; +{ + datum key; + datum val; + + register int n; + register int off = PBLKSIZ; + char cur[PBLKSIZ]; + register short *ino = (short *) cur; + + (void) memcpy(cur, pag, PBLKSIZ); + (void) memset(pag, 0, PBLKSIZ); + (void) memset(new, 0, PBLKSIZ); + + n = ino[0]; + for (ino++; n > 0; ino += 2) { + key.dptr = cur + ino[0]; + key.dsize = off - ino[0]; + val.dptr = cur + ino[1]; + val.dsize = ino[0] - ino[1]; +/* + * select the page pointer (by looking at sbit) and insert + */ + (void) putpair((exhash(key) & sbit) ? new : pag, key, val); + + off = ino[1]; + n -= 2; + } + + debug(("%d split %d/%d\n", ((short *) cur)[0] / 2, + ((short *) new)[0] / 2, + ((short *) pag)[0] / 2)); +} + +/* + * check page sanity: + * number of entries should be something + * reasonable, and all offsets in the index should be in order. + * this could be made more rigorous. + */ +int +chkpage(pag) +char *pag; +{ + register int n; + register int off; + register short *ino = (short *) pag; + + if ((n = ino[0]) < 0 || n > PBLKSIZ / sizeof(short)) + return 0; + + if (n > 0) { + off = PBLKSIZ; + for (ino++; n > 0; ino += 2) { + if (ino[0] > off || ino[1] > off || + ino[1] > ino[0]) + return 0; + off = ino[1]; + n -= 2; + } + } + return 1; +} Index: library/store/XOTclSdbm/pair.h =================================================================== diff -u -N --- library/store/XOTclSdbm/pair.h (revision 0) +++ library/store/XOTclSdbm/pair.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,10 @@ +extern int fitpair proto((char *, int)); +extern void putpair proto((char *, datum, datum)); +extern datum getpair proto((char *, datum)); +extern int delpair proto((char *, datum)); +extern int chkpage proto((char *)); +extern datum getnkey proto((char *, int)); +extern void splpage proto((char *, char *, long)); +#ifdef SEEDUPS +extern int duppair proto((char *, datum)); +#endif Index: library/store/XOTclSdbm/sdbm.c =================================================================== diff -u -N --- library/store/XOTclSdbm/sdbm.c (revision 0) +++ library/store/XOTclSdbm/sdbm.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,544 @@ +/* + * sdbm - ndbm work-alike hashed database library + * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). + * author: oz@nexus.yorku.ca + * status: public domain. + * + * core routines + */ + +#ifndef lint +static char rcsid[] = "$Id: sdbm.c,v 1.1 2004/05/23 22:50:39 neumann Exp $"; +#endif + +/*#include "config.h"*/ +#include "sdbm.h" +#include "tune.h" +#include "pair.h" + +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#ifdef HAVE_MEMORY_H +#include +#endif +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_FILE_H +# include +#endif +#ifdef _WIN32 +# define HAVE_FCNTL_H +# include +#endif +/* +#ifdef HAVE_FCNTL_H +*/ +# include +/* +#endif +*/ +#ifdef __STDC__ +#include +#endif + +#ifndef NULL +#define NULL 0 +#endif + +/* + * externals + */ +#ifndef _WIN32 +#ifndef HAVE_UNISTD_H +extern long lseek(); +#endif +#endif + +/* + * forward + */ +static int getdbit proto((DBM *, long)); +static int setdbit proto((DBM *, long)); +static int getpage proto((DBM *, long)); +static datum getnext proto((DBM *)); +static int makroom proto((DBM *, long, int)); + +/* + * useful macros + */ +#define bad(x) ((x).dptr == NULL || (x).dsize <= 0) +#define exhash(item) sdbm_hash((item).dptr, (item).dsize) +#define ioerr(db) ((db)->flags |= SDBM_IOERR) + +#define OFF_PAG(off) (long) (off) * PBLKSIZ +#define OFF_DIR(off) (long) (off) * DBLKSIZ + +static long masks[] = { + 000000000000, 000000000001, 000000000003, 000000000007, + 000000000017, 000000000037, 000000000077, 000000000177, + 000000000377, 000000000777, 000000001777, 000000003777, + 000000007777, 000000017777, 000000037777, 000000077777, + 000000177777, 000000377777, 000000777777, 000001777777, + 000003777777, 000007777777, 000017777777, 000037777777, + 000077777777, 000177777777, 000377777777, 000777777777, + 001777777777, 003777777777, 007777777777, 017777777777 +}; + +datum nullitem = {NULL, 0}; + +DBM * +sdbm_open(file, flags, mode) +register char *file; +register int flags; +register int mode; +{ + register DBM *db; + register char *dirname; + register char *pagname; + register int n; + + if (file == NULL || !*file) + return errno = EINVAL, (DBM *) NULL; +/* + * need space for two seperate filenames + */ + n = strlen(file) * 2 + strlen(DIRFEXT) + strlen(PAGFEXT) + 2; + + if ((dirname = malloc((unsigned) n)) == NULL) + return errno = ENOMEM, (DBM *) NULL; +/* + * build the file names + */ + dirname = strcat(strcpy(dirname, file), DIRFEXT); + pagname = strcpy(dirname + strlen(dirname) + 1, file); + pagname = strcat(pagname, PAGFEXT); + + db = sdbm_prep(dirname, pagname, flags, mode); + free((char *) dirname); + return db; +} + +DBM * +sdbm_prep(dirname, pagname, flags, mode) +char *dirname; +char *pagname; +int flags; +int mode; +{ + register DBM *db; + struct stat dstat; + + if ((db = (DBM *) malloc(sizeof(DBM))) == NULL) + return errno = ENOMEM, (DBM *) NULL; + + db->flags = 0; + db->hmask = 0; + db->blkptr = 0; + db->keyptr = 0; +/* + * adjust user flags so that WRONLY becomes RDWR, + * as required by this package. Also set our internal + * flag for RDONLY if needed. + */ + if (flags & O_WRONLY) + flags = (flags & ~O_WRONLY) | O_RDWR; + + else if ((flags & 03) == O_RDONLY) + db->flags = SDBM_RDONLY; + +#ifdef O_BINARY + /* GO32 / DOS-Braindamage */ + flags |= O_BINARY; +#endif + +/* + * open the files in sequence, and stat the dirfile. + * If we fail anywhere, undo everything, return NULL. + */ + if ((db->pagf = open(pagname, flags, mode)) > -1) { + if ((db->dirf = open(dirname, flags, mode)) > -1) { +/* + * need the dirfile size to establish max bit number. + */ + if (fstat(db->dirf, &dstat) == 0) { +/* + * zero size: either a fresh database, or one with a single, + * unsplit data page: dirpage is all zeros. + */ + db->dirbno = (!dstat.st_size) ? 0 : -1; + db->pagbno = -1; + db->maxbno = dstat.st_size * BYTESIZ; + + (void) memset(db->pagbuf, 0, PBLKSIZ); + (void) memset(db->dirbuf, 0, DBLKSIZ); + /* + * success + */ + return db; + } + (void) close(db->dirf); + } + (void) close(db->pagf); + } + free((char *) db); + return (DBM *) NULL; +} + +void +sdbm_close(db) +register DBM *db; +{ + if (db == NULL) + errno = EINVAL; + else { + (void) close(db->dirf); + (void) close(db->pagf); + free((char *) db); + } +} + +datum +sdbm_fetch(db, key) +register DBM *db; +datum key; +{ + if (db == NULL || bad(key)) + return errno = EINVAL, nullitem; + + if (getpage(db, exhash(key))) + return getpair(db->pagbuf, key); + + return ioerr(db), nullitem; +} + +int +sdbm_delete(db, key) +register DBM *db; +datum key; +{ + if (db == NULL || bad(key)) + return errno = EINVAL, -1; + if (sdbm_rdonly(db)) + return errno = EPERM, -1; + + if (getpage(db, exhash(key))) { + if (!delpair(db->pagbuf, key)) + return -1; +/* + * update the page file + */ + if (lseek(db->pagf, OFF_PAG(db->pagbno), SEEK_SET) < 0 + || write(db->pagf, db->pagbuf, PBLKSIZ) < 0) + return ioerr(db), -1; + + return 0; + } + + return ioerr(db), -1; +} + +int +sdbm_store(db, key, val, flags) +register DBM *db; +datum key; +datum val; +int flags; +{ + int need; + register long hash; + + if (db == NULL || bad(key)) + return errno = EINVAL, -1; + if (sdbm_rdonly(db)) + return errno = EPERM, -1; + + need = key.dsize + val.dsize; +/* + * is the pair too big (or too small) for this database ?? + */ + if (need < 0 || need > PAIRMAX) + return errno = EINVAL, -1; + + if (getpage(db, (hash = exhash(key)))) { +/* + * if we need to replace, delete the key/data pair + * first. If it is not there, ignore. + */ + if (flags == SDBM_REPLACE) + (void) delpair(db->pagbuf, key); +#ifdef SEEDUPS + else if (duppair(db->pagbuf, key)) + return 1; +#endif +/* + * if we do not have enough room, we have to split. + */ + if (!fitpair(db->pagbuf, need)) + if (!makroom(db, hash, need)) + return ioerr(db), -1; +/* + * we have enough room or split is successful. insert the key, + * and update the page file. + */ + (void) putpair(db->pagbuf, key, val); + + if (lseek(db->pagf, OFF_PAG(db->pagbno), SEEK_SET) < 0 + || write(db->pagf, db->pagbuf, PBLKSIZ) < 0) + return ioerr(db), -1; + /* + * success + */ + return 0; + } + + return ioerr(db), -1; +} + +/* + * makroom - make room by splitting the overfull page + * this routine will attempt to make room for SPLTMAX times before + * giving up. + */ +static int +makroom(db, hash, need) +register DBM *db; +long hash; +int need; +{ + long newp; + char twin[PBLKSIZ]; + char *pag = db->pagbuf; + char *new = twin; + register int smax = SPLTMAX; + + do { +/* + * split the current page + */ + (void) splpage(pag, new, db->hmask + 1); +/* + * address of the new page + */ + newp = (hash & db->hmask) | (db->hmask + 1); + +/* + * write delay, read avoidence/cache shuffle: + * select the page for incoming pair: if key is to go to the new page, + * write out the previous one, and copy the new one over, thus making + * it the current page. If not, simply write the new page, and we are + * still looking at the page of interest. current page is not updated + * here, as sdbm_store will do so, after it inserts the incoming pair. + */ + if (hash & (db->hmask + 1)) { + if (lseek(db->pagf, OFF_PAG(db->pagbno), SEEK_SET) < 0 + || write(db->pagf, db->pagbuf, PBLKSIZ) < 0) + return 0; + db->pagbno = newp; + (void) memcpy(pag, new, PBLKSIZ); + } + else if (lseek(db->pagf, OFF_PAG(newp), SEEK_SET) < 0 + || write(db->pagf, new, PBLKSIZ) < 0) + return 0; + + if (!setdbit(db, db->curbit)) + return 0; +/* + * see if we have enough room now + */ + if (fitpair(pag, need)) + return 1; +/* + * try again... update curbit and hmask as getpage would have + * done. because of our update of the current page, we do not + * need to read in anything. BUT we have to write the current + * [deferred] page out, as the window of failure is too great. + */ + db->curbit = 2 * db->curbit + + ((hash & (db->hmask + 1)) ? 2 : 1); + db->hmask |= db->hmask + 1; + + if (lseek(db->pagf, OFF_PAG(db->pagbno), SEEK_SET) < 0 + || write(db->pagf, db->pagbuf, PBLKSIZ) < 0) + return 0; + + } while (--smax); +/* + * if we are here, this is real bad news. After SPLTMAX splits, + * we still cannot fit the key. say goodnight. + */ +#ifdef BADMESS + (void) write(2, "sdbm: cannot insert after SPLTMAX attempts.\n", 44); +#endif + return 0; + +} + +/* + * the following two routines will break if + * deletions aren't taken into account. (ndbm bug) + */ +datum +sdbm_firstkey(db) +register DBM *db; +{ + if (db == NULL) + return errno = EINVAL, nullitem; +/* + * start at page 0 + */ + if (lseek(db->pagf, OFF_PAG(0), SEEK_SET) < 0 + || read(db->pagf, db->pagbuf, PBLKSIZ) < 0) + return ioerr(db), nullitem; + db->pagbno = 0; + db->blkptr = 0; + db->keyptr = 0; + + return getnext(db); +} + +datum +sdbm_nextkey(db) +register DBM *db; +{ + if (db == NULL) + return errno = EINVAL, nullitem; + return getnext(db); +} + +/* + * all important binary trie traversal + */ +static int +getpage(db, hash) +register DBM *db; +register long hash; +{ + register int hbit; + register long dbit; + register long pagb; + + dbit = 0; + hbit = 0; + while (dbit < db->maxbno && getdbit(db, dbit)) + dbit = 2 * dbit + ((hash & (1 << hbit++)) ? 2 : 1); + + debug(("dbit: %d...", dbit)); + + db->curbit = dbit; + db->hmask = masks[hbit]; + + pagb = hash & db->hmask; +/* + * see if the block we need is already in memory. + * note: this lookaside cache has about 10% hit rate. + */ + if (pagb != db->pagbno) { +/* + * note: here, we assume a "hole" is read as 0s. + * if not, must zero pagbuf first. + */ + if (lseek(db->pagf, OFF_PAG(pagb), SEEK_SET) < 0 + || read(db->pagf, db->pagbuf, PBLKSIZ) < 0) + return 0; + if (!chkpage(db->pagbuf)) + return 0; + db->pagbno = pagb; + + debug(("pag read: %d\n", pagb)); + } + return 1; +} + +static int +getdbit(db, dbit) +register DBM *db; +register long dbit; +{ + register long c; + register long dirb; + + c = dbit / BYTESIZ; + dirb = c / DBLKSIZ; + + if (dirb != db->dirbno) { + if (lseek(db->dirf, OFF_DIR(dirb), SEEK_SET) < 0 + || read(db->dirf, db->dirbuf, DBLKSIZ) < 0) + return 0; + db->dirbno = dirb; + + debug(("dir read: %d\n", dirb)); + } + + return db->dirbuf[c % DBLKSIZ] & (1 << dbit % BYTESIZ); +} + +static int +setdbit(db, dbit) +register DBM *db; +register long dbit; +{ + register long c; + register long dirb; + + c = dbit / BYTESIZ; + dirb = c / DBLKSIZ; + + if (dirb != db->dirbno) { + if (lseek(db->dirf, OFF_DIR(dirb), SEEK_SET) < 0 + || read(db->dirf, db->dirbuf, DBLKSIZ) < 0) + return 0; + db->dirbno = dirb; + + debug(("dir read: %d\n", dirb)); + } + + db->dirbuf[c % DBLKSIZ] |= (1 << dbit % BYTESIZ); + + if (dbit >= db->maxbno) + db->maxbno += DBLKSIZ * BYTESIZ; + + if (lseek(db->dirf, OFF_DIR(dirb), SEEK_SET) < 0 + || write(db->dirf, db->dirbuf, DBLKSIZ) < 0) + return 0; + + return 1; +} + +/* + * getnext - get the next key in the page, and if done with + * the page, try the next page in sequence + */ +static datum +getnext(db) +register DBM *db; +{ + datum key; + + for (;;) { + db->keyptr++; + key = getnkey(db->pagbuf, db->keyptr); + if (key.dptr != NULL) + return key; +/* + * we either run out, or there is nothing on this page.. + * try the next one... If we lost our position on the + * file, we will have to seek. + */ + db->keyptr = 0; + if (db->pagbno != db->blkptr++) + if (lseek(db->pagf, OFF_PAG(db->blkptr), SEEK_SET) < 0) + break; + db->pagbno = db->blkptr; + if (read(db->pagf, db->pagbuf, PBLKSIZ) <= 0) + break; + if (!chkpage(db->pagbuf)) + break; + } + + return ioerr(db), nullitem; +} Index: library/store/XOTclSdbm/sdbm.h =================================================================== diff -u -N --- library/store/XOTclSdbm/sdbm.h (revision 0) +++ library/store/XOTclSdbm/sdbm.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,96 @@ +/* + * sdbm - ndbm work-alike hashed database library + * based on Per-Ake Larson's Dynamic Hashing algorithms. BIT 18 (1978). + * author: oz@nexus.yorku.ca + * status: public domain. + */ + +#ifndef VISUAL_CC + #include +#endif +#define DBLKSIZ 4096 +#define PBLKSIZ 1024 +#define PAIRMAX 1008 /* arbitrary on PBLKSIZ-N */ +#define SPLTMAX 10 /* maximum allowed splits */ + /* for a single insertion */ +#define DIRFEXT ".dir" +#define PAGFEXT ".pag" + +typedef struct { + int dirf; /* directory file descriptor */ + int pagf; /* page file descriptor */ + int flags; /* status/error flags, see below */ + long maxbno; /* size of dirfile in bits */ + long curbit; /* current bit number */ + long hmask; /* current hash mask */ + long blkptr; /* current block for nextkey */ + int keyptr; /* current key for nextkey */ + long blkno; /* current page to read/write */ + long pagbno; /* current page in pagbuf */ + char pagbuf[PBLKSIZ]; /* page file block buffer */ + long dirbno; /* current block in dirbuf */ + char dirbuf[DBLKSIZ]; /* directory file block buffer */ +} DBM; + +#define SDBM_RDONLY 0x1 /* data base open read-only */ +#define SDBM_IOERR 0x2 /* data base I/O error */ + +/* + * utility macros + */ +#define sdbm_rdonly(db) ((db)->flags & SDBM_RDONLY) +#define sdbm_error(db) ((db)->flags & SDBM_IOERR) + +#define sdbm_clearerr(db) ((db)->flags &= ~SDBM_IOERR) /* ouch */ + +#define sdbm_dirfno(db) ((db)->dirf) +#define sdbm_pagfno(db) ((db)->pagf) + +#ifdef VISUAL_CC +typedef struct { + char *dptr; + int dsize; +} datum; +#else +typedef struct { + char *dptr; + size_t dsize; +} datum; +#endif + + +extern datum nullitem; + +#ifdef __STDC__ +#define proto(p) p +#else +#define proto(p) () +#endif + +/* + * flags to sdbm_store + */ +#define SDBM_INSERT 0 +#define SDBM_REPLACE 1 + +/* + * ndbm interface + */ +extern DBM *sdbm_open proto((char *, int, int)); +extern void sdbm_close proto((DBM *)); +extern datum sdbm_fetch proto((DBM *, datum)); +extern int sdbm_delete proto((DBM *, datum)); +extern int sdbm_store proto((DBM *, datum, datum, int)); +extern datum sdbm_firstkey proto((DBM *)); +extern datum sdbm_nextkey proto((DBM *)); + +/* + * other + */ + +extern DBM *sdbm_prep proto((char *, char *, int, int)); +#ifdef VISUAL_CC +extern long sdbm_hash proto((char *, int)); +#else +extern long sdbm_hash proto((char *, size_t)); +#endif Index: library/store/XOTclSdbm/tcl.m4 =================================================================== diff -u -N --- library/store/XOTclSdbm/tcl.m4 (revision 0) +++ library/store/XOTclSdbm/tcl.m4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,4041 @@ +# tcl.m4 -- +# +# This file provides a set of autoconf macros to help TEA-enable +# a Tcl extension. +# +# Copyright (c) 1999-2000 Ajuba Solutions. +# 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: tcl.m4,v 1.2 2007/10/12 19:53:32 neumann Exp $ + +AC_PREREQ(2.57) + +dnl TEA extensions pass us the version of TEA they think they +dnl are compatible with (must be set in TEA_INIT below) +dnl TEA_VERSION="3.6" + +# Possible values for key variables defined: +# +# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') +# TEA_PLATFORM - windows unix +# + +#------------------------------------------------------------------------ +# TEA_PATH_TCLCONFIG -- +# +# Locate the tclConfig.sh file and perform a sanity check on +# the Tcl compile flags +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-tcl=... +# +# Defines the following vars: +# TCL_BIN_DIR Full path to the directory containing +# the tclConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_TCLCONFIG], [ + dnl Make sure we are initialized + AC_REQUIRE([TEA_INIT]) + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + AC_ARG_WITH(tcl, + AC_HELP_STRING([--with-tcl], + [directory containing tcl configuration (tclConfig.sh)]), + with_tclconfig=${withval}) + AC_MSG_CHECKING([for Tcl configuration]) + AC_CACHE_VAL(ac_cv_c_tclconfig,[ + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case ${with_tclconfig} in + */tclConfig.sh ) + if test -f ${with_tclconfig}; then + AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) + with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tcl.framework/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + AC_MSG_WARN([Can't find Tcl configuration definitions]) + exit 0 + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_PATH_TKCONFIG -- +# +# Locate the tkConfig.sh file +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-tk=... +# +# Defines the following vars: +# TK_BIN_DIR Full path to the directory containing +# the tkConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_TKCONFIG], [ + # + # Ok, lets find the tk configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tk + # + + if test x"${no_tk}" = x ; then + # we reset no_tk in case something fails here + no_tk=true + AC_ARG_WITH(tk, + AC_HELP_STRING([--with-tk], + [directory containing tk configuration (tkConfig.sh)]), + with_tkconfig=${withval}) + AC_MSG_CHECKING([for Tk configuration]) + AC_CACHE_VAL(ac_cv_c_tkconfig,[ + + # First check to see if --with-tkconfig was specified. + if test x"${with_tkconfig}" != x ; then + case ${with_tkconfig} in + */tkConfig.sh ) + if test -f ${with_tkconfig}; then + AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) + with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tkconfig}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` + else + AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) + fi + fi + + # then check for a private Tk library + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ../tk \ + `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../tk \ + `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../../tk \ + `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tk.framework/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_tkconfig}" = x ; then + TK_BIN_DIR="# no Tk configs found" + AC_MSG_WARN([Can't find Tk configuration definitions]) + exit 0 + else + no_tk= + TK_BIN_DIR=${ac_cv_c_tkconfig} + AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_TCLCONFIG -- +# +# Load the tclConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# TCL_BIN_DIR +# +# Results: +# +# Subst the following vars: +# TCL_BIN_DIR +# TCL_SRC_DIR +# TCL_LIB_FILE +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_TCLCONFIG], [ + AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) + + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then + AC_MSG_RESULT([loading]) + . "${TCL_BIN_DIR}/tclConfig.sh" + else + AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tcl.framework installed in an arbitary location. + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then + for i in "`cd ${TCL_BIN_DIR}; pwd`" \ + "`cd ${TCL_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then + TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" + break + fi + done + fi + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then + TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + AC_SUBST(TCL_VERSION) + AC_SUBST(TCL_BIN_DIR) + AC_SUBST(TCL_SRC_DIR) + + AC_SUBST(TCL_LIB_FILE) + AC_SUBST(TCL_LIB_FLAG) + AC_SUBST(TCL_LIB_SPEC) + + AC_SUBST(TCL_STUB_LIB_FILE) + AC_SUBST(TCL_STUB_LIB_FLAG) + AC_SUBST(TCL_STUB_LIB_SPEC) + + AC_SUBST(TCL_LIBS) + AC_SUBST(TCL_DEFS) + AC_SUBST(TCL_EXTRA_CFLAGS) + AC_SUBST(TCL_LD_FLAGS) + AC_SUBST(TCL_SHLIB_LD_LIBS) +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_TKCONFIG -- +# +# Load the tkConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# TK_BIN_DIR +# +# Results: +# +# Sets the following vars that should be in tkConfig.sh: +# TK_BIN_DIR +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_TKCONFIG], [ + AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) + + if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then + AC_MSG_RESULT([loading]) + . "${TK_BIN_DIR}/tkConfig.sh" + else + AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" + eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" + + # If the TK_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TK_LIB_SPEC will be set to the value + # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC + # instead of TK_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TK_BIN_DIR}/Makefile" ; then + TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} + TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} + TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tk.framework installed in an arbitary location. + case ${TK_DEFS} in + *TK_FRAMEWORK*) + if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then + for i in "`cd ${TK_BIN_DIR}; pwd`" \ + "`cd ${TK_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then + TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" + break + fi + done + fi + if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then + TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" + TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" + eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" + eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" + eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" + + # Ensure windowingsystem is defined + if test "${TEA_PLATFORM}" = "unix" ; then + case ${TK_DEFS} in + *MAC_OSX_TK*) + AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) + TEA_WINDOWINGSYSTEM="aqua" + ;; + *) + TEA_WINDOWINGSYSTEM="x11" + ;; + esac + elif test "${TEA_PLATFORM}" = "windows" ; then + TEA_WINDOWINGSYSTEM="win32" + fi + + AC_SUBST(TK_VERSION) + AC_SUBST(TK_BIN_DIR) + AC_SUBST(TK_SRC_DIR) + + AC_SUBST(TK_LIB_FILE) + AC_SUBST(TK_LIB_FLAG) + AC_SUBST(TK_LIB_SPEC) + + AC_SUBST(TK_STUB_LIB_FILE) + AC_SUBST(TK_STUB_LIB_FLAG) + AC_SUBST(TK_STUB_LIB_SPEC) + + AC_SUBST(TK_LIBS) + AC_SUBST(TK_XINCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_SHARED -- +# +# Allows the building of shared libraries +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-shared=yes|no +# +# Defines the following vars: +# STATIC_BUILD Used for building import/export libraries +# on Windows. +# +# Sets the following vars: +# SHARED_BUILD Value of 1 or 0 +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_SHARED], [ + AC_MSG_CHECKING([how to build libraries]) + AC_ARG_ENABLE(shared, + AC_HELP_STRING([--enable-shared], + [build and link with shared libraries (default: on)]), + [tcl_ok=$enableval], [tcl_ok=yes]) + + if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" ; then + AC_MSG_RESULT([shared]) + SHARED_BUILD=1 + else + AC_MSG_RESULT([static]) + SHARED_BUILD=0 + AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) + fi + AC_SUBST(SHARED_BUILD) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_THREADS -- +# +# Specify if thread support should be enabled. If "yes" is specified +# as an arg (optional), threads are enabled by default, "no" means +# threads are disabled. "yes" is the default. +# +# TCL_THREADS is checked so that if you are compiling an extension +# against a threaded core, your extension must be compiled threaded +# as well. +# +# Note that it is legal to have a thread enabled extension run in a +# threaded or non-threaded Tcl core, but a non-threaded extension may +# only run in a non-threaded Tcl core. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-threads +# +# Sets the following vars: +# THREADS_LIBS Thread library(s) +# +# Defines the following vars: +# TCL_THREADS +# _REENTRANT +# _THREAD_SAFE +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_THREADS], [ + AC_ARG_ENABLE(threads, + AC_HELP_STRING([--enable-threads], + [build with threads]), + [tcl_ok=$enableval], [tcl_ok=yes]) + + if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then + TCL_THREADS=1 + + if test "${TEA_PLATFORM}" != "windows" ; then + # We are always OK on Windows, so check what this platform wants: + + # USE_THREAD_ALLOC tells us to try the special thread-based + # allocator that significantly reduces lock contention + AC_DEFINE(USE_THREAD_ALLOC, 1, + [Do we want to use the threaded memory allocator?]) + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + if test "`uname -s`" = "SunOS" ; then + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + fi + AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) + AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + AC_CHECK_LIB(pthread, __pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + AC_CHECK_LIB(pthreads, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + AC_CHECK_LIB(c, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "no"; then + AC_CHECK_LIB(c_r, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -pthread" + else + TCL_THREADS=0 + AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) + fi + fi + fi + fi + fi + else + TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + AC_MSG_CHECKING([for building with threads]) + if test "${TCL_THREADS}" = 1; then + AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) + AC_MSG_RESULT([yes (default)]) + else + AC_MSG_RESULT([no]) + fi + # TCL_THREADS sanity checking. See if our request for building with + # threads is the same as the way Tcl was built. If not, warn the user. + case ${TCL_DEFS} in + *THREADS=1*) + if test "${TCL_THREADS}" = "0"; then + AC_MSG_WARN([ + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads.]) + fi + ;; + *) + if test "${TCL_THREADS}" = "1"; then + AC_MSG_WARN([ + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core.]) + fi + ;; + esac + AC_SUBST(TCL_THREADS) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_SYMBOLS -- +# +# Specify if debugging symbols should be used. +# Memory (TCL_MEM_DEBUG) debugging can also be enabled. +# +# Arguments: +# none +# +# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives +# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. +# Requires the following vars to be set in the Makefile: +# CFLAGS_DEFAULT +# LDFLAGS_DEFAULT +# +# Results: +# +# Adds the following arguments to configure: +# --enable-symbols +# +# Defines the following vars: +# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true +# Sets to $(CFLAGS_OPTIMIZE) if false +# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true +# Sets to $(LDFLAGS_OPTIMIZE) if false +# DBGX Formerly used as debug library extension; +# always blank now. +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_SYMBOLS], [ + dnl Make sure we are initialized + AC_REQUIRE([TEA_CONFIG_CFLAGS]) + AC_MSG_CHECKING([for build with symbols]) + AC_ARG_ENABLE(symbols, + AC_HELP_STRING([--enable-symbols], + [build with debugging symbols (default: off)]), + [tcl_ok=$enableval], [tcl_ok=no]) + DBGX="" + if test "$tcl_ok" = "no"; then + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" + AC_MSG_RESULT([no]) + else + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" + if test "$tcl_ok" = "yes"; then + AC_MSG_RESULT([yes (standard debugging)]) + fi + fi + if test "${TEA_PLATFORM}" != "windows" ; then + LDFLAGS_DEFAULT="${LDFLAGS}" + fi + + AC_SUBST(TCL_DBGX) + AC_SUBST(CFLAGS_DEFAULT) + AC_SUBST(LDFLAGS_DEFAULT) + + if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then + AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) + fi + + if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then + if test "$tcl_ok" = "all"; then + AC_MSG_RESULT([enabled symbols mem debugging]) + else + AC_MSG_RESULT([enabled $tcl_ok debugging]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_LANGINFO -- +# +# Allows use of modern nl_langinfo check for better l10n. +# This is only relevant for Unix. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-langinfo=yes|no (default is yes) +# +# Defines the following vars: +# HAVE_LANGINFO Triggers use of nl_langinfo if defined. +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_LANGINFO], [ + AC_ARG_ENABLE(langinfo, + AC_HELP_STRING([--enable-langinfo], + [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), + [langinfo_ok=$enableval], [langinfo_ok=yes]) + + HAVE_LANGINFO=0 + if test "$langinfo_ok" = "yes"; then + AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) + fi + AC_MSG_CHECKING([whether to use nl_langinfo]) + if test "$langinfo_ok" = "yes"; then + AC_CACHE_VAL(tcl_cv_langinfo_h, [ + AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], + [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) + AC_MSG_RESULT([$tcl_cv_langinfo_h]) + if test $tcl_cv_langinfo_h = yes; then + AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) + fi + else + AC_MSG_RESULT([$langinfo_ok]) + fi +]) + +#-------------------------------------------------------------------- +# TEA_CONFIG_SYSTEM +# +# Determine what the system is (some things cannot be easily checked +# on a feature-driven basis, alas). This can usually be done via the +# "uname" command, but there are a few systems, like Next, where +# this doesn't work. +# +# Arguments: +# none +# +# Results: +# Defines the following var: +# +# system - System/platform/version identification code. +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_CONFIG_SYSTEM], [ + AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ + if test "${TEA_PLATFORM}" = "windows" ; then + tcl_cv_sys_version=windows + elif test -f /usr/lib/NextStep/software_version; then + tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + tcl_cv_sys_version=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + AC_MSG_WARN([can't find uname command]) + tcl_cv_sys_version=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi + fi + fi + ]) + system=$tcl_cv_sys_version +]) + +#-------------------------------------------------------------------- +# TEA_CONFIG_CFLAGS +# +# Try to determine the proper flags to pass to the compiler +# for building shared libraries and other such nonsense. +# +# Arguments: +# none +# +# Results: +# +# Defines and substitutes the following vars: +# +# DL_OBJS - Name of the object file that implements dynamic +# loading for Tcl on this system. +# DL_LIBS - Library file(s) to include in tclsh and other base +# applications in order for the "load" command to work. +# LDFLAGS - Flags to pass to the compiler when linking object +# files into an executable application binary such +# as tclsh. +# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", +# that tell the run-time dynamic linker where to look +# for shared libraries such as libtcl.so. Depends on +# the variable LIB_RUNTIME_DIR in the Makefile. Could +# be the same as CC_SEARCH_FLAGS if ${CC} is used to link. +# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", +# that tell the run-time dynamic linker where to look +# for shared libraries such as libtcl.so. Depends on +# the variable LIB_RUNTIME_DIR in the Makefile. +# SHLIB_CFLAGS - Flags to pass to cc when compiling the components +# of a shared library (may request position-independent +# code, among other things). +# SHLIB_LD - Base command to use for combining object files +# into a shared library. +# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when +# creating shared libraries. This symbol typically +# goes at the end of the "ld" commands that build +# shared libraries. The value of the symbol is +# "${LIBS}" if all of the dependent libraries should +# be specified when creating a shared library. If +# dependent libraries should not be specified (as on +# SunOS 4.x, where they cause the link to fail, or in +# general if Tcl and Tk aren't themselves shared +# libraries), then this symbol has an empty string +# as its value. +# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable +# extensions. An empty string means we don't know how +# to use shared libraries on this platform. +# LIB_SUFFIX - Specifies everything that comes after the "libfoo" +# in a static or shared library name, using the $VERSION variable +# to put the version in the right place. This is used +# by platforms that need non-standard library names. +# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs +# to have a version after the .so, and ${VERSION}.a +# on AIX, since a shared library needs to have +# a .a extension whereas shared objects for loadable +# extensions have a .so extension. Defaults to +# ${VERSION}${SHLIB_SUFFIX}. +# TCL_NEEDS_EXP_FILE - +# 1 means that an export file is needed to link to a +# shared library. +# TCL_EXP_FILE - The name of the installed export / import file which +# should be used to link to the Tcl shared library. +# Empty if Tcl is unshared. +# TCL_BUILD_EXP_FILE - +# The name of the built export / import file which +# should be used to link to the Tcl shared library. +# Empty if Tcl is unshared. +# CFLAGS_DEBUG - +# Flags used when running the compiler in debug mode +# CFLAGS_OPTIMIZE - +# Flags used when running the compiler in optimize mode +# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_CONFIG_CFLAGS], [ + dnl Make sure we are initialized + AC_REQUIRE([TEA_INIT]) + + # Step 0.a: Enable 64 bit support? + + AC_MSG_CHECKING([if 64bit support is requested]) + AC_ARG_ENABLE(64bit, + AC_HELP_STRING([--enable-64bit], + [enable 64bit support (default: off)]), + [do64bit=$enableval], [do64bit=no]) + AC_MSG_RESULT([$do64bit]) + + # Step 0.b: Enable Solaris 64 bit VIS support? + + AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) + AC_ARG_ENABLE(64bit-vis, + AC_HELP_STRING([--enable-64bit-vis], + [enable 64bit Sparc VIS support (default: off)]), + [do64bitVIS=$enableval], [do64bitVIS=no]) + AC_MSG_RESULT([$do64bitVIS]) + + if test "$do64bitVIS" = "yes"; then + # Force 64bit on with VIS + do64bit=yes + fi + + # Step 0.c: Cross-compiling options for Windows/CE builds? + + if test "${TEA_PLATFORM}" = "windows" ; then + AC_MSG_CHECKING([if Windows/CE build is requested]) + AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) + AC_MSG_RESULT([$doWince]) + fi + + # Step 1: set the variable "system" to hold the name and version number + # for the system. + + TEA_CONFIG_SYSTEM + + # Step 2: check for existence of -ldl library. This is needed because + # Linux can use either -ldl or -ldld for dynamic loading. + + AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) + + # Require ranlib early so we can override it in special cases below. + + AC_REQUIRE([AC_PROG_RANLIB]) + + # Step 3: set configuration options based on system name and version. + # This is similar to Tcl's unix/tcl.m4 except that we've added a + # "windows" case. + + do64bit_ok=no + LDFLAGS_ORIG="$LDFLAGS" + # When ld needs options to work in 64-bit mode, put them in + # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] + # is disabled by the user. [Bug 1016796] + LDFLAGS_ARCH="" + TCL_EXPORT_FILE_SUFFIX="" + UNSHARED_LIB_SUFFIX="" + TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' + ECHO_VERSION='`echo ${PACKAGE_VERSION}`' + TCL_LIB_VERSIONS_OK=ok + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE=-O + if test "$GCC" = "yes" ; then + CFLAGS_OPTIMIZE=-O2 + CFLAGS_WARNING="-Wall -Wno-implicit-int" + else + CFLAGS_WARNING="" + fi + TCL_NEEDS_EXP_FILE=0 + TCL_BUILD_EXP_FILE="" + TCL_EXP_FILE="" +dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. +dnl AC_CHECK_TOOL(AR, ar) + AC_CHECK_PROG(AR, ar, ar) + STLIB_LD='${AR} cr' + LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" + case $system in + windows) + # This is a 2-stage check to make sure we have the 64-bit SDK + # We have to know where the SDK is installed. + # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs + # MACHINE is IX86 for LINK, but this is used by the manifest, + # which requires x86|amd64|ia64. + MACHINE="X86" + if test "$do64bit" != "no" ; then + if test "x${MSSDK}x" = "xx" ; then + MSSDK="C:/Progra~1/Microsoft Platform SDK" + fi + MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` + PATH64="" + case "$do64bit" in + amd64|x64|yes) + MACHINE="AMD64" ; # default to AMD64 64-bit build + PATH64="${MSSDK}/Bin/Win64/x86/AMD64" + ;; + ia64) + MACHINE="IA64" + PATH64="${MSSDK}/Bin/Win64" + ;; + esac + if test ! -d "${PATH64}" ; then + AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) + AC_MSG_WARN([Ensure latest Platform SDK is installed]) + do64bit="no" + else + AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) + do64bit_ok="yes" + fi + fi + + if test "$doWince" != "no" ; then + if test "$do64bit" != "no" ; then + AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) + fi + if test "$GCC" = "yes" ; then + AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) + fi + TEA_PATH_CELIB + # Set defaults for common evc4/PPC2003 setup + # Currently Tcl requires 300+, possibly 420+ for sockets + CEVERSION=420; # could be 211 300 301 400 420 ... + TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... + ARCH=ARM; # could be ARM MIPS X86EM ... + PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" + if test "$doWince" != "yes"; then + # If !yes then the user specified something + # Reset ARCH to allow user to skip specifying it + ARCH= + eval `echo $doWince | awk -F, '{ \ + if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ + if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ + if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ + if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ + if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ + }'` + if test "x${ARCH}" = "x" ; then + ARCH=$TARGETCPU; + fi + fi + OSVERSION=WCE$CEVERSION; + if test "x${WCEROOT}" = "x" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" + if test ! -d "${WCEROOT}" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded Tools" + fi + fi + if test "x${SDKROOT}" = "x" ; then + SDKROOT="C:/Program Files/Windows CE Tools" + if test ! -d "${SDKROOT}" ; then + SDKROOT="C:/Windows CE Tools" + fi + fi + WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` + SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` + if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ + -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then + AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) + doWince="no" + else + # We could PATH_NOSPACE these, but that's not important, + # as long as we quote them when used. + CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" + if test -d "${CEINCLUDE}/${TARGETCPU}" ; then + CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" + fi + CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" + fi + fi + + if test "$GCC" != "yes" ; then + if test "${SHARED_BUILD}" = "0" ; then + runtime=-MT + else + runtime=-MD + fi + + if test "$do64bit" != "no" ; then + # All this magic is necessary for the Win64 SDK RC1 - hobbs + CC="\"${PATH64}/cl.exe\"" + CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" + RC="\"${MSSDK}/bin/rc.exe\"" + lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + LINKBIN="\"${PATH64}/link.exe\"" + CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + # Avoid 'unresolved external symbol __security_cookie' + # errors, c.f. http://support.microsoft.com/?id=894573 + TEA_ADD_LIBS([bufferoverflowU.lib]) + elif test "$doWince" != "no" ; then + CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" + if test "${TARGETCPU}" = "X86"; then + CC="\"${CEBINROOT}/cl.exe\"" + else + CC="\"${CEBINROOT}/cl${ARCH}.exe\"" + fi + CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" + RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" + arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` + defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" + if test "${SHARED_BUILD}" = "1" ; then + # Static CE builds require static celib as well + defs="${defs} _DLL" + fi + for i in $defs ; do + AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) + done + AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) + AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) + CFLAGS_DEBUG="-nologo -Zi -Od" + CFLAGS_OPTIMIZE="-nologo -Ox" + lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` + lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" + LINKBIN="\"${CEBINROOT}/link.exe\"" + AC_SUBST(CELIB_DIR) + else + RC="rc" + lflags="-nologo" + LINKBIN="link" + CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + fi + fi + + if test "$GCC" = "yes"; then + # mingw gcc mode + RC="windres" + CFLAGS_DEBUG="-g" + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + SHLIB_LD="$CC -shared" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" + LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" + else + SHLIB_LD="${LINKBIN} -dll ${lflags}" + # link -lib only works when -lib is the first arg + STLIB_LD="${LINKBIN} -lib ${lflags}" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' + PATHTYPE=-w + # For information on what debugtype is most useful, see: + # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp + # This essentially turns it all on. + LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" + LDFLAGS_OPTIMIZE="-release" + if test "$doWince" != "no" ; then + LDFLAGS_CONSOLE="-link ${lflags}" + LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} + else + LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" + LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" + fi + fi + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dll" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' + + TCL_LIB_VERSIONS_OK=nodots + # Bogus to avoid getting this turned off + DL_OBJS="tclLoadNone.obj" + ;; + AIX-*) + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then + # AIX requires the _r compiler when gcc isn't being used + case "${CC}" in + *_r) + # ok ... + ;; + *) + CC=${CC}_r + ;; + esac + AC_MSG_RESULT([Using $CC for compiling with threads]) + fi + LIBS="$LIBS -lc" + SHLIB_CFLAGS="" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + DL_OBJS="tclLoadDl.o" + LD_LIBRARY_PATH_VAR="LIBPATH" + + # Check to enable 64-bit flags for compiler/linker on AIX 4+ + if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + else + do64bit_ok=yes + CFLAGS="$CFLAGS -q64" + LDFLAGS_ARCH="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + else + SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' + fi + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then + AC_LIBOBJ([tclLoadAix]) + DL_LIBS="-lld" + fi + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) + fi + ;; + BeOS*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="${CC} -nostart" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + + #----------------------------------------------------------- + # Check for inet_ntoa in -lbind, for BeOS (which also needs + # -lsocket, even if the network functions are in -lnet which + # is always linked to, for compatibility. + #----------------------------------------------------------- + AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) + ;; + BSD/OS-2.1*|BSD/OS-3*) + SHLIB_CFLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD="cc -shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + HP-UX-*.11.*) + # Use updated header definitions where possible + AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) + # Needed by Tcl, but not most extensions + #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) + #LIBS="$LIBS -lxnet" # Use the XOPEN network library + + if test "`uname -m`" = "ia64" ; then + SHLIB_SUFFIX=".so" + # Use newer C++ library for C++ extensions + #if test "$GCC" != "yes" ; then + # CPPFLAGS="-AA" + #fi + else + SHLIB_SUFFIX=".sl" + fi + AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + SHLIB_LD_LIBS='${LIBS}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc + #CFLAGS="$CFLAGS +DAportable" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + hpux_arch=`${CC} -dumpmachine` + case $hpux_arch in + hppa64*) + # 64-bit gcc in use. Fix flags for GNU ld. + do64bit_ok=yes + SHLIB_LD="${CC} -shared" + SHLIB_LD_LIBS='${LIBS}' + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + *) + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + ;; + esac + else + do64bit_ok=yes + CFLAGS="$CFLAGS +DD64" + LDFLAGS_ARCH="+DD64" + fi + fi + ;; + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + SHLIB_SUFFIX=".sl" + AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + ;; + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + ;; + IRIX-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mabi=n32" + LDFLAGS="$LDFLAGS -mabi=n32" + else + case $system in + IRIX-6.3) + # Use to build 6.2 compatible binaries on 6.3. + CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" + ;; + *) + CFLAGS="$CFLAGS -n32" + ;; + esac + LDFLAGS="$LDFLAGS -n32" + fi + ;; + IRIX64-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + + # Check to enable 64-bit flags for compiler/linker + + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN([64bit mode not supported by gcc]) + else + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS_ARCH="-64" + fi + fi + ;; + Linux*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings + # when you inline the string and math operations. Turn this off to + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + if test $do64bit = yes; then + AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_m64 = yes; then + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + fi + fi + + # The combo of gcc + glibc has a bug related + # to inlining of functions like strtod(). The + # -fno-builtin flag should address this problem + # but it does not work. The -fno-inline flag + # is kind of overkill but it works. + # Disable inlining only when one of the + # files in compat/*.c is being linked in. + if test x"${USE_COMPAT}" != x ; then + CFLAGS="$CFLAGS -fno-inline" + fi + + ;; + GNU*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + SHLIB_LD="${CC} -shared" + DL_OBJS="" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + ;; + Lynx*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + CFLAGS_OPTIMIZE=-02 + SHLIB_LD="${CC} -shared " + DL_OBJS="tclLoadDl.o" + DL_LIBS="-mshared -ldl" + LD_FLAGS="-Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + ;; + MP-RAS-02*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + MP-RAS-*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,-Bexport" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + NetBSD-*|FreeBSD-[[1-2]].*) + # NetBSD/SPARC needs -fPIC, -fpic will not do. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ + AC_EGREP_CPP(yes, [ +#ifdef __ELF__ + yes +#endif + ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) + if test $tcl_cv_ld_elf = yes; then + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + else + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + fi + + # Ancient FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + OpenBSD-*) + # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. + case `machine` in + sparc|sparc64) + SHLIB_CFLAGS="-fPIC";; + *) + SHLIB_CFLAGS="-fpic";; + esac + SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ + AC_EGREP_CPP(yes, [ +#ifdef __ELF__ + yes +#endif + ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) + if test $tcl_cv_ld_elf = yes; then + LDFLAGS=-Wl,-export-dynamic + else + LDFLAGS="" + fi + + # OpenBSD doesn't do version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "${TCL_THREADS}" = "1" ; then + # The -pthread needs to go in the CFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + case $system in + FreeBSD-3.*) + # FreeBSD-3 doesn't handle version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + TCL_LIB_VERSIONS_OK=nodots + ;; + esac + ;; + Darwin-*) + CFLAGS_OPTIMIZE="-Os" + SHLIB_CFLAGS="-fno-common" + # To avoid discrepancies between what headers configure sees during + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: + CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" + if test $do64bit = yes; then + case `arch` in + ppc) + AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], + tcl_cv_cc_arch_ppc64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes, + tcl_cv_cc_arch_ppc64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_arch_ppc64 = yes; then + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + do64bit_ok=yes + fi;; + i386) + AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], + tcl_cv_cc_arch_x86_64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch x86_64" + AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes, + tcl_cv_cc_arch_x86_64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_arch_x86_64 = yes; then + CFLAGS="$CFLAGS -arch x86_64" + do64bit_ok=yes + fi;; + *) + AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; + esac + else + # Check for combined 32-bit and 64-bit fat build + echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ + echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ + fat_32_64=yes + fi + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' + AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" + AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_single_module = yes; then + SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + fi + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" + DL_LIBS="" + # Don't use -prebind when building for Mac OS X 10.4 or later only: + test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \ + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \ + LDFLAGS="$LDFLAGS -prebind" + LDFLAGS="$LDFLAGS -headerpad_max_install_names" + AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_search_paths_first = yes; then + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + + # TEA specific: for Tk extensions, remove 64-bit arch flags from + # CFLAGS et al. for combined 32 & 64 bit fat builds as neither + # TkAqua nor TkX11 can be built for 64-bit at present. + test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done + ;; + NEXTSTEP-*) + SHLIB_CFLAGS="" + SHLIB_LD="cc -nostdlib -r" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadNext.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OS/390-*) + CFLAGS_OPTIMIZE="" # Optimizer is buggy + AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h + [Should OS/390 do the right thing with sockets?]) + ;; + OSF1-1.0|OSF1-1.1|OSF1-1.2) + # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + SHLIB_CFLAGS="" + # Hack: make package name same as library name + SHLIB_LD='ld -R -export $@:' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadOSF.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-1.*) + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SHLIB_CFLAGS="-fPIC" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD="ld -shared" + else + SHLIB_LD="ld -non_shared" + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-V*) + # Digital OSF/1 + SHLIB_CFLAGS="" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD='ld -shared -expect_unresolved "*"' + else + SHLIB_LD='ld -non_shared -expect_unresolved "*"' + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mieee" + else + CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" + fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = "1" ; then + CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" + CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + LIBS=`echo $LIBS | sed s/-lpthreads//` + if test "$GCC" = "yes" ; then + LIBS="$LIBS -lpthread -lmach -lexc" + else + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + fi + + ;; + QNX-6*) + # QNX RTP + # This may work for all QNX, but it was only reported for v6. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + # dlopen is in -lc on QNX + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SCO_SV-3.2*) + # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # this test works, since "uname -s" was non-standard in 3.2.4 and + # below. + if test "$GCC" = "yes" ; then + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + else + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + fi + SHLIB_LD="ld -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SINIX*5.4*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SunOS-4*) + SHLIB_CFLAGS="-PIC" + SHLIB_LD="ld" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + + # SunOS can't handle version numbers with dots in them in library + # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it + # requires an extra version number at the end of .so file names. + # So, the library has to have a name like libtcl75.so.1.0 + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + SunOS-5.[[0-6]]) + # Careful to not let 5.10+ fall into this case + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + + SHLIB_CFLAGS="-KPIC" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + ;; + SunOS-5*) + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + + SHLIB_CFLAGS="-KPIC" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + arch=`isainfo` + if test "$arch" = "sparcv9 sparc" ; then + if test "$GCC" = "yes" ; then + if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then + AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) + else + do64bit_ok=yes + CFLAGS="$CFLAGS -m64 -mcpu=v9" + LDFLAGS="$LDFLAGS -m64 -mcpu=v9" + SHLIB_CFLAGS="-fPIC" + fi + else + do64bit_ok=yes + if test "$do64bitVIS" = "yes" ; then + CFLAGS="$CFLAGS -xarch=v9a" + LDFLAGS_ARCH="-xarch=v9a" + else + CFLAGS="$CFLAGS -xarch=v9" + LDFLAGS_ARCH="-xarch=v9" + fi + # Solaris 64 uses this as well + #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" + fi + elif test "$arch" = "amd64 i386" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + else + do64bit_ok=yes + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64" + fi + else + AC_MSG_WARN([64bit mode not supported for $arch]) + fi + fi + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "$do64bit_ok" = "yes" ; then + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + fi + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + fi + ;; + UNIX_SV* | UnixWare-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-Bexport" + AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_Bexport = yes; then + LDFLAGS="$LDFLAGS -Wl,-Bexport" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + esac + + if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then + AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) + fi + +dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so +dnl # until the end of configure, as configure's compile and link tests use +dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's +dnl # preprocessing tests use only CPPFLAGS. + AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) + + # Step 4: disable dynamic loading if requested via a command-line switch. + + AC_ARG_ENABLE(load, + AC_HELP_STRING([--enable-load], + [allow dynamic loading and "load" command (default: on)]), + [tcl_ok=$enableval], [tcl_ok=yes]) + if test "$tcl_ok" = "no"; then + DL_OBJS="" + fi + + if test "x$DL_OBJS" != "x" ; then + BUILD_DLTEST="\$(DLTEST_TARGETS)" + else + echo "Can't figure out how to do dynamic loading or shared libraries" + echo "on this system." + SHLIB_CFLAGS="" + SHLIB_LD="" + SHLIB_SUFFIX="" + DL_OBJS="tclLoadNone.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS_ORIG" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + BUILD_DLTEST="" + fi + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" + + # If we're running gcc, then change the C flags for compiling shared + # libraries to the right flags for gcc, instead of those for the + # standard manufacturer compiler. + + if test "$DL_OBJS" != "tclLoadNone.o" ; then + if test "$GCC" = "yes" ; then + case $system in + AIX-*) + ;; + BSD/OS*) + ;; + IRIX*) + ;; + NetBSD-*|FreeBSD-*) + ;; + Darwin-*) + ;; + SCO_SV-3.2*) + ;; + windows) + ;; + *) + SHLIB_CFLAGS="-fPIC" + ;; + esac + fi + fi + + if test "$SHARED_LIB_SUFFIX" = "" ; then + SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' + fi + if test "$UNSHARED_LIB_SUFFIX" = "" ; then + UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' + fi + + AC_SUBST(DL_LIBS) + + AC_SUBST(CFLAGS_DEBUG) + AC_SUBST(CFLAGS_OPTIMIZE) + AC_SUBST(CFLAGS_WARNING) + + AC_SUBST(STLIB_LD) + AC_SUBST(SHLIB_LD) + + AC_SUBST(SHLIB_LD_LIBS) + AC_SUBST(SHLIB_CFLAGS) + + AC_SUBST(LD_LIBRARY_PATH_VAR) + + # These must be called after we do the basic CFLAGS checks and + # verify any possible 64-bit or similar switches are necessary + TEA_TCL_EARLY_FLAGS + TEA_TCL_64BIT_FLAGS +]) + +#-------------------------------------------------------------------- +# TEA_SERIAL_PORT +# +# Determine which interface to use to talk to the serial port. +# Note that #include lines must begin in leftmost column for +# some compilers to recognize them as preprocessor directives, +# and some build environments have stdin not pointing at a +# pseudo-terminal (usually /dev/null instead.) +# +# Arguments: +# none +# +# Results: +# +# Defines only one of the following vars: +# HAVE_SYS_MODEM_H +# USE_TERMIOS +# USE_TERMIO +# USE_SGTTY +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_SERIAL_PORT], [ + AC_CHECK_HEADERS(sys/modem.h) + AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ + AC_TRY_RUN([ +#include + +int main() { + struct termios t; + if (tcgetattr(0, &t) == 0) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include + +int main() { + struct termio t; + if (ioctl(0, TCGETA, &t) == 0) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include + +int main() { + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct termios t; + if (tcgetattr(0, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct termio t; + if (ioctl(0, TCGETA, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; + }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) + fi]) + case $tcl_cv_api_serial in + termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; + termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; + sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; + esac +]) + +#-------------------------------------------------------------------- +# TEA_MISSING_POSIX_HEADERS +# +# Supply substitutes for missing POSIX header files. Special +# notes: +# - stdlib.h doesn't define strtol, strtoul, or +# strtod insome versions of SunOS +# - some versions of string.h don't declare procedures such +# as strstr +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# NO_DIRENT_H +# NO_ERRNO_H +# NO_VALUES_H +# HAVE_LIMITS_H or NO_LIMITS_H +# NO_STDLIB_H +# NO_STRING_H +# NO_SYS_WAIT_H +# NO_DLFCN_H +# HAVE_SYS_PARAM_H +# +# HAVE_STRING_H ? +# +# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and +# CHECK on limits.h +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ + AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ + AC_TRY_LINK([#include +#include ], [ +#ifndef _POSIX_SOURCE +# ifdef __Lynx__ + /* + * Generate compilation error to make the test fail: Lynx headers + * are only valid if really in the POSIX environment. + */ + + missing_procedure(); +# endif +#endif +DIR *d; +struct dirent *entryPtr; +char *p; +d = opendir("foobar"); +entryPtr = readdir(d); +p = entryPtr->d_name; +closedir(d); +], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) + + if test $tcl_cv_dirent_h = no; then + AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) + fi + + AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(limits.h, + [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], + [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) + AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) + AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) + AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) + if test $tcl_ok = 0; then + AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) + fi + AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) + AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) + AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) + + # See also memmove check below for a place where NO_STRING_H can be + # set and why. + + if test $tcl_ok = 0; then + AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) + fi + + AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) + + # OS/390 lacks sys/param.h (and doesn't need it, by chance). + AC_HAVE_HEADERS(sys/param.h) +]) + +#-------------------------------------------------------------------- +# TEA_PATH_X +# +# Locate the X11 header files and the X11 library archive. Try +# the ac_path_x macro first, but if it doesn't find the X stuff +# (e.g. because there's no xmkmf program) then check through +# a list of possible directories. Under some conditions the +# autoconf macro will return an include directory that contains +# no include files, so double-check its result just to be safe. +# +# This should be called after TEA_CONFIG_CFLAGS as setting the +# LIBS line can confuse some configure macro magic. +# +# Arguments: +# none +# +# Results: +# +# Sets the following vars: +# XINCLUDES +# XLIBSW +# PKG_LIBS (appends to) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_PATH_X], [ + if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then + TEA_PATH_UNIX_X + fi +]) + +AC_DEFUN([TEA_PATH_UNIX_X], [ + AC_PATH_X + not_really_there="" + if test "$no_x" = ""; then + if test "$x_includes" = ""; then + AC_TRY_CPP([#include ], , not_really_there="yes") + else + if test ! -r $x_includes/X11/Intrinsic.h; then + not_really_there="yes" + fi + fi + fi + if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then + AC_MSG_CHECKING([for X11 header files]) + found_xincludes="no" + AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") + if test "$found_xincludes" = "no"; then + dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" + for i in $dirs ; do + if test -r $i/X11/Intrinsic.h; then + AC_MSG_RESULT([$i]) + XINCLUDES=" -I$i" + found_xincludes="yes" + break + fi + done + fi + else + if test "$x_includes" != ""; then + XINCLUDES="-I$x_includes" + found_xincludes="yes" + fi + fi + if test found_xincludes = "no"; then + AC_MSG_RESULT([couldn't find any!]) + fi + + if test "$no_x" = yes; then + AC_MSG_CHECKING([for X11 libraries]) + XLIBSW=nope + dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" + for i in $dirs ; do + if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then + AC_MSG_RESULT([$i]) + XLIBSW="-L$i -lX11" + x_libraries="$i" + break + fi + done + else + if test "$x_libraries" = ""; then + XLIBSW=-lX11 + else + XLIBSW="-L$x_libraries -lX11" + fi + fi + if test "$XLIBSW" = nope ; then + AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) + fi + if test "$XLIBSW" = nope ; then + AC_MSG_RESULT([could not find any! Using -lX11.]) + XLIBSW=-lX11 + fi + if test x"${XLIBSW}" != x ; then + PKG_LIBS="${PKG_LIBS} ${XLIBSW}" + fi +]) + +#-------------------------------------------------------------------- +# TEA_BLOCKING_STYLE +# +# The statements below check for systems where POSIX-style +# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. +# On these systems (mostly older ones), use the old BSD-style +# FIONBIO approach instead. +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# HAVE_SYS_IOCTL_H +# HAVE_SYS_FILIO_H +# USE_FIONBIO +# O_NONBLOCK +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_BLOCKING_STYLE], [ + AC_CHECK_HEADERS(sys/ioctl.h) + AC_CHECK_HEADERS(sys/filio.h) + TEA_CONFIG_SYSTEM + AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) + case $system in + # There used to be code here to use FIONBIO under AIX. However, it + # was reported that FIONBIO doesn't work under AIX 3.2.5. Since + # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO + # code (JO, 5/31/97). + + OSF*) + AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) + AC_MSG_RESULT([FIONBIO]) + ;; + SunOS-4*) + AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) + AC_MSG_RESULT([FIONBIO]) + ;; + *) + AC_MSG_RESULT([O_NONBLOCK]) + ;; + esac +]) + +#-------------------------------------------------------------------- +# TEA_TIME_HANLDER +# +# Checks how the system deals with time.h, what time structures +# are used on the system, and what fields the structures have. +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# USE_DELTA_FOR_TZ +# HAVE_TM_GMTOFF +# HAVE_TM_TZADJ +# HAVE_TIMEZONE_VAR +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TIME_HANDLER], [ + AC_CHECK_HEADERS(sys/time.h) + AC_HEADER_TIME + AC_STRUCT_TIMEZONE + + AC_CHECK_FUNCS(gmtime_r localtime_r) + + AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ + AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], + tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) + if test $tcl_cv_member_tm_tzadj = yes ; then + AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) + fi + + AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ + AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], + tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) + if test $tcl_cv_member_tm_gmtoff = yes ; then + AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) + fi + + # + # Its important to include time.h in this check, as some systems + # (like convex) have timezone functions, etc. + # + AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ + AC_TRY_COMPILE([#include ], + [extern long timezone; + timezone += 1; + exit (0);], + tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) + if test $tcl_cv_timezone_long = yes ; then + AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) + else + # + # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. + # + AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ + AC_TRY_COMPILE([#include ], + [extern time_t timezone; + timezone += 1; + exit (0);], + tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) + if test $tcl_cv_timezone_time = yes ; then + AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) + fi + fi +]) + +#-------------------------------------------------------------------- +# TEA_BUGGY_STRTOD +# +# Under Solaris 2.4, strtod returns the wrong value for the +# terminating character under some conditions. Check for this +# and if the problem exists use a substitute procedure +# "fixstrtod" (provided by Tcl) that corrects the error. +# Also, on Compaq's Tru64 Unix 5.0, +# strtod(" ") returns 0.0 instead of a failure to convert. +# +# Arguments: +# none +# +# Results: +# +# Might defines some of the following vars: +# strtod (=fixstrtod) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_BUGGY_STRTOD], [ + AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) + if test "$tcl_strtod" = 1; then + AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ + AC_TRY_RUN([ + extern double strtod(); + int main() { + char *infString="Inf", *nanString="NaN", *spaceString=" "; + char *term; + double value; + value = strtod(infString, &term); + if ((term != infString) && (term[-1] == 0)) { + exit(1); + } + value = strtod(nanString, &term); + if ((term != nanString) && (term[-1] == 0)) { + exit(1); + } + value = strtod(spaceString, &term); + if (term == (spaceString+1)) { + exit(1); + } + exit(0); + }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, + tcl_cv_strtod_buggy=buggy)]) + if test "$tcl_cv_strtod_buggy" = buggy; then + AC_LIBOBJ([fixstrtod]) + USE_COMPAT=1 + AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) + fi + fi +]) + +#-------------------------------------------------------------------- +# TEA_TCL_LINK_LIBS +# +# Search for the libraries needed to link the Tcl shell. +# Things like the math library (-lm) and socket stuff (-lsocket vs. +# -lnsl) are dealt with here. +# +# Arguments: +# Requires the following vars to be set in the Makefile: +# DL_LIBS +# LIBS +# MATH_LIBS +# +# Results: +# +# Subst's the following var: +# TCL_LIBS +# MATH_LIBS +# +# Might append to the following vars: +# LIBS +# +# Might define the following vars: +# HAVE_NET_ERRNO_H +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_LINK_LIBS], [ + #-------------------------------------------------------------------- + # On a few very rare systems, all of the libm.a stuff is + # already in libc.a. Set compiler flags accordingly. + # Also, Linux requires the "ieee" library for math to work + # right (and it must appear before "-lm"). + #-------------------------------------------------------------------- + + AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") + AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) + + #-------------------------------------------------------------------- + # Interactive UNIX requires -linet instead of -lsocket, plus it + # needs net/errno.h to define the socket-related error codes. + #-------------------------------------------------------------------- + + AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) + AC_CHECK_HEADER(net/errno.h, [ + AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) + + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- + + tcl_checkBoth=0 + AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) + if test "$tcl_checkSocket" = 1; then + AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, + LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) + fi + if test "$tcl_checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) + fi + AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, + [LIBS="$LIBS -lnsl"])]) + + # Don't perform the eval of the libraries here because DL_LIBS + # won't be set until we call TEA_CONFIG_CFLAGS + + TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' + AC_SUBST(TCL_LIBS) + AC_SUBST(MATH_LIBS) +]) + +#-------------------------------------------------------------------- +# TEA_TCL_EARLY_FLAGS +# +# Check for what flags are needed to be passed so the correct OS +# features are available. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# _ISOC99_SOURCE +# _LARGEFILE64_SOURCE +# _LARGEFILE_SOURCE64 +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_EARLY_FLAG],[ + AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), + AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, + AC_TRY_COMPILE([[#define ]$1[ 1 +]$2], $3, + [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, + [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) + if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then + AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) + tcl_flags="$tcl_flags $1" + fi +]) + +AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ + AC_MSG_CHECKING([for required early compiler flags]) + tcl_flags="" + TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], + [char *p = (char *)strtoll; char *q = (char *)strtoull;]) + TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], + [struct stat64 buf; int i = stat64("/", &buf);]) + TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ], + [char *p = (char *)open64;]) + if test "x${tcl_flags}" = "x" ; then + AC_MSG_RESULT([none]) + else + AC_MSG_RESULT([${tcl_flags}]) + fi +]) + +#-------------------------------------------------------------------- +# TEA_TCL_64BIT_FLAGS +# +# Check for what is defined in the way of 64-bit features. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# TCL_WIDE_INT_IS_LONG +# TCL_WIDE_INT_TYPE +# HAVE_STRUCT_DIRENT64 +# HAVE_STRUCT_STAT64 +# HAVE_TYPE_OFF64_T +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ + AC_MSG_CHECKING([for 64-bit integer type]) + AC_CACHE_VAL(tcl_cv_type_64bit,[ + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], + tcl_type_64bit=__int64, tcl_type_64bit="long long") + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + AC_TRY_COMPILE(,[switch (0) { + case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; + }],tcl_cv_type_64bit=${tcl_type_64bit})]) + if test "${tcl_cv_type_64bit}" = none ; then + AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) + AC_MSG_RESULT([using long]) + elif test "${tcl_cv_type_64bit}" = "__int64" \ + -a "${TEA_PLATFORM}" = "windows" ; then + # We actually want to use the default tcl.h checks in this + # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* + AC_MSG_RESULT([using Tcl header defaults]) + else + AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, + [What type should be used to define wide integers?]) + AC_MSG_RESULT([${tcl_cv_type_64bit}]) + + # Now check for auxiliary declarations + AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ + AC_TRY_COMPILE([#include +#include ],[struct dirent64 p;], + tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) + fi + + AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ + AC_TRY_COMPILE([#include ],[struct stat64 p; +], + tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) + fi + + AC_CHECK_FUNCS(open64 lseek64) + AC_MSG_CHECKING([for off64_t]) + AC_CACHE_VAL(tcl_cv_type_off64_t,[ + AC_TRY_COMPILE([#include ],[off64_t offset; +], + tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) + dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the + dnl functions lseek64 and open64 are defined. + if test "x${tcl_cv_type_off64_t}" = "xyes" && \ + test "x${ac_cv_func_lseek64}" = "xyes" && \ + test "x${ac_cv_func_open64}" = "xyes" ; then + AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + fi +]) + +## +## Here ends the standard Tcl configuration bits and starts the +## TEA specific functions +## + +#------------------------------------------------------------------------ +# TEA_INIT -- +# +# Init various Tcl Extension Architecture (TEA) variables. +# This should be the first called TEA_* macro. +# +# Arguments: +# none +# +# Results: +# +# Defines and substs the following vars: +# CYGPATH +# EXEEXT +# Defines only: +# TEA_VERSION +# TEA_INITED +# TEA_PLATFORM (windows or unix) +# +# "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. +# +# EXEEXT +# Select the executable extension based on the host type. This +# is a lightweight replacement for AC_EXEEXT that doesn't require +# a compiler. +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_INIT], [ + # TEA extensions pass this us the version of TEA they think they + # are compatible with. + TEA_VERSION="3.6" + + AC_MSG_CHECKING([for correct TEA configuration]) + if test x"${PACKAGE_NAME}" = x ; then + AC_MSG_ERROR([ +The PACKAGE_NAME variable must be defined by your TEA configure.in]) + fi + if test x"$1" = x ; then + AC_MSG_ERROR([ +TEA version not specified.]) + elif test "$1" != "${TEA_VERSION}" ; then + AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) + else + AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) + fi + case "`uname -s`" in + *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) + AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) + EXEEXT=".exe" + TEA_PLATFORM="windows" + ;; + *) + CYGPATH=echo + EXEEXT="" + TEA_PLATFORM="unix" + ;; + esac + + # Check if exec_prefix is set. If not use fall back to prefix. + # Note when adjusted, so that TEA_PREFIX can correct for this. + # This is needed for recursive configures, since autoconf propagates + # $prefix, but not $exec_prefix (doh!). + if test x$exec_prefix = xNONE ; then + exec_prefix_default=yes + exec_prefix=$prefix + fi + + AC_SUBST(EXEEXT) + AC_SUBST(CYGPATH) + + # This package name must be replaced statically for AC_SUBST to work + AC_SUBST(PKG_LIB_FILE) + # Substitute STUB_LIB_FILE in case package creates a stub library too. + AC_SUBST(PKG_STUB_LIB_FILE) + + # We AC_SUBST these here to ensure they are subst'ed, + # in case the user doesn't call TEA_ADD_... + AC_SUBST(PKG_STUB_SOURCES) + AC_SUBST(PKG_STUB_OBJECTS) + AC_SUBST(PKG_TCL_SOURCES) + AC_SUBST(PKG_HEADERS) + AC_SUBST(PKG_INCLUDES) + AC_SUBST(PKG_LIBS) + AC_SUBST(PKG_CFLAGS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_SOURCES -- +# +# Specify one or more source files. Users should check for +# the right platform before adding to their list. +# It is not important to specify the directory, as long as it is +# in the generic, win or unix subdirectory of $(srcdir). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_SOURCES +# PKG_OBJECTS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_SOURCES], [ + vars="$@" + for i in $vars; do + case $i in + [\$]*) + # allow $-var names + PKG_SOURCES="$PKG_SOURCES $i" + PKG_OBJECTS="$PKG_OBJECTS $i" + ;; + *) + # check for existence - allows for generic/win/unix VPATH + # To add more dirs here (like 'src'), you have to update VPATH + # in Makefile.in as well + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + AC_MSG_ERROR([could not find source file '$i']) + fi + PKG_SOURCES="$PKG_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" + fi + PKG_OBJECTS="$PKG_OBJECTS $j" + ;; + esac + done + AC_SUBST(PKG_SOURCES) + AC_SUBST(PKG_OBJECTS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_STUB_SOURCES -- +# +# Specify one or more source files. Users should check for +# the right platform before adding to their list. +# It is not important to specify the directory, as long as it is +# in the generic, win or unix subdirectory of $(srcdir). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_STUB_SOURCES +# PKG_STUB_OBJECTS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_STUB_SOURCES], [ + vars="$@" + for i in $vars; do + # check for existence - allows for generic/win/unix VPATH + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + AC_MSG_ERROR([could not find stub source file '$i']) + fi + PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" + fi + PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" + done + AC_SUBST(PKG_STUB_SOURCES) + AC_SUBST(PKG_STUB_OBJECTS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_TCL_SOURCES -- +# +# Specify one or more Tcl source files. These should be platform +# independent runtime files. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_TCL_SOURCES +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_TCL_SOURCES], [ + vars="$@" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) + fi + PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" + done + AC_SUBST(PKG_TCL_SOURCES) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_HEADERS -- +# +# Specify one or more source headers. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_HEADERS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_HEADERS], [ + vars="$@" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + AC_MSG_ERROR([could not find header file '${srcdir}/$i']) + fi + PKG_HEADERS="$PKG_HEADERS $i" + done + AC_SUBST(PKG_HEADERS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_INCLUDES -- +# +# Specify one or more include dirs. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_INCLUDES +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_INCLUDES], [ + vars="$@" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + AC_SUBST(PKG_INCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_LIBS -- +# +# Specify one or more libraries. Users should check for +# the right platform before adding to their list. For Windows, +# libraries provided in "foo.lib" format will be converted to +# "-lfoo" when using GCC (mingw). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_LIBS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_LIBS], [ + vars="$@" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + AC_SUBST(PKG_LIBS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_CFLAGS -- +# +# Specify one or more CFLAGS. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_CFLAGS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_CFLAGS], [ + PKG_CFLAGS="$PKG_CFLAGS $@" + AC_SUBST(PKG_CFLAGS) +]) + +#------------------------------------------------------------------------ +# TEA_PREFIX -- +# +# Handle the --prefix=... option by defaulting to what Tcl gave +# +# Arguments: +# none +# +# Results: +# +# If --prefix or --exec-prefix was not specified, $prefix and +# $exec_prefix will be set to the values given to Tcl when it was +# configured. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_PREFIX], [ + if test "${prefix}" = "NONE"; then + prefix_default=yes + if test x"${TCL_PREFIX}" != x; then + AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) + prefix=${TCL_PREFIX} + else + AC_MSG_NOTICE([--prefix defaulting to /usr/local]) + prefix=/usr/local + fi + fi + if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ + -o x"${exec_prefix_default}" = x"yes" ; then + if test x"${TCL_EXEC_PREFIX}" != x; then + AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) + exec_prefix=${TCL_EXEC_PREFIX} + else + AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) + exec_prefix=$prefix + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_SETUP_COMPILER_CC -- +# +# Do compiler checks the way we want. This is just a replacement +# for AC_PROG_CC in TEA configure.in files to make them cleaner. +# +# Arguments: +# none +# +# Results: +# +# Sets up CC var and other standard bits we need to make executables. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_SETUP_COMPILER_CC], [ + # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) + # in this macro, they need to go into TEA_SETUP_COMPILER instead. + + # If the user did not set CFLAGS, set it now to keep + # the AC_PROG_CC macro from adding "-g -O2". + if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" + fi + + AC_PROG_CC + AC_PROG_CPP + + AC_PROG_INSTALL + + #-------------------------------------------------------------------- + # Checks to see if the make program sets the $MAKE variable. + #-------------------------------------------------------------------- + + AC_PROG_MAKE_SET + + #-------------------------------------------------------------------- + # Find ranlib + #-------------------------------------------------------------------- + + AC_PROG_RANLIB + + #-------------------------------------------------------------------- + # Determines the correct binary file extension (.o, .obj, .exe etc.) + #-------------------------------------------------------------------- + + AC_OBJEXT + AC_EXEEXT +]) + +#------------------------------------------------------------------------ +# TEA_SETUP_COMPILER -- +# +# Do compiler checks that use the compiler. This must go after +# TEA_SETUP_COMPILER_CC, which does the actual compiler check. +# +# Arguments: +# none +# +# Results: +# +# Sets up CC var and other standard bits we need to make executables. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_SETUP_COMPILER], [ + # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. + AC_REQUIRE([TEA_SETUP_COMPILER_CC]) + + #------------------------------------------------------------------------ + # If we're using GCC, see if the compiler understands -pipe. If so, use it. + # It makes compiling go faster. (This is only a performance feature.) + #------------------------------------------------------------------------ + + if test -z "$no_pipe" -a -n "$GCC"; then + AC_CACHE_CHECK([if the compiler understands -pipe], + tcl_cv_cc_pipe, [ + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" + AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_pipe = yes; then + CFLAGS="$CFLAGS -pipe" + fi + fi + + #-------------------------------------------------------------------- + # Common compiler flag setup + #-------------------------------------------------------------------- + + AC_C_BIGENDIAN + if test "${TEA_PLATFORM}" = "unix" ; then + TEA_TCL_LINK_LIBS + TEA_MISSING_POSIX_HEADERS + # Let the user call this, because if it triggers, they will + # need a compat/strtod.c that is correct. Users can also + # use Tcl_GetDouble(FromObj) instead. + #TEA_BUGGY_STRTOD + fi +]) + +#------------------------------------------------------------------------ +# TEA_MAKE_LIB -- +# +# Generate a line that can be used to build a shared/unshared library +# in a platform independent manner. +# +# Arguments: +# none +# +# Requires: +# +# Results: +# +# Defines the following vars: +# CFLAGS - Done late here to note disturb other AC macros +# MAKE_LIB - Command to execute to build the Tcl library; +# differs depending on whether or not Tcl is being +# compiled as a shared library. +# MAKE_SHARED_LIB Makefile rule for building a shared library +# MAKE_STATIC_LIB Makefile rule for building a static library +# MAKE_STUB_LIB Makefile rule for building a stub library +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_MAKE_LIB], [ + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then + MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" + MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" + else + MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" + MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" + fi + + if test "${SHARED_BUILD}" = "1" ; then + MAKE_LIB="${MAKE_SHARED_LIB} " + else + MAKE_LIB="${MAKE_STATIC_LIB} " + fi + + #-------------------------------------------------------------------- + # Shared libraries and static libraries have different names. + # Use the double eval to make sure any variables in the suffix is + # substituted. (@@@ Might not be necessary anymore) + #-------------------------------------------------------------------- + + if test "${TEA_PLATFORM}" = "windows" ; then + if test "${SHARED_BUILD}" = "1" ; then + # We force the unresolved linking of symbols that are really in + # the private libraries of Tcl and Tk. + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" + fi + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + else + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + if test "$GCC" = "yes"; then + PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} + fi + # These aren't needed on Windows (either MSVC or gcc) + RANLIB=: + RANLIB_STUB=: + else + RANLIB_STUB="${RANLIB}" + if test "${SHARED_BUILD}" = "1" ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" + fi + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + fi + + # These are escaped so that only CFLAGS is picked up at configure time. + # The other values will be substituted at make time. + CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" + if test "${SHARED_BUILD}" = "1" ; then + CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" + fi + + AC_SUBST(MAKE_LIB) + AC_SUBST(MAKE_SHARED_LIB) + AC_SUBST(MAKE_STATIC_LIB) + AC_SUBST(MAKE_STUB_LIB) + AC_SUBST(RANLIB_STUB) +]) + +#------------------------------------------------------------------------ +# TEA_LIB_SPEC -- +# +# Compute the name of an existing object library located in libdir +# from the given base name and produce the appropriate linker flags. +# +# Arguments: +# basename The base name of the library without version +# numbers, extensions, or "lib" prefixes. +# extra_dir Extra directory in which to search for the +# library. This location is used first, then +# $prefix/$exec-prefix, then some defaults. +# +# Requires: +# TEA_INIT and TEA_PREFIX must be called first. +# +# Results: +# +# Defines the following vars: +# ${basename}_LIB_NAME The computed library name. +# ${basename}_LIB_SPEC The computed linker flags. +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LIB_SPEC], [ + AC_MSG_CHECKING([for $1 library]) + + # Look in exec-prefix for the library (defined by TEA_PREFIX). + + tea_lib_name_dir="${exec_prefix}/lib" + + # Or in a user-specified location. + + if test x"$2" != x ; then + tea_extra_lib_dir=$2 + else + tea_extra_lib_dir=NONE + fi + + for i in \ + `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do + if test -f "$i" ; then + tea_lib_name_dir=`dirname $i` + $1_LIB_NAME=`basename $i` + $1_LIB_PATH_NAME=$i + break + fi + done + + if test "${TEA_PLATFORM}" = "windows"; then + $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" + else + # Strip off the leading "lib" and trailing ".a" or ".so" + + tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` + $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" + fi + + if test "x${$1_LIB_NAME}" = x ; then + AC_MSG_ERROR([not found]) + else + AC_MSG_RESULT([${$1_LIB_SPEC}]) + fi +]) + +#------------------------------------------------------------------------ +# TEA_PRIVATE_TCL_HEADERS -- +# +# Locate the private Tcl include files +# +# Arguments: +# +# Requires: +# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has +# already been called. +# +# Results: +# +# Substs the following vars: +# TCL_TOP_DIR_NATIVE +# TCL_GENERIC_DIR_NATIVE +# TCL_UNIX_DIR_NATIVE +# TCL_WIN_DIR_NATIVE +# TCL_BMAP_DIR_NATIVE +# TCL_TOOL_DIR_NATIVE +# TCL_PLATFORM_DIR_NATIVE +# TCL_BIN_DIR_NATIVE +# TCL_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ + AC_MSG_CHECKING([for Tcl private include files]) + + TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` + TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" + TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" + TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" + TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" + TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" + TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" + TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" + + if test "${TEA_PLATFORM}" = "windows"; then + TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} + else + TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} + fi + # We want to ensure these are substituted so as not to require + # any *_NATIVE vars be defined in the Makefile + TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers and PrivateHeaders directories + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then + TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else + TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi + ;; + esac + else + if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then + AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) + fi + fi + + + AC_SUBST(TCL_TOP_DIR_NATIVE) + AC_SUBST(TCL_GENERIC_DIR_NATIVE) + AC_SUBST(TCL_UNIX_DIR_NATIVE) + AC_SUBST(TCL_WIN_DIR_NATIVE) + AC_SUBST(TCL_BMAP_DIR_NATIVE) + AC_SUBST(TCL_TOOL_DIR_NATIVE) + AC_SUBST(TCL_PLATFORM_DIR_NATIVE) + + AC_SUBST(TCL_INCLUDES) + AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) +]) + +#------------------------------------------------------------------------ +# TEA_PUBLIC_TCL_HEADERS -- +# +# Locate the installed public Tcl header files +# +# Arguments: +# None. +# +# Requires: +# CYGPATH must be set +# +# Results: +# +# Adds a --with-tclinclude switch to configure. +# Result is cached. +# +# Substs the following vars: +# TCL_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ + AC_MSG_CHECKING([for Tcl public headers]) + + AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) + + AC_CACHE_VAL(ac_cv_c_tclh, [ + # Use the value from --with-tclinclude, if it was given + + if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + ac_cv_c_tclh=${with_tclinclude} + else + AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) + fi + else + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers directory + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tcl is not installed, + # and in that situation, look there before installed locations. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + if test x"${TCL_INCLUDE_SPEC}" != x ; then + d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` + list="$list `ls -d ${d} 2>/dev/null`" + fi + fi + for i in $list ; do + if test -f "$i/tcl.h" ; then + ac_cv_c_tclh=$i + break + fi + done + fi + ]) + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tclh}" = x ; then + AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) + else + AC_MSG_RESULT([${ac_cv_c_tclh}]) + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` + + TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + AC_SUBST(TCL_INCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_PRIVATE_TK_HEADERS -- +# +# Locate the private Tk include files +# +# Arguments: +# +# Requires: +# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has +# already been called. +# +# Results: +# +# Substs the following vars: +# TK_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ + AC_MSG_CHECKING([for Tk private include files]) + + TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` + TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" + TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" + TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" + TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" + TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" + if test "${TEA_PLATFORM}" = "windows"; then + TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} + else + TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} + fi + # We want to ensure these are substituted so as not to require + # any *_NATIVE vars be defined in the Makefile + TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" + # Detect and add ttk subdir + if test -d ${TK_SRC_DIR_NATIVE}/generic/ttk; then + TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" + fi + if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ + -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" + fi + if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" + fi + if test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use + # the framework's Headers and PrivateHeaders directories + case ${TK_DEFS} in + *TK_FRAMEWORK*) + if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then + TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi + ;; + esac + else + if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then + AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) + fi + fi + + AC_SUBST(TK_TOP_DIR_NATIVE) + AC_SUBST(TK_UNIX_DIR_NATIVE) + AC_SUBST(TK_WIN_DIR_NATIVE) + AC_SUBST(TK_GENERIC_DIR_NATIVE) + AC_SUBST(TK_XLIB_DIR_NATIVE) + AC_SUBST(TK_PLATFORM_DIR_NATIVE) + + AC_SUBST(TK_INCLUDES) + AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) +]) + +#------------------------------------------------------------------------ +# TEA_PUBLIC_TK_HEADERS -- +# +# Locate the installed public Tk header files +# +# Arguments: +# None. +# +# Requires: +# CYGPATH must be set +# +# Results: +# +# Adds a --with-tkinclude switch to configure. +# Result is cached. +# +# Substs the following vars: +# TK_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ + AC_MSG_CHECKING([for Tk public headers]) + + AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) + + AC_CACHE_VAL(ac_cv_c_tkh, [ + # Use the value from --with-tkinclude, if it was given + + if test x"${with_tkinclude}" != x ; then + if test -f "${with_tkinclude}/tk.h" ; then + ac_cv_c_tkh=${with_tkinclude} + else + AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) + fi + else + if test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use + # the framework's Headers directory. + case ${TK_DEFS} in + *TK_FRAMEWORK*) + list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tk is not installed, + # and in that situation, look there before installed locations. + if test -f "${TK_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tk's --prefix location, + # relative to directory of tkConfig.sh, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TK_PREFIX}/include 2>/dev/null` \ + `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + fi + for i in $list ; do + if test -f "$i/tk.h" ; then + ac_cv_c_tkh=$i + break + fi + done + fi + ]) + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tkh}" = x ; then + AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) + else + AC_MSG_RESULT([${ac_cv_c_tkh}]) + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` + + TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + AC_SUBST(TK_INCLUDES) + + if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ + -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + # On Windows and Aqua, we need the X compat headers + AC_MSG_CHECKING([for X11 header files]) + if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then + INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" + TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + AC_SUBST(TK_XINCLUDES) + fi + AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) + fi +]) + +#------------------------------------------------------------------------ +# TEA_PROG_TCLSH +# Determine the fully qualified path name of the tclsh executable +# in the Tcl build directory or the tclsh installed in a bin +# directory. This macro will correctly determine the name +# of the tclsh executable even if tclsh has not yet been +# built in the build directory. The tclsh found is always +# associated with a tclConfig.sh file. This tclsh should be used +# only for running extension test cases. It should never be +# or generation of files (like pkgIndex.tcl) at build time. +# +# Arguments +# none +# +# Results +# Subst's the following values: +# TCLSH_PROG +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PROG_TCLSH], [ + AC_MSG_CHECKING([for tclsh]) + if test -f "${TCL_BIN_DIR}/Makefile" ; then + # tclConfig.sh is in Tcl build directory + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="${TCL_BIN_DIR}/tclsh" + fi + else + # tclConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" + fi + list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${TCLSH_PROG}" ; then + REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" + fi + AC_MSG_RESULT([${TCLSH_PROG}]) + AC_SUBST(TCLSH_PROG) +]) + +#------------------------------------------------------------------------ +# TEA_PROG_WISH +# Determine the fully qualified path name of the wish executable +# in the Tk build directory or the wish installed in a bin +# directory. This macro will correctly determine the name +# of the wish executable even if wish has not yet been +# built in the build directory. The wish found is always +# associated with a tkConfig.sh file. This wish should be used +# only for running extension test cases. It should never be +# or generation of files (like pkgIndex.tcl) at build time. +# +# Arguments +# none +# +# Results +# Subst's the following values: +# WISH_PROG +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PROG_WISH], [ + AC_MSG_CHECKING([for wish]) + if test -f "${TK_BIN_DIR}/Makefile" ; then + # tkConfig.sh is in Tk build directory + if test "${TEA_PLATFORM}" = "windows"; then + WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" + else + WISH_PROG="${TK_BIN_DIR}/wish" + fi + else + # tkConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" + else + WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" + fi + list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TK_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${WISH_PROG}" ; then + REAL_TK_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" + fi + AC_MSG_RESULT([${WISH_PROG}]) + AC_SUBST(WISH_PROG) +]) + +#------------------------------------------------------------------------ +# TEA_PATH_CONFIG -- +# +# Locate the ${1}Config.sh file and perform a sanity check on +# the ${1} compile flags. These are used by packages like +# [incr Tk] that load *Config.sh files from more than Tcl and Tk. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-$1=... +# +# Defines the following vars: +# $1_BIN_DIR Full path to the directory containing +# the $1Config.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_CONFIG], [ + # + # Ok, lets find the $1 configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-$1 + # + + if test x"${no_$1}" = x ; then + # we reset no_$1 in case something fails here + no_$1=true + AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) + AC_MSG_CHECKING([for $1 configuration]) + AC_CACHE_VAL(ac_cv_c_$1config,[ + + # First check to see if --with-$1 was specified. + if test x"${with_$1config}" != x ; then + case ${with_$1config} in + */$1Config.sh ) + if test -f ${with_$1config}; then + AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) + with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` + fi;; + esac + if test -f "${with_$1config}/$1Config.sh" ; then + ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` + else + AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) + fi + fi + + # then check for a private $1 installation + if test x"${ac_cv_c_$1config}" = x ; then + for i in \ + ../$1 \ + `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ../../$1 \ + `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ../../../$1 \ + `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ${srcdir}/../$1 \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ; do + if test -f "$i/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i; pwd)` + break + fi + if test -f "$i/unix/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i/unix; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_$1config}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_$1config}" = x ; then + $1_BIN_DIR="# no $1 configs found" + AC_MSG_WARN([Cannot find $1 configuration definitions]) + exit 0 + else + no_$1= + $1_BIN_DIR=${ac_cv_c_$1config} + AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_CONFIG -- +# +# Load the $1Config.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# $1_BIN_DIR +# +# Results: +# +# Subst the following vars: +# $1_SRC_DIR +# $1_LIB_FILE +# $1_LIB_SPEC +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_CONFIG], [ + AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) + + if test -f "${$1_BIN_DIR}/$1Config.sh" ; then + AC_MSG_RESULT([loading]) + . "${$1_BIN_DIR}/$1Config.sh" + else + AC_MSG_RESULT([file not found]) + fi + + # + # If the $1_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable $1_LIB_SPEC will be set to the value + # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC + # instead of $1_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + # + + if test -f "${$1_BIN_DIR}/Makefile" ; then + AC_MSG_WARN([Found Makefile - using build library specs for $1]) + $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} + $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} + $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} + fi + + AC_SUBST($1_VERSION) + AC_SUBST($1_BIN_DIR) + AC_SUBST($1_SRC_DIR) + + AC_SUBST($1_LIB_FILE) + AC_SUBST($1_LIB_SPEC) + + AC_SUBST($1_STUB_LIB_FILE) + AC_SUBST($1_STUB_LIB_SPEC) + AC_SUBST($1_STUB_LIB_PATH) +]) + +#------------------------------------------------------------------------ +# TEA_PATH_CELIB -- +# +# Locate Keuchel's celib emulation layer for targeting Win/CE +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-celib=... +# +# Defines the following vars: +# CELIB_DIR Full path to the directory containing +# the include and platform lib files +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_CELIB], [ + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-celib + + if test x"${no_celib}" = x ; then + # we reset no_celib in case something fails here + no_celib=true + AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) + AC_MSG_CHECKING([for Windows/CE celib directory]) + AC_CACHE_VAL(ac_cv_c_celibconfig,[ + # First check to see if --with-celibconfig was specified. + if test x"${with_celibconfig}" != x ; then + if test -d "${with_celibconfig}/inc" ; then + ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` + else + AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) + fi + fi + + # then check for a celib library + if test x"${ac_cv_c_celibconfig}" = x ; then + for i in \ + ../celib-palm-3.0 \ + ../celib \ + ../../celib-palm-3.0 \ + ../../celib \ + `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ + ${srcdir}/../celib-palm-3.0 \ + ${srcdir}/../celib \ + `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ + ; do + if test -d "$i/inc" ; then + ac_cv_c_celibconfig=`(cd $i; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_celibconfig}" = x ; then + AC_MSG_ERROR([Cannot find celib support library directory]) + else + no_celib= + CELIB_DIR=${ac_cv_c_celibconfig} + CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` + AC_MSG_RESULT([found $CELIB_DIR]) + fi + fi +]) + + +# Local Variables: +# mode: autoconf +# End: Index: library/store/XOTclSdbm/tune.h =================================================================== diff -u -N --- library/store/XOTclSdbm/tune.h (revision 0) +++ library/store/XOTclSdbm/tune.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,34 @@ +/* + * sdbm - ndbm work-alike hashed database library + * tuning and portability constructs [not nearly enough] + * author: oz@nexus.yorku.ca + */ + +#define BYTESIZ 8 + +#ifdef SVID +#include +#endif + +#ifdef BSD42 +#define SEEK_SET L_SET +#define memset(s,c,n) bzero(s, n) /* only when c is zero */ +#define memcpy(s1,s2,n) bcopy(s2, s1, n) +#define memcmp(s1,s2,n) bcmp(s1,s2,n) +#endif + +/* + * important tuning parms (hah) + */ + +#define SEEDUPS /* always detect duplicates */ +#define BADMESS /* generate a message for worst case: + cannot make room after SPLTMAX splits */ +/* + * misc + */ +#ifdef DEBUG +#define debug(x) printf x +#else +#define debug(x) +#endif Index: library/store/XOTclSdbm/util.c =================================================================== diff -u -N --- library/store/XOTclSdbm/util.c (revision 0) +++ library/store/XOTclSdbm/util.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,189 @@ +#include "config.h" +#include +#include +#include "sdbm.h" + +#ifdef HAVE_SYS_FILE_H +#include +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif +#include +extern int errno; + +void +oops(s1, s2) +register char *s1; +register char *s2; +{ +#ifndef HAVE_STRERROR + extern int sys_nerr; + extern char *sys_errlist[]; +#endif + extern char *progname; + + if (progname) + fprintf(stderr, "%s: ", progname); + fprintf(stderr, s1, s2); +#ifndef HAVE_STRERROR + if (errno > 0 && errno < sys_nerr) + fprintf(stderr, " (%s)", sys_errlist[errno]); +#else + if (errno > 0) + fprintf(stderr, " (%s)", strerror(errno)); +#endif + fprintf(stderr, "\n"); + exit(1); +} + +int +okpage(char *pag) +{ + register unsigned n; + register off; + register short *ino = (short *) pag; + + if ((n = ino[0]) > PBLKSIZ / sizeof(short)) + return 0; + + if (!n) + return 1; + + off = PBLKSIZ; + for (ino++; n; ino += 2) { + if (ino[0] > off || ino[1] > off || + ino[1] > ino[0]) + return 0; + off = ino[1]; + n -= 2; + } + + return 1; +} + + + +/***************************************************************************\ +** ** +** Function name: getopt() ** +** Author: Henry Spencer, UofT ** +** Coding date: 84/04/28 ** +** ** +** Description: ** +** ** +** Parses argv[] for arguments. ** +** Works with Whitesmith's C compiler. ** +** ** +** Inputs - The number of arguments ** +** - The base address of the array of arguments ** +** - A string listing the valid options (':' indicates an ** +** argument to the preceding option is required, a ';' ** +** indicates an argument to the preceding option is optional) ** +** ** +** Outputs - Returns the next option character, ** +** '?' for non '-' arguments ** +** or ':' when there is no more arguments. ** +** ** +** Side Effects + The argument to an option is pointed to by 'optarg' ** +** ** +***************************************************************************** +** ** +** REVISION HISTORY: ** +** ** +** DATE NAME DESCRIPTION ** +** YY/MM/DD ------------------ ------------------------------------ ** +** 88/10/20 Janick Bergeron Returns '?' on unamed arguments ** +** returns '!' on unknown options ** +** and 'EOF' only when exhausted. ** +** 88/11/18 Janick Bergeron Return ':' when no more arguments ** +** 89/08/11 Janick Bergeron Optional optarg when ';' in optstring ** +** ** +\***************************************************************************/ + +char *optarg; /* Global argument pointer. */ + +#ifdef VMS +#define index strchr +#endif + +#ifndef HAVE_GETOPT +char +getopt(argc, argv, optstring) +int argc; +char **argv; +char *optstring; +{ + register int c; + register char *place; + extern char *index(); + static int optind = 0; + static char *scan = NULL; + + optarg = NULL; + + if (scan == NULL || *scan == '\0') { + + if (optind == 0) + optind++; + if (optind >= argc) + return ':'; + + optarg = place = argv[optind++]; + if (place[0] != '-' || place[1] == '\0') + return '?'; + if (place[1] == '-' && place[2] == '\0') + return '?'; + scan = place + 1; + } + + c = *scan++; + place = index(optstring, c); + if (place == NULL || c == ':' || c == ';') { + + (void) fprintf(stderr, "%s: unknown option %c\n", argv[0], c); + scan = NULL; + return '!'; + } + if (*++place == ':') { + + if (*scan != '\0') { + + optarg = scan; + scan = NULL; + + } + else { + + if (optind >= argc) { + + (void) fprintf(stderr, "%s: %c requires an argument\n", + argv[0], c); + return '!'; + } + optarg = argv[optind]; + optind++; + } + } + else if (*place == ';') { + + if (*scan != '\0') { + + optarg = scan; + scan = NULL; + + } + else { + + if (optind >= argc || *argv[optind] == '-') + optarg = NULL; + else { + optarg = argv[optind]; + optind++; + } + } + } + return c; +} +#endif Index: library/store/XOTclSdbm/xotcl.m4 =================================================================== diff -u -N --- library/store/XOTclSdbm/xotcl.m4 (revision 0) +++ library/store/XOTclSdbm/xotcl.m4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,139 @@ +# xotcl.m4 -- +# +# This file provides a set of autoconf macros to help TEA-enable +# a Tcl extension. +# +# Copyright (c) 1999 Scriptics Corporation. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. + +#------------------------------------------------------------------------ +# SC_PATH_XOTCLCONFIG -- +# +# Locate the xotclConfig.sh file and perform a sanity check on +# the Tcl compile flags +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-xotcl=... +# +# Defines the following vars: +# XOTCL_BIN_DIR Full path to the directory containing +# the xotclConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN(SC_PATH_XOTCLCONFIG, [ + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + if test x"${no_xotcl}" = x ; then + # we reset no_xotcl in case something fails here + no_xotcl=true + AC_ARG_WITH(xotcl, [ --with-xotcl directory containing xotcl configuration (xotclConfig.sh)], with_xotclconfig=${withval}) + AC_MSG_CHECKING([for XOTcl configuration]) + AC_CACHE_VAL(ac_cv_c_xotclconfig,[ + + # First check to see if --with-xotcl was specified. + if test x"${with_xotclconfig}" != x ; then + if test -f "${with_xotclconfig}/xotclConfig.sh" ; then + ac_cv_c_xotclconfig=`(cd ${with_xotclconfig}; pwd)` + else + AC_MSG_ERROR([${with_xotclconfig} directory doesn't contain xotclConfig.sh]) + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_xotclconfig}" = x ; then + for i in \ + ${srcdir}/../xotcl \ + `ls -dr ${srcdir}/../xotcl-* 2>/dev/null` \ + ${srcdir}/../../xotcl \ + `ls -dr ${srcdir}/../../xotcl-* 2>/dev/null` \ + ${srcdir}/../../../xotcl \ + `ls -dr ${srcdir}/../../../xotcl-* 2>/dev/null` \ + ${srcdir}/../../../../xotcl \ + `ls -dr ${srcdir}/../../../../xotcl-* 2>/dev/null` \ + ${srcdir}/../../../../../xotcl \ + `ls -dr ${srcdir}/../../../../../xotcl-* 2>/dev/null` ; do + if test -f "$i/xotclConfig.sh" ; then + ac_cv_c_xotclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_xotclconfig}" = x ; then + for i in `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` ; do + if test -f "$i/xotclConfig.sh" ; then + ac_cv_c_xotclconfig=`(cd $i; pwd)` + break + fi + done + fi + + ]) + + if test x"${ac_cv_c_xotclconfig}" = x ; then + XOTCL_BIN_DIR="# no XOTcl configs found" + AC_MSG_WARN(Can't find XOTcl configuration definitions) + exit 0 + else + no_xotcl= + XOTCL_BIN_DIR=${ac_cv_c_xotclconfig} + AC_MSG_RESULT(found $XOTCL_BIN_DIR/xotclConfig.sh) + fi + fi +]) + +#------------------------------------------------------------------------ +# SC_LOAD_XOTCLCONFIG -- +# +# Load the tclConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# XOTCL_BIN_DIR +# +# Results: +# +# Subst the vars: +# +#------------------------------------------------------------------------ + +AC_DEFUN(SC_LOAD_XOTCLCONFIG, [ + AC_MSG_CHECKING([for existence of $XOTCL_BIN_DIR/xotclConfig.sh]) + + if test -f "$XOTCL_BIN_DIR/xotclConfig.sh" ; then + AC_MSG_RESULT([loading]) + . $XOTCL_BIN_DIR/xotclConfig.sh + else + AC_MSG_RESULT([file not found]) + fi + + # + # The eval is required to do the TCL_DBGX substitution in the + # TCL_LIB_FILE variable + # + AC_SUBST(XOTCL_VERSION) + AC_SUBST(XOTCL_MAJOR_VERSION) + AC_SUBST(XOTCL_MINOR_VERSION) + AC_SUBST(XOTCL_RELEASE_LEVEL) + AC_SUBST(XOTCL_LIB_FILE) + AC_SUBST(XOTCL_BUILD_LIB_SPEC) + AC_SUBST(XOTCL_LIB_SPEC) + AC_SUBST(XOTCL_STUB_LIB_FILE) + AC_SUBST(XOTCL_BUILD_STUB_LIB_SPEC) + AC_SUBST(XOTCL_STUB_LIB_SPEC) + AC_SUBST(XOTCL_SRC_DIR) +]) + Index: library/store/XOTclSdbm/xotclsdbm.c =================================================================== diff -u -N --- library/store/XOTclSdbm/xotclsdbm.c (revision 0) +++ library/store/XOTclSdbm/xotclsdbm.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,414 @@ +/* + * xotclsdbm.c + * + * based on Tclndbm 0.5 by John Ellson (ellson@lucent.com) + */ + +#include +#include +#include "sdbm.h" +#include +#include + +#if (TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<1) +# define TclObjStr(obj) Tcl_GetStringFromObj(obj, ((int*)NULL)) +#else +# define TclObjStr(obj) Tcl_GetString(obj) +#endif + +/* + * a database .. + */ + +typedef struct db_s { + int mode; + DBM *db; +} db_t ; + +static int +XOTclSdbmOpenMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + int mode; + db_t *db; + XOTcl_Object* obj = (XOTcl_Object *) cd; +/* + int i; + fprintf(stderr, "Method=XOTclSdbmOpenMethod\n"); + for (i=0; i< objc; i++) + fprintf(stderr, " objv[%d]=%s\n",i,TclObjStr(objv[i])); +*/ + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 2) + return XOTclObjErrArgCnt(in, obj->cmdName, "open filename"); + + /* + * check mode string if given + * + mode = O_RDONLY ; + if (argc == 3) { + + if (strcmp(argv[2],"r")==0) + mode = O_RDONLY ; + else if (strcmp(argv[2],"rw")==0) + mode = O_RDWR | O_SYNC ; + else if (strcmp(argv[2],"rwc")==0) + mode = O_CREAT | O_RDWR | O_SYNC ; + else if (strcmp(argv[2],"rwn")==0) + mode = O_CREAT | O_EXCL | O_RDWR | O_SYNC ; + else { + sprintf(buf, BAD_MODE, argv[0], argv[2]); + Tcl_AppendResult (interp,buf,(char *)0); + return (TCL_ERROR); + } + } + */ + /* Storage interface at the moment assumes mode=rwc */ +#ifdef O_SYNC + mode = O_CREAT | O_RDWR | O_SYNC; +#else + mode = O_CREAT | O_RDWR; +#endif + + /* name not in hashtab - create new db */ + if (XOTclGetObjClientData(obj)) + return XOTclVarErrMsg(in, "Called open on '", TclObjStr(obj->cmdName), + "', but open database was not closed before.", 0); + + db = (db_t*) ckalloc (sizeof(db_t)); + + /* + * create new name and malloc space for it + * malloc extra space for name + db->name = (char *) malloc (strlen(buf)+1) ; + if (!db->name) { + perror ("malloc for name in db_open"); + exit (-1); + } + strcpy(db->name,buf); + */ + + db->mode = mode; + db->db = sdbm_open(TclObjStr(objv[1]), mode, 0644); + + if (!db->db) { + /* + * error occurred + * free previously allocated memory + */ + /*ckfree ((char*) db->name);*/ + ckfree ((char*) db); + db = (db_t*) NULL ; + + return XOTclVarErrMsg(in, "Open on '", TclObjStr(obj->cmdName), + "' failed with '", TclObjStr(objv[1]),"'.", 0); + } else { + /* + * success + */ + XOTclSetObjClientData(obj, (ClientData) db); + return TCL_OK; + } +} + +static int +XOTclSdbmCloseMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + db_t *db; + XOTcl_Object* obj = (XOTcl_Object *) cd; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 1) + return XOTclObjErrArgCnt(in, obj->cmdName, "close"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called close on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + sdbm_close (db->db); + + /*ckfree((char*)db->name);*/ + ckfree ((char*)db); + XOTclSetObjClientData(obj, 0); + + return TCL_OK; +} + +static int +XOTclSdbmNamesMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + XOTcl_Object* obj = (XOTcl_Object *) cd; + Tcl_Obj *list; + db_t *db; + Tcl_DString result; + datum key; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 1) + return XOTclObjErrArgCnt(in, obj->cmdName, "names"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called names on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + Tcl_DStringInit(&result); + + key = sdbm_firstkey(db->db); + if (!key.dptr) { + /* empty db */ + return TCL_OK ; + } + + /* + * copy key to result and go to next key + */ + list = Tcl_NewListObj(0, NULL); + do { + Tcl_ListObjAppendElement(in,list,Tcl_NewStringObj(key.dptr,(int)(key.dsize-1))); + key = sdbm_nextkey(db->db); + } while (key.dptr); + Tcl_SetObjResult(in, list); + + return TCL_OK; +} + +static int +XOTclSdbmSetMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + XOTcl_Object* obj = (XOTcl_Object *) cd; + db_t *db; + datum key, content; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc <2 || objc > 3) + return XOTclObjErrArgCnt(in, obj->cmdName, "set key ?value?"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called set on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + + key.dptr = TclObjStr(objv[1]); + key.dsize = objv[1]->length + 1; + + if (objc == 2) { + /* get value */ + content = sdbm_fetch(db->db,key); + if (content.dptr) { + /* found */ + Tcl_Obj *r = Tcl_NewStringObj(content.dptr, (int)(content.dsize-1)); + Tcl_SetObjResult(in, r); + } else { + /* key not found */ + return XOTclVarErrMsg(in, "no such variable '", key.dptr, + "'", 0); + } + } else { + /* set value */ + if (db->mode == O_RDONLY) { + return XOTclVarErrMsg(in, "Trying to set '", TclObjStr(obj->cmdName), + "', but database is in read mode.", 0); + } + content.dptr = TclObjStr(objv[2]); + content.dsize = objv[2]->length + 1; + if (sdbm_store(db->db, key, content, SDBM_REPLACE) == 0) { + /*fprintf(stderr,"setting %s to '%s'\n",key.dptr,content.dptr);*/ + Tcl_SetObjResult(in, objv[2]); + } else { + return XOTclVarErrMsg(in, "set of variable '", TclObjStr(obj->cmdName), + "' failed.", 0); + } + } + return TCL_OK; +} + +static int +XOTclSdbmExistsMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + XOTcl_Object* obj = (XOTcl_Object *) cd; + db_t *db; + datum key, content; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 2) + return XOTclObjErrArgCnt(in, obj->cmdName, "exists variable"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called exists on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + + key.dptr = TclObjStr(objv[1]); + key.dsize = objv[1]->length + 1; + + content = sdbm_fetch(db->db,key); + Tcl_SetIntObj(Tcl_GetObjResult(in), content.dptr != NULL); + + return TCL_OK; +} + + + +static int +XOTclSdbmUnsetMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + XOTcl_Object* obj = (XOTcl_Object *) cd; + db_t *db; + datum key; + int ret; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 2) + return XOTclObjErrArgCnt(in, obj->cmdName, "unset key"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + /* check for read mode */ + if (db->mode == O_RDONLY) { + return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), + "', but database is in read mode.", 0); + } + + key.dptr = TclObjStr(objv[1]); + key.dsize = objv[1]->length + 1; + + ret = sdbm_delete(db->db, key); + + if (ret == 0) { + return TCL_OK; + } else { + return XOTclVarErrMsg(in, "Tried to unset '", TclObjStr(objv[1]), + "' but key does not exist.", 0); + } +} + +/* + * ndbm_firstkey + */ + +static int +XOTclSdbmFirstKeyMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + XOTcl_Object* obj = (XOTcl_Object *) cd; + db_t *db; + datum key; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 1) + return XOTclObjErrArgCnt(in, obj->cmdName, "firstkey"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + + + key = sdbm_firstkey(db->db); + if (!key.dptr) { + /* + * empty db + */ + return TCL_OK; + } + + Tcl_AppendResult (in, key.dptr, (char*)0); + return TCL_OK; +} + +static int +XOTclSdbmNextKeyMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { + XOTcl_Object* obj = (XOTcl_Object *) cd; + db_t *db; + datum newkey; + + if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); + if (objc != 1) + return XOTclObjErrArgCnt(in, obj->cmdName, "nextkey"); + + db = (db_t*) XOTclGetObjClientData(obj); + if (!db) + return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), + "', but database was not opened yet.", 0); + + newkey = sdbm_nextkey(db->db); + + if (!newkey.dptr) { + /* + * empty db + */ + return TCL_OK ; + } + + Tcl_AppendResult (in, newkey.dptr, (char*)0); + return TCL_OK ; +} + +/* + * Xotclsdbm_Init + * register commands, init data structures + */ + +/* this should be done via the stubs ... for the time being + simply export */ +#ifdef VISUAL_CC +DLLEXPORT extern int Xotclsdbm_Init(Tcl_Interp * in); +#endif + +extern int +Xotclsdbm_Init(Tcl_Interp * in) { + XOTcl_Class* cl; + int result; + +#ifdef USE_TCL_STUBS + if (Tcl_InitStubs(in, "8.1", 0) == NULL) { + return TCL_ERROR; + } +# ifdef USE_XOTCL_STUBS + if (Xotcl_InitStubs(in, "1.1", 0) == NULL) { + return TCL_ERROR; + } +# endif +#else + if (Tcl_PkgRequire(in, "Tcl", TCL_VERSION, 0) == NULL) { + return TCL_ERROR; + } +#endif + Tcl_PkgProvide(in, "xotcl::store::sdbm", PACKAGE_VERSION); + +#ifdef PACKAGE_REQUIRE_XOTCL_FROM_SLAVE_INTERP_WORKS_NOW + if (Tcl_PkgRequire(in, "XOTcl", XOTCLVERSION, 0) == NULL) { + return TCL_ERROR; + } +#endif + if (Tcl_PkgRequire(in, "xotcl::store", 0, 0) == NULL) { + return TCL_ERROR; + } + result = Tcl_VarEval (in, "::xotcl::Class create Storage=Sdbm -superclass Storage", + (char *) NULL); + if (result != TCL_OK) + return result; + /*{ + Tcl_Obj *res = Tcl_GetObjResult(in); + fprintf(stderr,"res='%s'\n", TclObjStr(res)); + cl = XOTclGetClass(in, "Storage=Sdbm"); + fprintf(stderr,"cl=%p\n",cl); + }*/ + + cl = XOTclGetClass(in, "Storage=Sdbm"); + if (!cl) { + return TCL_ERROR; + } + + XOTclAddIMethod(in, cl, "open", XOTclSdbmOpenMethod, 0, 0); + XOTclAddIMethod(in, cl, "close", XOTclSdbmCloseMethod, 0, 0); + XOTclAddIMethod(in, cl, "set", XOTclSdbmSetMethod, 0, 0); + XOTclAddIMethod(in, cl, "exists", XOTclSdbmExistsMethod, 0, 0); + XOTclAddIMethod(in, cl, "names", XOTclSdbmNamesMethod, 0, 0); + XOTclAddIMethod(in, cl, "unset", XOTclSdbmUnsetMethod, 0, 0); + XOTclAddIMethod(in, cl, "firstkey", XOTclSdbmFirstKeyMethod, 0, 0); + XOTclAddIMethod(in, cl, "nextkey", XOTclSdbmNextKeyMethod, 0, 0); + + Tcl_SetIntObj(Tcl_GetObjResult(in), 1); + return TCL_OK; +} + +extern int +Xotclsdbm_SafeInit(interp) + Tcl_Interp *interp; +{ + return Xotclsdbm_Init(interp); +} Index: library/store/persistenceExample.xotcl =================================================================== diff -u -N --- library/store/persistenceExample.xotcl (revision 0) +++ library/store/persistenceExample.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,63 @@ +#!../../src/xotclsh +# $Id: persistenceExample.xotcl,v 1.2 2006/02/18 22:17:33 neumann Exp $ +# +# load the persistence component +package require xotcl::store::persistence + +# Two example objects +Object o +# set two variables to default values +o set x 1 +o set y 1 + +Object p +# set two variables to default values +p set x 1 +p set y 1 + +#################################### +# now we make these vars persistent +#################################### + + +# 1. we need the PersistenceMgr (for gdbm we have to specify a file +# name). If we want to get rid of the current setting and start again +# we default values, we have to delete this file +PersistenceMgr pmgr -dirName . -fileName example-db + +# 2. we have to make the objects persistent. We register the +# persistence strategy as per-object mixin on the two objects +# +# one uses the lazy, one the eager strategy + +o mixin Persistent=Eager +p mixin Persistent=Lazy + +# 3. tell the objects, which PersistenceMgr to use + +o persistenceMgr pmgr +p persistenceMgr pmgr + +# 4. make the vars persistent + +o persistent {x y} +p persistent {x y} + +##################################### + +# now the vars are loaded from the persistence store +# +# we incr them to demonstrate the persistency; and print the results + +o incr x 2 +o append y 1 +p incr x 3 +p append y 2 + +puts "Values:" +puts " o->x: [o set x]" +puts " o->y: [o set y]" +puts " p->x: [p set x]" +puts " p->y: [p set y]" + +# now run the program several times to see the results \ No newline at end of file Index: library/store/pkgIndex-subdir.add =================================================================== diff -u -N --- library/store/pkgIndex-subdir.add (revision 0) +++ library/store/pkgIndex-subdir.add (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,10 @@ +set __store_dir__ $dir +foreach index [glob -nocomplain [file join $dir * pkgIndex.tcl]] { + set dir [file dirname $index] + #puts subdir=$dir,index=$index + source $index +} +set dir $__store_dir__ +unset __store_dir__ + + Index: library/store/pkgIndex.tcl =================================================================== diff -u -N --- library/store/pkgIndex.tcl (revision 0) +++ library/store/pkgIndex.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,27 @@ +# Tcl package index file, version 1.1 +# This file is generated by the "pkg_mkIndex -direct" command +# and sourced either when an application starts up or +# by a "package unknown" script. It invokes the +# "package ifneeded" command to set up package-related +# information so that packages will be loaded automatically +# in response to "package require" commands. When this +# script is sourced, the variable $dir must contain the +# full path name of this file's directory. + +package ifneeded xotcl::store 0.84 [list source [file join $dir Storage.xotcl]] +package ifneeded xotcl::store::jufgdbm 0.81 [list source [file join $dir JufGdbmStorage.xotcl]] +package ifneeded xotcl::store::mem 0.84 [list source [file join $dir MemStorage.xotcl]] +package ifneeded xotcl::store::multi 0.9 [list source [file join $dir MultiStorage.xotcl]] +package ifneeded xotcl::store::persistence 0.8 [list source [file join $dir Persistence.xotcl]] +package ifneeded xotcl::store::tclgdbm 0.84 [list source [file join $dir TclGdbmStorage.xotcl]] +package ifneeded xotcl::store::textfile 0.84 [list source [file join $dir TextFileStorage.xotcl]] +set __store_dir__ $dir +foreach index [glob -nocomplain [file join $dir * pkgIndex.tcl]] { + set dir [file dirname $index] + #puts subdir=$dir,index=$index + source $index +} +set dir $__store_dir__ +unset __store_dir__ + + Index: library/xml/COPYRIGHT =================================================================== diff -u -N --- library/xml/COPYRIGHT (revision 0) +++ library/xml/COPYRIGHT (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,41 @@ + * XOTcl - Extended OTcl + * + * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) + * + * (a) Vienna University of Economics and Business Administration + * Dept. of Information Systems / New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * (b) University of Essen + * Specification of Software Systems + * Altendorferstra�e 97-101 + * D-45143 Essen, Germany + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * + * This software is based upon MIT Object Tcl by David Wetherall and + * Christopher J. Lindblad, that contains the following copyright + * message: + * + * "Copyright 1993 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this + * permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity + * pertaining to distribution of the software without specific, + * written prior permission. M.I.T. makes no representations about + * the suitability of this software for any purpose. It is + * provided "as is" without express or implied warranty." + Index: library/xml/TclExpat-1.1/Makefile =================================================================== diff -u -N --- library/xml/TclExpat-1.1/Makefile (revision 0) +++ library/xml/TclExpat-1.1/Makefile (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,433 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# Copyright (c) 2002-2003 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,v 1.30 2007/09/13 15:21:54 neumann 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. +#======================================================================== + +#======================================================================== +# The names of the source files is defined in the configure script. +# The object files are used for linking into the final library. +# 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 = xmltok.c unixfilemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c +PKG_OBJECTS = xmltok.o unixfilemap.o xmlrole.o xmlwf.o codepage.o xmlparse.o hashtable.o tclexpat.o + +PKG_STUB_SOURCES = +PKG_STUB_OBJECTS = + +#======================================================================== +# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with +# this package that need to be installed, if any. +#======================================================================== + +PKG_TCL_SOURCES = + +#======================================================================== +# This is a list of public header files to be installed, if any. +#======================================================================== + +PKG_HEADERS = + +#======================================================================== +# "PKG_LIB_FILE" refers to the library (dynamic or static as per +# configuration options) composed of the named objects. +#======================================================================== + +PKG_LIB_FILE = libxotclexpat0.9.dylib +PKG_STUB_LIB_FILE = libxotclexpatstub0.9.a + +lib_BINARIES = $(PKG_LIB_FILE) +BINARIES = $(lib_BINARIES) + +SHELL = /bin/sh + +srcdir = . +prefix = /usr/local/aolserver-4.5 +exec_prefix = /usr/local/aolserver-4.5 + +bindir = ${exec_prefix}/bin +libdir = ${exec_prefix}/lib +datadir = ${prefix}/share +mandir = ${prefix}/man +includedir = ${prefix}/include + +DESTDIR = + +PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) +pkgdatadir = $(datadir)/$(PKG_DIR) +pkglibdir = $(libdir)/$(PKG_DIR) +pkgincludedir = $(includedir)/$(PKG_DIR) + +top_builddir = . + +INSTALL = /usr/bin/install -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} + +PACKAGE_NAME = xotclexpat +PACKAGE_VERSION = 0.9 +CC = gcc +CFLAGS_DEFAULT = -Os +CFLAGS_WARNING = -Wall -Wno-implicit-int +CLEANFILES = pkgIndex.tcl +EXEEXT = +LDFLAGS_DEFAULT = -prebind -headerpad_max_install_names -Wl,-search_paths_first +MAKE_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} +MAKE_SHARED_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} +MAKE_STATIC_LIB = ${STLIB_LD} $@ $(PKG_OBJECTS) +MAKE_STUB_LIB = ${STLIB_LD} $@ $(PKG_STUB_OBJECTS) +OBJEXT = o +RANLIB = : +RANLIB_STUB = ranlib +SHLIB_CFLAGS = -fno-common +SHLIB_LD = ${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT} -Wl,-single_module +SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@ +SHLIB_LD_LIBS = ${LIBS} -L/usr/local/aolserver-4.5/lib -ltclstub8.4 +STLIB_LD = ${AR} cr +TCL_DEFS = -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DHAVE_COREFOUNDATION=1 -DMAC_OSX_TCL=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_MTSAFE_GETHOSTBYNAME=1 -DHAVE_MTSAFE_GETHOSTBYADDR=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_COPYFILE=1 -DHAVE_LIBKERN_OSATOMIC_H=1 -DHAVE_OSSPINLOCKLOCK=1 -DHAVE_PTHREAD_ATFORK=1 -DUSE_VFORK=1 -DTCL_DEFAULT_ENCODING=\"utf-8\" -DTCL_LOAD_FROM_MEMORY=1 -DHAVE_AVAILABILITYMACROS_H=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 +TCL_BIN_DIR = /usr/local/aolserver-4.5/lib +TCL_SRC_DIR = /usr/local/src/tcl8.4.14 +# This is necessary for packages that use private Tcl headers +#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ +# Not used, but retained for reference of what libs Tcl required +TCL_LIBS = ${DL_LIBS} ${LIBS} ${MATH_LIBS} + +#======================================================================== +# 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). +#======================================================================== + +EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) +TCLSH_ENV = TCL_LIBRARY=`echo $(TCL_SRC_DIR)/library` \ + DYLD_LIBRARY_PATH="$(EXTRA_PATH):$(DYLD_LIBRARY_PATH)" \ + PATH="$(EXTRA_PATH):$(PATH)" \ + TCLLIBPATH="$(top_builddir)" +TCLSH_PROG = /usr/local/aolserver-4.5/bin/tclsh8.4 +TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) +SHARED_BUILD = 1 + +INCLUDES = -I/Users/neumann/src/xotcl-1.5.5/generic -I./generic -I"/usr/local/aolserver-4.5/include" + +EXTRA_CFLAGS = + +# TCL_DEFS is not strictly need here, but if you remove it, then you +# must make sure that configure.in 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) -DPACKAGE_NAME=\"xotclexpat\" -DPACKAGE_TARNAME=\"xotclexpat\" -DPACKAGE_VERSION=\"0.9\" -DPACKAGE_STRING=\"xotclexpat\ 0.9\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 $(EXTRA_CFLAGS) +DEFS = -DPACKAGE_NAME=\"xotclexpat\" -DPACKAGE_TARNAME=\"xotclexpat\" -DPACKAGE_VERSION=\"0.9\" -DPACKAGE_STRING=\"xotclexpat\ 0.9\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 $(EXTRA_CFLAGS) + +CONFIG_CLEAN_FILES = Makefile + +CPPFLAGS = +LIBS = -L/Users/neumann/src/xotcl-1.5.5 -lxotclstub1.5.5 +AR = ar +CFLAGS = -pipe ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: $(BINARIES) pkgIndex.tcl + +libraries: + +doc: + @echo "If you have documentation to create, place the commands to" + @echo "build the docs in the 'doc:' target. For example:" + @echo " xml2nroff sample.xml > sample.n" + @echo " xml2html sample.xml > sample.html" + +install: all install-binaries install-libraries install-doc + +install-binaries: binaries install-lib-binaries install-bin-binaries + if test "x$(SHARED_BUILD)" = "x1"; then \ + $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ + fi + +#======================================================================== +# This rule installs platform-independent files, such as header files. +#======================================================================== + +install-libraries: libraries + @mkdir -p $(DESTDIR)$(includedir) + @echo "Installing header files in $(DESTDIR)$(includedir)" + @if test -n "$(PKG_HEADERS)" ; then \ + for i in "$(PKG_HEADERS)" ; do \ + echo "Installing $(srcdir)/$$i" ; \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ + done; \ + fi + +#======================================================================== +# Install documentation. Unix manpages should go in the $(mandir) +# directory. +#======================================================================== + +install-doc: doc +#install-doc: doc +# @mkdir -p $(DESTDIR)$(mandir)/mann +# @echo "Installing documentation in $(DESTDIR)$(mandir)" +# @for i in $(srcdir)/doc/*.n; do \ +# echo "Installing $$i"; \ +# rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ +# $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ +# done + +test: binaries libraries + $(TCLSH) `echo $(srcdir)/tests/all.tcl` $(TESTFLAGS) + +shell: binaries libraries + @$(TCLSH) $(SCRIPT) + +gdb: + $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) + +depend: + +#======================================================================== +# $(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". +# +# 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. +#======================================================================== + +$(PKG_LIB_FILE): $(PKG_OBJECTS) + -rm -f $(PKG_LIB_FILE) + ${MAKE_LIB} + $(RANLIB) $(PKG_LIB_FILE) + +$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) + -rm -f $(PKG_STUB_LIB_FILE) + ${MAKE_STUB_LIB} + $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# +# 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 `echo $(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:.... +#======================================================================== + +VPATH = $(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win + +.c.o: + $(COMPILE) -c `echo $<` -o $@ + +#======================================================================== +# Create the pkgIndex.tcl file. +# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but +# you may find that you need to customize the package. If so, either +# modify the -hand version, or create a pkgIndex.tcl.in file and have +# the configure script output the pkgIndex.tcl by editing configure.in. +#======================================================================== + +pkgIndex.tcl: + ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) + +pkgIndex.tcl-hand: + (echo 'package ifneeded xotcl::xml::expat $(PACKAGE_VERSION) \ + [list load [file join $$dir $(PKG_LIB_FILE)]]'\ + ) > pkgIndex.tcl + +#======================================================================== +# Distribution creation +# You may need to tweak this target to make it work correctly. +#======================================================================== + +#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar +COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) +DIST_ROOT = /tmp/dist +DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) + +dist-clean: + rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* + +dist: dist-clean + mkdir -p $(DIST_DIR) + cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ + $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ + $(DIST_DIR)/ + chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 + chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in + + cp -p $(srcdir)/*.[ch] $(DIST_DIR)/ + + mkdir $(DIST_DIR)/tclconfig + cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ + $(DIST_DIR)/tclconfig/ + chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 + chmod +x $(DIST_DIR)/tclconfig/install-sh + + list='demos doc generic library mac tests unix win'; \ + for p in $$list; do \ + if test -d $(srcdir)/$$p ; then \ + mkdir $(DIST_DIR)/$$p; \ + cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ + fi; \ + done + + (cd $(DIST_ROOT); $(COMPRESS);) + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + -test -z "$(BINARIES)" || rm -f $(BINARIES) + -rm -f *.$(OBJEXT) core *.core + -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 + +#======================================================================== +# 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) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: + @mkdir -p $(DESTDIR)$(pkglibdir) + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ + stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ + if test "x$$stub" = "xstub"; then \ + echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ + else \ + echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ + fi; \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + 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; \ + fi; \ + fi; \ + 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; \ + done + +#======================================================================== +# 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. +# +# You should not have to modify this target, except to define bin_BINARIES +# above if necessary. +#======================================================================== + +install-bin-binaries: + @mkdir -p $(DESTDIR)$(bindir) + @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; \ + done + +.SUFFIXES: .c .$(OBJEXT) + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +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; \ + done + +.PHONY: all binaries clean depend distclean doc install libraries test + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: library/xml/TclExpat-1.1/Makefile.in =================================================================== diff -u -N --- library/xml/TclExpat-1.1/Makefile.in (revision 0) +++ library/xml/TclExpat-1.1/Makefile.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,433 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# Copyright (c) 2002-2003 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.5 2007/08/14 16:38:27 neumann 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. +#======================================================================== + +#======================================================================== +# The names of the source files is defined in the configure script. +# The object files are used for linking into the final library. +# 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@ + +PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ +PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ + +#======================================================================== +# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with +# this package that need to be installed, if any. +#======================================================================== + +PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ + +#======================================================================== +# This is a list of public header files to be installed, if any. +#======================================================================== + +PKG_HEADERS = @PKG_HEADERS@ + +#======================================================================== +# "PKG_LIB_FILE" refers to the library (dynamic or static as per +# configuration options) composed of the named objects. +#======================================================================== + +PKG_LIB_FILE = @PKG_LIB_FILE@ +PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ + +lib_BINARIES = $(PKG_LIB_FILE) +BINARIES = $(lib_BINARIES) + +SHELL = @SHELL@ + +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +libdir = @libdir@ +datadir = @datadir@ +mandir = @mandir@ +includedir = @includedir@ + +DESTDIR = + +PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) +pkgdatadir = $(datadir)/$(PKG_DIR) +pkglibdir = $(libdir)/$(PKG_DIR) +pkgincludedir = $(includedir)/$(PKG_DIR) + +top_builddir = . + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ + +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +CC = @CC@ +CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ +CFLAGS_WARNING = @CFLAGS_WARNING@ +CLEANFILES = @CLEANFILES@ +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_FLAGS = @SHLIB_LD_FLAGS@ +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@ +# This is necessary for packages that use private Tcl headers +#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ +# Not used, but retained for reference of what libs Tcl required +TCL_LIBS = @TCL_LIBS@ + +#======================================================================== +# 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). +#======================================================================== + +EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) +TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ + @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ + PATH="$(EXTRA_PATH):$(PATH)" \ + TCLLIBPATH="$(top_builddir)" +TCLSH_PROG = @TCLSH_PROG@ +TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) +SHARED_BUILD = @SHARED_BUILD@ + +INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ + +EXTRA_CFLAGS = @PKG_CFLAGS@ + +# TCL_DEFS is not strictly need here, but if you remove it, then you +# must make sure that configure.in 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@ $(EXTRA_CFLAGS) +DEFS = @DEFS@ $(EXTRA_CFLAGS) + +CONFIG_CLEAN_FILES = Makefile + +CPPFLAGS = @CPPFLAGS@ +LIBS = @PKG_LIBS@ @LIBS@ +AR = ar +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: $(BINARIES) pkgIndex.tcl + +libraries: + +doc: + @echo "If you have documentation to create, place the commands to" + @echo "build the docs in the 'doc:' target. For example:" + @echo " xml2nroff sample.xml > sample.n" + @echo " xml2html sample.xml > sample.html" + +install: all install-binaries install-libraries install-doc + +install-binaries: binaries install-lib-binaries install-bin-binaries + if test "x$(SHARED_BUILD)" = "x1"; then \ + $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ + fi + +#======================================================================== +# This rule installs platform-independent files, such as header files. +#======================================================================== + +install-libraries: libraries + @mkdir -p $(DESTDIR)$(includedir) + @echo "Installing header files in $(DESTDIR)$(includedir)" + @if test -n "$(PKG_HEADERS)" ; then \ + for i in "$(PKG_HEADERS)" ; do \ + echo "Installing $(srcdir)/$$i" ; \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ + done; \ + fi + +#======================================================================== +# Install documentation. Unix manpages should go in the $(mandir) +# directory. +#======================================================================== + +install-doc: doc +#install-doc: doc +# @mkdir -p $(DESTDIR)$(mandir)/mann +# @echo "Installing documentation in $(DESTDIR)$(mandir)" +# @for i in $(srcdir)/doc/*.n; do \ +# echo "Installing $$i"; \ +# rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ +# $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ +# done + +test: binaries libraries + $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) + +shell: binaries libraries + @$(TCLSH) $(SCRIPT) + +gdb: + $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) + +depend: + +#======================================================================== +# $(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". +# +# 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. +#======================================================================== + +$(PKG_LIB_FILE): $(PKG_OBJECTS) + -rm -f $(PKG_LIB_FILE) + ${MAKE_LIB} + $(RANLIB) $(PKG_LIB_FILE) + +$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) + -rm -f $(PKG_STUB_LIB_FILE) + ${MAKE_STUB_LIB} + $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# +# 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:.... +#======================================================================== + +VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win + +.c.@OBJEXT@: + $(COMPILE) -c `@CYGPATH@ $<` -o $@ + +#======================================================================== +# Create the pkgIndex.tcl file. +# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but +# you may find that you need to customize the package. If so, either +# modify the -hand version, or create a pkgIndex.tcl.in file and have +# the configure script output the pkgIndex.tcl by editing configure.in. +#======================================================================== + +pkgIndex.tcl: + ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) + +pkgIndex.tcl-hand: + (echo 'package ifneeded xotcl::xml::expat $(PACKAGE_VERSION) \ + [list load [file join $$dir $(PKG_LIB_FILE)]]'\ + ) > pkgIndex.tcl + +#======================================================================== +# Distribution creation +# You may need to tweak this target to make it work correctly. +#======================================================================== + +#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar +COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) +DIST_ROOT = /tmp/dist +DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) + +dist-clean: + rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* + +dist: dist-clean + mkdir -p $(DIST_DIR) + cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ + $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ + $(DIST_DIR)/ + chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 + chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in + + cp -p $(srcdir)/*.[ch] $(DIST_DIR)/ + + mkdir $(DIST_DIR)/tclconfig + cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ + $(DIST_DIR)/tclconfig/ + chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 + chmod +x $(DIST_DIR)/tclconfig/install-sh + + list='demos doc generic library mac tests unix win'; \ + for p in $$list; do \ + if test -d $(srcdir)/$$p ; then \ + mkdir $(DIST_DIR)/$$p; \ + cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ + fi; \ + done + + (cd $(DIST_ROOT); $(COMPRESS);) + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + -test -z "$(BINARIES)" || rm -f $(BINARIES) + -rm -f *.$(OBJEXT) core *.core + -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 + +#======================================================================== +# 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) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: + @mkdir -p $(DESTDIR)$(pkglibdir) + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ + stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ + if test "x$$stub" = "xstub"; then \ + echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ + else \ + echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ + fi; \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + 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; \ + fi; \ + fi; \ + 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; \ + done + +#======================================================================== +# 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. +# +# You should not have to modify this target, except to define bin_BINARIES +# above if necessary. +#======================================================================== + +install-bin-binaries: + @mkdir -p $(DESTDIR)$(bindir) + @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; \ + done + +.SUFFIXES: .c .$(OBJEXT) + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +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; \ + done + +.PHONY: all binaries clean depend distclean doc install libraries test + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: library/xml/TclExpat-1.1/Makefile.in-ok =================================================================== diff -u -N --- library/xml/TclExpat-1.1/Makefile.in-ok (revision 0) +++ library/xml/TclExpat-1.1/Makefile.in-ok (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,390 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# RCS: @(#) $Id: Makefile.in-ok,v 1.1 2004/05/23 22:50:39 neumann Exp $ + +#======================================================================== +# Edit the following few lines when writing a new extension +#======================================================================== + +configdir=$(srcdir)/../../../config + +#======================================================================== +# 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= +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. +#======================================================================== + +#xotclexpat_SOURCES = +#SOURCES = $(xotclexpat_SOURCES) + +#======================================================================== +# Enumerate the names of the object files included in this package. +# These objects are created and linked into the final library. In +# most cases these object files will correspond to the source files +# above. +# +#======================================================================== + +FILEMAP_OBJ=unixfilemap.$(OBJEXT) +#FILEMAP_OBJ=readfilemap.$(OBJEXT) + +xotclexpat_OBJECTS = xmltok.$(OBJEXT) \ + xmlrole.$(OBJEXT) \ + xmlwf.$(OBJEXT) \ + codepage.$(OBJEXT) \ + xmlparse.$(OBJEXT) \ + hashtable.$(OBJEXT) \ + $(FILEMAP_OBJ) \ + tclexpat.$(OBJEXT) +OBJECTS = $(xotclexpat_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. +#======================================================================== + +xotclexpat_LIB_FILE = @xotclexpat_LIB_FILE@ +$(xotclexpat_LIB_FILE)_OBJECTS = $(xotclexpat_OBJECTS) + +#======================================================================== +# This is a list of header files to be installed +#======================================================================== + +GENERIC_HDRS= + +#======================================================================== +# Add additional lines to handle any additional AC_SUBST cases that +# have been added to the configure script. +#======================================================================== + +SAMPLE_NEW_VAR=@SAMPLE_NEW_VAR@ + +#======================================================================== +# Nothing of the variables below this line need to be changed. Please +# check the TARGETS section below to make sure the make targets are +# correct. +#======================================================================== + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_FLAG = +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +CC = @CC@ +CFLAGS_DEBUG = @CFLAGS_DEBUG@ +CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ +CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ +CLEANFILES = @CLEANFILES@ +EXEEXT = @EXEEXT@ +LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ +LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ +LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ +MAKE_LIB = @MAKE_LIB@ +MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ +MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ +OBJEXT = @OBJEXT@ +RANLIB = @RANLIB@ +SHLIB_CFLAGS = @SHLIB_CFLAGS@ +SHLIB_LD = @SHLIB_LD@ +SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ +SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ +STLIB_LD = @STLIB_LD@ +TCL_BIN_DIR = @TCL_BIN_DIR@ +TCL_DEFS = @TCL_DEFS@ +TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ +TCL_LD_FLAGS = @TCL_LD_FLAGS@ +TCL_LIBS = @TCL_LIBS@ +TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ +TCL_SRC_DIR = @TCL_SRC_DIR@ +TCL_DBGX = @TCL_DBGX@ +TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ +TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ +TCL_TOOL_DIR_NATIVE = @TCL_TOOL_DIR_NATIVE@ +TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ +TCL_UNIX_DIR_NATIVE = @TCL_UNIX_DIR_NATIVE@ +TCL_WIN_DIR_NATIVE = @TCL_WIN_DIR_NATIVE@ +INCLUDE_DIR_NATIVE = @INCLUDE_DIR_NATIVE@ +TCL_BMAP_DIR_NATIVE = @TCL_BMAP_DIR_NATIVE@ +TCL_PLATFORM_DIR_NATIVE = @TCL_PLATFORM_DIR_NATIVE@ +TCL_GENERIC_DIR_NATIVE = @TCL_GENERIC_DIR_NATIVE@ +TCLSH_PROG = @TCLSH_PROG@ + +AUTOCONF = autoconf + +LDFLAGS = $(LDFLAGS_DEFAULT) + +INCLUDES = @TCL_INCLUDES@ + +EXTRA_CFLAGS = $(TCL_DEFS) $(PROTO_FLAGS) $(SECURITY_FLAGS) $(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) $(NO_DEPRECATED_FLAGS) + +DEFS = @DEFS@ $(EXTRA_CFLAGS) + +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(configdir)/mkinstalldirs +CONFIG_CLEAN_FILES = $(configdir)/mkIndex.tcl + +CPPFLAGS = @CPPFLAGS@ +LIBS = @LIBS@ +AR = ar +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -I. -I@XOTCL_SRC_DIR@/generic + +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: + +libraries: $(srcdir)/../$(xotclexpat_LIB_FILE) + +doc: + +install: install-binaries install-libraries install-doc + +install-binaries: binaries install-lib-binaries install-bin-binaries + +#======================================================================== +# This rule installs platform-independent files, such as header files. +#======================================================================== + +install-libraries: libraries $(DESTDIR)$(includedir) + @if test ! -z $(GENERIC_HDRS) ; then \ + echo "Installing header files in $(DESTDIR)$(includedir)" ; \ + fi + @for i in $(GENERIC_HDRS) ; do \ + echo "Installing $$i" ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(includedir) ; \ + done; + +#======================================================================== +# Install documentation. Unix manpages should go in the $(mandir) +# directory. +#======================================================================== + +install-doc: + +test: + +depend: + +#======================================================================== +# Enumerate the names of the object files included in this package. +# These objects are created and linked into the final library. In +# most cases these object files will correspond to the source files +# above. +# +# $(exampleA_LIB_FILE) should be listed as part of the BINARIES variable +# at the top of the Makefile. That will ensure that this target is built +# when you run "make binaries". +# +# You shouldn't need to modify this target, except to change the package +# name from "exampleA" to your package's name. +#======================================================================== + +$(xotclexpat_LIB_FILE): $(xotclexpat_OBJECTS) + rm -f $@ + @MAKE_LIB@ + $(RANLIB) $@ + +$(srcdir)/../$(xotclexpat_LIB_FILE): $(xotclexpat_LIB_FILE) + cp $< $@ +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# Unfortunately, there does not seem to be any other way to do this +# in a Makefile-independent way. We can't use VPATH because it picks up +# object files that may be located in the source directory. +# +# In the following lines, $(srcdir) refers to the toplevel directory +# containing your extension. If your sources are in a subdirectory, +# you will have to modify the paths to reflect this: +# +# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c +# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@ +#======================================================================== + +%.o: $(srcdir)/%.c + $(COMPILE) -c `@CYGPATH@ $<` -o $@ + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + @rm -f $(xotclexpat_LIB_FILE) $(srcdir)/../$(xotclexpat_LIB_FILE) \ + *.o core *.core *.$(OBJEXT) $(CLEANFILES) expat/*/*.o expat/*/*.so \ + core so_locations gmon.out *~ \#* config.log + +distclean: clean + -rm -f *.tab.c + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -rm -f config.status + +#======================================================================== +# Install binary object libraries. On Windows this includes both .dll and +# .lib files. Because the .lib files are not explicitly listed anywhere, +# we need to deduce their existence from the .dll file of the same name. +# Additionally, the .dll files go into the bin directory, but the .lib +# files go into the lib directory. On Unix platforms, all library files +# go into the lib directory. In addition, this will generate the pkgIndex.tcl +# file in the install location (assuming it can find a usable tclsh8.2 shell) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + echo " $(INSTALL_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)$(libdir)/$$lib"; \ + $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \ + fi; \ + else \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \ + fi; \ + else :; fi; \ + done + @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 +# $(TCLSH_PROG) $(configdir)/mkIndex.tcl + +#======================================================================== +# Install binary executables (e.g. .exe files) +# +# You should not have to modify this target. +#======================================================================== + +install-bin-binaries: $(DESTDIR)$(bindir) + @list='$(BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \ + else :; fi; \ + done + +.SUFFIXES: .c .o .obj + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + + +uninstall-binaries: + @$(NORMAL_UNINSTALL) + list='$(BINARIES)'; for p in $$list; do \ + rm -f $(DESTDIR)$(libdir)/$$p; \ + done + +$(DESTDIR)$(includedir): + $(mkinstalldirs) $@ +$(DESTDIR)$(libdir): + $(mkinstalldirs) $@ +$(DESTDIR)$(bindir): + $(mkinstalldirs) $@ + +.PHONY: all binaries clean depend distclean doc install libraries test + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Index: library/xml/TclExpat-1.1/Makefile.vc =================================================================== diff -u -N --- library/xml/TclExpat-1.1/Makefile.vc (revision 0) +++ library/xml/TclExpat-1.1/Makefile.vc (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,239 @@ +###################################################################### +# +# XOTclExpat Makefile for Visual C++ +# +###################################################################### + +# Be sure to adapt the "configs.vc" file in the toplevel directory +# to your system settings. +!include "..\..\..\win\configs.vc" + +BINROOT = . +ROOT = .. +NAMEPREFIX = lib +NAME = xotclexpat +XOTCL_DIR = ..\..\.. +GENERICDIR = . +WINDIR = . + +###################################################################### + +!if $(DEBUG) +TMPNAME = Debug +DBGX = d +!else +TMPNAME = Release +DBGX = +!endif + +TMP_DIR = $(BINROOT)\$(TMPNAME) +OUT_DIR = $(TMP_DIR) + +!if $(STATIC_BUILD) +OUTNAME = $(NAMEPREFIX)$(NAME)$(XOTCL_VERSION)$(DBGX) +TARGET = "$(OUT_DIR)\$(OUTNAME).lib" +!else +OUTNAME = $(NAMEPREFIX)$(NAME)$(XOTCL_VERSION)$(DBGX) +IMPLIB = "$(OUT_DIR)\$(OUTNAME).lib" +TARGET = "$(OUT_DIR)\$(OUTNAME).dll" +!endif + +TCLSTUBLIB = "$(TCLROOT)\win\Release\tclstub$(TCL_VERSION).lib" +TCLIMPLIB = "$(TCLROOT)\win\$(OUT_DIR)\tcl$(TCL_VERSION)$(DBGX).lib" +TCLSH = "$(TCLROOT)\win\$(OUT_DIR)\tclsh$(TCL_VERSION)$(DBGX).exe" + +XOTCLSTUBLIB = "$(XOTCL_DIR)\win\Release\libxotclstub$(XOTCL_VERSION).lib" +XOTCLIMPLIB = "$(XOTCL_DIR)\win\$(OUT_DIR)\libxotcl$(XOTCL_VERSION)$(DBGX).lib" + +LIB_INSTALL_DIR = $(INSTALLDIR)\lib +BIN_INSTALL_DIR = $(INSTALLDIR)\bin +SCRIPT_INSTALL_DIR = $(INSTALLDIR)\lib\xotcl$(XOTCL_VERSION) +INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include + +OBJS = $(TMP_DIR)\xmltok.obj \ + $(TMP_DIR)\xmlrole.obj \ + $(TMP_DIR)\xmlwf.obj \ + $(TMP_DIR)\codepage.obj \ + $(TMP_DIR)\xmlparse.obj \ + $(TMP_DIR)\hashtable.obj \ + $(TMP_DIR)\win32filemap.obj \ + $(TMP_DIR)\tclexpat.obj \ +!if $(STATIC_BUILD) == 0 + $(TMP_DIR)\dllEntryPoint.obj +!endif + +###################################################################### +# Link flags +###################################################################### + +!if $(DEBUG) +ldebug = -debug:full -debugtype:cv -pdb:none +!else +ldebug = -release -opt:ref +!endif + +# declarations common to all linker options +lcommon = -nologo -link50compat -machine:$(MACHINE) + +LFLAGS = $(lcommon) -subsystem:windows -dll + +!if $(USE_TCL_STUBS) == 0 +LLIBS = $(TCLIMPLIB) $(XOTCLIMPLIB) +!else +### should be: +### LLIBS = $(TCLSTUBLIB) $(XOTCLSTUBLIB) when xotcl stub lib is mature +### LLIBS = $(TCLSTUBLIB) $(XOTCLIMPLIB) +LLIBS = $(TCLSTUBLIB) $(XOTCLSTUBLIB) +!endif + +###################################################################### +# Compile flags +###################################################################### + +!IF $(DEBUG) == 0 +!IF "$(MACHINE)" == "ALPHA" +# MSVC on Alpha doesn't understand -Ot +cdebug = -O2i +!ELSE +cdebug = -Ox +!ENDIF +!ELSE +!if $(MSDEV_VER) < 6 +cdebug = -Zi -Od -WX +!else +cdebug = -ZI -Od -WX +!endif +!ENDIF + +!if $(STATIC_BUILD) +cdll = +!else +cdll = -GD +!endif + +# declarations common to all compiler options +ccommon = -nologo -c -W3 -YX \ + + +!if $(STATIC_BUILD) && $(NOMSVCRT) +crt = -MT$(DBGX) +!else +crt = -MD$(DBGX) +!endif + +INCLUDES = -I"$(TCLROOT)\generic" -I"$(XOTCL_DIR)\generic" -I"." + +DEFINES = -DBUILD_$(NAME) -DTCL_THREADS=1 \ + -DXOLIBPKG=$(INST_XOLIBPKG) \ + -DXOTCLVERSION=$(XOTCLVERSION) \ + -DPACKAGE_VERSION=$(XOTCLVERSION) \ + -DVERSION=$(XOTCLVERSION) \ + -DXOTCLPATCHLEVEL=$(XOTCLPATCHLEVEL) \ + -D__WIN32__ -DVISUAL_CC + +EXE_CFLAGS = $(ccommon) $(cdebug) $(crt) $(cdll) $(INCLUDES) $(DEFINES) + +!if $(USE_TCL_STUBS) +#CFLAGS = $(EXE_CFLAGS) -DUSE_TCL_STUBS +CFLAGS = $(EXE_CFLAGS) -DUSE_TCL_STUBS -DUSE_XOTCL_STUBS +!else +CFLAGS = $(EXE_CFLAGS) +!endif + +###################################################################### +# Project specific targets +###################################################################### + +all : libs + +libs : setup $(TARGET) + copy $(TARGET) .. + +setup : + @$(vcvars) > nul + @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) &\ + echo Created directory '$(TMP_DIR)' + @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) &\ + echo Created directory '$(OUT_DIR)' + +$(TARGET) : $(OBJS) +!if $(STATIC_BUILD) + $(lib32) -nologo -machine:$(MACHINE) -out:$@ @<< +!else + $(link32) $(LFLAGS) -base:@$(XOTCL_DIR)\win\dllBase.txt,$@ -out:$@ $(LLIBS) @<< +!endif + $(OBJS) +<< + + +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 $(TARGET) "$(SCRIPT_INSTALL_DIR)" + +###################################################################### +# Inference rules. Use batch-mode when supported. +###################################################################### + +!if $(_NMAKE_VER) < 162 +{$(WINDIR)}.c{$(TMP_DIR)}.obj : +!else +{$(WINDIR)}.c{$(TMP_DIR)}.obj :: +!endif + $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +!if $(_NMAKE_VER) < 162 +{$(GENERICDIR)}.c{$(TMP_DIR)}.obj : +!else +{$(GENERICDIR)}.c{$(TMP_DIR)}.obj :: +!endif + $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +#$(TMP_DIR)\xmltok.obj : expat\xmltok\xmltok.c +# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? +#$(TMP_DIR)\xmlrole.obj : expat\xmltok\xmlrole.c +# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? +#$(TMP_DIR)\xmlwf.obj : expat\xmlwf\xmlwf.c +# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? +#$(TMP_DIR)\readfilemap.obj : expat\xmlwf\readfilemap.c +# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? +#$(TMP_DIR)\codepage.obj : expat\xmlwf\codepage.c +# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? +#$(TMP_DIR)\xmlparse.obj : expat\xmlparse\xmlparse.c +# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? +#$(TMP_DIR)\hashtable.obj : expat\xmlparse\hashtable.c +# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? + +#{$(RCDIR)}.rc{$(TMP_DIR)}.res : +# $(rc32) -fo $@ -DDEBUG=$(DEBUG) $(XOTCL_VERSION_DEFINES) $(XOTCL_INCLUDES) $(TCL_INCLUDES) $(XOTCL_DEFINES) $< + +###################################################################### +# Clean up +###################################################################### + +tidy : + -del $(TMP_DIR)\*.pch + -del $(TMP_DIR)\*.obj + -del $(TMP_DIR)\*.res + -del .\*.pch + -del .\*.pdb + +clean : tidy + -del $(OUT_DIR)\*.exp + -del $(OUT_DIR)\*.lib + -del $(OUT_DIR)\*.dll + -del ..\*.exp + -del ..\*.lib + -del ..\*.dll + +distclean : clean + -rmdir $(OUT_DIR) + -rmdir $(TMP_DIR) + Index: library/xml/TclExpat-1.1/aclocal.m4 =================================================================== diff -u -N --- library/xml/TclExpat-1.1/aclocal.m4 (revision 0) +++ library/xml/TclExpat-1.1/aclocal.m4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,3 @@ +builtin(include,xotcl.m4) +builtin(include,tcl.m4) + Index: library/xml/TclExpat-1.1/asciitab.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/asciitab.h (revision 0) +++ library/xml/TclExpat-1.1/asciitab.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,52 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, +/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, +/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, +/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, +/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, +/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, +/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, +/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, +/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_NMSTRT, BT_SEMI, +/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, +/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, +/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, +/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, +/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, +/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, +/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, +/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, +/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, Index: library/xml/TclExpat-1.1/codepage.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/codepage.c (revision 0) +++ library/xml/TclExpat-1.1/codepage.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,77 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#include "codepage.h" + +#ifdef WIN32 +#include + +int codepageMap(int cp, int *map) +{ + int i; + CPINFO info; + if (!GetCPInfo(cp, &info) || info.MaxCharSize > 2) + return 0; + for (i = 0; i < 256; i++) + map[i] = -1; + if (info.MaxCharSize > 1) { + for (i = 0; i < MAX_LEADBYTES; i++) { + int j, lim; + if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0) + break; + lim = info.LeadByte[i + 1]; + for (j = info.LeadByte[i]; j < lim; j++) + map[j] = -2; + } + } + for (i = 0; i < 256; i++) { + if (map[i] == -1) { + char c = i; + unsigned short n; + if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS, + &c, 1, &n, 1) == 1) + map[i] = n; + } + } + return 1; +} + +int codepageConvert(int cp, const char *p) +{ + unsigned short c; + if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS, + p, 2, &c, 1) == 1) + return c; + return -1; +} + +#else /* not WIN32 */ + +int codepageMap(int cp, int *map) +{ + return 0; +} + +int codepageConvert(int cp, const char *p) +{ + return -1; +} + +#endif /* not WIN32 */ Index: library/xml/TclExpat-1.1/codepage.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/codepage.h (revision 0) +++ library/xml/TclExpat-1.1/codepage.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,22 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +int codepageMap(int cp, int *map); +int codepageConvert(int cp, const char *p); Index: library/xml/TclExpat-1.1/config.log =================================================================== diff -u -N --- library/xml/TclExpat-1.1/config.log (revision 0) +++ library/xml/TclExpat-1.1/config.log (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1026 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by xotclexpat configure 0.9, which was +generated by GNU Autoconf 2.57. Invocation command line was + + $ ./configure --prefix=/usr --enable-threads --prefix=/usr --with-all --cache-file=/dev/null --srcdir=. + +## --------- ## +## Platform. ## +## --------- ## + +hostname = localhost.localdomain +uname -m = i686 +uname -r = 2.4.22-1.2188.nptl +uname -s = Linux +uname -v = #1 Wed Apr 21 20:36:05 EDT 2004 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = i686 +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: . +PATH: /home/neumann/bin +PATH: . +PATH: /home/neumann/bin +PATH: /usr/local/bin +PATH: /usr/bin +PATH: /bin +PATH: /usr/X11R6/bin +PATH: /usr/X11R6/bin +PATH: /sbin +PATH: /usr/sbin +PATH: /opt/bin +PATH: /usr/X11R6/bin +PATH: /sbin +PATH: /usr/sbin +PATH: /opt/bin + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:1294: checking for correct TEA configuration +configure:1313: result: ok +configure:1433: checking for Tcl configuration +configure:1505: result: found /usr/lib/tclConfig.sh +configure:1511: checking for existence of /usr/lib/tclConfig.sh +configure:1515: result: loading +configure:1670: checking for gcc +configure:1686: found /usr/bin/gcc +configure:1696: result: gcc +configure:1940: checking for C compiler version +configure:1943: gcc --version &5 +gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1) +Copyright (C) 2003 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +configure:1946: $? = 0 +configure:1948: gcc -v &5 +Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs +Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux +Thread model: posix +gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) +configure:1951: $? = 0 +configure:1953: gcc -V &5 +gcc: `-V' option must have argument +configure:1956: $? = 1 +configure:1980: checking for C compiler default output +configure:1983: gcc conftest.c >&5 +configure:1986: $? = 0 +configure:2032: result: a.out +configure:2037: checking whether the C compiler works +configure:2043: ./a.out +configure:2046: $? = 0 +configure:2063: result: yes +configure:2070: checking whether we are cross compiling +configure:2072: result: no +configure:2075: checking for suffix of executables +configure:2077: gcc -o conftest conftest.c >&5 +configure:2080: $? = 0 +configure:2105: result: +configure:2111: checking for suffix of object files +configure:2133: gcc -c conftest.c >&5 +configure:2136: $? = 0 +configure:2158: result: o +configure:2162: checking whether we are using the GNU C compiler +configure:2187: gcc -c conftest.c >&5 +configure:2190: $? = 0 +configure:2193: test -s conftest.o +configure:2196: $? = 0 +configure:2209: result: yes +configure:2215: checking whether gcc accepts -g +configure:2237: gcc -c -g conftest.c >&5 +configure:2240: $? = 0 +configure:2243: test -s conftest.o +configure:2246: $? = 0 +configure:2257: result: yes +configure:2274: checking for gcc option to accept ANSI C +configure:2335: gcc -c conftest.c >&5 +configure:2338: $? = 0 +configure:2341: test -s conftest.o +configure:2344: $? = 0 +configure:2362: result: none needed +configure:2380: gcc -c conftest.c >&5 +conftest.c:2: error: syntax error before "me" +configure:2383: $? = 1 +configure: failed program was: +| #ifndef __cplusplus +| choke me +| #endif +configure:2497: checking how to run the C preprocessor +configure:2533: gcc -E conftest.c +configure:2539: $? = 0 +configure:2571: gcc -E conftest.c +configure:2570:28: ac_nonexistent.h: No such file or directory +configure:2577: $? = 1 +configure: failed program was: +| #line 2562 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclexpat" +| #define PACKAGE_TARNAME "xotclexpat" +| #define PACKAGE_VERSION "0.9" +| #define PACKAGE_STRING "xotclexpat 0.9" +| #define PACKAGE_BUGREPORT "" +| /* end confdefs.h. */ +| #include +configure:2615: result: gcc -E +configure:2640: gcc -E conftest.c +configure:2646: $? = 0 +configure:2678: gcc -E conftest.c +configure:2677:28: ac_nonexistent.h: No such file or directory +configure:2684: $? = 1 +configure: failed program was: +| #line 2669 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclexpat" +| #define PACKAGE_TARNAME "xotclexpat" +| #define PACKAGE_VERSION "0.9" +| #define PACKAGE_STRING "xotclexpat 0.9" +| #define PACKAGE_BUGREPORT "" +| /* end confdefs.h. */ +| #include +configure:2739: checking for a BSD-compatible install +configure:2793: result: /usr/bin/install -c +configure:2809: checking whether make sets $(MAKE) +configure:2829: result: yes +configure:2884: checking for ranlib +configure:2900: found /usr/bin/ranlib +configure:2911: result: ranlib +configure:2933: checking for egrep +configure:2943: result: grep -E +configure:2948: checking for ANSI C header files +configure:2974: gcc -c conftest.c >&5 +configure:2977: $? = 0 +configure:2980: test -s conftest.o +configure:2983: $? = 0 +configure:3072: gcc -o conftest conftest.c >&5 +configure:3075: $? = 0 +configure:3077: ./conftest +configure:3080: $? = 0 +configure:3095: result: yes +configure:3119: checking for sys/types.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for sys/stat.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for stdlib.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for string.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for memory.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for strings.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for inttypes.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for stdint.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3119: checking for unistd.h +configure:3136: gcc -c conftest.c >&5 +configure:3139: $? = 0 +configure:3142: test -s conftest.o +configure:3145: $? = 0 +configure:3156: result: yes +configure:3178: checking if the compiler understands -pipe +configure:3199: gcc -pipe -c conftest.c >&5 +configure:3202: $? = 0 +configure:3205: test -s conftest.o +configure:3208: $? = 0 +configure:3210: result: yes +configure:3228: checking for required early compiler flags +configure:3252: gcc -pipe -c conftest.c >&5 +configure:3255: $? = 0 +configure:3258: test -s conftest.o +configure:3261: $? = 0 +configure:3338: gcc -pipe -c conftest.c >&5 +configure: In function `main': +configure:3343: error: storage size of `buf' isn't known +configure:3341: $? = 1 +configure: failed program was: +| #line 3321 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclexpat" +| #define PACKAGE_TARNAME "xotclexpat" +| #define PACKAGE_VERSION "0.9" +| #define PACKAGE_STRING "xotclexpat 0.9" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| /* end confdefs.h. */ +| #include +| int +| main () +| { +| struct stat64 buf; int i = stat64("/", &buf); +| ; +| return 0; +| } +configure:3372: gcc -pipe -c conftest.c >&5 +configure:3375: $? = 0 +configure:3378: test -s conftest.o +configure:3381: $? = 0 +configure:3407: result: _LARGEFILE64_SOURCE +configure:3412: checking for 64-bit integer type +configure:3435: gcc -pipe -c conftest.c >&5 +configure: In function `main': +configure:3441: error: `__int64' undeclared (first use in this function) +configure:3441: error: (Each undeclared identifier is reported only once +configure:3441: error: for each function it appears in.) +configure:3441: error: syntax error before "value" +configure:3438: $? = 1 +configure: failed program was: +| #line 3418 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclexpat" +| #define PACKAGE_TARNAME "xotclexpat" +| #define PACKAGE_VERSION "0.9" +| #define PACKAGE_STRING "xotclexpat 0.9" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| /* end confdefs.h. */ +| +| int +| main () +| { +| __int64 value = (__int64) 0; +| ; +| return 0; +| } +configure:3471: gcc -pipe -o conftest conftest.c >&5 +configure:3474: $? = 0 +configure:3476: ./conftest +configure:3479: $? = 0 +configure:3507: result: long long +configure:3511: checking for struct dirent64 +configure:3535: gcc -pipe -c conftest.c >&5 +configure:3538:24: sys/dirent.h: No such file or directory +configure: In function `main': +configure:3542: error: storage size of `p' isn't known +configure:3538: $? = 1 +configure: failed program was: +| #line 3517 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclexpat" +| #define PACKAGE_TARNAME "xotclexpat" +| #define PACKAGE_VERSION "0.9" +| #define PACKAGE_STRING "xotclexpat 0.9" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| /* end confdefs.h. */ +| #include +| #include +| int +| main () +| { +| struct dirent64 p; +| ; +| return 0; +| } +configure:3562: result: no +configure:3565: checking for struct stat64 +configure:3589: gcc -pipe -c conftest.c >&5 +configure:3592: $? = 0 +configure:3595: test -s conftest.o +configure:3598: $? = 0 +configure:3616: result: yes +configure:3619: checking for off64_t +configure:3643: gcc -pipe -c conftest.c >&5 +configure:3646: $? = 0 +configure:3649: test -s conftest.o +configure:3652: $? = 0 +configure:3670: result: yes +configure:3674: checking whether byte ordering is bigendian +configure:3702: gcc -pipe -c conftest.c >&5 +configure:3705: $? = 0 +configure:3708: test -s conftest.o +configure:3711: $? = 0 +configure:3736: gcc -pipe -c conftest.c >&5 +configure: In function `main': +configure:3743: error: `not' undeclared (first use in this function) +configure:3743: error: (Each undeclared identifier is reported only once +configure:3743: error: for each function it appears in.) +configure:3743: error: syntax error before "big" +configure:3739: $? = 1 +configure: failed program was: +| #line 3714 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclexpat" +| #define PACKAGE_TARNAME "xotclexpat" +| #define PACKAGE_VERSION "0.9" +| #define PACKAGE_STRING "xotclexpat 0.9" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| #include +| #include +| +| int +| main () +| { +| #if BYTE_ORDER != BIG_ENDIAN +| not big endian +| #endif +| +| ; +| return 0; +| } +configure:3859: result: no +configure:3887: checking for sin +configure:3937: gcc -pipe -o conftest conftest.c >&5 +configure:3930: warning: conflicting types for built-in function `sin' +/tmp/ccY0yOcH.o(.text+0x16): In function `main': +: undefined reference to `sin' +/tmp/ccY0yOcH.o(.data+0x0): undefined reference to `sin' +collect2: ld returned 1 exit status +configure:3940: $? = 1 +configure: failed program was: +| #line 3892 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclexpat" +| #define PACKAGE_TARNAME "xotclexpat" +| #define PACKAGE_VERSION "0.9" +| #define PACKAGE_STRING "xotclexpat 0.9" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| /* System header to define __stub macros and hopefully few prototypes, +| which can conflict with char sin (); below. +| Prefer to if __STDC__ is defined, since +| exists even on freestanding compilers. */ +| #ifdef __STDC__ +| # include +| #else +| # include +| #endif +| /* Override any gcc2 internal prototype to avoid an error. */ +| #ifdef __cplusplus +| extern "C" +| { +| #endif +| /* We use char because int might match the return type of a gcc2 +| builtin and then its argument prototype would still apply. */ +| char sin (); +| /* The GNU C library defines this for functions which it implements +| to always fail with ENOSYS. Some functions are actually named +| something starting with __ and the normal name is an alias. */ +| #if defined (__stub_sin) || defined (__stub___sin) +| choke me +| #else +| char (*f) () = sin; +| #endif +| #ifdef __cplusplus +| } +| #endif +| +| int +| main () +| { +| return f != sin; +| ; +| return 0; +| } +configure:3957: result: no +configure:3965: checking for main in -lieee +configure:3990: gcc -pipe -o conftest conftest.c -lieee >&5 +configure:3993: $? = 0 +configure:3996: test -s conftest +configure:3999: $? = 0 +configure:4011: result: yes +configure:4023: checking for main in -linet +configure:4048: gcc -pipe -o conftest conftest.c -linet >&5 +/usr/bin/ld: cannot find -linet +collect2: ld returned 1 exit status +configure:4051: $? = 1 +configure: failed program was: +| #line 4030 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclexpat" +| #define PACKAGE_TARNAME "xotclexpat" +| #define PACKAGE_VERSION "0.9" +| #define PACKAGE_STRING "xotclexpat 0.9" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| +| +| int +| main () +| { +| main (); +| ; +| return 0; +| } +configure:4069: result: no +configure:4085: checking net/errno.h usability +configure:4098: gcc -pipe -c conftest.c >&5 +configure:4143:23: net/errno.h: No such file or directory +configure:4101: $? = 1 +configure: failed program was: +| #line 4087 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclexpat" +| #define PACKAGE_TARNAME "xotclexpat" +| #define PACKAGE_VERSION "0.9" +| #define PACKAGE_STRING "xotclexpat 0.9" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| #include +| #if HAVE_SYS_TYPES_H +| # include +| #endif +| #if HAVE_SYS_STAT_H +| # include +| #endif +| #if STDC_HEADERS +| # include +| # include +| #else +| # if HAVE_STDLIB_H +| # include +| # endif +| #endif +| #if HAVE_STRING_H +| # if !STDC_HEADERS && HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #if HAVE_STRINGS_H +| # include +| #endif +| #if HAVE_INTTYPES_H +| # include +| #else +| # if HAVE_STDINT_H +| # include +| # endif +| #endif +| #if HAVE_UNISTD_H +| # include +| #endif +| #include +configure:4117: result: no +configure:4121: checking net/errno.h presence +configure:4132: gcc -E conftest.c +configure:4145:23: net/errno.h: No such file or directory +configure:4138: $? = 1 +configure: failed program was: +| #line 4123 "configure" +| /* confdefs.h. */ +| +| #define PACKAGE_NAME "xotclexpat" +| #define PACKAGE_TARNAME "xotclexpat" +| #define PACKAGE_VERSION "0.9" +| #define PACKAGE_STRING "xotclexpat 0.9" +| #define PACKAGE_BUGREPORT "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define _LARGEFILE64_SOURCE 1 +| #define TCL_WIDE_INT_TYPE long long +| #define HAVE_STRUCT_STAT64 1 +| #define HAVE_TYPE_OFF64_T 1 +| /* end confdefs.h. */ +| #include +configure:4157: result: no +configure:4193: checking for net/errno.h +configure:4200: result: no +configure:4232: checking for connect +configure:4282: gcc -pipe -o conftest conftest.c >&5 +configure:4285: $? = 0 +configure:4288: test -s conftest +configure:4291: $? = 0 +configure:4302: result: yes +configure:4531: checking for gethostbyname +configure:4581: gcc -pipe -o conftest conftest.c >&5 +configure:4584: $? = 0 +configure:4587: test -s conftest +configure:4590: $? = 0 +configure:4601: result: yes +configure:4675: checking dirent.h +configure:4713: gcc -pipe -o conftest conftest.c >&5 +configure:4716: $? = 0 +configure:4719: test -s conftest +configure:4722: $? = 0 +configure:4740: result: yes +configure:4752: checking errno.h usability +configure:4765: gcc -pipe -c conftest.c >&5 +configure:4768: $? = 0 +configure:4771: test -s conftest.o +configure:4774: $? = 0 +configure:4784: result: yes +configure:4788: checking errno.h presence +configure:4799: gcc -E conftest.c +configure:4805: $? = 0 +configure:4824: result: yes +configure:4860: checking for errno.h +configure:4867: result: yes +configure:4891: checking float.h usability +configure:4904: gcc -pipe -c conftest.c >&5 +configure:4907: $? = 0 +configure:4910: test -s conftest.o +configure:4913: $? = 0 +configure:4923: result: yes +configure:4927: checking float.h presence +configure:4938: gcc -E conftest.c +configure:4944: $? = 0 +configure:4963: result: yes +configure:4999: checking for float.h +configure:5006: result: yes +configure:5030: checking values.h usability +configure:5043: gcc -pipe -c conftest.c >&5 +configure:5046: $? = 0 +configure:5049: test -s conftest.o +configure:5052: $? = 0 +configure:5062: result: yes +configure:5066: checking values.h presence +configure:5077: gcc -E conftest.c +configure:5083: $? = 0 +configure:5102: result: yes +configure:5138: checking for values.h +configure:5145: result: yes +configure:5169: checking limits.h usability +configure:5182: gcc -pipe -c conftest.c >&5 +configure:5185: $? = 0 +configure:5188: test -s conftest.o +configure:5191: $? = 0 +configure:5201: result: yes +configure:5205: checking limits.h presence +configure:5216: gcc -E conftest.c +configure:5222: $? = 0 +configure:5241: result: yes +configure:5277: checking for limits.h +configure:5284: result: yes +configure:5299: checking for stdlib.h +configure:5304: result: yes +configure:5495: checking for string.h +configure:5500: result: yes +configure:5687: checking sys/wait.h usability +configure:5700: gcc -pipe -c conftest.c >&5 +configure:5703: $? = 0 +configure:5706: test -s conftest.o +configure:5709: $? = 0 +configure:5719: result: yes +configure:5723: checking sys/wait.h presence +configure:5734: gcc -E conftest.c +configure:5740: $? = 0 +configure:5759: result: yes +configure:5795: checking for sys/wait.h +configure:5802: result: yes +configure:5826: checking dlfcn.h usability +configure:5839: gcc -pipe -c conftest.c >&5 +configure:5842: $? = 0 +configure:5845: test -s conftest.o +configure:5848: $? = 0 +configure:5858: result: yes +configure:5862: checking dlfcn.h presence +configure:5873: gcc -E conftest.c +configure:5879: $? = 0 +configure:5898: result: yes +configure:5934: checking for dlfcn.h +configure:5941: result: yes +configure:5967: checking for limits.h +configure:5972: result: yes +configure:5967: checking for unistd.h +configure:5972: result: yes +configure:5976: checking sys/param.h usability +configure:5989: gcc -pipe -c conftest.c >&5 +configure:5992: $? = 0 +configure:5995: test -s conftest.o +configure:5998: $? = 0 +configure:6008: result: yes +configure:6012: checking sys/param.h presence +configure:6023: gcc -E conftest.c +configure:6029: $? = 0 +configure:6048: result: yes +configure:6084: checking for sys/param.h +configure:6091: result: yes +configure:6139: checking for XOTcl configuration +configure:6200: result: found /home/neumann/xotcl-1.2.1/xotclConfig.sh +configure:6206: checking for existence of /home/neumann/xotcl-1.2.1/xotclConfig.sh +configure:6210: result: loading +configure:6379: checking for Tcl public headers +configure:6434: result: /usr/include +configure:6482: checking for pthread_mutex_init in -lpthread +configure:6513: gcc -pipe -o conftest conftest.c -lpthread >&5 +configure:6516: $? = 0 +configure:6519: test -s conftest +configure:6522: $? = 0 +configure:6534: result: yes +configure:6821: checking for pthread_attr_setstacksize +configure:6871: gcc -pipe -o conftest conftest.c -lpthread >&5 +configure:6874: $? = 0 +configure:6877: test -s conftest +configure:6880: $? = 0 +configure:6891: result: yes +configure:6906: checking for readdir_r +configure:6956: gcc -pipe -o conftest conftest.c >&5 +configure:6959: $? = 0 +configure:6962: test -s conftest +configure:6965: $? = 0 +configure:6976: result: yes +configure:6991: checking for building with threads +configure:6998: result: yes +configure:7037: checking how to build libraries +configure:7055: result: shared +configure:7081: checking if 64bit support is enabled +configure:7090: result: no +configure:7095: checking if 64bit Sparc VIS support is requested +configure:7104: result: no +configure:7132: checking system version (for dynamic loading) +configure:7155: result: Linux-2.4.22-1.2188.nptl +configure:7163: checking for dlopen in -ldl +configure:7194: gcc -pipe -o conftest conftest.c -ldl >&5 +configure:7197: $? = 0 +configure:7200: test -s conftest +configure:7203: $? = 0 +configure:7215: result: yes +configure:7245: checking for ar +configure:7261: found /usr/bin/ar +configure:7271: result: ar +configure:9157: checking for build with symbols +configure:9171: result: no +configure:9306: checking for tclsh +configure:9337: result: /usr/lib/../bin/tclsh8.4 +configure:9481: creating ./config.status + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by xotclexpat config.status 0.9, which was +generated by GNU Autoconf 2.57. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on localhost.localdomain + +config.status:675: creating Makefile + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_c_bigendian=no +ac_cv_c_compiler_gnu=yes +ac_cv_c_tclconfig=/usr/lib +ac_cv_c_tclh=/usr/include +ac_cv_c_xotclconfig=/home/neumann/xotcl-1.2.1 +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_exeext= +ac_cv_func_connect=yes +ac_cv_func_gethostbyname=yes +ac_cv_func_pthread_attr_setstacksize=yes +ac_cv_func_readdir_r=yes +ac_cv_func_sin=no +ac_cv_header_dlfcn_h=yes +ac_cv_header_errno_h=yes +ac_cv_header_float_h=yes +ac_cv_header_inttypes_h=yes +ac_cv_header_limits_h=yes +ac_cv_header_memory_h=yes +ac_cv_header_net_errno_h=no +ac_cv_header_stdc=yes +ac_cv_header_stdint_h=yes +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_param_h=yes +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_sys_wait_h=yes +ac_cv_header_unistd_h=yes +ac_cv_header_values_h=yes +ac_cv_lib_dl_dlopen=yes +ac_cv_lib_ieee_main=yes +ac_cv_lib_inet_main=no +ac_cv_lib_pthread_pthread_mutex_init=yes +ac_cv_objext=o +ac_cv_path_install='/usr/bin/install -c' +ac_cv_path_tclsh=/usr/lib/../bin/tclsh8.4 +ac_cv_prog_AR=ar +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_RANLIB=ranlib +ac_cv_prog_cc_g=yes +ac_cv_prog_cc_stdc= +ac_cv_prog_egrep='grep -E' +ac_cv_prog_make_make_set=yes +tcl_cv_flag__isoc99_source=no +tcl_cv_flag__largefile64_source=yes +tcl_cv_struct_dirent64=no +tcl_cv_struct_stat64=yes +tcl_cv_type_64bit='long long' +tcl_cv_type_off64_t=yes + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +AR='ar' +CC='gcc -pipe' +CFLAGS=' ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' +CFLAGS_DEBUG='-g' +CFLAGS_DEFAULT='-O' +CFLAGS_OPTIMIZE='-O' +CFLAGS_WARNING='-Wall -Wconversion -Wno-implicit-int' +CLEANFILES='pkgIndex.tcl' +CPP='gcc -E' +CPPFLAGS='' +CYGPATH='echo' +DEFS='-DPACKAGE_NAME=\"xotclexpat\" -DPACKAGE_TARNAME=\"xotclexpat\" -DPACKAGE_VERSION=\"0.9\" -DPACKAGE_STRING=\"xotclexpat\ 0.9\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -DTCL_THREADS=1 -DUSE_TCL_STUBS=1 ' +DL_LIBS='-ldl' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='grep -E' +EXEEXT='' +EXTRA_CFLAGS='' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +LDFLAGS='-rdynamic' +LDFLAGS_DEBUG='' +LDFLAGS_DEFAULT='-rdynamic' +LDFLAGS_OPTIMIZE='' +LD_LIBRARY_PATH_VAR='LD_LIBRARY_PATH' +LIBOBJS='' +LIBS='' +LTLIBOBJS='' +MAKE_LIB='${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_FLAGS} ${SHLIB_LD_LIBS} ' +MAKE_SHARED_LIB='${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_FLAGS} ${SHLIB_LD_LIBS}' +MAKE_STATIC_LIB='${STLIB_LD} $@ $(PKG_OBJECTS)' +MAKE_STUB_LIB='${STLIB_LD} $@ $(PKG_STUB_OBJECTS)' +MATH_LIBS='-lieee -lm' +OBJEXT='o' +PACKAGE_BUGREPORT='' +PACKAGE_NAME='xotclexpat' +PACKAGE_STRING='xotclexpat 0.9' +PACKAGE_TARNAME='xotclexpat' +PACKAGE_VERSION='0.9' +PATH_SEPARATOR=':' +PKG_CFLAGS=' ' +PKG_HEADERS='' +PKG_INCLUDES=' -I/home/neumann/xotcl-1.2.1/generic' +PKG_LIBS=' -L/home/neumann/xotcl-1.2.1 -lxotclstub1.2.1' +PKG_LIB_FILE='libxotclexpat0.9.so' +PKG_OBJECTS=' xmltok.o unixfilemap.o xmlrole.o xmlwf.o codepage.o xmlparse.o hashtable.o tclexpat.o' +PKG_SOURCES=' xmltok.c unixfilemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c' +PKG_STUB_LIB_FILE='libxotclexpatstub0.9.a' +PKG_STUB_OBJECTS='' +PKG_STUB_SOURCES='' +PKG_TCL_SOURCES='' +RANLIB=':' +RANLIB_STUB='ranlib' +SET_MAKE='' +SHARED_BUILD='1' +SHELL='/bin/sh' +SHLIB_CFLAGS='-fPIC' +SHLIB_LD='gcc -pipe -shared' +SHLIB_LD_FLAGS='' +SHLIB_LD_LIBS='${LIBS} -L/usr/lib -ltclstub8.4' +STLIB_LD='${AR} cr' +TCLSH_PROG='/usr/lib/../bin/tclsh8.4' +TCL_BIN_DIR='/usr/lib' +TCL_DBGX='' +TCL_DEFS=' -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DPEEK_XCLOSEIM=1 -DHAVE_SYS_IOCTL_H=1 ' +TCL_EXTRA_CFLAGS='' +TCL_INCLUDES='-I"/usr/include"' +TCL_LD_FLAGS='-rdynamic' +TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' +TCL_LIB_FILE='libtcl8.4.so' +TCL_LIB_FLAG='-ltcl8.4' +TCL_LIB_SPEC='-L/usr/lib -ltcl8.4' +TCL_SHLIB_LD_LIBS='${LIBS}' +TCL_SRC_DIR='/home/neumann/tcl8.4.5' +TCL_STUB_LIB_FILE='libtclstub8.4.a' +TCL_STUB_LIB_FLAG='-ltclstub8.4' +TCL_STUB_LIB_SPEC='-L/usr/lib -ltclstub8.4' +TCL_THREADS='1' +TCL_VERSION='8.4' +XOTCL_BUILD_LIB_SPEC='-L/home/neumann/xotcl-1.2.1 -lxotcl1.2.1' +XOTCL_BUILD_STUB_LIB_SPEC='-L/home/neumann/xotcl-1.2.1 -lxotclstub1.2.1' +XOTCL_LIB_FILE='libxotcl1.2.1.so' +XOTCL_LIB_SPEC='-L/usr/lib -lxotcl1.2.1' +XOTCL_MAJOR_VERSION='1' +XOTCL_MINOR_VERSION='2' +XOTCL_RELEASE_LEVEL='.1' +XOTCL_SRC_DIR='/home/neumann/xotcl-1.2.1' +XOTCL_STUB_LIB_FILE='' +XOTCL_STUB_LIB_SPEC='-L/usr/lib -lxotclstub1.2.1' +XOTCL_VERSION='1.2' +ac_ct_CC='gcc' +ac_ct_RANLIB='ranlib' +bindir='${exec_prefix}/bin' +build_alias='' +datadir='${prefix}/share' +exec_prefix='/usr' +host_alias='' +includedir='${prefix}/include' +infodir='${prefix}/info' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localstatedir='${prefix}/var' +mandir='${prefix}/man' +oldincludedir='/usr/include' +prefix='/usr' +program_transform_name='s,x,x,' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target_alias='' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 +#define HAVE_READDIR_R 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRUCT_STAT64 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_TYPE_OFF64_T 1 +#define HAVE_UNISTD_H 1 +#define HAVE_UNISTD_H 1 +#define PACKAGE_BUGREPORT "" +#define PACKAGE_NAME "xotclexpat" +#define PACKAGE_STRING "xotclexpat 0.9" +#define PACKAGE_TARNAME "xotclexpat" +#define PACKAGE_VERSION "0.9" +#define STDC_HEADERS 1 +#define TCL_THREADS 1 +#define TCL_WIDE_INT_TYPE long long +#define USE_TCL_STUBS 1 +#define USE_THREAD_ALLOC 1 +#define _LARGEFILE64_SOURCE 1 +#define _REENTRANT 1 +#define _THREAD_SAFE 1 + +configure: exit 0 Index: library/xml/TclExpat-1.1/configure =================================================================== diff -u -N --- library/xml/TclExpat-1.1/configure (revision 0) +++ library/xml/TclExpat-1.1/configure (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,10986 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for xotclexpat 0.9. +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='xotclexpat' +PACKAGE_TARNAME='xotclexpat' +PACKAGE_VERSION='0.9' +PACKAGE_STRING='xotclexpat 0.9' +PACKAGE_BUGREPORT='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures xotclexpat 0.9 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of xotclexpat 0.9:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-threads build with threads + --enable-shared build and link with shared libraries (default: on) + --enable-64bit enable 64bit support (default: off) + --enable-64bit-vis enable 64bit Sparc VIS support (default: off) + --enable-wince enable Win/CE support (where applicable) + --enable-load allow dynamic loading and "load" command (default: + on) + --enable-symbols build with debugging symbols (default: off) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH + absolute path to xotclConfig.sh, + --without-xotcl disables, but this is pointless + --with-tcl directory containing tcl configuration + (tclConfig.sh) + --with-tclinclude directory containing the public Tcl header files + --with-celib=DIR use Windows/CE support library from DIR + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +xotclexpat configure 0.9 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by xotclexpat $as_me 0.9, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#-------------------------------------------------------------------- +# 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 extensions pass this us the version of TEA they think they + # are compatible with. + TEA_VERSION="3.6" + + echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 +echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 + if test x"${PACKAGE_NAME}" = x ; then + { { echo "$as_me:$LINENO: error: +The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 +echo "$as_me: error: +The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} + { (exit 1); exit 1; }; } + fi + if test x"3.5" = x ; then + { { echo "$as_me:$LINENO: error: +TEA version not specified." >&5 +echo "$as_me: error: +TEA version not specified." >&2;} + { (exit 1); exit 1; }; } + elif test "3.5" != "${TEA_VERSION}" ; then + echo "$as_me:$LINENO: result: warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&5 +echo "${ECHO_T}warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&6 + else + echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 +echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 + fi + case "`uname -s`" in + *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) + # Extract the first word of "cygpath", so it can be a program name with args. +set dummy cygpath; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CYGPATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CYGPATH"; then + ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CYGPATH="cygpath -w" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" +fi +fi +CYGPATH=$ac_cv_prog_CYGPATH +if test -n "$CYGPATH"; then + echo "$as_me:$LINENO: result: $CYGPATH" >&5 +echo "${ECHO_T}$CYGPATH" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + EXEEXT=".exe" + TEA_PLATFORM="windows" + ;; + *) + CYGPATH=echo + EXEEXT="" + TEA_PLATFORM="unix" + ;; + esac + + # Check if exec_prefix is set. If not use fall back to prefix. + # Note when adjusted, so that TEA_PREFIX can correct for this. + # This is needed for recursive configures, since autoconf propagates + # $prefix, but not $exec_prefix (doh!). + if test x$exec_prefix = xNONE ; then + exec_prefix_default=yes + exec_prefix=$prefix + fi + + + + + # This package name must be replaced statically for AC_SUBST to work + + # Substitute STUB_LIB_FILE in case package creates a stub library too. + + + # We AC_SUBST these here to ensure they are subst'ed, + # in case the user doesn't call TEA_ADD_... + + + + + + + + + +ac_aux_dir= +for ac_dir in ../../../config $srcdir/../../../config; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../../config $srcdir/../../../config" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in ../../../config $srcdir/../../../config" >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + + +#-------------------------------------------------------------------- +# specify some extra flags +#-------------------------------------------------------------------- + + +# Check whether --with-xotcl or --without-xotcl was given. +if test "${with_xotcl+set}" = set; then + withval="$with_xotcl" + with_xotcl=$withval +else + { { echo "$as_me:$LINENO: error: --with-xotcl is required" >&5 +echo "$as_me: error: --with-xotcl is required" >&2;} + { (exit 1); exit 1; }; } +fi; + +#-------------------------------------------------------------------- +# Load the tclConfig.sh file +#-------------------------------------------------------------------- + + + + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + with_tclconfig=${withval} +fi; + echo "$as_me:$LINENO: checking for Tcl configuration" >&5 +echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 + if test "${ac_cv_c_tclconfig+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case ${with_tclconfig} in + */tclConfig.sh ) + if test -f ${with_tclconfig}; then + { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 +echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} + with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 +echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tcl.framework/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + +fi + + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 +echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} + exit 0 + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 + fi + fi + + + echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 + + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then + echo "$as_me:$LINENO: result: loading" >&5 +echo "${ECHO_T}loading" >&6 + . "${TCL_BIN_DIR}/tclConfig.sh" + else + echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tcl.framework installed in an arbitary location. + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then + for i in "`cd ${TCL_BIN_DIR}; pwd`" \ + "`cd ${TCL_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then + TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" + break + fi + done + fi + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then + TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + + + + + + + + + + + + + + + + + + + +#-------------------------------------------------------------------- +# Load the tkConfig.sh file if necessary (Tk extension) +#-------------------------------------------------------------------- + +#TEA_PATH_TKCONFIG +#TEA_LOAD_TKCONFIG + +#----------------------------------------------------------------------- +# Handle the --prefix=... option by defaulting to what Tcl gave. +# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. +#----------------------------------------------------------------------- + + + if test "${prefix}" = "NONE"; then + prefix_default=yes + if test x"${TCL_PREFIX}" != x; then + { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 +echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} + prefix=${TCL_PREFIX} + else + { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 +echo "$as_me: --prefix defaulting to /usr/local" >&6;} + prefix=/usr/local + fi + fi + if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ + -o x"${exec_prefix_default}" = x"yes" ; then + if test x"${TCL_EXEC_PREFIX}" != x; then + { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 +echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} + exec_prefix=${TCL_EXEC_PREFIX} + else + { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 +echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} + exec_prefix=$prefix + fi + fi + + +#----------------------------------------------------------------------- +# Standard compiler checks. +# This sets up CC by using the CC env var, or looks for gcc otherwise. +# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create +# the basic setup necessary to compile executables. +#----------------------------------------------------------------------- + + + # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) + # in this macro, they need to go into TEA_SETUP_COMPILER instead. + + # If the user did not set CFLAGS, set it now to keep + # the AC_PROG_CC macro from adding "-g -O2". + if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" + fi + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + + #-------------------------------------------------------------------- + # Checks to see if the make program sets the $MAKE variable. + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + + #-------------------------------------------------------------------- + # Find ranlib + #-------------------------------------------------------------------- + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + + #-------------------------------------------------------------------- + # Determines the correct binary file extension (.o, .obj, .exe etc.) + #-------------------------------------------------------------------- + + + + + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. + + + #------------------------------------------------------------------------ + # If we're using GCC, see if the compiler understands -pipe. If so, use it. + # It makes compiling go faster. (This is only a performance feature.) + #------------------------------------------------------------------------ + + if test -z "$no_pipe" -a -n "$GCC"; then + echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 +echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 +if test "${tcl_cv_cc_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_pipe=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_pipe=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 +echo "${ECHO_T}$tcl_cv_cc_pipe" >&6 + if test $tcl_cv_cc_pipe = yes; then + CFLAGS="$CFLAGS -pipe" + fi + fi + + #-------------------------------------------------------------------- + # Common compiler flag setup + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + + if test "${TEA_PLATFORM}" = "unix" ; then + + #-------------------------------------------------------------------- + # On a few very rare systems, all of the libm.a stuff is + # already in libc.a. Set compiler flags accordingly. + # Also, Linux requires the "ieee" library for math to work + # right (and it must appear before "-lm"). + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking for sin" >&5 +echo $ECHO_N "checking for sin... $ECHO_C" >&6 +if test "${ac_cv_func_sin+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define sin to an innocuous variant, in case declares sin. + For example, HP-UX 11i declares gettimeofday. */ +#define sin innocuous_sin + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char sin (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef sin + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char sin (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_sin) || defined (__stub___sin) +choke me +#else +char (*f) () = sin; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != sin; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_sin=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_sin=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 +echo "${ECHO_T}$ac_cv_func_sin" >&6 +if test $ac_cv_func_sin = yes; then + MATH_LIBS="" +else + MATH_LIBS="-lm" +fi + + echo "$as_me:$LINENO: checking for main in -lieee" >&5 +echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 +if test "${ac_cv_lib_ieee_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lieee $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ieee_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ieee_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 +echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 +if test $ac_cv_lib_ieee_main = yes; then + MATH_LIBS="-lieee $MATH_LIBS" +fi + + + #-------------------------------------------------------------------- + # Interactive UNIX requires -linet instead of -lsocket, plus it + # needs net/errno.h to define the socket-related error codes. + #-------------------------------------------------------------------- + + echo "$as_me:$LINENO: checking for main in -linet" >&5 +echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 +if test "${ac_cv_lib_inet_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-linet $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_inet_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_inet_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 +echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 +if test $ac_cv_lib_inet_main = yes; then + LIBS="$LIBS -linet" +fi + + if test "${ac_cv_header_net_errno_h+set}" = set; then + echo "$as_me:$LINENO: checking for net/errno.h" >&5 +echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_net_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking net/errno.h usability" >&5 +echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking net/errno.h presence" >&5 +echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------- ## +## Report this to the xotclexpat lists. ## +## ------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for net/errno.h" >&5 +echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_net_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_net_errno_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 + +fi +if test $ac_cv_header_net_errno_h = yes; then + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NET_ERRNO_H 1 +_ACEOF + +fi + + + + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- + + tcl_checkBoth=0 + echo "$as_me:$LINENO: checking for connect" >&5 +echo $ECHO_N "checking for connect... $ECHO_C" >&6 +if test "${ac_cv_func_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef connect + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_connect) || defined (__stub___connect) +choke me +#else +char (*f) () = connect; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != connect; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_connect=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +echo "${ECHO_T}$ac_cv_func_connect" >&6 +if test $ac_cv_func_connect = yes; then + tcl_checkSocket=0 +else + tcl_checkSocket=1 +fi + + if test "$tcl_checkSocket" = 1; then + echo "$as_me:$LINENO: checking for setsockopt" >&5 +echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 +if test "${ac_cv_func_setsockopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define setsockopt to an innocuous variant, in case declares setsockopt. + For example, HP-UX 11i declares gettimeofday. */ +#define setsockopt innocuous_setsockopt + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char setsockopt (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef setsockopt + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setsockopt (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_setsockopt) || defined (__stub___setsockopt) +choke me +#else +char (*f) () = setsockopt; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != setsockopt; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_setsockopt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_setsockopt=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 +echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 +if test $ac_cv_func_setsockopt = yes; then + : +else + echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 +echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_setsockopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setsockopt (); +int +main () +{ +setsockopt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_setsockopt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_socket_setsockopt=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 +if test $ac_cv_lib_socket_setsockopt = yes; then + LIBS="$LIBS -lsocket" +else + tcl_checkBoth=1 +fi + +fi + + fi + if test "$tcl_checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + echo "$as_me:$LINENO: checking for accept" >&5 +echo $ECHO_N "checking for accept... $ECHO_C" >&6 +if test "${ac_cv_func_accept+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define accept to an innocuous variant, in case declares accept. + For example, HP-UX 11i declares gettimeofday. */ +#define accept innocuous_accept + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char accept (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef accept + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char accept (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_accept) || defined (__stub___accept) +choke me +#else +char (*f) () = accept; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != accept; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_accept=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_accept=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 +echo "${ECHO_T}$ac_cv_func_accept" >&6 +if test $ac_cv_func_accept = yes; then + tcl_checkNsl=0 +else + LIBS=$tk_oldLibs +fi + + fi + echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_func_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef gethostbyname + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +char (*f) () = gethostbyname; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != gethostbyname; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 +if test $ac_cv_func_gethostbyname = yes; then + : +else + echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_nsl_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_nsl_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 +if test $ac_cv_lib_nsl_gethostbyname = yes; then + LIBS="$LIBS -lnsl" +fi + +fi + + + # Don't perform the eval of the libraries here because DL_LIBS + # won't be set until we call TEA_CONFIG_CFLAGS + + TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' + + + + + echo "$as_me:$LINENO: checking dirent.h" >&5 +echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 +if test "${tcl_cv_dirent_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ + +#ifndef _POSIX_SOURCE +# ifdef __Lynx__ + /* + * Generate compilation error to make the test fail: Lynx headers + * are only valid if really in the POSIX environment. + */ + + missing_procedure(); +# endif +#endif +DIR *d; +struct dirent *entryPtr; +char *p; +d = opendir("foobar"); +entryPtr = readdir(d); +p = entryPtr->d_name; +closedir(d); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_dirent_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_dirent_h=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 +echo "${ECHO_T}$tcl_cv_dirent_h" >&6 + + if test $tcl_cv_dirent_h = no; then + +cat >>confdefs.h <<\_ACEOF +#define NO_DIRENT_H 1 +_ACEOF + + fi + + if test "${ac_cv_header_errno_h+set}" = set; then + echo "$as_me:$LINENO: checking for errno.h" >&5 +echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_errno_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking errno.h usability" >&5 +echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking errno.h presence" >&5 +echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------- ## +## Report this to the xotclexpat lists. ## +## ------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for errno.h" >&5 +echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 +if test "${ac_cv_header_errno_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_errno_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 +echo "${ECHO_T}$ac_cv_header_errno_h" >&6 + +fi +if test $ac_cv_header_errno_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_ERRNO_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_float_h+set}" = set; then + echo "$as_me:$LINENO: checking for float.h" >&5 +echo $ECHO_N "checking for float.h... $ECHO_C" >&6 +if test "${ac_cv_header_float_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 +echo "${ECHO_T}$ac_cv_header_float_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking float.h usability" >&5 +echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking float.h presence" >&5 +echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------- ## +## Report this to the xotclexpat lists. ## +## ------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for float.h" >&5 +echo $ECHO_N "checking for float.h... $ECHO_C" >&6 +if test "${ac_cv_header_float_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_float_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 +echo "${ECHO_T}$ac_cv_header_float_h" >&6 + +fi +if test $ac_cv_header_float_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_FLOAT_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_values_h+set}" = set; then + echo "$as_me:$LINENO: checking for values.h" >&5 +echo $ECHO_N "checking for values.h... $ECHO_C" >&6 +if test "${ac_cv_header_values_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 +echo "${ECHO_T}$ac_cv_header_values_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking values.h usability" >&5 +echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking values.h presence" >&5 +echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------- ## +## Report this to the xotclexpat lists. ## +## ------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for values.h" >&5 +echo $ECHO_N "checking for values.h... $ECHO_C" >&6 +if test "${ac_cv_header_values_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_values_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 +echo "${ECHO_T}$ac_cv_header_values_h" >&6 + +fi +if test $ac_cv_header_values_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_VALUES_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_limits_h+set}" = set; then + echo "$as_me:$LINENO: checking for limits.h" >&5 +echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 +if test "${ac_cv_header_limits_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +echo "${ECHO_T}$ac_cv_header_limits_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking limits.h usability" >&5 +echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking limits.h presence" >&5 +echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------- ## +## Report this to the xotclexpat lists. ## +## ------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for limits.h" >&5 +echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 +if test "${ac_cv_header_limits_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_limits_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +echo "${ECHO_T}$ac_cv_header_limits_h" >&6 + +fi +if test $ac_cv_header_limits_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIMITS_H 1 +_ACEOF + +else + +cat >>confdefs.h <<\_ACEOF +#define NO_LIMITS_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_stdlib_h+set}" = set; then + echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking stdlib.h usability" >&5 +echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking stdlib.h presence" >&5 +echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------- ## +## Report this to the xotclexpat lists. ## +## ------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_stdlib_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 + +fi +if test $ac_cv_header_stdlib_h = yes; then + tcl_ok=1 +else + tcl_ok=0 +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtol" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtoul" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strtod" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + if test $tcl_ok = 0; then + +cat >>confdefs.h <<\_ACEOF +#define NO_STDLIB_H 1 +_ACEOF + + fi + if test "${ac_cv_header_string_h+set}" = set; then + echo "$as_me:$LINENO: checking for string.h" >&5 +echo $ECHO_N "checking for string.h... $ECHO_C" >&6 +if test "${ac_cv_header_string_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +echo "${ECHO_T}$ac_cv_header_string_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking string.h usability" >&5 +echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking string.h presence" >&5 +echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------- ## +## Report this to the xotclexpat lists. ## +## ------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for string.h" >&5 +echo $ECHO_N "checking for string.h... $ECHO_C" >&6 +if test "${ac_cv_header_string_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_string_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 +echo "${ECHO_T}$ac_cv_header_string_h" >&6 + +fi +if test $ac_cv_header_string_h = yes; then + tcl_ok=1 +else + tcl_ok=0 +fi + + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strstr" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "strerror" >/dev/null 2>&1; then + : +else + tcl_ok=0 +fi +rm -f conftest* + + + # See also memmove check below for a place where NO_STRING_H can be + # set and why. + + if test $tcl_ok = 0; then + +cat >>confdefs.h <<\_ACEOF +#define NO_STRING_H 1 +_ACEOF + + fi + + if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo "$as_me:$LINENO: checking for sys/wait.h" >&5 +echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 +echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 +echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------- ## +## Report this to the xotclexpat lists. ## +## ------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for sys/wait.h" >&5 +echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_wait_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 + +fi +if test $ac_cv_header_sys_wait_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_SYS_WAIT_H 1 +_ACEOF + +fi + + + if test "${ac_cv_header_dlfcn_h+set}" = set; then + echo "$as_me:$LINENO: checking for dlfcn.h" >&5 +echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 +if test "${ac_cv_header_dlfcn_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 +echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 +echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 +echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------- ## +## Report this to the xotclexpat lists. ## +## ------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for dlfcn.h" >&5 +echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 +if test "${ac_cv_header_dlfcn_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_dlfcn_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 +echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 + +fi +if test $ac_cv_header_dlfcn_h = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define NO_DLFCN_H 1 +_ACEOF + +fi + + + + # OS/390 lacks sys/param.h (and doesn't need it, by chance). + +for ac_header in sys/param.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------- ## +## Report this to the xotclexpat lists. ## +## ------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + # Let the user call this, because if it triggers, they will + # need a compat/strtod.c that is correct. Users can also + # use Tcl_GetDouble(FromObj) instead. + #TEA_BUGGY_STRTOD + fi + + +#-------------------------------------------------------------------- +# Load the xotclConfig.sh file +#-------------------------------------------------------------------- + +{ echo "$as_me:$LINENO: Reading file ${with_xotcl}/xotclConfig.sh" >&5 +echo "$as_me: Reading file ${with_xotcl}/xotclConfig.sh" >&6;} +source ${with_xotcl}/xotclConfig.sh + +#----------------------------------------------------------------------- +# __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. +#----------------------------------------------------------------------- + +if test "${TEA_PLATFORM}" = "windows" ; then + + vars="xmltok.c win32filemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c" + for i in $vars; do + case $i in + \$*) + # allow $-var names + PKG_SOURCES="$PKG_SOURCES $i" + PKG_OBJECTS="$PKG_OBJECTS $i" + ;; + *) + # check for existence - allows for generic/win/unix VPATH + # To add more dirs here (like 'src'), you have to update VPATH + # in Makefile.in as well + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 +echo "$as_me: error: could not find source file '$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_SOURCES="$PKG_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" + fi + PKG_OBJECTS="$PKG_OBJECTS $j" + ;; + esac + done + + + +else + + vars="xmltok.c unixfilemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c" + for i in $vars; do + case $i in + \$*) + # allow $-var names + PKG_SOURCES="$PKG_SOURCES $i" + PKG_OBJECTS="$PKG_OBJECTS $i" + ;; + *) + # check for existence - allows for generic/win/unix VPATH + # To add more dirs here (like 'src'), you have to update VPATH + # in Makefile.in as well + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 +echo "$as_me: error: could not find source file '$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_SOURCES="$PKG_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" + fi + PKG_OBJECTS="$PKG_OBJECTS $j" + ;; + esac + done + + + +fi + + + vars="" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 +echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_HEADERS="$PKG_HEADERS $i" + done + + + + vars="-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC}" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + + + + vars="$XOTCL_BUILD_STUB_LIB_SPEC" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + + PKG_CFLAGS="$PKG_CFLAGS " + + + + vars="" + for i in $vars; do + # check for existence - allows for generic/win/unix VPATH + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 +echo "$as_me: error: could not find stub source file '$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" + fi + PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" + done + + + + + vars="" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 +echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} + { (exit 1); exit 1; }; } + fi + PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" + done + + + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_sample in this case) so +# that we create the export library with the dll. +# +# 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. +# +# TEA_ADD_* any platform specific compiler/build info here. +#-------------------------------------------------------------------- + +if test "${TEA_PLATFORM}" = "windows" ; then + cat >>confdefs.h <<\_ACEOF +#define BUILD_sample 1 +_ACEOF + + CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" + #TEA_ADD_SOURCES([win/winFile.c]) + #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) +else + CLEANFILES="pkgIndex.tcl" + #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 +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking for Tcl public headers" >&5 +echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 + + +# Check whether --with-tclinclude or --without-tclinclude was given. +if test "${with_tclinclude+set}" = set; then + withval="$with_tclinclude" + with_tclinclude=${withval} +fi; + + if test "${ac_cv_c_tclh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + # Use the value from --with-tclinclude, if it was given + + if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + ac_cv_c_tclh=${with_tclinclude} + else + { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 +echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} + { (exit 1); exit 1; }; } + fi + else + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers directory + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tcl is not installed, + # and in that situation, look there before installed locations. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + if test x"${TCL_INCLUDE_SPEC}" != x ; then + d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` + list="$list `ls -d ${d} 2>/dev/null`" + fi + fi + for i in $list ; do + if test -f "$i/tcl.h" ; then + ac_cv_c_tclh=$i + break + fi + done + fi + +fi + + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tclh}" = x ; then + { { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 +echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} + { (exit 1); exit 1; }; } + else + echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 +echo "${ECHO_T}${ac_cv_c_tclh}" >&6 + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` + + TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + + +#TEA_PRIVATE_TCL_HEADERS + +#TEA_PUBLIC_TK_HEADERS +#TEA_PRIVATE_TK_HEADERS +#TEA_PATH_X + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +#-------------------------------------------------------------------- + + + # Check whether --enable-threads or --disable-threads was given. +if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + + if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then + TCL_THREADS=1 + + if test "${TEA_PLATFORM}" != "windows" ; then + # We are always OK on Windows, so check what this platform wants: + + # USE_THREAD_ALLOC tells us to try the special thread-based + # allocator that significantly reduces lock contention + +cat >>confdefs.h <<\_ACEOF +#define USE_THREAD_ALLOC 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + if test "`uname -s`" = "SunOS" ; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + fi + +cat >>confdefs.h <<\_ACEOF +#define _THREAD_SAFE 1 +_ACEOF + + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 +if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 +echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char __pthread_mutex_init (); +int +main () +{ +__pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread___pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread___pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 +if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 +if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthreads $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthreads_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthreads_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 +if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 +if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_c_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 +if test $ac_cv_lib_c_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "no"; then + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 +if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init (); +int +main () +{ +pthread_mutex_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_c_r_pthread_mutex_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_r_pthread_mutex_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 +if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -pthread" + else + TCL_THREADS=0 + { echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 +echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} + fi + fi + fi + fi + fi + else + TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + echo "$as_me:$LINENO: checking for building with threads" >&5 +echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 + if test "${TCL_THREADS}" = 1; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_THREADS 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes (default)" >&5 +echo "${ECHO_T}yes (default)" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + # TCL_THREADS sanity checking. See if our request for building with + # threads is the same as the way Tcl was built. If not, warn the user. + case ${TCL_DEFS} in + *THREADS=1*) + if test "${TCL_THREADS}" = "0"; then + { echo "$as_me:$LINENO: WARNING: + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads." >&5 +echo "$as_me: WARNING: + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads." >&2;} + fi + ;; + *) + if test "${TCL_THREADS}" = "1"; then + { echo "$as_me:$LINENO: WARNING: + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core." >&5 +echo "$as_me: WARNING: + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core." >&2;} + fi + ;; + esac + + + +#-------------------------------------------------------------------- +# The statement below defines a collection of symbols related to +# building as a shared library instead of a static library. +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking how to build libraries" >&5 +echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 + # Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + + if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" ; then + echo "$as_me:$LINENO: result: shared" >&5 +echo "${ECHO_T}shared" >&6 + SHARED_BUILD=1 + else + echo "$as_me:$LINENO: result: static" >&5 +echo "${ECHO_T}static" >&6 + SHARED_BUILD=0 + +cat >>confdefs.h <<\_ACEOF +#define STATIC_BUILD 1 +_ACEOF + + fi + + + +#-------------------------------------------------------------------- +# 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. +#-------------------------------------------------------------------- + + + + + # Step 0.a: Enable 64 bit support? + + echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 +echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 + # Check whether --enable-64bit or --disable-64bit was given. +if test "${enable_64bit+set}" = set; then + enableval="$enable_64bit" + do64bit=$enableval +else + do64bit=no +fi; + echo "$as_me:$LINENO: result: $do64bit" >&5 +echo "${ECHO_T}$do64bit" >&6 + + # Step 0.b: Enable Solaris 64 bit VIS support? + + echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 +echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 + # Check whether --enable-64bit-vis or --disable-64bit-vis was given. +if test "${enable_64bit_vis+set}" = set; then + enableval="$enable_64bit_vis" + do64bitVIS=$enableval +else + do64bitVIS=no +fi; + echo "$as_me:$LINENO: result: $do64bitVIS" >&5 +echo "${ECHO_T}$do64bitVIS" >&6 + + if test "$do64bitVIS" = "yes"; then + # Force 64bit on with VIS + do64bit=yes + fi + + # Step 0.c: Cross-compiling options for Windows/CE builds? + + if test "${TEA_PLATFORM}" = "windows" ; then + echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 +echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 + # Check whether --enable-wince or --disable-wince was given. +if test "${enable_wince+set}" = set; then + enableval="$enable_wince" + doWince=$enableval +else + doWince=no +fi; + echo "$as_me:$LINENO: result: $doWince" >&5 +echo "${ECHO_T}$doWince" >&6 + fi + + # Step 1: set the variable "system" to hold the name and version number + # for the system. + + + echo "$as_me:$LINENO: checking system version" >&5 +echo $ECHO_N "checking system version... $ECHO_C" >&6 +if test "${tcl_cv_sys_version+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "${TEA_PLATFORM}" = "windows" ; then + tcl_cv_sys_version=windows + elif test -f /usr/lib/NextStep/software_version; then + tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + tcl_cv_sys_version=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 +echo "$as_me: WARNING: can't find uname command" >&2;} + tcl_cv_sys_version=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi + fi + fi + +fi +echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 +echo "${ECHO_T}$tcl_cv_sys_version" >&6 + system=$tcl_cv_sys_version + + + # Step 2: check for existence of -ldl library. This is needed because + # Linux can use either -ldl or -ldld for dynamic loading. + + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main () +{ +dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then + have_dl=yes +else + have_dl=no +fi + + + # Require ranlib early so we can override it in special cases below. + + + + # Step 3: set configuration options based on system name and version. + # This is similar to Tcl's unix/tcl.m4 except that we've added a + # "windows" case. + + do64bit_ok=no + LDFLAGS_ORIG="$LDFLAGS" + # When ld needs options to work in 64-bit mode, put them in + # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] + # is disabled by the user. [Bug 1016796] + LDFLAGS_ARCH="" + TCL_EXPORT_FILE_SUFFIX="" + UNSHARED_LIB_SUFFIX="" + TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' + ECHO_VERSION='`echo ${PACKAGE_VERSION}`' + TCL_LIB_VERSIONS_OK=ok + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE=-O + if test "$GCC" = "yes" ; then + CFLAGS_OPTIMIZE=-O2 + CFLAGS_WARNING="-Wall -Wno-implicit-int" + else + CFLAGS_WARNING="" + fi + TCL_NEEDS_EXP_FILE=0 + TCL_BUILD_EXP_FILE="" + TCL_EXP_FILE="" + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STLIB_LD='${AR} cr' + LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" + case $system in + windows) + # This is a 2-stage check to make sure we have the 64-bit SDK + # We have to know where the SDK is installed. + # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs + # MACHINE is IX86 for LINK, but this is used by the manifest, + # which requires x86|amd64|ia64. + MACHINE="X86" + if test "$do64bit" != "no" ; then + if test "x${MSSDK}x" = "xx" ; then + MSSDK="C:/Progra~1/Microsoft Platform SDK" + fi + MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` + PATH64="" + case "$do64bit" in + amd64|x64|yes) + MACHINE="AMD64" ; # default to AMD64 64-bit build + PATH64="${MSSDK}/Bin/Win64/x86/AMD64" + ;; + ia64) + MACHINE="IA64" + PATH64="${MSSDK}/Bin/Win64" + ;; + esac + if test ! -d "${PATH64}" ; then + { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 +echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} + { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 +echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} + do64bit="no" + else + echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 +echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 + do64bit_ok="yes" + fi + fi + + if test "$doWince" != "no" ; then + if test "$do64bit" != "no" ; then + { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 +echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} + { (exit 1); exit 1; }; } + fi + if test "$GCC" = "yes" ; then + { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 +echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} + { (exit 1); exit 1; }; } + fi + + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-celib + + if test x"${no_celib}" = x ; then + # we reset no_celib in case something fails here + no_celib=true + +# Check whether --with-celib or --without-celib was given. +if test "${with_celib+set}" = set; then + withval="$with_celib" + with_celibconfig=${withval} +fi; + echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 +echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 + if test "${ac_cv_c_celibconfig+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + # First check to see if --with-celibconfig was specified. + if test x"${with_celibconfig}" != x ; then + if test -d "${with_celibconfig}/inc" ; then + ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` + else + { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 +echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + # then check for a celib library + if test x"${ac_cv_c_celibconfig}" = x ; then + for i in \ + ../celib-palm-3.0 \ + ../celib \ + ../../celib-palm-3.0 \ + ../../celib \ + `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ + ${srcdir}/../celib-palm-3.0 \ + ${srcdir}/../celib \ + `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ + ; do + if test -d "$i/inc" ; then + ac_cv_c_celibconfig=`(cd $i; pwd)` + break + fi + done + fi + +fi + + if test x"${ac_cv_c_celibconfig}" = x ; then + { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 +echo "$as_me: error: Cannot find celib support library directory" >&2;} + { (exit 1); exit 1; }; } + else + no_celib= + CELIB_DIR=${ac_cv_c_celibconfig} + CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` + echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 +echo "${ECHO_T}found $CELIB_DIR" >&6 + fi + fi + + # Set defaults for common evc4/PPC2003 setup + # Currently Tcl requires 300+, possibly 420+ for sockets + CEVERSION=420; # could be 211 300 301 400 420 ... + TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... + ARCH=ARM; # could be ARM MIPS X86EM ... + PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" + if test "$doWince" != "yes"; then + # If !yes then the user specified something + # Reset ARCH to allow user to skip specifying it + ARCH= + eval `echo $doWince | awk -F, '{ \ + if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ + if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ + if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ + if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ + if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ + }'` + if test "x${ARCH}" = "x" ; then + ARCH=$TARGETCPU; + fi + fi + OSVERSION=WCE$CEVERSION; + if test "x${WCEROOT}" = "x" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" + if test ! -d "${WCEROOT}" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded Tools" + fi + fi + if test "x${SDKROOT}" = "x" ; then + SDKROOT="C:/Program Files/Windows CE Tools" + if test ! -d "${SDKROOT}" ; then + SDKROOT="C:/Windows CE Tools" + fi + fi + WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` + SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` + if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ + -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then + { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 +echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} + { (exit 1); exit 1; }; } + doWince="no" + else + # We could PATH_NOSPACE these, but that's not important, + # as long as we quote them when used. + CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" + if test -d "${CEINCLUDE}/${TARGETCPU}" ; then + CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" + fi + CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" + fi + fi + + if test "$GCC" != "yes" ; then + if test "${SHARED_BUILD}" = "0" ; then + runtime=-MT + else + runtime=-MD + fi + + if test "$do64bit" != "no" ; then + # All this magic is necessary for the Win64 SDK RC1 - hobbs + CC="\"${PATH64}/cl.exe\"" + CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" + RC="\"${MSSDK}/bin/rc.exe\"" + lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + LINKBIN="\"${PATH64}/link.exe\"" + CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + # Avoid 'unresolved external symbol __security_cookie' + # errors, c.f. http://support.microsoft.com/?id=894573 + + vars="bufferoverflowU.lib" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + + + elif test "$doWince" != "no" ; then + CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" + if test "${TARGETCPU}" = "X86"; then + CC="\"${CEBINROOT}/cl.exe\"" + else + CC="\"${CEBINROOT}/cl${ARCH}.exe\"" + fi + CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" + RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" + arch=`echo ${ARCH} | awk '{print tolower($0)}'` + defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" + if test "${SHARED_BUILD}" = "1" ; then + # Static CE builds require static celib as well + defs="${defs} _DLL" + fi + for i in $defs ; do + +cat >>confdefs.h <<_ACEOF +#define $i 1 +_ACEOF + + done + +cat >>confdefs.h <<_ACEOF +#define _WIN32_WCE $CEVERSION +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define UNDER_CE $CEVERSION +_ACEOF + + CFLAGS_DEBUG="-nologo -Zi -Od" + CFLAGS_OPTIMIZE="-nologo -Ox" + lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` + lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" + LINKBIN="\"${CEBINROOT}/link.exe\"" + + else + RC="rc" + lflags="-nologo" + LINKBIN="link" + CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + fi + fi + + if test "$GCC" = "yes"; then + # mingw gcc mode + RC="windres" + CFLAGS_DEBUG="-g" + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + SHLIB_LD="$CC -shared" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" + LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" + else + SHLIB_LD="${LINKBIN} -dll ${lflags}" + # link -lib only works when -lib is the first arg + STLIB_LD="${LINKBIN} -lib ${lflags}" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' + PATHTYPE=-w + # For information on what debugtype is most useful, see: + # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp + # This essentially turns it all on. + LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" + LDFLAGS_OPTIMIZE="-release" + if test "$doWince" != "no" ; then + LDFLAGS_CONSOLE="-link ${lflags}" + LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} + else + LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" + LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" + fi + fi + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dll" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' + + TCL_LIB_VERSIONS_OK=nodots + # Bogus to avoid getting this turned off + DL_OBJS="tclLoadNone.obj" + ;; + AIX-*) + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then + # AIX requires the _r compiler when gcc isn't being used + case "${CC}" in + *_r) + # ok ... + ;; + *) + CC=${CC}_r + ;; + esac + echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 +echo "${ECHO_T}Using $CC for compiling with threads" >&6 + fi + LIBS="$LIBS -lc" + SHLIB_CFLAGS="" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + DL_OBJS="tclLoadDl.o" + LD_LIBRARY_PATH_VAR="LIBPATH" + + # Check to enable 64-bit flags for compiler/linker on AIX 4+ + if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then + if test "$GCC" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + else + do64bit_ok=yes + CFLAGS="$CFLAGS -q64" + LDFLAGS_ARCH="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + else + SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' + fi + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then + case $LIBOBJS in + "tclLoadAix.$ac_objext" | \ + *" tclLoadAix.$ac_objext" | \ + "tclLoadAix.$ac_objext "* | \ + *" tclLoadAix.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; +esac + + DL_LIBS="-lld" + fi + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 +echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gettimeofday (); +int +main () +{ +gettimeofday (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bsd_gettimeofday=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bsd_gettimeofday=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 +if test $ac_cv_lib_bsd_gettimeofday = yes; then + libbsd=yes +else + libbsd=no +fi + + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + +cat >>confdefs.h <<\_ACEOF +#define USE_DELTA_FOR_TZ 1 +_ACEOF + + fi + ;; + BeOS*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="${CC} -nostart" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + + #----------------------------------------------------------- + # Check for inet_ntoa in -lbind, for BeOS (which also needs + # -lsocket, even if the network functions are in -lnet which + # is always linked to, for compatibility. + #----------------------------------------------------------- + echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 +echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 +if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbind $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inet_ntoa (); +int +main () +{ +inet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bind_inet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bind_inet_ntoa=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 +if test $ac_cv_lib_bind_inet_ntoa = yes; then + LIBS="$LIBS -lbind -lsocket" +fi + + ;; + BSD/OS-2.1*|BSD/OS-3*) + SHLIB_CFLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD="cc -shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + HP-UX-*.11.*) + # Use updated header definitions where possible + +cat >>confdefs.h <<\_ACEOF +#define _XOPEN_SOURCE_EXTENDED 1 +_ACEOF + + # Needed by Tcl, but not most extensions + #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) + #LIBS="$LIBS -lxnet" # Use the XOPEN network library + + if test "`uname -m`" = "ia64" ; then + SHLIB_SUFFIX=".so" + # Use newer C++ library for C++ extensions + #if test "$GCC" != "yes" ; then + # CPPFLAGS="-AA" + #fi + else + SHLIB_SUFFIX=".sl" + fi + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + SHLIB_LD_LIBS='${LIBS}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc + #CFLAGS="$CFLAGS +DAportable" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + hpux_arch=`${CC} -dumpmachine` + case $hpux_arch in + hppa64*) + # 64-bit gcc in use. Fix flags for GNU ld. + do64bit_ok=yes + SHLIB_LD="${CC} -shared" + SHLIB_LD_LIBS='${LIBS}' + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + *) + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + ;; + esac + else + do64bit_ok=yes + CFLAGS="$CFLAGS +DD64" + LDFLAGS_ARCH="+DD64" + fi + fi + ;; + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + SHLIB_SUFFIX=".sl" + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main () +{ +shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + tcl_ok=yes +else + tcl_ok=no +fi + + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + ;; + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + ;; + IRIX-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mabi=n32" + LDFLAGS="$LDFLAGS -mabi=n32" + else + case $system in + IRIX-6.3) + # Use to build 6.2 compatible binaries on 6.3. + CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" + ;; + *) + CFLAGS="$CFLAGS -n32" + ;; + esac + LDFLAGS="$LDFLAGS -n32" + fi + ;; + IRIX64-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + + # Check to enable 64-bit flags for compiler/linker + + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 +echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} + else + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS_ARCH="-64" + fi + fi + ;; + Linux*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings + # when you inline the string and math operations. Turn this off to + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + if test $do64bit = yes; then + echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_m64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_m64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_m64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 +echo "${ECHO_T}$tcl_cv_cc_m64" >&6 + if test $tcl_cv_cc_m64 = yes; then + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + fi + fi + + # The combo of gcc + glibc has a bug related + # to inlining of functions like strtod(). The + # -fno-builtin flag should address this problem + # but it does not work. The -fno-inline flag + # is kind of overkill but it works. + # Disable inlining only when one of the + # files in compat/*.c is being linked in. + if test x"${USE_COMPAT}" != x ; then + CFLAGS="$CFLAGS -fno-inline" + fi + + ;; + GNU*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + SHLIB_LD="${CC} -shared" + DL_OBJS="" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + ;; + Lynx*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + CFLAGS_OPTIMIZE=-02 + SHLIB_LD="${CC} -shared " + DL_OBJS="tclLoadDl.o" + DL_LIBS="-mshared -ldl" + LD_FLAGS="-Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + ;; + MP-RAS-02*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + MP-RAS-*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,-Bexport" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + NetBSD-*|FreeBSD-[1-2].*) + # NetBSD/SPARC needs -fPIC, -fpic will not do. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + echo "$as_me:$LINENO: checking for ELF" >&5 +echo $ECHO_N "checking for ELF... $ECHO_C" >&6 +if test "${tcl_cv_ld_elf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef __ELF__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + tcl_cv_ld_elf=yes +else + tcl_cv_ld_elf=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 +echo "${ECHO_T}$tcl_cv_ld_elf" >&6 + if test $tcl_cv_ld_elf = yes; then + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + else + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + fi + + # Ancient FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + OpenBSD-*) + # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. + case `machine` in + sparc|sparc64) + SHLIB_CFLAGS="-fPIC";; + *) + SHLIB_CFLAGS="-fpic";; + esac + SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + echo "$as_me:$LINENO: checking for ELF" >&5 +echo $ECHO_N "checking for ELF... $ECHO_C" >&6 +if test "${tcl_cv_ld_elf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef __ELF__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + tcl_cv_ld_elf=yes +else + tcl_cv_ld_elf=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 +echo "${ECHO_T}$tcl_cv_ld_elf" >&6 + if test $tcl_cv_ld_elf = yes; then + LDFLAGS=-Wl,-export-dynamic + else + LDFLAGS="" + fi + + # OpenBSD doesn't do version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "${TCL_THREADS}" = "1" ; then + # The -pthread needs to go in the CFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + case $system in + FreeBSD-3.*) + # FreeBSD-3 doesn't handle version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + TCL_LIB_VERSIONS_OK=nodots + ;; + esac + ;; + Darwin-*) + CFLAGS_OPTIMIZE="-Os" + SHLIB_CFLAGS="-fno-common" + # To avoid discrepancies between what headers configure sees during + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: + CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" + if test $do64bit = yes; then + case `arch` in + ppc) + echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_ppc64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_arch_ppc64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_ppc64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 + if test $tcl_cv_cc_arch_ppc64 = yes; then + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + do64bit_ok=yes + fi;; + i386) + echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_x86_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch x86_64" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_arch_x86_64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_x86_64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 + if test $tcl_cv_cc_arch_x86_64 = yes; then + CFLAGS="$CFLAGS -arch x86_64" + do64bit_ok=yes + fi;; + *) + { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 +echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; + esac + else + # Check for combined 32-bit and 64-bit fat build + echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ + echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ + fat_32_64=yes + fi + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' + echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 +echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_single_module+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_single_module=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_single_module=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 +echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 + if test $tcl_cv_ld_single_module = yes; then + SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + fi + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" + DL_LIBS="" + # Don't use -prebind when building for Mac OS X 10.4 or later only: + test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \ + LDFLAGS="$LDFLAGS -prebind" + LDFLAGS="$LDFLAGS -headerpad_max_install_names" + echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 +echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_search_paths_first+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_search_paths_first=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_search_paths_first=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 +echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 + if test $tcl_cv_ld_search_paths_first = yes; then + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + + # TEA specific: for Tk extensions, remove 64-bit arch flags from + # CFLAGS et al. for combined 32 & 64 bit fat builds as neither + # TkAqua nor TkX11 can be built for 64-bit at present. + test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done + ;; + NEXTSTEP-*) + SHLIB_CFLAGS="" + SHLIB_LD="cc -nostdlib -r" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadNext.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OS/390-*) + CFLAGS_OPTIMIZE="" # Optimizer is buggy + +cat >>confdefs.h <<\_ACEOF +#define _OE_SOCKETS 1 +_ACEOF + + ;; + OSF1-1.0|OSF1-1.1|OSF1-1.2) + # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + SHLIB_CFLAGS="" + # Hack: make package name same as library name + SHLIB_LD='ld -R -export :' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadOSF.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-1.*) + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SHLIB_CFLAGS="-fPIC" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD="ld -shared" + else + SHLIB_LD="ld -non_shared" + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-V*) + # Digital OSF/1 + SHLIB_CFLAGS="" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD='ld -shared -expect_unresolved "*"' + else + SHLIB_LD='ld -non_shared -expect_unresolved "*"' + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mieee" + else + CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" + fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = "1" ; then + CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" + CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + LIBS=`echo $LIBS | sed s/-lpthreads//` + if test "$GCC" = "yes" ; then + LIBS="$LIBS -lpthread -lmach -lexc" + else + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + fi + + ;; + QNX-6*) + # QNX RTP + # This may work for all QNX, but it was only reported for v6. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + # dlopen is in -lc on QNX + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SCO_SV-3.2*) + # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # this test works, since "uname -s" was non-standard in 3.2.4 and + # below. + if test "$GCC" = "yes" ; then + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + else + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + fi + SHLIB_LD="ld -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SINIX*5.4*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SunOS-4*) + SHLIB_CFLAGS="-PIC" + SHLIB_LD="ld" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + + # SunOS can't handle version numbers with dots in them in library + # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it + # requires an extra version number at the end of .so file names. + # So, the library has to have a name like libtcl75.so.1.0 + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + SunOS-5.[0-6]) + # Careful to not let 5.10+ fall into this case + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + + SHLIB_CFLAGS="-KPIC" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + ;; + SunOS-5*) + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + + SHLIB_CFLAGS="-KPIC" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + arch=`isainfo` + if test "$arch" = "sparcv9 sparc" ; then + if test "$GCC" = "yes" ; then + if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} + else + do64bit_ok=yes + CFLAGS="$CFLAGS -m64 -mcpu=v9" + LDFLAGS="$LDFLAGS -m64 -mcpu=v9" + SHLIB_CFLAGS="-fPIC" + fi + else + do64bit_ok=yes + if test "$do64bitVIS" = "yes" ; then + CFLAGS="$CFLAGS -xarch=v9a" + LDFLAGS_ARCH="-xarch=v9a" + else + CFLAGS="$CFLAGS -xarch=v9" + LDFLAGS_ARCH="-xarch=v9" + fi + # Solaris 64 uses this as well + #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" + fi + elif test "$arch" = "amd64 i386" ; then + if test "$GCC" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + else + do64bit_ok=yes + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64" + fi + else + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 +echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} + fi + fi + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "$do64bit_ok" = "yes" ; then + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + fi + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + fi + ;; + UNIX_SV* | UnixWare-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 +echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_Bexport+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-Bexport" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_ld_Bexport=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_Bexport=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$hold_ldflags +fi +echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 +echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 + if test $tcl_cv_ld_Bexport = yes; then + LDFLAGS="$LDFLAGS -Wl,-Bexport" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + esac + + if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then + { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 +echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} + fi + + + + # Step 4: disable dynamic loading if requested via a command-line switch. + + # Check whether --enable-load or --disable-load was given. +if test "${enable_load+set}" = set; then + enableval="$enable_load" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + if test "$tcl_ok" = "no"; then + DL_OBJS="" + fi + + if test "x$DL_OBJS" != "x" ; then + BUILD_DLTEST="\$(DLTEST_TARGETS)" + else + echo "Can't figure out how to do dynamic loading or shared libraries" + echo "on this system." + SHLIB_CFLAGS="" + SHLIB_LD="" + SHLIB_SUFFIX="" + DL_OBJS="tclLoadNone.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS_ORIG" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + BUILD_DLTEST="" + fi + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" + + # If we're running gcc, then change the C flags for compiling shared + # libraries to the right flags for gcc, instead of those for the + # standard manufacturer compiler. + + if test "$DL_OBJS" != "tclLoadNone.o" ; then + if test "$GCC" = "yes" ; then + case $system in + AIX-*) + ;; + BSD/OS*) + ;; + IRIX*) + ;; + NetBSD-*|FreeBSD-*) + ;; + Darwin-*) + ;; + SCO_SV-3.2*) + ;; + windows) + ;; + *) + SHLIB_CFLAGS="-fPIC" + ;; + esac + fi + fi + + if test "$SHARED_LIB_SUFFIX" = "" ; then + SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' + fi + if test "$UNSHARED_LIB_SUFFIX" = "" ; then + UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' + fi + + + + + + + + + + + + + + + + # These must be called after we do the basic CFLAGS checks and + # verify any possible 64-bit or similar switches are necessary + + echo "$as_me:$LINENO: checking for required early compiler flags" >&5 +echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 + tcl_flags="" + + if test "${tcl_cv_flag__isoc99_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *)strtoll; char *q = (char *)strtoull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__isoc99_source=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _ISOC99_SOURCE 1 +#include +int +main () +{ +char *p = (char *)strtoll; char *q = (char *)strtoull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__isoc99_source=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__isoc99_source=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _ISOC99_SOURCE 1 +_ACEOF + + tcl_flags="$tcl_flags _ISOC99_SOURCE" + fi + + + if test "${tcl_cv_flag__largefile64_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile64_source=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE64_SOURCE 1 +#include +int +main () +{ +struct stat64 buf; int i = stat64("/", &buf); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile64_source=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__largefile64_source=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _LARGEFILE64_SOURCE 1 +_ACEOF + + tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" + fi + + + if test "${tcl_cv_flag__largefile_source64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *)open64; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile_source64=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE64 1 +#include +int +main () +{ +char *p = (char *)open64; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__largefile_source64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__largefile_source64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _LARGEFILE_SOURCE64 1 +_ACEOF + + tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" + fi + + if test "x${tcl_flags}" = "x" ; then + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 + else + echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 +echo "${ECHO_T}${tcl_flags}" >&6 + fi + + + echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 +echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 + if test "${tcl_cv_type_64bit+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +__int64 value = (__int64) 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_type_64bit=__int64 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_type_64bit="long long" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +switch (0) { + case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; + } + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_type_64bit=${tcl_type_64bit} +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "${tcl_cv_type_64bit}" = none ; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_WIDE_INT_IS_LONG 1 +_ACEOF + + echo "$as_me:$LINENO: result: using long" >&5 +echo "${ECHO_T}using long" >&6 + elif test "${tcl_cv_type_64bit}" = "__int64" \ + -a "${TEA_PLATFORM}" = "windows" ; then + # We actually want to use the default tcl.h checks in this + # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* + echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 +echo "${ECHO_T}using Tcl header defaults" >&6 + else + +cat >>confdefs.h <<_ACEOF +#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} +_ACEOF + + echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 +echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 + + # Now check for auxiliary declarations + echo "$as_me:$LINENO: checking for struct dirent64" >&5 +echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 +if test "${tcl_cv_struct_dirent64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +struct dirent64 p; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_struct_dirent64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_struct_dirent64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 +echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_DIRENT64 1 +_ACEOF + + fi + + echo "$as_me:$LINENO: checking for struct stat64" >&5 +echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 +if test "${tcl_cv_struct_stat64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +struct stat64 p; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_struct_stat64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_struct_stat64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 +echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_STAT64 1 +_ACEOF + + fi + + + +for ac_func in open64 lseek64 +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + echo "$as_me:$LINENO: checking for off64_t" >&5 +echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 + if test "${tcl_cv_type_off64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +off64_t offset; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_type_off64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_type_off64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test "x${tcl_cv_type_off64_t}" = "xyes" && \ + test "x${ac_cv_func_lseek64}" = "xyes" && \ + test "x${ac_cv_func_open64}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_TYPE_OFF64_T 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + fi + + + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols option. +#-------------------------------------------------------------------- + + + + echo "$as_me:$LINENO: checking for build with symbols" >&5 +echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 + # Check whether --enable-symbols or --disable-symbols was given. +if test "${enable_symbols+set}" = set; then + enableval="$enable_symbols" + tcl_ok=$enableval +else + tcl_ok=no +fi; + DBGX="" + if test "$tcl_ok" = "no"; then + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + else + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" + if test "$tcl_ok" = "yes"; then + echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 +echo "${ECHO_T}yes (standard debugging)" >&6 + fi + fi + if test "${TEA_PLATFORM}" != "windows" ; then + LDFLAGS_DEFAULT="${LDFLAGS}" + fi + + + + + + if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_MEM_DEBUG 1 +_ACEOF + + fi + + if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then + if test "$tcl_ok" = "all"; then + echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 +echo "${ECHO_T}enabled symbols mem debugging" >&6 + else + echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 +echo "${ECHO_T}enabled $tcl_ok debugging" >&6 + fi + 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. Add Tk too if necessary. +#-------------------------------------------------------------------- + +cat >>confdefs.h <<\_ACEOF +#define USE_TCL_STUBS 1 +_ACEOF + +#AC_DEFINE(USE_TK_STUBS) + +#-------------------------------------------------------------------- +# 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. +#-------------------------------------------------------------------- + + + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then + MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" + MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" + else + MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" + MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" + fi + + if test "${SHARED_BUILD}" = "1" ; then + MAKE_LIB="${MAKE_SHARED_LIB} " + else + MAKE_LIB="${MAKE_STATIC_LIB} " + fi + + #-------------------------------------------------------------------- + # Shared libraries and static libraries have different names. + # Use the double eval to make sure any variables in the suffix is + # substituted. (@@@ Might not be necessary anymore) + #-------------------------------------------------------------------- + + if test "${TEA_PLATFORM}" = "windows" ; then + if test "${SHARED_BUILD}" = "1" ; then + # We force the unresolved linking of symbols that are really in + # the private libraries of Tcl and Tk. + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" + fi + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + else + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + if test "$GCC" = "yes"; then + PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} + fi + # These aren't needed on Windows (either MSVC or gcc) + RANLIB=: + RANLIB_STUB=: + else + RANLIB_STUB="${RANLIB}" + if test "${SHARED_BUILD}" = "1" ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" + fi + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + fi + + # These are escaped so that only CFLAGS is picked up at configure time. + # The other values will be substituted at make time. + CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" + if test "${SHARED_BUILD}" = "1" ; then + CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" + fi + + + + + + + + +#-------------------------------------------------------------------- +# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl +# file during the install process. Don't run the TCLSH_PROG through +# ${CYGPATH} because it's being used directly by make. +# Require that we use a tclsh shell version 8.2 or later since earlier +# versions have bugs in the pkg_mkIndex routine. +# Add WISH as well if this is a Tk extension. +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking for tclsh" >&5 +echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 + if test -f "${TCL_BIN_DIR}/Makefile" ; then + # tclConfig.sh is in Tcl build directory + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="${TCL_BIN_DIR}/tclsh" + fi + else + # tclConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" + fi + list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${TCLSH_PROG}" ; then + REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" + fi + echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 +echo "${ECHO_T}${TCLSH_PROG}" >&6 + + +#TEA_PROG_WISH + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile. +# You may alternatively have a special pkgIndex.tcl.in or other files +# which require substituting th AC variables in. Include these here. +#-------------------------------------------------------------------- + + ac_config_files="$ac_config_files Makefile" +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by xotclexpat $as_me 0.9, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +xotclexpat config.status 0.9 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@CYGPATH@,$CYGPATH,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t +s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t +s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t +s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t +s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t +s,@PKG_HEADERS@,$PKG_HEADERS,;t t +s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t +s,@PKG_LIBS@,$PKG_LIBS,;t t +s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t +s,@TCL_VERSION@,$TCL_VERSION,;t t +s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t +s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t +s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t +s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t +s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t +s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t +s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t +s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t +s,@TCL_LIBS@,$TCL_LIBS,;t t +s,@TCL_DEFS@,$TCL_DEFS,;t t +s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t +s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t +s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@EGREP@,$EGREP,;t t +s,@MATH_LIBS@,$MATH_LIBS,;t t +s,@PKG_SOURCES@,$PKG_SOURCES,;t t +s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t +s,@CLEANFILES@,$CLEANFILES,;t t +s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t +s,@TCL_THREADS@,$TCL_THREADS,;t t +s,@SHARED_BUILD@,$SHARED_BUILD,;t t +s,@AR@,$AR,;t t +s,@CELIB_DIR@,$CELIB_DIR,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@DL_LIBS@,$DL_LIBS,;t t +s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t +s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t +s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t +s,@STLIB_LD@,$STLIB_LD,;t t +s,@SHLIB_LD@,$SHLIB_LD,;t t +s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t +s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t +s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t +s,@TCL_DBGX@,$TCL_DBGX,;t t +s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t +s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t +s,@MAKE_LIB@,$MAKE_LIB,;t t +s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t +s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t +s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t +s,@RANLIB_STUB@,$RANLIB_STUB,;t t +s,@TCLSH_PROG@,$TCLSH_PROG,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: library/xml/TclExpat-1.1/configure.in =================================================================== diff -u -N --- library/xml/TclExpat-1.1/configure.in (revision 0) +++ library/xml/TclExpat-1.1/configure.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,249 @@ +#!/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. +# +# RCS: @(#) $Id: configure.in,v 1.20 2007/10/12 19:53:32 neumann Exp $ + +#----------------------------------------------------------------------- +# Sample configure.in for Tcl Extensions. The only places you should +# need to modify this file are marked by the string __CHANGE__ +#----------------------------------------------------------------------- + +configdir=$(srcdir)/../../../config + +#----------------------------------------------------------------------- +# __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. +#----------------------------------------------------------------------- + +AC_INIT([xotclexpat], [0.9]) + +#-------------------------------------------------------------------- +# 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([3.5]) + +AC_CONFIG_AUX_DIR(../../../config) + +#-------------------------------------------------------------------- +# specify some extra flags +#-------------------------------------------------------------------- + +AC_ARG_WITH(xotcl, + [ --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH + absolute path to xotclConfig.sh, + --without-xotcl disables, but this is pointless], + [with_xotcl=$withval], [AC_MSG_ERROR([--with-xotcl is required])]) + +#-------------------------------------------------------------------- +# 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 + +#----------------------------------------------------------------------- +# 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, AC_PROG_INSTALL and a few others to create +# the basic setup necessary to compile executables. +#----------------------------------------------------------------------- + +TEA_SETUP_COMPILER + +#-------------------------------------------------------------------- +# Load the xotclConfig.sh file +#-------------------------------------------------------------------- + +AC_MSG_NOTICE([Reading file ${with_xotcl}/xotclConfig.sh]) +source ${with_xotcl}/xotclConfig.sh + +#----------------------------------------------------------------------- +# __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. +#----------------------------------------------------------------------- + +if test "${TEA_PLATFORM}" = "windows" ; then + TEA_ADD_SOURCES([xmltok.c win32filemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c]) +else + TEA_ADD_SOURCES([xmltok.c unixfilemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c]) +fi + +TEA_ADD_HEADERS([]) +TEA_ADD_INCLUDES([-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC}]) +TEA_ADD_LIBS([$XOTCL_BUILD_STUB_LIB_SPEC]) +TEA_ADD_CFLAGS([]) +TEA_ADD_STUB_SOURCES([]) +TEA_ADD_TCL_SOURCES([]) + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_sample in this case) so +# that we create the export library with the dll. +# +# 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. +# +# TEA_ADD_* any platform specific compiler/build info here. +#-------------------------------------------------------------------- + +if test "${TEA_PLATFORM}" = "windows" ; then + AC_DEFINE(BUILD_sample) + CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" + #TEA_ADD_SOURCES([win/winFile.c]) + #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) +else + CLEANFILES="pkgIndex.tcl" + #TEA_ADD_SOURCES([unix/unixFile.c]) + #TEA_ADD_LIBS([-lsuperfly]) +fi +AC_SUBST(CLEANFILES) + +#-------------------------------------------------------------------- +# __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 + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +#-------------------------------------------------------------------- + +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 + +#-------------------------------------------------------------------- +# 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. Add Tk too if necessary. +#-------------------------------------------------------------------- + +AC_DEFINE(USE_TCL_STUBS) +#AC_DEFINE(USE_TK_STUBS) + +#-------------------------------------------------------------------- +# 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 + +#-------------------------------------------------------------------- +# 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. +# Add WISH as well if this is a Tk extension. +#-------------------------------------------------------------------- + +TEA_PROG_TCLSH +#TEA_PROG_WISH + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile. +# You may alternatively have a special pkgIndex.tcl.in or other files +# which require substituting th AC variables in. Include these here. +#-------------------------------------------------------------------- + +AC_OUTPUT([Makefile]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: library/xml/TclExpat-1.1/configure.in-ok =================================================================== diff -u -N --- library/xml/TclExpat-1.1/configure.in-ok (revision 0) +++ library/xml/TclExpat-1.1/configure.in-ok (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,312 @@ +#-------------------------------------------------------------------- +# 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(./tclexpat.c) +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=xotclexpat + +# do not modify the following lines manually, they are generated with changeXOTclVersion +XOTCL_MAJOR_VERSION=1 +XOTCL_MINOR_VERSION=2 +XOTCL_RELEASE_LEVEL=.1 + +MAJOR_VERSION=${XOTCL_MAJOR_VERSION} +MINOR_VERSION=${XOTCL_MINOR_VERSION} +PATCHLEVEL=${XOTCL_RELEASE_LEVEL} + +VERSION=${MAJOR_VERSION}.${MINOR_VERSION} +NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION} + +AC_SUBST(PATCHLEVEL) +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" + ;; + *) + CYGPATH=echo + ;; +esac + +AC_SUBST(CYGPATH) + +#-------------------------------------------------------------------- +# __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 before SC_PATH_TCLCONFIG/SC_LOAD_TCLCONFIG +#-------------------------------------------------------------------- + +#SC_PUBLIC_TCL_HEADERS +SC_PRIVATE_TCL_HEADERS + +if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + TCL_INCLUDES="-I${with_tclinclude} ${TCL_INCLUDES}" + else + AC_MSG_ERROR([${with_tclinclude} directory does not contain Tcl header file tcl.h]) + fi +fi + +#-------------------------------------------------------------------- +# Load the tclConfig.sh file +#-------------------------------------------------------------------- + +SC_PATH_TCLCONFIG +SC_LOAD_TCLCONFIG + +#-------------------------------------------------------------------- +# Load the xotclConfig.sh file +#-------------------------------------------------------------------- + +SC_PATH_XOTCLCONFIG +SC_LOAD_XOTCLCONFIG + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_exampleA 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(BUILD_xotclexpat) + CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch vc60.pch" + AC_SUBST(CLEANFILES) + ;; + *) + CLEANFILES= + ;; +esac + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +# So far only Tcl responds to this one. +#-------------------------------------------------------------------- + +SC_ENABLE_THREADS + +#-------------------------------------------------------------------- +# The statement below defines a collection of symbols related to +# building as a shared library instead of a static library. +#-------------------------------------------------------------------- + +SC_ENABLE_SHARED + +#-------------------------------------------------------------------- +# This macro figures out what flags to use with the compiler/linker +# when building shared/static debug/optimized objects. This information +# is all taken from the tclConfig.sh file. +#-------------------------------------------------------------------- + +CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG} +CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE} +LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG} +LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE} +SHLIB_LD=${TCL_SHLIB_LD} +STLIB_LD=${TCL_STLIB_LD} +SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS} + +AC_SUBST(CFLAGS_DEBUG) +AC_SUBST(CFLAGS_OPTIMIZE) +AC_SUBST(STLIB_LD) +AC_SUBST(SHLIB_LD) +AC_SUBST(SHLIB_CFLAGS) +AC_SUBST(SHLIB_LDFLAGS) + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols +# option. +#-------------------------------------------------------------------- + +SC_ENABLE_SYMBOLS + +if test "${SHARED_BUILD}" = "1" ; then + CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' +else + CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}' +fi + +#-------------------------------------------------------------------- +# Everyone should be linking against the Tcl stub library. If you +# can't for some reason, remove this definition. If you aren't using +# stubs, you also need to modify the SHLIB_LD_LIBS setting below to +# link against the non-stubbed Tcl library. +#-------------------------------------------------------------------- + +if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then + echo "Tcl 8.0, no stubs used" + USE_TCL_STUBS="" +else + AC_DEFINE(USE_TCL_STUBS) + AC_DEFINE(USE_XOTCL_STUBS) +fi + +#-------------------------------------------------------------------- +# This macro generates a line to use when building a library. It +# depends on values set by the SC_ENABLE_SHARED, SC_ENABLE_SYMBOLS, +# and SC_LOAD_TCLCONFIG macros above. +#-------------------------------------------------------------------- + +SC_MAKE_LIB + +#-------------------------------------------------------------------- +# eval these two values to dereference the ${DBGX} variable. +#-------------------------------------------------------------------- + +#eval "SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" +#eval "UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" + +SHARED_LIB_SUFFIX=${XOTCL_SHARED_LIB_SUFFIX} +UNSHARED_LIB_SUFFIX=${XOTCL_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}`\" \"`cygpath -w ${XOTCL_BUILD_STUB_LIB_PATH}`\" ${TCL_SHLIB_LD_LIBS}" + eval "${PACKAGE}_LIB_FILE=${PACKAGE}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval "${PACKAGE}_LIB_FILE=${PACKAGE}${UNSHARED_LIB_SUFFIX}" + fi + ;; + *) + if test "${SHARED_BUILD}" = "1" ; then + #SHLIB_LD_LIBS="${TCL_BUILD_STUB_LIB_SPEC} ${XOTCL_BUILD_STUB_LIB_SPEC}" + SHLIB_LD_LIBS="${TCL_STUB_LIB_SPEC} ${XOTCL_BUILD_STUB_LIB_SPEC}" + eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${UNSHARED_LIB_SUFFIX}" + fi + ;; +esac + +#-------------------------------------------------------------------- +# __CHANGE__ +# Change the name from exampeA_LIB_FILE to match your package name. +#-------------------------------------------------------------------- + +AC_SUBST(xotclexpat_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) + + + + + + + + + + Index: library/xml/TclExpat-1.1/dllEntryPoint.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/dllEntryPoint.c (revision 0) +++ library/xml/TclExpat-1.1/dllEntryPoint.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,39 @@ +/* + * dllEntryPoint.c -- + * $Id: dllEntryPoint.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ + * + * This file implements the Dll entry point as needed by Windows. + */ + +#define WIN32_LEAN_AND_MEAN +#include +#if defined(_MSC_VER) +# define DllEntryPoint DllMain +#endif + +/* + *---------------------------------------------------------------------- + * + * DllEntryPoint -- + * + * This wrapper function is used by Windows to invoke the + * initialization code for the DLL. If we are compiling + * with Visual C++, this routine will be renamed to DllMain. + * + * Results: + * Returns TRUE; + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +BOOL APIENTRY +DllEntryPoint(hInst, reason, reserved) + HINSTANCE hInst; /* Library instance handle. */ + DWORD reason; /* Reason this function is being called. */ + LPVOID reserved; /* Not used. */ +{ + return TRUE; +} Index: library/xml/TclExpat-1.1/dllmain.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/dllmain.c (revision 0) +++ library/xml/TclExpat-1.1/dllmain.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,27 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#include + +BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) +{ + return TRUE; +} + Index: library/xml/TclExpat-1.1/filemap.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/filemap.h (revision 0) +++ library/xml/TclExpat-1.1/filemap.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,32 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + + +#include + +#ifdef XML_UNICODE +int filemap(const wchar_t *name, + void (*processor)(const void *, size_t, const wchar_t *, void *arg), + void *arg); +#else +int filemap(const char *name, + void (*processor)(const void *, size_t, const char *, void *arg), + void *arg); +#endif Index: library/xml/TclExpat-1.1/hashtable.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/hashtable.c (revision 0) +++ library/xml/TclExpat-1.1/hashtable.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,134 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +csompliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#include +#include + +#include "xmldef.h" +#include "hashtable.h" + +#ifdef XML_UNICODE +#define keycmp wcscmp +#else +#define keycmp strcmp +#endif + +#define INIT_SIZE 64 + +static +unsigned long hash(KEY s) +{ + unsigned long h = 0; + while (*s) + h = (h << 5) + h + (unsigned char)*s++; + return h; +} + +NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize) +{ + size_t i; + if (table->size == 0) { + if (!createSize) + return 0; + table->v = calloc(INIT_SIZE, sizeof(NAMED *)); + if (!table->v) + return 0; + table->size = INIT_SIZE; + table->usedLim = INIT_SIZE / 2; + i = hash(name) & (table->size - 1); + } + else { + unsigned long h = hash(name); + for (i = h & (table->size - 1); + table->v[i]; + i == 0 ? i = table->size - 1 : --i) { + if (keycmp(name, table->v[i]->name) == 0) + return table->v[i]; + } + if (!createSize) + return 0; + if (table->used == table->usedLim) { + /* check for overflow */ + size_t newSize = table->size * 2; + NAMED **newV = calloc(newSize, sizeof(NAMED *)); + if (!newV) + return 0; + for (i = 0; i < table->size; i++) + if (table->v[i]) { + size_t j; + for (j = hash(table->v[i]->name) & (newSize - 1); + newV[j]; + j == 0 ? j = newSize - 1 : --j) + ; + newV[j] = table->v[i]; + } + free(table->v); + table->v = newV; + table->size = newSize; + table->usedLim = newSize/2; + for (i = h & (table->size - 1); + table->v[i]; + i == 0 ? i = table->size - 1 : --i) + ; + } + } + table->v[i] = calloc(1, createSize); + if (!table->v[i]) + return 0; + table->v[i]->name = name; + (table->used)++; + return table->v[i]; +} + +void hashTableDestroy(HASH_TABLE *table) +{ + size_t i; + for (i = 0; i < table->size; i++) { + NAMED *p = table->v[i]; + if (p) + free(p); + } + free(table->v); +} + +void hashTableInit(HASH_TABLE *p) +{ + p->size = 0; + p->usedLim = 0; + p->used = 0; + p->v = 0; +} + +void hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table) +{ + iter->p = table->v; + iter->end = iter->p + table->size; +} + +NAMED *hashTableIterNext(HASH_TABLE_ITER *iter) +{ + while (iter->p != iter->end) { + NAMED *tem = *(iter->p)++; + if (tem) + return tem; + } + return 0; +} + Index: library/xml/TclExpat-1.1/hashtable.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/hashtable.h (revision 0) +++ library/xml/TclExpat-1.1/hashtable.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,51 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + + +#include + +#ifdef XML_UNICODE +typedef const wchar_t *KEY; +#else +typedef const char *KEY; +#endif + +typedef struct { + KEY name; +} NAMED; + +typedef struct { + NAMED **v; + size_t size; + size_t used; + size_t usedLim; +} HASH_TABLE; + +NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize); +void hashTableInit(HASH_TABLE *); +void hashTableDestroy(HASH_TABLE *); + +typedef struct { + NAMED **p; + NAMED **end; +} HASH_TABLE_ITER; + +void hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *); +NAMED *hashTableIterNext(HASH_TABLE_ITER *); Index: library/xml/TclExpat-1.1/iasciitab.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/iasciitab.h (revision 0) +++ library/xml/TclExpat-1.1/iasciitab.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,53 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ +/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, +/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, +/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, +/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, +/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, +/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, +/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, +/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, +/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_NMSTRT, BT_SEMI, +/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, +/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, +/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, +/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, +/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, +/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, +/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, +/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, +/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, Index: library/xml/TclExpat-1.1/latin1tab.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/latin1tab.h (revision 0) +++ library/xml/TclExpat-1.1/latin1tab.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,52 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, +/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, +/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, +/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, +/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, +/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, Index: library/xml/TclExpat-1.1/nametab.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/nametab.h (revision 0) +++ library/xml/TclExpat-1.1/nametab.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,150 @@ +static const unsigned namingBitmap[] = { +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE, +0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF, +0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF, +0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF, +0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, +0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, +0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, +0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, +0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, +0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF, +0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000, +0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060, +0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003, +0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003, +0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000, +0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001, +0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003, +0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000, +0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003, +0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003, +0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000, +0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000, +0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF, +0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB, +0x40000000, 0xF580C900, 0x00000007, 0x02010800, +0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF, +0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF, +0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, +0x00000000, 0x00004C40, 0x00000000, 0x00000000, +0x00000007, 0x00000000, 0x00000000, 0x00000000, +0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF, +0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF, +0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000, +0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000, +0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE, +0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF, +0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, +0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000, +0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003, +0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, +0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, +0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, +0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, +0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF, +0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF, +0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF, +0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF, +0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF, +0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0, +0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1, +0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3, +0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80, +0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3, +0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3, +0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000, +0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000, +0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF, +0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x00000000, 0x00000000, +0x00000000, 0x00000000, 0x1FFF0000, 0x00000002, +0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF, +0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF, +}; +static const unsigned char nmstrtPages[] = { +0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, +0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, +0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, +0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +static const unsigned char namePages[] = { +0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00, +0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, +0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, +0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; Index: library/xml/TclExpat-1.1/readfilemap.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/readfilemap.c (revision 0) +++ library/xml/TclExpat-1.1/readfilemap.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,89 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#include +#include +#include +#include +#include + +#ifndef S_ISREG +#ifndef S_IFREG +#define S_IFREG _S_IFREG +#endif +#ifndef S_IFMT +#define S_IFMT _S_IFMT +#endif +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#endif /* not S_ISREG */ + +#ifndef O_BINARY +#ifdef _O_BINARY +#define O_BINARY _O_BINARY +#else +#define O_BINARY 0 +#endif +#endif + +int filemap(const char *name, + void (*processor)(const void *, size_t, const char *, void *arg), + void *arg) +{ + size_t nbytes; + int fd; + int n; + struct stat sb; + void *p; + + fd = open(name, O_RDONLY|O_BINARY); + if (fd < 0) { + perror(name); + return 0; + } + if (fstat(fd, &sb) < 0) { + perror(name); + return 0; + } + if (!S_ISREG(sb.st_mode)) { + fprintf(stderr, "%s: not a regular file\n", name); + return 0; + } + nbytes = sb.st_size; + p = malloc(nbytes); + if (!p) { + fprintf(stderr, "%s: out of memory\n", name); + return 0; + } + n = read(fd, p, nbytes); + if (n < 0) { + perror(name); + close(fd); + return 0; + } + if (n != nbytes) { + fprintf(stderr, "%s: read unexpected number of bytes\n", name); + close(fd); + return 0; + } + processor(p, nbytes, name, arg); + free(p); + close(fd); + return 1; +} Index: library/xml/TclExpat-1.1/readme =================================================================== diff -u -N --- library/xml/TclExpat-1.1/readme (revision 0) +++ library/xml/TclExpat-1.1/readme (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,174 @@ + A Tcl interface to expat. + + Steve Ball, Zveno Pty Ltd. + +This package provides a Tcl interface to James Clark's expat library. +It creates a Tcl package, called "expat", which defines a single +new Tcl command "expat". + +See for more information +on XML support for Tcl. + +INSTALLATION +============ + +Unix/Linux +---------- + +You must have Tcl/Tk version 8.0p2 or 8.1a2 installed on your system. +TclExpat has been setup to use Tcl's configuration to make compilation +easy. Simply point TclExpat's Makefile at the Tcl configuration file: + + /bin/sh '. /usr/local/tcl/lib/tclConfig.sh ; make -e' + +where "/usr/local/tcl" is the installation path for Tcl. + +To install the package in the first available directory in the Tcl package +path use the command below. You may need to be root to do this. + + /bin/sh '. /usr/local/tcl/lib/tclConfig.sh ; make -e install' + +Macintosh +--------- + +The source must be compiled against the Tcl/Tk version 8.0p2 release. +A pre-compiled shareware distribution is available from Zveno, see below. + +Windows +------- + +The source must be compiled against the Tcl/Tk version 8.0p2 release. +A pre-compiled shareware distribution is available from Zveno, see below. + +SHAREWARE +========= + +Binary distributions for the Macintosh and Windows platforms are available +from Zveno. See + +USAGE +===== + +The package is loaded using: + + package require expat 1.0 + +This package defines the "expat" command which is used to create a +parser. It accepts the following arguments: + + expat parserName ?option value...? + +If no "parserName" argument is given then a unique name is chosen. +The name of the newly created parser is returned and a new Tcl command +of the same name is created to manipulate the parser. + +The parser command accepts the following methods: + + $parser cget -option + Returns the current value of an option. + + $parser configure -option value ?-option value...? + Sets configuration options. + + $parser parse xml + Parses the XML data given by "xml". This will + cause Tcl callback scripts to be invoked, if they + have been configured. + + If the document is not well-formed then the command + returns an error. + + $parser reset + Resets the parser. Call this method before parsing + a new document. + +The following options are accepted: + + -elementstartcommand command + Defines a callback script which is invoked + when the start of an element is found in the + document. The following arguments are appended + to the string before it is evaluated: + + command name attributelist + + "name" is the name of the element. + "attributelist" is the attribute list for the element. + + -elementendcommand command + Defines a callback script which is invoked + whenever an element is closed in the document. + The following arguments are appended to the string + before it is evaluated: + + command name + + "name" is the name of the element. + + -characterdatacommand command + Defines a callback script which is invoked whenever + character data is encountered in the document. + The following arguments are appended to the string + before it is evaluated: + + command data + + "data" is the character data found in the document. + + -processinginstructioncommand command + Defines a callback script which is invoked whenever + a processing instruction is encountered in the document. + The following arguments are appended to the string + before it is evaluated: + + command target data + + "target" is the target of the PI. + "data" is additional data found in the PI. + + -externalentitycommand command + Defines a callback script which is invoked whenever + an externally parsed general entity is encountered + in the document. The following arguments are appended + to the string before it is evaluated: + + command names base systemid publicid + + "names" is a list of the open entity names. + "base" is a URL to be used for resolving relative URLs. + "systemid" is the system identifier specified in the entity declaration + "publicid" is the public identifier specified in the entity declaration + + -defaultcommand command + Invoked when no other callback has been defined for a + document feature which has been encountered. + + -unparsedentitydeclcommand command + Invoked when an unparsed entity declaration is encountered. + + -notationdeclcommand command + Invoked when a notation declaration is encountered. + + -unknownencodingcommand command + Invoked when a character is encountered which has an + unknown encoding. + + -baseurl URL + Specifies a base URL to use for resolving relative URLs. + + -final boolean + Specifies whether more data is to be parsed. + +Callback scripts + +Tcl callback scripts may use the "break", "continue" and "error" commands +to alter the flow of control. + + break + Suppresses invocation of further callback scripts. + continue + Suppresses invocation of further callback scripts + until the current element has finished. + error + Suppresses invocation of further callback scripts. + The parser also returns an error condition. \ No newline at end of file Index: library/xml/TclExpat-1.1/tcl.m4 =================================================================== diff -u -N --- library/xml/TclExpat-1.1/tcl.m4 (revision 0) +++ library/xml/TclExpat-1.1/tcl.m4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,4041 @@ +# tcl.m4 -- +# +# This file provides a set of autoconf macros to help TEA-enable +# a Tcl extension. +# +# Copyright (c) 1999-2000 Ajuba Solutions. +# 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: tcl.m4,v 1.2 2007/10/12 19:53:32 neumann Exp $ + +AC_PREREQ(2.57) + +dnl TEA extensions pass us the version of TEA they think they +dnl are compatible with (must be set in TEA_INIT below) +dnl TEA_VERSION="3.6" + +# Possible values for key variables defined: +# +# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') +# TEA_PLATFORM - windows unix +# + +#------------------------------------------------------------------------ +# TEA_PATH_TCLCONFIG -- +# +# Locate the tclConfig.sh file and perform a sanity check on +# the Tcl compile flags +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-tcl=... +# +# Defines the following vars: +# TCL_BIN_DIR Full path to the directory containing +# the tclConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_TCLCONFIG], [ + dnl Make sure we are initialized + AC_REQUIRE([TEA_INIT]) + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + AC_ARG_WITH(tcl, + AC_HELP_STRING([--with-tcl], + [directory containing tcl configuration (tclConfig.sh)]), + with_tclconfig=${withval}) + AC_MSG_CHECKING([for Tcl configuration]) + AC_CACHE_VAL(ac_cv_c_tclconfig,[ + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case ${with_tclconfig} in + */tclConfig.sh ) + if test -f ${with_tclconfig}; then + AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) + with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tcl.framework/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + AC_MSG_WARN([Can't find Tcl configuration definitions]) + exit 0 + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_PATH_TKCONFIG -- +# +# Locate the tkConfig.sh file +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-tk=... +# +# Defines the following vars: +# TK_BIN_DIR Full path to the directory containing +# the tkConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_TKCONFIG], [ + # + # Ok, lets find the tk configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tk + # + + if test x"${no_tk}" = x ; then + # we reset no_tk in case something fails here + no_tk=true + AC_ARG_WITH(tk, + AC_HELP_STRING([--with-tk], + [directory containing tk configuration (tkConfig.sh)]), + with_tkconfig=${withval}) + AC_MSG_CHECKING([for Tk configuration]) + AC_CACHE_VAL(ac_cv_c_tkconfig,[ + + # First check to see if --with-tkconfig was specified. + if test x"${with_tkconfig}" != x ; then + case ${with_tkconfig} in + */tkConfig.sh ) + if test -f ${with_tkconfig}; then + AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) + with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tkconfig}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` + else + AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) + fi + fi + + # then check for a private Tk library + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ../tk \ + `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../tk \ + `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../../tk \ + `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tk.framework/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_tkconfig}" = x ; then + TK_BIN_DIR="# no Tk configs found" + AC_MSG_WARN([Can't find Tk configuration definitions]) + exit 0 + else + no_tk= + TK_BIN_DIR=${ac_cv_c_tkconfig} + AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_TCLCONFIG -- +# +# Load the tclConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# TCL_BIN_DIR +# +# Results: +# +# Subst the following vars: +# TCL_BIN_DIR +# TCL_SRC_DIR +# TCL_LIB_FILE +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_TCLCONFIG], [ + AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) + + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then + AC_MSG_RESULT([loading]) + . "${TCL_BIN_DIR}/tclConfig.sh" + else + AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tcl.framework installed in an arbitary location. + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then + for i in "`cd ${TCL_BIN_DIR}; pwd`" \ + "`cd ${TCL_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then + TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" + break + fi + done + fi + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then + TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + AC_SUBST(TCL_VERSION) + AC_SUBST(TCL_BIN_DIR) + AC_SUBST(TCL_SRC_DIR) + + AC_SUBST(TCL_LIB_FILE) + AC_SUBST(TCL_LIB_FLAG) + AC_SUBST(TCL_LIB_SPEC) + + AC_SUBST(TCL_STUB_LIB_FILE) + AC_SUBST(TCL_STUB_LIB_FLAG) + AC_SUBST(TCL_STUB_LIB_SPEC) + + AC_SUBST(TCL_LIBS) + AC_SUBST(TCL_DEFS) + AC_SUBST(TCL_EXTRA_CFLAGS) + AC_SUBST(TCL_LD_FLAGS) + AC_SUBST(TCL_SHLIB_LD_LIBS) +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_TKCONFIG -- +# +# Load the tkConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# TK_BIN_DIR +# +# Results: +# +# Sets the following vars that should be in tkConfig.sh: +# TK_BIN_DIR +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_TKCONFIG], [ + AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) + + if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then + AC_MSG_RESULT([loading]) + . "${TK_BIN_DIR}/tkConfig.sh" + else + AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" + eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" + + # If the TK_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TK_LIB_SPEC will be set to the value + # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC + # instead of TK_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TK_BIN_DIR}/Makefile" ; then + TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} + TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} + TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tk.framework installed in an arbitary location. + case ${TK_DEFS} in + *TK_FRAMEWORK*) + if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then + for i in "`cd ${TK_BIN_DIR}; pwd`" \ + "`cd ${TK_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then + TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" + break + fi + done + fi + if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then + TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" + TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" + eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" + eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" + eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" + + # Ensure windowingsystem is defined + if test "${TEA_PLATFORM}" = "unix" ; then + case ${TK_DEFS} in + *MAC_OSX_TK*) + AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) + TEA_WINDOWINGSYSTEM="aqua" + ;; + *) + TEA_WINDOWINGSYSTEM="x11" + ;; + esac + elif test "${TEA_PLATFORM}" = "windows" ; then + TEA_WINDOWINGSYSTEM="win32" + fi + + AC_SUBST(TK_VERSION) + AC_SUBST(TK_BIN_DIR) + AC_SUBST(TK_SRC_DIR) + + AC_SUBST(TK_LIB_FILE) + AC_SUBST(TK_LIB_FLAG) + AC_SUBST(TK_LIB_SPEC) + + AC_SUBST(TK_STUB_LIB_FILE) + AC_SUBST(TK_STUB_LIB_FLAG) + AC_SUBST(TK_STUB_LIB_SPEC) + + AC_SUBST(TK_LIBS) + AC_SUBST(TK_XINCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_SHARED -- +# +# Allows the building of shared libraries +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-shared=yes|no +# +# Defines the following vars: +# STATIC_BUILD Used for building import/export libraries +# on Windows. +# +# Sets the following vars: +# SHARED_BUILD Value of 1 or 0 +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_SHARED], [ + AC_MSG_CHECKING([how to build libraries]) + AC_ARG_ENABLE(shared, + AC_HELP_STRING([--enable-shared], + [build and link with shared libraries (default: on)]), + [tcl_ok=$enableval], [tcl_ok=yes]) + + if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" ; then + AC_MSG_RESULT([shared]) + SHARED_BUILD=1 + else + AC_MSG_RESULT([static]) + SHARED_BUILD=0 + AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) + fi + AC_SUBST(SHARED_BUILD) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_THREADS -- +# +# Specify if thread support should be enabled. If "yes" is specified +# as an arg (optional), threads are enabled by default, "no" means +# threads are disabled. "yes" is the default. +# +# TCL_THREADS is checked so that if you are compiling an extension +# against a threaded core, your extension must be compiled threaded +# as well. +# +# Note that it is legal to have a thread enabled extension run in a +# threaded or non-threaded Tcl core, but a non-threaded extension may +# only run in a non-threaded Tcl core. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-threads +# +# Sets the following vars: +# THREADS_LIBS Thread library(s) +# +# Defines the following vars: +# TCL_THREADS +# _REENTRANT +# _THREAD_SAFE +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_THREADS], [ + AC_ARG_ENABLE(threads, + AC_HELP_STRING([--enable-threads], + [build with threads]), + [tcl_ok=$enableval], [tcl_ok=yes]) + + if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then + TCL_THREADS=1 + + if test "${TEA_PLATFORM}" != "windows" ; then + # We are always OK on Windows, so check what this platform wants: + + # USE_THREAD_ALLOC tells us to try the special thread-based + # allocator that significantly reduces lock contention + AC_DEFINE(USE_THREAD_ALLOC, 1, + [Do we want to use the threaded memory allocator?]) + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + if test "`uname -s`" = "SunOS" ; then + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + fi + AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) + AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + AC_CHECK_LIB(pthread, __pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + AC_CHECK_LIB(pthreads, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + AC_CHECK_LIB(c, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "no"; then + AC_CHECK_LIB(c_r, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -pthread" + else + TCL_THREADS=0 + AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) + fi + fi + fi + fi + fi + else + TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + AC_MSG_CHECKING([for building with threads]) + if test "${TCL_THREADS}" = 1; then + AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) + AC_MSG_RESULT([yes (default)]) + else + AC_MSG_RESULT([no]) + fi + # TCL_THREADS sanity checking. See if our request for building with + # threads is the same as the way Tcl was built. If not, warn the user. + case ${TCL_DEFS} in + *THREADS=1*) + if test "${TCL_THREADS}" = "0"; then + AC_MSG_WARN([ + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads.]) + fi + ;; + *) + if test "${TCL_THREADS}" = "1"; then + AC_MSG_WARN([ + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core.]) + fi + ;; + esac + AC_SUBST(TCL_THREADS) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_SYMBOLS -- +# +# Specify if debugging symbols should be used. +# Memory (TCL_MEM_DEBUG) debugging can also be enabled. +# +# Arguments: +# none +# +# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives +# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. +# Requires the following vars to be set in the Makefile: +# CFLAGS_DEFAULT +# LDFLAGS_DEFAULT +# +# Results: +# +# Adds the following arguments to configure: +# --enable-symbols +# +# Defines the following vars: +# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true +# Sets to $(CFLAGS_OPTIMIZE) if false +# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true +# Sets to $(LDFLAGS_OPTIMIZE) if false +# DBGX Formerly used as debug library extension; +# always blank now. +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_SYMBOLS], [ + dnl Make sure we are initialized + AC_REQUIRE([TEA_CONFIG_CFLAGS]) + AC_MSG_CHECKING([for build with symbols]) + AC_ARG_ENABLE(symbols, + AC_HELP_STRING([--enable-symbols], + [build with debugging symbols (default: off)]), + [tcl_ok=$enableval], [tcl_ok=no]) + DBGX="" + if test "$tcl_ok" = "no"; then + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" + AC_MSG_RESULT([no]) + else + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" + if test "$tcl_ok" = "yes"; then + AC_MSG_RESULT([yes (standard debugging)]) + fi + fi + if test "${TEA_PLATFORM}" != "windows" ; then + LDFLAGS_DEFAULT="${LDFLAGS}" + fi + + AC_SUBST(TCL_DBGX) + AC_SUBST(CFLAGS_DEFAULT) + AC_SUBST(LDFLAGS_DEFAULT) + + if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then + AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) + fi + + if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then + if test "$tcl_ok" = "all"; then + AC_MSG_RESULT([enabled symbols mem debugging]) + else + AC_MSG_RESULT([enabled $tcl_ok debugging]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_LANGINFO -- +# +# Allows use of modern nl_langinfo check for better l10n. +# This is only relevant for Unix. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-langinfo=yes|no (default is yes) +# +# Defines the following vars: +# HAVE_LANGINFO Triggers use of nl_langinfo if defined. +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_LANGINFO], [ + AC_ARG_ENABLE(langinfo, + AC_HELP_STRING([--enable-langinfo], + [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), + [langinfo_ok=$enableval], [langinfo_ok=yes]) + + HAVE_LANGINFO=0 + if test "$langinfo_ok" = "yes"; then + AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) + fi + AC_MSG_CHECKING([whether to use nl_langinfo]) + if test "$langinfo_ok" = "yes"; then + AC_CACHE_VAL(tcl_cv_langinfo_h, [ + AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], + [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) + AC_MSG_RESULT([$tcl_cv_langinfo_h]) + if test $tcl_cv_langinfo_h = yes; then + AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) + fi + else + AC_MSG_RESULT([$langinfo_ok]) + fi +]) + +#-------------------------------------------------------------------- +# TEA_CONFIG_SYSTEM +# +# Determine what the system is (some things cannot be easily checked +# on a feature-driven basis, alas). This can usually be done via the +# "uname" command, but there are a few systems, like Next, where +# this doesn't work. +# +# Arguments: +# none +# +# Results: +# Defines the following var: +# +# system - System/platform/version identification code. +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_CONFIG_SYSTEM], [ + AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ + if test "${TEA_PLATFORM}" = "windows" ; then + tcl_cv_sys_version=windows + elif test -f /usr/lib/NextStep/software_version; then + tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + tcl_cv_sys_version=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + AC_MSG_WARN([can't find uname command]) + tcl_cv_sys_version=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi + fi + fi + ]) + system=$tcl_cv_sys_version +]) + +#-------------------------------------------------------------------- +# TEA_CONFIG_CFLAGS +# +# Try to determine the proper flags to pass to the compiler +# for building shared libraries and other such nonsense. +# +# Arguments: +# none +# +# Results: +# +# Defines and substitutes the following vars: +# +# DL_OBJS - Name of the object file that implements dynamic +# loading for Tcl on this system. +# DL_LIBS - Library file(s) to include in tclsh and other base +# applications in order for the "load" command to work. +# LDFLAGS - Flags to pass to the compiler when linking object +# files into an executable application binary such +# as tclsh. +# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", +# that tell the run-time dynamic linker where to look +# for shared libraries such as libtcl.so. Depends on +# the variable LIB_RUNTIME_DIR in the Makefile. Could +# be the same as CC_SEARCH_FLAGS if ${CC} is used to link. +# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", +# that tell the run-time dynamic linker where to look +# for shared libraries such as libtcl.so. Depends on +# the variable LIB_RUNTIME_DIR in the Makefile. +# SHLIB_CFLAGS - Flags to pass to cc when compiling the components +# of a shared library (may request position-independent +# code, among other things). +# SHLIB_LD - Base command to use for combining object files +# into a shared library. +# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when +# creating shared libraries. This symbol typically +# goes at the end of the "ld" commands that build +# shared libraries. The value of the symbol is +# "${LIBS}" if all of the dependent libraries should +# be specified when creating a shared library. If +# dependent libraries should not be specified (as on +# SunOS 4.x, where they cause the link to fail, or in +# general if Tcl and Tk aren't themselves shared +# libraries), then this symbol has an empty string +# as its value. +# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable +# extensions. An empty string means we don't know how +# to use shared libraries on this platform. +# LIB_SUFFIX - Specifies everything that comes after the "libfoo" +# in a static or shared library name, using the $VERSION variable +# to put the version in the right place. This is used +# by platforms that need non-standard library names. +# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs +# to have a version after the .so, and ${VERSION}.a +# on AIX, since a shared library needs to have +# a .a extension whereas shared objects for loadable +# extensions have a .so extension. Defaults to +# ${VERSION}${SHLIB_SUFFIX}. +# TCL_NEEDS_EXP_FILE - +# 1 means that an export file is needed to link to a +# shared library. +# TCL_EXP_FILE - The name of the installed export / import file which +# should be used to link to the Tcl shared library. +# Empty if Tcl is unshared. +# TCL_BUILD_EXP_FILE - +# The name of the built export / import file which +# should be used to link to the Tcl shared library. +# Empty if Tcl is unshared. +# CFLAGS_DEBUG - +# Flags used when running the compiler in debug mode +# CFLAGS_OPTIMIZE - +# Flags used when running the compiler in optimize mode +# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_CONFIG_CFLAGS], [ + dnl Make sure we are initialized + AC_REQUIRE([TEA_INIT]) + + # Step 0.a: Enable 64 bit support? + + AC_MSG_CHECKING([if 64bit support is requested]) + AC_ARG_ENABLE(64bit, + AC_HELP_STRING([--enable-64bit], + [enable 64bit support (default: off)]), + [do64bit=$enableval], [do64bit=no]) + AC_MSG_RESULT([$do64bit]) + + # Step 0.b: Enable Solaris 64 bit VIS support? + + AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) + AC_ARG_ENABLE(64bit-vis, + AC_HELP_STRING([--enable-64bit-vis], + [enable 64bit Sparc VIS support (default: off)]), + [do64bitVIS=$enableval], [do64bitVIS=no]) + AC_MSG_RESULT([$do64bitVIS]) + + if test "$do64bitVIS" = "yes"; then + # Force 64bit on with VIS + do64bit=yes + fi + + # Step 0.c: Cross-compiling options for Windows/CE builds? + + if test "${TEA_PLATFORM}" = "windows" ; then + AC_MSG_CHECKING([if Windows/CE build is requested]) + AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) + AC_MSG_RESULT([$doWince]) + fi + + # Step 1: set the variable "system" to hold the name and version number + # for the system. + + TEA_CONFIG_SYSTEM + + # Step 2: check for existence of -ldl library. This is needed because + # Linux can use either -ldl or -ldld for dynamic loading. + + AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) + + # Require ranlib early so we can override it in special cases below. + + AC_REQUIRE([AC_PROG_RANLIB]) + + # Step 3: set configuration options based on system name and version. + # This is similar to Tcl's unix/tcl.m4 except that we've added a + # "windows" case. + + do64bit_ok=no + LDFLAGS_ORIG="$LDFLAGS" + # When ld needs options to work in 64-bit mode, put them in + # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] + # is disabled by the user. [Bug 1016796] + LDFLAGS_ARCH="" + TCL_EXPORT_FILE_SUFFIX="" + UNSHARED_LIB_SUFFIX="" + TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' + ECHO_VERSION='`echo ${PACKAGE_VERSION}`' + TCL_LIB_VERSIONS_OK=ok + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE=-O + if test "$GCC" = "yes" ; then + CFLAGS_OPTIMIZE=-O2 + CFLAGS_WARNING="-Wall -Wno-implicit-int" + else + CFLAGS_WARNING="" + fi + TCL_NEEDS_EXP_FILE=0 + TCL_BUILD_EXP_FILE="" + TCL_EXP_FILE="" +dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. +dnl AC_CHECK_TOOL(AR, ar) + AC_CHECK_PROG(AR, ar, ar) + STLIB_LD='${AR} cr' + LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" + case $system in + windows) + # This is a 2-stage check to make sure we have the 64-bit SDK + # We have to know where the SDK is installed. + # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs + # MACHINE is IX86 for LINK, but this is used by the manifest, + # which requires x86|amd64|ia64. + MACHINE="X86" + if test "$do64bit" != "no" ; then + if test "x${MSSDK}x" = "xx" ; then + MSSDK="C:/Progra~1/Microsoft Platform SDK" + fi + MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` + PATH64="" + case "$do64bit" in + amd64|x64|yes) + MACHINE="AMD64" ; # default to AMD64 64-bit build + PATH64="${MSSDK}/Bin/Win64/x86/AMD64" + ;; + ia64) + MACHINE="IA64" + PATH64="${MSSDK}/Bin/Win64" + ;; + esac + if test ! -d "${PATH64}" ; then + AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) + AC_MSG_WARN([Ensure latest Platform SDK is installed]) + do64bit="no" + else + AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) + do64bit_ok="yes" + fi + fi + + if test "$doWince" != "no" ; then + if test "$do64bit" != "no" ; then + AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) + fi + if test "$GCC" = "yes" ; then + AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) + fi + TEA_PATH_CELIB + # Set defaults for common evc4/PPC2003 setup + # Currently Tcl requires 300+, possibly 420+ for sockets + CEVERSION=420; # could be 211 300 301 400 420 ... + TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... + ARCH=ARM; # could be ARM MIPS X86EM ... + PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" + if test "$doWince" != "yes"; then + # If !yes then the user specified something + # Reset ARCH to allow user to skip specifying it + ARCH= + eval `echo $doWince | awk -F, '{ \ + if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ + if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ + if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ + if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ + if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ + }'` + if test "x${ARCH}" = "x" ; then + ARCH=$TARGETCPU; + fi + fi + OSVERSION=WCE$CEVERSION; + if test "x${WCEROOT}" = "x" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" + if test ! -d "${WCEROOT}" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded Tools" + fi + fi + if test "x${SDKROOT}" = "x" ; then + SDKROOT="C:/Program Files/Windows CE Tools" + if test ! -d "${SDKROOT}" ; then + SDKROOT="C:/Windows CE Tools" + fi + fi + WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` + SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` + if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ + -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then + AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) + doWince="no" + else + # We could PATH_NOSPACE these, but that's not important, + # as long as we quote them when used. + CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" + if test -d "${CEINCLUDE}/${TARGETCPU}" ; then + CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" + fi + CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" + fi + fi + + if test "$GCC" != "yes" ; then + if test "${SHARED_BUILD}" = "0" ; then + runtime=-MT + else + runtime=-MD + fi + + if test "$do64bit" != "no" ; then + # All this magic is necessary for the Win64 SDK RC1 - hobbs + CC="\"${PATH64}/cl.exe\"" + CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" + RC="\"${MSSDK}/bin/rc.exe\"" + lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + LINKBIN="\"${PATH64}/link.exe\"" + CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + # Avoid 'unresolved external symbol __security_cookie' + # errors, c.f. http://support.microsoft.com/?id=894573 + TEA_ADD_LIBS([bufferoverflowU.lib]) + elif test "$doWince" != "no" ; then + CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" + if test "${TARGETCPU}" = "X86"; then + CC="\"${CEBINROOT}/cl.exe\"" + else + CC="\"${CEBINROOT}/cl${ARCH}.exe\"" + fi + CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" + RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" + arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` + defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" + if test "${SHARED_BUILD}" = "1" ; then + # Static CE builds require static celib as well + defs="${defs} _DLL" + fi + for i in $defs ; do + AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) + done + AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) + AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) + CFLAGS_DEBUG="-nologo -Zi -Od" + CFLAGS_OPTIMIZE="-nologo -Ox" + lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` + lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" + LINKBIN="\"${CEBINROOT}/link.exe\"" + AC_SUBST(CELIB_DIR) + else + RC="rc" + lflags="-nologo" + LINKBIN="link" + CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + fi + fi + + if test "$GCC" = "yes"; then + # mingw gcc mode + RC="windres" + CFLAGS_DEBUG="-g" + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + SHLIB_LD="$CC -shared" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" + LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" + else + SHLIB_LD="${LINKBIN} -dll ${lflags}" + # link -lib only works when -lib is the first arg + STLIB_LD="${LINKBIN} -lib ${lflags}" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' + PATHTYPE=-w + # For information on what debugtype is most useful, see: + # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp + # This essentially turns it all on. + LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" + LDFLAGS_OPTIMIZE="-release" + if test "$doWince" != "no" ; then + LDFLAGS_CONSOLE="-link ${lflags}" + LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} + else + LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" + LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" + fi + fi + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dll" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' + + TCL_LIB_VERSIONS_OK=nodots + # Bogus to avoid getting this turned off + DL_OBJS="tclLoadNone.obj" + ;; + AIX-*) + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then + # AIX requires the _r compiler when gcc isn't being used + case "${CC}" in + *_r) + # ok ... + ;; + *) + CC=${CC}_r + ;; + esac + AC_MSG_RESULT([Using $CC for compiling with threads]) + fi + LIBS="$LIBS -lc" + SHLIB_CFLAGS="" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + DL_OBJS="tclLoadDl.o" + LD_LIBRARY_PATH_VAR="LIBPATH" + + # Check to enable 64-bit flags for compiler/linker on AIX 4+ + if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + else + do64bit_ok=yes + CFLAGS="$CFLAGS -q64" + LDFLAGS_ARCH="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + else + SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' + fi + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then + AC_LIBOBJ([tclLoadAix]) + DL_LIBS="-lld" + fi + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) + fi + ;; + BeOS*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="${CC} -nostart" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + + #----------------------------------------------------------- + # Check for inet_ntoa in -lbind, for BeOS (which also needs + # -lsocket, even if the network functions are in -lnet which + # is always linked to, for compatibility. + #----------------------------------------------------------- + AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) + ;; + BSD/OS-2.1*|BSD/OS-3*) + SHLIB_CFLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD="cc -shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + HP-UX-*.11.*) + # Use updated header definitions where possible + AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) + # Needed by Tcl, but not most extensions + #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) + #LIBS="$LIBS -lxnet" # Use the XOPEN network library + + if test "`uname -m`" = "ia64" ; then + SHLIB_SUFFIX=".so" + # Use newer C++ library for C++ extensions + #if test "$GCC" != "yes" ; then + # CPPFLAGS="-AA" + #fi + else + SHLIB_SUFFIX=".sl" + fi + AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + SHLIB_LD_LIBS='${LIBS}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc + #CFLAGS="$CFLAGS +DAportable" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + hpux_arch=`${CC} -dumpmachine` + case $hpux_arch in + hppa64*) + # 64-bit gcc in use. Fix flags for GNU ld. + do64bit_ok=yes + SHLIB_LD="${CC} -shared" + SHLIB_LD_LIBS='${LIBS}' + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + *) + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + ;; + esac + else + do64bit_ok=yes + CFLAGS="$CFLAGS +DD64" + LDFLAGS_ARCH="+DD64" + fi + fi + ;; + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + SHLIB_SUFFIX=".sl" + AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + ;; + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + ;; + IRIX-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mabi=n32" + LDFLAGS="$LDFLAGS -mabi=n32" + else + case $system in + IRIX-6.3) + # Use to build 6.2 compatible binaries on 6.3. + CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" + ;; + *) + CFLAGS="$CFLAGS -n32" + ;; + esac + LDFLAGS="$LDFLAGS -n32" + fi + ;; + IRIX64-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + + # Check to enable 64-bit flags for compiler/linker + + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN([64bit mode not supported by gcc]) + else + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS_ARCH="-64" + fi + fi + ;; + Linux*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings + # when you inline the string and math operations. Turn this off to + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + if test $do64bit = yes; then + AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_m64 = yes; then + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + fi + fi + + # The combo of gcc + glibc has a bug related + # to inlining of functions like strtod(). The + # -fno-builtin flag should address this problem + # but it does not work. The -fno-inline flag + # is kind of overkill but it works. + # Disable inlining only when one of the + # files in compat/*.c is being linked in. + if test x"${USE_COMPAT}" != x ; then + CFLAGS="$CFLAGS -fno-inline" + fi + + ;; + GNU*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + SHLIB_LD="${CC} -shared" + DL_OBJS="" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + ;; + Lynx*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + CFLAGS_OPTIMIZE=-02 + SHLIB_LD="${CC} -shared " + DL_OBJS="tclLoadDl.o" + DL_LIBS="-mshared -ldl" + LD_FLAGS="-Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + ;; + MP-RAS-02*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + MP-RAS-*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,-Bexport" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + NetBSD-*|FreeBSD-[[1-2]].*) + # NetBSD/SPARC needs -fPIC, -fpic will not do. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ + AC_EGREP_CPP(yes, [ +#ifdef __ELF__ + yes +#endif + ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) + if test $tcl_cv_ld_elf = yes; then + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + else + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + fi + + # Ancient FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + OpenBSD-*) + # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. + case `machine` in + sparc|sparc64) + SHLIB_CFLAGS="-fPIC";; + *) + SHLIB_CFLAGS="-fpic";; + esac + SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ + AC_EGREP_CPP(yes, [ +#ifdef __ELF__ + yes +#endif + ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) + if test $tcl_cv_ld_elf = yes; then + LDFLAGS=-Wl,-export-dynamic + else + LDFLAGS="" + fi + + # OpenBSD doesn't do version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "${TCL_THREADS}" = "1" ; then + # The -pthread needs to go in the CFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + case $system in + FreeBSD-3.*) + # FreeBSD-3 doesn't handle version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + TCL_LIB_VERSIONS_OK=nodots + ;; + esac + ;; + Darwin-*) + CFLAGS_OPTIMIZE="-Os" + SHLIB_CFLAGS="-fno-common" + # To avoid discrepancies between what headers configure sees during + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: + CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" + if test $do64bit = yes; then + case `arch` in + ppc) + AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], + tcl_cv_cc_arch_ppc64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes, + tcl_cv_cc_arch_ppc64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_arch_ppc64 = yes; then + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + do64bit_ok=yes + fi;; + i386) + AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], + tcl_cv_cc_arch_x86_64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch x86_64" + AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes, + tcl_cv_cc_arch_x86_64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_arch_x86_64 = yes; then + CFLAGS="$CFLAGS -arch x86_64" + do64bit_ok=yes + fi;; + *) + AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; + esac + else + # Check for combined 32-bit and 64-bit fat build + echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ + echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ + fat_32_64=yes + fi + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' + AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" + AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_single_module = yes; then + SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + fi + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" + DL_LIBS="" + # Don't use -prebind when building for Mac OS X 10.4 or later only: + test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \ + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \ + LDFLAGS="$LDFLAGS -prebind" + LDFLAGS="$LDFLAGS -headerpad_max_install_names" + AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_search_paths_first = yes; then + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + + # TEA specific: for Tk extensions, remove 64-bit arch flags from + # CFLAGS et al. for combined 32 & 64 bit fat builds as neither + # TkAqua nor TkX11 can be built for 64-bit at present. + test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done + ;; + NEXTSTEP-*) + SHLIB_CFLAGS="" + SHLIB_LD="cc -nostdlib -r" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadNext.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OS/390-*) + CFLAGS_OPTIMIZE="" # Optimizer is buggy + AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h + [Should OS/390 do the right thing with sockets?]) + ;; + OSF1-1.0|OSF1-1.1|OSF1-1.2) + # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + SHLIB_CFLAGS="" + # Hack: make package name same as library name + SHLIB_LD='ld -R -export $@:' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadOSF.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-1.*) + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SHLIB_CFLAGS="-fPIC" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD="ld -shared" + else + SHLIB_LD="ld -non_shared" + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-V*) + # Digital OSF/1 + SHLIB_CFLAGS="" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD='ld -shared -expect_unresolved "*"' + else + SHLIB_LD='ld -non_shared -expect_unresolved "*"' + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mieee" + else + CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" + fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = "1" ; then + CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" + CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + LIBS=`echo $LIBS | sed s/-lpthreads//` + if test "$GCC" = "yes" ; then + LIBS="$LIBS -lpthread -lmach -lexc" + else + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + fi + + ;; + QNX-6*) + # QNX RTP + # This may work for all QNX, but it was only reported for v6. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + # dlopen is in -lc on QNX + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SCO_SV-3.2*) + # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # this test works, since "uname -s" was non-standard in 3.2.4 and + # below. + if test "$GCC" = "yes" ; then + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + else + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + fi + SHLIB_LD="ld -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SINIX*5.4*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SunOS-4*) + SHLIB_CFLAGS="-PIC" + SHLIB_LD="ld" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + + # SunOS can't handle version numbers with dots in them in library + # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it + # requires an extra version number at the end of .so file names. + # So, the library has to have a name like libtcl75.so.1.0 + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + SunOS-5.[[0-6]]) + # Careful to not let 5.10+ fall into this case + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + + SHLIB_CFLAGS="-KPIC" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + ;; + SunOS-5*) + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + + SHLIB_CFLAGS="-KPIC" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + arch=`isainfo` + if test "$arch" = "sparcv9 sparc" ; then + if test "$GCC" = "yes" ; then + if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then + AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) + else + do64bit_ok=yes + CFLAGS="$CFLAGS -m64 -mcpu=v9" + LDFLAGS="$LDFLAGS -m64 -mcpu=v9" + SHLIB_CFLAGS="-fPIC" + fi + else + do64bit_ok=yes + if test "$do64bitVIS" = "yes" ; then + CFLAGS="$CFLAGS -xarch=v9a" + LDFLAGS_ARCH="-xarch=v9a" + else + CFLAGS="$CFLAGS -xarch=v9" + LDFLAGS_ARCH="-xarch=v9" + fi + # Solaris 64 uses this as well + #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" + fi + elif test "$arch" = "amd64 i386" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + else + do64bit_ok=yes + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64" + fi + else + AC_MSG_WARN([64bit mode not supported for $arch]) + fi + fi + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "$do64bit_ok" = "yes" ; then + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + fi + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + fi + ;; + UNIX_SV* | UnixWare-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-Bexport" + AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_Bexport = yes; then + LDFLAGS="$LDFLAGS -Wl,-Bexport" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + esac + + if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then + AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) + fi + +dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so +dnl # until the end of configure, as configure's compile and link tests use +dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's +dnl # preprocessing tests use only CPPFLAGS. + AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) + + # Step 4: disable dynamic loading if requested via a command-line switch. + + AC_ARG_ENABLE(load, + AC_HELP_STRING([--enable-load], + [allow dynamic loading and "load" command (default: on)]), + [tcl_ok=$enableval], [tcl_ok=yes]) + if test "$tcl_ok" = "no"; then + DL_OBJS="" + fi + + if test "x$DL_OBJS" != "x" ; then + BUILD_DLTEST="\$(DLTEST_TARGETS)" + else + echo "Can't figure out how to do dynamic loading or shared libraries" + echo "on this system." + SHLIB_CFLAGS="" + SHLIB_LD="" + SHLIB_SUFFIX="" + DL_OBJS="tclLoadNone.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS_ORIG" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + BUILD_DLTEST="" + fi + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" + + # If we're running gcc, then change the C flags for compiling shared + # libraries to the right flags for gcc, instead of those for the + # standard manufacturer compiler. + + if test "$DL_OBJS" != "tclLoadNone.o" ; then + if test "$GCC" = "yes" ; then + case $system in + AIX-*) + ;; + BSD/OS*) + ;; + IRIX*) + ;; + NetBSD-*|FreeBSD-*) + ;; + Darwin-*) + ;; + SCO_SV-3.2*) + ;; + windows) + ;; + *) + SHLIB_CFLAGS="-fPIC" + ;; + esac + fi + fi + + if test "$SHARED_LIB_SUFFIX" = "" ; then + SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' + fi + if test "$UNSHARED_LIB_SUFFIX" = "" ; then + UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' + fi + + AC_SUBST(DL_LIBS) + + AC_SUBST(CFLAGS_DEBUG) + AC_SUBST(CFLAGS_OPTIMIZE) + AC_SUBST(CFLAGS_WARNING) + + AC_SUBST(STLIB_LD) + AC_SUBST(SHLIB_LD) + + AC_SUBST(SHLIB_LD_LIBS) + AC_SUBST(SHLIB_CFLAGS) + + AC_SUBST(LD_LIBRARY_PATH_VAR) + + # These must be called after we do the basic CFLAGS checks and + # verify any possible 64-bit or similar switches are necessary + TEA_TCL_EARLY_FLAGS + TEA_TCL_64BIT_FLAGS +]) + +#-------------------------------------------------------------------- +# TEA_SERIAL_PORT +# +# Determine which interface to use to talk to the serial port. +# Note that #include lines must begin in leftmost column for +# some compilers to recognize them as preprocessor directives, +# and some build environments have stdin not pointing at a +# pseudo-terminal (usually /dev/null instead.) +# +# Arguments: +# none +# +# Results: +# +# Defines only one of the following vars: +# HAVE_SYS_MODEM_H +# USE_TERMIOS +# USE_TERMIO +# USE_SGTTY +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_SERIAL_PORT], [ + AC_CHECK_HEADERS(sys/modem.h) + AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ + AC_TRY_RUN([ +#include + +int main() { + struct termios t; + if (tcgetattr(0, &t) == 0) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include + +int main() { + struct termio t; + if (ioctl(0, TCGETA, &t) == 0) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include + +int main() { + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct termios t; + if (tcgetattr(0, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct termio t; + if (ioctl(0, TCGETA, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; + }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) + fi]) + case $tcl_cv_api_serial in + termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; + termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; + sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; + esac +]) + +#-------------------------------------------------------------------- +# TEA_MISSING_POSIX_HEADERS +# +# Supply substitutes for missing POSIX header files. Special +# notes: +# - stdlib.h doesn't define strtol, strtoul, or +# strtod insome versions of SunOS +# - some versions of string.h don't declare procedures such +# as strstr +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# NO_DIRENT_H +# NO_ERRNO_H +# NO_VALUES_H +# HAVE_LIMITS_H or NO_LIMITS_H +# NO_STDLIB_H +# NO_STRING_H +# NO_SYS_WAIT_H +# NO_DLFCN_H +# HAVE_SYS_PARAM_H +# +# HAVE_STRING_H ? +# +# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and +# CHECK on limits.h +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ + AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ + AC_TRY_LINK([#include +#include ], [ +#ifndef _POSIX_SOURCE +# ifdef __Lynx__ + /* + * Generate compilation error to make the test fail: Lynx headers + * are only valid if really in the POSIX environment. + */ + + missing_procedure(); +# endif +#endif +DIR *d; +struct dirent *entryPtr; +char *p; +d = opendir("foobar"); +entryPtr = readdir(d); +p = entryPtr->d_name; +closedir(d); +], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) + + if test $tcl_cv_dirent_h = no; then + AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) + fi + + AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(limits.h, + [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], + [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) + AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) + AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) + AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) + if test $tcl_ok = 0; then + AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) + fi + AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) + AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) + AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) + + # See also memmove check below for a place where NO_STRING_H can be + # set and why. + + if test $tcl_ok = 0; then + AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) + fi + + AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) + + # OS/390 lacks sys/param.h (and doesn't need it, by chance). + AC_HAVE_HEADERS(sys/param.h) +]) + +#-------------------------------------------------------------------- +# TEA_PATH_X +# +# Locate the X11 header files and the X11 library archive. Try +# the ac_path_x macro first, but if it doesn't find the X stuff +# (e.g. because there's no xmkmf program) then check through +# a list of possible directories. Under some conditions the +# autoconf macro will return an include directory that contains +# no include files, so double-check its result just to be safe. +# +# This should be called after TEA_CONFIG_CFLAGS as setting the +# LIBS line can confuse some configure macro magic. +# +# Arguments: +# none +# +# Results: +# +# Sets the following vars: +# XINCLUDES +# XLIBSW +# PKG_LIBS (appends to) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_PATH_X], [ + if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then + TEA_PATH_UNIX_X + fi +]) + +AC_DEFUN([TEA_PATH_UNIX_X], [ + AC_PATH_X + not_really_there="" + if test "$no_x" = ""; then + if test "$x_includes" = ""; then + AC_TRY_CPP([#include ], , not_really_there="yes") + else + if test ! -r $x_includes/X11/Intrinsic.h; then + not_really_there="yes" + fi + fi + fi + if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then + AC_MSG_CHECKING([for X11 header files]) + found_xincludes="no" + AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") + if test "$found_xincludes" = "no"; then + dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" + for i in $dirs ; do + if test -r $i/X11/Intrinsic.h; then + AC_MSG_RESULT([$i]) + XINCLUDES=" -I$i" + found_xincludes="yes" + break + fi + done + fi + else + if test "$x_includes" != ""; then + XINCLUDES="-I$x_includes" + found_xincludes="yes" + fi + fi + if test found_xincludes = "no"; then + AC_MSG_RESULT([couldn't find any!]) + fi + + if test "$no_x" = yes; then + AC_MSG_CHECKING([for X11 libraries]) + XLIBSW=nope + dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" + for i in $dirs ; do + if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then + AC_MSG_RESULT([$i]) + XLIBSW="-L$i -lX11" + x_libraries="$i" + break + fi + done + else + if test "$x_libraries" = ""; then + XLIBSW=-lX11 + else + XLIBSW="-L$x_libraries -lX11" + fi + fi + if test "$XLIBSW" = nope ; then + AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) + fi + if test "$XLIBSW" = nope ; then + AC_MSG_RESULT([could not find any! Using -lX11.]) + XLIBSW=-lX11 + fi + if test x"${XLIBSW}" != x ; then + PKG_LIBS="${PKG_LIBS} ${XLIBSW}" + fi +]) + +#-------------------------------------------------------------------- +# TEA_BLOCKING_STYLE +# +# The statements below check for systems where POSIX-style +# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. +# On these systems (mostly older ones), use the old BSD-style +# FIONBIO approach instead. +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# HAVE_SYS_IOCTL_H +# HAVE_SYS_FILIO_H +# USE_FIONBIO +# O_NONBLOCK +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_BLOCKING_STYLE], [ + AC_CHECK_HEADERS(sys/ioctl.h) + AC_CHECK_HEADERS(sys/filio.h) + TEA_CONFIG_SYSTEM + AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) + case $system in + # There used to be code here to use FIONBIO under AIX. However, it + # was reported that FIONBIO doesn't work under AIX 3.2.5. Since + # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO + # code (JO, 5/31/97). + + OSF*) + AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) + AC_MSG_RESULT([FIONBIO]) + ;; + SunOS-4*) + AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) + AC_MSG_RESULT([FIONBIO]) + ;; + *) + AC_MSG_RESULT([O_NONBLOCK]) + ;; + esac +]) + +#-------------------------------------------------------------------- +# TEA_TIME_HANLDER +# +# Checks how the system deals with time.h, what time structures +# are used on the system, and what fields the structures have. +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# USE_DELTA_FOR_TZ +# HAVE_TM_GMTOFF +# HAVE_TM_TZADJ +# HAVE_TIMEZONE_VAR +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TIME_HANDLER], [ + AC_CHECK_HEADERS(sys/time.h) + AC_HEADER_TIME + AC_STRUCT_TIMEZONE + + AC_CHECK_FUNCS(gmtime_r localtime_r) + + AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ + AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], + tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) + if test $tcl_cv_member_tm_tzadj = yes ; then + AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) + fi + + AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ + AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], + tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) + if test $tcl_cv_member_tm_gmtoff = yes ; then + AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) + fi + + # + # Its important to include time.h in this check, as some systems + # (like convex) have timezone functions, etc. + # + AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ + AC_TRY_COMPILE([#include ], + [extern long timezone; + timezone += 1; + exit (0);], + tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) + if test $tcl_cv_timezone_long = yes ; then + AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) + else + # + # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. + # + AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ + AC_TRY_COMPILE([#include ], + [extern time_t timezone; + timezone += 1; + exit (0);], + tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) + if test $tcl_cv_timezone_time = yes ; then + AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) + fi + fi +]) + +#-------------------------------------------------------------------- +# TEA_BUGGY_STRTOD +# +# Under Solaris 2.4, strtod returns the wrong value for the +# terminating character under some conditions. Check for this +# and if the problem exists use a substitute procedure +# "fixstrtod" (provided by Tcl) that corrects the error. +# Also, on Compaq's Tru64 Unix 5.0, +# strtod(" ") returns 0.0 instead of a failure to convert. +# +# Arguments: +# none +# +# Results: +# +# Might defines some of the following vars: +# strtod (=fixstrtod) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_BUGGY_STRTOD], [ + AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) + if test "$tcl_strtod" = 1; then + AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ + AC_TRY_RUN([ + extern double strtod(); + int main() { + char *infString="Inf", *nanString="NaN", *spaceString=" "; + char *term; + double value; + value = strtod(infString, &term); + if ((term != infString) && (term[-1] == 0)) { + exit(1); + } + value = strtod(nanString, &term); + if ((term != nanString) && (term[-1] == 0)) { + exit(1); + } + value = strtod(spaceString, &term); + if (term == (spaceString+1)) { + exit(1); + } + exit(0); + }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, + tcl_cv_strtod_buggy=buggy)]) + if test "$tcl_cv_strtod_buggy" = buggy; then + AC_LIBOBJ([fixstrtod]) + USE_COMPAT=1 + AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) + fi + fi +]) + +#-------------------------------------------------------------------- +# TEA_TCL_LINK_LIBS +# +# Search for the libraries needed to link the Tcl shell. +# Things like the math library (-lm) and socket stuff (-lsocket vs. +# -lnsl) are dealt with here. +# +# Arguments: +# Requires the following vars to be set in the Makefile: +# DL_LIBS +# LIBS +# MATH_LIBS +# +# Results: +# +# Subst's the following var: +# TCL_LIBS +# MATH_LIBS +# +# Might append to the following vars: +# LIBS +# +# Might define the following vars: +# HAVE_NET_ERRNO_H +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_LINK_LIBS], [ + #-------------------------------------------------------------------- + # On a few very rare systems, all of the libm.a stuff is + # already in libc.a. Set compiler flags accordingly. + # Also, Linux requires the "ieee" library for math to work + # right (and it must appear before "-lm"). + #-------------------------------------------------------------------- + + AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") + AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) + + #-------------------------------------------------------------------- + # Interactive UNIX requires -linet instead of -lsocket, plus it + # needs net/errno.h to define the socket-related error codes. + #-------------------------------------------------------------------- + + AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) + AC_CHECK_HEADER(net/errno.h, [ + AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) + + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- + + tcl_checkBoth=0 + AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) + if test "$tcl_checkSocket" = 1; then + AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, + LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) + fi + if test "$tcl_checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) + fi + AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, + [LIBS="$LIBS -lnsl"])]) + + # Don't perform the eval of the libraries here because DL_LIBS + # won't be set until we call TEA_CONFIG_CFLAGS + + TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' + AC_SUBST(TCL_LIBS) + AC_SUBST(MATH_LIBS) +]) + +#-------------------------------------------------------------------- +# TEA_TCL_EARLY_FLAGS +# +# Check for what flags are needed to be passed so the correct OS +# features are available. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# _ISOC99_SOURCE +# _LARGEFILE64_SOURCE +# _LARGEFILE_SOURCE64 +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_EARLY_FLAG],[ + AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), + AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, + AC_TRY_COMPILE([[#define ]$1[ 1 +]$2], $3, + [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, + [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) + if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then + AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) + tcl_flags="$tcl_flags $1" + fi +]) + +AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ + AC_MSG_CHECKING([for required early compiler flags]) + tcl_flags="" + TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], + [char *p = (char *)strtoll; char *q = (char *)strtoull;]) + TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], + [struct stat64 buf; int i = stat64("/", &buf);]) + TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ], + [char *p = (char *)open64;]) + if test "x${tcl_flags}" = "x" ; then + AC_MSG_RESULT([none]) + else + AC_MSG_RESULT([${tcl_flags}]) + fi +]) + +#-------------------------------------------------------------------- +# TEA_TCL_64BIT_FLAGS +# +# Check for what is defined in the way of 64-bit features. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# TCL_WIDE_INT_IS_LONG +# TCL_WIDE_INT_TYPE +# HAVE_STRUCT_DIRENT64 +# HAVE_STRUCT_STAT64 +# HAVE_TYPE_OFF64_T +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ + AC_MSG_CHECKING([for 64-bit integer type]) + AC_CACHE_VAL(tcl_cv_type_64bit,[ + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], + tcl_type_64bit=__int64, tcl_type_64bit="long long") + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + AC_TRY_COMPILE(,[switch (0) { + case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; + }],tcl_cv_type_64bit=${tcl_type_64bit})]) + if test "${tcl_cv_type_64bit}" = none ; then + AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) + AC_MSG_RESULT([using long]) + elif test "${tcl_cv_type_64bit}" = "__int64" \ + -a "${TEA_PLATFORM}" = "windows" ; then + # We actually want to use the default tcl.h checks in this + # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* + AC_MSG_RESULT([using Tcl header defaults]) + else + AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, + [What type should be used to define wide integers?]) + AC_MSG_RESULT([${tcl_cv_type_64bit}]) + + # Now check for auxiliary declarations + AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ + AC_TRY_COMPILE([#include +#include ],[struct dirent64 p;], + tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) + fi + + AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ + AC_TRY_COMPILE([#include ],[struct stat64 p; +], + tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) + fi + + AC_CHECK_FUNCS(open64 lseek64) + AC_MSG_CHECKING([for off64_t]) + AC_CACHE_VAL(tcl_cv_type_off64_t,[ + AC_TRY_COMPILE([#include ],[off64_t offset; +], + tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) + dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the + dnl functions lseek64 and open64 are defined. + if test "x${tcl_cv_type_off64_t}" = "xyes" && \ + test "x${ac_cv_func_lseek64}" = "xyes" && \ + test "x${ac_cv_func_open64}" = "xyes" ; then + AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + fi +]) + +## +## Here ends the standard Tcl configuration bits and starts the +## TEA specific functions +## + +#------------------------------------------------------------------------ +# TEA_INIT -- +# +# Init various Tcl Extension Architecture (TEA) variables. +# This should be the first called TEA_* macro. +# +# Arguments: +# none +# +# Results: +# +# Defines and substs the following vars: +# CYGPATH +# EXEEXT +# Defines only: +# TEA_VERSION +# TEA_INITED +# TEA_PLATFORM (windows or unix) +# +# "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. +# +# EXEEXT +# Select the executable extension based on the host type. This +# is a lightweight replacement for AC_EXEEXT that doesn't require +# a compiler. +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_INIT], [ + # TEA extensions pass this us the version of TEA they think they + # are compatible with. + TEA_VERSION="3.6" + + AC_MSG_CHECKING([for correct TEA configuration]) + if test x"${PACKAGE_NAME}" = x ; then + AC_MSG_ERROR([ +The PACKAGE_NAME variable must be defined by your TEA configure.in]) + fi + if test x"$1" = x ; then + AC_MSG_ERROR([ +TEA version not specified.]) + elif test "$1" != "${TEA_VERSION}" ; then + AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) + else + AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) + fi + case "`uname -s`" in + *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) + AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) + EXEEXT=".exe" + TEA_PLATFORM="windows" + ;; + *) + CYGPATH=echo + EXEEXT="" + TEA_PLATFORM="unix" + ;; + esac + + # Check if exec_prefix is set. If not use fall back to prefix. + # Note when adjusted, so that TEA_PREFIX can correct for this. + # This is needed for recursive configures, since autoconf propagates + # $prefix, but not $exec_prefix (doh!). + if test x$exec_prefix = xNONE ; then + exec_prefix_default=yes + exec_prefix=$prefix + fi + + AC_SUBST(EXEEXT) + AC_SUBST(CYGPATH) + + # This package name must be replaced statically for AC_SUBST to work + AC_SUBST(PKG_LIB_FILE) + # Substitute STUB_LIB_FILE in case package creates a stub library too. + AC_SUBST(PKG_STUB_LIB_FILE) + + # We AC_SUBST these here to ensure they are subst'ed, + # in case the user doesn't call TEA_ADD_... + AC_SUBST(PKG_STUB_SOURCES) + AC_SUBST(PKG_STUB_OBJECTS) + AC_SUBST(PKG_TCL_SOURCES) + AC_SUBST(PKG_HEADERS) + AC_SUBST(PKG_INCLUDES) + AC_SUBST(PKG_LIBS) + AC_SUBST(PKG_CFLAGS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_SOURCES -- +# +# Specify one or more source files. Users should check for +# the right platform before adding to their list. +# It is not important to specify the directory, as long as it is +# in the generic, win or unix subdirectory of $(srcdir). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_SOURCES +# PKG_OBJECTS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_SOURCES], [ + vars="$@" + for i in $vars; do + case $i in + [\$]*) + # allow $-var names + PKG_SOURCES="$PKG_SOURCES $i" + PKG_OBJECTS="$PKG_OBJECTS $i" + ;; + *) + # check for existence - allows for generic/win/unix VPATH + # To add more dirs here (like 'src'), you have to update VPATH + # in Makefile.in as well + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + AC_MSG_ERROR([could not find source file '$i']) + fi + PKG_SOURCES="$PKG_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" + fi + PKG_OBJECTS="$PKG_OBJECTS $j" + ;; + esac + done + AC_SUBST(PKG_SOURCES) + AC_SUBST(PKG_OBJECTS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_STUB_SOURCES -- +# +# Specify one or more source files. Users should check for +# the right platform before adding to their list. +# It is not important to specify the directory, as long as it is +# in the generic, win or unix subdirectory of $(srcdir). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_STUB_SOURCES +# PKG_STUB_OBJECTS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_STUB_SOURCES], [ + vars="$@" + for i in $vars; do + # check for existence - allows for generic/win/unix VPATH + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + AC_MSG_ERROR([could not find stub source file '$i']) + fi + PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" + fi + PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" + done + AC_SUBST(PKG_STUB_SOURCES) + AC_SUBST(PKG_STUB_OBJECTS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_TCL_SOURCES -- +# +# Specify one or more Tcl source files. These should be platform +# independent runtime files. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_TCL_SOURCES +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_TCL_SOURCES], [ + vars="$@" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) + fi + PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" + done + AC_SUBST(PKG_TCL_SOURCES) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_HEADERS -- +# +# Specify one or more source headers. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_HEADERS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_HEADERS], [ + vars="$@" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + AC_MSG_ERROR([could not find header file '${srcdir}/$i']) + fi + PKG_HEADERS="$PKG_HEADERS $i" + done + AC_SUBST(PKG_HEADERS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_INCLUDES -- +# +# Specify one or more include dirs. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_INCLUDES +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_INCLUDES], [ + vars="$@" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + AC_SUBST(PKG_INCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_LIBS -- +# +# Specify one or more libraries. Users should check for +# the right platform before adding to their list. For Windows, +# libraries provided in "foo.lib" format will be converted to +# "-lfoo" when using GCC (mingw). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_LIBS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_LIBS], [ + vars="$@" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + AC_SUBST(PKG_LIBS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_CFLAGS -- +# +# Specify one or more CFLAGS. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_CFLAGS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_CFLAGS], [ + PKG_CFLAGS="$PKG_CFLAGS $@" + AC_SUBST(PKG_CFLAGS) +]) + +#------------------------------------------------------------------------ +# TEA_PREFIX -- +# +# Handle the --prefix=... option by defaulting to what Tcl gave +# +# Arguments: +# none +# +# Results: +# +# If --prefix or --exec-prefix was not specified, $prefix and +# $exec_prefix will be set to the values given to Tcl when it was +# configured. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_PREFIX], [ + if test "${prefix}" = "NONE"; then + prefix_default=yes + if test x"${TCL_PREFIX}" != x; then + AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) + prefix=${TCL_PREFIX} + else + AC_MSG_NOTICE([--prefix defaulting to /usr/local]) + prefix=/usr/local + fi + fi + if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ + -o x"${exec_prefix_default}" = x"yes" ; then + if test x"${TCL_EXEC_PREFIX}" != x; then + AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) + exec_prefix=${TCL_EXEC_PREFIX} + else + AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) + exec_prefix=$prefix + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_SETUP_COMPILER_CC -- +# +# Do compiler checks the way we want. This is just a replacement +# for AC_PROG_CC in TEA configure.in files to make them cleaner. +# +# Arguments: +# none +# +# Results: +# +# Sets up CC var and other standard bits we need to make executables. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_SETUP_COMPILER_CC], [ + # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) + # in this macro, they need to go into TEA_SETUP_COMPILER instead. + + # If the user did not set CFLAGS, set it now to keep + # the AC_PROG_CC macro from adding "-g -O2". + if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" + fi + + AC_PROG_CC + AC_PROG_CPP + + AC_PROG_INSTALL + + #-------------------------------------------------------------------- + # Checks to see if the make program sets the $MAKE variable. + #-------------------------------------------------------------------- + + AC_PROG_MAKE_SET + + #-------------------------------------------------------------------- + # Find ranlib + #-------------------------------------------------------------------- + + AC_PROG_RANLIB + + #-------------------------------------------------------------------- + # Determines the correct binary file extension (.o, .obj, .exe etc.) + #-------------------------------------------------------------------- + + AC_OBJEXT + AC_EXEEXT +]) + +#------------------------------------------------------------------------ +# TEA_SETUP_COMPILER -- +# +# Do compiler checks that use the compiler. This must go after +# TEA_SETUP_COMPILER_CC, which does the actual compiler check. +# +# Arguments: +# none +# +# Results: +# +# Sets up CC var and other standard bits we need to make executables. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_SETUP_COMPILER], [ + # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. + AC_REQUIRE([TEA_SETUP_COMPILER_CC]) + + #------------------------------------------------------------------------ + # If we're using GCC, see if the compiler understands -pipe. If so, use it. + # It makes compiling go faster. (This is only a performance feature.) + #------------------------------------------------------------------------ + + if test -z "$no_pipe" -a -n "$GCC"; then + AC_CACHE_CHECK([if the compiler understands -pipe], + tcl_cv_cc_pipe, [ + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" + AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_pipe = yes; then + CFLAGS="$CFLAGS -pipe" + fi + fi + + #-------------------------------------------------------------------- + # Common compiler flag setup + #-------------------------------------------------------------------- + + AC_C_BIGENDIAN + if test "${TEA_PLATFORM}" = "unix" ; then + TEA_TCL_LINK_LIBS + TEA_MISSING_POSIX_HEADERS + # Let the user call this, because if it triggers, they will + # need a compat/strtod.c that is correct. Users can also + # use Tcl_GetDouble(FromObj) instead. + #TEA_BUGGY_STRTOD + fi +]) + +#------------------------------------------------------------------------ +# TEA_MAKE_LIB -- +# +# Generate a line that can be used to build a shared/unshared library +# in a platform independent manner. +# +# Arguments: +# none +# +# Requires: +# +# Results: +# +# Defines the following vars: +# CFLAGS - Done late here to note disturb other AC macros +# MAKE_LIB - Command to execute to build the Tcl library; +# differs depending on whether or not Tcl is being +# compiled as a shared library. +# MAKE_SHARED_LIB Makefile rule for building a shared library +# MAKE_STATIC_LIB Makefile rule for building a static library +# MAKE_STUB_LIB Makefile rule for building a stub library +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_MAKE_LIB], [ + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then + MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" + MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" + else + MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" + MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" + fi + + if test "${SHARED_BUILD}" = "1" ; then + MAKE_LIB="${MAKE_SHARED_LIB} " + else + MAKE_LIB="${MAKE_STATIC_LIB} " + fi + + #-------------------------------------------------------------------- + # Shared libraries and static libraries have different names. + # Use the double eval to make sure any variables in the suffix is + # substituted. (@@@ Might not be necessary anymore) + #-------------------------------------------------------------------- + + if test "${TEA_PLATFORM}" = "windows" ; then + if test "${SHARED_BUILD}" = "1" ; then + # We force the unresolved linking of symbols that are really in + # the private libraries of Tcl and Tk. + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" + fi + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + else + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + if test "$GCC" = "yes"; then + PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} + fi + # These aren't needed on Windows (either MSVC or gcc) + RANLIB=: + RANLIB_STUB=: + else + RANLIB_STUB="${RANLIB}" + if test "${SHARED_BUILD}" = "1" ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" + fi + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + fi + + # These are escaped so that only CFLAGS is picked up at configure time. + # The other values will be substituted at make time. + CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" + if test "${SHARED_BUILD}" = "1" ; then + CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" + fi + + AC_SUBST(MAKE_LIB) + AC_SUBST(MAKE_SHARED_LIB) + AC_SUBST(MAKE_STATIC_LIB) + AC_SUBST(MAKE_STUB_LIB) + AC_SUBST(RANLIB_STUB) +]) + +#------------------------------------------------------------------------ +# TEA_LIB_SPEC -- +# +# Compute the name of an existing object library located in libdir +# from the given base name and produce the appropriate linker flags. +# +# Arguments: +# basename The base name of the library without version +# numbers, extensions, or "lib" prefixes. +# extra_dir Extra directory in which to search for the +# library. This location is used first, then +# $prefix/$exec-prefix, then some defaults. +# +# Requires: +# TEA_INIT and TEA_PREFIX must be called first. +# +# Results: +# +# Defines the following vars: +# ${basename}_LIB_NAME The computed library name. +# ${basename}_LIB_SPEC The computed linker flags. +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LIB_SPEC], [ + AC_MSG_CHECKING([for $1 library]) + + # Look in exec-prefix for the library (defined by TEA_PREFIX). + + tea_lib_name_dir="${exec_prefix}/lib" + + # Or in a user-specified location. + + if test x"$2" != x ; then + tea_extra_lib_dir=$2 + else + tea_extra_lib_dir=NONE + fi + + for i in \ + `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do + if test -f "$i" ; then + tea_lib_name_dir=`dirname $i` + $1_LIB_NAME=`basename $i` + $1_LIB_PATH_NAME=$i + break + fi + done + + if test "${TEA_PLATFORM}" = "windows"; then + $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" + else + # Strip off the leading "lib" and trailing ".a" or ".so" + + tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` + $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" + fi + + if test "x${$1_LIB_NAME}" = x ; then + AC_MSG_ERROR([not found]) + else + AC_MSG_RESULT([${$1_LIB_SPEC}]) + fi +]) + +#------------------------------------------------------------------------ +# TEA_PRIVATE_TCL_HEADERS -- +# +# Locate the private Tcl include files +# +# Arguments: +# +# Requires: +# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has +# already been called. +# +# Results: +# +# Substs the following vars: +# TCL_TOP_DIR_NATIVE +# TCL_GENERIC_DIR_NATIVE +# TCL_UNIX_DIR_NATIVE +# TCL_WIN_DIR_NATIVE +# TCL_BMAP_DIR_NATIVE +# TCL_TOOL_DIR_NATIVE +# TCL_PLATFORM_DIR_NATIVE +# TCL_BIN_DIR_NATIVE +# TCL_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ + AC_MSG_CHECKING([for Tcl private include files]) + + TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` + TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" + TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" + TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" + TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" + TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" + TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" + TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" + + if test "${TEA_PLATFORM}" = "windows"; then + TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} + else + TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} + fi + # We want to ensure these are substituted so as not to require + # any *_NATIVE vars be defined in the Makefile + TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers and PrivateHeaders directories + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then + TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else + TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi + ;; + esac + else + if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then + AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) + fi + fi + + + AC_SUBST(TCL_TOP_DIR_NATIVE) + AC_SUBST(TCL_GENERIC_DIR_NATIVE) + AC_SUBST(TCL_UNIX_DIR_NATIVE) + AC_SUBST(TCL_WIN_DIR_NATIVE) + AC_SUBST(TCL_BMAP_DIR_NATIVE) + AC_SUBST(TCL_TOOL_DIR_NATIVE) + AC_SUBST(TCL_PLATFORM_DIR_NATIVE) + + AC_SUBST(TCL_INCLUDES) + AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) +]) + +#------------------------------------------------------------------------ +# TEA_PUBLIC_TCL_HEADERS -- +# +# Locate the installed public Tcl header files +# +# Arguments: +# None. +# +# Requires: +# CYGPATH must be set +# +# Results: +# +# Adds a --with-tclinclude switch to configure. +# Result is cached. +# +# Substs the following vars: +# TCL_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ + AC_MSG_CHECKING([for Tcl public headers]) + + AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) + + AC_CACHE_VAL(ac_cv_c_tclh, [ + # Use the value from --with-tclinclude, if it was given + + if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + ac_cv_c_tclh=${with_tclinclude} + else + AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) + fi + else + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers directory + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tcl is not installed, + # and in that situation, look there before installed locations. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + if test x"${TCL_INCLUDE_SPEC}" != x ; then + d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` + list="$list `ls -d ${d} 2>/dev/null`" + fi + fi + for i in $list ; do + if test -f "$i/tcl.h" ; then + ac_cv_c_tclh=$i + break + fi + done + fi + ]) + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tclh}" = x ; then + AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) + else + AC_MSG_RESULT([${ac_cv_c_tclh}]) + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` + + TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + AC_SUBST(TCL_INCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_PRIVATE_TK_HEADERS -- +# +# Locate the private Tk include files +# +# Arguments: +# +# Requires: +# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has +# already been called. +# +# Results: +# +# Substs the following vars: +# TK_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ + AC_MSG_CHECKING([for Tk private include files]) + + TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` + TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" + TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" + TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" + TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" + TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" + if test "${TEA_PLATFORM}" = "windows"; then + TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} + else + TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} + fi + # We want to ensure these are substituted so as not to require + # any *_NATIVE vars be defined in the Makefile + TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" + # Detect and add ttk subdir + if test -d ${TK_SRC_DIR_NATIVE}/generic/ttk; then + TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" + fi + if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ + -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" + fi + if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" + fi + if test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use + # the framework's Headers and PrivateHeaders directories + case ${TK_DEFS} in + *TK_FRAMEWORK*) + if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then + TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi + ;; + esac + else + if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then + AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) + fi + fi + + AC_SUBST(TK_TOP_DIR_NATIVE) + AC_SUBST(TK_UNIX_DIR_NATIVE) + AC_SUBST(TK_WIN_DIR_NATIVE) + AC_SUBST(TK_GENERIC_DIR_NATIVE) + AC_SUBST(TK_XLIB_DIR_NATIVE) + AC_SUBST(TK_PLATFORM_DIR_NATIVE) + + AC_SUBST(TK_INCLUDES) + AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) +]) + +#------------------------------------------------------------------------ +# TEA_PUBLIC_TK_HEADERS -- +# +# Locate the installed public Tk header files +# +# Arguments: +# None. +# +# Requires: +# CYGPATH must be set +# +# Results: +# +# Adds a --with-tkinclude switch to configure. +# Result is cached. +# +# Substs the following vars: +# TK_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ + AC_MSG_CHECKING([for Tk public headers]) + + AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) + + AC_CACHE_VAL(ac_cv_c_tkh, [ + # Use the value from --with-tkinclude, if it was given + + if test x"${with_tkinclude}" != x ; then + if test -f "${with_tkinclude}/tk.h" ; then + ac_cv_c_tkh=${with_tkinclude} + else + AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) + fi + else + if test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use + # the framework's Headers directory. + case ${TK_DEFS} in + *TK_FRAMEWORK*) + list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tk is not installed, + # and in that situation, look there before installed locations. + if test -f "${TK_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tk's --prefix location, + # relative to directory of tkConfig.sh, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TK_PREFIX}/include 2>/dev/null` \ + `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + fi + for i in $list ; do + if test -f "$i/tk.h" ; then + ac_cv_c_tkh=$i + break + fi + done + fi + ]) + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tkh}" = x ; then + AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) + else + AC_MSG_RESULT([${ac_cv_c_tkh}]) + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` + + TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + AC_SUBST(TK_INCLUDES) + + if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ + -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + # On Windows and Aqua, we need the X compat headers + AC_MSG_CHECKING([for X11 header files]) + if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then + INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" + TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + AC_SUBST(TK_XINCLUDES) + fi + AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) + fi +]) + +#------------------------------------------------------------------------ +# TEA_PROG_TCLSH +# Determine the fully qualified path name of the tclsh executable +# in the Tcl build directory or the tclsh installed in a bin +# directory. This macro will correctly determine the name +# of the tclsh executable even if tclsh has not yet been +# built in the build directory. The tclsh found is always +# associated with a tclConfig.sh file. This tclsh should be used +# only for running extension test cases. It should never be +# or generation of files (like pkgIndex.tcl) at build time. +# +# Arguments +# none +# +# Results +# Subst's the following values: +# TCLSH_PROG +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PROG_TCLSH], [ + AC_MSG_CHECKING([for tclsh]) + if test -f "${TCL_BIN_DIR}/Makefile" ; then + # tclConfig.sh is in Tcl build directory + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="${TCL_BIN_DIR}/tclsh" + fi + else + # tclConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" + fi + list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${TCLSH_PROG}" ; then + REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" + fi + AC_MSG_RESULT([${TCLSH_PROG}]) + AC_SUBST(TCLSH_PROG) +]) + +#------------------------------------------------------------------------ +# TEA_PROG_WISH +# Determine the fully qualified path name of the wish executable +# in the Tk build directory or the wish installed in a bin +# directory. This macro will correctly determine the name +# of the wish executable even if wish has not yet been +# built in the build directory. The wish found is always +# associated with a tkConfig.sh file. This wish should be used +# only for running extension test cases. It should never be +# or generation of files (like pkgIndex.tcl) at build time. +# +# Arguments +# none +# +# Results +# Subst's the following values: +# WISH_PROG +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PROG_WISH], [ + AC_MSG_CHECKING([for wish]) + if test -f "${TK_BIN_DIR}/Makefile" ; then + # tkConfig.sh is in Tk build directory + if test "${TEA_PLATFORM}" = "windows"; then + WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" + else + WISH_PROG="${TK_BIN_DIR}/wish" + fi + else + # tkConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" + else + WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" + fi + list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TK_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${WISH_PROG}" ; then + REAL_TK_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" + fi + AC_MSG_RESULT([${WISH_PROG}]) + AC_SUBST(WISH_PROG) +]) + +#------------------------------------------------------------------------ +# TEA_PATH_CONFIG -- +# +# Locate the ${1}Config.sh file and perform a sanity check on +# the ${1} compile flags. These are used by packages like +# [incr Tk] that load *Config.sh files from more than Tcl and Tk. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-$1=... +# +# Defines the following vars: +# $1_BIN_DIR Full path to the directory containing +# the $1Config.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_CONFIG], [ + # + # Ok, lets find the $1 configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-$1 + # + + if test x"${no_$1}" = x ; then + # we reset no_$1 in case something fails here + no_$1=true + AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) + AC_MSG_CHECKING([for $1 configuration]) + AC_CACHE_VAL(ac_cv_c_$1config,[ + + # First check to see if --with-$1 was specified. + if test x"${with_$1config}" != x ; then + case ${with_$1config} in + */$1Config.sh ) + if test -f ${with_$1config}; then + AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) + with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` + fi;; + esac + if test -f "${with_$1config}/$1Config.sh" ; then + ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` + else + AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) + fi + fi + + # then check for a private $1 installation + if test x"${ac_cv_c_$1config}" = x ; then + for i in \ + ../$1 \ + `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ../../$1 \ + `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ../../../$1 \ + `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ${srcdir}/../$1 \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ; do + if test -f "$i/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i; pwd)` + break + fi + if test -f "$i/unix/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i/unix; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_$1config}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_$1config}" = x ; then + $1_BIN_DIR="# no $1 configs found" + AC_MSG_WARN([Cannot find $1 configuration definitions]) + exit 0 + else + no_$1= + $1_BIN_DIR=${ac_cv_c_$1config} + AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_CONFIG -- +# +# Load the $1Config.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# $1_BIN_DIR +# +# Results: +# +# Subst the following vars: +# $1_SRC_DIR +# $1_LIB_FILE +# $1_LIB_SPEC +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_CONFIG], [ + AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) + + if test -f "${$1_BIN_DIR}/$1Config.sh" ; then + AC_MSG_RESULT([loading]) + . "${$1_BIN_DIR}/$1Config.sh" + else + AC_MSG_RESULT([file not found]) + fi + + # + # If the $1_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable $1_LIB_SPEC will be set to the value + # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC + # instead of $1_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + # + + if test -f "${$1_BIN_DIR}/Makefile" ; then + AC_MSG_WARN([Found Makefile - using build library specs for $1]) + $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} + $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} + $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} + fi + + AC_SUBST($1_VERSION) + AC_SUBST($1_BIN_DIR) + AC_SUBST($1_SRC_DIR) + + AC_SUBST($1_LIB_FILE) + AC_SUBST($1_LIB_SPEC) + + AC_SUBST($1_STUB_LIB_FILE) + AC_SUBST($1_STUB_LIB_SPEC) + AC_SUBST($1_STUB_LIB_PATH) +]) + +#------------------------------------------------------------------------ +# TEA_PATH_CELIB -- +# +# Locate Keuchel's celib emulation layer for targeting Win/CE +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-celib=... +# +# Defines the following vars: +# CELIB_DIR Full path to the directory containing +# the include and platform lib files +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_CELIB], [ + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-celib + + if test x"${no_celib}" = x ; then + # we reset no_celib in case something fails here + no_celib=true + AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) + AC_MSG_CHECKING([for Windows/CE celib directory]) + AC_CACHE_VAL(ac_cv_c_celibconfig,[ + # First check to see if --with-celibconfig was specified. + if test x"${with_celibconfig}" != x ; then + if test -d "${with_celibconfig}/inc" ; then + ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` + else + AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) + fi + fi + + # then check for a celib library + if test x"${ac_cv_c_celibconfig}" = x ; then + for i in \ + ../celib-palm-3.0 \ + ../celib \ + ../../celib-palm-3.0 \ + ../../celib \ + `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ + ${srcdir}/../celib-palm-3.0 \ + ${srcdir}/../celib \ + `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ + ; do + if test -d "$i/inc" ; then + ac_cv_c_celibconfig=`(cd $i; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_celibconfig}" = x ; then + AC_MSG_ERROR([Cannot find celib support library directory]) + else + no_celib= + CELIB_DIR=${ac_cv_c_celibconfig} + CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` + AC_MSG_RESULT([found $CELIB_DIR]) + fi + fi +]) + + +# Local Variables: +# mode: autoconf +# End: Index: library/xml/TclExpat-1.1/tclexpat.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/tclexpat.c (revision 0) +++ library/xml/TclExpat-1.1/tclexpat.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1478 @@ +/* + * tclexpat.c -- + * + * A Tcl interface to James Clark's expat XML parser + * + * Copyright (c) 1998 Steve Ball, Zveno Pty Ltd + * + * Zveno Pty Ltd makes this software and associated documentation + * available free of charge for any purpose. You may make copies + * of the software but you must include all of this notice on any copy. + * + * Zveno Pty Ltd does not warrant that this software is error free + * or fit for any purpose. Zveno Pty Ltd disclaims any liability for + * all claims, expenses, losses, damages and costs any user may incur + * as a result of using, copying or modifying the software. + * + * $Id: tclexpat.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ + * + */ + +#include +#include +#include +#include "xmlparse.h" + + +/* + * The structure below is used to refer to an expat parser object. + */ + +typedef struct TclExpatInfo { + XML_Parser parser; /* The expat parser structure */ + Tcl_Interp *interp; /* Interpreter for this instance */ + Tcl_Obj *name; /* name of this instance */ + + int final; /* input data complete? */ + + int status; /* application status */ + Tcl_Obj *result; /* application return result */ + + int continueCount; /* reference count for continue */ + + Tcl_Obj *elementstartcommand; /* Script for element start */ + Tcl_Obj *elementendcommand; /* Script for element end */ + Tcl_Obj *datacommand; /* Script for character data */ + Tcl_Obj *picommand; /* Script for processing instruction */ + Tcl_Obj *defaultcommand; /* Script for default data */ + Tcl_Obj *unparsedcommand; /* Script for unparsed entity declaration */ + Tcl_Obj *notationcommand; /* Script for notation declaration */ + Tcl_Obj *externalentitycommand; /* Script for external entity */ + Tcl_Obj *unknownencodingcommand; /* Script for unknown character encoding */ + +} TclExpatInfo; + +/* + * Prototypes for procedures defined later in this file: + */ + +static Tcl_ObjCmdProc TclExpatObjCmd; +static Tcl_ObjCmdProc TclExpatInstanceCmd; +static Tcl_CmdDeleteProc TclExpatDeleteCmd; +static int (TclExpatCreateParser) _ANSI_ARGS_((Tcl_Interp *interp, + TclExpatInfo *expat)); +static void (TclExpatFreeParser) _ANSI_ARGS_((TclExpatInfo *expat)); +static int (TclExpatParse) _ANSI_ARGS_((Tcl_Interp *interp, + TclExpatInfo *expat, + char *data, + size_t len)); +static int (TclExpatConfigure) _ANSI_ARGS_((Tcl_Interp *interp, + TclExpatInfo *expat, + int objc, + Tcl_Obj *CONST objv[])); +static int (TclExpatCget) _ANSI_ARGS_((Tcl_Interp *interp, + TclExpatInfo *expat, + int objc, + Tcl_Obj *CONST objv[])); + +static void * (TclExpatElementStartHandler) _ANSI_ARGS_((void *userdata, + const XML_Char *name, + const XML_Char **atts)); +static void * (TclExpatElementEndHandler) _ANSI_ARGS_((void *userData, + const XML_Char *name)); +static void * (TclExpatCharacterDataHandler) _ANSI_ARGS_((void *userData, + const XML_Char *s, + int len)); +static void * (TclExpatProcessingInstructionHandler) _ANSI_ARGS_((void *userData, + const XML_Char *target, + const XML_Char *data)); +static void * (TclExpatExternalEntityRefHandler) _ANSI_ARGS_((XML_Parser parser, + const XML_Char *openEntityNames, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId)); +static void * (TclExpatDefaultHandler) _ANSI_ARGS_ ((void *userData, + const XML_Char *s, + int len)); +static void * (TclExpatUnparsedDeclHandler) _ANSI_ARGS_ ((void *userData, + const XML_Char *entityname, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId, + const XML_Char *notationName)); +static void * (TclExpatNotationDeclHandler) _ANSI_ARGS_ ((void *userData, + const XML_Char *notationName, + const XML_Char *base, + const XML_Char *systemId, const XML_Char *publicId)); +static int (TclExpatUnknownEncodingHandler) _ANSI_ARGS_ ((void *encodingHandlerData, + const XML_Char *name, + XML_Encoding *info)); + +#if defined(PRE81) + +/* + *---------------------------------------------------------------------------- + * + * Tcl_GetString -- + * + * Compatibility routine for Tcl 8.0 + * + * Results: + * String representation of object.. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +char * +Tcl_GetString (obj) + Tcl_Obj *obj; /* Object to retrieve string from. */ +{ + char *s; + int i; + + s = Tcl_GetStringFromObj(obj, &i); + return s; +} +#endif + +/* + *---------------------------------------------------------------------------- + * + * TclExpat_Init -- + * + * Initialisation routine for loadable module + * + * Results: + * None. + * + * Side effects: + * Defines "expat" command in the interpreter. + * + *---------------------------------------------------------------------------- + */ + +/* this should be done via the stubs ... for the time being + simply export */ +#ifdef VISUAL_CC +DLLEXPORT extern int Xotclexpat_Init(Tcl_Interp * interp); +# define CONST_XOTCL_EXPAT +#else +# if defined(PRE84) +# define CONST_XOTCL_EXPAT +# else +# define CONST_XOTCL_EXPAT CONST84 +# endif +#endif + +extern int +Xotclexpat_Init (interp) + Tcl_Interp *interp; /* Interpreter to initialise. */ +{ +#ifdef USE_TCL_STUBS + if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { + return TCL_ERROR; + } +#ifdef USE_XOTCL_STUBS + if (Xotcl_InitStubs(interp, "1.1", 0) == NULL) { + return TCL_ERROR; + } +#endif +#else + if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) { + return TCL_ERROR; + } +#endif + + + Tcl_PkgProvide(interp, "xotcl::xml::expat", PACKAGE_VERSION); + + Tcl_CreateObjCommand(interp, "expat", TclExpatObjCmd, NULL, NULL); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatObjCmd -- + * + * Creation command for expat class. + * + * Results: + * The name of the newly created parser instance. + * + * Side effects: + * This creates an expat parser. + * + *---------------------------------------------------------------------------- + */ + +int +TclExpatObjCmd(dummy, interp, objc, objv) + ClientData dummy; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; +{ + TclExpatInfo *expat; + + if (objc < 2) { + Tcl_WrongNumArgs(interp, 1, objv, "name ?args?"); + return TCL_ERROR; + } + + /* + * Create the data structures for this parser. + */ + + if (!(expat = (TclExpatInfo *) ckalloc(sizeof(TclExpatInfo)))) { + ckfree((char*)expat); + Tcl_SetResult(interp, "unable to create parser", NULL); + return TCL_ERROR; + } + expat->interp = interp; + Tcl_IncrRefCount(objv[1]); + expat->name = objv[1]; + + expat->elementstartcommand = NULL; + expat->elementendcommand = NULL; + expat->datacommand = NULL; + expat->picommand = NULL; + expat->defaultcommand = NULL; + expat->unparsedcommand = NULL; + expat->notationcommand = NULL; + expat->externalentitycommand = NULL; + expat->unknownencodingcommand = NULL; + + if (TclExpatCreateParser(interp, expat) != TCL_OK) { + ckfree((char*)expat); + return TCL_ERROR; + } + + /* + * Register a Tcl command for this parser instance. + */ + + Tcl_CreateObjCommand(interp, Tcl_GetString(expat->name), TclExpatInstanceCmd, (ClientData) expat, TclExpatDeleteCmd); + + /* + * Handle configuration options + */ + + if (objc > 2) { + TclExpatConfigure(interp, expat, objc - 2, objv + 2); + } + + Tcl_SetObjResult(interp, expat->name); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatCreateParser -- + * + * Create the expat parser and initialise (some of) the TclExpatInfo + * structure. + * + * Note that callback commands are not affected by this routine, + * to allow a reset to leave these intact. + * + * Results: + * New parser instance created and initialised. + * + * Side effects: + * Creates an expat parser. + * Modifies TclExpatInfo fields. + * + *---------------------------------------------------------------------------- + */ + +int +TclExpatCreateParser(interp, expat) + Tcl_Interp *interp; + TclExpatInfo *expat; +{ + if (!(expat->parser = XML_ParserCreate(NULL))) { + Tcl_SetResult(interp, "unable to create expat parser", NULL); + return TCL_ERROR; + } + + expat->final = 1; + expat->status = TCL_OK; + expat->result = NULL; + expat->continueCount = 0; + + /* + * Set handlers for the parser to routines in this module. + */ + + XML_SetElementHandler(expat->parser, + (XML_StartElementHandler) TclExpatElementStartHandler, + (XML_EndElementHandler) TclExpatElementEndHandler); + XML_SetCharacterDataHandler(expat->parser, + (XML_CharacterDataHandler) TclExpatCharacterDataHandler); + XML_SetProcessingInstructionHandler(expat->parser, + (XML_ProcessingInstructionHandler) TclExpatProcessingInstructionHandler); + XML_SetDefaultHandler(expat->parser, + (XML_DefaultHandler) TclExpatDefaultHandler); + XML_SetUnparsedEntityDeclHandler(expat->parser, + (XML_UnparsedEntityDeclHandler) TclExpatUnparsedDeclHandler); + XML_SetNotationDeclHandler(expat->parser, + (XML_NotationDeclHandler) TclExpatNotationDeclHandler); + XML_SetExternalEntityRefHandler(expat->parser, + (XML_ExternalEntityRefHandler) TclExpatExternalEntityRefHandler); + XML_SetUnknownEncodingHandler(expat->parser, + (XML_UnknownEncodingHandler) TclExpatUnknownEncodingHandler, + (void *) expat); + XML_SetUserData(expat->parser, + (void *) expat); + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatFreeParser -- + * + * Destroy the expat parser structure. + * + * Results: + * None. + * + * Side effects: + * Frees any memory allocated for the XML parser. + * + *---------------------------------------------------------------------------- + */ + +void +TclExpatFreeParser(expat) + TclExpatInfo *expat; +{ + XML_ParserFree(expat->parser); + expat->parser = NULL; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatInstanceCmd -- + * + * Implements instance command for expat class objects. + * + * Results: + * Depends on the method. + * + * Side effects: + * Depends on the method. + * + *---------------------------------------------------------------------------- + */ + +int +TclExpatInstanceCmd (clientData, interp, objc, objv) + ClientData clientData; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; +{ + TclExpatInfo *expat = (TclExpatInfo *) clientData; + char *data; + size_t len; + int index, result = TCL_OK; + static char CONST_XOTCL_EXPAT *options[] = { + "configure", "cget", "parse", "reset", NULL + }; + enum options { + EXPAT_CONFIGURE, EXPAT_CGET, EXPAT_PARSE, EXPAT_RESET + }; + + if (objc < 2) { + Tcl_WrongNumArgs(interp, 1, objv, "method ?args?"); + return TCL_ERROR; + } + + if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0, + &index) != TCL_OK) { + return TCL_ERROR; + } + + switch ((enum options) index) { + case EXPAT_CONFIGURE: + + result = TclExpatConfigure(interp, (TclExpatInfo *) clientData, objc - 2, objv + 2); + break; + + case EXPAT_CGET: + + result = TclExpatCget(interp, (TclExpatInfo *) clientData, objc - 2, objv + 2); + break; + + case EXPAT_PARSE: + + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "data"); + return TCL_ERROR; + } + + data = Tcl_GetStringFromObj(objv[2], &len); + + result = TclExpatParse(interp, expat, data, len); + + break; + + case EXPAT_RESET: + + if (objc > 2) { + Tcl_WrongNumArgs(interp, 1, objv, ""); + return TCL_ERROR; + } + + /* + * Destroy the parser and create a fresh one. + */ + + TclExpatFreeParser(expat); + TclExpatCreateParser(interp, expat); + + break; + + default: + + Tcl_SetResult(interp, "unknown method", NULL); + return TCL_ERROR; + + } + + return result; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatParse -- + * + * Wrapper to invoke expat parser and check return result. + * + * Results: + * TCL_OK if no errors, TCL_ERROR otherwise. + * + * Side effects: + * Sets interpreter result as appropriate. + * + *---------------------------------------------------------------------------- + */ + +int +TclExpatParse (interp, expat, data, len) + Tcl_Interp *interp; + TclExpatInfo *expat; + char *data; + size_t len; +{ + int result; + char s[255]; + + expat->status = TCL_OK; + if (expat->result != NULL) { + Tcl_DecrRefCount(expat->result); + } + expat->result = NULL; + + result = XML_Parse(expat->parser, + data, len, + expat->final); + + if (!result) { + Tcl_ResetResult(interp); + sprintf(s, "%d", XML_GetCurrentLineNumber(expat->parser)); + Tcl_AppendResult(interp, "error \"", + XML_ErrorString(XML_GetErrorCode(expat->parser)), + "\" at line ", s, " character ", NULL); + sprintf(s, "%d", XML_GetCurrentColumnNumber(expat->parser)); + Tcl_AppendResult(interp, s, NULL); + + return TCL_ERROR; + } + + switch (expat->status) { + case TCL_OK: + case TCL_BREAK: + case TCL_CONTINUE: + Tcl_ResetResult(interp); + return TCL_OK; + + case TCL_ERROR: + Tcl_SetObjResult(interp, expat->result); + return TCL_ERROR; + + default: + Tcl_SetResult(interp, "unknown parsing status", NULL); + return TCL_ERROR; + } + +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatConfigure -- + * + * Implements instance command for expat class objects. + * + * Results: + * Depends on the method. + * + * Side effects: + * Depends on the method. + * + *---------------------------------------------------------------------------- + */ + +int +TclExpatConfigure (interp, expat, objc, objv) + Tcl_Interp *interp; + TclExpatInfo *expat; + int objc; + Tcl_Obj *CONST objv[]; +{ + static CONST_XOTCL_EXPAT char *switchTable[] = { + "-final", + "-baseurl", + "-elementstartcommand", + "-elementendcommand", + "-characterdatacommand", + "-processinginstructioncommand", + "-defaultcommand", + "-unparsedentitydeclcommand", + "-notationdeclcommand", + "-externalentitycommand", + "-unknownencodingcommand", + (char *) NULL + }; + enum switches { + EXPAT_FINAL, EXPAT_BASE, + EXPAT_ELEMENTSTARTCMD, EXPAT_ELEMENTENDCMD, + EXPAT_DATACMD, EXPAT_PICMD, + EXPAT_DEFAULTCMD, + EXPAT_UNPARSEDENTITYCMD, EXPAT_NOTATIONCMD, + EXPAT_EXTERNALENTITYCMD, EXPAT_UNKNOWNENCODINGCMD + }; + int index, bool, doParse = 0; + Tcl_Obj *CONST *objPtr = objv; + + while (objc > 1) { + if (Tcl_GetIndexFromObj(interp, objPtr[0], switchTable, + "switch", 0, &index) != TCL_OK) { + return TCL_ERROR; + } + switch ((enum switches) index) { + case EXPAT_FINAL: /* -final */ + + if (Tcl_GetBooleanFromObj(interp, objPtr[1], &bool) != TCL_OK) { + return TCL_ERROR; + } + + if (bool && !expat->final) { + + expat->final = bool; + doParse = 1; + + } else if (!bool && expat->final) { + + /* + * Reset the parser for new input + */ + + TclExpatFreeParser(expat); + TclExpatCreateParser(interp, expat); + doParse = 0; + + } + + break; + + case EXPAT_BASE: /* -base */ + + if (XML_SetBase(expat->parser, Tcl_GetString(objPtr[1])) == 0) { + Tcl_SetResult(interp, "unable to set base URL", NULL); + return TCL_ERROR; + } + break; + + case EXPAT_ELEMENTSTARTCMD: /* -elementstartcommand */ + + if (expat->elementstartcommand != NULL) { + Tcl_DecrRefCount(expat->elementstartcommand); + } + + expat->elementstartcommand = objPtr[1]; + Tcl_IncrRefCount(expat->elementstartcommand); + + break; + + case EXPAT_ELEMENTENDCMD: /* -elementendcommand */ + + if (expat->elementendcommand != NULL) { + Tcl_DecrRefCount(expat->elementendcommand); + } + + expat->elementendcommand = objPtr[1]; + Tcl_IncrRefCount(expat->elementendcommand); + + break; + + case EXPAT_DATACMD: /* -characterdatacommand */ + + if (expat->datacommand != NULL) { + Tcl_DecrRefCount(expat->datacommand); + } + + expat->datacommand = objPtr[1]; + Tcl_IncrRefCount(expat->datacommand); + + break; + + case EXPAT_PICMD: /* -processinginstructioncommand */ + + if (expat->picommand != NULL) { + Tcl_DecrRefCount(expat->picommand); + } + + expat->picommand = objPtr[1]; + Tcl_IncrRefCount(expat->picommand); + + break; + + case EXPAT_DEFAULTCMD: /* -defaultcommand */ + + if (expat->defaultcommand != NULL) { + Tcl_DecrRefCount(expat->defaultcommand); + } + + expat->defaultcommand = objPtr[1]; + Tcl_IncrRefCount(expat->defaultcommand); + + break; + + case EXPAT_UNPARSEDENTITYCMD: /* -unparsedentitydeclcommand */ + + if (expat->unparsedcommand != NULL) { + Tcl_DecrRefCount(expat->unparsedcommand); + } + + expat->unparsedcommand = objPtr[1]; + Tcl_IncrRefCount(expat->unparsedcommand); + + break; + + case EXPAT_NOTATIONCMD: /* -notationdeclcommand */ + + if (expat->notationcommand != NULL) { + Tcl_DecrRefCount(expat->notationcommand); + } + + expat->notationcommand = objPtr[1]; + Tcl_IncrRefCount(expat->notationcommand); + + break; + + case EXPAT_EXTERNALENTITYCMD: /* -externalentitycommand */ + + if (expat->externalentitycommand != NULL) { + Tcl_DecrRefCount(expat->externalentitycommand); + } + + expat->externalentitycommand = objPtr[1]; + Tcl_IncrRefCount(expat->externalentitycommand); + + break; + + case EXPAT_UNKNOWNENCODINGCMD: /* -unknownencodingcommand */ + + /* Not implemented */ + break; + + if (expat->unknownencodingcommand != NULL) { + Tcl_DecrRefCount(expat->unknownencodingcommand); + } + + expat->unknownencodingcommand = objPtr[1]; + Tcl_IncrRefCount(expat->unknownencodingcommand); + + break; + + } + + objPtr += 2; + objc -= 2; + + } + + if (doParse) { + return TclExpatParse(interp, expat->parser, "", 0); + } else { + return TCL_OK; + } + +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatCget -- + * + * Returns setting of configuration option. + * Not yet implemented. + * + * Results: + * Option value. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +TclExpatCget (interp, expat, objc, objv) + Tcl_Interp *interp; + TclExpatInfo *expat; + int objc; + Tcl_Obj *CONST objv[]; +{ + Tcl_SetResult(interp, "method not implemented", NULL); + return TCL_ERROR; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatHandlerResult -- + * + * Manage the result of the application callback. + * + * Results: + * None. + * + * Side Effects: + * Further invocation of callback scripts may be inhibited. + * + *---------------------------------------------------------------------------- + */ + +void +TclExpatHandlerResult(expat, result) + TclExpatInfo *expat; + int result; +{ + switch (result) { + case TCL_OK: + expat->status = TCL_OK; + break; + + case TCL_CONTINUE: + /* + * Skip callbacks until the matching end element event + * occurs for the currently open element. + * Keep a reference count to handle nested + * elements. + */ + expat->status = TCL_CONTINUE; + expat->continueCount = 1; + break; + + case TCL_BREAK: + /* + * Skip all further callbacks, but return OK. + */ + expat->status = TCL_BREAK; + break; + + case TCL_ERROR: + /* + * Skip all further callbacks, and return error. + */ + default: + expat->status = TCL_ERROR; + expat->result = Tcl_GetObjResult(expat->interp); + Tcl_IncrRefCount(expat->result); + break; + } +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatElementStartHandler -- + * + * Called by expat for each start tag. + * + * Results: + * None. + * + * Side Effects: + * Callback script is invoked. + * + *---------------------------------------------------------------------------- + */ + +static void * +TclExpatElementStartHandler(userData, name, atts) + void *userData; + const char *name; + const char **atts; +{ + TclExpatInfo *expat = (TclExpatInfo *) userData; + Tcl_Obj *atList, *cmdPtr; + const char **atPtr; + int result; + + if (expat->status == TCL_CONTINUE) { + + /* + * We're currently skipping elements looking for the + * close of the continued element. + */ + + expat->continueCount++; + return NULL; + } + + if (expat->elementstartcommand == NULL || + expat->status != TCL_OK) { + return NULL; + } + + /* + * Convert the attribute list into a Tcl key-value paired list. + */ + + atList = Tcl_NewListObj(0, NULL); + for (atPtr = atts; atPtr[0] && atPtr[1]; atPtr += 2) { + Tcl_ListObjAppendElement(expat->interp, atList, Tcl_NewStringObj((char *)atPtr[0], strlen(atPtr[0]))); + Tcl_ListObjAppendElement(expat->interp, atList, Tcl_NewStringObj((char *)atPtr[1], strlen(atPtr[1]))); + } + + /* + * Take a copy of the callback script so that arguments may be appended. + */ + + cmdPtr = Tcl_DuplicateObj(expat->elementstartcommand); + Tcl_IncrRefCount(cmdPtr); + Tcl_Preserve((ClientData) expat->interp); + + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)name, strlen(name))); + Tcl_ListObjAppendElement(expat->interp, cmdPtr, atList); + + /* + * It would be desirable to be able to terminate parsing + * if the return result is TCL_ERROR or TCL_BREAK. + */ +#if defined(PRE81) + result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); +#elif defined(PRE82) + result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#else + result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#endif + + Tcl_DecrRefCount(cmdPtr); + Tcl_Release((ClientData) expat->interp); + + TclExpatHandlerResult(expat, result); + + return NULL; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatElementEndHandler -- + * + * Called by expat for each end tag. + * + * Results: + * None. + * + * Side Effects: + * Callback script is invoked. + * + *---------------------------------------------------------------------------- + */ + +static void * +TclExpatElementEndHandler(userData, name) + void *userData; + CONST char *name; +{ + TclExpatInfo *expat = (TclExpatInfo *) userData; + Tcl_Obj *cmdPtr; + int result; + + if (expat->status == TCL_CONTINUE) { + /* + * We're currently skipping elements looking for the + * end of the currently open element. + */ + + if (!--(expat->continueCount)) { + expat->status = TCL_OK; + return NULL; + } + } + + if (expat->elementendcommand == NULL || + expat->status != TCL_OK) { + return NULL; + } + + /* + * Take a copy of the callback script so that arguments may be appended. + */ + + cmdPtr = Tcl_DuplicateObj(expat->elementendcommand); + Tcl_IncrRefCount(cmdPtr); + Tcl_Preserve((ClientData) expat->interp); + + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)name, strlen(name))); + + /* + * It would be desirable to be able to terminate parsing + * if the return result is TCL_ERROR or TCL_BREAK. + */ +#if defined(PRE81) + result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); +#elif defined(PRE82) + result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#else + result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#endif + + Tcl_DecrRefCount(cmdPtr); + Tcl_Release((ClientData) expat->interp); + + TclExpatHandlerResult(expat, result); + + return NULL; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatCharacterDataHandler -- + * + * Called by expat for character data. + * + * Results: + * None. + * + * Side Effects: + * Callback script is invoked. + * + *---------------------------------------------------------------------------- + */ + +static void * +TclExpatCharacterDataHandler(userData, s, len) + void *userData; + CONST char *s; + int len; +{ + TclExpatInfo *expat = (TclExpatInfo *) userData; + Tcl_Obj *cmdPtr; + int result; + + if (expat->datacommand == NULL || + expat->status != TCL_OK) { + return NULL; + } + + /* + * Take a copy of the callback script so that arguments may be appended. + */ + + cmdPtr = Tcl_DuplicateObj(expat->datacommand); + Tcl_IncrRefCount(cmdPtr); + Tcl_Preserve((ClientData) expat->interp); + + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)s, len)); + + /* + * It would be desirable to be able to terminate parsing + * if the return result is TCL_ERROR or TCL_BREAK. + */ +#if defined(PRE81) + result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); +#elif defined(PRE82) + result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#else + result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#endif + + Tcl_DecrRefCount(cmdPtr); + Tcl_Release((ClientData) expat->interp); + + TclExpatHandlerResult(expat, result); + + return NULL; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatProcessingInstructionHandler -- + * + * Called by expat for processing instructions. + * + * Results: + * None. + * + * Side Effects: + * Callback script is invoked. + * + *---------------------------------------------------------------------------- + */ + +static void * +TclExpatProcessingInstructionHandler(userData, target, data) + void *userData; + CONST char *target; + CONST char *data; +{ + TclExpatInfo *expat = (TclExpatInfo *) userData; + Tcl_Obj *cmdPtr; + int result; + + if (expat->picommand == NULL || + expat->status != TCL_OK) { + return NULL; + } + + /* + * Take a copy of the callback script so that arguments may be appended. + */ + + cmdPtr = Tcl_DuplicateObj(expat->picommand); + Tcl_IncrRefCount(cmdPtr); + Tcl_Preserve((ClientData) expat->interp); + + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)target, strlen(target))); + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)data, strlen(data))); + + /* + * It would be desirable to be able to terminate parsing + * if the return result is TCL_ERROR or TCL_BREAK. + */ +#if defined(PRE81) + result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); +#elif defined(PRE82) + result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#else + result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#endif + + Tcl_DecrRefCount(cmdPtr); + Tcl_Release((ClientData) expat->interp); + + TclExpatHandlerResult(expat, result); + + return NULL; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatDefaultHandler -- + * + * Called by expat for processing data which has no other handler. + * + * Results: + * None. + * + * Side Effects: + * Callback script is invoked. + * + *---------------------------------------------------------------------------- + */ + +static void * +TclExpatDefaultHandler(userData, s, len) + void *userData; + CONST char *s; + int len; +{ + TclExpatInfo *expat = (TclExpatInfo *) userData; + Tcl_Obj *cmdPtr; + int result; + + if (expat->defaultcommand == NULL || + expat->status != TCL_OK) { + return NULL; + } + + /* + * Take a copy of the callback script so that arguments may be appended. + */ + + cmdPtr = Tcl_DuplicateObj(expat->defaultcommand); + Tcl_IncrRefCount(cmdPtr); + Tcl_Preserve((ClientData) expat->interp); + + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)s, len)); + + /* + * It would be desirable to be able to terminate parsing + * if the return result is TCL_ERROR or TCL_BREAK. + */ +#if defined(PRE81) + result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); +#elif defined(PRE82) + result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#else + result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#endif + + Tcl_DecrRefCount(cmdPtr); + Tcl_Release((ClientData) expat->interp); + + TclExpatHandlerResult(expat, result); + + return NULL; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatUnparsedDeclHandler -- + * + * Called by expat for processing an unparsed entity references. + * + * Results: + * None. + * + * Side Effects: + * Callback script is invoked. + * + *---------------------------------------------------------------------------- + */ + +static void * +TclExpatUnparsedDeclHandler(userData, entityname, base, systemId, publicId, notationName) + void *userData; + CONST char *entityname; + CONST char *base; + CONST char *systemId; + CONST char *publicId; + CONST char *notationName; +{ + TclExpatInfo *expat = (TclExpatInfo *) userData; + Tcl_Obj *cmdPtr; + int result; + + if (expat->unparsedcommand == NULL || + expat->status != TCL_OK) { + return NULL; + } + + /* + * Take a copy of the callback script so that arguments may be appended. + */ + + cmdPtr = Tcl_DuplicateObj(expat->unparsedcommand); + Tcl_IncrRefCount(cmdPtr); + Tcl_Preserve((ClientData) expat->interp); + + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)entityname, strlen(entityname))); + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)base, strlen(base))); + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)systemId, strlen(systemId))); + if (publicId == NULL) { + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewListObj(0, NULL)); + } else { + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)publicId, strlen(publicId))); + } + if (notationName == NULL) { + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewListObj(0, NULL)); + } else { + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)notationName, strlen(notationName))); + } + + /* + * It would be desirable to be able to terminate parsing + * if the return result is TCL_ERROR or TCL_BREAK. + */ +#if defined(PRE81) + result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); +#elif defined(PRE82) + result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#else + result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#endif + + Tcl_DecrRefCount(cmdPtr); + Tcl_Release((ClientData) expat->interp); + + TclExpatHandlerResult(expat, result); + + return NULL; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatNotationDeclHandler -- + * + * Called by expat for processing a notation declaration. + * + * Results: + * None. + * + * Side Effects: + * Callback script is invoked. + * + *---------------------------------------------------------------------------- + */ + +static void * +TclExpatNotationDeclHandler(userData, notationName, base, systemId, publicId) + void *userData; + CONST char *notationName; + CONST char *base; + CONST char *systemId; + CONST char *publicId; +{ + TclExpatInfo *expat = (TclExpatInfo *) userData; + Tcl_Obj *cmdPtr; + int result; + + if (expat->notationcommand == NULL || + expat->status != TCL_OK) { + return NULL; + } + + /* + * Take a copy of the callback script so that arguments may be appended. + */ + + cmdPtr = Tcl_DuplicateObj(expat->notationcommand); + Tcl_IncrRefCount(cmdPtr); + Tcl_Preserve((ClientData) expat->interp); + + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)notationName, strlen(notationName))); + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)base, strlen(base))); + if (systemId == NULL) { + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewListObj(0, NULL)); + } else { + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)systemId, strlen(systemId))); + } + if (publicId == NULL) { + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewListObj(0, NULL)); + } else { + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)publicId, strlen(publicId))); + } + + /* + * It would be desirable to be able to terminate parsing + * if the return result is TCL_ERROR or TCL_BREAK. + */ +#if defined(PRE81) + result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); +#elif defined(PRE82) + result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#else + result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#endif + + Tcl_DecrRefCount(cmdPtr); + Tcl_Release((ClientData) expat->interp); + + TclExpatHandlerResult(expat, result); + + return NULL; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatUnknownEncodingHandler -- + * + * Called by expat for processing a reference to a character in an + * unknown encoding. + * + * Results: + * None. + * + * Side Effects: + * Callback script is invoked. + * + *---------------------------------------------------------------------------- + */ + +static int +TclExpatUnknownEncodingHandler(encodingHandlerData, name, info) + void *encodingHandlerData; + CONST char *name; + XML_Encoding *info; +{ + TclExpatInfo *expat = (TclExpatInfo *) encodingHandlerData; + Tcl_Obj *cmdPtr; + int result; + + Tcl_SetResult(expat->interp, "not implemented", NULL); + return 0; + + if (expat->unknownencodingcommand == NULL || + expat->status != TCL_OK) { + return 0; + } + + /* + * Take a copy of the callback script so that arguments may be appended. + */ + + cmdPtr = Tcl_DuplicateObj(expat->unknownencodingcommand); + Tcl_IncrRefCount(cmdPtr); + Tcl_Preserve((ClientData) expat->interp); + + /* + * Setup the arguments + */ + + /* + * It would be desirable to be able to terminate parsing + * if the return result is TCL_ERROR or TCL_BREAK. + */ +#if defined(PRE81) + result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); +#elif defined(PRE82) + result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#else + result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#endif + + Tcl_DecrRefCount(cmdPtr); + Tcl_Release((ClientData) expat->interp); + + TclExpatHandlerResult(expat, result); + + /* + * NOTE: have to decide whether to return 0 or 1 here, + * since Expat is waiting for an answer. + */ + return 0; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatExternalEntityRefHandler -- + * + * Called by expat for processing external entity references. + * + * Results: + * None. + * + * Side Effects: + * Callback script is invoked. + * + *---------------------------------------------------------------------------- + */ + +static void * +TclExpatExternalEntityRefHandler(parser, openEntityNames, base, systemId, publicId) + XML_Parser parser; + CONST char *openEntityNames; + CONST char *base; + CONST char *systemId; + CONST char *publicId; +{ + TclExpatInfo *expat = (TclExpatInfo *) XML_GetUserData(parser); + Tcl_Obj *cmdPtr; + int result; + + if (expat->externalentitycommand == NULL || + expat->status != TCL_OK) { + return NULL; + } + + /* + * Take a copy of the callback script so that arguments may be appended. + */ + + cmdPtr = Tcl_DuplicateObj(expat->externalentitycommand); + Tcl_IncrRefCount(cmdPtr); + Tcl_Preserve((ClientData) expat->interp); + + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)openEntityNames, strlen(openEntityNames))); + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)base, strlen(base))); + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)systemId, strlen(systemId))); + Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)publicId, strlen(publicId))); + + /* + * It would be desirable to be able to terminate parsing + * if the return result is TCL_ERROR or TCL_BREAK. + */ +#if defined(PRE81) + result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); +#elif defined(PRE82) + result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#else + result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); +#endif + + Tcl_DecrRefCount(cmdPtr); + Tcl_Release((ClientData) expat->interp); + + TclExpatHandlerResult(expat, result); + + return NULL; +} + +/* + *---------------------------------------------------------------------------- + * + * TclExpatDeleteCmd -- + * + * Called when a expat parser is deleted. + * + * Results: + * None. + * + * Side Effects: + * Memory structures are freed. + * + *---------------------------------------------------------------------------- + */ + +static void +TclExpatDeleteCmd(clientData) + ClientData clientData; +{ + TclExpatInfo *expat = (TclExpatInfo *) clientData; + + TclExpatFreeParser(expat); + + Tcl_DecrRefCount(expat->name); + + if (expat->elementstartcommand) { + Tcl_DecrRefCount(expat->elementstartcommand); + } + if (expat->elementendcommand) { + Tcl_DecrRefCount(expat->elementendcommand); + } + if (expat->datacommand) { + Tcl_DecrRefCount(expat->datacommand); + } + if (expat->picommand) { + Tcl_DecrRefCount(expat->picommand); + } + if (expat->externalentitycommand) { + Tcl_DecrRefCount(expat->externalentitycommand); + } +} Index: library/xml/TclExpat-1.1/test-break.tcl =================================================================== diff -u -N --- library/xml/TclExpat-1.1/test-break.tcl (revision 0) +++ library/xml/TclExpat-1.1/test-break.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,80 @@ +#!/bin/sh +#\ +exec tclsh8.1 "$0" "$@" + +# This tests the function of the break facility + +lappend auto_path [file dirname [info script]] +package require expat + +proc element {tag name {attrs {}}} { + array set at $attrs + if {[info exists at(class)]} { + switch $at(class) { + continue { + return -code continue + } + break { + return -code break + } + error { + return -code error "error condition in XML" + } + } + } +} +proc pi {name args} { + if {$name eq "break"} { + return -code break + } +} +proc pcdata pcdata { + if {[string length [string trim $pcdata]]} { + puts $pcdata + } +} + +set data(test1) { + + +Should see this data +Should not see this data +Should not see this data +} +set data(test2) { + + +Should see this data +Should see this data + Should not see this data + +Should not see this data +} +set data(test3) { + + +Should see this data +Should see this data + +Should not see this data +} + +set parser [expat xmlparser \ + -elementstartcommand {element start} \ + -elementendcommand {element end} \ + -characterdatacommand pcdata \ + -processinginstructioncommand pi \ + -final yes \ +] + +foreach {testName testData} [array get data] { + puts "*** $testName" + $parser reset + if {[catch {$parser parse $testData} err]} { + puts [list test failed due to $err] + } else { + puts [list test passed] + } +} + +exit 0 \ No newline at end of file Index: library/xml/TclExpat-1.1/test-continue.tcl =================================================================== diff -u -N --- library/xml/TclExpat-1.1/test-continue.tcl (revision 0) +++ library/xml/TclExpat-1.1/test-continue.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,85 @@ +#!/bin/sh +#\ +exec tclsh8.1 "$0" "$@" + +# This tests the function of the continue facility + +lappend auto_path [file dirname [info script]] +package require expat + +proc element {tag name {attrs {}}} { + array set at $attrs + if {[info exists at(class)]} { + switch $at(class) { + continue { + return -code continue + } + break { + return -code break + } + error { + return -code error "error condition in XML" + } + } + } +} +proc pi {name args} { + if {[regexp {continue|break|error} $name]} { + return -code $name + } +} +proc pcdata pcdata { + if {[string length [string trim $pcdata]]} { + puts $pcdata + } +} + +set data(test1) { + + +Should see this data +Should not see this data +Should see this data +} +set data(test2) { + + +Should see this data +Should see this data + Should not see this data +Should see this data + +Should see this data +} +set data(test3) { + + +Should see this data +Should not see this data + Should not see this data + + Should not see this data + + Should not see this data + +Should see this data +} + +set parser [expat xmlparser \ + -elementstartcommand {element start} \ + -elementendcommand {element end} \ + -characterdatacommand pcdata \ + -final yes \ +] + +foreach {testName testData} [array get data] { + puts "*** $testName" + $parser reset + if {[catch {$parser parse $testData} err]} { + puts [list test failed due to $err] + } else { + puts [list test passed] + } +} + +exit 0 \ No newline at end of file Index: library/xml/TclExpat-1.1/test-error.tcl =================================================================== diff -u -N --- library/xml/TclExpat-1.1/test-error.tcl (revision 0) +++ library/xml/TclExpat-1.1/test-error.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,58 @@ +#!/bin/sh +#\ +exec tclsh8.1 "$0" "$@" + +# This tests the function of the error facility + +lappend auto_path [file dirname [info script]] +package require expat + +proc element {tag name {attrs {}}} { + array set at $attrs + if {[info exists at(class)]} { + switch $at(class) { + continue { + return -code continue + } + break { + return -code break + } + error { + return -code error "error condition in XML" + } + } + } +} +proc pcdata pcdata { + if {[string length [string trim $pcdata]]} { + puts $pcdata + } +} + +set data(error) { + + +Should see this data +Should not see this data +Should not see this data +} + +set parser [expat xmlparser \ + -elementstartcommand {element start} \ + -elementendcommand {element end} \ + -characterdatacommand pcdata \ + -final yes \ +] + +puts {*** Test error} +if {[catch {$parser parse $data(error)} err]} { + if {$err ne "error condition in XML" } { + puts [list test failed, incorrect error message: $err] + } else { + puts [list test passed] + } +} else { + puts [list test failed, no error returned] +} + +exit 0 \ No newline at end of file Index: library/xml/TclExpat-1.1/tester =================================================================== diff -u -N --- library/xml/TclExpat-1.1/tester (revision 0) +++ library/xml/TclExpat-1.1/tester (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,34 @@ +#!/bin/sh +#\ +exec tclsh8.1 "$0" "$@" + +#load ./tclexpat.sl Tclexpat +#load ./tclexpat.so Tclexpat +lappend auto_path [file dirname [info script]] +package require expat + +proc element {tag name {attrs {}}} { + puts [list Element $tag $name $attrs] +} +proc pcdata pcdata { + puts [list Character data: $pcdata] +} + +set ch [open [lindex $argv 0]] +set data [read $ch] +close $ch + +puts stderr [list creating parser] + +set parser [expat xmlparser \ + -elementstartcommand {element start} \ + -elementendcommand {element end} \ + -characterdatacommand pcdata \ + -final yes \ +] + +puts stderr [list parsing document] + +$parser parse $data + +exit 0 \ No newline at end of file Index: library/xml/TclExpat-1.1/unixfilemap.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/unixfilemap.c (revision 0) +++ library/xml/TclExpat-1.1/unixfilemap.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,72 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef MAP_FILE +#define MAP_FILE 0 +#endif + +#include "filemap.h" + +int filemap(const char *name, + void (*processor)(const void *, size_t, const char *, void *arg), + void *arg) +{ + int fd; + size_t nbytes; + struct stat sb; + void *p; + + fd = open(name, O_RDONLY); + if (fd < 0) { + perror(name); + return 0; + } + if (fstat(fd, &sb) < 0) { + perror(name); + close(fd); + return 0; + } + if (!S_ISREG(sb.st_mode)) { + close(fd); + fprintf(stderr, "%s: not a regular file\n", name); + return 0; + } + + nbytes = sb.st_size; + p = (void *)mmap((caddr_t)0, (size_t)nbytes, PROT_READ, + MAP_FILE|MAP_PRIVATE, fd, (off_t)0); + if (p == (void *)-1) { + perror(name); + close(fd); + return 0; + } + processor(p, nbytes, name, arg); + munmap((caddr_t)p, nbytes); + close(fd); + return 1; +} Index: library/xml/TclExpat-1.1/utf8tab.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/utf8tab.h (revision 0) +++ library/xml/TclExpat-1.1/utf8tab.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,53 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + + +/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, +/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, +/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, +/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, +/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, +/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, Index: library/xml/TclExpat-1.1/win32filemap.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/win32filemap.c (revision 0) +++ library/xml/TclExpat-1.1/win32filemap.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,102 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#define STRICT 1 +#ifdef XML_UNICODE +#define UNICODE +#define _UNICODE +#endif /* XML_UNICODE */ +#include +#include +#include +#include "filemap.h" + +static void win32perror(const TCHAR *); + +int filemap(const TCHAR *name, + void (*processor)(const void *, size_t, const TCHAR *, void *arg), + void *arg) +{ + HANDLE f; + HANDLE m; + DWORD size; + DWORD sizeHi; + void *p; + + f = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, + FILE_FLAG_SEQUENTIAL_SCAN, NULL); + if (f == INVALID_HANDLE_VALUE) { + win32perror(name); + return 0; + } + size = GetFileSize(f, &sizeHi); + if (size == (DWORD)-1) { + win32perror(name); + return 0; + } + if (sizeHi) { + _ftprintf(stderr, _T("%s: bigger than 2Gb\n"), name); + return 0; + } + /* CreateFileMapping barfs on zero length files */ + if (size == 0) { + static const char c = '\0'; + processor(&c, 0, name, arg); + CloseHandle(f); + return 1; + } + m = CreateFileMapping(f, NULL, PAGE_READONLY, 0, 0, NULL); + if (m == NULL) { + win32perror(name); + CloseHandle(f); + return 0; + } + p = MapViewOfFile(m, FILE_MAP_READ, 0, 0, 0); + if (p == NULL) { + win32perror(name); + CloseHandle(m); + CloseHandle(f); + return 0; + } + processor(p, size, name, arg); + UnmapViewOfFile(p); + CloseHandle(m); + CloseHandle(f); + return 1; +} + +static +void win32perror(const TCHAR *s) +{ + LPVOID buf; + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &buf, + 0, + NULL)) { + _ftprintf(stderr, _T("%s: %s"), s, buf); + fflush(stderr); + LocalFree(buf); + } + else + _ftprintf(stderr, _T("%s: unknown Windows error\n"), s); +} Index: library/xml/TclExpat-1.1/xmldef.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/xmldef.h (revision 0) +++ library/xml/TclExpat-1.1/xmldef.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,32 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +/* This file can be used for any definitions needed in +particular environments. */ + +#ifdef MOZILLA + +#include "nspr.h" +#define malloc(x) PR_Calloc(1,(x)) +#define calloc(x, y) PR_Calloc((x),(y)) +#define free(x) PR_Free(x) +#define int int32 + +#endif /* MOZILLA */ Index: library/xml/TclExpat-1.1/xmlparse.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/xmlparse.c (revision 0) +++ library/xml/TclExpat-1.1/xmlparse.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,2572 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#include +#include +#include + +#include "xmldef.h" + +#ifdef XML_UNICODE +#define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX +#define XmlConvert XmlUtf16Convert +#define XmlGetInternalEncoding XmlGetUtf16InternalEncoding +#define XmlEncode XmlUtf16Encode +#define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((unsigned long)s) & 1)) +typedef unsigned short ICHAR; +#else +#define XML_ENCODE_MAX XML_UTF8_ENCODE_MAX +#define XmlConvert XmlUtf8Convert +#define XmlGetInternalEncoding XmlGetUtf8InternalEncoding +#define XmlEncode XmlUtf8Encode +#define MUST_CONVERT(enc, s) (!(enc)->isUtf8) +typedef char ICHAR; +#endif + +#ifdef XML_UNICODE_WCHAR_T +#define XML_T(x) L ## x +#else +#define XML_T(x) x +#endif + +/* Round up n to be a multiple of sz, where sz is a power of 2. */ +#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1)) + +#include "xmlparse.h" +#include "xmltok.h" +#include "xmlrole.h" +#include "hashtable.h" + +#define INIT_TAG_BUF_SIZE 32 /* must be a multiple of sizeof(XML_Char) */ +#define INIT_DATA_BUF_SIZE 1024 +#define INIT_ATTS_SIZE 16 +#define INIT_BLOCK_SIZE 1024 +#define INIT_BUFFER_SIZE 1024 + +typedef struct tag { + struct tag *parent; + const char *rawName; + size_t rawNameLength; + const XML_Char *name; + char *buf; + char *bufEnd; +} TAG; + +typedef struct { + const XML_Char *name; + const XML_Char *textPtr; + int textLen; + const XML_Char *systemId; + const XML_Char *base; + const XML_Char *publicId; + const XML_Char *notation; + char open; +} ENTITY; + +typedef struct block { + struct block *next; + int size; + XML_Char s[1]; +} BLOCK; + +typedef struct { + BLOCK *blocks; + BLOCK *freeBlocks; + const XML_Char *end; + XML_Char *ptr; + XML_Char *start; +} STRING_POOL; + +/* The XML_Char before the name is used to determine whether +an attribute has been specified. */ +typedef struct { + XML_Char *name; + char maybeTokenized; +} ATTRIBUTE_ID; + +typedef struct { + const ATTRIBUTE_ID *id; + char isCdata; + const XML_Char *value; +} DEFAULT_ATTRIBUTE; + +typedef struct { + const XML_Char *name; + int nDefaultAtts; + int allocDefaultAtts; + DEFAULT_ATTRIBUTE *defaultAtts; +} ELEMENT_TYPE; + +typedef struct { + HASH_TABLE generalEntities; + HASH_TABLE elementTypes; + HASH_TABLE attributeIds; + STRING_POOL pool; + int complete; + int standalone; + const XML_Char *base; +} DTD; + +typedef enum XML_Error Processor(XML_Parser parser, + const char *start, + const char *end, + const char **endPtr); + +static Processor prologProcessor; +static Processor prologInitProcessor; +static Processor contentProcessor; +static Processor cdataSectionProcessor; +static Processor epilogProcessor; +static Processor errorProcessor; +static Processor externalEntityInitProcessor; +static Processor externalEntityInitProcessor2; +static Processor externalEntityInitProcessor3; +static Processor externalEntityContentProcessor; + +static enum XML_Error +handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName); +static enum XML_Error +processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *, const char *); +static enum XML_Error +initializeEncoding(XML_Parser parser); +static enum XML_Error +doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, + const char *start, const char *end, const char **endPtr); +static enum XML_Error +doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr); +static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *, const XML_Char *tagName, const char *s); +static int +defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, int isCdata, const XML_Char *dfltValue); +static enum XML_Error +storeAttributeValue(XML_Parser parser, const ENCODING *, int isCdata, const char *, const char *, + STRING_POOL *); +static enum XML_Error +appendAttributeValue(XML_Parser parser, const ENCODING *, int isCdata, const char *, const char *, + STRING_POOL *); +static ATTRIBUTE_ID * +getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); +static enum XML_Error +storeEntityValue(XML_Parser parser, const char *start, const char *end); +static int +reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); +static void +reportDefault(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); + +static const XML_Char *getOpenEntityNames(XML_Parser parser); +static int setOpenEntityNames(XML_Parser parser, const XML_Char *openEntityNames); +static void normalizePublicId(XML_Char *s); +static int dtdInit(DTD *); +static void dtdDestroy(DTD *); +static int dtdCopy(DTD *newDtd, const DTD *oldDtd); +static void poolInit(STRING_POOL *); +static void poolClear(STRING_POOL *); +static void poolDestroy(STRING_POOL *); +static XML_Char *poolAppend(STRING_POOL *pool, const ENCODING *enc, + const char *ptr, const char *end); +static XML_Char *poolStoreString(STRING_POOL *pool, const ENCODING *enc, + const char *ptr, const char *end); +static int poolGrow(STRING_POOL *pool); +static const XML_Char *poolCopyString(STRING_POOL *pool, const XML_Char *s); +static const XML_Char *poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n); + +#define poolStart(pool) ((pool)->start) +#define poolEnd(pool) ((pool)->ptr) +#define poolLength(pool) ((pool)->ptr - (pool)->start) +#define poolChop(pool) ((void)--(pool->ptr)) +#define poolLastChar(pool) (((pool)->ptr)[-1]) +#define poolDiscard(pool) ((pool)->ptr = (pool)->start) +#define poolFinish(pool) ((pool)->start = (pool)->ptr) +#define poolAppendChar(pool, c) \ + (((pool)->ptr == (pool)->end && !poolGrow(pool)) \ + ? 0 \ + : ((*((pool)->ptr)++ = c), 1)) + +typedef struct { + /* The first member must be userData so that the XML_GetUserData macro works. */ + void *userData; + void *handlerArg; + char *buffer; + /* first character to be parsed */ + const char *bufferPtr; + /* past last character to be parsed */ + char *bufferEnd; + /* allocated end of buffer */ + const char *bufferLim; + long parseEndByteIndex; + const char *parseEndPtr; + XML_Char *dataBuf; + XML_Char *dataBufEnd; + XML_StartElementHandler startElementHandler; + XML_EndElementHandler endElementHandler; + XML_CharacterDataHandler characterDataHandler; + XML_ProcessingInstructionHandler processingInstructionHandler; + XML_DefaultHandler defaultHandler; + XML_UnparsedEntityDeclHandler unparsedEntityDeclHandler; + XML_NotationDeclHandler notationDeclHandler; + XML_ExternalEntityRefHandler externalEntityRefHandler; + XML_UnknownEncodingHandler unknownEncodingHandler; + const ENCODING *encoding; + INIT_ENCODING initEncoding; + const XML_Char *protocolEncodingName; + void *unknownEncodingMem; + void *unknownEncodingData; + void *unknownEncodingHandlerData; + void (*unknownEncodingRelease)(void *); + PROLOG_STATE prologState; + Processor *processor; + enum XML_Error errorCode; + const char *eventPtr; + const char *eventEndPtr; + const char *positionPtr; + int tagLevel; + ENTITY *declEntity; + const XML_Char *declNotationName; + const XML_Char *declNotationPublicId; + ELEMENT_TYPE *declElementType; + ATTRIBUTE_ID *declAttributeId; + char declAttributeIsCdata; + DTD dtd; + TAG *tagStack; + TAG *freeTagList; + int attsSize; + ATTRIBUTE *atts; + POSITION position; + STRING_POOL tempPool; + STRING_POOL temp2Pool; + char *groupConnector; + unsigned groupSize; + int hadExternalDoctype; +} Parser; + +#define userData (((Parser *)parser)->userData) +#define handlerArg (((Parser *)parser)->handlerArg) +#define startElementHandler (((Parser *)parser)->startElementHandler) +#define endElementHandler (((Parser *)parser)->endElementHandler) +#define characterDataHandler (((Parser *)parser)->characterDataHandler) +#define processingInstructionHandler (((Parser *)parser)->processingInstructionHandler) +#define defaultHandler (((Parser *)parser)->defaultHandler) +#define unparsedEntityDeclHandler (((Parser *)parser)->unparsedEntityDeclHandler) +#define notationDeclHandler (((Parser *)parser)->notationDeclHandler) +#define externalEntityRefHandler (((Parser *)parser)->externalEntityRefHandler) +#define unknownEncodingHandler (((Parser *)parser)->unknownEncodingHandler) +#define encoding (((Parser *)parser)->encoding) +#define initEncoding (((Parser *)parser)->initEncoding) +#define unknownEncodingMem (((Parser *)parser)->unknownEncodingMem) +#define unknownEncodingData (((Parser *)parser)->unknownEncodingData) +#define unknownEncodingHandlerData \ + (((Parser *)parser)->unknownEncodingHandlerData) +#define unknownEncodingRelease (((Parser *)parser)->unknownEncodingRelease) +#define protocolEncodingName (((Parser *)parser)->protocolEncodingName) +#define prologState (((Parser *)parser)->prologState) +#define processor (((Parser *)parser)->processor) +#define errorCode (((Parser *)parser)->errorCode) +#define eventPtr (((Parser *)parser)->eventPtr) +#define eventEndPtr (((Parser *)parser)->eventEndPtr) +#define positionPtr (((Parser *)parser)->positionPtr) +#define position (((Parser *)parser)->position) +#define tagLevel (((Parser *)parser)->tagLevel) +#define buffer (((Parser *)parser)->buffer) +#define bufferPtr (((Parser *)parser)->bufferPtr) +#define bufferEnd (((Parser *)parser)->bufferEnd) +#define parseEndByteIndex (((Parser *)parser)->parseEndByteIndex) +#define parseEndPtr (((Parser *)parser)->parseEndPtr) +#define bufferLim (((Parser *)parser)->bufferLim) +#define dataBuf (((Parser *)parser)->dataBuf) +#define dataBufEnd (((Parser *)parser)->dataBufEnd) +#define dtd (((Parser *)parser)->dtd) +#define declEntity (((Parser *)parser)->declEntity) +#define declNotationName (((Parser *)parser)->declNotationName) +#define declNotationPublicId (((Parser *)parser)->declNotationPublicId) +#define declElementType (((Parser *)parser)->declElementType) +#define declAttributeId (((Parser *)parser)->declAttributeId) +#define declAttributeIsCdata (((Parser *)parser)->declAttributeIsCdata) +#define freeTagList (((Parser *)parser)->freeTagList) +#define tagStack (((Parser *)parser)->tagStack) +#define atts (((Parser *)parser)->atts) +#define attsSize (((Parser *)parser)->attsSize) +#define tempPool (((Parser *)parser)->tempPool) +#define temp2Pool (((Parser *)parser)->temp2Pool) +#define groupConnector (((Parser *)parser)->groupConnector) +#define groupSize (((Parser *)parser)->groupSize) +#define hadExternalDoctype (((Parser *)parser)->hadExternalDoctype) + +XML_Parser XML_ParserCreate(const XML_Char *encodingName) +{ + XML_Parser parser = malloc(sizeof(Parser)); + if (!parser) + return parser; + processor = prologInitProcessor; + XmlPrologStateInit(&prologState); + userData = 0; + handlerArg = 0; + startElementHandler = 0; + endElementHandler = 0; + characterDataHandler = 0; + processingInstructionHandler = 0; + defaultHandler = 0; + unparsedEntityDeclHandler = 0; + notationDeclHandler = 0; + externalEntityRefHandler = 0; + unknownEncodingHandler = 0; + buffer = 0; + bufferPtr = 0; + bufferEnd = 0; + parseEndByteIndex = 0; + parseEndPtr = 0; + bufferLim = 0; + declElementType = 0; + declAttributeId = 0; + declEntity = 0; + declNotationName = 0; + declNotationPublicId = 0; + memset(&position, 0, sizeof(POSITION)); + errorCode = XML_ERROR_NONE; + eventPtr = 0; + eventEndPtr = 0; + positionPtr = 0; + tagLevel = 0; + tagStack = 0; + freeTagList = 0; + attsSize = INIT_ATTS_SIZE; + atts = malloc(attsSize * sizeof(ATTRIBUTE)); + dataBuf = malloc(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); + groupSize = 0; + groupConnector = 0; + hadExternalDoctype = 0; + unknownEncodingMem = 0; + unknownEncodingRelease = 0; + unknownEncodingData = 0; + unknownEncodingHandlerData = 0; + poolInit(&tempPool); + poolInit(&temp2Pool); + protocolEncodingName = encodingName ? poolCopyString(&tempPool, encodingName) : 0; + if (!dtdInit(&dtd) || !atts || !dataBuf + || (encodingName && !protocolEncodingName)) { + XML_ParserFree(parser); + return 0; + } + dataBufEnd = dataBuf + INIT_DATA_BUF_SIZE; + XmlInitEncoding(&initEncoding, &encoding, 0); + return parser; +} + +XML_Parser XML_ExternalEntityParserCreate(XML_Parser oldParser, + const XML_Char *openEntityNames, + const XML_Char *encodingName) +{ + XML_Parser parser = oldParser; + DTD *oldDtd = &dtd; + XML_StartElementHandler oldStartElementHandler = startElementHandler; + XML_EndElementHandler oldEndElementHandler = endElementHandler; + XML_CharacterDataHandler oldCharacterDataHandler = characterDataHandler; + XML_ProcessingInstructionHandler oldProcessingInstructionHandler = processingInstructionHandler; + XML_DefaultHandler oldDefaultHandler = defaultHandler; + XML_ExternalEntityRefHandler oldExternalEntityRefHandler = externalEntityRefHandler; + XML_UnknownEncodingHandler oldUnknownEncodingHandler = unknownEncodingHandler; + void *oldUserData = userData; + void *oldHandlerArg = handlerArg; + + parser = XML_ParserCreate(encodingName); + if (!parser) + return 0; + startElementHandler = oldStartElementHandler; + endElementHandler = oldEndElementHandler; + characterDataHandler = oldCharacterDataHandler; + processingInstructionHandler = oldProcessingInstructionHandler; + defaultHandler = oldDefaultHandler; + externalEntityRefHandler = oldExternalEntityRefHandler; + unknownEncodingHandler = oldUnknownEncodingHandler; + userData = oldUserData; + if (oldUserData == oldHandlerArg) + handlerArg = userData; + else + handlerArg = parser; + if (!dtdCopy(&dtd, oldDtd) || !setOpenEntityNames(parser, openEntityNames)) { + XML_ParserFree(parser); + return 0; + } + processor = externalEntityInitProcessor; + return parser; +} + +void XML_ParserFree(XML_Parser parser) +{ + for (;;) { + TAG *p; + if (tagStack == 0) { + if (freeTagList == 0) + break; + tagStack = freeTagList; + freeTagList = 0; + } + p = tagStack; + tagStack = tagStack->parent; + free(p->buf); + free(p); + } + poolDestroy(&tempPool); + poolDestroy(&temp2Pool); + dtdDestroy(&dtd); + free((void *)atts); + free(groupConnector); + free(buffer); + free(dataBuf); + free(unknownEncodingMem); + if (unknownEncodingRelease) + unknownEncodingRelease(unknownEncodingData); + free(parser); +} + +void XML_UseParserAsHandlerArg(XML_Parser parser) +{ + handlerArg = parser; +} + +void XML_SetUserData(XML_Parser parser, void *p) +{ + if (handlerArg == userData) + handlerArg = userData = p; + else + userData = p; +} + +int XML_SetBase(XML_Parser parser, const XML_Char *p) +{ + if (p) { + p = poolCopyString(&dtd.pool, p); + if (!p) + return 0; + dtd.base = p; + } + else + dtd.base = 0; + return 1; +} + +const XML_Char *XML_GetBase(XML_Parser parser) +{ + return dtd.base; +} + +void XML_SetElementHandler(XML_Parser parser, + XML_StartElementHandler start, + XML_EndElementHandler end) +{ + startElementHandler = start; + endElementHandler = end; +} + +void XML_SetCharacterDataHandler(XML_Parser parser, + XML_CharacterDataHandler handler) +{ + characterDataHandler = handler; +} + +void XML_SetProcessingInstructionHandler(XML_Parser parser, + XML_ProcessingInstructionHandler handler) +{ + processingInstructionHandler = handler; +} + +void XML_SetDefaultHandler(XML_Parser parser, + XML_DefaultHandler handler) +{ + defaultHandler = handler; +} + +void XML_SetUnparsedEntityDeclHandler(XML_Parser parser, + XML_UnparsedEntityDeclHandler handler) +{ + unparsedEntityDeclHandler = handler; +} + +void XML_SetNotationDeclHandler(XML_Parser parser, + XML_NotationDeclHandler handler) +{ + notationDeclHandler = handler; +} + +void XML_SetExternalEntityRefHandler(XML_Parser parser, + XML_ExternalEntityRefHandler handler) +{ + externalEntityRefHandler = handler; +} + +void XML_SetUnknownEncodingHandler(XML_Parser parser, + XML_UnknownEncodingHandler handler, + void *data) +{ + unknownEncodingHandler = handler; + unknownEncodingHandlerData = data; +} + +int XML_Parse(XML_Parser parser, const char *s, size_t len, int isFinal) +{ + if (len == 0) { + if (!isFinal) + return 1; + errorCode = processor(parser, bufferPtr, parseEndPtr = bufferEnd, 0); + if (errorCode == XML_ERROR_NONE) + return 1; + eventEndPtr = eventPtr; + return 0; + } + else if (bufferPtr == bufferEnd) { + const char *end; + size_t nLeftOver; + parseEndByteIndex += len; + positionPtr = s; + if (isFinal) { + errorCode = processor(parser, s, parseEndPtr = s + len, 0); + if (errorCode == XML_ERROR_NONE) + return 1; + eventEndPtr = eventPtr; + return 0; + } + errorCode = processor(parser, s, parseEndPtr = s + len, &end); + if (errorCode != XML_ERROR_NONE) { + eventEndPtr = eventPtr; + return 0; + } + XmlUpdatePosition(encoding, positionPtr, end, &position); + nLeftOver = s + len - end; + if (nLeftOver) { + if (buffer == 0 || nLeftOver > bufferLim - buffer) { + /* FIXME avoid integer overflow */ + buffer = buffer == 0 ? malloc(len * 2) : realloc(buffer, len * 2); + if (!buffer) { + errorCode = XML_ERROR_NO_MEMORY; + eventPtr = eventEndPtr = 0; + return 0; + } + bufferLim = buffer + len * 2; + } + memcpy(buffer, end, nLeftOver); + bufferPtr = buffer; + bufferEnd = buffer + nLeftOver; + } + return 1; + } + else { + memcpy(XML_GetBuffer(parser, len), s, len); + return XML_ParseBuffer(parser, len, isFinal); + } +} + +int XML_ParseBuffer(XML_Parser parser, size_t len, int isFinal) +{ + const char *start = bufferPtr; + positionPtr = start; + bufferEnd += len; + parseEndByteIndex += len; + errorCode = processor(parser, start, parseEndPtr = bufferEnd, + isFinal ? (const char **)0 : &bufferPtr); + if (errorCode == XML_ERROR_NONE) { + if (!isFinal) + XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position); + return 1; + } + else { + eventEndPtr = eventPtr; + return 0; + } +} + +void *XML_GetBuffer(XML_Parser parser, size_t len) +{ + if (len > bufferLim - bufferEnd) { + /* FIXME avoid integer overflow */ + size_t neededSize = len + (bufferEnd - bufferPtr); + if (neededSize <= bufferLim - buffer) { + memmove(buffer, bufferPtr, (size_t)(bufferEnd - bufferPtr)); + bufferEnd = buffer + (bufferEnd - bufferPtr); + bufferPtr = buffer; + } + else { + char *newBuf; + size_t bufferSize = bufferLim - bufferPtr; + if (bufferSize == 0) + bufferSize = INIT_BUFFER_SIZE; + do { + bufferSize *= 2; + } while (bufferSize < neededSize); + newBuf = malloc(bufferSize); + if (newBuf == 0) { + errorCode = XML_ERROR_NO_MEMORY; + return 0; + } + bufferLim = newBuf + bufferSize; + if (bufferPtr) { + memcpy(newBuf, bufferPtr, (size_t)(bufferEnd - bufferPtr)); + free(buffer); + } + bufferEnd = newBuf + (bufferEnd - bufferPtr); + bufferPtr = buffer = newBuf; + } + } + return bufferEnd; +} + +enum XML_Error XML_GetErrorCode(XML_Parser parser) +{ + return errorCode; +} + +long XML_GetCurrentByteIndex(XML_Parser parser) +{ + if (eventPtr) + return parseEndByteIndex - (parseEndPtr - eventPtr); + return -1; +} + +int XML_GetCurrentLineNumber(XML_Parser parser) +{ + if (eventPtr) { + XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); + positionPtr = eventPtr; + } + return position.lineNumber + 1; +} + +int XML_GetCurrentColumnNumber(XML_Parser parser) +{ + if (eventPtr) { + XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); + positionPtr = eventPtr; + } + return position.columnNumber; +} + +void XML_DefaultCurrent(XML_Parser parser) +{ + if (defaultHandler) + reportDefault(parser, encoding, eventPtr, eventEndPtr); +} + +const XML_LChar *XML_ErrorString(enum XML_Error code) +{ + static const XML_LChar *message[] = { + 0, + XML_T("out of memory"), + XML_T("syntax error"), + XML_T("no element found"), + XML_T("not well-formed"), + XML_T("unclosed token"), + XML_T("unclosed token"), + XML_T("mismatched tag"), + XML_T("duplicate attribute"), + XML_T("junk after document element"), + XML_T("illegal parameter entity reference"), + XML_T("undefined entity"), + XML_T("recursive entity reference"), + XML_T("asynchronous entity"), + XML_T("reference to invalid character number"), + XML_T("reference to binary entity"), + XML_T("reference to external entity in attribute"), + XML_T("xml processing instruction not at start of external entity"), + XML_T("unknown encoding"), + XML_T("encoding specified in XML declaration is incorrect"), + XML_T("unclosed CDATA section"), + XML_T("error in processing external entity reference") + }; + if (code > 0 && code < sizeof(message)/sizeof(message[0])) + return message[code]; + return 0; +} + +static +enum XML_Error contentProcessor(XML_Parser parser, + const char *start, + const char *end, + const char **endPtr) +{ + return doContent(parser, 0, encoding, start, end, endPtr); +} + +static +enum XML_Error externalEntityInitProcessor(XML_Parser parser, + const char *start, + const char *end, + const char **endPtr) +{ + enum XML_Error result = initializeEncoding(parser); + if (result != XML_ERROR_NONE) + return result; + processor = externalEntityInitProcessor2; + return externalEntityInitProcessor2(parser, start, end, endPtr); +} + +static +enum XML_Error externalEntityInitProcessor2(XML_Parser parser, + const char *start, + const char *end, + const char **endPtr) +{ + const char *next; + int tok = XmlContentTok(encoding, start, end, &next); + switch (tok) { + case XML_TOK_BOM: + start = next; + break; + case XML_TOK_PARTIAL: + if (endPtr) { + *endPtr = start; + return XML_ERROR_NONE; + } + eventPtr = start; + return XML_ERROR_UNCLOSED_TOKEN; + case XML_TOK_PARTIAL_CHAR: + if (endPtr) { + *endPtr = start; + return XML_ERROR_NONE; + } + eventPtr = start; + return XML_ERROR_PARTIAL_CHAR; + } + processor = externalEntityInitProcessor3; + return externalEntityInitProcessor3(parser, start, end, endPtr); +} + +static +enum XML_Error externalEntityInitProcessor3(XML_Parser parser, + const char *start, + const char *end, + const char **endPtr) +{ + const char *next; + int tok = XmlContentTok(encoding, start, end, &next); + switch (tok) { + case XML_TOK_XML_DECL: + { + enum XML_Error result = processXmlDecl(parser, 1, start, next); + if (result != XML_ERROR_NONE) + return result; + start = next; + } + break; + case XML_TOK_PARTIAL: + if (endPtr) { + *endPtr = start; + return XML_ERROR_NONE; + } + eventPtr = start; + return XML_ERROR_UNCLOSED_TOKEN; + case XML_TOK_PARTIAL_CHAR: + if (endPtr) { + *endPtr = start; + return XML_ERROR_NONE; + } + eventPtr = start; + return XML_ERROR_PARTIAL_CHAR; + } + processor = externalEntityContentProcessor; + tagLevel = 1; + return doContent(parser, 1, encoding, start, end, endPtr); +} + +static +enum XML_Error externalEntityContentProcessor(XML_Parser parser, + const char *start, + const char *end, + const char **endPtr) +{ + return doContent(parser, 1, encoding, start, end, endPtr); +} + +static enum XML_Error +doContent(XML_Parser parser, + int startTagLevel, + const ENCODING *enc, + const char *s, + const char *end, + const char **nextPtr) +{ + const ENCODING *internalEnc = XmlGetInternalEncoding(); + const char *dummy; + const char **eventPP; + const char **eventEndPP; + if (enc == encoding) { + eventPP = &eventPtr; + *eventPP = s; + eventEndPP = &eventEndPtr; + } + else + eventPP = eventEndPP = &dummy; + for (;;) { + const char *next; + int tok = XmlContentTok(enc, s, end, &next); + *eventEndPP = next; + switch (tok) { + case XML_TOK_TRAILING_CR: + if (nextPtr) { + *nextPtr = s; + return XML_ERROR_NONE; + } + *eventEndPP = end; + if (characterDataHandler) { + XML_Char c = XML_T('\n'); + characterDataHandler(handlerArg, &c, 1); + } + else if (defaultHandler) + reportDefault(parser, enc, s, end); + if (startTagLevel == 0) + return XML_ERROR_NO_ELEMENTS; + if (tagLevel != startTagLevel) + return XML_ERROR_ASYNC_ENTITY; + return XML_ERROR_NONE; + case XML_TOK_NONE: + if (nextPtr) { + *nextPtr = s; + return XML_ERROR_NONE; + } + if (startTagLevel > 0) { + if (tagLevel != startTagLevel) + return XML_ERROR_ASYNC_ENTITY; + return XML_ERROR_NONE; + } + return XML_ERROR_NO_ELEMENTS; + case XML_TOK_INVALID: + *eventPP = next; + return XML_ERROR_INVALID_TOKEN; + case XML_TOK_PARTIAL: + if (nextPtr) { + *nextPtr = s; + return XML_ERROR_NONE; + } + return XML_ERROR_UNCLOSED_TOKEN; + case XML_TOK_PARTIAL_CHAR: + if (nextPtr) { + *nextPtr = s; + return XML_ERROR_NONE; + } + return XML_ERROR_PARTIAL_CHAR; + case XML_TOK_ENTITY_REF: + { + const XML_Char *name; + ENTITY *entity; + XML_Char ch = XmlPredefinedEntityName(enc, + s + enc->minBytesPerChar, + next - enc->minBytesPerChar); + if (ch) { + if (characterDataHandler) + characterDataHandler(handlerArg, &ch, 1); + else if (defaultHandler) + reportDefault(parser, enc, s, next); + break; + } + name = poolStoreString(&dtd.pool, enc, + s + enc->minBytesPerChar, + next - enc->minBytesPerChar); + if (!name) + return XML_ERROR_NO_MEMORY; + entity = (ENTITY *)lookup(&dtd.generalEntities, name, 0); + poolDiscard(&dtd.pool); + if (!entity) { + if (dtd.complete || dtd.standalone) + return XML_ERROR_UNDEFINED_ENTITY; + if (defaultHandler) + reportDefault(parser, enc, s, next); + break; + } + if (entity->open) + return XML_ERROR_RECURSIVE_ENTITY_REF; + if (entity->notation) + return XML_ERROR_BINARY_ENTITY_REF; + if (entity) { + if (entity->textPtr) { + enum XML_Error result; + if (defaultHandler) { + reportDefault(parser, enc, s, next); + break; + } + /* Protect against the possibility that somebody sets + the defaultHandler from inside another handler. */ + *eventEndPP = *eventPP; + entity->open = 1; + result = doContent(parser, + tagLevel, + internalEnc, + (char *)entity->textPtr, + (char *)(entity->textPtr + entity->textLen), + 0); + entity->open = 0; + if (result) + return result; + } + else if (externalEntityRefHandler) { + const XML_Char *openEntityNames; + entity->open = 1; + openEntityNames = getOpenEntityNames(parser); + entity->open = 0; + if (!openEntityNames) + return XML_ERROR_NO_MEMORY; + if (!externalEntityRefHandler(parser, openEntityNames, dtd.base, entity->systemId, entity->publicId)) + return XML_ERROR_EXTERNAL_ENTITY_HANDLING; + } + else if (defaultHandler) + reportDefault(parser, enc, s, next); + } + break; + } + case XML_TOK_START_TAG_WITH_ATTS: + if (!startElementHandler) { + enum XML_Error result = storeAtts(parser, enc, 0, s); + if (result) + return result; + } + /* fall through */ + case XML_TOK_START_TAG_NO_ATTS: + { + TAG *tag; + if (freeTagList) { + tag = freeTagList; + freeTagList = freeTagList->parent; + } + else { + tag = malloc(sizeof(TAG)); + if (!tag) + return XML_ERROR_NO_MEMORY; + tag->buf = malloc(INIT_TAG_BUF_SIZE); + if (!tag->buf) + return XML_ERROR_NO_MEMORY; + tag->bufEnd = tag->buf + INIT_TAG_BUF_SIZE; + } + tag->parent = tagStack; + tagStack = tag; + tag->rawName = s + enc->minBytesPerChar; + tag->rawNameLength = XmlNameLength(enc, tag->rawName); + if (nextPtr) { + if (tag->rawNameLength > tag->bufEnd - tag->buf) { + size_t bufSize = tag->rawNameLength * 4; + bufSize = ROUND_UP(bufSize, sizeof(XML_Char)); + tag->buf = realloc(tag->buf, bufSize); + if (!tag->buf) + return XML_ERROR_NO_MEMORY; + tag->bufEnd = tag->buf + bufSize; + } + memcpy(tag->buf, tag->rawName, tag->rawNameLength); + tag->rawName = tag->buf; + } + ++tagLevel; + if (startElementHandler) { + enum XML_Error result; + XML_Char *toPtr; + for (;;) { + const char *rawNameEnd = tag->rawName + tag->rawNameLength; + const char *fromPtr = tag->rawName; + size_t bufSize; + if (nextPtr) + toPtr = (XML_Char *)(tag->buf + ROUND_UP(tag->rawNameLength, sizeof(XML_Char))); + else + toPtr = (XML_Char *)tag->buf; + tag->name = toPtr; + XmlConvert(enc, + &fromPtr, rawNameEnd, + (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1); + if (fromPtr == rawNameEnd) + break; + bufSize = (tag->bufEnd - tag->buf) << 1; + tag->buf = realloc(tag->buf, bufSize); + if (!tag->buf) + return XML_ERROR_NO_MEMORY; + tag->bufEnd = tag->buf + bufSize; + if (nextPtr) + tag->rawName = tag->buf; + } + *toPtr = XML_T('\0'); + result = storeAtts(parser, enc, tag->name, s); + if (result) + return result; + startElementHandler(handlerArg, tag->name, (const XML_Char **)atts); + poolClear(&tempPool); + } + else { + tag->name = 0; + if (defaultHandler) + reportDefault(parser, enc, s, next); + } + break; + } + case XML_TOK_EMPTY_ELEMENT_WITH_ATTS: + if (!startElementHandler) { + enum XML_Error result = storeAtts(parser, enc, 0, s); + if (result) + return result; + } + /* fall through */ + case XML_TOK_EMPTY_ELEMENT_NO_ATTS: + if (startElementHandler || endElementHandler) { + const char *rawName = s + enc->minBytesPerChar; + const XML_Char *name = poolStoreString(&tempPool, enc, rawName, + rawName + + XmlNameLength(enc, rawName)); + if (!name) + return XML_ERROR_NO_MEMORY; + poolFinish(&tempPool); + if (startElementHandler) { + enum XML_Error result = storeAtts(parser, enc, name, s); + if (result) + return result; + startElementHandler(handlerArg, name, (const XML_Char **)atts); + } + if (endElementHandler) { + if (startElementHandler) + *eventEndPP = *eventPP; + endElementHandler(handlerArg, name); + } + poolClear(&tempPool); + } + else if (defaultHandler) + reportDefault(parser, enc, s, next); + if (tagLevel == 0) + return epilogProcessor(parser, next, end, nextPtr); + break; + case XML_TOK_END_TAG: + if (tagLevel == startTagLevel) + return XML_ERROR_ASYNC_ENTITY; + else { + size_t len; + const char *rawName; + TAG *tag = tagStack; + tagStack = tag->parent; + tag->parent = freeTagList; + freeTagList = tag; + rawName = s + enc->minBytesPerChar*2; + len = XmlNameLength(enc, rawName); + if (len != tag->rawNameLength + || memcmp(tag->rawName, rawName, len) != 0) { + *eventPP = rawName; + return XML_ERROR_TAG_MISMATCH; + } + --tagLevel; + if (endElementHandler) { + if (tag->name) + endElementHandler(handlerArg, tag->name); + else { + const XML_Char *name = poolStoreString(&tempPool, enc, rawName, + rawName + len); + if (!name) + return XML_ERROR_NO_MEMORY; + endElementHandler(handlerArg, name); + poolClear(&tempPool); + } + } + else if (defaultHandler) + reportDefault(parser, enc, s, next); + if (tagLevel == 0) + return epilogProcessor(parser, next, end, nextPtr); + } + break; + case XML_TOK_CHAR_REF: + { + int n = XmlCharRefNumber(enc, s); + if (n < 0) + return XML_ERROR_BAD_CHAR_REF; + if (characterDataHandler) { + XML_Char buf[XML_ENCODE_MAX]; + characterDataHandler(handlerArg, buf, XmlEncode(n, (ICHAR *)buf)); + } + else if (defaultHandler) + reportDefault(parser, enc, s, next); + } + break; + case XML_TOK_XML_DECL: + return XML_ERROR_MISPLACED_XML_PI; + case XML_TOK_DATA_NEWLINE: + if (characterDataHandler) { + XML_Char c = XML_T('\n'); + characterDataHandler(handlerArg, &c, 1); + } + else if (defaultHandler) + reportDefault(parser, enc, s, next); + break; + case XML_TOK_CDATA_SECT_OPEN: + { + enum XML_Error result; + if (characterDataHandler) + characterDataHandler(handlerArg, dataBuf, 0); + else if (defaultHandler) + reportDefault(parser, enc, s, next); + result = doCdataSection(parser, enc, &next, end, nextPtr); + if (!next) { + processor = cdataSectionProcessor; + return result; + } + } + break; + case XML_TOK_TRAILING_RSQB: + if (nextPtr) { + *nextPtr = s; + return XML_ERROR_NONE; + } + if (characterDataHandler) { + if (MUST_CONVERT(enc, s)) { + ICHAR *dataPtr = (ICHAR *)dataBuf; + XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); + characterDataHandler(handlerArg, dataBuf, + (size_t)(dataPtr - (ICHAR *)dataBuf)); + } + else + characterDataHandler(handlerArg, + (XML_Char *)s, + (size_t)((XML_Char *)end - (XML_Char *)s)); + } + else if (defaultHandler) + reportDefault(parser, enc, s, end); + if (startTagLevel == 0) { + *eventPP = end; + return XML_ERROR_NO_ELEMENTS; + } + if (tagLevel != startTagLevel) { + *eventPP = end; + return XML_ERROR_ASYNC_ENTITY; + } + return XML_ERROR_NONE; + case XML_TOK_DATA_CHARS: + if (characterDataHandler) { + if (MUST_CONVERT(enc, s)) { + for (;;) { + ICHAR *dataPtr = (ICHAR *)dataBuf; + XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); + *eventEndPP = s; + characterDataHandler(handlerArg, dataBuf, (size_t)(dataPtr - (ICHAR *)dataBuf)); + if (s == next) + break; + *eventPP = s; + } + } + else + characterDataHandler(handlerArg, + (XML_Char *)s, + (size_t)((XML_Char *)next - (XML_Char *)s)); + } + else if (defaultHandler) + reportDefault(parser, enc, s, next); + break; + case XML_TOK_PI: + if (!reportProcessingInstruction(parser, enc, s, next)) + return XML_ERROR_NO_MEMORY; + break; + default: + if (defaultHandler) + reportDefault(parser, enc, s, next); + break; + } + *eventPP = s = next; + } + /* not reached */ +} + +/* If tagName is non-null, build a real list of attributes, +otherwise just check the attributes for well-formedness. */ + +static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc, + const XML_Char *tagName, const char *s) +{ + ELEMENT_TYPE *elementType = 0; + int nDefaultAtts = 0; + const XML_Char **appAtts; + int i; + int n; + + if (tagName) { + elementType = (ELEMENT_TYPE *)lookup(&dtd.elementTypes, tagName, 0); + if (elementType) + nDefaultAtts = elementType->nDefaultAtts; + } + + n = XmlGetAttributes(enc, s, attsSize, atts); + if (n + nDefaultAtts > attsSize) { + int oldAttsSize = attsSize; + attsSize = n + nDefaultAtts + INIT_ATTS_SIZE; + atts = realloc((void *)atts, attsSize * sizeof(ATTRIBUTE)); + if (!atts) + return XML_ERROR_NO_MEMORY; + if (n > oldAttsSize) + XmlGetAttributes(enc, s, n, atts); + } + appAtts = (const XML_Char **)atts; + for (i = 0; i < n; i++) { + ATTRIBUTE_ID *attId = getAttributeId(parser, enc, atts[i].name, + atts[i].name + + XmlNameLength(enc, atts[i].name)); + if (!attId) + return XML_ERROR_NO_MEMORY; + if ((attId->name)[-1]) { + if (enc == encoding) + eventPtr = atts[i].name; + return XML_ERROR_DUPLICATE_ATTRIBUTE; + } + (attId->name)[-1] = 1; + appAtts[i << 1] = attId->name; + if (!atts[i].normalized) { + enum XML_Error result; + int isCdata = 1; + + if (attId->maybeTokenized) { + int j; + for (j = 0; j < nDefaultAtts; j++) { + if (attId == elementType->defaultAtts[j].id) { + isCdata = elementType->defaultAtts[j].isCdata; + break; + } + } + } + + result = storeAttributeValue(parser, enc, isCdata, + atts[i].valuePtr, atts[i].valueEnd, + &tempPool); + if (result) + return result; + if (tagName) { + appAtts[(i << 1) + 1] = poolStart(&tempPool); + poolFinish(&tempPool); + } + else + poolDiscard(&tempPool); + } + else if (tagName) { + appAtts[(i << 1) + 1] = poolStoreString(&tempPool, enc, atts[i].valuePtr, atts[i].valueEnd); + if (appAtts[(i << 1) + 1] == 0) + return XML_ERROR_NO_MEMORY; + poolFinish(&tempPool); + } + } + if (tagName) { + int j; + for (j = 0; j < nDefaultAtts; j++) { + const DEFAULT_ATTRIBUTE *da = elementType->defaultAtts + j; + if (!(da->id->name)[-1] && da->value) { + (da->id->name)[-1] = 1; + appAtts[i << 1] = da->id->name; + appAtts[(i << 1) + 1] = da->value; + i++; + } + } + appAtts[i << 1] = 0; + } + while (i-- > 0) + ((XML_Char *)appAtts[i << 1])[-1] = 0; + return XML_ERROR_NONE; +} + +/* The idea here is to avoid using stack for each CDATA section when +the whole file is parsed with one call. */ + +static +enum XML_Error cdataSectionProcessor(XML_Parser parser, + const char *start, + const char *end, + const char **endPtr) +{ + enum XML_Error result = doCdataSection(parser, encoding, &start, end, endPtr); + if (start) { + processor = contentProcessor; + return contentProcessor(parser, start, end, endPtr); + } + return result; +} + +/* startPtr gets set to non-null is the section is closed, and to null if +the section is not yet closed. */ + +static +enum XML_Error doCdataSection(XML_Parser parser, + const ENCODING *enc, + const char **startPtr, + const char *end, + const char **nextPtr) +{ + const char *s = *startPtr; + const char *dummy; + const char **eventPP; + const char **eventEndPP; + if (enc == encoding) { + eventPP = &eventPtr; + *eventPP = s; + eventEndPP = &eventEndPtr; + } + else + eventPP = eventEndPP = &dummy; + *startPtr = 0; + for (;;) { + const char *next; + int tok = XmlCdataSectionTok(enc, s, end, &next); + *eventEndPP = next; + switch (tok) { + case XML_TOK_CDATA_SECT_CLOSE: + if (characterDataHandler) + characterDataHandler(handlerArg, dataBuf, 0); + else if (defaultHandler) + reportDefault(parser, enc, s, next); + *startPtr = next; + return XML_ERROR_NONE; + case XML_TOK_DATA_NEWLINE: + if (characterDataHandler) { + XML_Char c = XML_T('\n'); + characterDataHandler(handlerArg, &c, 1); + } + else if (defaultHandler) + reportDefault(parser, enc, s, next); + break; + case XML_TOK_DATA_CHARS: + if (characterDataHandler) { + if (MUST_CONVERT(enc, s)) { + for (;;) { + ICHAR *dataPtr = (ICHAR *)dataBuf; + XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); + *eventEndPP = next; + characterDataHandler(handlerArg, dataBuf, (size_t)(dataPtr - (ICHAR *)dataBuf)); + if (s == next) + break; + *eventPP = s; + } + } + else + characterDataHandler(handlerArg, + (XML_Char *)s, + (size_t)((XML_Char *)next - (XML_Char *)s)); + } + else if (defaultHandler) + reportDefault(parser, enc, s, next); + break; + case XML_TOK_INVALID: + *eventPP = next; + return XML_ERROR_INVALID_TOKEN; + case XML_TOK_PARTIAL_CHAR: + if (nextPtr) { + *nextPtr = s; + return XML_ERROR_NONE; + } + return XML_ERROR_PARTIAL_CHAR; + case XML_TOK_PARTIAL: + case XML_TOK_NONE: + if (nextPtr) { + *nextPtr = s; + return XML_ERROR_NONE; + } + return XML_ERROR_UNCLOSED_CDATA_SECTION; + default: + abort(); + } + *eventPP = s = next; + } + /* not reached */ +} + +static enum XML_Error +initializeEncoding(XML_Parser parser) +{ + const char *s; +#ifdef XML_UNICODE + char encodingBuf[128]; + if (!protocolEncodingName) + s = 0; + else { + int i; + for (i = 0; protocolEncodingName[i]; i++) { + if (i == sizeof(encodingBuf) - 1 + || protocolEncodingName[i] >= 0x80 + || protocolEncodingName[i] < 0) { + encodingBuf[0] = '\0'; + break; + } + encodingBuf[i] = (char)protocolEncodingName[i]; + } + encodingBuf[i] = '\0'; + s = encodingBuf; + } +#else + s = protocolEncodingName; +#endif + if (XmlInitEncoding(&initEncoding, &encoding, s)) + return XML_ERROR_NONE; + return handleUnknownEncoding(parser, protocolEncodingName); +} + +static enum XML_Error +processXmlDecl(XML_Parser parser, int isGeneralTextEntity, + const char *s, const char *next) +{ + const char *encodingName = 0; + const ENCODING *newEncoding = 0; + const char *version; + int standalone = -1; + if (!XmlParseXmlDecl(isGeneralTextEntity, + encoding, + s, + next, + &eventPtr, + &version, + &encodingName, + &newEncoding, + &standalone)) + return XML_ERROR_SYNTAX; + if (defaultHandler) + reportDefault(parser, encoding, s, next); + if (!protocolEncodingName) { + if (newEncoding) { + if (newEncoding->minBytesPerChar != encoding->minBytesPerChar) { + eventPtr = encodingName; + return XML_ERROR_INCORRECT_ENCODING; + } + encoding = newEncoding; + } + else if (encodingName) { + enum XML_Error result; + const XML_Char *s = poolStoreString(&tempPool, + encoding, + encodingName, + encodingName + + XmlNameLength(encoding, encodingName)); + if (!s) + return XML_ERROR_NO_MEMORY; + result = handleUnknownEncoding(parser, s); + poolDiscard(&tempPool); + if (result == XML_ERROR_UNKNOWN_ENCODING) + eventPtr = encodingName; + return result; + } + } + if (!isGeneralTextEntity && standalone == 1) + dtd.standalone = 1; + return XML_ERROR_NONE; +} + +static enum XML_Error +handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName) +{ + if (unknownEncodingHandler) { + XML_Encoding info; + int i; + for (i = 0; i < 256; i++) + info.map[i] = -1; + info.convert = 0; + info.data = 0; + info.release = 0; + if (unknownEncodingHandler(unknownEncodingHandlerData, encodingName, &info)) { + ENCODING *enc; + unknownEncodingMem = malloc((size_t)XmlSizeOfUnknownEncoding()); + if (!unknownEncodingMem) { + if (info.release) + info.release(info.data); + return XML_ERROR_NO_MEMORY; + } + enc = XmlInitUnknownEncoding(unknownEncodingMem, + info.map, + info.convert, + info.data); + if (enc) { + unknownEncodingData = info.data; + unknownEncodingRelease = info.release; + encoding = enc; + return XML_ERROR_NONE; + } + } + if (info.release) + info.release(info.data); + } + return XML_ERROR_UNKNOWN_ENCODING; +} + +static enum XML_Error +prologInitProcessor(XML_Parser parser, + const char *s, + const char *end, + const char **nextPtr) +{ + enum XML_Error result = initializeEncoding(parser); + if (result != XML_ERROR_NONE) + return result; + processor = prologProcessor; + return prologProcessor(parser, s, end, nextPtr); +} + +static enum XML_Error +prologProcessor(XML_Parser parser, + const char *s, + const char *end, + const char **nextPtr) +{ + for (;;) { + const char *next; + int tok = XmlPrologTok(encoding, s, end, &next); + if (tok <= 0) { + if (nextPtr != 0 && tok != XML_TOK_INVALID) { + *nextPtr = s; + return XML_ERROR_NONE; + } + switch (tok) { + case XML_TOK_INVALID: + eventPtr = next; + return XML_ERROR_INVALID_TOKEN; + case XML_TOK_NONE: + return XML_ERROR_NO_ELEMENTS; + case XML_TOK_PARTIAL: + return XML_ERROR_UNCLOSED_TOKEN; + case XML_TOK_PARTIAL_CHAR: + return XML_ERROR_PARTIAL_CHAR; + case XML_TOK_TRAILING_CR: + eventPtr = s + encoding->minBytesPerChar; + return XML_ERROR_NO_ELEMENTS; + default: + abort(); + } + } + switch (XmlTokenRole(&prologState, tok, s, next, encoding)) { + case XML_ROLE_XML_DECL: + { + enum XML_Error result = processXmlDecl(parser, 0, s, next); + if (result != XML_ERROR_NONE) + return result; + } + break; + case XML_ROLE_DOCTYPE_SYSTEM_ID: + hadExternalDoctype = 1; + break; + case XML_ROLE_DOCTYPE_PUBLIC_ID: + case XML_ROLE_ENTITY_PUBLIC_ID: + if (!XmlIsPublicId(encoding, s, next, &eventPtr)) + return XML_ERROR_SYNTAX; + if (declEntity) { + XML_Char *tem = poolStoreString(&dtd.pool, + encoding, + s + encoding->minBytesPerChar, + next - encoding->minBytesPerChar); + if (!tem) + return XML_ERROR_NO_MEMORY; + normalizePublicId(tem); + declEntity->publicId = tem; + poolFinish(&dtd.pool); + } + break; + case XML_ROLE_INSTANCE_START: + processor = contentProcessor; + if (hadExternalDoctype) + dtd.complete = 0; + return contentProcessor(parser, s, end, nextPtr); + case XML_ROLE_ATTLIST_ELEMENT_NAME: + { + const XML_Char *name = poolStoreString(&dtd.pool, encoding, s, next); + if (!name) + return XML_ERROR_NO_MEMORY; + declElementType = (ELEMENT_TYPE *)lookup(&dtd.elementTypes, name, sizeof(ELEMENT_TYPE)); + if (!declElementType) + return XML_ERROR_NO_MEMORY; + if (declElementType->name != name) + poolDiscard(&dtd.pool); + else + poolFinish(&dtd.pool); + break; + } + case XML_ROLE_ATTRIBUTE_NAME: + declAttributeId = getAttributeId(parser, encoding, s, next); + if (!declAttributeId) + return XML_ERROR_NO_MEMORY; + declAttributeIsCdata = 0; + break; + case XML_ROLE_ATTRIBUTE_TYPE_CDATA: + declAttributeIsCdata = 1; + break; + case XML_ROLE_IMPLIED_ATTRIBUTE_VALUE: + case XML_ROLE_REQUIRED_ATTRIBUTE_VALUE: + if (dtd.complete + && !defineAttribute(declElementType, declAttributeId, declAttributeIsCdata, 0)) + return XML_ERROR_NO_MEMORY; + break; + case XML_ROLE_DEFAULT_ATTRIBUTE_VALUE: + case XML_ROLE_FIXED_ATTRIBUTE_VALUE: + { + const XML_Char *attVal; + enum XML_Error result + = storeAttributeValue(parser, encoding, declAttributeIsCdata, + s + encoding->minBytesPerChar, + next - encoding->minBytesPerChar, + &dtd.pool); + if (result) + return result; + attVal = poolStart(&dtd.pool); + poolFinish(&dtd.pool); + if (dtd.complete + && !defineAttribute(declElementType, declAttributeId, declAttributeIsCdata, attVal)) + return XML_ERROR_NO_MEMORY; + break; + } + case XML_ROLE_ENTITY_VALUE: + { + enum XML_Error result = storeEntityValue(parser, s, next); + if (result != XML_ERROR_NONE) + return result; + } + break; + case XML_ROLE_ENTITY_SYSTEM_ID: + if (declEntity) { + declEntity->systemId = poolStoreString(&dtd.pool, encoding, + s + encoding->minBytesPerChar, + next - encoding->minBytesPerChar); + if (!declEntity->systemId) + return XML_ERROR_NO_MEMORY; + declEntity->base = dtd.base; + poolFinish(&dtd.pool); + } + break; + case XML_ROLE_ENTITY_NOTATION_NAME: + if (declEntity) { + declEntity->notation = poolStoreString(&dtd.pool, encoding, s, next); + if (!declEntity->notation) + return XML_ERROR_NO_MEMORY; + poolFinish(&dtd.pool); + if (unparsedEntityDeclHandler) { + eventPtr = eventEndPtr = s; + unparsedEntityDeclHandler(handlerArg, + declEntity->name, + declEntity->base, + declEntity->systemId, + declEntity->publicId, + declEntity->notation); + } + + } + break; + case XML_ROLE_GENERAL_ENTITY_NAME: + { + const XML_Char *name; + if (XmlPredefinedEntityName(encoding, s, next)) { + declEntity = 0; + break; + } + name = poolStoreString(&dtd.pool, encoding, s, next); + if (!name) + return XML_ERROR_NO_MEMORY; + if (dtd.complete) { + declEntity = (ENTITY *)lookup(&dtd.generalEntities, name, sizeof(ENTITY)); + if (!declEntity) + return XML_ERROR_NO_MEMORY; + if (declEntity->name != name) { + poolDiscard(&dtd.pool); + declEntity = 0; + } + else + poolFinish(&dtd.pool); + } + else { + poolDiscard(&dtd.pool); + declEntity = 0; + } + } + break; + case XML_ROLE_PARAM_ENTITY_NAME: + declEntity = 0; + break; + case XML_ROLE_NOTATION_NAME: + declNotationPublicId = 0; + declNotationName = 0; + if (notationDeclHandler) { + declNotationName = poolStoreString(&tempPool, encoding, s, next); + if (!declNotationName) + return XML_ERROR_NO_MEMORY; + poolFinish(&tempPool); + } + break; + case XML_ROLE_NOTATION_PUBLIC_ID: + if (!XmlIsPublicId(encoding, s, next, &eventPtr)) + return XML_ERROR_SYNTAX; + if (declNotationName) { + XML_Char *tem = poolStoreString(&tempPool, + encoding, + s + encoding->minBytesPerChar, + next - encoding->minBytesPerChar); + if (!tem) + return XML_ERROR_NO_MEMORY; + normalizePublicId(tem); + declNotationPublicId = tem; + poolFinish(&tempPool); + } + break; + case XML_ROLE_NOTATION_SYSTEM_ID: + if (declNotationName && notationDeclHandler) { + const XML_Char *systemId + = poolStoreString(&tempPool, encoding, + s + encoding->minBytesPerChar, + next - encoding->minBytesPerChar); + if (!systemId) + return XML_ERROR_NO_MEMORY; + eventPtr = eventEndPtr = s; + notationDeclHandler(handlerArg, + declNotationName, + dtd.base, + systemId, + declNotationPublicId); + } + poolClear(&tempPool); + break; + case XML_ROLE_NOTATION_NO_SYSTEM_ID: + if (declNotationPublicId && notationDeclHandler) { + eventPtr = eventEndPtr = s; + notationDeclHandler(handlerArg, + declNotationName, + dtd.base, + 0, + declNotationPublicId); + } + poolClear(&tempPool); + break; + case XML_ROLE_ERROR: + eventPtr = s; + switch (tok) { + case XML_TOK_PARAM_ENTITY_REF: + return XML_ERROR_PARAM_ENTITY_REF; + case XML_TOK_XML_DECL: + return XML_ERROR_MISPLACED_XML_PI; + default: + return XML_ERROR_SYNTAX; + } + case XML_ROLE_GROUP_OPEN: + if (prologState.level >= groupSize) { + if (groupSize) + groupConnector = realloc(groupConnector, groupSize *= 2); + else + groupConnector = malloc(groupSize = 32); + if (!groupConnector) + return XML_ERROR_NO_MEMORY; + } + groupConnector[prologState.level] = 0; + break; + case XML_ROLE_GROUP_SEQUENCE: + if (groupConnector[prologState.level] == '|') { + eventPtr = s; + return XML_ERROR_SYNTAX; + } + groupConnector[prologState.level] = ','; + break; + case XML_ROLE_GROUP_CHOICE: + if (groupConnector[prologState.level] == ',') { + eventPtr = s; + return XML_ERROR_SYNTAX; + } + groupConnector[prologState.level] = '|'; + break; + case XML_ROLE_PARAM_ENTITY_REF: + dtd.complete = 0; + break; + case XML_ROLE_NONE: + switch (tok) { + case XML_TOK_PI: + eventPtr = s; + eventEndPtr = next; + if (!reportProcessingInstruction(parser, encoding, s, next)) + return XML_ERROR_NO_MEMORY; + break; + } + break; + } + if (defaultHandler) { + switch (tok) { + case XML_TOK_PI: + case XML_TOK_BOM: + case XML_TOK_XML_DECL: + break; + default: + eventPtr = s; + eventEndPtr = next; + reportDefault(parser, encoding, s, next); + } + } + s = next; + } + /* not reached */ +} + +static +enum XML_Error epilogProcessor(XML_Parser parser, + const char *s, + const char *end, + const char **nextPtr) +{ + processor = epilogProcessor; + eventPtr = s; + for (;;) { + const char *next; + int tok = XmlPrologTok(encoding, s, end, &next); + eventEndPtr = next; + switch (tok) { + case XML_TOK_TRAILING_CR: + if (defaultHandler) { + eventEndPtr = end; + reportDefault(parser, encoding, s, end); + } + /* fall through */ + case XML_TOK_NONE: + if (nextPtr) + *nextPtr = end; + return XML_ERROR_NONE; + case XML_TOK_PROLOG_S: + case XML_TOK_COMMENT: + if (defaultHandler) + reportDefault(parser, encoding, s, next); + break; + case XML_TOK_PI: + if (!reportProcessingInstruction(parser, encoding, s, next)) + return XML_ERROR_NO_MEMORY; + break; + case XML_TOK_INVALID: + eventPtr = next; + return XML_ERROR_INVALID_TOKEN; + case XML_TOK_PARTIAL: + if (nextPtr) { + *nextPtr = s; + return XML_ERROR_NONE; + } + return XML_ERROR_UNCLOSED_TOKEN; + case XML_TOK_PARTIAL_CHAR: + if (nextPtr) { + *nextPtr = s; + return XML_ERROR_NONE; + } + return XML_ERROR_PARTIAL_CHAR; + default: + return XML_ERROR_JUNK_AFTER_DOC_ELEMENT; + } + eventPtr = s = next; + } +} + +static +enum XML_Error errorProcessor(XML_Parser parser, + const char *s, + const char *end, + const char **nextPtr) +{ + return errorCode; +} + +static enum XML_Error +storeAttributeValue(XML_Parser parser, const ENCODING *enc, int isCdata, + const char *ptr, const char *end, + STRING_POOL *pool) +{ + enum XML_Error result = appendAttributeValue(parser, enc, isCdata, ptr, end, pool); + if (result) + return result; + if (!isCdata && poolLength(pool) && poolLastChar(pool) == XML_T(' ')) + poolChop(pool); + if (!poolAppendChar(pool, XML_T('\0'))) + return XML_ERROR_NO_MEMORY; + return XML_ERROR_NONE; +} + +static enum XML_Error +appendAttributeValue(XML_Parser parser, const ENCODING *enc, int isCdata, + const char *ptr, const char *end, + STRING_POOL *pool) +{ + const ENCODING *internalEnc = XmlGetInternalEncoding(); + for (;;) { + const char *next; + int tok = XmlAttributeValueTok(enc, ptr, end, &next); + switch (tok) { + case XML_TOK_NONE: + return XML_ERROR_NONE; + case XML_TOK_INVALID: + if (enc == encoding) + eventPtr = next; + return XML_ERROR_INVALID_TOKEN; + case XML_TOK_PARTIAL: + if (enc == encoding) + eventPtr = ptr; + return XML_ERROR_INVALID_TOKEN; + case XML_TOK_CHAR_REF: + { + XML_Char buf[XML_ENCODE_MAX]; + int i; + int n = XmlCharRefNumber(enc, ptr); + if (n < 0) { + if (enc == encoding) + eventPtr = ptr; + return XML_ERROR_BAD_CHAR_REF; + } + if (!isCdata + && n == 0x20 /* space */ + && (poolLength(pool) == 0 || poolLastChar(pool) == XML_T(' '))) + break; + n = XmlEncode(n, (ICHAR *)buf); + if (!n) { + if (enc == encoding) + eventPtr = ptr; + return XML_ERROR_BAD_CHAR_REF; + } + for (i = 0; i < n; i++) { + if (!poolAppendChar(pool, buf[i])) + return XML_ERROR_NO_MEMORY; + } + } + break; + case XML_TOK_DATA_CHARS: + if (!poolAppend(pool, enc, ptr, next)) + return XML_ERROR_NO_MEMORY; + break; + break; + case XML_TOK_TRAILING_CR: + next = ptr + enc->minBytesPerChar; + /* fall through */ + case XML_TOK_ATTRIBUTE_VALUE_S: + case XML_TOK_DATA_NEWLINE: + if (!isCdata && (poolLength(pool) == 0 || poolLastChar(pool) == XML_T(' '))) + break; + if (!poolAppendChar(pool, XML_T(' '))) + return XML_ERROR_NO_MEMORY; + break; + case XML_TOK_ENTITY_REF: + { + const XML_Char *name; + ENTITY *entity; + XML_Char ch = XmlPredefinedEntityName(enc, + ptr + enc->minBytesPerChar, + next - enc->minBytesPerChar); + if (ch) { + if (!poolAppendChar(pool, ch)) + return XML_ERROR_NO_MEMORY; + break; + } + name = poolStoreString(&temp2Pool, enc, + ptr + enc->minBytesPerChar, + next - enc->minBytesPerChar); + if (!name) + return XML_ERROR_NO_MEMORY; + entity = (ENTITY *)lookup(&dtd.generalEntities, name, 0); + poolDiscard(&temp2Pool); + if (!entity) { + if (dtd.complete) { + if (enc == encoding) + eventPtr = ptr; + return XML_ERROR_UNDEFINED_ENTITY; + } + } + else if (entity->open) { + if (enc == encoding) + eventPtr = ptr; + return XML_ERROR_RECURSIVE_ENTITY_REF; + } + else if (entity->notation) { + if (enc == encoding) + eventPtr = ptr; + return XML_ERROR_BINARY_ENTITY_REF; + } + else if (!entity->textPtr) { + if (enc == encoding) + eventPtr = ptr; + return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF; + } + else { + enum XML_Error result; + const XML_Char *textEnd = entity->textPtr + entity->textLen; + entity->open = 1; + result = appendAttributeValue(parser, internalEnc, isCdata, (char *)entity->textPtr, (char *)textEnd, pool); + entity->open = 0; + if (result) + return result; + } + } + break; + default: + abort(); + } + ptr = next; + } + /* not reached */ +} + +static +enum XML_Error storeEntityValue(XML_Parser parser, + const char *entityTextPtr, + const char *entityTextEnd) +{ + /*const ENCODING *internalEnc = XmlGetInternalEncoding();*/ + STRING_POOL *pool = &(dtd.pool); + entityTextPtr += encoding->minBytesPerChar; + entityTextEnd -= encoding->minBytesPerChar; + for (;;) { + const char *next; + int tok = XmlEntityValueTok(encoding, entityTextPtr, entityTextEnd, &next); + switch (tok) { + case XML_TOK_PARAM_ENTITY_REF: + eventPtr = entityTextPtr; + return XML_ERROR_SYNTAX; + case XML_TOK_NONE: + if (declEntity) { + declEntity->textPtr = pool->start; + declEntity->textLen = pool->ptr - pool->start; + poolFinish(pool); + } + else + poolDiscard(pool); + return XML_ERROR_NONE; + case XML_TOK_ENTITY_REF: + case XML_TOK_DATA_CHARS: + if (!poolAppend(pool, encoding, entityTextPtr, next)) + return XML_ERROR_NO_MEMORY; + break; + case XML_TOK_TRAILING_CR: + next = entityTextPtr + encoding->minBytesPerChar; + /* fall through */ + case XML_TOK_DATA_NEWLINE: + if (pool->end == pool->ptr && !poolGrow(pool)) + return XML_ERROR_NO_MEMORY; + *(pool->ptr)++ = XML_T('\n'); + break; + case XML_TOK_CHAR_REF: + { + XML_Char buf[XML_ENCODE_MAX]; + int i; + int n = XmlCharRefNumber(encoding, entityTextPtr); + if (n < 0) { + eventPtr = entityTextPtr; + return XML_ERROR_BAD_CHAR_REF; + } + n = XmlEncode(n, (ICHAR *)buf); + if (!n) { + eventPtr = entityTextPtr; + return XML_ERROR_BAD_CHAR_REF; + } + for (i = 0; i < n; i++) { + if (pool->end == pool->ptr && !poolGrow(pool)) + return XML_ERROR_NO_MEMORY; + *(pool->ptr)++ = buf[i]; + } + } + break; + case XML_TOK_PARTIAL: + eventPtr = entityTextPtr; + return XML_ERROR_INVALID_TOKEN; + case XML_TOK_INVALID: + eventPtr = next; + return XML_ERROR_INVALID_TOKEN; + default: + abort(); + } + entityTextPtr = next; + } + /* not reached */ +} + +static void +normalizeLines(XML_Char *s) +{ + XML_Char *p; + for (;; s++) { + if (*s == XML_T('\0')) + return; + if (*s == XML_T('\r')) + break; + } + p = s; + do { + if (*s == XML_T('\r')) { + *p++ = XML_T('\n'); + if (*++s == XML_T('\n')) + s++; + } + else + *p++ = *s++; + } while (*s); + *p = XML_T('\0'); +} + +static int +reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) +{ + const XML_Char *target; + XML_Char *data; + const char *tem; + if (!processingInstructionHandler) { + if (defaultHandler) + reportDefault(parser, enc, start, end); + return 1; + } + start += enc->minBytesPerChar * 2; + tem = start + XmlNameLength(enc, start); + target = poolStoreString(&tempPool, enc, start, tem); + if (!target) + return 0; + poolFinish(&tempPool); + data = poolStoreString(&tempPool, enc, + XmlSkipS(enc, tem), + end - enc->minBytesPerChar*2); + if (!data) + return 0; + normalizeLines(data); + processingInstructionHandler(handlerArg, target, data); + poolClear(&tempPool); + return 1; +} + +static void +reportDefault(XML_Parser parser, const ENCODING *enc, const char *s, const char *end) +{ + if (MUST_CONVERT(enc, s)) { + for (;;) { + ICHAR *dataPtr = (ICHAR *)dataBuf; + XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); + if (s == end) { + defaultHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); + break; + } + if (enc == encoding) { + eventEndPtr = s; + defaultHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); + eventPtr = s; + } + else + defaultHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); + } + } + else + defaultHandler(handlerArg, (XML_Char *)s, (XML_Char *)end - (XML_Char *)s); +} + + +static int +defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, int isCdata, const XML_Char *value) +{ + DEFAULT_ATTRIBUTE *att; + if (type->nDefaultAtts == type->allocDefaultAtts) { + if (type->allocDefaultAtts == 0) { + type->allocDefaultAtts = 8; + type->defaultAtts = malloc(type->allocDefaultAtts*sizeof(DEFAULT_ATTRIBUTE)); + } + else { + type->allocDefaultAtts *= 2; + type->defaultAtts = realloc(type->defaultAtts, + type->allocDefaultAtts*sizeof(DEFAULT_ATTRIBUTE)); + } + if (!type->defaultAtts) + return 0; + } + att = type->defaultAtts + type->nDefaultAtts; + att->id = attId; + att->value = value; + att->isCdata = isCdata; + if (!isCdata) + attId->maybeTokenized = 1; + type->nDefaultAtts += 1; + return 1; +} + +static ATTRIBUTE_ID * +getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) +{ + ATTRIBUTE_ID *id; + const XML_Char *name; + if (!poolAppendChar(&dtd.pool, XML_T('\0'))) + return 0; + name = poolStoreString(&dtd.pool, enc, start, end); + if (!name) + return 0; + ++name; + id = (ATTRIBUTE_ID *)lookup(&dtd.attributeIds, name, sizeof(ATTRIBUTE_ID)); + if (!id) + return 0; + if (id->name != name) + poolDiscard(&dtd.pool); + else + poolFinish(&dtd.pool); + return id; +} + +static +const XML_Char *getOpenEntityNames(XML_Parser parser) +{ + HASH_TABLE_ITER iter; + + hashTableIterInit(&iter, &(dtd.generalEntities)); + for (;;) { + const XML_Char *s; + ENTITY *e = (ENTITY *)hashTableIterNext(&iter); + if (!e) + break; + if (!e->open) + continue; + if (poolLength(&tempPool) > 0 && !poolAppendChar(&tempPool, XML_T(' '))) + return 0; + for (s = e->name; *s; s++) + if (!poolAppendChar(&tempPool, *s)) + return 0; + } + + if (!poolAppendChar(&tempPool, XML_T('\0'))) + return 0; + return tempPool.start; +} + +static +int setOpenEntityNames(XML_Parser parser, const XML_Char *openEntityNames) +{ + const XML_Char *s = openEntityNames; + while (*openEntityNames != XML_T('\0')) { + if (*s == XML_T(' ') || *s == XML_T('\0')) { + ENTITY *e; + if (!poolAppendChar(&tempPool, XML_T('\0'))) + return 0; + e = (ENTITY *)lookup(&dtd.generalEntities, poolStart(&tempPool), 0); + if (e) + e->open = 1; + if (*s == XML_T(' ')) + s++; + openEntityNames = s; + poolDiscard(&tempPool); + } + else { + if (!poolAppendChar(&tempPool, *s)) + return 0; + s++; + } + } + return 1; +} + + +static +void normalizePublicId(XML_Char *publicId) +{ + XML_Char *p = publicId; + XML_Char *s; + for (s = publicId; *s; s++) { + switch (*s) { + case XML_T(' '): + case XML_T('\r'): + case XML_T('\n'): + if (p != publicId && p[-1] != XML_T(' ')) + *p++ = XML_T(' '); + break; + default: + *p++ = *s; + } + } + if (p != publicId && p[-1] == XML_T(' ')) + --p; + *p = XML_T('\0'); +} + +static int dtdInit(DTD *p) +{ + poolInit(&(p->pool)); + hashTableInit(&(p->generalEntities)); + hashTableInit(&(p->elementTypes)); + hashTableInit(&(p->attributeIds)); + p->complete = 1; + p->base = 0; + return 1; +} + +static void dtdDestroy(DTD *p) +{ + HASH_TABLE_ITER iter; + hashTableIterInit(&iter, &(p->elementTypes)); + for (;;) { + ELEMENT_TYPE *e = (ELEMENT_TYPE *)hashTableIterNext(&iter); + if (!e) + break; + if (e->allocDefaultAtts != 0) + free(e->defaultAtts); + } + hashTableDestroy(&(p->generalEntities)); + hashTableDestroy(&(p->elementTypes)); + hashTableDestroy(&(p->attributeIds)); + poolDestroy(&(p->pool)); +} + +/* Do a deep copy of the DTD. Return 0 for out of memory; non-zero otherwise. +The new DTD has already been initialized. */ + +static int dtdCopy(DTD *newDtd, const DTD *oldDtd) +{ + HASH_TABLE_ITER iter; + + if (oldDtd->base) { + const XML_Char *tem = poolCopyString(&(newDtd->pool), oldDtd->base); + if (!tem) + return 0; + newDtd->base = tem; + } + + hashTableIterInit(&iter, &(oldDtd->attributeIds)); + + /* Copy the attribute id table. */ + + for (;;) { + ATTRIBUTE_ID *newA; + const XML_Char *name; + const ATTRIBUTE_ID *oldA = (ATTRIBUTE_ID *)hashTableIterNext(&iter); + + if (!oldA) + break; + /* Remember to allocate the scratch byte before the name. */ + if (!poolAppendChar(&(newDtd->pool), XML_T('\0'))) + return 0; + name = poolCopyString(&(newDtd->pool), oldA->name); + if (!name) + return 0; + ++name; + newA = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), name, sizeof(ATTRIBUTE_ID)); + if (!newA) + return 0; + newA->maybeTokenized = oldA->maybeTokenized; + } + + /* Copy the element type table. */ + + hashTableIterInit(&iter, &(oldDtd->elementTypes)); + + for (;;) { + int i; + ELEMENT_TYPE *newE; + const XML_Char *name; + const ELEMENT_TYPE *oldE = (ELEMENT_TYPE *)hashTableIterNext(&iter); + if (!oldE) + break; + name = poolCopyString(&(newDtd->pool), oldE->name); + if (!name) + return 0; + newE = (ELEMENT_TYPE *)lookup(&(newDtd->elementTypes), name, sizeof(ELEMENT_TYPE)); + if (!newE) + return 0; + newE->defaultAtts = (DEFAULT_ATTRIBUTE *)malloc(oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); + if (!newE->defaultAtts) + return 0; + newE->allocDefaultAtts = newE->nDefaultAtts = oldE->nDefaultAtts; + for (i = 0; i < newE->nDefaultAtts; i++) { + newE->defaultAtts[i].id = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), oldE->defaultAtts[i].id->name, 0); + newE->defaultAtts[i].isCdata = oldE->defaultAtts[i].isCdata; + newE->defaultAtts[i].value = poolCopyString(&(newDtd->pool), oldE->defaultAtts[i].value); + if (!newE->defaultAtts[i].value) + return 0; + } + } + + /* Copy the entity table. */ + + hashTableIterInit(&iter, &(oldDtd->generalEntities)); + + for (;;) { + ENTITY *newE; + const XML_Char *name; + const ENTITY *oldE = (ENTITY *)hashTableIterNext(&iter); + if (!oldE) + break; + name = poolCopyString(&(newDtd->pool), oldE->name); + if (!name) + return 0; + newE = (ENTITY *)lookup(&(newDtd->generalEntities), name, sizeof(ENTITY)); + if (!newE) + return 0; + if (oldE->systemId) { + const XML_Char *tem = poolCopyString(&(newDtd->pool), oldE->systemId); + if (!tem) + return 0; + newE->systemId = tem; + if (oldE->base) { + if (oldE->base == oldDtd->base) + newE->base = newDtd->base; + tem = poolCopyString(&(newDtd->pool), oldE->base); + if (!tem) + return 0; + newE->base = tem; + } + } + else { + const XML_Char *tem = poolCopyStringN(&(newDtd->pool), oldE->textPtr, oldE->textLen); + if (!tem) + return 0; + newE->textPtr = tem; + newE->textLen = oldE->textLen; + } + if (oldE->notation) { + const XML_Char *tem = poolCopyString(&(newDtd->pool), oldE->notation); + if (!tem) + return 0; + newE->notation = tem; + } + } + + newDtd->complete = oldDtd->complete; + newDtd->standalone = oldDtd->standalone; + return 1; +} + +static +void poolInit(STRING_POOL *pool) +{ + pool->blocks = 0; + pool->freeBlocks = 0; + pool->start = 0; + pool->ptr = 0; + pool->end = 0; +} + +static +void poolClear(STRING_POOL *pool) +{ + if (!pool->freeBlocks) + pool->freeBlocks = pool->blocks; + else { + BLOCK *p = pool->blocks; + while (p) { + BLOCK *tem = p->next; + p->next = pool->freeBlocks; + pool->freeBlocks = p; + p = tem; + } + } + pool->blocks = 0; + pool->start = 0; + pool->ptr = 0; + pool->end = 0; +} + +static +void poolDestroy(STRING_POOL *pool) +{ + BLOCK *p = pool->blocks; + while (p) { + BLOCK *tem = p->next; + free(p); + p = tem; + } + pool->blocks = 0; + p = pool->freeBlocks; + while (p) { + BLOCK *tem = p->next; + free(p); + p = tem; + } + pool->freeBlocks = 0; + pool->ptr = 0; + pool->start = 0; + pool->end = 0; +} + +static +XML_Char *poolAppend(STRING_POOL *pool, const ENCODING *enc, + const char *ptr, const char *end) +{ + if (!pool->ptr && !poolGrow(pool)) + return 0; + for (;;) { + XmlConvert(enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end); + if (ptr == end) + break; + if (!poolGrow(pool)) + return 0; + } + return pool->start; +} + +static const XML_Char *poolCopyString(STRING_POOL *pool, const XML_Char *s) +{ + do { + if (!poolAppendChar(pool, *s)) + return 0; + } while (*s++); + s = pool->start; + poolFinish(pool); + return s; +} + +static const XML_Char *poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n) +{ + if (!pool->ptr && !poolGrow(pool)) + return 0; + for (; n > 0; --n, s++) { + if (!poolAppendChar(pool, *s)) + return 0; + + } + s = pool->start; + poolFinish(pool); + return s; +} + +static +XML_Char *poolStoreString(STRING_POOL *pool, const ENCODING *enc, + const char *ptr, const char *end) +{ + if (!poolAppend(pool, enc, ptr, end)) + return 0; + if (pool->ptr == pool->end && !poolGrow(pool)) + return 0; + *(pool->ptr)++ = 0; + return pool->start; +} + +static +int poolGrow(STRING_POOL *pool) +{ + if (pool->freeBlocks) { + if (pool->start == 0) { + pool->blocks = pool->freeBlocks; + pool->freeBlocks = pool->freeBlocks->next; + pool->blocks->next = 0; + pool->start = pool->blocks->s; + pool->end = pool->start + pool->blocks->size; + pool->ptr = pool->start; + return 1; + } + if (pool->end - pool->start < pool->freeBlocks->size) { + BLOCK *tem = pool->freeBlocks->next; + pool->freeBlocks->next = pool->blocks; + pool->blocks = pool->freeBlocks; + pool->freeBlocks = tem; + memcpy(pool->blocks->s, pool->start, (pool->end - pool->start) * sizeof(XML_Char)); + pool->ptr = pool->blocks->s + (pool->ptr - pool->start); + pool->start = pool->blocks->s; + pool->end = pool->start + pool->blocks->size; + return 1; + } + } + if (pool->blocks && pool->start == pool->blocks->s) { + int blockSize = (pool->end - pool->start)*2; + pool->blocks = realloc(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); + if (!pool->blocks) + return 0; + pool->blocks->size = blockSize; + pool->ptr = pool->blocks->s + (pool->ptr - pool->start); + pool->start = pool->blocks->s; + pool->end = pool->start + blockSize; + } + else { + BLOCK *tem; + int blockSize = pool->end - pool->start; + if (blockSize < INIT_BLOCK_SIZE) + blockSize = INIT_BLOCK_SIZE; + else + blockSize *= 2; + tem = malloc(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); + if (!tem) + return 0; + tem->size = blockSize; + tem->next = pool->blocks; + pool->blocks = tem; + memcpy(tem->s, pool->start, (pool->ptr - pool->start) * sizeof(XML_Char)); + pool->ptr = tem->s + (pool->ptr - pool->start); + pool->start = tem->s; + pool->end = tem->s + blockSize; + } + return 1; +} Index: library/xml/TclExpat-1.1/xmlparse.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/xmlparse.h (revision 0) +++ library/xml/TclExpat-1.1/xmlparse.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,382 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#ifndef XmlParse_INCLUDED +#define XmlParse_INCLUDED 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef XMLPARSEAPI +#define XMLPARSEAPI /* as nothing */ +#endif + +typedef void *XML_Parser; + +#ifdef XML_UNICODE_WCHAR_T + +/* XML_UNICODE_WCHAR_T will work only if sizeof(wchar_t) == 2 and wchar_t +uses Unicode. */ +/* Information is UTF-16 encoded as wchar_ts */ + +#ifndef XML_UNICODE +#define XML_UNICODE +#endif + +#include +typedef wchar_t XML_Char; +typedef wchar_t XML_LChar; + +#else /* not XML_UNICODE_WCHAR_T */ + +#ifdef XML_UNICODE + +/* Information is UTF-16 encoded as unsigned shorts */ +typedef unsigned short XML_Char; +typedef char XML_LChar; + +#else /* not XML_UNICODE */ + +/* Information is UTF-8 encoded. */ +typedef char XML_Char; +typedef char XML_LChar; + +#endif /* not XML_UNICODE */ + +#endif /* not XML_UNICODE_WCHAR_T */ + + +/* Constructs a new parser; encoding is the encoding specified by the external +protocol or null if there is none specified. */ + +XML_Parser XMLPARSEAPI +XML_ParserCreate(const XML_Char *encoding); + + +/* atts is array of name/value pairs, terminated by 0; + names and values are 0 terminated. */ + +typedef void (*XML_StartElementHandler)(void *userData, + const XML_Char *name, + const XML_Char **atts); + +typedef void (*XML_EndElementHandler)(void *userData, + const XML_Char *name); + +/* s is not 0 terminated. */ +typedef void (*XML_CharacterDataHandler)(void *userData, + const XML_Char *s, + size_t len); + +/* target and data are 0 terminated */ +typedef void (*XML_ProcessingInstructionHandler)(void *userData, + const XML_Char *target, + const XML_Char *data); + +/* This is called for any characters in the XML document for +which there is no applicable handler. This includes both +characters that are part of markup which is of a kind that is +not reported (comments, markup declarations), or characters +that are part of a construct which could be reported but +for which no handler has been supplied. The characters are passed +exactly as they were in the XML document except that +they will be encoded in UTF-8. Line boundaries are not normalized. +Note that a byte order mark character is not passed to the default handler. +If a default handler is set, internal entity references +are not expanded. There are no guarantees about +how characters are divided between calls to the default handler: +for example, a comment might be split between multiple calls. */ + +typedef void (*XML_DefaultHandler)(void *userData, + const XML_Char *s, + int len); + +/* This is called for a declaration of an unparsed (NDATA) +entity. The base argument is whatever was set by XML_SetBase. +The entityName, systemId and notationName arguments will never be null. +The other arguments may be. */ + +typedef void (*XML_UnparsedEntityDeclHandler)(void *userData, + const XML_Char *entityName, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId, + const XML_Char *notationName); + +/* This is called for a declaration of notation. +The base argument is whatever was set by XML_SetBase. +The notationName will never be null. The other arguments can be. */ + +typedef void (*XML_NotationDeclHandler)(void *userData, + const XML_Char *notationName, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId); + +/* This is called for a reference to an external parsed general entity. +The referenced entity is not automatically parsed. +The application can parse it immediately or later using +XML_ExternalEntityParserCreate. +The parser argument is the parser parsing the entity containing the reference; +it can be passed as the parser argument to XML_ExternalEntityParserCreate. +The systemId argument is the system identifier as specified in the entity declaration; +it will not be null. +The base argument is the system identifier that should be used as the base for +resolving systemId if systemId was relative; this is set by XML_SetBase; +it may be null. +The publicId argument is the public identifier as specified in the entity declaration, +or null if none was specified; the whitespace in the public identifier +will have been normalized as required by the XML spec. +The openEntityNames argument is a space-separated list of the names of the entities +that are open for the parse of this entity (including the name of the referenced +entity); this can be passed as the openEntityNames argument to +XML_ExternalEntityParserCreate; openEntityNames is valid only until the handler +returns, so if the referenced entity is to be parsed later, it must be copied. +The handler should return 0 if processing should not continue because of +a fatal error in the handling of the external entity. +In this case the calling parser will return an XML_ERROR_EXTERNAL_ENTITY_HANDLING +error. +Note that unlike other handlers the first argument is the parser, not userData. */ + +typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser, + const XML_Char *openEntityNames, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId); + +/* This structure is filled in by the XML_UnknownEncodingHandler +to provide information to the parser about encodings that are unknown +to the parser. +The map[b] member gives information about byte sequences +whose first byte is b. +If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar value c. +If map[b] is -1, then the byte sequence is malformed. +If map[b] is -n, where n >= 2, then b is the first byte of an n-byte +sequence that encodes a single Unicode scalar value. +The data member will be passed as the first argument to the convert function. +The convert function is used to convert multibyte sequences; +s will point to a n-byte sequence where map[(unsigned char)*s] == -n. +The convert function must return the Unicode scalar value +represented by this byte sequence or -1 if the byte sequence is malformed. +The convert function may be null if the encoding is a single-byte encoding, +that is if map[b] >= -1 for all bytes b. +When the parser is finished with the encoding, then if release is not null, +it will call release passing it the data member; +once release has been called, the convert function will not be called again. + +Expat places certain restrictions on the encodings that are supported +using this mechanism. + +1. Every ASCII character that can appear in a well-formed XML document, +other than the characters + + $@\^`{}~ + +must be represented by a single byte, and that byte must be the +same byte that represents that character in ASCII. + +2. No character may require more than 4 bytes to encode. + +3. All characters encoded must have Unicode scalar values <= 0xFFFF, +(ie characters that would be encoded by surrogates in UTF-16 +are not allowed). Note that this restriction doesn't apply to +the built-in support for UTF-8 and UTF-16. + +4. No Unicode character may be encoded by more than one distinct sequence +of bytes. */ + +typedef struct { + int map[256]; + void *data; + int (*convert)(void *data, const char *s); + void (*release)(void *data); +} XML_Encoding; + +/* This is called for an encoding that is unknown to the parser. +The encodingHandlerData argument is that which was passed as the +second argument to XML_SetUnknownEncodingHandler. +The name argument gives the name of the encoding as specified in +the encoding declaration. +If the callback can provide information about the encoding, +it must fill in the XML_Encoding structure, and return 1. +Otherwise it must return 0. +If info does not describe a suitable encoding, +then the parser will return an XML_UNKNOWN_ENCODING error. */ + +typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData, + const XML_Char *name, + XML_Encoding *info); + +void XMLPARSEAPI +XML_SetElementHandler(XML_Parser parser, + XML_StartElementHandler start, + XML_EndElementHandler end); + +void XMLPARSEAPI +XML_SetCharacterDataHandler(XML_Parser parser, + XML_CharacterDataHandler handler); + +void XMLPARSEAPI +XML_SetProcessingInstructionHandler(XML_Parser parser, + XML_ProcessingInstructionHandler handler); + +void XMLPARSEAPI +XML_SetDefaultHandler(XML_Parser parser, + XML_DefaultHandler handler); + +void XMLPARSEAPI +XML_SetUnparsedEntityDeclHandler(XML_Parser parser, + XML_UnparsedEntityDeclHandler handler); + +void XMLPARSEAPI +XML_SetNotationDeclHandler(XML_Parser parser, + XML_NotationDeclHandler handler); + +void XMLPARSEAPI +XML_SetExternalEntityRefHandler(XML_Parser parser, + XML_ExternalEntityRefHandler handler); + +void XMLPARSEAPI +XML_SetUnknownEncodingHandler(XML_Parser parser, + XML_UnknownEncodingHandler handler, + void *encodingHandlerData); + +/* This can be called within a handler for a start element, end element, +processing instruction or character data. It causes the corresponding +markup to be passed to the default handler. +Within the expansion of an internal entity, nothing will be passed +to the default handler, although this usually will not happen since +setting a default handler inhibits expansion of internal entities. */ +void XMLPARSEAPI XML_DefaultCurrent(XML_Parser parser); + +/* This value is passed as the userData argument to callbacks. */ +void XMLPARSEAPI +XML_SetUserData(XML_Parser parser, void *userData); + +/* Returns the last value set by XML_SetUserData or null. */ +#define XML_GetUserData(parser) (*(void **)(parser)) + +/* If this function is called, then the parser will be passed +as the first argument to callbacks instead of userData. +The userData will still be accessible using XML_GetUserData. */ + +void XMLPARSEAPI +XML_UseParserAsHandlerArg(XML_Parser parser); + +/* Sets the base to be used for resolving relative URIs in system identifiers in +declarations. Resolving relative identifiers is left to the application: +this value will be passed through as the base argument to the +XML_ExternalEntityRefHandler, XML_NotationDeclHandler +and XML_UnparsedEntityDeclHandler. The base argument will be copied. +Returns zero if out of memory, non-zero otherwise. */ + +int XMLPARSEAPI +XML_SetBase(XML_Parser parser, const XML_Char *base); + +const XML_Char XMLPARSEAPI * +XML_GetBase(XML_Parser parser); + +/* Parses some input. Returns 0 if a fatal error is detected. +The last call to XML_Parse must have isFinal true; +len may be zero for this call (or any other). */ +int XMLPARSEAPI +XML_Parse(XML_Parser parser, const char *s, size_t len, int isFinal); + +void XMLPARSEAPI * +XML_GetBuffer(XML_Parser parser, size_t len); + +int XMLPARSEAPI +XML_ParseBuffer(XML_Parser parser, size_t len, int isFinal); + +/* Creates an XML_Parser object that can parse an external general entity; +openEntityNames is a space-separated list of the names of the entities that are open +for the parse of this entity (including the name of this one); +encoding is the externally specified encoding, +or null if there is no externally specified encoding. +This can be called at any point after the first call to an ExternalEntityRefHandler +so longer as the parser has not yet been freed. +The new parser is completely independent and may safely be used in a separate thread. +The handlers and userData are initialized from the parser argument. +Returns 0 if out of memory. Otherwise returns a new XML_Parser object. */ +XML_Parser XMLPARSEAPI +XML_ExternalEntityParserCreate(XML_Parser parser, + const XML_Char *openEntityNames, + const XML_Char *encoding); + +enum XML_Error { + XML_ERROR_NONE, + XML_ERROR_NO_MEMORY, + XML_ERROR_SYNTAX, + XML_ERROR_NO_ELEMENTS, + XML_ERROR_INVALID_TOKEN, + XML_ERROR_UNCLOSED_TOKEN, + XML_ERROR_PARTIAL_CHAR, + XML_ERROR_TAG_MISMATCH, + XML_ERROR_DUPLICATE_ATTRIBUTE, + XML_ERROR_JUNK_AFTER_DOC_ELEMENT, + XML_ERROR_PARAM_ENTITY_REF, + XML_ERROR_UNDEFINED_ENTITY, + XML_ERROR_RECURSIVE_ENTITY_REF, + XML_ERROR_ASYNC_ENTITY, + XML_ERROR_BAD_CHAR_REF, + XML_ERROR_BINARY_ENTITY_REF, + XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, + XML_ERROR_MISPLACED_XML_PI, + XML_ERROR_UNKNOWN_ENCODING, + XML_ERROR_INCORRECT_ENCODING, + XML_ERROR_UNCLOSED_CDATA_SECTION, + XML_ERROR_EXTERNAL_ENTITY_HANDLING +}; + +/* If XML_Parse or XML_ParseBuffer have returned 0, then XML_GetErrorCode +returns information about the error. */ + +enum XML_Error XMLPARSEAPI XML_GetErrorCode(XML_Parser parser); + +/* These functions return information about the current parse location. +They may be called when XML_Parse or XML_ParseBuffer return 0; +in this case the location is the location of the character at which +the error was detected. +They may also be called from any other callback called to report +some parse event; in this the location is the location of the first +of the sequence of characters that generated the event. */ + +int XMLPARSEAPI XML_GetCurrentLineNumber(XML_Parser parser); +int XMLPARSEAPI XML_GetCurrentColumnNumber(XML_Parser parser); +long XMLPARSEAPI XML_GetCurrentByteIndex(XML_Parser parser); + +/* For backwards compatibility with previous versions. */ +#define XML_GetErrorLineNumber XML_GetCurrentLineNumber +#define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber +#define XML_GetErrorByteIndex XML_GetCurrentByteIndex + +/* Frees memory used by the parser. */ +void XMLPARSEAPI +XML_ParserFree(XML_Parser parser); + +/* Returns a string describing the error. */ +const XML_LChar XMLPARSEAPI *XML_ErrorString(enum XML_Error code); + +#ifdef __cplusplus +} +#endif + +#endif /* not XmlParse_INCLUDED */ Index: library/xml/TclExpat-1.1/xmlrole.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/xmlrole.c (revision 0) +++ library/xml/TclExpat-1.1/xmlrole.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1096 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ +#include /* for time_t */ + +#include "xmldef.h" +#include "xmlrole.h" + +/* Doesn't check: + + that ,| are not mixed in a model group + content of literals + +*/ + +#ifndef MIN_BYTES_PER_CHAR +#define MIN_BYTES_PER_CHAR(enc) ((enc)->minBytesPerChar) +#endif + +typedef int PROLOG_HANDLER(struct prolog_state *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc); + +static PROLOG_HANDLER + prolog0, prolog1, prolog2, + doctype0, doctype1, doctype2, doctype3, doctype4, doctype5, + internalSubset, + entity0, entity1, entity2, entity3, entity4, entity5, entity6, + entity7, entity8, entity9, + notation0, notation1, notation2, notation3, notation4, + attlist0, attlist1, attlist2, attlist3, attlist4, attlist5, attlist6, + attlist7, attlist8, attlist9, + element0, element1, element2, element3, element4, element5, element6, + element7, + declClose, + error; + +static +int syntaxError(PROLOG_STATE *); + +static +int prolog0(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + state->handler = prolog1; + return XML_ROLE_NONE; + case XML_TOK_XML_DECL: + state->handler = prolog1; + return XML_ROLE_XML_DECL; + case XML_TOK_PI: + state->handler = prolog1; + return XML_ROLE_NONE; + case XML_TOK_COMMENT: + state->handler = prolog1; + case XML_TOK_BOM: + return XML_ROLE_NONE; + case XML_TOK_DECL_OPEN: + if (!XmlNameMatchesAscii(enc, + ptr + 2 * MIN_BYTES_PER_CHAR(enc), + "DOCTYPE")) + break; + state->handler = doctype0; + return XML_ROLE_NONE; + case XML_TOK_INSTANCE_START: + state->handler = error; + return XML_ROLE_INSTANCE_START; + } + return syntaxError(state); +} + +static +int prolog1(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_PI: + case XML_TOK_COMMENT: + case XML_TOK_BOM: + return XML_ROLE_NONE; + case XML_TOK_DECL_OPEN: + if (!XmlNameMatchesAscii(enc, + ptr + 2 * MIN_BYTES_PER_CHAR(enc), + "DOCTYPE")) + break; + state->handler = doctype0; + return XML_ROLE_NONE; + case XML_TOK_INSTANCE_START: + state->handler = error; + return XML_ROLE_INSTANCE_START; + } + return syntaxError(state); +} + +static +int prolog2(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_PI: + case XML_TOK_COMMENT: + return XML_ROLE_NONE; + case XML_TOK_INSTANCE_START: + state->handler = error; + return XML_ROLE_INSTANCE_START; + } + return syntaxError(state); +} + +static +int doctype0(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + state->handler = doctype1; + return XML_ROLE_DOCTYPE_NAME; + } + return syntaxError(state); +} + +static +int doctype1(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_OPEN_BRACKET: + state->handler = internalSubset; + return XML_ROLE_NONE; + case XML_TOK_DECL_CLOSE: + state->handler = prolog2; + return XML_ROLE_DOCTYPE_CLOSE; + case XML_TOK_NAME: + if (XmlNameMatchesAscii(enc, ptr, "SYSTEM")) { + state->handler = doctype3; + return XML_ROLE_NONE; + } + if (XmlNameMatchesAscii(enc, ptr, "PUBLIC")) { + state->handler = doctype2; + return XML_ROLE_NONE; + } + break; + } + return syntaxError(state); +} + +static +int doctype2(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_LITERAL: + state->handler = doctype3; + return XML_ROLE_DOCTYPE_PUBLIC_ID; + } + return syntaxError(state); +} + +static +int doctype3(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_LITERAL: + state->handler = doctype4; + return XML_ROLE_DOCTYPE_SYSTEM_ID; + } + return syntaxError(state); +} + +static +int doctype4(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_OPEN_BRACKET: + state->handler = internalSubset; + return XML_ROLE_NONE; + case XML_TOK_DECL_CLOSE: + state->handler = prolog2; + return XML_ROLE_DOCTYPE_CLOSE; + } + return syntaxError(state); +} + +static +int doctype5(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_DECL_CLOSE: + state->handler = prolog2; + return XML_ROLE_DOCTYPE_CLOSE; + } + return syntaxError(state); +} + +static +int internalSubset(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_DECL_OPEN: + if (XmlNameMatchesAscii(enc, + ptr + 2 * MIN_BYTES_PER_CHAR(enc), + "ENTITY")) { + state->handler = entity0; + return XML_ROLE_NONE; + } + if (XmlNameMatchesAscii(enc, + ptr + 2 * MIN_BYTES_PER_CHAR(enc), + "ATTLIST")) { + state->handler = attlist0; + return XML_ROLE_NONE; + } + if (XmlNameMatchesAscii(enc, + ptr + 2 * MIN_BYTES_PER_CHAR(enc), + "ELEMENT")) { + state->handler = element0; + return XML_ROLE_NONE; + } + if (XmlNameMatchesAscii(enc, + ptr + 2 * MIN_BYTES_PER_CHAR(enc), + "NOTATION")) { + state->handler = notation0; + return XML_ROLE_NONE; + } + break; + case XML_TOK_PI: + case XML_TOK_COMMENT: + return XML_ROLE_NONE; + case XML_TOK_PARAM_ENTITY_REF: + return XML_ROLE_PARAM_ENTITY_REF; + case XML_TOK_CLOSE_BRACKET: + state->handler = doctype5; + return XML_ROLE_NONE; + } + return syntaxError(state); +} + +static +int entity0(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_PERCENT: + state->handler = entity1; + return XML_ROLE_NONE; + case XML_TOK_NAME: + state->handler = entity2; + return XML_ROLE_GENERAL_ENTITY_NAME; + } + return syntaxError(state); +} + +static +int entity1(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + state->handler = entity7; + return XML_ROLE_PARAM_ENTITY_NAME; + } + return syntaxError(state); +} + +static +int entity2(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + if (XmlNameMatchesAscii(enc, ptr, "SYSTEM")) { + state->handler = entity4; + return XML_ROLE_NONE; + } + if (XmlNameMatchesAscii(enc, ptr, "PUBLIC")) { + state->handler = entity3; + return XML_ROLE_NONE; + } + break; + case XML_TOK_LITERAL: + state->handler = declClose; + return XML_ROLE_ENTITY_VALUE; + } + return syntaxError(state); +} + +static +int entity3(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_LITERAL: + state->handler = entity4; + return XML_ROLE_ENTITY_PUBLIC_ID; + } + return syntaxError(state); +} + + +static +int entity4(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_LITERAL: + state->handler = entity5; + return XML_ROLE_ENTITY_SYSTEM_ID; + } + return syntaxError(state); +} + +static +int entity5(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_DECL_CLOSE: + state->handler = internalSubset; + return XML_ROLE_NONE; + case XML_TOK_NAME: + if (XmlNameMatchesAscii(enc, ptr, "NDATA")) { + state->handler = entity6; + return XML_ROLE_NONE; + } + break; + } + return syntaxError(state); +} + +static +int entity6(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + state->handler = declClose; + return XML_ROLE_ENTITY_NOTATION_NAME; + } + return syntaxError(state); +} + +static +int entity7(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + if (XmlNameMatchesAscii(enc, ptr, "SYSTEM")) { + state->handler = entity9; + return XML_ROLE_NONE; + } + if (XmlNameMatchesAscii(enc, ptr, "PUBLIC")) { + state->handler = entity8; + return XML_ROLE_NONE; + } + break; + case XML_TOK_LITERAL: + state->handler = declClose; + return XML_ROLE_ENTITY_VALUE; + } + return syntaxError(state); +} + +static +int entity8(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_LITERAL: + state->handler = entity9; + return XML_ROLE_ENTITY_PUBLIC_ID; + } + return syntaxError(state); +} + +static +int entity9(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_LITERAL: + state->handler = declClose; + return XML_ROLE_ENTITY_SYSTEM_ID; + } + return syntaxError(state); +} + +static +int notation0(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + state->handler = notation1; + return XML_ROLE_NOTATION_NAME; + } + return syntaxError(state); +} + +static +int notation1(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + if (XmlNameMatchesAscii(enc, ptr, "SYSTEM")) { + state->handler = notation3; + return XML_ROLE_NONE; + } + if (XmlNameMatchesAscii(enc, ptr, "PUBLIC")) { + state->handler = notation2; + return XML_ROLE_NONE; + } + break; + } + return syntaxError(state); +} + +static +int notation2(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_LITERAL: + state->handler = notation4; + return XML_ROLE_NOTATION_PUBLIC_ID; + } + return syntaxError(state); +} + +static +int notation3(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_LITERAL: + state->handler = declClose; + return XML_ROLE_NOTATION_SYSTEM_ID; + } + return syntaxError(state); +} + +static +int notation4(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_LITERAL: + state->handler = declClose; + return XML_ROLE_NOTATION_SYSTEM_ID; + case XML_TOK_DECL_CLOSE: + state->handler = internalSubset; + return XML_ROLE_NOTATION_NO_SYSTEM_ID; + } + return syntaxError(state); +} + +static +int attlist0(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + state->handler = attlist1; + return XML_ROLE_ATTLIST_ELEMENT_NAME; + } + return syntaxError(state); +} + +static +int attlist1(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_DECL_CLOSE: + state->handler = internalSubset; + return XML_ROLE_NONE; + case XML_TOK_NAME: + state->handler = attlist2; + return XML_ROLE_ATTRIBUTE_NAME; + } + return syntaxError(state); +} + +static +int attlist2(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + { + static const char *types[] = { + "CDATA", + "ID", + "IDREF", + "IDREFS", + "ENTITY", + "ENTITIES", + "NMTOKEN", + "NMTOKENS", + }; + int i; + for (i = 0; i < (int)(sizeof(types)/sizeof(types[0])); i++) + if (XmlNameMatchesAscii(enc, ptr, types[i])) { + state->handler = attlist8; + return XML_ROLE_ATTRIBUTE_TYPE_CDATA + i; + } + } + if (XmlNameMatchesAscii(enc, ptr, "NOTATION")) { + state->handler = attlist5; + return XML_ROLE_NONE; + } + break; + case XML_TOK_OPEN_PAREN: + state->handler = attlist3; + return XML_ROLE_NONE; + } + return syntaxError(state); +} + +static +int attlist3(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NMTOKEN: + case XML_TOK_NAME: + state->handler = attlist4; + return XML_ROLE_ATTRIBUTE_ENUM_VALUE; + } + return syntaxError(state); +} + +static +int attlist4(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_CLOSE_PAREN: + state->handler = attlist8; + return XML_ROLE_NONE; + case XML_TOK_OR: + state->handler = attlist3; + return XML_ROLE_NONE; + } + return syntaxError(state); +} + +static +int attlist5(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_OPEN_PAREN: + state->handler = attlist6; + return XML_ROLE_NONE; + } + return syntaxError(state); +} + + +static +int attlist6(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + state->handler = attlist7; + return XML_ROLE_ATTRIBUTE_NOTATION_VALUE; + } + return syntaxError(state); +} + +static +int attlist7(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_CLOSE_PAREN: + state->handler = attlist8; + return XML_ROLE_NONE; + case XML_TOK_OR: + state->handler = attlist6; + return XML_ROLE_NONE; + } + return syntaxError(state); +} + +/* default value */ +static +int attlist8(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_POUND_NAME: + if (XmlNameMatchesAscii(enc, + ptr + MIN_BYTES_PER_CHAR(enc), + "IMPLIED")) { + state->handler = attlist1; + return XML_ROLE_IMPLIED_ATTRIBUTE_VALUE; + } + if (XmlNameMatchesAscii(enc, + ptr + MIN_BYTES_PER_CHAR(enc), + "REQUIRED")) { + state->handler = attlist1; + return XML_ROLE_REQUIRED_ATTRIBUTE_VALUE; + } + if (XmlNameMatchesAscii(enc, + ptr + MIN_BYTES_PER_CHAR(enc), + "FIXED")) { + state->handler = attlist9; + return XML_ROLE_NONE; + } + break; + case XML_TOK_LITERAL: + state->handler = attlist1; + return XML_ROLE_DEFAULT_ATTRIBUTE_VALUE; + } + return syntaxError(state); +} + +static +int attlist9(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_LITERAL: + state->handler = attlist1; + return XML_ROLE_FIXED_ATTRIBUTE_VALUE; + } + return syntaxError(state); +} + +static +int element0(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + state->handler = element1; + return XML_ROLE_ELEMENT_NAME; + } + return syntaxError(state); +} + +static +int element1(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + if (XmlNameMatchesAscii(enc, ptr, "EMPTY")) { + state->handler = declClose; + return XML_ROLE_CONTENT_EMPTY; + } + if (XmlNameMatchesAscii(enc, ptr, "ANY")) { + state->handler = declClose; + return XML_ROLE_CONTENT_ANY; + } + break; + case XML_TOK_OPEN_PAREN: + state->handler = element2; + state->level = 1; + return XML_ROLE_GROUP_OPEN; + } + return syntaxError(state); +} + +static +int element2(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_POUND_NAME: + if (XmlNameMatchesAscii(enc, + ptr + MIN_BYTES_PER_CHAR(enc), + "PCDATA")) { + state->handler = element3; + return XML_ROLE_CONTENT_PCDATA; + } + break; + case XML_TOK_OPEN_PAREN: + state->level = 2; + state->handler = element6; + return XML_ROLE_GROUP_OPEN; + case XML_TOK_NAME: + state->handler = element7; + return XML_ROLE_CONTENT_ELEMENT; + case XML_TOK_NAME_QUESTION: + state->handler = element7; + return XML_ROLE_CONTENT_ELEMENT_OPT; + case XML_TOK_NAME_ASTERISK: + state->handler = element7; + return XML_ROLE_CONTENT_ELEMENT_REP; + case XML_TOK_NAME_PLUS: + state->handler = element7; + return XML_ROLE_CONTENT_ELEMENT_PLUS; + } + return syntaxError(state); +} + +static +int element3(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_CLOSE_PAREN: + case XML_TOK_CLOSE_PAREN_ASTERISK: + state->handler = declClose; + return XML_ROLE_GROUP_CLOSE_REP; + case XML_TOK_OR: + state->handler = element4; + return XML_ROLE_NONE; + } + return syntaxError(state); +} + +static +int element4(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_NAME: + state->handler = element5; + return XML_ROLE_CONTENT_ELEMENT; + } + return syntaxError(state); +} + +static +int element5(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_CLOSE_PAREN_ASTERISK: + state->handler = declClose; + return XML_ROLE_GROUP_CLOSE_REP; + case XML_TOK_OR: + state->handler = element4; + return XML_ROLE_NONE; + } + return syntaxError(state); +} + +static +int element6(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_OPEN_PAREN: + state->level += 1; + return XML_ROLE_GROUP_OPEN; + case XML_TOK_NAME: + state->handler = element7; + return XML_ROLE_CONTENT_ELEMENT; + case XML_TOK_NAME_QUESTION: + state->handler = element7; + return XML_ROLE_CONTENT_ELEMENT_OPT; + case XML_TOK_NAME_ASTERISK: + state->handler = element7; + return XML_ROLE_CONTENT_ELEMENT_REP; + case XML_TOK_NAME_PLUS: + state->handler = element7; + return XML_ROLE_CONTENT_ELEMENT_PLUS; + } + return syntaxError(state); +} + +static +int element7(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_CLOSE_PAREN: + state->level -= 1; + if (state->level == 0) + state->handler = declClose; + return XML_ROLE_GROUP_CLOSE; + case XML_TOK_CLOSE_PAREN_ASTERISK: + state->level -= 1; + if (state->level == 0) + state->handler = declClose; + return XML_ROLE_GROUP_CLOSE_REP; + case XML_TOK_CLOSE_PAREN_QUESTION: + state->level -= 1; + if (state->level == 0) + state->handler = declClose; + return XML_ROLE_GROUP_CLOSE_OPT; + case XML_TOK_CLOSE_PAREN_PLUS: + state->level -= 1; + if (state->level == 0) + state->handler = declClose; + return XML_ROLE_GROUP_CLOSE_PLUS; + case XML_TOK_COMMA: + state->handler = element6; + return XML_ROLE_GROUP_SEQUENCE; + case XML_TOK_OR: + state->handler = element6; + return XML_ROLE_GROUP_CHOICE; + } + return syntaxError(state); +} + +static +int declClose(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_PROLOG_S: + return XML_ROLE_NONE; + case XML_TOK_DECL_CLOSE: + state->handler = internalSubset; + return XML_ROLE_NONE; + } + return syntaxError(state); +} + +#if 0 + +static +int ignore(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + switch (tok) { + case XML_TOK_DECL_CLOSE: + state->handler = internalSubset; + return 0; + default: + return XML_ROLE_NONE; + } + return syntaxError(state); +} +#endif + +static +int error(PROLOG_STATE *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc) +{ + return XML_ROLE_NONE; +} + +static +int syntaxError(PROLOG_STATE *state) +{ + state->handler = error; + return XML_ROLE_ERROR; +} + +void XmlPrologStateInit(PROLOG_STATE *state) +{ + state->handler = prolog0; +} Index: library/xml/TclExpat-1.1/xmlrole.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/xmlrole.h (revision 0) +++ library/xml/TclExpat-1.1/xmlrole.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,101 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#ifndef XmlRole_INCLUDED +#define XmlRole_INCLUDED 1 + +#include "xmltok.h" + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + XML_ROLE_ERROR = -1, + XML_ROLE_NONE = 0, + XML_ROLE_XML_DECL, + XML_ROLE_INSTANCE_START, + XML_ROLE_DOCTYPE_NAME, + XML_ROLE_DOCTYPE_SYSTEM_ID, + XML_ROLE_DOCTYPE_PUBLIC_ID, + XML_ROLE_DOCTYPE_CLOSE, + XML_ROLE_GENERAL_ENTITY_NAME, + XML_ROLE_PARAM_ENTITY_NAME, + XML_ROLE_ENTITY_VALUE, + XML_ROLE_ENTITY_SYSTEM_ID, + XML_ROLE_ENTITY_PUBLIC_ID, + XML_ROLE_ENTITY_NOTATION_NAME, + XML_ROLE_NOTATION_NAME, + XML_ROLE_NOTATION_SYSTEM_ID, + XML_ROLE_NOTATION_NO_SYSTEM_ID, + XML_ROLE_NOTATION_PUBLIC_ID, + XML_ROLE_ATTRIBUTE_NAME, + XML_ROLE_ATTRIBUTE_TYPE_CDATA, + XML_ROLE_ATTRIBUTE_TYPE_ID, + XML_ROLE_ATTRIBUTE_TYPE_IDREF, + XML_ROLE_ATTRIBUTE_TYPE_IDREFS, + XML_ROLE_ATTRIBUTE_TYPE_ENTITY, + XML_ROLE_ATTRIBUTE_TYPE_ENTITIES, + XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN, + XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS, + XML_ROLE_ATTRIBUTE_ENUM_VALUE, + XML_ROLE_ATTRIBUTE_NOTATION_VALUE, + XML_ROLE_ATTLIST_ELEMENT_NAME, + XML_ROLE_IMPLIED_ATTRIBUTE_VALUE, + XML_ROLE_REQUIRED_ATTRIBUTE_VALUE, + XML_ROLE_DEFAULT_ATTRIBUTE_VALUE, + XML_ROLE_FIXED_ATTRIBUTE_VALUE, + XML_ROLE_ELEMENT_NAME, + XML_ROLE_CONTENT_ANY, + XML_ROLE_CONTENT_EMPTY, + XML_ROLE_CONTENT_PCDATA, + XML_ROLE_GROUP_OPEN, + XML_ROLE_GROUP_CLOSE, + XML_ROLE_GROUP_CLOSE_REP, + XML_ROLE_GROUP_CLOSE_OPT, + XML_ROLE_GROUP_CLOSE_PLUS, + XML_ROLE_GROUP_CHOICE, + XML_ROLE_GROUP_SEQUENCE, + XML_ROLE_CONTENT_ELEMENT, + XML_ROLE_CONTENT_ELEMENT_REP, + XML_ROLE_CONTENT_ELEMENT_OPT, + XML_ROLE_CONTENT_ELEMENT_PLUS, + XML_ROLE_PARAM_ENTITY_REF +}; + +typedef struct prolog_state { + int (*handler)(struct prolog_state *state, + int tok, + const char *ptr, + const char *end, + const ENCODING *enc); + unsigned level; +} PROLOG_STATE; + +void XMLTOKAPI XmlPrologStateInit(PROLOG_STATE *); + +#define XmlTokenRole(state, tok, ptr, end, enc) \ + (((state)->handler)(state, tok, ptr, end, enc)) + +#ifdef __cplusplus +} +#endif + +#endif /* not XmlRole_INCLUDED */ Index: library/xml/TclExpat-1.1/xmltok.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/xmltok.c (revision 0) +++ library/xml/TclExpat-1.1/xmltok.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1135 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#include /*for size_t */ +#include "xmldef.h" +#include "xmltok.h" +#include "nametab.h" + +#define VTABLE1 \ + { PREFIX(prologTok), PREFIX(contentTok), PREFIX(cdataSectionTok) }, \ + { PREFIX(attributeValueTok), PREFIX(entityValueTok) }, \ + PREFIX(sameName), \ + PREFIX(nameMatchesAscii), \ + PREFIX(nameLength), \ + PREFIX(skipS), \ + PREFIX(getAtts), \ + PREFIX(charRefNumber), \ + PREFIX(predefinedEntityName), \ + PREFIX(updatePosition), \ + PREFIX(isPublicId) + +#define VTABLE VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16) + +#define UCS2_GET_NAMING(pages, hi, lo) \ + (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1 << ((lo) & 0x1F))) + +/* A 2 byte UTF-8 representation splits the characters 11 bits +between the bottom 5 and 6 bits of the bytes. +We need 8 bits to index into pages, 3 bits to add to that index and +5 bits to generate the mask. */ +#define UTF8_GET_NAMING2(pages, byte) \ + (namingBitmap[((pages)[(((byte)[0]) >> 2) & 7] << 3) \ + + ((((byte)[0]) & 3) << 1) \ + + ((((byte)[1]) >> 5) & 1)] \ + & (1 << (((byte)[1]) & 0x1F))) + +/* A 3 byte UTF-8 representation splits the characters 16 bits +between the bottom 4, 6 and 6 bits of the bytes. +We need 8 bits to index into pages, 3 bits to add to that index and +5 bits to generate the mask. */ +#define UTF8_GET_NAMING3(pages, byte) \ + (namingBitmap[((pages)[((((byte)[0]) & 0xF) << 4) \ + + ((((byte)[1]) >> 2) & 0xF)] \ + << 3) \ + + ((((byte)[1]) & 3) << 1) \ + + ((((byte)[2]) >> 5) & 1)] \ + & (1 << (((byte)[2]) & 0x1F))) + +#define UTF8_GET_NAMING(pages, p, n) \ + ((n) == 2 \ + ? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \ + : ((n) == 3 \ + ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) \ + : 0)) + +#define UTF8_INVALID3(p) \ + ((*p) == 0xED \ + ? (((p)[1] & 0x20) != 0) \ + : ((*p) == 0xEF \ + ? ((p)[1] == 0xBF && ((p)[2] == 0xBF || (p)[2] == 0xBE)) \ + : 0)) + +#define UTF8_INVALID4(p) ((*p) == 0xF4 && ((p)[1] & 0x30) != 0) + +static +int isNever(const ENCODING *enc, const char *p) +{ + return 0; +} + +static +int utf8_isName2(const ENCODING *enc, const char *p) +{ + return UTF8_GET_NAMING2(namePages, (const unsigned char *)p); +} + +static +int utf8_isName3(const ENCODING *enc, const char *p) +{ + return UTF8_GET_NAMING3(namePages, (const unsigned char *)p); +} + +#define utf8_isName4 isNever + +static +int utf8_isNmstrt2(const ENCODING *enc, const char *p) +{ + return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p); +} + +static +int utf8_isNmstrt3(const ENCODING *enc, const char *p) +{ + return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p); +} + +#define utf8_isNmstrt4 isNever + +#define utf8_isInvalid2 isNever + +static +int utf8_isInvalid3(const ENCODING *enc, const char *p) +{ + return UTF8_INVALID3((const unsigned char *)p); +} + +static +int utf8_isInvalid4(const ENCODING *enc, const char *p) +{ + return UTF8_INVALID4((const unsigned char *)p); +} + +struct normal_encoding { + ENCODING enc; + unsigned char type[256]; + int (*isName2)(const ENCODING *, const char *); + int (*isName3)(const ENCODING *, const char *); + int (*isName4)(const ENCODING *, const char *); + int (*isNmstrt2)(const ENCODING *, const char *); + int (*isNmstrt3)(const ENCODING *, const char *); + int (*isNmstrt4)(const ENCODING *, const char *); + int (*isInvalid2)(const ENCODING *, const char *); + int (*isInvalid3)(const ENCODING *, const char *); + int (*isInvalid4)(const ENCODING *, const char *); +}; + +#define NORMAL_VTABLE(E) \ + E ## isName2, \ + E ## isName3, \ + E ## isName4, \ + E ## isNmstrt2, \ + E ## isNmstrt3, \ + E ## isNmstrt4, \ + E ## isInvalid2, \ + E ## isInvalid3, \ + E ## isInvalid4 + +static int checkCharRefNumber(int); + +#include "xmltok_impl.h" + +/* minimum bytes per character */ +#define MINBPC 1 +#define BYTE_TYPE(enc, p) \ + (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)]) +#define BYTE_TO_ASCII(enc, p) (*p) + +#define IS_NAME_CHAR(enc, p, n) \ + (((const struct normal_encoding *)(enc))->isName ## n(enc, p)) +#define IS_NMSTRT_CHAR(enc, p, n) \ + (((const struct normal_encoding *)(enc))->isNmstrt ## n(enc, p)) +#define IS_INVALID_CHAR(enc, p, n) \ + (((const struct normal_encoding *)(enc))->isInvalid ## n(enc, p)) + +#define IS_NAME_CHAR_MINBPC(enc, p) (0) +#define IS_NMSTRT_CHAR_MINBPC(enc, p) (0) + +/* c is an ASCII character */ +#define CHAR_MATCHES(enc, p, c) (*(p) == c) + +#define PREFIX(ident) normal_ ## ident +#include "xmltok_impl.c" + +#undef MINBPC +#undef BYTE_TYPE +#undef BYTE_TO_ASCII +#undef CHAR_MATCHES +#undef IS_NAME_CHAR +#undef IS_NAME_CHAR_MINBPC +#undef IS_NMSTRT_CHAR +#undef IS_NMSTRT_CHAR_MINBPC +#undef IS_INVALID_CHAR + +enum { /* UTF8_cvalN is value of masked first byte of N byte sequence */ + UTF8_cval1 = 0x00, + UTF8_cval2 = 0xc0, + UTF8_cval3 = 0xe0, + UTF8_cval4 = 0xf0 +}; + +static +void utf8_toUtf8(const ENCODING *enc, + const char **fromP, const char *fromLim, + char **toP, const char *toLim) +{ + char *to; + const char *from; + if (fromLim - *fromP > toLim - *toP) { + /* Avoid copying partial characters. */ + for (fromLim = *fromP + (toLim - *toP); fromLim > *fromP; fromLim--) + if (((unsigned char)fromLim[-1] & 0xc0) != 0x80) + break; + } + for (to = *toP, from = *fromP; from != fromLim; from++, to++) + *to = *from; + *fromP = from; + *toP = to; +} + +static +void utf8_toUtf16(const ENCODING *enc, + const char **fromP, const char *fromLim, + unsigned short **toP, const unsigned short *toLim) +{ + unsigned short *to = *toP; + const char *from = *fromP; + while (from != fromLim && to != toLim) { + switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) { + case BT_LEAD2: + *to++ = ((from[0] & 0x1f) << 6) | (from[1] & 0x3f); + from += 2; + break; + case BT_LEAD3: + *to++ = ((from[0] & 0xf) << 12) | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f); + from += 3; + break; + case BT_LEAD4: + { + unsigned long n; + if (to + 1 == toLim) + break; + n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12) | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f); + n -= 0x10000; + to[0] = (unsigned short)((n >> 10) | 0xD800); + to[1] = (unsigned short)((n & 0x3FF) | 0xDC00); + to += 2; + from += 4; + } + break; + default: + *to++ = *from++; + break; + } + } + *fromP = from; + *toP = to; +} + +static const struct normal_encoding utf8_encoding = { + { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, + { +#include "asciitab.h" +#include "utf8tab.h" + }, + NORMAL_VTABLE(utf8_) +}; + +static const struct normal_encoding internal_utf8_encoding = { + { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, + { +#include "iasciitab.h" +#include "utf8tab.h" + }, + NORMAL_VTABLE(utf8_) +}; + +static +void latin1_toUtf8(const ENCODING *enc, + const char **fromP, const char *fromLim, + char **toP, const char *toLim) +{ + for (;;) { + unsigned char c; + if (*fromP == fromLim) + break; + c = (unsigned char)**fromP; + if (c & 0x80) { + if (toLim - *toP < 2) + break; + *(*toP)++ = ((c >> 6) | UTF8_cval2); + *(*toP)++ = ((c & 0x3f) | 0x80); + (*fromP)++; + } + else { + if (*toP == toLim) + break; + *(*toP)++ = *(*fromP)++; + } + } +} + +static +void latin1_toUtf16(const ENCODING *enc, + const char **fromP, const char *fromLim, + unsigned short **toP, const unsigned short *toLim) +{ + while (*fromP != fromLim && *toP != toLim) + *(*toP)++ = (unsigned char)*(*fromP)++; +} + +static const struct normal_encoding latin1_encoding = { + { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 }, + { +#include "asciitab.h" +#include "latin1tab.h" + } +}; + +static +void ascii_toUtf8(const ENCODING *enc, + const char **fromP, const char *fromLim, + char **toP, const char *toLim) +{ + while (*fromP != fromLim && *toP != toLim) + *(*toP)++ = *(*fromP)++; +} + +static const struct normal_encoding ascii_encoding = { + { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 }, + { +#include "asciitab.h" +/* BT_NONXML == 0 */ + } +}; + +#undef PREFIX + +static int unicode_byte_type(char hi, char lo) +{ + switch ((unsigned char)hi) { + case 0xD8: case 0xD9: case 0xDA: case 0xDB: + return BT_LEAD4; + case 0xDC: case 0xDD: case 0xDE: case 0xDF: + return BT_TRAIL; + case 0xFF: + switch ((unsigned char)lo) { + case 0xFF: + case 0xFE: + return BT_NONXML; + } + break; + } + return BT_NONASCII; +} + +#define DEFINE_UTF16_TO_UTF8 \ +static \ +void PREFIX(toUtf8)(const ENCODING *enc, \ + const char **fromP, const char *fromLim, \ + char **toP, const char *toLim) \ +{ \ + const char *from; \ + for (from = *fromP; from != fromLim; from += 2) { \ + int plane; \ + unsigned char lo2; \ + unsigned char lo = GET_LO(from); \ + unsigned char hi = GET_HI(from); \ + switch (hi) { \ + case 0: \ + if (lo < 0x80) { \ + if (*toP == toLim) { \ + *fromP = from; \ + return; \ + } \ + *(*toP)++ = lo; \ + break; \ + } \ + /* fall through */ \ + case 0x1: case 0x2: case 0x3: \ + case 0x4: case 0x5: case 0x6: case 0x7: \ + if (toLim - *toP < 2) { \ + *fromP = from; \ + return; \ + } \ + *(*toP)++ = ((lo >> 6) | (hi << 2) | UTF8_cval2); \ + *(*toP)++ = ((lo & 0x3f) | 0x80); \ + break; \ + default: \ + if (toLim - *toP < 3) { \ + *fromP = from; \ + return; \ + } \ + /* 16 bits divided 4, 6, 6 amongst 3 bytes */ \ + *(*toP)++ = ((hi >> 4) | UTF8_cval3); \ + *(*toP)++ = (((hi & 0xf) << 2) | (lo >> 6) | 0x80); \ + *(*toP)++ = ((lo & 0x3f) | 0x80); \ + break; \ + case 0xD8: case 0xD9: case 0xDA: case 0xDB: \ + if (toLim - *toP < 4) { \ + *fromP = from; \ + return; \ + } \ + plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \ + *(*toP)++ = ((plane >> 2) | UTF8_cval4); \ + *(*toP)++ = (((lo >> 2) & 0xF) | ((plane & 0x3) << 4) | 0x80); \ + from += 2; \ + lo2 = GET_LO(from); \ + *(*toP)++ = (((lo & 0x3) << 4) \ + | ((GET_HI(from) & 0x3) << 2) \ + | (lo2 >> 6) \ + | 0x80); \ + *(*toP)++ = ((lo2 & 0x3f) | 0x80); \ + break; \ + } \ + } \ + *fromP = from; \ +} + +#define DEFINE_UTF16_TO_UTF16 \ +static \ +void PREFIX(toUtf16)(const ENCODING *enc, \ + const char **fromP, const char *fromLim, \ + unsigned short **toP, const unsigned short *toLim) \ +{ \ + /* Avoid copying first half only of surrogate */ \ + if (fromLim - *fromP > ((toLim - *toP) << 1) \ + && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) \ + fromLim -= 2; \ + for (; *fromP != fromLim && *toP != toLim; *fromP += 2) \ + *(*toP)++ = (GET_HI(*fromP) << 8) | GET_LO(*fromP); \ +} + +#define PREFIX(ident) little2_ ## ident +#define MINBPC 2 +#define BYTE_TYPE(enc, p) \ + ((p)[1] == 0 \ + ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \ + : unicode_byte_type((p)[1], (p)[0])) +#define BYTE_TO_ASCII(enc, p) ((p)[1] == 0 ? (p)[0] : -1) +#define CHAR_MATCHES(enc, p, c) ((p)[1] == 0 && (p)[0] == c) +#define IS_NAME_CHAR(enc, p, n) (0) +#define IS_NAME_CHAR_MINBPC(enc, p) \ + UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0]) +#define IS_NMSTRT_CHAR(enc, p, n) (0) +#define IS_NMSTRT_CHAR_MINBPC(enc, p) \ + UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[1], (unsigned char)p[0]) + +#include "xmltok_impl.c" + +#define SET2(ptr, ch) \ + (((ptr)[0] = ((ch) & 0xff)), ((ptr)[1] = ((ch) >> 8))) +#define GET_LO(ptr) ((unsigned char)(ptr)[0]) +#define GET_HI(ptr) ((unsigned char)(ptr)[1]) + +DEFINE_UTF16_TO_UTF8 +DEFINE_UTF16_TO_UTF16 + +#undef SET2 +#undef GET_LO +#undef GET_HI +#undef MINBPC +#undef BYTE_TYPE +#undef BYTE_TO_ASCII +#undef CHAR_MATCHES +#undef IS_NAME_CHAR +#undef IS_NAME_CHAR_MINBPC +#undef IS_NMSTRT_CHAR +#undef IS_NMSTRT_CHAR_MINBPC +#undef IS_INVALID_CHAR + +static const struct normal_encoding little2_encoding = { + { VTABLE, 2, 0, +#if BYTE_ORDER == 12 + 1 +#else + 0 +#endif + }, +#include "asciitab.h" +#include "latin1tab.h" +}; + +#if BYTE_ORDER != 21 + +static const struct normal_encoding internal_little2_encoding = { + { VTABLE, 2, 0, 1 }, +#include "iasciitab.h" +#include "latin1tab.h" +}; + +#endif + +#undef PREFIX + +#define PREFIX(ident) big2_ ## ident +#define MINBPC 2 +/* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ +#define BYTE_TYPE(enc, p) \ + ((p)[0] == 0 \ + ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \ + : unicode_byte_type((p)[0], (p)[1])) +#define BYTE_TO_ASCII(enc, p) ((p)[0] == 0 ? (p)[1] : -1) +#define CHAR_MATCHES(enc, p, c) ((p)[0] == 0 && (p)[1] == c) +#define IS_NAME_CHAR(enc, p, n) 0 +#define IS_NAME_CHAR_MINBPC(enc, p) \ + UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1]) +#define IS_NMSTRT_CHAR(enc, p, n) (0) +#define IS_NMSTRT_CHAR_MINBPC(enc, p) \ + UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[0], (unsigned char)p[1]) + +#include "xmltok_impl.c" + +#define SET2(ptr, ch) \ + (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch) & 0xFF))) +#define GET_LO(ptr) ((unsigned char)(ptr)[1]) +#define GET_HI(ptr) ((unsigned char)(ptr)[0]) + +DEFINE_UTF16_TO_UTF8 +DEFINE_UTF16_TO_UTF16 + +#undef SET2 +#undef GET_LO +#undef GET_HI +#undef MINBPC +#undef BYTE_TYPE +#undef BYTE_TO_ASCII +#undef CHAR_MATCHES +#undef IS_NAME_CHAR +#undef IS_NAME_CHAR_MINBPC +#undef IS_NMSTRT_CHAR +#undef IS_NMSTRT_CHAR_MINBPC +#undef IS_INVALID_CHAR + +static const struct normal_encoding big2_encoding = { + { VTABLE, 2, 0, +#if BYTE_ORDER == 21 + 1 +#else + 0 +#endif + }, +#include "asciitab.h" +#include "latin1tab.h" +}; + +#if BYTE_ORDER != 12 + +static const struct normal_encoding internal_big2_encoding = { + { VTABLE, 2, 0, 1 }, +#include "iasciitab.h" +#include "latin1tab.h" +}; + +#endif + +#undef PREFIX + +static +int streqci(const char *s1, const char *s2) +{ + for (;;) { + char c1 = *s1++; + char c2 = *s2++; + if ('a' <= c1 && c1 <= 'z') + c1 += 'A' - 'a'; + if ('a' <= c2 && c2 <= 'z') + c2 += 'A' - 'a'; + if (c1 != c2) + return 0; + if (!c1) + break; + } + return 1; +} + +static +int initScan(const ENCODING *enc, int state, const char *ptr, const char *end, + const char **nextTokPtr) +{ + const ENCODING **encPtr; + + if (ptr == end) + return XML_TOK_NONE; + encPtr = ((const INIT_ENCODING *)enc)->encPtr; + if (ptr + 1 == end) { + switch ((unsigned char)*ptr) { + case 0xFE: + case 0xFF: + case 0x00: + case 0x3C: + return XML_TOK_PARTIAL; + } + } + else { + switch (((unsigned char)ptr[0] << 8) | (unsigned char)ptr[1]) { + case 0x003C: + *encPtr = &big2_encoding.enc; + return XmlTok(*encPtr, state, ptr, end, nextTokPtr); + case 0xFEFF: + *nextTokPtr = ptr + 2; + *encPtr = &big2_encoding.enc; + return XML_TOK_BOM; + case 0x3C00: + *encPtr = &little2_encoding.enc; + return XmlTok(*encPtr, state, ptr, end, nextTokPtr); + case 0xFFFE: + *nextTokPtr = ptr + 2; + *encPtr = &little2_encoding.enc; + return XML_TOK_BOM; + } + } + *encPtr = &utf8_encoding.enc; + return XmlTok(*encPtr, state, ptr, end, nextTokPtr); +} + +static +int initScanProlog(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + return initScan(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr); +} + +static +int initScanContent(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + return initScan(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr); +} + +static +void initUpdatePosition(const ENCODING *enc, const char *ptr, + const char *end, POSITION *pos) +{ + normal_updatePosition(&utf8_encoding.enc, ptr, end, pos); +} + +const ENCODING *XmlGetUtf8InternalEncoding() +{ + return &internal_utf8_encoding.enc; +} + +const ENCODING *XmlGetUtf16InternalEncoding() +{ +#if BYTE_ORDER == 12 + return &internal_little2_encoding.enc; +#elif BYTE_ORDER == 21 + return &internal_big2_encoding.enc; +#else + const short n = 1; + return *(const char *)&n ? &internal_little2_encoding.enc : &internal_big2_encoding.enc; +#endif +} + +int XmlInitEncoding(INIT_ENCODING *p, const ENCODING **encPtr, const char *name) +{ + if (name) { + if (streqci(name, "ISO-8859-1")) { + *encPtr = &latin1_encoding.enc; + return 1; + } + if (streqci(name, "UTF-8")) { + *encPtr = &utf8_encoding.enc; + return 1; + } + if (streqci(name, "US-ASCII")) { + *encPtr = &ascii_encoding.enc; + return 1; + } + if (!streqci(name, "UTF-16")) + return 0; + } + p->initEnc.scanners[XML_PROLOG_STATE] = initScanProlog; + p->initEnc.scanners[XML_CONTENT_STATE] = initScanContent; + p->initEnc.updatePosition = initUpdatePosition; + p->initEnc.minBytesPerChar = 1; + p->encPtr = encPtr; + *encPtr = &(p->initEnc); + return 1; +} + +static +int toAscii(const ENCODING *enc, const char *ptr, const char *end) +{ + char buf[1]; + char *p = buf; + XmlUtf8Convert(enc, &ptr, end, &p, p + 1); + if (p == buf) + return -1; + else + return buf[0]; +} + +static +int isSpace(int c) +{ + switch (c) { + case ' ': + case '\r': + case '\n': + case '\t': + return 1; + } + return 0; +} + +/* Return 1 if there's just optional white space +or there's an S followed by name=val. */ +static +int parsePseudoAttribute(const ENCODING *enc, + const char *ptr, + const char *end, + const char **namePtr, + const char **valPtr, + const char **nextTokPtr) +{ + int c; + char open; + if (ptr == end) { + *namePtr = 0; + return 1; + } + if (!isSpace(toAscii(enc, ptr, end))) { + *nextTokPtr = ptr; + return 0; + } + do { + ptr += enc->minBytesPerChar; + } while (isSpace(toAscii(enc, ptr, end))); + if (ptr == end) { + *namePtr = 0; + return 1; + } + *namePtr = ptr; + for (;;) { + c = toAscii(enc, ptr, end); + if (c == -1) { + *nextTokPtr = ptr; + return 0; + } + if (c == '=') + break; + if (isSpace(c)) { + do { + ptr += enc->minBytesPerChar; + } while (isSpace(c = toAscii(enc, ptr, end))); + if (c != '=') { + *nextTokPtr = ptr; + return 0; + } + break; + } + ptr += enc->minBytesPerChar; + } + if (ptr == *namePtr) { + *nextTokPtr = ptr; + return 0; + } + ptr += enc->minBytesPerChar; + c = toAscii(enc, ptr, end); + while (isSpace(c)) { + ptr += enc->minBytesPerChar; + c = toAscii(enc, ptr, end); + } + if (c != '"' && c != '\'') { + *nextTokPtr = ptr; + return 0; + } + open = c; + ptr += enc->minBytesPerChar; + *valPtr = ptr; + for (;; ptr += enc->minBytesPerChar) { + c = toAscii(enc, ptr, end); + if (c == open) + break; + if (!('a' <= c && c <= 'z') + && !('A' <= c && c <= 'Z') + && !('0' <= c && c <= '9') + && c != '.' + && c != '-' + && c != '_') { + *nextTokPtr = ptr; + return 0; + } + } + *nextTokPtr = ptr + enc->minBytesPerChar; + return 1; +} + +static +const ENCODING *findEncoding(const ENCODING *enc, const char *ptr, const char *end) +{ +#define ENCODING_MAX 128 + char buf[ENCODING_MAX]; + char *p = buf; + int i; + XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); + if (ptr != end) + return 0; + *p = 0; + for (i = 0; buf[i]; i++) { + if ('a' <= buf[i] && buf[i] <= 'z') + buf[i] += 'A' - 'a'; + } + if (streqci(buf, "UTF-8")) + return &utf8_encoding.enc; + if (streqci(buf, "ISO-8859-1")) + return &latin1_encoding.enc; + if (streqci(buf, "US-ASCII")) + return &ascii_encoding.enc; + if (streqci(buf, "UTF-16")) { + if (enc->minBytesPerChar == 2) + return enc; + return &big2_encoding.enc; + } + return 0; +} + +int XmlParseXmlDecl(int isGeneralTextEntity, + const ENCODING *enc, + const char *ptr, + const char *end, + const char **badPtr, + const char **versionPtr, + const char **encodingName, + const ENCODING **encoding, + int *standalone) +{ + const char *val = 0; + const char *name = 0; + ptr += 5 * enc->minBytesPerChar; + end -= 2 * enc->minBytesPerChar; + if (!parsePseudoAttribute(enc, ptr, end, &name, &val, &ptr) || !name) { + *badPtr = ptr; + return 0; + } + if (!XmlNameMatchesAscii(enc, name, "version")) { + if (!isGeneralTextEntity) { + *badPtr = name; + return 0; + } + } + else { + if (versionPtr) + *versionPtr = val; + if (!parsePseudoAttribute(enc, ptr, end, &name, &val, &ptr)) { + *badPtr = ptr; + return 0; + } + if (!name) + return 1; + } + if (XmlNameMatchesAscii(enc, name, "encoding")) { + int c = toAscii(enc, val, end); + if (!('a' <= c && c <= 'z') && !('A' <= c && c <= 'Z')) { + *badPtr = val; + return 0; + } + if (encodingName) + *encodingName = val; + if (encoding) + *encoding = findEncoding(enc, val, ptr - enc->minBytesPerChar); + if (!parsePseudoAttribute(enc, ptr, end, &name, &val, &ptr)) { + *badPtr = ptr; + return 0; + } + if (!name) + return 1; + } + if (!XmlNameMatchesAscii(enc, name, "standalone") || isGeneralTextEntity) { + *badPtr = name; + return 0; + } + if (XmlNameMatchesAscii(enc, val, "yes")) { + if (standalone) + *standalone = 1; + } + else if (XmlNameMatchesAscii(enc, val, "no")) { + if (standalone) + *standalone = 0; + } + else { + *badPtr = val; + return 0; + } + while (isSpace(toAscii(enc, ptr, end))) + ptr += enc->minBytesPerChar; + if (ptr != end) { + *badPtr = ptr; + return 0; + } + return 1; +} + +static +int checkCharRefNumber(int result) +{ + switch (result >> 8) { + case 0xD8: case 0xD9: case 0xDA: case 0xDB: + case 0xDC: case 0xDD: case 0xDE: case 0xDF: + return -1; + case 0: + if (latin1_encoding.type[result] == BT_NONXML) + return -1; + break; + case 0xFF: + if (result == 0xFFFE || result == 0xFFFF) + return -1; + break; + } + return result; +} + +size_t XmlUtf8Encode(int c, char *buf) +{ + enum { + /* minN is minimum legal resulting value for N byte sequence */ + min2 = 0x80, + min3 = 0x800, + min4 = 0x10000 + }; + + if (c < 0) + return 0; + if (c < min2) { + buf[0] = (c | UTF8_cval1); + return 1; + } + if (c < min3) { + buf[0] = ((c >> 6) | UTF8_cval2); + buf[1] = ((c & 0x3f) | 0x80); + return 2; + } + if (c < min4) { + buf[0] = ((c >> 12) | UTF8_cval3); + buf[1] = (((c >> 6) & 0x3f) | 0x80); + buf[2] = ((c & 0x3f) | 0x80); + return 3; + } + if (c < 0x110000) { + buf[0] = ((c >> 18) | UTF8_cval4); + buf[1] = (((c >> 12) & 0x3f) | 0x80); + buf[2] = (((c >> 6) & 0x3f) | 0x80); + buf[3] = ((c & 0x3f) | 0x80); + return 4; + } + return 0; +} + +size_t XmlUtf16Encode(int charNum, unsigned short *buf) +{ + if (charNum < 0) + return 0; + if (charNum < 0x10000) { + buf[0] = charNum; + return 1; + } + if (charNum < 0x110000) { + charNum -= 0x10000; + buf[0] = (charNum >> 10) + 0xD800; + buf[1] = (charNum & 0x3FF) + 0xDC00; + return 2; + } + return 0; +} + +struct unknown_encoding { + struct normal_encoding normal; + int (*convert)(void *userData, const char *p); + void *userData; + unsigned short utf16[256]; + char utf8[256][4]; +}; + +int XmlSizeOfUnknownEncoding() +{ + return sizeof(struct unknown_encoding); +} + +static +int unknown_isName(const ENCODING *enc, const char *p) +{ + int c = ((const struct unknown_encoding *)enc) + ->convert(((const struct unknown_encoding *)enc)->userData, p); + if (c & ~0xFFFF) + return 0; + return UCS2_GET_NAMING(namePages, c >> 8, c & 0xFF); +} + +static +int unknown_isNmstrt(const ENCODING *enc, const char *p) +{ + int c = ((const struct unknown_encoding *)enc) + ->convert(((const struct unknown_encoding *)enc)->userData, p); + if (c & ~0xFFFF) + return 0; + return UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xFF); +} + +static +int unknown_isInvalid(const ENCODING *enc, const char *p) +{ + int c = ((const struct unknown_encoding *)enc) + ->convert(((const struct unknown_encoding *)enc)->userData, p); + return (c & ~0xFFFF) || checkCharRefNumber(c) < 0; +} + +static +void unknown_toUtf8(const ENCODING *enc, + const char **fromP, const char *fromLim, + char **toP, const char *toLim) +{ + char buf[XML_UTF8_ENCODE_MAX]; + for (;;) { + const char *utf8; + int n; + if (*fromP == fromLim) + break; + utf8 = ((const struct unknown_encoding *)enc)->utf8[(unsigned char)**fromP]; + n = *utf8++; + if (n == 0) { + int c = ((const struct unknown_encoding *)enc) + ->convert(((const struct unknown_encoding *)enc)->userData, *fromP); + n = XmlUtf8Encode(c, buf); + if (n > toLim - *toP) + break; + utf8 = buf; + *fromP += ((const struct normal_encoding *)enc)->type[(unsigned char)**fromP] + - (BT_LEAD2 - 2); + } + else { + if (n > toLim - *toP) + break; + (*fromP)++; + } + do { + *(*toP)++ = *utf8++; + } while (--n != 0); + } +} + +static +void unknown_toUtf16(const ENCODING *enc, + const char **fromP, const char *fromLim, + unsigned short **toP, const unsigned short *toLim) +{ + while (*fromP != fromLim && *toP != toLim) { + unsigned short c + = ((const struct unknown_encoding *)enc)->utf16[(unsigned char)**fromP]; + if (c == 0) { + c = (unsigned short)((const struct unknown_encoding *)enc) + ->convert(((const struct unknown_encoding *)enc)->userData, *fromP); + *fromP += ((const struct normal_encoding *)enc)->type[(unsigned char)**fromP] + - (BT_LEAD2 - 2); + } + else + (*fromP)++; + *(*toP)++ = c; + } +} + +ENCODING * +XmlInitUnknownEncoding(void *mem, + int *table, + int (*convert)(void *userData, const char *p), + void *userData) +{ + int i; + struct unknown_encoding *e = mem; + for (i = 0; i < sizeof(struct normal_encoding); i++) + ((char *)mem)[i] = ((char *)&latin1_encoding)[i]; + for (i = 0; i < 128; i++) + if (latin1_encoding.type[i] != BT_OTHER + && latin1_encoding.type[i] != BT_NONXML + && table[i] != i) + return 0; + for (i = 0; i < 256; i++) { + int c = table[i]; + if (c == -1) { + e->normal.type[i] = BT_MALFORM; + /* This shouldn't really get used. */ + e->utf16[i] = 0xFFFF; + e->utf8[i][0] = 1; + e->utf8[i][1] = 0; + } + else if (c < 0) { + if (c < -4) + return 0; + e->normal.type[i] = BT_LEAD2 - (c + 2); + e->utf8[i][0] = 0; + e->utf16[i] = 0; + } + else if (c < 0x80) { + if (latin1_encoding.type[c] != BT_OTHER + && latin1_encoding.type[c] != BT_NONXML + && c != i) + return 0; + e->normal.type[i] = latin1_encoding.type[c]; + e->utf8[i][0] = 1; + e->utf8[i][1] = (char)c; + e->utf16[i] = c == 0 ? 0xFFFF : c; + } + else if (checkCharRefNumber(c) < 0) { + e->normal.type[i] = BT_NONXML; + /* This shouldn't really get used. */ + e->utf16[i] = 0xFFFF; + e->utf8[i][0] = 1; + e->utf8[i][1] = 0; + } + else { + if (c > 0xFFFF) + return 0; + if (UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xff)) + e->normal.type[i] = BT_NMSTRT; + else if (UCS2_GET_NAMING(namePages, c >> 8, c & 0xff)) + e->normal.type[i] = BT_NAME; + else + e->normal.type[i] = BT_OTHER; + e->utf8[i][0] = (char)XmlUtf8Encode(c, e->utf8[i] + 1); + e->utf16[i] = c; + } + } + e->userData = userData; + e->convert = convert; + if (convert) { + e->normal.isName2 = unknown_isName; + e->normal.isName3 = unknown_isName; + e->normal.isName4 = unknown_isName; + e->normal.isNmstrt2 = unknown_isNmstrt; + e->normal.isNmstrt3 = unknown_isNmstrt; + e->normal.isNmstrt4 = unknown_isNmstrt; + e->normal.isInvalid2 = unknown_isInvalid; + e->normal.isInvalid3 = unknown_isInvalid; + e->normal.isInvalid4 = unknown_isInvalid; + } + e->normal.enc.utf8Convert = unknown_toUtf8; + e->normal.enc.utf16Convert = unknown_toUtf16; + return &(e->normal.enc); +} Index: library/xml/TclExpat-1.1/xmltok.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/xmltok.h (revision 0) +++ library/xml/TclExpat-1.1/xmltok.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,276 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#ifndef XmlTok_INCLUDED +#define XmlTok_INCLUDED 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef XMLTOKAPI +#define XMLTOKAPI /* as nothing */ +#endif + +/* The following token may be returned by XmlContentTok */ +#define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be start of + illegal ]]> sequence */ +/* The following tokens may be returned by both XmlPrologTok and XmlContentTok */ +#define XML_TOK_NONE -4 /* The string to be scanned is empty */ +#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; + might be part of CRLF sequence */ +#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ +#define XML_TOK_PARTIAL -1 /* only part of a token */ +#define XML_TOK_INVALID 0 + +/* The following tokens are returned by XmlContentTok; some are also + returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok */ + +#define XML_TOK_START_TAG_WITH_ATTS 1 +#define XML_TOK_START_TAG_NO_ATTS 2 +#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag */ +#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4 +#define XML_TOK_END_TAG 5 +#define XML_TOK_DATA_CHARS 6 +#define XML_TOK_DATA_NEWLINE 7 +#define XML_TOK_CDATA_SECT_OPEN 8 +#define XML_TOK_ENTITY_REF 9 +#define XML_TOK_CHAR_REF 10 /* numeric character reference */ + +/* The following tokens may be returned by both XmlPrologTok and XmlContentTok */ +#define XML_TOK_PI 11 /* processing instruction */ +#define XML_TOK_XML_DECL 12 /* XML decl or text decl */ +#define XML_TOK_COMMENT 13 +#define XML_TOK_BOM 14 /* Byte order mark */ + +/* The following tokens are returned only by XmlPrologTok */ +#define XML_TOK_PROLOG_S 15 +#define XML_TOK_DECL_OPEN 16 /* */ +#define XML_TOK_NAME 18 +#define XML_TOK_NMTOKEN 19 +#define XML_TOK_POUND_NAME 20 /* #name */ +#define XML_TOK_OR 21 /* | */ +#define XML_TOK_PERCENT 22 +#define XML_TOK_OPEN_PAREN 23 +#define XML_TOK_CLOSE_PAREN 24 +#define XML_TOK_OPEN_BRACKET 25 +#define XML_TOK_CLOSE_BRACKET 26 +#define XML_TOK_LITERAL 27 +#define XML_TOK_PARAM_ENTITY_REF 28 +#define XML_TOK_INSTANCE_START 29 + +/* The following occur only in element type declarations */ +#define XML_TOK_NAME_QUESTION 30 /* name? */ +#define XML_TOK_NAME_ASTERISK 31 /* name* */ +#define XML_TOK_NAME_PLUS 32 /* name+ */ +#define XML_TOK_COND_SECT_OPEN 33 /* */ +#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */ +#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */ +#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */ +#define XML_TOK_COMMA 38 + +/* The following token is returned only by XmlAttributeValueTok */ +#define XML_TOK_ATTRIBUTE_VALUE_S 39 + +/* The following token is returned only by XmlCdataSectionTok */ +#define XML_TOK_CDATA_SECT_CLOSE 40 + +#define XML_N_STATES 3 +#define XML_PROLOG_STATE 0 +#define XML_CONTENT_STATE 1 +#define XML_CDATA_SECTION_STATE 2 + +#define XML_N_LITERAL_TYPES 2 +#define XML_ATTRIBUTE_VALUE_LITERAL 0 +#define XML_ENTITY_VALUE_LITERAL 1 + +/* The size of the buffer passed to XmlUtf8Encode must be at least this. */ +#define XML_UTF8_ENCODE_MAX 4 +/* The size of the buffer passed to XmlUtf16Encode must be at least this. */ +#define XML_UTF16_ENCODE_MAX 2 + +typedef struct position { + /* first line and first column are 0 not 1 */ + unsigned long lineNumber; + unsigned long columnNumber; +} POSITION; + +typedef struct { + const char *name; + const char *valuePtr; + const char *valueEnd; + char normalized; +} ATTRIBUTE; + +struct encoding; +typedef struct encoding ENCODING; + +struct encoding { + int (*scanners[XML_N_STATES])(const ENCODING *, + const char *, + const char *, + const char **); + int (*literalScanners[XML_N_LITERAL_TYPES])(const ENCODING *, + const char *, + const char *, + const char **); + int (*sameName)(const ENCODING *, + const char *, const char *); + int (*nameMatchesAscii)(const ENCODING *, + const char *, const char *); + int (*nameLength)(const ENCODING *, const char *); + const char *(*skipS)(const ENCODING *, const char *); + int (*getAtts)(const ENCODING *enc, const char *ptr, + int attsMax, ATTRIBUTE *atts); + int (*charRefNumber)(const ENCODING *enc, const char *ptr); + int (*predefinedEntityName)(const ENCODING *, const char *, const char *); + void (*updatePosition)(const ENCODING *, + const char *ptr, + const char *end, + POSITION *); + int (*isPublicId)(const ENCODING *enc, const char *ptr, const char *end, + const char **badPtr); + void (*utf8Convert)(const ENCODING *enc, + const char **fromP, + const char *fromLim, + char **toP, + const char *toLim); + void (*utf16Convert)(const ENCODING *enc, + const char **fromP, + const char *fromLim, + unsigned short **toP, + const unsigned short *toLim); + int minBytesPerChar; + char isUtf8; + char isUtf16; +}; + +/* +Scan the string starting at ptr until the end of the next complete token, +but do not scan past eptr. Return an integer giving the type of token. + +Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set. + +Return XML_TOK_PARTIAL when the string does not contain a complete token; +nextTokPtr will not be set. + +Return XML_TOK_INVALID when the string does not start a valid token; nextTokPtr +will be set to point to the character which made the token invalid. + +Otherwise the string starts with a valid token; nextTokPtr will be set to point +to the character following the end of that token. + +Each data character counts as a single token, but adjacent data characters +may be returned together. Similarly for characters in the prolog outside +literals, comments and processing instructions. +*/ + + +#define XmlTok(enc, state, ptr, end, nextTokPtr) \ + (((enc)->scanners[state])(enc, ptr, end, nextTokPtr)) + +#define XmlPrologTok(enc, ptr, end, nextTokPtr) \ + XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr) + +#define XmlContentTok(enc, ptr, end, nextTokPtr) \ + XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr) + +#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \ + XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr) + +/* This is used for performing a 2nd-level tokenization on +the content of a literal that has already been returned by XmlTok. */ + +#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \ + (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr)) + +#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \ + XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr) + +#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \ + XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr) + +#define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2)) + +#define XmlNameMatchesAscii(enc, ptr1, ptr2) \ + (((enc)->nameMatchesAscii)(enc, ptr1, ptr2)) + +#define XmlNameLength(enc, ptr) \ + (((enc)->nameLength)(enc, ptr)) + +#define XmlSkipS(enc, ptr) \ + (((enc)->skipS)(enc, ptr)) + +#define XmlGetAttributes(enc, ptr, attsMax, atts) \ + (((enc)->getAtts)(enc, ptr, attsMax, atts)) + +#define XmlCharRefNumber(enc, ptr) \ + (((enc)->charRefNumber)(enc, ptr)) + +#define XmlPredefinedEntityName(enc, ptr, end) \ + (((enc)->predefinedEntityName)(enc, ptr, end)) + +#define XmlUpdatePosition(enc, ptr, end, pos) \ + (((enc)->updatePosition)(enc, ptr, end, pos)) + +#define XmlIsPublicId(enc, ptr, end, badPtr) \ + (((enc)->isPublicId)(enc, ptr, end, badPtr)) + +#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \ + (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) + +#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \ + (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim)) + +typedef struct { + ENCODING initEnc; + const ENCODING **encPtr; +} INIT_ENCODING; + +int XMLTOKAPI XmlParseXmlDecl(int isGeneralTextEntity, + const ENCODING *enc, + const char *ptr, + const char *end, + const char **badPtr, + const char **versionPtr, + const char **encodingNamePtr, + const ENCODING **namedEncodingPtr, + int *standalonePtr); + +int XMLTOKAPI XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); +const ENCODING XMLTOKAPI *XmlGetUtf8InternalEncoding(); +const ENCODING XMLTOKAPI *XmlGetUtf16InternalEncoding(); +size_t XMLTOKAPI XmlUtf8Encode(int charNumber, char *buf); +size_t XMLTOKAPI XmlUtf16Encode(int charNumber, unsigned short *buf); + +int XMLTOKAPI XmlSizeOfUnknownEncoding(); +ENCODING XMLTOKAPI * +XmlInitUnknownEncoding(void *mem, + int *table, + int (*convert)(void *userData, const char *p), + void *userData); + +#ifdef __cplusplus +} +#endif + +#endif /* not XmlTok_INCLUDED */ Index: library/xml/TclExpat-1.1/xmltok_impl.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/xmltok_impl.c (revision 0) +++ library/xml/TclExpat-1.1/xmltok_impl.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1643 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#ifndef IS_INVALID_CHAR +#define IS_INVALID_CHAR(enc, ptr, n) (0) +#endif + +#define INVALID_LEAD_CASE(n, ptr, nextTokPtr) \ + case BT_LEAD ## n: \ + if (end - ptr < n) \ + return XML_TOK_PARTIAL_CHAR; \ + if (IS_INVALID_CHAR(enc, ptr, n)) { \ + *(nextTokPtr) = (ptr); \ + return XML_TOK_INVALID; \ + } \ + ptr += n; \ + break; + +#define INVALID_CASES(ptr, nextTokPtr) \ + INVALID_LEAD_CASE(2, ptr, nextTokPtr) \ + INVALID_LEAD_CASE(3, ptr, nextTokPtr) \ + INVALID_LEAD_CASE(4, ptr, nextTokPtr) \ + case BT_NONXML: \ + case BT_MALFORM: \ + case BT_TRAIL: \ + *(nextTokPtr) = (ptr); \ + return XML_TOK_INVALID; + +#define CHECK_NAME_CASE(n, enc, ptr, end, nextTokPtr) \ + case BT_LEAD ## n: \ + if (end - ptr < n) \ + return XML_TOK_PARTIAL_CHAR; \ + if (!IS_NAME_CHAR(enc, ptr, n)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_INVALID; \ + } \ + ptr += n; \ + break; + +#define CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) \ + case BT_NONASCII: \ + if (!IS_NAME_CHAR_MINBPC(enc, ptr)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_INVALID; \ + } \ + case BT_NMSTRT: \ + case BT_HEX: \ + case BT_DIGIT: \ + case BT_NAME: \ + case BT_MINUS: \ + ptr += MINBPC; \ + break; \ + CHECK_NAME_CASE(2, enc, ptr, end, nextTokPtr) \ + CHECK_NAME_CASE(3, enc, ptr, end, nextTokPtr) \ + CHECK_NAME_CASE(4, enc, ptr, end, nextTokPtr) + +#define CHECK_NMSTRT_CASE(n, enc, ptr, end, nextTokPtr) \ + case BT_LEAD ## n: \ + if (end - ptr < n) \ + return XML_TOK_PARTIAL_CHAR; \ + if (!IS_NMSTRT_CHAR(enc, ptr, n)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_INVALID; \ + } \ + ptr += n; \ + break; + +#define CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) \ + case BT_NONASCII: \ + if (!IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_INVALID; \ + } \ + case BT_NMSTRT: \ + case BT_HEX: \ + ptr += MINBPC; \ + break; \ + CHECK_NMSTRT_CASE(2, enc, ptr, end, nextTokPtr) \ + CHECK_NMSTRT_CASE(3, enc, ptr, end, nextTokPtr) \ + CHECK_NMSTRT_CASE(4, enc, ptr, end, nextTokPtr) + +#ifndef PREFIX +#define PREFIX(ident) ident +#endif + +/* ptr points to character following "')) { + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + *nextTokPtr = ptr + MINBPC; + return XML_TOK_COMMENT; + } + /* fall through */ + default: + ptr += MINBPC; + break; + } + } + } + return XML_TOK_PARTIAL; +} + +/* ptr points to character following " */ + switch (BYTE_TYPE(enc, ptr + MINBPC)) { + case BT_S: case BT_CR: case BT_LF: case BT_PERCNT: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + /* fall through */ + case BT_S: case BT_CR: case BT_LF: + *nextTokPtr = ptr; + return XML_TOK_DECL_OPEN; + case BT_NMSTRT: + case BT_HEX: + ptr += MINBPC; + break; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + } + return XML_TOK_PARTIAL; +} + +static +int PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, int *tokPtr) +{ + int upper = 0; + *tokPtr = XML_TOK_PI; + if (end - ptr != MINBPC*3) + return 1; + switch (BYTE_TO_ASCII(enc, ptr)) { + case 'x': + break; + case 'X': + upper = 1; + break; + default: + return 1; + } + ptr += MINBPC; + switch (BYTE_TO_ASCII(enc, ptr)) { + case 'm': + break; + case 'M': + upper = 1; + break; + default: + return 1; + } + ptr += MINBPC; + switch (BYTE_TO_ASCII(enc, ptr)) { + case 'l': + break; + case 'L': + upper = 1; + break; + default: + return 1; + } + if (upper) + return 0; + *tokPtr = XML_TOK_XML_DECL; + return 1; +} + +/* ptr points to character following "')) { + *nextTokPtr = ptr + MINBPC; + return tok; + } + break; + default: + ptr += MINBPC; + break; + } + } + return XML_TOK_PARTIAL; + case BT_QUEST: + if (!PREFIX(checkPiTarget)(enc, target, ptr, &tok)) { + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + ptr += MINBPC; + if (ptr == end) + return XML_TOK_PARTIAL; + if (CHAR_MATCHES(enc, ptr, '>')) { + *nextTokPtr = ptr + MINBPC; + return tok; + } + /* fall through */ + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + } + return XML_TOK_PARTIAL; +} + + +static +int PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + int i; + /* CDATA[ */ + if (end - ptr < 6 * MINBPC) + return XML_TOK_PARTIAL; + for (i = 0; i < 6; i++, ptr += MINBPC) { + if (!CHAR_MATCHES(enc, ptr, "CDATA["[i])) { + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + } + *nextTokPtr = ptr; + return XML_TOK_CDATA_SECT_OPEN; +} + +static +int PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + if (ptr == end) + return XML_TOK_NONE; +#if MINBPC > 1 + { + size_t n = end - ptr; + if (n & (MINBPC - 1)) { + n &= ~(MINBPC - 1); + if (n == 0) + return XML_TOK_PARTIAL; + end = ptr + n; + } + } +#endif + switch (BYTE_TYPE(enc, ptr)) { + case BT_RSQB: + ptr += MINBPC; + if (ptr == end) + return XML_TOK_PARTIAL; + if (!CHAR_MATCHES(enc, ptr, ']')) + break; + ptr += MINBPC; + if (ptr == end) + return XML_TOK_PARTIAL; + if (!CHAR_MATCHES(enc, ptr, '>')) { + ptr -= MINBPC; + break; + } + *nextTokPtr = ptr + MINBPC; + return XML_TOK_CDATA_SECT_CLOSE; + case BT_CR: + ptr += MINBPC; + if (ptr == end) + return XML_TOK_PARTIAL; + if (BYTE_TYPE(enc, ptr) == BT_LF) + ptr += MINBPC; + *nextTokPtr = ptr; + return XML_TOK_DATA_NEWLINE; + case BT_LF: + *nextTokPtr = ptr + MINBPC; + return XML_TOK_DATA_NEWLINE; + INVALID_CASES(ptr, nextTokPtr) + default: + ptr += MINBPC; + break; + } + while (ptr != end) { + switch (BYTE_TYPE(enc, ptr)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: \ + if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_DATA_CHARS; \ + } \ + ptr += n; \ + break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_NONXML: + case BT_MALFORM: + case BT_TRAIL: + case BT_CR: + case BT_LF: + case BT_RSQB: + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + default: + ptr += MINBPC; + break; + } + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; +} + +/* ptr points to character following "')) { + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + *nextTokPtr = ptr + MINBPC; + return XML_TOK_EMPTY_ELEMENT_WITH_ATTS; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + break; + } + break; + } + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + } + return XML_TOK_PARTIAL; +} + +/* ptr points to character following "<" */ + +static +int PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + if (ptr == end) + return XML_TOK_PARTIAL; + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) + case BT_EXCL: + if ((ptr += MINBPC) == end) + return XML_TOK_PARTIAL; + switch (BYTE_TYPE(enc, ptr)) { + case BT_MINUS: + return PREFIX(scanComment)(enc, ptr + MINBPC, end, nextTokPtr); + case BT_LSQB: + return PREFIX(scanCdataSection)(enc, ptr + MINBPC, end, nextTokPtr); + } + *nextTokPtr = ptr; + return XML_TOK_INVALID; + case BT_QUEST: + return PREFIX(scanPi)(enc, ptr + MINBPC, end, nextTokPtr); + case BT_SOL: + return PREFIX(scanEndTag)(enc, ptr + MINBPC, end, nextTokPtr); + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + /* we have a start-tag */ + while (ptr != end) { + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) + case BT_S: case BT_CR: case BT_LF: + { + ptr += MINBPC; + while (ptr != end) { + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) + case BT_GT: + goto gt; + case BT_SOL: + goto sol; + case BT_S: case BT_CR: case BT_LF: + ptr += MINBPC; + continue; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + return PREFIX(scanAtts)(enc, ptr, end, nextTokPtr); + } + return XML_TOK_PARTIAL; + } + case BT_GT: + gt: + *nextTokPtr = ptr + MINBPC; + return XML_TOK_START_TAG_NO_ATTS; + case BT_SOL: + sol: + ptr += MINBPC; + if (ptr == end) + return XML_TOK_PARTIAL; + if (!CHAR_MATCHES(enc, ptr, '>')) { + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + *nextTokPtr = ptr + MINBPC; + return XML_TOK_EMPTY_ELEMENT_NO_ATTS; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + } + return XML_TOK_PARTIAL; +} + +static +int PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + if (ptr == end) + return XML_TOK_NONE; +#if MINBPC > 1 + { + size_t n = end - ptr; + if (n & (MINBPC - 1)) { + n &= ~(MINBPC - 1); + if (n == 0) + return XML_TOK_PARTIAL; + end = ptr + n; + } + } +#endif + switch (BYTE_TYPE(enc, ptr)) { + case BT_LT: + return PREFIX(scanLt)(enc, ptr + MINBPC, end, nextTokPtr); + case BT_AMP: + return PREFIX(scanRef)(enc, ptr + MINBPC, end, nextTokPtr); + case BT_CR: + ptr += MINBPC; + if (ptr == end) + return XML_TOK_TRAILING_CR; + if (BYTE_TYPE(enc, ptr) == BT_LF) + ptr += MINBPC; + *nextTokPtr = ptr; + return XML_TOK_DATA_NEWLINE; + case BT_LF: + *nextTokPtr = ptr + MINBPC; + return XML_TOK_DATA_NEWLINE; + case BT_RSQB: + ptr += MINBPC; + if (ptr == end) + return XML_TOK_TRAILING_RSQB; + if (!CHAR_MATCHES(enc, ptr, ']')) + break; + ptr += MINBPC; + if (ptr == end) + return XML_TOK_TRAILING_RSQB; + if (!CHAR_MATCHES(enc, ptr, '>')) { + ptr -= MINBPC; + break; + } + *nextTokPtr = ptr; + return XML_TOK_INVALID; + INVALID_CASES(ptr, nextTokPtr) + default: + ptr += MINBPC; + break; + } + while (ptr != end) { + switch (BYTE_TYPE(enc, ptr)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: \ + if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_DATA_CHARS; \ + } \ + ptr += n; \ + break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_RSQB: + if (ptr + MINBPC != end) { + if (!CHAR_MATCHES(enc, ptr + MINBPC, ']')) { + ptr += MINBPC; + break; + } + if (ptr + 2*MINBPC != end) { + if (!CHAR_MATCHES(enc, ptr + 2*MINBPC, '>')) { + ptr += MINBPC; + break; + } + *nextTokPtr = ptr + 2*MINBPC; + return XML_TOK_INVALID; + } + } + /* fall through */ + case BT_AMP: + case BT_LT: + case BT_NONXML: + case BT_MALFORM: + case BT_TRAIL: + case BT_CR: + case BT_LF: + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + default: + ptr += MINBPC; + break; + } + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; +} + +/* ptr points to character following "%" */ + +static +int PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + if (ptr == end) + return XML_TOK_PARTIAL; + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) + case BT_S: case BT_LF: case BT_CR: case BT_PERCNT: + *nextTokPtr = ptr; + return XML_TOK_PERCENT; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + while (ptr != end) { + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) + case BT_SEMI: + *nextTokPtr = ptr + MINBPC; + return XML_TOK_PARAM_ENTITY_REF; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + } + return XML_TOK_PARTIAL; +} + +static +int PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + if (ptr == end) + return XML_TOK_PARTIAL; + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + while (ptr != end) { + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) + case BT_CR: case BT_LF: case BT_S: + case BT_RPAR: case BT_GT: case BT_PERCNT: case BT_VERBAR: + *nextTokPtr = ptr; + return XML_TOK_POUND_NAME; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + } + return XML_TOK_PARTIAL; +} + +static +int PREFIX(scanLit)(int open, const ENCODING *enc, + const char *ptr, const char *end, + const char **nextTokPtr) +{ + while (ptr != end) { + int t = BYTE_TYPE(enc, ptr); + switch (t) { + INVALID_CASES(ptr, nextTokPtr) + case BT_QUOT: + case BT_APOS: + ptr += MINBPC; + if (t != open) + break; + if (ptr == end) + return XML_TOK_PARTIAL; + *nextTokPtr = ptr; + switch (BYTE_TYPE(enc, ptr)) { + case BT_S: case BT_CR: case BT_LF: + case BT_GT: case BT_PERCNT: case BT_LSQB: + return XML_TOK_LITERAL; + default: + return XML_TOK_INVALID; + } + default: + ptr += MINBPC; + break; + } + } + return XML_TOK_PARTIAL; +} + +static +int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + int tok; + if (ptr == end) + return XML_TOK_NONE; +#if MINBPC > 1 + { + size_t n = end - ptr; + if (n & (MINBPC - 1)) { + n &= ~(MINBPC - 1); + if (n == 0) + return XML_TOK_PARTIAL; + end = ptr + n; + } + } +#endif + switch (BYTE_TYPE(enc, ptr)) { + case BT_QUOT: + return PREFIX(scanLit)(BT_QUOT, enc, ptr + MINBPC, end, nextTokPtr); + case BT_APOS: + return PREFIX(scanLit)(BT_APOS, enc, ptr + MINBPC, end, nextTokPtr); + case BT_LT: + { + ptr += MINBPC; + if (ptr == end) + return XML_TOK_PARTIAL; + switch (BYTE_TYPE(enc, ptr)) { + case BT_EXCL: + return PREFIX(scanDecl)(enc, ptr + MINBPC, end, nextTokPtr); + case BT_QUEST: + return PREFIX(scanPi)(enc, ptr + MINBPC, end, nextTokPtr); + case BT_NMSTRT: + case BT_HEX: + case BT_NONASCII: + case BT_LEAD2: + case BT_LEAD3: + case BT_LEAD4: + *nextTokPtr = ptr - MINBPC; + return XML_TOK_INSTANCE_START; + } + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + case BT_CR: + if (ptr + MINBPC == end) + return XML_TOK_TRAILING_CR; + /* fall through */ + case BT_S: case BT_LF: + for (;;) { + ptr += MINBPC; + if (ptr == end) + break; + switch (BYTE_TYPE(enc, ptr)) { + case BT_S: case BT_LF: + break; + case BT_CR: + /* don't split CR/LF pair */ + if (ptr + MINBPC != end) + break; + /* fall through */ + default: + *nextTokPtr = ptr; + return XML_TOK_PROLOG_S; + } + } + *nextTokPtr = ptr; + return XML_TOK_PROLOG_S; + case BT_PERCNT: + return PREFIX(scanPercent)(enc, ptr + MINBPC, end, nextTokPtr); + case BT_COMMA: + *nextTokPtr = ptr + MINBPC; + return XML_TOK_COMMA; + case BT_LSQB: + *nextTokPtr = ptr + MINBPC; + return XML_TOK_OPEN_BRACKET; + case BT_RSQB: + ptr += MINBPC; + if (ptr == end) + return XML_TOK_PARTIAL; + if (CHAR_MATCHES(enc, ptr, ']')) { + if (ptr + MINBPC == end) + return XML_TOK_PARTIAL; + if (CHAR_MATCHES(enc, ptr + MINBPC, '>')) { + *nextTokPtr = ptr + 2*MINBPC; + return XML_TOK_COND_SECT_CLOSE; + } + } + *nextTokPtr = ptr; + return XML_TOK_CLOSE_BRACKET; + case BT_LPAR: + *nextTokPtr = ptr + MINBPC; + return XML_TOK_OPEN_PAREN; + case BT_RPAR: + ptr += MINBPC; + if (ptr == end) + return XML_TOK_PARTIAL; + switch (BYTE_TYPE(enc, ptr)) { + case BT_AST: + *nextTokPtr = ptr + MINBPC; + return XML_TOK_CLOSE_PAREN_ASTERISK; + case BT_QUEST: + *nextTokPtr = ptr + MINBPC; + return XML_TOK_CLOSE_PAREN_QUESTION; + case BT_PLUS: + *nextTokPtr = ptr + MINBPC; + return XML_TOK_CLOSE_PAREN_PLUS; + case BT_CR: case BT_LF: case BT_S: + case BT_GT: case BT_COMMA: case BT_VERBAR: + case BT_RPAR: + *nextTokPtr = ptr; + return XML_TOK_CLOSE_PAREN; + } + *nextTokPtr = ptr; + return XML_TOK_INVALID; + case BT_VERBAR: + *nextTokPtr = ptr + MINBPC; + return XML_TOK_OR; + case BT_GT: + *nextTokPtr = ptr + MINBPC; + return XML_TOK_DECL_CLOSE; + case BT_NUM: + return PREFIX(scanPoundName)(enc, ptr + MINBPC, end, nextTokPtr); +#define LEAD_CASE(n) \ + case BT_LEAD ## n: \ + if (end - ptr < n) \ + return XML_TOK_PARTIAL_CHAR; \ + if (IS_NMSTRT_CHAR(enc, ptr, n)) { \ + ptr += n; \ + tok = XML_TOK_NAME; \ + break; \ + } \ + if (IS_NAME_CHAR(enc, ptr, n)) { \ + ptr += n; \ + tok = XML_TOK_NMTOKEN; \ + break; \ + } \ + *nextTokPtr = ptr; \ + return XML_TOK_INVALID; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_NMSTRT: + case BT_HEX: + tok = XML_TOK_NAME; + ptr += MINBPC; + break; + case BT_DIGIT: + case BT_NAME: + case BT_MINUS: + tok = XML_TOK_NMTOKEN; + ptr += MINBPC; + break; + case BT_NONASCII: + if (IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { + ptr += MINBPC; + tok = XML_TOK_NAME; + break; + } + if (IS_NAME_CHAR_MINBPC(enc, ptr)) { + ptr += MINBPC; + tok = XML_TOK_NMTOKEN; + break; + } + /* fall through */ + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + while (ptr != end) { + switch (BYTE_TYPE(enc, ptr)) { + CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) + case BT_GT: case BT_RPAR: case BT_COMMA: + case BT_VERBAR: case BT_LSQB: case BT_PERCNT: + case BT_S: case BT_CR: case BT_LF: + *nextTokPtr = ptr; + return tok; + case BT_PLUS: + if (tok != XML_TOK_NAME) { + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + *nextTokPtr = ptr + MINBPC; + return XML_TOK_NAME_PLUS; + case BT_AST: + if (tok != XML_TOK_NAME) { + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + *nextTokPtr = ptr + MINBPC; + return XML_TOK_NAME_ASTERISK; + case BT_QUEST: + if (tok != XML_TOK_NAME) { + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + *nextTokPtr = ptr + MINBPC; + return XML_TOK_NAME_QUESTION; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } + } + return XML_TOK_PARTIAL; +} + +static +int PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + const char *start; + if (ptr == end) + return XML_TOK_NONE; + start = ptr; + while (ptr != end) { + switch (BYTE_TYPE(enc, ptr)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: ptr += n; break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_AMP: + if (ptr == start) + return PREFIX(scanRef)(enc, ptr + MINBPC, end, nextTokPtr); + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + case BT_LT: + /* this is for inside entity references */ + *nextTokPtr = ptr; + return XML_TOK_INVALID; + case BT_LF: + if (ptr == start) { + *nextTokPtr = ptr + MINBPC; + return XML_TOK_DATA_NEWLINE; + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + case BT_CR: + if (ptr == start) { + ptr += MINBPC; + if (ptr == end) + return XML_TOK_TRAILING_CR; + if (BYTE_TYPE(enc, ptr) == BT_LF) + ptr += MINBPC; + *nextTokPtr = ptr; + return XML_TOK_DATA_NEWLINE; + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + case BT_S: + if (ptr == start) { + *nextTokPtr = ptr + MINBPC; + return XML_TOK_ATTRIBUTE_VALUE_S; + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + default: + ptr += MINBPC; + break; + } + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; +} + +static +int PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end, + const char **nextTokPtr) +{ + const char *start; + if (ptr == end) + return XML_TOK_NONE; + start = ptr; + while (ptr != end) { + switch (BYTE_TYPE(enc, ptr)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: ptr += n; break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_AMP: + if (ptr == start) + return PREFIX(scanRef)(enc, ptr + MINBPC, end, nextTokPtr); + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + case BT_PERCNT: + if (ptr == start) + return PREFIX(scanPercent)(enc, ptr + MINBPC, end, nextTokPtr); + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + case BT_LF: + if (ptr == start) { + *nextTokPtr = ptr + MINBPC; + return XML_TOK_DATA_NEWLINE; + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + case BT_CR: + if (ptr == start) { + ptr += MINBPC; + if (ptr == end) + return XML_TOK_TRAILING_CR; + if (BYTE_TYPE(enc, ptr) == BT_LF) + ptr += MINBPC; + *nextTokPtr = ptr; + return XML_TOK_DATA_NEWLINE; + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; + default: + ptr += MINBPC; + break; + } + } + *nextTokPtr = ptr; + return XML_TOK_DATA_CHARS; +} + +static +int PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, + const char **badPtr) +{ + ptr += MINBPC; + end -= MINBPC; + for (; ptr != end; ptr += MINBPC) { + switch (BYTE_TYPE(enc, ptr)) { + case BT_DIGIT: + case BT_HEX: + case BT_MINUS: + case BT_APOS: + case BT_LPAR: + case BT_RPAR: + case BT_PLUS: + case BT_COMMA: + case BT_SOL: + case BT_EQUALS: + case BT_QUEST: + case BT_CR: + case BT_LF: + case BT_SEMI: + case BT_EXCL: + case BT_AST: + case BT_PERCNT: + case BT_NUM: + break; + case BT_S: + if (CHAR_MATCHES(enc, ptr, '\t')) { + *badPtr = ptr; + return 0; + } + break; + case BT_NAME: + case BT_NMSTRT: + if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f)) + break; + default: + switch (BYTE_TO_ASCII(enc, ptr)) { + case 0x24: /* $ */ + case 0x40: /* @ */ + break; + default: + *badPtr = ptr; + return 0; + } + break; + } + } + return 1; +} + +/* This must only be called for a well-formed start-tag or empty element tag. +Returns the number of attributes. Pointers to the first attsMax attributes +are stored in atts. */ + +static +int PREFIX(getAtts)(const ENCODING *enc, const char *ptr, + int attsMax, ATTRIBUTE *atts) +{ + enum { other, inName, inValue } state = inName; + int nAtts = 0; + int open = 0; + + for (ptr += MINBPC;; ptr += MINBPC) { + switch (BYTE_TYPE(enc, ptr)) { +#define START_NAME \ + if (state == other) { \ + if (nAtts < attsMax) { \ + atts[nAtts].name = ptr; \ + atts[nAtts].normalized = 1; \ + } \ + state = inName; \ + } +#define LEAD_CASE(n) \ + case BT_LEAD ## n: START_NAME ptr += (n - MINBPC); break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_NONASCII: + case BT_NMSTRT: + case BT_HEX: + START_NAME + break; +#undef START_NAME + case BT_QUOT: + if (state != inValue) { + atts[nAtts].valuePtr = ptr + MINBPC; + state = inValue; + open = BT_QUOT; + } + else if (open == BT_QUOT) { + state = other; + atts[nAtts++].valueEnd = ptr; + } + break; + case BT_APOS: + if (state != inValue) { + atts[nAtts].valuePtr = ptr + MINBPC; + state = inValue; + open = BT_APOS; + } + else if (open == BT_APOS) { + state = other; + atts[nAtts++].valueEnd = ptr; + } + break; + case BT_AMP: + atts[nAtts].normalized = 0; + break; + case BT_S: + if (state == inName) + state = other; + else if (state == inValue + && atts[nAtts].normalized + && (ptr == atts[nAtts].valuePtr + || BYTE_TO_ASCII(enc, ptr) != ' ' + || BYTE_TO_ASCII(enc, ptr + MINBPC) == ' ' + || BYTE_TYPE(enc, ptr + MINBPC) == open)) + atts[nAtts].normalized = 0; + break; + case BT_CR: case BT_LF: + /* This case ensures that the first attribute name is counted + Apart from that we could just change state on the quote. */ + if (state == inName) + state = other; + else if (state == inValue) + atts[nAtts].normalized = 0; + break; + case BT_GT: + case BT_SOL: + if (state != inValue) + return nAtts; + break; + default: + break; + } + } + /* not reached */ +} + +static +int PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) +{ + int result = 0; + /* skip &# */ + ptr += 2*MINBPC; + if (CHAR_MATCHES(enc, ptr, 'x')) { + for (ptr += MINBPC; !CHAR_MATCHES(enc, ptr, ';'); ptr += MINBPC) { + int c = BYTE_TO_ASCII(enc, ptr); + switch (c) { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + result <<= 4; + result |= (c - '0'); + break; + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + result <<= 4; + result += 10 + (c - 'A'); + break; + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + result <<= 4; + result += 10 + (c - 'a'); + break; + } + if (result >= 0x110000) + return -1; + } + } + else { + for (; !CHAR_MATCHES(enc, ptr, ';'); ptr += MINBPC) { + int c = BYTE_TO_ASCII(enc, ptr); + result *= 10; + result += (c - '0'); + if (result >= 0x110000) + return -1; + } + } + return checkCharRefNumber(result); +} + +static +int PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, const char *end) +{ + switch (end - ptr) { + case 2 * MINBPC: + if (CHAR_MATCHES(enc, ptr + MINBPC, 't')) { + switch (BYTE_TO_ASCII(enc, ptr)) { + case 'l': + return '<'; + case 'g': + return '>'; + } + } + break; + case 3 * MINBPC: + if (CHAR_MATCHES(enc, ptr, 'a')) { + ptr += MINBPC; + if (CHAR_MATCHES(enc, ptr, 'm')) { + ptr += MINBPC; + if (CHAR_MATCHES(enc, ptr, 'p')) + return '&'; + } + } + break; + case 4 * MINBPC: + switch (BYTE_TO_ASCII(enc, ptr)) { + case 'q': + ptr += MINBPC; + if (CHAR_MATCHES(enc, ptr, 'u')) { + ptr += MINBPC; + if (CHAR_MATCHES(enc, ptr, 'o')) { + ptr += MINBPC; + if (CHAR_MATCHES(enc, ptr, 't')) + return '"'; + } + } + break; + case 'a': + ptr += MINBPC; + if (CHAR_MATCHES(enc, ptr, 'p')) { + ptr += MINBPC; + if (CHAR_MATCHES(enc, ptr, 'o')) { + ptr += MINBPC; + if (CHAR_MATCHES(enc, ptr, 's')) + return '\''; + } + } + break; + } + } + return 0; +} + +static +int PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2) +{ + for (;;) { + switch (BYTE_TYPE(enc, ptr1)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: \ + if (*ptr1++ != *ptr2++) \ + return 0; + LEAD_CASE(4) LEAD_CASE(3) LEAD_CASE(2) +#undef LEAD_CASE + /* fall through */ + if (*ptr1++ != *ptr2++) + return 0; + break; + case BT_NONASCII: + case BT_NMSTRT: + case BT_HEX: + case BT_DIGIT: + case BT_NAME: + case BT_MINUS: + if (*ptr2++ != *ptr1++) + return 0; +#if MINBPC > 1 + if (*ptr2++ != *ptr1++) + return 0; +#if MINBPC > 2 + if (*ptr2++ != *ptr1++) + return 0; +#if MINBPC > 3 + if (*ptr2++ != *ptr1++) + return 0; +#endif +#endif +#endif + break; + default: +#if MINBPC == 1 + if (*ptr1 == *ptr2) + return 1; +#endif + switch (BYTE_TYPE(enc, ptr2)) { + case BT_LEAD2: + case BT_LEAD3: + case BT_LEAD4: + case BT_NONASCII: + case BT_NMSTRT: + case BT_HEX: + case BT_DIGIT: + case BT_NAME: + case BT_MINUS: + return 0; + default: + return 1; + } + } + } + /* not reached */ +} + +static +int PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1, const char *ptr2) +{ + for (; *ptr2; ptr1 += MINBPC, ptr2++) { + if (!CHAR_MATCHES(end, ptr1, *ptr2)) + return 0; + } + switch (BYTE_TYPE(enc, ptr1)) { + case BT_LEAD2: + case BT_LEAD3: + case BT_LEAD4: + case BT_NONASCII: + case BT_NMSTRT: + case BT_HEX: + case BT_DIGIT: + case BT_NAME: + case BT_MINUS: + return 0; + default: + return 1; + } +} + +static +int PREFIX(nameLength)(const ENCODING *enc, const char *ptr) +{ + const char *start = ptr; + for (;;) { + switch (BYTE_TYPE(enc, ptr)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: ptr += n; break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_NONASCII: + case BT_NMSTRT: + case BT_HEX: + case BT_DIGIT: + case BT_NAME: + case BT_MINUS: + ptr += MINBPC; + break; + default: + return ptr - start; + } + } +} + +static +const char *PREFIX(skipS)(const ENCODING *enc, const char *ptr) +{ + for (;;) { + switch (BYTE_TYPE(enc, ptr)) { + case BT_LF: + case BT_CR: + case BT_S: + ptr += MINBPC; + break; + default: + return ptr; + } + } +} + +static +void PREFIX(updatePosition)(const ENCODING *enc, + const char *ptr, + const char *end, + POSITION *pos) +{ + while (ptr != end) { + switch (BYTE_TYPE(enc, ptr)) { +#define LEAD_CASE(n) \ + case BT_LEAD ## n: \ + ptr += n; \ + break; + LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) +#undef LEAD_CASE + case BT_LF: + pos->columnNumber = (unsigned)-1; + pos->lineNumber++; + ptr += MINBPC; + break; + case BT_CR: + pos->lineNumber++; + ptr += MINBPC; + if (ptr != end && BYTE_TYPE(enc, ptr) == BT_LF) + ptr += MINBPC; + pos->columnNumber = (unsigned)-1; + break; + default: + ptr += MINBPC; + break; + } + pos->columnNumber++; + } +} + +#undef DO_LEAD_CASE +#undef MULTIBYTE_CASES +#undef INVALID_CASES +#undef CHECK_NAME_CASE +#undef CHECK_NAME_CASES +#undef CHECK_NMSTRT_CASE +#undef CHECK_NMSTRT_CASES Index: library/xml/TclExpat-1.1/xmltok_impl.h =================================================================== diff -u -N --- library/xml/TclExpat-1.1/xmltok_impl.h (revision 0) +++ library/xml/TclExpat-1.1/xmltok_impl.h (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,60 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +enum { + BT_NONXML, + BT_MALFORM, + BT_LT, + BT_AMP, + BT_RSQB, + BT_LEAD2, + BT_LEAD3, + BT_LEAD4, + BT_TRAIL, + BT_CR, + BT_LF, + BT_GT, + BT_QUOT, + BT_APOS, + BT_EQUALS, + BT_QUEST, + BT_EXCL, + BT_SOL, + BT_SEMI, + BT_NUM, + BT_LSQB, + BT_S, + BT_NMSTRT, + BT_HEX, + BT_DIGIT, + BT_NAME, + BT_MINUS, + BT_OTHER, /* known not to be a name or name start character */ + BT_NONASCII, /* might be a name or name start character */ + BT_PERCNT, + BT_LPAR, + BT_RPAR, + BT_AST, + BT_PLUS, + BT_COMMA, + BT_VERBAR +}; + +#include Index: library/xml/TclExpat-1.1/xmlwf.c =================================================================== diff -u -N --- library/xml/TclExpat-1.1/xmlwf.c (revision 0) +++ library/xml/TclExpat-1.1/xmlwf.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,654 @@ +/* +The contents of this file are subject to the Mozilla Public License +Version 1.0 (the "License"); you may not use this file except in +compliance with the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" +basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +License for the specific language governing rights and limitations +under the License. + +The Original Code is expat. + +The Initial Developer of the Original Code is James Clark. +Portions created by James Clark are Copyright (C) 1998 +James Clark. All Rights Reserved. + +Contributor(s): +*/ + +#include +#include "xmlparse.h" +#include "filemap.h" +#include "codepage.h" + +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#include +#endif + +#ifdef _POSIX_SOURCE +#include +#endif + +#ifndef O_BINARY +#ifdef _O_BINARY +#define O_BINARY _O_BINARY +#else +#define O_BINARY 0 +#endif +#endif + +#ifdef _MSC_VER +#include +#endif + +#ifdef _DEBUG +#define READ_SIZE 16 +#else +#define READ_SIZE (1024*8) +#endif + +#ifdef XML_UNICODE +#ifndef XML_UNICODE_WCHAR_T +#error xmlwf requires a 16-bit Unicode-compatible wchar_t +#endif +#define T(x) L ## x +#define ftprintf fwprintf +#define tfopen _wfopen +#define fputts fputws +#define puttc putwc +#define tcscmp wcscmp +#define tcscpy wcscpy +#define tcscat wcscat +#define tcschr wcschr +#define tcsrchr wcsrchr +#define tcslen wcslen +#define tperror _wperror +#define topen _wopen +#define tmain wmain +#define tremove _wremove +#else /* not XML_UNICODE */ +#define T(x) x +#define ftprintf fprintf +#define tfopen fopen +#define fputts fputs +#define puttc putc +#define tcscmp strcmp +#define tcscpy strcpy +#define tcscat strcat +#define tcschr strchr +#define tcsrchr strrchr +#define tcslen strlen +#define tperror perror +#define topen open +#define tmain main +#define tremove remove +#endif /* not XML_UNICODE */ + +static void characterData(void *userData, const XML_Char *s, size_t len) +{ + FILE *fp = userData; + for (; len > 0; --len, ++s) { + switch (*s) { + case T('&'): + fputts(T("&"), fp); + break; + case T('<'): + fputts(T("<"), fp); + break; + case T('>'): + fputts(T(">"), fp); + break; + case T('"'): + fputts(T("""), fp); + break; + case 9: + case 10: + case 13: + ftprintf(fp, T("&#%d;"), *s); + break; + default: + puttc(*s, fp); + break; + } + } +} + +/* Lexicographically comparing UTF-8 encoded attribute values, +is equivalent to lexicographically comparing based on the character number. */ + +static int attcmp(const void *att1, const void *att2) +{ + return tcscmp(*(const XML_Char **)att1, *(const XML_Char **)att2); +} + +static void startElement(void *userData, const XML_Char *name, const XML_Char **atts) +{ + size_t nAtts; + const XML_Char **p; + FILE *fp = userData; + puttc(T('<'), fp); + fputts(name, fp); + + p = atts; + while (*p) + ++p; + nAtts = (p - atts) >> 1; + if (nAtts > 1) + qsort((void *)atts, nAtts, sizeof(XML_Char *) * 2, attcmp); + while (*atts) { + puttc(T(' '), fp); + fputts(*atts++, fp); + puttc(T('='), fp); + puttc(T('"'), fp); + characterData(userData, *atts, tcslen(*atts)); + puttc(T('"'), fp); + atts++; + } + puttc(T('>'), fp); +} + +static void endElement(void *userData, const XML_Char *name) +{ + FILE *fp = userData; + puttc(T('<'), fp); + puttc(T('/'), fp); + fputts(name, fp); + puttc(T('>'), fp); +} + +static void processingInstruction(void *userData, const XML_Char *target, const XML_Char *data) +{ + FILE *fp = userData; + puttc(T('<'), fp); + puttc(T('?'), fp); + fputts(target, fp); + puttc(T(' '), fp); + fputts(data, fp); + puttc(T('?'), fp); + puttc(T('>'), fp); +} + +static void defaultCharacterData(XML_Parser parser, const XML_Char *s, size_t len) +{ + XML_DefaultCurrent(parser); +} + +static void defaultStartElement(XML_Parser parser, const XML_Char *name, const XML_Char **atts) +{ + XML_DefaultCurrent(parser); +} + +static void defaultEndElement(XML_Parser parser, const XML_Char *name) +{ + XML_DefaultCurrent(parser); +} + +static void defaultProcessingInstruction(XML_Parser parser, const XML_Char *target, const XML_Char *data) +{ + XML_DefaultCurrent(parser); +} + +static void markup(XML_Parser parser, const XML_Char *s, int len) +{ + FILE *fp = XML_GetUserData(parser); + for (; len > 0; --len, ++s) + puttc(*s, fp); +} + +static +void metaLocation(XML_Parser parser) +{ + const XML_Char *uri = XML_GetBase(parser); + if (uri) + ftprintf(XML_GetUserData(parser), T(" uri=\"%s\""), uri); + ftprintf(XML_GetUserData(parser), + T(" byte=\"%ld\" line=\"%d\" col=\"%d\""), + XML_GetCurrentByteIndex(parser), + XML_GetCurrentLineNumber(parser), + XML_GetCurrentColumnNumber(parser)); +} + +static +void metaStartElement(XML_Parser parser, const XML_Char *name, const XML_Char **atts) +{ + FILE *fp = XML_GetUserData(parser); + ftprintf(fp, T("\n"), fp); + do { + ftprintf(fp, T("\n"), fp); + } while (*(atts += 2)); + fputts(T("\n"), fp); + } + else + fputts(T("/>\n"), fp); +} + +static +void metaEndElement(XML_Parser parser, const XML_Char *name) +{ + FILE *fp = XML_GetUserData(parser); + ftprintf(fp, T("\n"), fp); +} + +static +void metaProcessingInstruction(XML_Parser parser, const XML_Char *target, const XML_Char *data) +{ + FILE *fp = XML_GetUserData(parser); + ftprintf(fp, T("\n"), fp); +} + +static +void metaCharacterData(XML_Parser parser, const XML_Char *s, size_t len) +{ + FILE *fp = XML_GetUserData(parser); + fputts(T("\n"), fp); +} + +static +void metaUnparsedEntityDecl(XML_Parser parser, + const XML_Char *entityName, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId, + const XML_Char *notationName) +{ + FILE *fp = XML_GetUserData(parser); + ftprintf(fp, T("\n"), fp); +} + +static +void metaNotationDecl(XML_Parser parser, + const XML_Char *notationName, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId) +{ + FILE *fp = XML_GetUserData(parser); + ftprintf(fp, T("\n"), fp); +} + +typedef struct { + XML_Parser parser; + int *retPtr; +} PROCESS_ARGS; + +static +void reportError(XML_Parser parser, const XML_Char *filename) +{ + int code = XML_GetErrorCode(parser); + const XML_Char *message = XML_ErrorString(code); + if (message) + ftprintf(stdout, T("%s:%d:%d: %s\n"), + filename, + XML_GetErrorLineNumber(parser), + XML_GetErrorColumnNumber(parser), + message); + else + ftprintf(stderr, T("%s: (unknown message %d)\n"), filename, code); +} + +static +void processFile(const void *data, size_t size, const XML_Char *filename, void *args) +{ + XML_Parser parser = ((PROCESS_ARGS *)args)->parser; + int *retPtr = ((PROCESS_ARGS *)args)->retPtr; + if (!XML_Parse(parser, data, size, 1)) { + reportError(parser, filename); + *retPtr = 0; + } + else + *retPtr = 1; +} + +static +int isAsciiLetter(XML_Char c) +{ + return (T('a') <= c && c <= T('z')) || (T('A') <= c && c <= T('Z')); +} + +static +const XML_Char *resolveSystemId(const XML_Char *base, const XML_Char *systemId, XML_Char **toFree) +{ + XML_Char *s; + *toFree = 0; + if (!base + || *systemId == T('/') +#ifdef WIN32 + || *systemId == T('\\') + || (isAsciiLetter(systemId[0]) && systemId[1] == T(':')) +#endif + ) + return systemId; + *toFree = (XML_Char *)malloc((tcslen(base) + tcslen(systemId) + 2)*sizeof(XML_Char)); + if (!*toFree) + return systemId; + tcscpy(*toFree, base); + s = *toFree; + if (tcsrchr(s, T('/'))) + s = tcsrchr(s, T('/')) + 1; +#ifdef WIN32 + if (tcsrchr(s, T('\\'))) + s = tcsrchr(s, T('\\')) + 1; +#endif + tcscpy(s, systemId); + return *toFree; +} + +static +int externalEntityRefFilemap(XML_Parser parser, + const XML_Char *openEntityNames, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId) +{ + int result; + XML_Char *s; + const XML_Char *filename; + XML_Parser entParser = XML_ExternalEntityParserCreate(parser, openEntityNames, 0); + PROCESS_ARGS args; + args.retPtr = &result; + args.parser = entParser; + filename = resolveSystemId(base, systemId, &s); + XML_SetBase(entParser, filename); + if (!filemap(filename, processFile, &args)) + result = 0; + free(s); + XML_ParserFree(entParser); + return result; +} + +static +int processStream(const XML_Char *filename, XML_Parser parser) +{ + int fd = topen(filename, O_BINARY|O_RDONLY); + if (fd < 0) { + tperror(filename); + return 0; + } + for (;;) { + size_t nread; + char *buf = XML_GetBuffer(parser, READ_SIZE); + if (!buf) { + close(fd); + ftprintf(stderr, T("%s: out of memory\n"), filename); + return 0; + } + nread = read(fd, buf, READ_SIZE); + if (nread < 0) { + tperror(filename); + close(fd); + return 0; + } + if (!XML_ParseBuffer(parser, nread, nread == 0)) { + reportError(parser, filename); + close(fd); + return 0; + } + if (nread == 0) { + close(fd); + break;; + } + } + return 1; +} + +static +int externalEntityRefStream(XML_Parser parser, + const XML_Char *openEntityNames, + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId) +{ + XML_Char *s; + const XML_Char *filename; + int ret; + XML_Parser entParser = XML_ExternalEntityParserCreate(parser, openEntityNames, 0); + filename = resolveSystemId(base, systemId, &s); + XML_SetBase(entParser, filename); + ret = processStream(filename, entParser); + free(s); + XML_ParserFree(entParser); + return ret; +} + +static +int unknownEncodingConvert(void *data, const char *p) +{ + return codepageConvert(*(int *)data, p); +} + +static +int unknownEncoding(void *userData, + const XML_Char *name, + XML_Encoding *info) +{ + int cp; + static const XML_Char prefixL[] = T("windows-"); + static const XML_Char prefixU[] = T("WINDOWS-"); + int i; + + for (i = 0; prefixU[i]; i++) + if (name[i] != prefixU[i] && name[i] != prefixL[i]) + return 0; + + cp = 0; + for (; name[i]; i++) { + static const XML_Char digits[] = T("0123456789"); + const XML_Char *s = tcschr(digits, name[i]); + if (!s) + return 0; + cp *= 10; + cp += s - digits; + if (cp >= 0x10000) + return 0; + } + if (!codepageMap(cp, info->map)) + return 0; + info->convert = unknownEncodingConvert; + /* We could just cast the code page integer to a void *, + and avoid the use of release. */ + info->release = free; + info->data = malloc(sizeof(int)); + if (!info->data) + return 0; + *(int *)info->data = cp; + return 1; +} + +static +void usage(const XML_Char *prog) +{ + ftprintf(stderr, T("usage: %s [-r] [-w] [-x] [-d output-dir] [-e encoding] file ...\n"), prog); + exit(1); +} + +int tmain(int argc, XML_Char **argv) +{ + int i; + const XML_Char *outputDir = 0; + const XML_Char *encoding = 0; + int useFilemap = 1; + int processExternalEntities = 0; + int windowsCodePages = 0; + int outputType = 0; + +#ifdef _MSC_VER + _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF); +#endif + + i = 1; + while (i < argc && argv[i][0] == T('-')) { + int j; + if (argv[i][1] == T('-') && argv[i][2] == T('\0')) { + i++; + break; + } + j = 1; + if (argv[i][j] == T('r')) { + useFilemap = 0; + j++; + } + if (argv[i][j] == T('x')) { + processExternalEntities = 1; + j++; + } + if (argv[i][j] == T('w')) { + windowsCodePages = 1; + j++; + } + if (argv[i][j] == T('m')) { + outputType = 'm'; + j++; + } + if (argv[i][j] == T('c')) { + outputType = 'c'; + j++; + } + if (argv[i][j] == T('d')) { + if (argv[i][j + 1] == T('\0')) { + if (++i == argc) + usage(argv[0]); + outputDir = argv[i]; + } + else + outputDir = argv[i] + j + 1; + i++; + } + else if (argv[i][j] == T('e')) { + if (argv[i][j + 1] == T('\0')) { + if (++i == argc) + usage(argv[0]); + encoding = argv[i]; + } + else + encoding = argv[i] + j + 1; + i++; + } + else if (argv[i][j] == T('\0') && j > 1) + i++; + else + usage(argv[0]); + } + if (i == argc) + usage(argv[0]); + for (; i < argc; i++) { + FILE *fp = 0; + XML_Char *outName = 0; + int result; + XML_Parser parser = XML_ParserCreate(encoding); + if (outputDir) { + const XML_Char *file = argv[i]; + if (tcsrchr(file, T('/'))) + file = tcsrchr(file, T('/')) + 1; +#ifdef WIN32 + if (tcsrchr(file, T('\\'))) + file = tcsrchr(file, T('\\')) + 1; +#endif + outName = malloc((tcslen(outputDir) + tcslen(file) + 2) * sizeof(XML_Char)); + tcscpy(outName, outputDir); + tcscat(outName, T("/")); + tcscat(outName, file); + fp = tfopen(outName, T("wb")); + if (!fp) { + tperror(outName); + exit(1); + } +#ifdef XML_UNICODE + puttc(0xFEFF, fp); +#endif + XML_SetUserData(parser, fp); + switch (outputType) { + case 'm': + XML_UseParserAsHandlerArg(parser); + fputts(T("\n"), fp); + XML_SetElementHandler(parser, metaStartElement, metaEndElement); + XML_SetProcessingInstructionHandler(parser, metaProcessingInstruction); + XML_SetCharacterDataHandler(parser, metaCharacterData); + XML_SetUnparsedEntityDeclHandler(parser, metaUnparsedEntityDecl); + XML_SetNotationDeclHandler(parser, metaNotationDecl); + break; + case 'c': + XML_UseParserAsHandlerArg(parser); + XML_SetDefaultHandler(parser, markup); + XML_SetElementHandler(parser, defaultStartElement, defaultEndElement); + XML_SetCharacterDataHandler(parser, defaultCharacterData); + XML_SetProcessingInstructionHandler(parser, defaultProcessingInstruction); + break; + default: + XML_SetElementHandler(parser, startElement, endElement); + XML_SetCharacterDataHandler(parser, characterData); + XML_SetProcessingInstructionHandler(parser, processingInstruction); + break; + } + } + if (windowsCodePages) + XML_SetUnknownEncodingHandler(parser, unknownEncoding, 0); + if (!XML_SetBase(parser, argv[i])) { + ftprintf(stderr, T("%s: out of memory"), argv[0]); + exit(1); + } + if (processExternalEntities) + XML_SetExternalEntityRefHandler(parser, + useFilemap + ? externalEntityRefFilemap + : externalEntityRefStream); + if (useFilemap) { + PROCESS_ARGS args; + args.retPtr = &result; + args.parser = parser; + if (!filemap(argv[i], processFile, &args)) + result = 0; + } + else + result = processStream(argv[i], parser); + if (outputDir) { + if (outputType == 'm') + fputts(T("\n"), fp); + fclose(fp); + if (!result) + tremove(outName); + free(outName); + } + XML_ParserFree(parser); + } + return 0; +} Index: library/xml/TclExpat-1.1/xotcl.m4 =================================================================== diff -u -N --- library/xml/TclExpat-1.1/xotcl.m4 (revision 0) +++ library/xml/TclExpat-1.1/xotcl.m4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,139 @@ +# xotcl.m4 -- +# +# This file provides a set of autoconf macros to help TEA-enable +# a Tcl extension. +# +# Copyright (c) 1999 Scriptics Corporation. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. + +#------------------------------------------------------------------------ +# SC_PATH_XOTCLCONFIG -- +# +# Locate the xotclConfig.sh file and perform a sanity check on +# the Tcl compile flags +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-xotcl=... +# +# Defines the following vars: +# XOTCL_BIN_DIR Full path to the directory containing +# the xotclConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN(SC_PATH_XOTCLCONFIG, [ + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + if test x"${no_xotcl}" = x ; then + # we reset no_xotcl in case something fails here + no_xotcl=true + AC_ARG_WITH(xotcl, [ --with-xotcl directory containing xotcl configuration (xotclConfig.sh)], with_xotclconfig=${withval}) + AC_MSG_CHECKING([for XOTcl configuration]) + AC_CACHE_VAL(ac_cv_c_xotclconfig,[ + + # First check to see if --with-xotcl was specified. + if test x"${with_xotclconfig}" != x ; then + if test -f "${with_xotclconfig}/xotclConfig.sh" ; then + ac_cv_c_xotclconfig=`(cd ${with_xotclconfig}; pwd)` + else + AC_MSG_ERROR([${with_xotclconfig} directory doesn't contain xotclConfig.sh]) + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_xotclconfig}" = x ; then + for i in \ + ${srcdir}/../xotcl \ + `ls -dr ${srcdir}/../xotcl-* 2>/dev/null` \ + ${srcdir}/../../xotcl \ + `ls -dr ${srcdir}/../../xotcl-* 2>/dev/null` \ + ${srcdir}/../../../xotcl \ + `ls -dr ${srcdir}/../../../xotcl-* 2>/dev/null` \ + ${srcdir}/../../../../xotcl \ + `ls -dr ${srcdir}/../../../../xotcl-* 2>/dev/null` \ + ${srcdir}/../../../../../xotcl \ + `ls -dr ${srcdir}/../../../../../xotcl-* 2>/dev/null` ; do + if test -f "$i/xotclConfig.sh" ; then + ac_cv_c_xotclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_xotclconfig}" = x ; then + for i in `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` ; do + if test -f "$i/xotclConfig.sh" ; then + ac_cv_c_xotclconfig=`(cd $i; pwd)` + break + fi + done + fi + + ]) + + if test x"${ac_cv_c_xotclconfig}" = x ; then + XOTCL_BIN_DIR="# no XOTcl configs found" + AC_MSG_WARN(Can't find XOTcl configuration definitions) + exit 0 + else + no_xotcl= + XOTCL_BIN_DIR=${ac_cv_c_xotclconfig} + AC_MSG_RESULT(found $XOTCL_BIN_DIR/xotclConfig.sh) + fi + fi +]) + +#------------------------------------------------------------------------ +# SC_LOAD_XOTCLCONFIG -- +# +# Load the tclConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# XOTCL_BIN_DIR +# +# Results: +# +# Subst the vars: +# +#------------------------------------------------------------------------ + +AC_DEFUN(SC_LOAD_XOTCLCONFIG, [ + AC_MSG_CHECKING([for existence of $XOTCL_BIN_DIR/xotclConfig.sh]) + + if test -f "$XOTCL_BIN_DIR/xotclConfig.sh" ; then + AC_MSG_RESULT([loading]) + . $XOTCL_BIN_DIR/xotclConfig.sh + else + AC_MSG_RESULT([file not found]) + fi + + # + # The eval is required to do the TCL_DBGX substitution in the + # TCL_LIB_FILE variable + # + AC_SUBST(XOTCL_VERSION) + AC_SUBST(XOTCL_MAJOR_VERSION) + AC_SUBST(XOTCL_MINOR_VERSION) + AC_SUBST(XOTCL_RELEASE_LEVEL) + AC_SUBST(XOTCL_LIB_FILE) + AC_SUBST(XOTCL_BUILD_LIB_SPEC) + AC_SUBST(XOTCL_LIB_SPEC) + AC_SUBST(XOTCL_STUB_LIB_FILE) + AC_SUBST(XOTCL_BUILD_STUB_LIB_SPEC) + AC_SUBST(XOTCL_STUB_LIB_SPEC) + AC_SUBST(XOTCL_SRC_DIR) +]) + Index: library/xml/pkgIndex.tcl =================================================================== diff -u -N --- library/xml/pkgIndex.tcl (revision 0) +++ library/xml/pkgIndex.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,15 @@ +# Tcl package index file, version 1.1 +# This file is generated by the "pkg_mkIndex -direct" command +# and sourced either when an application starts up or +# by a "package unknown" script. It invokes the +# "package ifneeded" command to set up package-related +# information so that packages will be loaded automatically +# in response to "package require" commands. When this +# script is sourced, the variable $dir must contain the +# full path name of this file's directory. + +package ifneeded sgml 1.6 [list source [file join $dir sgml.tcl]] +package ifneeded xml 1.8 [list source [file join $dir xml.tcl]] +package ifneeded xotcl::xml::parser 0.94 [list source [file join $dir xoXML.xotcl]] +package ifneeded xotcl::xml::printVisitor 0.9 [list source [file join $dir printVisitor.xotcl]] +package ifneeded xotcl::xml::recreatorVisitor 0.9 [list source [file join $dir xmlRecreatorVisitor.xotcl]] Index: library/xml/printVisitor.xotcl =================================================================== diff -u -N --- library/xml/printVisitor.xotcl (revision 0) +++ library/xml/printVisitor.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,28 @@ +# $Id: printVisitor.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ + +package provide xotcl::xml::printVisitor 0.9 +package require xotcl::xml::parser +package require XOTcl + +namespace eval ::xotcl::xml::printVisitor { + namespace import ::xotcl::* + + ############################################################################## + # + # Small debugging visitor that just uses node's print method to print the + # node tree + # + ############################################################################## + + Class PrintVisitor -superclass NodeTreeVisitor -parameter parser + PrintVisitor instproc visit objName { + puts [$objName print] + } + PrintVisitor instproc interpretNodeTree node { + $node accept [self] + } + + namespace export PrintVisitor +} + +namespace import ::xotcl::xml::printVisitor::* Index: library/xml/sgml.tcl =================================================================== diff -u -N --- library/xml/sgml.tcl (revision 0) +++ library/xml/sgml.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1653 @@ +# sgml.tcl -- +# +# This file provides generic parsing services for SGML-based +# languages, namely HTML and XML. +# +# NB. It is a misnomer. There is no support for parsing +# arbitrary SGML as such. +# +# Copyright (c) 1998,1999 Zveno Pty Ltd +# http://www.zveno.com/ +# +# Zveno makes this software available free of charge for any purpose. +# Copies may be made of this software but all of this notice must be included +# on any copy. +# +# The software was developed for research purposes only and Zveno does not +# warrant that it is error free or fit for any purpose. Zveno disclaims any +# liability for all claims, expenses, losses, damages and costs any user may +# incur as a result of using, copying or modifying this software. +# +# Copyright (c) 1997 ANU and CSIRO on behalf of the +# participants in the CRC for Advanced Computational Systems ('ACSys'). +# +# ACSys makes this software and all associated data and documentation +# ('Software') available free of charge for any purpose. You may make copies +# of the Software but you must include all of this notice on any copy. +# +# The Software was developed for research purposes and ACSys does not warrant +# that it is error free or fit for any purpose. ACSys disclaims any +# liability for all claims, expenses, losses, damages and costs any user may +# incur as a result of using, copying or modifying the Software. +# +# $Id: sgml.tcl,v 1.4 2006/09/27 08:12:40 neumann Exp $ + +package provide sgml 1.6 + +namespace eval sgml { + namespace export tokenise parseEvent + + namespace export parseDTD + + # Convenience routine + proc cl x { + return "\[$x\]" + } + + # Define various regular expressions + # white space + variable Wsp " \t\r\n" + variable noWsp [cl ^$Wsp] + + # Various XML names + variable nmtoken [cl -a-zA-Z0-9._]+ + variable name [cl a-zA-Z_][cl -a-zA-Z0-9._]* + + # Other + variable ParseEventNum + if {![info exists ParseEventNum]} { + set ParseEventNum 0 + } + variable ParseDTDnum + if {![info exists ParseDTDNum]} { + set ParseDTDNum 0 + } + + # table of predefined entities for XML + + variable EntityPredef + array set EntityPredef { + lt < gt > amp & quot \" apos ' + } + +} + +# sgml::tokenise -- +# +# Transform the given HTML/XML text into a Tcl list. +# +# Arguments: +# sgml text to tokenize +# elemExpr RE to recognise tags +# elemSub transform for matched tags +# args options +# +# Valid Options: +# -final boolean True if no more data is to be supplied +# -statevariable varName Name of a variable used to store info +# +# Results: +# Returns a Tcl list representing the document. + +proc sgml::tokenise {sgml elemExpr elemSub args} { + array set options {-final 1} + catch {array set options $args} + set options(-final) [Boolean $options(-final)] + + # If the data is not final then there must be a variable to store + # unused data. + if {!$options(-final) && ![info exists options(-statevariable)]} { + return -code error {option "-statevariable" required if not final} + } + + # Pre-process stage + # + # Extract the internal DTD subset, if any + + catch {upvar #0 $options(-internaldtdvariable) dtd} + if {[regexp {]*$)} [lindex $sgml end] x text unused]} { + set sgml [lreplace $sgml end end $text] + } + + } else { + + # Performance note (Tcl 8.0): + # In this case, no conversion to list object is performed + + regsub -all $elemExpr $sgml $elemSub sgml + set sgml "{} {} {} {} \{$sgml\}" + } + + return $sgml + +} + +# sgml::parseEvent -- +# +# Produces an event stream for a XML/HTML document, +# given the Tcl list format returned by tokenise. +# +# This procedure checks that the document is well-formed, +# and throws an error if the document is found to be not +# well formed. Warnings are passed via the -warningcommand script. +# +# The procedure only check for well-formedness, +# no DTD is required. However, facilities are provided for entity expansion. +# +# Arguments: +# sgml Instance data, as a Tcl list. +# args option/value pairs +# +# Valid Options: +# -final Indicates end of document data +# -elementstartcommand Called when an element starts +# -elementendcommand Called when an element ends +# -characterdatacommand Called when character data occurs +# -entityreferencecommand Called when an entity reference occurs +# -processinginstructioncommand Called when a PI occurs +# -externalentityrefcommand Called for an external entity reference +# +# (Not compatible with expat) +# -xmldeclcommand Called when the XML declaration occurs +# -doctypecommand Called when the document type declaration occurs +# -commentcommand Called when a comment occurs +# +# -errorcommand Script to evaluate for a fatal error +# -warningcommand Script to evaluate for a reportable warning +# -statevariable global state variable +# -normalize whether to normalize names +# -reportempty whether to include an indication of empty elements +# +# Results: +# The various callback scripts are invoked. +# Returns empty string. +# +# BUGS: +# If command options are set to empty string then they should not be invoked. + +proc sgml::parseEvent {sgml args} { + variable Wsp + variable noWsp + variable nmtoken + variable name + variable ParseEventNum + + array set options [list \ + -elementstartcommand [namespace current]::noop \ + -elementendcommand [namespace current]::noop \ + -characterdatacommand [namespace current]::noop \ + -processinginstructioncommand [namespace current]::noop \ + -externalentityrefcommand [namespace current]::noop \ + -xmldeclcommand [namespace current]::noop \ + -doctypecommand [namespace current]::noop \ + -commentcommand [namespace current]::noop \ + -entityreferencecommand {} \ + -warningcommand [namespace current]::noop \ + -errorcommand [namespace current]::Error \ + -final 1 \ + -emptyelement [namespace current]::EmptyElement \ + -parseattributelistcommand [namespace current]::noop \ + -normalize 1 \ + -internaldtd {} \ + -reportempty 0 \ + -entityvariable [namespace current]::EntityPredef \ + ] + catch {array set options $args} + + if {![info exists options(-statevariable)]} { + set options(-statevariable) [namespace current]::ParseEvent[incr ParseEventNum] + } + + upvar #0 $options(-statevariable) state + upvar #0 $options(-entityvariable) entities + + if {![info exists state]} { + # Initialise the state variable + array set state { + mode normal + haveXMLDecl 0 + haveDocElement 0 + context {} + stack {} + line 0 + } + } + + foreach {tag close empty param text} $sgml { + + # Keep track of lines in the input + incr state(line) [regsub -all \n $param {} discard] + incr state(line) [regsub -all \n $text {} discard] + + # If the current mode is cdata or comment then we must undo what the + # regsub has done to reconstitute the data + + switch $state(mode) { + comment { + # This had "[string length $param] && " as a guard - + # can't remember why :-( + if {[regexp ([cl ^-]*)--\$ $tag discard comm1]} { + # end of comment (in tag) + set tag {} + set close {} + set empty {} + set state(mode) normal + uplevel #0 $options(-commentcommand) [list $state(commentdata)<$comm1] + unset state(commentdata) + } elseif {[regexp ([cl ^-]*)--\$ $param discard comm1]} { + # end of comment (in attributes) + uplevel #0 $options(-commentcommand) [list $state(commentdata)<$close$tag$empty>$comm1] + unset state(commentdata) + set tag {} + set param {} + set close {} + set empty {} + set state(mode) normal + } elseif {[regexp ([cl ^-]*)-->(.*) $text discard comm1 text]} { + # end of comment (in text) + uplevel #0 $options(-commentcommand) [list $state(commentdata)<$close$tag$param$empty>$comm1] + unset state(commentdata) + set tag {} + set param {} + set close {} + set empty {} + set state(mode) normal + } else { + # comment continues + append state(commentdata) <$close$tag$param$empty>$text + continue + } + } + cdata { + if {[string length $param] && [regexp ([cl ^\]]*)\]\][cl $Wsp]*\$ $tag discard cdata1]} { + # end of CDATA (in tag) + uplevel #0 $options(-characterdatacommand) [list $state(cdata)<$close$cdata1$text] + set text {} + set tag {} + unset state(cdata) + set state(mode) normal + } elseif {[regexp ([cl ^\]]*)\]\][cl $Wsp]*\$ $param discard cdata1]} { + # end of CDATA (in attributes) + uplevel #0 $options(-characterdatacommand) [list $state(cdata)<$close$tag$cdata1$text] + set text {} + set tag {} + set param {} + unset state(cdata) + set state(mode) normal + } elseif {[regexp ([cl ^\]]*)\]\][cl $Wsp]*>(.*) $text discard cdata1 text]} { + # end of CDATA (in text) + uplevel #0 $options(-characterdatacommand) [list $state(cdata)<$close$tag$param$empty>$cdata1$text] + set text {} + set tag {} + set param {} + set close {} + set empty {} + unset state(cdata) + set state(mode) normal + } else { + # CDATA continues + append state(cdata) <$close$tag$param$empty>$text + continue + } + } + } + + # default: normal mode + + # Bug: if the attribute list has a right angle bracket then the empty + # element marker will not be seen + + set isEmpty [uplevel #0 $options(-emptyelement) [list $tag $param $empty]] + if {[llength $isEmpty]} { + foreach {empty tag param} $isEmpty break + } + + switch -glob -- [string length $tag],[regexp {^\?|!.*} $tag],$close,$empty { + + 0,0,, { + # Ignore empty tag - dealt with non-normal mode above + } + *,0,, { + + # Start tag for an element. + + # Check for a right angle bracket in an attribute value + # This manifests itself by terminating the value before + # the delimiter is seen, and the delimiter appearing + # in the text + + # BUG: If two or more attribute values have right angle + # brackets then this will fail on the second one. + + if {[regexp [format {=[%s]*"[^"]*$} $Wsp] $param] && \ + [regexp {([^"]*"[^>]*)>(.*)} $text discard attrListRemainder text]} { + append param >$attrListRemainder + } elseif {[regexp [format {=[%s]*'[^']*$} $Wsp] $param] && \ + [regexp {([^']*'[^>]*)>(.*)} $text discard attrListRemainder text]} { + append param >$attrListRemainder + } + + # Check if the internal DTD entity is in an attribute + # value + regsub -all &xml:intdtd\; $param \[$options(-internaldtd)\] param + + ParseEvent:ElementOpen $tag $param options + set state(haveDocElement) 1 + + } + + *,0,/, { + + # End tag for an element. + + ParseEvent:ElementClose $tag options + + } + + *,0,,/ { + + # Empty element + + ParseEvent:ElementOpen $tag $param options -empty 1 + ParseEvent:ElementClose $tag options -empty 1 + + } + + *,1,* { + # Processing instructions or XML declaration + switch -glob -- $tag { + + {\?xml} { + # XML Declaration + if {$state(haveXMLDecl)} { + uplevel #0 $options(-errorcommand) "unexpected characters \"<$tag\" around line $state(line)" + } elseif {![regexp {\?$} $param]} { + uplevel #0 $options(-errorcommand) "XML Declaration missing characters \"?>\" around line $state(line)" + } else { + + # Get the version number + if {[regexp {[ ]*version="(-+|[a-zA-Z0-9_.:]+)"[ ]*} $param discard version] || [regexp {[ ]*version='(-+|[a-zA-Z0-9_.:]+)'[ ]*} $param discard version]} { + if {$version ne "1.0" } { + # Should we support future versions? + # At least 1.X? + uplevel #0 $options(-errorcommand) "document XML version \"$version\" is incompatible with XML version 1.0" + } + } else { + uplevel #0 $options(-errorcommand) "XML Declaration missing version information around line $state(line)" + } + + # Get the encoding declaration + set encoding {} + regexp {[ ]*encoding="([A-Za-z]([A-Za-z0-9._]|-)*)"[ ]*} $param discard encoding + regexp {[ ]*encoding='([A-Za-z]([A-Za-z0-9._]|-)*)'[ ]*} $param discard encoding + + # Get the standalone declaration + set standalone {} + regexp {[ ]*standalone="(yes|no)"[ ]*} $param discard standalone + regexp {[ ]*standalone='(yes|no)'[ ]*} $param discard standalone + + # Invoke the callback + uplevel #0 $options(-xmldeclcommand) [list $version $encoding $standalone] + + } + + } + + {\?*} { + # Processing instruction + if {![regsub {\?$} $param {} param]} { + uplevel #0 $options(-errorcommand) "PI: expected '?' character around line $state(line)" + } else { + uplevel #0 $options(-processinginstructioncommand) [list [string range $tag 1 end] [string trimleft $param]] + } + } + + !DOCTYPE { + # External entity reference + # This should move into xml.tcl + # Parse the params supplied. Looking for Name, ExternalID and MarkupDecl + regexp ^[cl $Wsp]*($name)(.*) $param x state(doc_name) param + set state(doc_name) [Normalize $state(doc_name) $options(-normalize)] + set externalID {} + set pubidlit {} + set systemlit {} + set externalID {} + if {[regexp -nocase ^[cl $Wsp]*(SYSTEM|PUBLIC)(.*) $param x id param]} { + switch [string toupper $id] { + SYSTEM { + if {[regexp ^[cl $Wsp]+"([cl ^"]*)"(.*) $param x systemlit param] || [regexp ^[cl $Wsp]+'([cl ^']*)'(.*) $param x systemlit param]} { + set externalID [list SYSTEM $systemlit] ;# " + } else { + uplevel #0 $options(-errorcommand) {{syntax error: SYSTEM identifier not followed by literal}} + } + } + PUBLIC { + if {[regexp ^[cl $Wsp]+"([cl ^"]*)"(.*) $param x pubidlit param] || [regexp ^[cl $Wsp]+'([cl ^']*)'(.*) $param x pubidlit param]} { + if {[regexp ^[cl $Wsp]+"([cl ^"]*)"(.*) $param x systemlit param] || [regexp ^[cl $Wsp]+'([cl ^']*)'(.*) $param x systemlit param]} { + set externalID [list PUBLIC $pubidlit $systemlit] + } else { + uplevel #0 $options(-errorcommand) "syntax error: PUBLIC identifier not followed by system literal around line $state(line)" + } + } else { + uplevel #0 $options(-errorcommand) "syntax error: PUBLIC identifier not followed by literal around line $state(line)" + } + } + } + if {[regexp -nocase ^[cl $Wsp]+NDATA[cl $Wsp]+($name)(.*) $param x notation param]} { + lappend externalID $notation + } + } + + uplevel #0 $options(-doctypecommand) $state(doc_name) [list $pubidlit $systemlit $options(-internaldtd)] + + } + + !--* { + + # Start of a comment + # See if it ends in the same tag, otherwise change the + # parsing mode + + regexp {!--(.*)} $tag discard comm1 + if {[regexp ([cl ^-]*)--[cl $Wsp]*\$ $comm1 discard comm1_1]} { + # processed comment (end in tag) + uplevel #0 $options(-commentcommand) [list $comm1_1] + } elseif {[regexp ([cl ^-]*)--[cl $Wsp]*\$ $param discard comm2]} { + # processed comment (end in attributes) + uplevel #0 $options(-commentcommand) [list $comm1$comm2] + } elseif {[regexp ([cl ^-]*)-->(.*) $text discard comm2 text]} { + # processed comment (end in text) + uplevel #0 $options(-commentcommand) [list $comm1$param>$comm2] + } else { + # start of comment + set state(mode) comment + set state(commentdata) "$comm1$param>$text" + continue + } + } + + {!\[CDATA\[*} { + + regexp {!\[CDATA\[(.*)} $tag discard cdata1 + if {[regexp {(.*)]]$} $param discard cdata2]} { + # processed CDATA (end in attribute) + uplevel #0 $options(-characterdatacommand) [list $cdata1$cdata2$text] + set text {} + } elseif {[regexp {(.*)]]>(.*)} $text discard cdata2 text]} { + # processed CDATA (end in text) + uplevel #0 $options(-characterdatacommand) [list $cdata1$param$empty>$cdata2$text] + set text {} + } else { + # start CDATA + set state(cdata) "$cdata1$param>$text" + set state(mode) cdata + continue + } + + } + + !ELEMENT { + # Internal DTD declaration + } + !ATTLIST { + } + !ENTITY { + } + !NOTATION { + } + + + !* { + uplevel #0 $options(-processinginstructioncommand) [list $tag $param] + } + default { + uplevel #0 $options(-errorcommand) [list "unknown processing instruction \"<$tag>\" around line $state(line)"] + } + } + } + *,1,* - + *,0,/,/ { + # Syntax error + uplevel #0 $options(-errorcommand) [list [list syntax error: closed/empty tag: tag $tag param $param empty $empty close $close around line $state(line)]] + } + } + + # Process character data + + if {$state(haveDocElement) && [llength $state(stack)]} { + + # Check if the internal DTD entity is in the text + regsub -all &xml:intdtd\; $text \[$options(-internaldtd)\] text + + # Look for entity references + if {([array size entities] || [string length $options(-entityreferencecommand)]) && \ + [regexp {&[^;]+;} $text]} { + + # protect Tcl specials + regsub -all {([][$\\])} $text {\\\1} text + # Mark entity references + regsub -all {&([^;]+);} $text [format {%s; %s {\1} ; %s %s} \}\} [namespace code [list Entity options $options(-entityreferencecommand) $options(-characterdatacommand) $options(-entityvariable)]] [list uplevel #0 $options(-characterdatacommand)] \{\{] text + set text "uplevel #0 $options(-characterdatacommand) {{$text}}" + eval $text + } else { + # Restore protected special characters + regsub -all {\\([{}\\])} $text {\1} text + uplevel #0 $options(-characterdatacommand) [list $text] + } + } elseif {[string length [string trim $text]]} { + uplevel #0 $options(-errorcommand) "unexpected text \"$text\" in document prolog around line $state(line)" + } + + } + + # If this is the end of the document, close all open containers + if {$options(-final) && [llength $state(stack)]} { + eval $options(-errorcommand) [list [list element [lindex $state(stack) end] remains unclosed around line $state(line)]] + } + + return {} +} + +# sgml::ParseEvent:ElementOpen -- +# +# Start of an element. +# +# Arguments: +# tag Element name +# attr Attribute list +# opts Option variable in caller +# args further configuration options +# +# Options: +# -empty boolean +# indicates whether the element was an empty element +# +# Results: +# Modify state and invoke callback + +proc sgml::ParseEvent:ElementOpen {tag attr opts args} { + upvar $opts options + upvar #0 $options(-statevariable) state + array set cfg {-empty 0} + array set cfg $args + + if {$options(-normalize)} { + set tag [string toupper $tag] + } + + # Update state + lappend state(stack) $tag + + # Parse attribute list into a key-value representation + if {[string compare $options(-parseattributelistcommand) {}]} { + if {[catch {uplevel #0 $options(-parseattributelistcommand) [list $attr]} attr]} { + uplevel #0 $options(-errorcommand) [list $attr around line $state(line)] + set attr {} + } + } + + set empty {} + if {$cfg(-empty) && $options(-reportempty)} { + set empty {-empty 1} + } + + # Invoke callback + uplevel #0 $options(-elementstartcommand) [list $tag $attr] $empty + + return {} +} + +# sgml::ParseEvent:ElementClose -- +# +# End of an element. +# +# Arguments: +# tag Element name +# opts Option variable in caller +# args further configuration options +# +# Options: +# -empty boolean +# indicates whether the element as an empty element +# +# Results: +# Modify state and invoke callback + +proc sgml::ParseEvent:ElementClose {tag opts args} { + upvar $opts options + upvar #0 $options(-statevariable) state + array set cfg {-empty 0} + array set cfg $args + + # WF check + if {$tag ne [lindex $state(stack) end] } { + uplevel #0 $options(-errorcommand) [list "end tag \"$tag\" does not match open element \"[lindex $state(stack) end]\" around line $state(line)"] + return + } + + # Update state + set state(stack) [lreplace $state(stack) end end] + + set empty {} + if {$cfg(-empty) && $options(-reportempty)} { + set empty {-empty 1} + } + + # Invoke callback + uplevel #0 $options(-elementendcommand) [list $tag] $empty + + return {} +} + +# sgml::Normalize -- +# +# Perform name normalization if required +# +# Arguments: +# name name to normalize +# req normalization required +# +# Results: +# Name returned as upper-case if normalization required + +proc sgml::Normalize {name req} { + if {$req} { + return [string toupper $name] + } else { + return $name + } +} + +# sgml::Entity -- +# +# Resolve XML entity references (syntax: &xxx;). +# +# Arguments: +# opts options array variable in caller +# entityrefcmd application callback for entity references +# pcdatacmd application callback for character data +# entities name of array containing entity definitions. +# ref entity reference (the "xxx" bit) +# +# Results: +# Returns substitution text for given entity. + +proc sgml::Entity {opts entityrefcmd pcdatacmd entities ref} { + upvar 2 $opts options + upvar #0 $options(-statevariable) state + + if {![string length $entities]} { + set entities [namespace current EntityPredef] + } + + switch -glob -- $ref { + %* { + # Parameter entity - not recognised outside of a DTD + } + #x* { + # Character entity - hex + if {[catch {format %c [scan [string range $ref 2 end] %x tmp; set tmp]} char]} { + return -code error "malformed character entity \"$ref\"" + } + uplevel #0 $pcdatacmd [list $char] + + return {} + + } + #* { + # Character entity - decimal + if {[catch {format %c [scan [string range $ref 1 end] %d tmp; set tmp]} char]} { + return -code error "malformed character entity \"$ref\"" + } + uplevel #0 $pcdatacmd [list $char] + + return {} + + } + default { + # General entity + upvar #0 $entities map + if {[info exists map($ref)]} { + + if {![regexp {<|&} $map($ref)]} { + + # Simple text replacement - optimise + + uplevel #0 $pcdatacmd [list $map($ref)] + + return {} + + } + + # Otherwise an additional round of parsing is required. + # This only applies to XML, since HTML doesn't have general entities + + # Must parse the replacement text for start & end tags, etc + # This text must be self-contained: balanced closing tags, and so on + + set tokenised [tokenise $map($ref) $::xml::tokExpr $::xml::substExpr] + set final $options(-final) + unset options(-final) + eval parseEvent [list $tokenised] [array get options] -final 0 + set options(-final) $final + + return {} + + } elseif {[string length $entityrefcmd]} { + + uplevel #0 $entityrefcmd [list $ref] + + return {} + + } + } + } + + # If all else fails leave the entity reference untouched + uplevel #0 $pcdatacmd [list &$ref\;] + + return {} +} + +#################################### +# +# DTD parser for SGML (XML). +# +# This DTD actually only handles XML DTDs. Other language's +# DTD's, such as HTML, must be written in terms of a XML DTD. +# +# A DTD is represented as a three element Tcl list. +# The first element contains the content models for elements, +# the second contains the attribute lists for elements and +# the last element contains the entities for the document. +# +#################################### + +# sgml::parseDTD -- +# +# Entry point to the SGML DTD parser. +# +# Arguments: +# dtd data defining the DTD to be parsed +# args configuration options +# +# Results: +# Returns a three element list, first element is the content model +# for each element, second element are the attribute lists of the +# elements and the third element is the entity map. + +proc sgml::parseDTD {dtd args} { + variable Wsp + variable ParseDTDnum + + array set opts [list \ + -errorcommand [namespace current]::noop \ + state [namespace current]::parseDTD[incr ParseDTDnum] + ] + array set opts $args + + set exp ]+)[cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^>]*)> + set sub {{\1} {\2} {\3} } + regsub -all $exp $dtd $sub dtd + + foreach {decl id value} $dtd { + catch {DTD:[string toupper $decl] $id $value} err + } + + return [list [array get contentmodel] [array get attributes] [array get entities]] +} + +# Procedures for handling the various declarative elements in a DTD. +# New elements may be added by creating a procedure of the form +# parse:DTD:_element_ + +# For each of these procedures, the various regular expressions they use +# are created outside of the proc to avoid overhead at runtime + +# sgml::DTD:ELEMENT -- +# +# defines an element. +# +# The content model for the element is stored in the contentmodel array, +# indexed by the element name. The content model is parsed into the +# following list form: +# +# {} Content model is EMPTY. +# Indicated by an empty list. +# * Content model is ANY. +# Indicated by an asterix. +# {ELEMENT ...} +# Content model is element-only. +# {MIXED {element1 element2 ...}} +# Content model is mixed (PCDATA and elements). +# The second element of the list contains the +# elements that may occur. #PCDATA is assumed +# (ie. the list is normalised). +# +# Arguments: +# id identifier for the element. +# value other information in the PI + +proc sgml::DTD:ELEMENT {id value} { + dbgputs DTD_parse [list DTD:ELEMENT $id $value] + variable Wsp + upvar opts state + upvar contentmodel cm + + if {[info exists cm($id)]} { + eval $state(-errorcommand) element [list "element \"$id\" already declared"] + } else { + switch -- $value { + EMPTY { + set cm($id) {} + } + ANY { + set cm($id) * + } + default { + if {[regexp [format {^\([%s]*#PCDATA[%s]*(\|([^)]+))?[%s]*\)*[%s]*$} $Wsp $Wsp $Wsp $Wsp] discard discard mtoks]} { + set cm($id) [list MIXED [split $mtoks |]] + } else { + if {[catch {CModelParse $state(state) $value} result]} { + eval $state(-errorcommand) element [list $result] + } else { + set cm($id) [list ELEMENT $result] + } + } + } + } + } +} + +# sgml::CModelParse -- +# +# Parse an element content model (non-mixed). +# A syntax tree is constructed. +# A transition table is built next. +# +# This is going to need alot of work! +# +# Arguments: +# state state array variable +# value the content model data +# +# Results: +# A Tcl list representing the content model. + +proc sgml::CModelParse {state value} { + upvar #0 $state var + + # First build syntax tree + set syntaxTree [CModelMakeSyntaxTree $state $value] + + # Build transition table + set transitionTable [CModelMakeTransitionTable $state $syntaxTree] + + return [list $syntaxTree $transitionTable] +} + +# sgml::CModelMakeSyntaxTree -- +# +# Construct a syntax tree for the regular expression. +# +# Syntax tree is represented as a Tcl list: +# rep {:choice|:seq {{rep list1} {rep list2} ...}} +# where: rep is repetition character, *, + or ?. {} for no repetition +# listN is nested expression or Name +# +# Arguments: +# spec Element specification +# +# Results: +# Syntax tree for element spec as nested Tcl list. +# +# Examples: +# (memo) +# {} {:seq {{} memo}} +# (front, body, back?) +# {} {:seq {{} front} {{} body} {? back}} +# (head, (p | list | note)*, div2*) +# {} {:seq {{} head} {* {:choice {{} p} {{} list} {{} note}}} {* div2}} +# (p | a | ul)+ +# + {:choice {{} p} {{} a} {{} ul}} + +proc sgml::CModelMakeSyntaxTree {state spec} { + upvar #0 $state var + variable Wsp + variable name + + # Translate the spec into a Tcl list. + + # None of the Tcl special characters are allowed in a content model spec. + if {[regexp {\$|\[|\]|\{|\}} $spec]} { + return -code error "illegal characters in specification" + } + + regsub -all [format {(%s)[%s]*(\?|\*|\+)?[%s]*(,|\|)?} $name $Wsp $Wsp] $spec [format {%sCModelSTname %s {\1} {\2} {\3}} \n $state] spec + regsub -all {\(} $spec "\nCModelSTopenParen $state " spec + regsub -all [format {\)[%s]*(\?|\*|\+)?[%s]*(,|\|)?} $Wsp $Wsp] $spec [format {%sCModelSTcloseParen %s {\1} {\2}} \n $state] spec + + array set var {stack {} state start} + eval $spec + + # Peel off the outer seq, its redundant + return [lindex [lindex $var(stack) 1] 0] +} + +# sgml::CModelSTname -- +# +# Processes a name in a content model spec. +# +# Arguments: +# state state array variable +# name name specified +# rep repetition operator +# cs choice or sequence delimiter +# +# Results: +# See CModelSTcp. + +proc sgml::CModelSTname {state name rep cs args} { + if {[llength $args]} { + return -code error "syntax error in specification: \"$args\"" + } + + CModelSTcp $state $name $rep $cs +} + +# sgml::CModelSTcp -- +# +# Process a content particle. +# +# Arguments: +# state state array variable +# name name specified +# rep repetition operator +# cs choice or sequence delimiter +# +# Results: +# The content particle is added to the current group. + +proc sgml::CModelSTcp {state cp rep cs} { + upvar #0 $state var + + switch -glob -- [lindex $var(state) end]=$cs { + start= { + set var(state) [lreplace $var(state) end end end] + # Add (dummy) grouping, either choice or sequence will do + CModelSTcsSet $state , + CModelSTcpAdd $state $cp $rep + } + :choice= - + :seq= { + set var(state) [lreplace $var(state) end end end] + CModelSTcpAdd $state $cp $rep + } + start=| - + start=, { + set var(state) [lreplace $var(state) end end [expr {$cs eq "," ? ":seq" : ":choice"}]] + CModelSTcsSet $state $cs + CModelSTcpAdd $state $cp $rep + } + :choice=| - + :seq=, { + CModelSTcpAdd $state $cp $rep + } + :choice=, - + :seq=| { + return -code error "syntax error in specification: incorrect delimiter after \"$cp\", should be \"[expr {$cs eq "," ? "|" : ","}]\"" + } + end=* { + return -code error "syntax error in specification: no delimiter before \"$cp\"" + } + default { + return -code error "syntax error" + } + } + +} + +# sgml::CModelSTcsSet -- +# +# Start a choice or sequence on the stack. +# +# Arguments: +# state state array +# cs choice oir sequence +# +# Results: +# state is modified: end element of state is appended. + +proc sgml::CModelSTcsSet {state cs} { + upvar #0 $state var + + set cs [expr {$cs eq "," ? ":seq" : ":choice"}] + + if {[llength $var(stack)]} { + set var(stack) [lreplace $var(stack) end end $cs] + } else { + set var(stack) [list $cs {}] + } +} + +# sgml::CModelSTcpAdd -- +# +# Append a content particle to the top of the stack. +# +# Arguments: +# state state array +# cp content particle +# rep repetition +# +# Results: +# state is modified: end element of state is appended. + +proc sgml::CModelSTcpAdd {state cp rep} { + upvar #0 $state var + + if {[llength $var(stack)]} { + set top [lindex $var(stack) end] + lappend top [list $rep $cp] + set var(stack) [lreplace $var(stack) end end $top] + } else { + set var(stack) [list $rep $cp] + } +} + +# sgml::CModelSTopenParen -- +# +# Processes a '(' in a content model spec. +# +# Arguments: +# state state array +# +# Results: +# Pushes stack in state array. + +proc sgml::CModelSTopenParen {state args} { + upvar #0 $state var + + if {[llength $args]} { + return -code error "syntax error in specification: \"$args\"" + } + + lappend var(state) start + lappend var(stack) [list {} {}] +} + +# sgml::CModelSTcloseParen -- +# +# Processes a ')' in a content model spec. +# +# Arguments: +# state state array +# rep repetition +# cs choice or sequence delimiter +# +# Results: +# Stack is popped, and former top of stack is appended to previous element. + +proc sgml::CModelSTcloseParen {state rep cs args} { + upvar #0 $state var + + if {[llength $args]} { + return -code error "syntax error in specification: \"$args\"" + } + + set cp [lindex $var(stack) end] + set var(stack) [lreplace $var(stack) end end] + set var(state) [lreplace $var(state) end end] + CModelSTcp $state $cp $rep $cs +} + +# sgml::CModelMakeTransitionTable -- +# +# Given a content model's syntax tree, constructs +# the transition table for the regular expression. +# +# See "Compilers, Principles, Techniques, and Tools", +# Aho, Sethi and Ullman. Section 3.9, algorithm 3.5. +# +# Arguments: +# state state array variable +# st syntax tree +# +# Results: +# The transition table is returned, as a key/value Tcl list. + +proc sgml::CModelMakeTransitionTable {state st} { + upvar #0 $state var + + # Construct nullable, firstpos and lastpos functions + array set var {number 0} + foreach {nullable firstpos lastpos} [ \ + TraverseDepth1st $state $st { + # Evaluated for leaf nodes + # Compute nullable(n) + # Compute firstpos(n) + # Compute lastpos(n) + set nullable [nullable leaf $rep $name] + set firstpos [list {} $var(number)] + set lastpos [list {} $var(number)] + set var(pos:$var(number)) $name + } { + # Evaluated for nonterminal nodes + # Compute nullable, firstpos, lastpos + set firstpos [firstpos $cs $firstpos $nullable] + set lastpos [lastpos $cs $lastpos $nullable] + set nullable [nullable nonterm $rep $cs $nullable] + } \ + ] break + + set accepting [incr var(number)] + set var(pos:$accepting) # + + # var(pos:N) maps from position to symbol. + # Construct reverse map for convenience. + # NB. A symbol may appear in more than one position. + # var is about to be reset, so use different arrays. + + foreach {pos symbol} [array get var pos:*] { + set pos [lindex [split $pos :] 1] + set pos2symbol($pos) $symbol + lappend sym2pos($symbol) $pos + } + + # Construct the followpos functions + catch {unset var} + followpos $state $st $firstpos $lastpos + + # Construct transition table + # Dstates is [union $marked $unmarked] + set unmarked [list [lindex $firstpos 1]] + while {[llength $unmarked]} { + set T [lindex $unmarked 0] + lappend marked $T + set unmarked [lrange $unmarked 1 end] + + # Find which input symbols occur in T + set symbols {} + foreach pos $T { + if {$pos != $accepting && [lsearch $symbols $pos2symbol($pos)] < 0} { + lappend symbols $pos2symbol($pos) + } + } + foreach a $symbols { + set U {} + foreach pos $sym2pos($a) { + if {[lsearch $T $pos] >= 0} { + # add followpos($pos) + if {$var($pos) == {}} { + lappend U $accepting + } else { + eval lappend U $var($pos) + } + } + } + set U [makeSet $U] + if {[llength $U] && [lsearch $marked $U] < 0 && [lsearch $unmarked $U] < 0} { + lappend unmarked $U + } + set Dtran($T,$a) $U + } + + } + + return [list [array get Dtran] [array get sym2pos] $accepting] +} + +# sgml::followpos -- +# +# Compute the followpos function, using the already computed +# firstpos and lastpos. +# +# Arguments: +# state array variable to store followpos functions +# st syntax tree +# firstpos firstpos functions for the syntax tree +# lastpos lastpos functions +# +# Results: +# followpos functions for each leaf node, in name/value format + +proc sgml::followpos {state st firstpos lastpos} { + upvar #0 $state var + + switch -- [lindex [lindex $st 1] 0] { + :seq { + for {set i 1} {$i < [llength [lindex $st 1]]} {incr i} { + followpos $state [lindex [lindex $st 1] $i] \ + [lindex [lindex $firstpos 0] [expr {$i - 1}]] \ + [lindex [lindex $lastpos 0] [expr {$i - 1}]] + foreach pos [lindex [lindex [lindex $lastpos 0] [expr {$i - 1}]] 1] { + eval lappend var($pos) [lindex [lindex [lindex $firstpos 0] $i] 1] + set var($pos) [makeSet $var($pos)] + } + } + } + :choice { + for {set i 1} {$i < [llength [lindex $st 1]]} {incr i} { + followpos $state [lindex [lindex $st 1] $i] \ + [lindex [lindex $firstpos 0] [expr {$i - 1}]] \ + [lindex [lindex $lastpos 0] [expr {$i - 1}]] + } + } + default { + # No action at leaf nodes + } + } + + switch -- [lindex $st 0] { + ? { + # We having nothing to do here ! Doing the same as + # for * effectively converts this qualifier into the other. + } + * { + foreach pos [lindex $lastpos 1] { + eval lappend var($pos) [lindex $firstpos 1] + set var($pos) [makeSet $var($pos)] + } + } + } + +} + +# sgml::TraverseDepth1st -- +# +# Perform depth-first traversal of a tree. +# A new tree is constructed, with each node computed by f. +# +# Arguments: +# state state array variable +# t The tree to traverse, a Tcl list +# leaf Evaluated at a leaf node +# nonTerm Evaluated at a nonterminal node +# +# Results: +# A new tree is returned. + +proc sgml::TraverseDepth1st {state t leaf nonTerm} { + upvar #0 $state var + + set nullable {} + set firstpos {} + set lastpos {} + + switch -- [lindex [lindex $t 1] 0] { + :seq - + :choice { + set rep [lindex $t 0] + set cs [lindex [lindex $t 1] 0] + + foreach child [lrange [lindex $t 1] 1 end] { + foreach {childNullable childFirstpos childLastpos} \ + [TraverseDepth1st $state $child $leaf $nonTerm] break + lappend nullable $childNullable + lappend firstpos $childFirstpos + lappend lastpos $childLastpos + } + + eval $nonTerm + } + default { + incr var(number) + set rep [lindex [lindex $t 0] 0] + set name [lindex [lindex $t 1] 0] + eval $leaf + } + } + + return [list $nullable $firstpos $lastpos] +} + +# sgml::firstpos -- +# +# Computes the firstpos function for a nonterminal node. +# +# Arguments: +# cs node type, choice or sequence +# firstpos firstpos functions for the subtree +# nullable nullable functions for the subtree +# +# Results: +# firstpos function for this node is returned. + +proc sgml::firstpos {cs firstpos nullable} { + switch -- $cs { + :seq { + set result [lindex [lindex $firstpos 0] 1] + for {set i 0} {$i < [llength $nullable]} {incr i} { + if {[lindex [lindex $nullable $i] 1]} { + eval lappend result [lindex [lindex $firstpos [expr {$i + 1}]] 1] + } else { + break + } + } + } + :choice { + foreach child $firstpos { + eval lappend result $child + } + } + } + + return [list $firstpos [makeSet $result]] +} + +# sgml::lastpos -- +# +# Computes the lastpos function for a nonterminal node. +# Same as firstpos, only logic is reversed +# +# Arguments: +# cs node type, choice or sequence +# lastpos lastpos functions for the subtree +# nullable nullable functions forthe subtree +# +# Results: +# lastpos function for this node is returned. + +proc sgml::lastpos {cs lastpos nullable} { + switch -- $cs { + :seq { + set result [lindex [lindex $lastpos end] 1] + for {set i [expr {[llength $nullable] - 1}]} {$i >= 0} {incr i -1} { + if {[lindex [lindex $nullable $i] 1]} { + eval lappend result [lindex [lindex $lastpos $i] 1] + } else { + break + } + } + } + :choice { + foreach child $lastpos { + eval lappend result $child + } + } + } + + return [list $lastpos [makeSet $result]] +} + +# sgml::makeSet -- +# +# Turn a list into a set, ie. remove duplicates. +# +# Arguments: +# s a list +# +# Results: +# A set is returned, which is a list with duplicates removed. + +proc sgml::makeSet s { + foreach r $s { + if {[llength $r]} { + set unique($r) {} + } + } + return [array names unique] +} + +# sgml::nullable -- +# +# Compute the nullable function for a node. +# +# Arguments: +# nodeType leaf or nonterminal +# rep repetition applying to this node +# name leaf node: symbol for this node, nonterm node: choice or seq node +# subtree nonterm node: nullable functions for the subtree +# +# Results: +# Returns nullable function for this branch of the tree. + +proc sgml::nullable {nodeType rep name {subtree {}}} { + switch -glob -- $rep:$nodeType { + :leaf - + +:leaf { + return [list {} 0] + } + \\*:leaf - + \\?:leaf { + return [list {} 1] + } + \\*:nonterm - + \\?:nonterm { + return [list $subtree 1] + } + :nonterm - + +:nonterm { + switch -- $name { + :choice { + set result 0 + foreach child $subtree { + set result [expr {$result || [lindex $child 1]}] + } + } + :seq { + set result 1 + foreach child $subtree { + set result [expr {$result && [lindex $child 1]}] + } + } + } + return [list $subtree $result] + } + } +} + +# These regular expressions are defined here once for better performance + +namespace eval sgml { + variable Wsp + + # Watch out for case-sensitivity + + set attlist_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*(#REQUIRED|#IMPLIED) + set attlist_enum_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*\\(([cl ^)]*)\\)[cl $Wsp]*("([cl ^")])")? ;# " + set attlist_fixed_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*(#FIXED)[cl $Wsp]*([cl ^$Wsp]+) + + set param_entity_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^"$Wsp]*)[cl $Wsp]*"([cl ^"]*)" + + set notation_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*(.*) + +} + +# sgml::DTD:ATTLIST -- +# +# defines an attribute list. +# +# Arguments: +# id Element an attribute list is being defined for. +# value data from the PI. +# +# Results: +# Attribute list variables are modified. + +proc sgml::DTD:ATTLIST {id value} { + variable attlist_exp + variable attlist_enum_exp + variable attlist_fixed_exp + dbgputs DTD_parse [list DTD:ATTLIST $id $value] + upvar opts state + upvar attributes am + + if {[info exists am($id)]} { + eval $state(-errorcommand) attlist [list "attribute list for element \"$id\" already declared"] + } else { + # Parse the attribute list. If it were regular, could just use foreach, + # but some attributes may have values. + regsub -all {([][$\\])} $value {\\\1} value + regsub -all $attlist_exp $value {[DTDAttribute {\1} {\2} {\3}]} value + regsub -all $attlist_enum_exp $value {[DTDAttribute {\1} {\2} {\3}]} value + regsub -all $attlist_fixed_exp $value {[DTDAttribute {\1} {\2} {\3} {\4}]} value + subst $value + set am($id) [array get attlist] + } +} + +# sgml::DTDAttribute -- +# +# Parse definition of a single attribute. +# +# Arguments: +# name attribute name +# type type of this attribute +# default default value of the attribute +# value other information + +proc sgml::DTDAttribute {name type default {value {}}} { + upvar attlist al + # This needs further work + set al($name) [list $default $value] +} + +# sgml::DTD:ENTITY -- +# +# PI +# +# Arguments: +# id identifier for the entity +# value data +# +# Results: +# Modifies the caller's entities array variable + +proc sgml::DTD:ENTITY {id value} { + variable param_entity_exp + dbgputs DTD_parse [list DTD:ENTITY $id $value] + upvar opts state + upvar entities ents + + if {"%" ne $id } { + # Entity declaration + if {[info exists ents($id)]} { + eval $state(-errorcommand) entity [list "entity \"$id\" already declared"] + } else { + if {![regexp {"([^"]*)"} $value x entvalue] && ![regexp {'([^']*)'} $value x entvalue]} { + eval $state(-errorcommand) entityvalue [list "entity value \"$value\" not correctly specified"] + } ;# " + set ents($id) $entvalue + } + } else { + # Parameter entity declaration + switch -glob [regexp $param_entity_exp $value x name scheme data],[string compare {} $scheme] { + 0,* { + eval $state(-errorcommand) entityvalue [list "parameter entity \"$value\" not correctly specified"] + } + *,0 { + # SYSTEM or PUBLIC declaration + } + default { + set ents($id) $data + } + } + } +} + +# sgml::DTD:NOTATION -- + +proc sgml::DTD:NOTATION {id value} { + variable notation_exp + upvar opts state + + if {[regexp $notation_exp $value x scheme data] == 2} { + } else { + eval $state(-errorcommand) notationvalue [list "notation value \"$value\" incorrectly specified"] + } +} + +### Utility procedures + +# sgml::noop -- +# +# A do-nothing proc +# +# Arguments: +# args arguments +# +# Results: +# Nothing. + +proc sgml::noop args { + return 0 +} + +# sgml::identity -- +# +# Identity function. +# +# Arguments: +# a arbitrary argument +# +# Results: +# $a + +proc sgml::identity a { + return $a +} + +# sgml::Error -- +# +# Throw an error +# +# Arguments: +# args arguments +# +# Results: +# Error return condition. + +proc sgml::Error args { + uplevel return -code error [list $args] +} + +### Following procedures are based on html_library + +# sgml::zapWhite -- +# +# Convert multiple white space into a single space. +# +# Arguments: +# data plain text +# +# Results: +# As above + +proc sgml::zapWhite data { + regsub -all "\[ \t\r\n\]+" $data { } data + return $data +} + +proc sgml::Boolean value { + regsub {1|true|yes|on} $value 1 value + regsub {0|false|no|off} $value 0 value + return $value +} + +proc sgml::dbgputs {where text} { + variable dbg + + catch {if {$dbg} {puts stdout "DBG: $where ($text)"}} +} Index: library/xml/xml.tcl =================================================================== diff -u -N --- library/xml/xml.tcl (revision 0) +++ library/xml/xml.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,504 @@ +# xml.tcl -- +# +# This file provides XML services. +# These services include a XML document instance and DTD parser, +# as well as support for generating XML. +# +# Copyright (c) 1998,1999 Zveno Pty Ltd +# http://www.zveno.com/ +# +# Zveno makes this software and all associated data and documentation +# ('Software') available free of charge for non-commercial purposes only. You +# may make copies of the Software but you must include all of this notice on +# any copy. +# +# The Software was developed for research purposes and Zveno does not warrant +# that it is error free or fit for any purpose. Zveno disclaims any +# liability for all claims, expenses, losses, damages and costs any user may +# incur as a result of using, copying or modifying the Software. +# +# Copyright (c) 1997 Australian National University (ANU). +# +# ANU makes this software and all associated data and documentation +# ('Software') available free of charge for non-commercial purposes only. You +# may make copies of the Software but you must include all of this notice on +# any copy. +# +# The Software was developed for research purposes and ANU does not warrant +# that it is error free or fit for any purpose. ANU disclaims any +# liability for all claims, expenses, losses, damages and costs any user may +# incur as a result of using, copying or modifying the Software. +# +# $Id: xml.tcl,v 1.4 2006/09/27 08:12:40 neumann Exp $ + +package provide xml 1.8 + +package require sgml 1.6 + +namespace eval xml { + + # Procedures for parsing XML documents + namespace export parser + # Procedures for parsing XML DTDs + namespace export DTDparser + + # Counter for creating unique parser objects + variable ParserCounter 0 + + # Convenience routine + proc cl x { + return "\[$x\]" + } + + # Define various regular expressions + # white space + variable Wsp " \t\r\n" + variable noWsp [cl ^$Wsp] + + # Various XML names and tokens + + # BUG: NameChar does not include CombiningChar or Extender + variable NameChar [cl -a-zA-Z0-9._:] + variable Name [cl a-zA-Z_:]$NameChar* + variable Nmtoken $NameChar+ + + # Tokenising expressions + + variable tokExpr <(/?)([cl ^$Wsp>]+)([cl $Wsp]*[cl ^>]*)> + variable substExpr "\}\n{\\2} {\\1} {} {\\3} \{" + + # table of predefined entities + + variable EntityPredef + array set EntityPredef { + lt < gt > amp & quot \" apos ' + } + +} + + +# xml::parser -- +# +# Creates XML parser object. +# +# Arguments: +# args Unique name for parser object +# plus option/value pairs +# +# Recognised Options: +# -final Indicates end of document data +# -elementstartcommand Called when an element starts +# -elementendcommand Called when an element ends +# -characterdatacommand Called when character data occurs +# -processinginstructioncommand Called when a PI occurs +# -externalentityrefcommand Called for an external entity reference +# +# (Not compatible with expat) +# -xmldeclcommand Called when the XML declaration occurs +# -doctypecommand Called when the document type declaration occurs +# +# -errorcommand Script to evaluate for a fatal error +# -warningcommand Script to evaluate for a reportable warning +# -statevariable global state variable +# -reportempty whether to provide empty element indication +# +# Results: +# The state variable is initialised. + +proc xml::parser {args} { + variable ParserCounter + + if {[llength $args] > 0} { + set name [lindex $args 0] + set args [lreplace $args 0 0] + } else { + set name parser[incr ParserCounter] + } + + if {[info command [namespace current]::$name] != {}} { + return -code error "unable to create parser object \"[namespace current]::$name\" command" + } + + # Initialise state variable and object command + upvar \#0 [namespace current]::$name parser + set sgml_ns [namespace parent]::sgml + array set parser [list name $name \ + -final 1 \ + -elementstartcommand ${sgml_ns}::noop \ + -elementendcommand ${sgml_ns}::noop \ + -characterdatacommand ${sgml_ns}::noop \ + -processinginstructioncommand ${sgml_ns}::noop \ + -externalentityrefcommand ${sgml_ns}::noop \ + -xmldeclcommand ${sgml_ns}::noop \ + -doctypecommand ${sgml_ns}::noop \ + -warningcommand ${sgml_ns}::noop \ + -statevariable [namespace current]::$name \ + -reportempty 0 \ + internaldtd {} \ + ] + + proc [namespace current]::$name {method args} \ + "eval ParseCommand $name \$method \$args" + + eval ParseCommand [list $name] configure $args + + return [namespace current]::$name +} + +# xml::ParseCommand -- +# +# Handles parse object command invocations +# +# Valid Methods: +# cget +# configure +# parse +# reset +# +# Arguments: +# parser parser object +# method minor command +# args other arguments +# +# Results: +# Depends on method + +proc xml::ParseCommand {parser method args} { + upvar \#0 [namespace current]::$parser state + + switch -- $method { + cget { + return $state([lindex $args 0]) + } + configure { + foreach {opt value} $args { + set state($opt) $value + } + } + parse { + ParseCommand_parse $parser [lindex $args 0] + } + reset { + if {[llength $args]} { + return -code error "too many arguments" + } + ParseCommand_reset $parser + } + default { + return -code error "unknown method \"$method\"" + } + } + + return {} +} + +# xml::ParseCommand_parse -- +# +# Parses document instance data +# +# Arguments: +# object parser object +# xml data +# +# Results: +# Callbacks are invoked, if any are defined + +proc xml::ParseCommand_parse {object xml} { + upvar \#0 [namespace current]::$object parser + variable Wsp + variable tokExpr + variable substExpr + + set parent [namespace parent] + if {"::" eq $parent } { + set parent {} + } + + set tokenised [lrange \ + [${parent}::sgml::tokenise $xml \ + $tokExpr \ + $substExpr \ + -internaldtdvariable [namespace current]::${object}(internaldtd)] \ + 5 end] + + eval ${parent}::sgml::parseEvent \ + [list $tokenised \ + -emptyelement [namespace code ParseEmpty] \ + -parseattributelistcommand [namespace code ParseAttrs]] \ + [array get parser -*command] \ + [array get parser -entityvariable] \ + [array get parser -reportempty] \ + -normalize 0 \ + -internaldtd [list $parser(internaldtd)] + + return {} +} + +# xml::ParseEmpty -- +# +# Used by parser to determine whether an element is empty. +# This should be dead easy in XML. The only complication is +# that the RE above can't catch the trailing slash, so we have +# to dig it out of the tag name or attribute list. +# +# Tcl 8.1 REs should fix this. +# +# Arguments: +# tag element name +# attr attribute list (raw) +# e End tag delimiter. +# +# Results: +# "/" if the trailing slash is found. Optionally, return a list +# containing new values for the tag name and/or attribute list. + +proc xml::ParseEmpty {tag attr e} { + + if {[string match */ [string trimright $tag]] && \ + ![string length $attr]} { + regsub {/$} $tag {} tag + return [list / $tag $attr] + } elseif {[string match */ [string trimright $attr]]} { + regsub {/$} [string trimright $attr] {} attr + return [list / $tag $attr] + } else { + return {} + } + +} + +# xml::ParseAttrs -- +# +# Parse element attributes. +# +# There are two forms for name-value pairs: +# +# name="value" +# name='value' +# +# Watch out for the trailing slash on empty elements. +# +# Arguments: +# attrs attribute string given in a tag +# +# Results: +# Returns a Tcl list representing the name-value pairs in the +# attribute string + +proc xml::ParseAttrs attrs { + variable Wsp + variable Name + + # First check whether there's any work to do + if {{} eq [string trim $attrs] } { + return {} + } + + # Strip the trailing slash on empty elements + regsub [format {/[%s]*$} " \t\n\r"] $attrs {} atList + + set mode name + set result {} + foreach component [split $atList =] { + switch $mode { + name { + set component [string trim $component] + if {[regexp $Name $component]} { + lappend result $component + } else { + return -code error "invalid attribute name \"$component\"" + } + set mode value:start + } + value:start { + set component [string trimleft $component] + set delimiter [string index $component 0] + set value {} + switch -- $delimiter { + \" - + ' { + if {[regexp [format {%s([^%s]*)%s(.*)} $delimiter $delimiter $delimiter] $component discard value remainder]} { + lappend result $value + set remainder [string trim $remainder] + if {[string length $remainder]} { + if {[regexp $Name $remainder]} { + lappend result $remainder + set mode value:start + } else { + return -code error "invalid attribute name \"$remainder\"" + } + } else { + set mode end + } + } else { + set value [string range $component 1 end] + set mode value:continue + } + } + default { + return -code error "invalid value for attribute \"[lindex $result end]\"" + } + } + } + value:continue { + if {[regexp [format {([^%s]*)%s(.*)} $delimiter $delimiter] $component discard valuepart remainder]} { + append value = $valuepart + lappend result $value + set remainder [string trim $remainder] + if {[string length $remainder]} { + if {[regexp $Name $remainder]} { + lappend result $remainder + set mode value:start + } else { + return -code error "invalid attribute name \"$remainder\"" + } + } else { + set mode end + } + } else { + append value = $component + } + } + end { + return -code error "unexpected data found after end of attribute list" + } + } + } + + switch $mode { + name - + end { + # This is normal + } + default { + return -code error "unexpected end of attribute list" + } + } + + return $result +} + +proc xml::OLDParseAttrs {attrs} { + variable Wsp + variable Name + + # First check whether there's any work to do + if {{} eq [string trim $attrs] } { + return {} + } + + # Strip the trailing slash on empty elements + regsub [format {/[%s]*$} " \t\n\r"] $attrs {} atList + + # Protect Tcl special characters + #regsub -all {([[\$\\])} $atList {\\\1} atList + regsub -all & $atList {\&} atList + regsub -all {\[} $atList {\&ob;} atList + regsub -all {\]} $atList {\&cb;} atlist + # NB. sgml package delivers braces and backslashes quoted + regsub -all {\\\{} $atList {\&oc;} atList + regsub -all {\\\}} $atList {\&cc;} atlist + regsub -all {\$} $atList {\$} atList + regsub -all {\\\\} $atList {\&bs;} atList + + regsub -all [format {(%s)[%s]*=[%s]*"([^"]*)"} $Name $Wsp $Wsp] \ + $atList {[set parsed(\1) {\2}; set dummy {}] } atList ;# " + regsub -all [format {(%s)[%s]*=[%s]*'([^']*)'} $Name $Wsp $Wsp] \ + $atList {[set parsed(\1) {\2}; set dummy {}] } atList + + set leftovers [subst $atList] + + if {[string length [string trim $leftovers]]} { + return -code error "syntax error in attribute list \"$attrs\"" + } + + return [ParseAttrs:Deprotect [array get parsed]] +} + +# xml::ParseAttrs:Deprotect -- +# +# Reverse map Tcl special characters previously protected +# +# Arguments: +# attrs attribute list +# +# Results: +# Characters substituted + +proc xml::ParseAttrs:Deprotect attrs { + + regsub -all &\; $attrs \\& attrs + regsub -all &ob\; $attrs \[ attrs + regsub -all &cb\; $attrs \] attrs + regsub -all &oc\; $attrs \{ attrs + regsub -all &cc\; $attrs \} attrs + regsub -all &dollar\; $attrs \$ attrs + regsub -all &bs\; $attrs \\\\ attrs + + return $attrs + +} + +# xml::ParseCommand_reset -- +# +# Initialize parser data +# +# Arguments: +# object parser object +# +# Results: +# Parser data structure initialised + +proc xml::ParseCommand_reset object { + upvar \#0 [namespace current]::$object parser + + array set parser [list \ + -final 1 \ + internaldtd {} \ + ] +} + +# xml::noop -- +# +# A do-nothing proc + +proc xml::noop args {} + +### Following procedures are based on html_library + +# xml::zapWhite -- +# +# Convert multiple white space into a single space. +# +# Arguments: +# data plain text +# +# Results: +# As above + +proc xml::zapWhite data { + regsub -all "\[ \t\r\n\]+" $data { } data + return $data +} + +# +# DTD parser for XML is wholly contained within the sgml.tcl package +# + +# xml::parseDTD -- +# +# Entry point to the XML DTD parser. +# +# Arguments: +# dtd XML data defining the DTD to be parsed +# args configuration options +# +# Results: +# Returns a three element list, first element is the content model +# for each element, second element are the attribute lists of the +# elements and the third element is the entity map. + +proc xml::parseDTD {dtd args} { + return [eval [expr {[namespace parent] == {::} ? {} : [namespace parent]}]::sgml::parseDTD [list $dtd] $args] +} + Index: library/xml/xml.xotcl =================================================================== diff -u -N --- library/xml/xml.xotcl (revision 0) +++ library/xml/xml.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,141 @@ +#!../../src/xotclsh +# $Id: xml.xotcl,v 1.2 2006/02/18 22:17:33 neumann Exp $ +# +# smaller implementation of an XML parser wrapper, similar to xoXML +# example from the XOTcl paper +# +# not used in ActiWeb +# +package require xml + +# +# Xml Parser Connection Class (wrapper facade to TclXML and expat interface like parsers) +# +Class XMLParser +XMLParser instproc init args { + my set PC [xml::parser [my autoname [namespace tail [self]]]] + my config \ + -characterdatacommand "[self] pcdata" \ + -elementstartcommand "[self] start" \ + -elementendcommand "[self] end" + my set currentElement [Node create [self]::T] + next +} + +# Create Forwarding methods to the parser == +# abstact interface for xml parser acces +XMLParser instproc cget option {[my set PC] cget $option} +XMLParser instproc config args {eval "[my set PC] configure $args"} +XMLParser instproc parse data {[my set PC] parse $data} +XMLParser instproc reset {} {[my set PC] reset; [self]::T reset} +XMLParser instproc pcdata text { + my instvar currentElement + $currentElement insertText $text +} +XMLParser instproc start {name attrList} { + my instvar currentElement + set currentElement [$currentElement insertElement $name $attrList] +} +XMLParser instproc end {name} { + my instvar currentElement + set currentElement [$currentElement info parent] +} +XMLParser instproc print {} { + ::x::T print + puts "" +} + +############################################################################### +# Simple Node tree +# General Nodes +Class Node +Node instproc reset {} { + foreach c [my info children] {$c destroy} + my set children "" +} +Node instproc print {} { + if {[my exists children]} { + foreach c [my set children] { $c print} + } +} +Node instproc insert {xoclass elementclass args} { + set new [eval $xoclass new -childof [self] $args] + my lappend children $new + return $new +} +Node instproc insertElement {tag args} { + return [eval my insert Element $tag -attributes $args -tag $tag] +} +Node instproc insertText {text} { + return [my insert Text text -content $text] +} + +# Element Nodes +Class Element -superclass Node -parameter { + {attributes ""} + tag +} +Element instproc print {} { + my instvar tag attributes + if {[llength $attributes]>0} { + foreach {n v} $attributes {append string " " $n = '$v'} + } else { + set string "" + } + puts -nonewline <$tag$string> + next + puts -nonewline +} + +# Text Nodes +Class Text -superclass Node -parameter { + {content ""} +} +Text instproc print {} { + puts -nonewline [my set content] +} + +################################################################################# +### Examples +################################################################################# +XMLParser x +x parse { + + + + Mary Andrew + Jacky Crystal + + + + + + + + + + + + + The Coolest Web Page + Il Pagio di Web Fuba + + + + } + +::x print +puts ============================================================ +x reset +x parse { + + a + b + c + def + g + +} +x print Index: library/xml/xmlExample.xotcl =================================================================== diff -u -N --- library/xml/xmlExample.xotcl (revision 0) +++ library/xml/xmlExample.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,115 @@ +#!../../src/xotclsh +# +# small Example for usage of xoXML +package require xotcl::package +package require xotcl::trace +package require xotcl::xml::parser +package require xotcl::xml::recreatorVisitor +package require xotcl::xml::printVisitor + +# +# instantiate parser and parser an example text into a node tree +# +XMLParser x +#x parse { +# + +x parse { + + + a + b + c + + + b + c + + + a + b + c + b + d + + + + + + Mary Andrew + Jacky Crystal + + + + + + + + + + + + + The Coolest Web Page + Il Pagio di Web Fuba + + + + + some text + + + + +} + +proc run {} { + # + # print the node treee to the std output + # + puts ************************************************************************ + puts "Node Tree:" + puts ************************************************************************ + PrintVisitor pv + pv interpretAll x + + # + # recreate xml text and print it to the std output + # + puts \n + puts ************************************************************************ + puts "Recreated XML Text:" + puts ************************************************************************ + XMLRecreatorVisitor rv + puts [rv interpretAll x] + +} +run + +XMLParser y +y parse { + + + + + + + + + + + + + olla + + + + + hallo + + +} +XMLRecreatorVisitor rv +puts [rv interpretAll y] Index: library/xml/xmlRecreatorVisitor.xotcl =================================================================== diff -u -N --- library/xml/xmlRecreatorVisitor.xotcl (revision 0) +++ library/xml/xmlRecreatorVisitor.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,160 @@ +# $Id: xmlRecreatorVisitor.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ + +package provide xotcl::xml::recreatorVisitor 0.9 +package require xotcl::xml::parser +package require XOTcl + +namespace eval ::xotcl::xml::recreatorVisitor { + namespace import ::xotcl::* + + ############################################################################## + # + # a visitor that recreates an XML representation from a + # node tree + # + ############################################################################# + Class XMLRecreatorVisitor -superclass NodeTreeVisitor -parameter useCDATA + + # + # determine nesting depth of an object if the aggregation tree + # + XMLRecreatorVisitor instproc nestingDepth {obj} { + for {set d 0;set s [$obj info parent]} {$s ne "::"} {set s [$s info parent]} { + incr d + } + return $d + } + + # + # insert appropriate number of spaces for indentation -> return space string + # + XMLRecreatorVisitor instproc indent chars { + set spaces " " + for {set l 9} {$l<$chars} {incr l $l} {append spaces $spaces} + return [string range $spaces 1 $chars] + } + XMLRecreatorVisitor instproc insertIndent {obj} { + my instvar nestingStart + return [my indent [expr {([my nestingDepth $obj] - $nestingStart)*2} - 2]] + } + + XMLRecreatorVisitor instproc attrIndent {objName fa} { + upvar [self callinglevel] $fa firstAttr + if {$firstAttr} { + set firstAttr 0 + return " " + } else { + return "\n[my insertIndent $objName] " + } + } + + XMLRecreatorVisitor instproc getContent objName { + return [$objName content] + } + XMLRecreatorVisitor instproc hasOnlyAttrs {obj} { + if {[$obj exists pcdata]} {return 0} + foreach c [$obj info children] { + if {[$c istype XMLNode]} {return 0} + } + return 1 + } + + # + # hook to append line feed dependent on the object + # default is to append one \n + # + XMLRecreatorVisitor instproc appendLineFeed obj { + return "\n" + } + + # + # evaluate node objName + # + XMLRecreatorVisitor instproc visit objName { + my instvar result + set c [my getContent $objName] + if {$c ne ""} { + $objName instvar attributes pcdata + set ns [$objName resolveNS] + set firstAttr 1 + set attrStr "" + if {[string first $objName $ns] != -1} { + # append xmlns attributes, xmlns=... first + if {[$ns exists nsArray(xmlns)]} { + append attrStr [my attrIndent $objName firstAttr] + append attrStr "xmlns = \"[$ns set nsArray(xmlns)]\"" + } + foreach a [$ns array names nsArray] { + if {$a ne "xmlns"} { + append attrStr [my attrIndent $objName firstAttr] + append attrStr "xmlns:${a} = \"[$ns set nsArray($a)]\"" + } + } + } + foreach a [array names attributes] { + append attrStr [my attrIndent $objName firstAttr] + append attrStr "$a = \"$attributes($a)\"" + } + append result "[my insertIndent $objName]<${c}$attrStr" + + if {[my hasOnlyAttrs $objName]} { + append result "/>" + } else { + append result ">" + } + + if {[info exists pcdata] && [llength $pcdata]>1 && + [lindex $pcdata 0] eq ""} { + append result " " [my pcdataString [lindex $pcdata 1]] + } + append result [my appendLineFeed $objName] + } + return $result + } + XMLRecreatorVisitor instproc pcdataString text { + if {[my exists useCDATA] && [regexp < $text]} { + return "" + } + return $text + } + + # + # evaluate end of a node + # + XMLRecreatorVisitor instproc visitEnd objName { + my instvar result + set c [$objName content] + if {$c ne ""} { + if {![my hasOnlyAttrs $objName]} { + append result [my insertIndent $objName] \n + } + } + # a child is responsible for the "mixed content" data elements + # that have a location after the child + set p [$objName info parent] + if {[$p istype XMLElement] && [$p mixedContent]} { + foreach {location data} [$p set pcdata] { + if {$location == $objName} { + append result [my insertIndent $objName] \ + [my pcdataString $data] \n + } + } + } + } + + + # + # public method to be called on top node -> returns XML text as result + # + XMLRecreatorVisitor instproc interpretNodeTree node { + my instvar result + set result "" + my set nestingStart [my nestingDepth $node] + $node accept [self] + return $result + } + + namespace export XMLRecreatorVisitor +} + +namespace import ::xotcl::xml::recreatorVisitor::* Index: library/xml/xoXML.xotcl =================================================================== diff -u -N --- library/xml/xoXML.xotcl (revision 0) +++ library/xml/xoXML.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,641 @@ +# $Id: xoXML.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ +package provide xotcl::xml::parser 0.94 + +package require XOTcl +package require xotcl::pattern::chainOfResponsibility +package require xotcl::pattern::sortedCompositeWithAfter +#package require xotcl::pattern::link +package require xotcl::trace +#package require xml +#package require expat + +namespace eval ::xotcl::xml::parser { + namespace import ::xotcl::* + + ############################################################################## + # + # XML Namespace Handling + # + ############################################################################## + @ ChainOfResponsibility XMLNamespace { + description { + A Chain of Responsiblity Class that handles the XML + XMLNamespace facility for an object tree + + especially for internal usage of the xoXML component + } + } + ChainOfResponsibility XMLNamespace + + + XMLNamespace instproc init args { + # Per default: New NS is end of a namespace chain + # indicated by "" + my successor "" + my array set nsArray {} + next + } + + # + # add two operations searchPrefix and searchFullName as chained -> calls are + # automatically forwarded in the chain, if the failure value (here: "") + # is returned by the chained object + # + XMLNamespace addChainedOperation searchPrefix "" + XMLNamespace addChainedOperation searchFullName "" + XMLNamespace addChainedOperation searchNamespaceByPrefix "" + # + # namespaces are added by value pairs of prefix and full namespace + # name (ns) + # + XMLNamespace instproc add {prefix ns} { + #puts stderr "adding ns: $prefix $ns" + my set nsArray($prefix) $ns + } + + # + # search the chain for a prefix -> return full name, if found + # + XMLNamespace instproc searchPrefix {prefix} { + #puts stderr "[self proc]: Searching for $prefix in [self]" + #puts stderr "[self proc]: There are: [my array names nsArray]" + if {[my exists nsArray($prefix)]} { + return [my set nsArray($prefix)] + } else { + return "" + } + } + + # + # search the chain for a prefix -> return the responisble namespace name + # + XMLNamespace instproc searchNamespaceByPrefix {prefix} { + if {[my exists nsArray($prefix)]} { + return [self] + } else { + return "" + } + } + + # + # search the chain for the full name -> return prefix, if found + # + XMLNamespace instproc searchFullName {fname} { + foreach n [my array names nsArray] { + if {[string match [my set nsArray($n)] $fname]} { + return $n + } + } + return "" + } + + # + # construct the full name from either a expression "prefix:name" + # or just "name" (then construct with "xmlns" as default namespace prefix) + # + XMLNamespace instproc getFullName {fname} { + #puts stderr "Getting FullName for $fname in [self]" + if {[regexp "^(.*):(.*)$" $fname _ prefix name]} { + if {[set pre [my searchPrefix $prefix]] != ""} { + return [set pre]$name + } + } else { + # no colon -> use xmlns + return [my searchPrefix "xmlns"]$fname + } + return $fname + } + + ############################################################################## + # + # Abstract Node Class + # + ############################################################################## + + SortedComposite AbstractXMLNode + + @ SortedComposite AbstractXMLNode { description { + Abstract interface for all node classes. Nodes have an event based + parsing interface to build up a node tree, from an event based parsing + stream + } + } + + # + # called if node start event occurs -> + # start parsing node "name" and intpretation hook for the attribute list + # + AbstractXMLNode abstract instproc parseStart {name attrList} + + # + # called if "character data" is reached + # + AbstractXMLNode abstract instproc parseData {text} + + # + # called if node end is reached + # + AbstractXMLNode abstract instproc parseEnd {name} + + # + # convinience method for printing nodes to output stream (e.g. for debugging) + # + AbstractXMLNode abstract instproc print {} + + # + # Visitor acceptance methods -> call visit and visitEnd of the given + # "visitor" with my as argument + # + AbstractXMLNode abstract instproc accept {visitor} + AbstractXMLNode abstract instproc acceptEnd {visitor} + + # make 'accept' and 'acceptEnd' composite operations + AbstractXMLNode addOperations {accept accept} + AbstractXMLNode addAfterOperations {accept acceptEnd} + + ############################################################################## + # + # XMLNode Node Class + # + ############################################################################## + + # + # the pcdata variable stores the data elements in form of a tuple list + # . + # + Class XMLNode -superclass AbstractXMLNode -parameter { + {content ""} + {namespace} + {parser ""} + pcdata + } + @ Class XMLNode { + description { + general superclass for XML nodes + } + } + + XMLNode instproc init args { + my array set attributes {} + next + } + + XMLNode instproc nextChild {name} { + set child [my autoname $name] + my set lastChild $child + my appendChildren $child + return $child + } + + # + # placeholder methods for the event interface + # + XMLNode instproc parseStart {name attrList} { + #puts "parsed start: [my info class]: $name $attrList" + } + + # + # chracter data is stored in a pcdata variable. + # + XMLNode instproc mixedContent {} { + expr {[my exists children] && [my exists pcdata]} + } + XMLNode instproc parseData {text} { + #my showCall + my instvar pcdata + + set childBeforePCData "" + # if pcdata exists seek the last XMLElement child + #if {[my exists children]} { + # foreach c [my set children] { + # if {[[self]::$c istype XMLElement]} { + # set childBeforePCData [self]::$c + # } + # } + # } + if {[my exists lastChild]} { + set childBeforePCData [self]::[my set lastChild] + } + #my showMsg childBeforePCData=$childBeforePCData + #my showMsg old-pcdata=$pcdata + if {[my exists pcdata]} { + foreach {e d} $pcdata { } + #puts stderr "//$e//$d// [expr {$e == $childBeforePCData}]" + if {$e == $childBeforePCData} { + set pcdata [lreplace $pcdata [expr {[llength $pcdata]-2}] end] + set text $d$text + } + lappend pcdata $childBeforePCData $text + #puts stderr *append****new-pcdata=$pcdata + } else { + set pcdata [list $childBeforePCData $text] + #puts stderr *set*******new-pcdata=$pcdata + } + } + + # + # this method just returns the data elt in the first pcdata + # + XMLNode instproc getFirstPCData {} { + if {[my exists pcdata]} { + return [lindex [my set pcdata] 1] + } + return "" + } + + # + # returns a list of all pcdata elememts, without location information + # stored in the pcdata instance variable + # + XMLNode instproc getPCdataList {} { + set result "" + foreach {l data} [my set pcdata] { + lappend result $data + } + return $result + } + + # + #my set pcdata $text + + XMLNode instproc parseEnd {name} { + #puts "parsed end: [my info class]: $name" + } + + XMLNode instproc print {} { + set c "[my info class]-[self] --- [my content]" + foreach a [my array names attributes] { + append c "\nATTR: $a = [my set attributes($a)]" + } + if {[my exists pcdata]} { + foreach d [my getPCdataList] { + append c "\nPCDATA:\n$d" + } + } + return $c + } + + # + # composite accept operation for visiting the node tree + # through visitors + # + # -> interpretation of the interpreter pattern + # + XMLNode instproc accept {visitor} { + $visitor visit [self] + } + + # + # composite operation called at termination of computation of + # a level == end node + # + XMLNode instproc acceptEnd {visitor} { + $visitor visitEnd [self] + } + + # + # error message, if child can't be parsed + # + XMLNode instproc errorChild {c} { + error "[self] unexpected content $c" + } + + # + # find the namespace object that is currently responsible + # for the [self] node + # + XMLNode instproc resolveNS {} { + set parser [my set parser] + if {[my exists namespace]} { + return [my set namespace] + } else { + set p [my info parent] + if {$p ne "" && $p != $parser} { + return [$p resolveNS] + } else { + #puts stderr "No parent namespace !! Using Parser's topNs ..." + return "" + } + } + } + + # + # add a new namespace entry to the object's NS entry, if it exists + # otherwise: act as a factory method for NS objects and create an + # NS object for the [self] node + # + XMLNode instproc makeIndividualNSEntry {prefix entry} { + set ns [my resolveNS] + if {[string first [self] $ns] == -1} { + #puts stderr "new namespace for [self]" + set newNS [XMLNamespace create [self]::[my autoname ns]] + $newNS set successor $ns + my namespace $newNS + set ns $newNS + } + $ns add $prefix $entry + } + + # + # check for xmlns attribute in the name/value pair "n v" + # return 1 on success, otherwise 0 + # + XMLNode instproc checkForXmlNS {n v} { + #puts "checking to build NS in [self] with $n == $v" + if {[regexp {^xmlns:?(.*)$} $n _ prefix]} { + if {$prefix eq ""} { + set prefix "xmlns" + } + my makeIndividualNSEntry $prefix $v + return 1 + } + return 0 + } + + # small helper proc to extract the namespace prefix from content + XMLNode instproc getContentPrefix {} { + if {[regexp {^([^:]*):} [my set content] _ prefix]} { + return $prefix + } + return "" + } + + ############################################################################## + # + # XMLNode _Class_ Factory for creating XML style node + # node classes + # + ############################################################################## + + Class XMLNodeClassFactory -superclass Class + + XMLNodeClassFactory create XMLElement -superclass XMLNode + + ############################################################################## + # + # Add some methods to the created XMLElement class + # + ############################################################################## + + XMLElement instproc parseAttributes {name attrList} { + my set content $name + foreach {n v} $attrList { + if {[my checkForXmlNS $n $v]} {continue} + my set attributes($n) $v + } + } + + # + # build a child corresponding to the node start event and + # check attribute list -> set content (attr name) and value (attr value) + # on created attr children objects of the XMLElement child + # return the new XMLElement child + # + XMLElement instproc parseStart {name attrList} { + set parser [my set parser] + set nf [$parser set nodeFactory] + set r [$nf getNode XMLElement [self]::[my nextChild elt] $parser] + $r parseAttributes $name $attrList + return $r + } + + # no action of parse end -> just return [self] for convinience + XMLElement instproc parseEnd content { + self + } + + ############################################################################## + # + # Abstract interface for factories that create node objects; + # + ############################################################################## + Class AbstractXMLNodeFactory + + # + # get a node with the specifies key (normally the classname) and name + # the node "objName" -> without flyweights an object "objName" or type "key" + # is created + # + AbstractXMLNodeFactory abstract instproc getNode {key objName parser} + + # + # clean up the node factory + # + AbstractXMLNodeFactory abstract instproc reset {} + + ############################################################################## + # + # Special Node Factory as used in xoXML and xoRDF + # for shared classes the factory acts as a flyweight factory + # + ############################################################################## + Class XMLNodeFactory -superclass AbstractXMLNodeFactory -parameter { + {sharedNodes ""} + } + + XMLNodeFactory instproc getNode {class objName parser} { + $class create $objName -parser $parser ;# returns object ID + } + + XMLNodeFactory instproc reset {} { + #my array set flyweights {} + } + + ############################################################################## + # + # XML Factory for creating node objects + # + ############################################################################## + XMLNodeFactory xmlNodeFactory + + ############################################################################## + # + # Xml Parser Connection Class (wrapper facade to TclXML, expat + # interface like parsers) + # + ############################################################################## + Class XMLParser -parameter { + {topLevelNodeHandler ""} + {nodeFactory "xmlNodeFactory"} + {xmlTextParser expat_fallback_tclxml} + } + + # + # normally all toplevel start events are handled with XML-Elements + # here we can define regexp patterns for other toplevel handlers + # + XMLParser instproc topLevelHandlerPattern {regexp handlerClass} { + my lappend topLevelNodeHandler $regexp $handlerClass + } + # + # if regexp matches -> handler class is used (see start instproc) + # if none matches -> use XMLElement; "name" is name given by the + # start method + # + XMLParser instproc createTopLevelNode {name attrList} { + set nf [my set nodeFactory] + set tnName [my autoname topNode] + foreach {regexpPattern class} [my set topLevelNodeHandler] { + if {[regexp $regexpPattern $name]} { + set tn [$nf getNode $class [self]::$tnName [self]] + my set currentTopNode $tn + return $tn + } + } + set tn [$nf getNode XMLElement [self]::$tnName [self]] + my set currentTopNode $tn + $tn parseAttributes $name $attrList + return $tn + } + + # + # determine the current node -> either the end of node list or topNode + # + XMLParser instproc currentNode {} { + set nodeList [my set nodeList] + if {$nodeList eq ""} { + if {[my exists currentTopNode]} { + return [my set currentTopNode] + } + error "No current top node" + } else { + return [lindex $nodeList end] + } + } + # + # instatiate parser and register event callback methods with parser + # + XMLParser instproc init args { + #my set xmlTextParser expat + switch -- [my set xmlTextParser] { + tclxml { + package require xml + my set PC \ + [xml::parser [[self class] autoname [namespace tail [self]]]] + } + expat { + package require xotcl::xml::expat + my set PC \ + [expat [[self class] autoname [namespace tail [self]]]] + } + expat_fallback_tclxml { + if {[catch {package require xotcl::xml::expat}]} { + package require xml + my set PC \ + [xml::parser [[self class] autoname [namespace tail [self]]]] + #puts "using tclxml" + } else { + my set PC \ + [expat [[self class] autoname [namespace tail [self]]]] + #puts "using expat" + } + } + } + my configure \ + -characterdatacommand [list [self] pcdata] \ + -elementstartcommand [list [self] start] \ + -elementendcommand [list [self] end] + my set nodeList "" + next + } + XMLParser instproc characterdatacommand cmd { + [my set PC] configure -[self proc] $cmd + } + XMLParser instproc elementstartcommand cmd { + [my set PC] configure -[self proc] $cmd + } + XMLParser instproc elementendcommand cmd { + [my set PC] configure -[self proc] $cmd + } + + # + # Create Forwarding methods to the parser == + # abstact interface for xml parser acces + # + XMLParser instproc cget option {[my set PC] cget $option} + XMLParser instproc parse data {[my set PC] parse $data} + XMLParser instproc parseFile filename { + set F [open $filename r]; set c [read $F]; close $F + return [my parse $c] + } + XMLParser instproc reset {} { + [my set PC] reset + foreach c [my info children] { + $c destroy + } + my autoname -reset topNode + my set nodeList "" + [my set nodeFactory] reset + } + XMLParser instproc pcdata text { + #my showCall + set t [string trim $text] + if {$t ne ""} { + #puts stderr "[self]->[self proc] '$text'" + [my currentNode] parseData $t + } + } + XMLParser instproc start {name {attrList ""}} { + #puts "[self]->[self proc] $name $attrList" + my instvar nodeList + if {$nodeList eq ""} { + # no currentNode -> we have to create one + set newStartNode [my createTopLevelNode $name $attrList] + } else { + set newStartNode [[my currentNode] parseStart $name $attrList] + } + lappend nodeList $newStartNode + } + XMLParser instproc end {name} { + #puts "[self]->[self proc] $name" + my instvar nodeList + set currentNode [my currentNode] + $currentNode parseEnd $name + set nodeList [lreplace $nodeList end end] + } + XMLParser instproc destroy args { + if {[my exists PC]} { + rename [my set PC] "" + } + next + } + ############################################################################## + # + # Abstract class for visiting Parser Node Trees + # + ############################################################################## + Class NodeTreeVisitor + + # + # visit a given node "objName" -> called by accept method of objName + # visit encapsulates the interpretation algorithm for a node + # + NodeTreeVisitor abstract instproc visit objName + + # + # interpret the whole node tree strating with top node "node" + # + NodeTreeVisitor abstract instproc interpretNodeTree node + + # + # visit end may stay unspecified in concrete visitors + # + NodeTreeVisitor instproc visitEnd objName {;} + # + # template method that interprets all topnodes of a parser + # in original order + # + NodeTreeVisitor instproc interpretAll {parser} { + set result "" + foreach tn [lsort [$parser info children topNode*]] { + append result [my interpretNodeTree $tn] + } + return $result + } + + namespace export XMLNamespace AbstractXMLNode XMLNode \ + XMLNodeClassFactory XMLElement AbstractXMLNodeFactory \ + XMLNodeFactory XMLParser NodeTreeVisitor +} + +namespace import ::xotcl::xml::parser::* Index: man/man.macros =================================================================== diff -u -N --- man/man.macros (revision 0) +++ man/man.macros (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,236 @@ +'\" 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. +'\" +'\" RCS: @(#) $Id: man.macros,v 1.1 2004/05/23 22:50:39 neumann Exp $ +'\" +'\" # 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 +.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) +.\".b +.\} +.el \{\ +.br +.ie !"\\$2"" \{\ +\&\\$1 \\fI\\$2\\fP +.\} +.el \{\ +\&\\fI\\$1\\fP +.\} +.\} +.. +'\" # define tabbing values for .AP +.de AS +.nr )A 10n +.if !"\\$1"" .nr )A \\w'\\$1'u+3n +.nr )B \\n()Au+15n +.\" +.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n +.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 +.de BS +.br +.mk ^y +.nr ^b 1u +.if n .nf +.if n .ti 0 +.if n \l'\\n(.lu\(ul' +.if n .fi +.. +'\" # BE - end boxed text (draw box now) +.de BE +.nf +.ti 0 +.mk ^t +.ie n \l'\\n(^lu\(ul' +.el \{\ +.\" Draw four-sided box normally, but don't draw top of +.\" box if the box started on an earlier page. +.ie !\\n(^b-1 \{\ +\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' +.\} +.el \}\ +\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' +.\} +.\} +.fi +.br +.nr ^b 0 +.. +'\" # 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 +.de VE +.ie n 'mc +.el \{\ +.ev 2 +.nf +.ti 0 +.mk ^t +\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' +.sp -1 +.fi +.ev +.\} +.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. +.de ^B +.ev 2 +'ti 0 +'nf +.mk ^t +.if \\n(^b \{\ +.\" Draw three-sided box if this is the box's first page, +.\" draw two sides but no top otherwise. +.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c +.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c +.\} +.if \\n(^v \{\ +.nr ^x \\n(^tu+1v-\\n(^Yu +\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c +.\} +.bp +'fi +.ev +.if \\n(^b \{\ +.mk ^y +.nr ^b 2 +.\} +.if \\n(^v \{\ +.mk ^Y +.\} +.. +'\" # DS - begin display +.de DS +.RS +.nf +.sp +.. +'\" # DE - end display +.de DE +.fi +.RE +.sp +.. +'\" # SO - start of list of standard options +.de SO +.SH "STANDARD OPTIONS" +.LP +.nf +.ta 4c 8c 12c +.ft B +.. +'\" # SE - end of list of standard options +.de SE +.fi +.ft R +.LP +See the \\fBoptions\\fR manual entry for details on the standard options. +.. +'\" # OP - start of full description for a single option +.de OP +.LP +.nf +.ta 4c +Command-Line Name: \\fB\\$1\\fR +Database Name: \\fB\\$2\\fR +Database Class: \\fB\\$3\\fR +.fi +.IP +.. +'\" # CS - begin code excerpt +.de CS +.RS +.nf +.ta .25i .5i .75i 1i +.. +'\" # CE - end code excerpt +.de CE +.fi +.RE +.. +.de UL +\\$1\l'|0\(ul'\\$2 +.. Index: man/xotclsh.1 =================================================================== diff -u -N --- man/xotclsh.1 (revision 0) +++ man/xotclsh.1 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,93 @@ +'\" +'\" XOTcl - Extended OTcl +'\" Copyright (C) 1999-2001 Gustaf Neumann, Uwe Zdun +'\" +'\" +.so man.macros +.TH xotclsh 1 "" XOTcl "XOTcl Applications" +.BS +.SH NAME +xotclsh \- Tcl Shell containing object-oriented scripting language XOTcl +.SH SYNOPSIS +\fBxotclsh\fR \fI?filename arg arg ...?\fR +.BE +.SH DESCRIPTION +.PP +\fBxotclsh\fR is a shell-like application that reads XOTcl commands +from its standard input or from a file and evaluates them. +Similarly as the relation between \fBtclsh\fR and \fBwish\fR, +\fBxowish\fR +provides all functionality of xotclsh and provides as well predefined +support for TK widgets. +.PP +XOTcl (XOTcl, pronounced exotickle) is an object-oriented scripting +language based on MIT's OTcl. It is intended as a value added +replacement of OTcl. +.PP +Scripting languages, such as Tcl, are designed for glueing components +together, provide features such as dynamic extensibility and dynamic +typing with automatic conversion, that make them well suited for rapid +application development. +.PP +The object system of XOTcl enables a user to to define objects, +classes, and meta-classes. Classes are special objects with the +purpose of managing +other objects. ``Managing'' means that a class controls the creation +and destruction of its instances and that it contains a repository of +methods accessible for the instances. Every object may be enhanced +with object-specific methods. XOTcl supports single and multiple +inheritance. All object-class and class-class relationships in XOTcl +are introspectable and can be dynamically changed at arbitrary times. +Ambiguities in name resolution of methods are avoided +through method chaining through "next", which does not require +explicit method naming. +.PP +XOTcl combines the ideas of scripting and object-orientation in a way +that preserves the benefits of both of them. It is equipped with +several new language constructs that help building and managing +complex systems. We added the following support: + +.PP +\fIDynamic Object Aggregations\fR, +to provide dynamic aggregations through nested namespaces (objects). +.PP +\fINested Classes\fR, to reduce the interference +of independently developed program structures. +.PP +\fIAssertions\fR, to reduce +the interface and the reliability problems caused by dynamic typing +and, therefore, to ease the combination of many components. +.PP +\fIMeta-data\fR, to enhance self-documentation of objects and +classes. +.PP +\fIPer-object mixins\fR, as a means to give an object +dynamically access to the methods of one or several supplemental classes. +.PP +\fIPer-class mixins\fR, as a means to give all instances of +an class dynamically access to the methods of one or several +supplemental classes. +.PP +\fIFilters\fR as a means of +abstractions over method invocations to implement large program +structures, like design patterns. + +XOTcl provides a value-added replacement of Tcl +package loading providing integration with object-oriented constructs and +tracking/tracing of component loading. +.SH VARIABLES +.PP +\fBxotclsh\fR sets all variables that \fBtclsh\fR sets, +and additionally the following variables: + +.TP 15 +\fB::xotcl::version\fR XOTcl version number. +.TP 15 +\fB::xotcl::confdir\fR Directory for XOTcl configuration. +.TP 15 +\fB::xotcl::logdir\fR Directory where logfiles are placed. + +.PP +.SH KEYWORDS +argument, interpreter, prompt, script file, shell + Index: man/xowish.1 =================================================================== diff -u -N --- man/xowish.1 (revision 0) +++ man/xowish.1 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,84 @@ +'\" +'\" XOTcl - Extended OTcl +'\" Copyright (C) 1999-2001 Gustaf Neumann, Uwe Zdun +'\" +'\" +.so man.macros +.TH xowish 1 "" XOWish "XOTcl Applications" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +xowish \- Graphical shell containing object-oriented scripting language XOTcl +.SH SYNOPSIS +\fBxowish\fR ?\fIfileName arg arg ...\fR? +.BE + +.SH DESCRIPTION +.PP +\fBxowish\fR is a shell-like application that reads XOTcl commands +from its standard input or from a file and evaluates them. In addition +to \fBxotclsh\fR it provides graphical user interface support for TK +widgets. +.PP +XOTcl (XOTcl, pronounced exotickle) is an object-oriented scripting +language based on MIT's OTcl. It is intended as a value added +replacement for OTcl. +.PP +Scripting languages, like Tcl, are designed for glueing components +together, provide features like dynamic extensibility and dynamic +typing with automatic conversion, that make them well suited for rapid +application development. +.PP +The basic object system of XOTcl is adopted from OTcl. The object +system enables us to define objects, classes, and +meta-classes. Classes are special objects with the purpose of managing +other objects. ``Managing'' means that a class controls the creation +and destruction of its instances and that it contains a repository of +methods accessible for the instances. Every object may be enhanced +with object-specific methods. XOTcl supports single and multiple +inheritance. All relationships in XOTcl, including class and +superclass relationships, are completely dynamic and can be +introspected. Through method chaining without explicit naming of the +intended method, ambiguities in name resolution of methods are +avoided. This way a shadowed method can be ``mixed into'' the +execution of the current method. +.PP +XOTcl combines the ideas of scripting and object-orientation in a way +that preserves the benefits of both of them. It is equipped with +several new language functionalities that help building and managing +complex systems. We added the following support: +.PP +Dynamic Object Aggregations, to provide dynamic aggregations through +nested namespaces (objects). +.PP +Nested Classes, to reduce the interference +of independently developed program structures. +.PP +Assertions, to reduce +the interface and the reliability problems caused by dynamic typing +and, therefore, to ease the combination of many components. +.PP +Meta-data, +to enhance self-documentation of objects and classes. +.PP +Per-object +mixins, as a means to improve flexibility of mixin methods by giving +an object access to several different supplemental classes, which may +be changed dynamically. +.PP +Per-class mixins, as a means to improve +flexibility of mixin methods to a class, all instances of the class +have access to the mixed in methods like for multiple inheritance, but +without the need of intersection classes. +.PP +Filters as a means of +abstractions over method invocations to implement large program +structures, like design patterns. +.PP +Dynamic Component Loading XOTcl +integrates the Tcl package loading with architectrual support for +integration with object-oriented constructs. Moreover, it provides +tracking/tracing of component loading. +.PP +.SH KEYWORDS +argument, interpreter, prompt, script file, shell Index: speed-1.4.1.xls =================================================================== diff -u -N Binary files differ Index: tcl.m4 =================================================================== diff -u -N --- tcl.m4 (revision 0) +++ tcl.m4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,4041 @@ +# tcl.m4 -- +# +# This file provides a set of autoconf macros to help TEA-enable +# a Tcl extension. +# +# Copyright (c) 1999-2000 Ajuba Solutions. +# 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: tcl.m4,v 1.8 2007/09/13 15:21:54 neumann Exp $ + +AC_PREREQ(2.57) + +dnl TEA extensions pass us the version of TEA they think they +dnl are compatible with (must be set in TEA_INIT below) +dnl TEA_VERSION="3.6" + +# Possible values for key variables defined: +# +# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') +# TEA_PLATFORM - windows unix +# + +#------------------------------------------------------------------------ +# TEA_PATH_TCLCONFIG -- +# +# Locate the tclConfig.sh file and perform a sanity check on +# the Tcl compile flags +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-tcl=... +# +# Defines the following vars: +# TCL_BIN_DIR Full path to the directory containing +# the tclConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_TCLCONFIG], [ + dnl Make sure we are initialized + AC_REQUIRE([TEA_INIT]) + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + AC_ARG_WITH(tcl, + AC_HELP_STRING([--with-tcl], + [directory containing tcl configuration (tclConfig.sh)]), + with_tclconfig=${withval}) + AC_MSG_CHECKING([for Tcl configuration]) + AC_CACHE_VAL(ac_cv_c_tclconfig,[ + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + case ${with_tclconfig} in + */tclConfig.sh ) + if test -f ${with_tclconfig}; then + AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) + with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tcl.framework/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + AC_MSG_WARN([Can't find Tcl configuration definitions]) + exit 0 + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_PATH_TKCONFIG -- +# +# Locate the tkConfig.sh file +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-tk=... +# +# Defines the following vars: +# TK_BIN_DIR Full path to the directory containing +# the tkConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_TKCONFIG], [ + # + # Ok, lets find the tk configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tk + # + + if test x"${no_tk}" = x ; then + # we reset no_tk in case something fails here + no_tk=true + AC_ARG_WITH(tk, + AC_HELP_STRING([--with-tk], + [directory containing tk configuration (tkConfig.sh)]), + with_tkconfig=${withval}) + AC_MSG_CHECKING([for Tk configuration]) + AC_CACHE_VAL(ac_cv_c_tkconfig,[ + + # First check to see if --with-tkconfig was specified. + if test x"${with_tkconfig}" != x ; then + case ${with_tkconfig} in + */tkConfig.sh ) + if test -f ${with_tkconfig}; then + AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) + with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` + fi ;; + esac + if test -f "${with_tkconfig}/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` + else + AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) + fi + fi + + # then check for a private Tk library + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ../tk \ + `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../tk \ + `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ + ../../../tk \ + `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tk.framework/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + + # on Windows, check in common installation locations + if test "${TEA_PLATFORM}" = "windows" \ + -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d C:/Tcl/lib 2>/dev/null` \ + `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ + ; do + if test -f "$i/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tkconfig}" = x ; then + for i in \ + ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do + if test -f "$i/unix/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_tkconfig}" = x ; then + TK_BIN_DIR="# no Tk configs found" + AC_MSG_WARN([Can't find Tk configuration definitions]) + exit 0 + else + no_tk= + TK_BIN_DIR=${ac_cv_c_tkconfig} + AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_TCLCONFIG -- +# +# Load the tclConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# TCL_BIN_DIR +# +# Results: +# +# Subst the following vars: +# TCL_BIN_DIR +# TCL_SRC_DIR +# TCL_LIB_FILE +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_TCLCONFIG], [ + AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) + + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then + AC_MSG_RESULT([loading]) + . "${TCL_BIN_DIR}/tclConfig.sh" + else + AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tcl.framework installed in an arbitary location. + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then + for i in "`cd ${TCL_BIN_DIR}; pwd`" \ + "`cd ${TCL_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then + TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" + break + fi + done + fi + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then + TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + AC_SUBST(TCL_VERSION) + AC_SUBST(TCL_BIN_DIR) + AC_SUBST(TCL_SRC_DIR) + + AC_SUBST(TCL_LIB_FILE) + AC_SUBST(TCL_LIB_FLAG) + AC_SUBST(TCL_LIB_SPEC) + + AC_SUBST(TCL_STUB_LIB_FILE) + AC_SUBST(TCL_STUB_LIB_FLAG) + AC_SUBST(TCL_STUB_LIB_SPEC) + + AC_SUBST(TCL_LIBS) + AC_SUBST(TCL_DEFS) + AC_SUBST(TCL_EXTRA_CFLAGS) + AC_SUBST(TCL_LD_FLAGS) + AC_SUBST(TCL_SHLIB_LD_LIBS) +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_TKCONFIG -- +# +# Load the tkConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# TK_BIN_DIR +# +# Results: +# +# Sets the following vars that should be in tkConfig.sh: +# TK_BIN_DIR +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_TKCONFIG], [ + AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) + + if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then + AC_MSG_RESULT([loading]) + . "${TK_BIN_DIR}/tkConfig.sh" + else + AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" + eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" + + # If the TK_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TK_LIB_SPEC will be set to the value + # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC + # instead of TK_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f "${TK_BIN_DIR}/Makefile" ; then + TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} + TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} + TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tk.framework installed in an arbitary location. + case ${TK_DEFS} in + *TK_FRAMEWORK*) + if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then + for i in "`cd ${TK_BIN_DIR}; pwd`" \ + "`cd ${TK_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then + TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" + break + fi + done + fi + if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then + TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" + TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" + eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" + eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" + eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" + + # Ensure windowingsystem is defined + if test "${TEA_PLATFORM}" = "unix" ; then + case ${TK_DEFS} in + *MAC_OSX_TK*) + AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) + TEA_WINDOWINGSYSTEM="aqua" + ;; + *) + TEA_WINDOWINGSYSTEM="x11" + ;; + esac + elif test "${TEA_PLATFORM}" = "windows" ; then + TEA_WINDOWINGSYSTEM="win32" + fi + + AC_SUBST(TK_VERSION) + AC_SUBST(TK_BIN_DIR) + AC_SUBST(TK_SRC_DIR) + + AC_SUBST(TK_LIB_FILE) + AC_SUBST(TK_LIB_FLAG) + AC_SUBST(TK_LIB_SPEC) + + AC_SUBST(TK_STUB_LIB_FILE) + AC_SUBST(TK_STUB_LIB_FLAG) + AC_SUBST(TK_STUB_LIB_SPEC) + + AC_SUBST(TK_LIBS) + AC_SUBST(TK_XINCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_SHARED -- +# +# Allows the building of shared libraries +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-shared=yes|no +# +# Defines the following vars: +# STATIC_BUILD Used for building import/export libraries +# on Windows. +# +# Sets the following vars: +# SHARED_BUILD Value of 1 or 0 +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_SHARED], [ + AC_MSG_CHECKING([how to build libraries]) + AC_ARG_ENABLE(shared, + AC_HELP_STRING([--enable-shared], + [build and link with shared libraries (default: on)]), + [tcl_ok=$enableval], [tcl_ok=yes]) + + if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" ; then + AC_MSG_RESULT([shared]) + SHARED_BUILD=1 + else + AC_MSG_RESULT([static]) + SHARED_BUILD=0 + AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) + fi + AC_SUBST(SHARED_BUILD) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_THREADS -- +# +# Specify if thread support should be enabled. If "yes" is specified +# as an arg (optional), threads are enabled by default, "no" means +# threads are disabled. "yes" is the default. +# +# TCL_THREADS is checked so that if you are compiling an extension +# against a threaded core, your extension must be compiled threaded +# as well. +# +# Note that it is legal to have a thread enabled extension run in a +# threaded or non-threaded Tcl core, but a non-threaded extension may +# only run in a non-threaded Tcl core. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-threads +# +# Sets the following vars: +# THREADS_LIBS Thread library(s) +# +# Defines the following vars: +# TCL_THREADS +# _REENTRANT +# _THREAD_SAFE +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_THREADS], [ + AC_ARG_ENABLE(threads, + AC_HELP_STRING([--enable-threads], + [build with threads]), + [tcl_ok=$enableval], [tcl_ok=yes]) + + if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval + else + tcl_ok=yes + fi + + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then + TCL_THREADS=1 + + if test "${TEA_PLATFORM}" != "windows" ; then + # We are always OK on Windows, so check what this platform wants: + + # USE_THREAD_ALLOC tells us to try the special thread-based + # allocator that significantly reduces lock contention + AC_DEFINE(USE_THREAD_ALLOC, 1, + [Do we want to use the threaded memory allocator?]) + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + if test "`uname -s`" = "SunOS" ; then + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + fi + AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) + AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + AC_CHECK_LIB(pthread, __pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + AC_CHECK_LIB(pthreads, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + AC_CHECK_LIB(c, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "no"; then + AC_CHECK_LIB(c_r, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -pthread" + else + TCL_THREADS=0 + AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) + fi + fi + fi + fi + fi + else + TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + AC_MSG_CHECKING([for building with threads]) + if test "${TCL_THREADS}" = 1; then + AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) + AC_MSG_RESULT([yes (default)]) + else + AC_MSG_RESULT([no]) + fi + # TCL_THREADS sanity checking. See if our request for building with + # threads is the same as the way Tcl was built. If not, warn the user. + case ${TCL_DEFS} in + *THREADS=1*) + if test "${TCL_THREADS}" = "0"; then + AC_MSG_WARN([ + Building ${PACKAGE_NAME} without threads enabled, but building against Tcl + that IS thread-enabled. It is recommended to use --enable-threads.]) + fi + ;; + *) + if test "${TCL_THREADS}" = "1"; then + AC_MSG_WARN([ + --enable-threads requested, but building against a Tcl that is NOT + thread-enabled. This is an OK configuration that will also run in + a thread-enabled core.]) + fi + ;; + esac + AC_SUBST(TCL_THREADS) +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_SYMBOLS -- +# +# Specify if debugging symbols should be used. +# Memory (TCL_MEM_DEBUG) debugging can also be enabled. +# +# Arguments: +# none +# +# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives +# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. +# Requires the following vars to be set in the Makefile: +# CFLAGS_DEFAULT +# LDFLAGS_DEFAULT +# +# Results: +# +# Adds the following arguments to configure: +# --enable-symbols +# +# Defines the following vars: +# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true +# Sets to $(CFLAGS_OPTIMIZE) if false +# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true +# Sets to $(LDFLAGS_OPTIMIZE) if false +# DBGX Formerly used as debug library extension; +# always blank now. +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_SYMBOLS], [ + dnl Make sure we are initialized + AC_REQUIRE([TEA_CONFIG_CFLAGS]) + AC_MSG_CHECKING([for build with symbols]) + AC_ARG_ENABLE(symbols, + AC_HELP_STRING([--enable-symbols], + [build with debugging symbols (default: off)]), + [tcl_ok=$enableval], [tcl_ok=no]) + DBGX="" + if test "$tcl_ok" = "no"; then + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" + AC_MSG_RESULT([no]) + else + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" + if test "$tcl_ok" = "yes"; then + AC_MSG_RESULT([yes (standard debugging)]) + fi + fi + if test "${TEA_PLATFORM}" != "windows" ; then + LDFLAGS_DEFAULT="${LDFLAGS}" + fi + + AC_SUBST(TCL_DBGX) + AC_SUBST(CFLAGS_DEFAULT) + AC_SUBST(LDFLAGS_DEFAULT) + + if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then + AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) + fi + + if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then + if test "$tcl_ok" = "all"; then + AC_MSG_RESULT([enabled symbols mem debugging]) + else + AC_MSG_RESULT([enabled $tcl_ok debugging]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_ENABLE_LANGINFO -- +# +# Allows use of modern nl_langinfo check for better l10n. +# This is only relevant for Unix. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-langinfo=yes|no (default is yes) +# +# Defines the following vars: +# HAVE_LANGINFO Triggers use of nl_langinfo if defined. +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_ENABLE_LANGINFO], [ + AC_ARG_ENABLE(langinfo, + AC_HELP_STRING([--enable-langinfo], + [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), + [langinfo_ok=$enableval], [langinfo_ok=yes]) + + HAVE_LANGINFO=0 + if test "$langinfo_ok" = "yes"; then + AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) + fi + AC_MSG_CHECKING([whether to use nl_langinfo]) + if test "$langinfo_ok" = "yes"; then + AC_CACHE_VAL(tcl_cv_langinfo_h, [ + AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], + [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) + AC_MSG_RESULT([$tcl_cv_langinfo_h]) + if test $tcl_cv_langinfo_h = yes; then + AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) + fi + else + AC_MSG_RESULT([$langinfo_ok]) + fi +]) + +#-------------------------------------------------------------------- +# TEA_CONFIG_SYSTEM +# +# Determine what the system is (some things cannot be easily checked +# on a feature-driven basis, alas). This can usually be done via the +# "uname" command, but there are a few systems, like Next, where +# this doesn't work. +# +# Arguments: +# none +# +# Results: +# Defines the following var: +# +# system - System/platform/version identification code. +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_CONFIG_SYSTEM], [ + AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ + if test "${TEA_PLATFORM}" = "windows" ; then + tcl_cv_sys_version=windows + elif test -f /usr/lib/NextStep/software_version; then + tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + tcl_cv_sys_version=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + AC_MSG_WARN([can't find uname command]) + tcl_cv_sys_version=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi + fi + fi + ]) + system=$tcl_cv_sys_version +]) + +#-------------------------------------------------------------------- +# TEA_CONFIG_CFLAGS +# +# Try to determine the proper flags to pass to the compiler +# for building shared libraries and other such nonsense. +# +# Arguments: +# none +# +# Results: +# +# Defines and substitutes the following vars: +# +# DL_OBJS - Name of the object file that implements dynamic +# loading for Tcl on this system. +# DL_LIBS - Library file(s) to include in tclsh and other base +# applications in order for the "load" command to work. +# LDFLAGS - Flags to pass to the compiler when linking object +# files into an executable application binary such +# as tclsh. +# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", +# that tell the run-time dynamic linker where to look +# for shared libraries such as libtcl.so. Depends on +# the variable LIB_RUNTIME_DIR in the Makefile. Could +# be the same as CC_SEARCH_FLAGS if ${CC} is used to link. +# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", +# that tell the run-time dynamic linker where to look +# for shared libraries such as libtcl.so. Depends on +# the variable LIB_RUNTIME_DIR in the Makefile. +# SHLIB_CFLAGS - Flags to pass to cc when compiling the components +# of a shared library (may request position-independent +# code, among other things). +# SHLIB_LD - Base command to use for combining object files +# into a shared library. +# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when +# creating shared libraries. This symbol typically +# goes at the end of the "ld" commands that build +# shared libraries. The value of the symbol is +# "${LIBS}" if all of the dependent libraries should +# be specified when creating a shared library. If +# dependent libraries should not be specified (as on +# SunOS 4.x, where they cause the link to fail, or in +# general if Tcl and Tk aren't themselves shared +# libraries), then this symbol has an empty string +# as its value. +# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable +# extensions. An empty string means we don't know how +# to use shared libraries on this platform. +# LIB_SUFFIX - Specifies everything that comes after the "libfoo" +# in a static or shared library name, using the $VERSION variable +# to put the version in the right place. This is used +# by platforms that need non-standard library names. +# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs +# to have a version after the .so, and ${VERSION}.a +# on AIX, since a shared library needs to have +# a .a extension whereas shared objects for loadable +# extensions have a .so extension. Defaults to +# ${VERSION}${SHLIB_SUFFIX}. +# TCL_NEEDS_EXP_FILE - +# 1 means that an export file is needed to link to a +# shared library. +# TCL_EXP_FILE - The name of the installed export / import file which +# should be used to link to the Tcl shared library. +# Empty if Tcl is unshared. +# TCL_BUILD_EXP_FILE - +# The name of the built export / import file which +# should be used to link to the Tcl shared library. +# Empty if Tcl is unshared. +# CFLAGS_DEBUG - +# Flags used when running the compiler in debug mode +# CFLAGS_OPTIMIZE - +# Flags used when running the compiler in optimize mode +# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_CONFIG_CFLAGS], [ + dnl Make sure we are initialized + AC_REQUIRE([TEA_INIT]) + + # Step 0.a: Enable 64 bit support? + + AC_MSG_CHECKING([if 64bit support is requested]) + AC_ARG_ENABLE(64bit, + AC_HELP_STRING([--enable-64bit], + [enable 64bit support (default: off)]), + [do64bit=$enableval], [do64bit=no]) + AC_MSG_RESULT([$do64bit]) + + # Step 0.b: Enable Solaris 64 bit VIS support? + + AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) + AC_ARG_ENABLE(64bit-vis, + AC_HELP_STRING([--enable-64bit-vis], + [enable 64bit Sparc VIS support (default: off)]), + [do64bitVIS=$enableval], [do64bitVIS=no]) + AC_MSG_RESULT([$do64bitVIS]) + + if test "$do64bitVIS" = "yes"; then + # Force 64bit on with VIS + do64bit=yes + fi + + # Step 0.c: Cross-compiling options for Windows/CE builds? + + if test "${TEA_PLATFORM}" = "windows" ; then + AC_MSG_CHECKING([if Windows/CE build is requested]) + AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) + AC_MSG_RESULT([$doWince]) + fi + + # Step 1: set the variable "system" to hold the name and version number + # for the system. + + TEA_CONFIG_SYSTEM + + # Step 2: check for existence of -ldl library. This is needed because + # Linux can use either -ldl or -ldld for dynamic loading. + + AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) + + # Require ranlib early so we can override it in special cases below. + + AC_REQUIRE([AC_PROG_RANLIB]) + + # Step 3: set configuration options based on system name and version. + # This is similar to Tcl's unix/tcl.m4 except that we've added a + # "windows" case. + + do64bit_ok=no + LDFLAGS_ORIG="$LDFLAGS" + # When ld needs options to work in 64-bit mode, put them in + # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] + # is disabled by the user. [Bug 1016796] + LDFLAGS_ARCH="" + TCL_EXPORT_FILE_SUFFIX="" + UNSHARED_LIB_SUFFIX="" + TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' + ECHO_VERSION='`echo ${PACKAGE_VERSION}`' + TCL_LIB_VERSIONS_OK=ok + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE=-O + if test "$GCC" = "yes" ; then + CFLAGS_OPTIMIZE=-O2 + CFLAGS_WARNING="-Wall -Wno-implicit-int" + else + CFLAGS_WARNING="" + fi + TCL_NEEDS_EXP_FILE=0 + TCL_BUILD_EXP_FILE="" + TCL_EXP_FILE="" +dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. +dnl AC_CHECK_TOOL(AR, ar) + AC_CHECK_PROG(AR, ar, ar) + STLIB_LD='${AR} cr' + LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" + case $system in + windows) + # This is a 2-stage check to make sure we have the 64-bit SDK + # We have to know where the SDK is installed. + # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs + # MACHINE is IX86 for LINK, but this is used by the manifest, + # which requires x86|amd64|ia64. + MACHINE="X86" + if test "$do64bit" != "no" ; then + if test "x${MSSDK}x" = "xx" ; then + MSSDK="C:/Progra~1/Microsoft Platform SDK" + fi + MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` + PATH64="" + case "$do64bit" in + amd64|x64|yes) + MACHINE="AMD64" ; # default to AMD64 64-bit build + PATH64="${MSSDK}/Bin/Win64/x86/AMD64" + ;; + ia64) + MACHINE="IA64" + PATH64="${MSSDK}/Bin/Win64" + ;; + esac + if test ! -d "${PATH64}" ; then + AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) + AC_MSG_WARN([Ensure latest Platform SDK is installed]) + do64bit="no" + else + AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) + do64bit_ok="yes" + fi + fi + + if test "$doWince" != "no" ; then + if test "$do64bit" != "no" ; then + AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) + fi + if test "$GCC" = "yes" ; then + AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) + fi + TEA_PATH_CELIB + # Set defaults for common evc4/PPC2003 setup + # Currently Tcl requires 300+, possibly 420+ for sockets + CEVERSION=420; # could be 211 300 301 400 420 ... + TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... + ARCH=ARM; # could be ARM MIPS X86EM ... + PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" + if test "$doWince" != "yes"; then + # If !yes then the user specified something + # Reset ARCH to allow user to skip specifying it + ARCH= + eval `echo $doWince | awk -F, '{ \ + if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ + if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ + if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ + if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ + if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ + }'` + if test "x${ARCH}" = "x" ; then + ARCH=$TARGETCPU; + fi + fi + OSVERSION=WCE$CEVERSION; + if test "x${WCEROOT}" = "x" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" + if test ! -d "${WCEROOT}" ; then + WCEROOT="C:/Program Files/Microsoft eMbedded Tools" + fi + fi + if test "x${SDKROOT}" = "x" ; then + SDKROOT="C:/Program Files/Windows CE Tools" + if test ! -d "${SDKROOT}" ; then + SDKROOT="C:/Windows CE Tools" + fi + fi + WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` + SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` + if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ + -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then + AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) + doWince="no" + else + # We could PATH_NOSPACE these, but that's not important, + # as long as we quote them when used. + CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" + if test -d "${CEINCLUDE}/${TARGETCPU}" ; then + CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" + fi + CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" + fi + fi + + if test "$GCC" != "yes" ; then + if test "${SHARED_BUILD}" = "0" ; then + runtime=-MT + else + runtime=-MD + fi + + if test "$do64bit" != "no" ; then + # All this magic is necessary for the Win64 SDK RC1 - hobbs + CC="\"${PATH64}/cl.exe\"" + CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" + RC="\"${MSSDK}/bin/rc.exe\"" + lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + LINKBIN="\"${PATH64}/link.exe\"" + CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + # Avoid 'unresolved external symbol __security_cookie' + # errors, c.f. http://support.microsoft.com/?id=894573 + TEA_ADD_LIBS([bufferoverflowU.lib]) + elif test "$doWince" != "no" ; then + CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" + if test "${TARGETCPU}" = "X86"; then + CC="\"${CEBINROOT}/cl.exe\"" + else + CC="\"${CEBINROOT}/cl${ARCH}.exe\"" + fi + CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" + RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" + arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` + defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" + if test "${SHARED_BUILD}" = "1" ; then + # Static CE builds require static celib as well + defs="${defs} _DLL" + fi + for i in $defs ; do + AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) + done + AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) + AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) + CFLAGS_DEBUG="-nologo -Zi -Od" + CFLAGS_OPTIMIZE="-nologo -Ox" + lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` + lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" + LINKBIN="\"${CEBINROOT}/link.exe\"" + AC_SUBST(CELIB_DIR) + else + RC="rc" + lflags="-nologo" + LINKBIN="link" + CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" + CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" + fi + fi + + if test "$GCC" = "yes"; then + # mingw gcc mode + RC="windres" + CFLAGS_DEBUG="-g" + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + SHLIB_LD="$CC -shared" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" + LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" + else + SHLIB_LD="${LINKBIN} -dll ${lflags}" + # link -lib only works when -lib is the first arg + STLIB_LD="${LINKBIN} -lib ${lflags}" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' + PATHTYPE=-w + # For information on what debugtype is most useful, see: + # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp + # This essentially turns it all on. + LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" + LDFLAGS_OPTIMIZE="-release" + if test "$doWince" != "no" ; then + LDFLAGS_CONSOLE="-link ${lflags}" + LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} + else + LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" + LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" + fi + fi + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dll" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' + + TCL_LIB_VERSIONS_OK=nodots + # Bogus to avoid getting this turned off + DL_OBJS="tclLoadNone.obj" + ;; + AIX-*) + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then + # AIX requires the _r compiler when gcc isn't being used + case "${CC}" in + *_r) + # ok ... + ;; + *) + CC=${CC}_r + ;; + esac + AC_MSG_RESULT([Using $CC for compiling with threads]) + fi + LIBS="$LIBS -lc" + SHLIB_CFLAGS="" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + DL_OBJS="tclLoadDl.o" + LD_LIBRARY_PATH_VAR="LIBPATH" + + # Check to enable 64-bit flags for compiler/linker on AIX 4+ + if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + else + do64bit_ok=yes + CFLAGS="$CFLAGS -q64" + LDFLAGS_ARCH="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + else + SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' + fi + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then + AC_LIBOBJ([tclLoadAix]) + DL_LIBS="-lld" + fi + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) + fi + ;; + BeOS*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="${CC} -nostart" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + + #----------------------------------------------------------- + # Check for inet_ntoa in -lbind, for BeOS (which also needs + # -lsocket, even if the network functions are in -lnet which + # is always linked to, for compatibility. + #----------------------------------------------------------- + AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) + ;; + BSD/OS-2.1*|BSD/OS-3*) + SHLIB_CFLAGS="" + SHLIB_LD="shlicc -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD="cc -shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + dgux*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + HP-UX-*.11.*) + # Use updated header definitions where possible + AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) + # Needed by Tcl, but not most extensions + #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) + #LIBS="$LIBS -lxnet" # Use the XOPEN network library + + if test "`uname -m`" = "ia64" ; then + SHLIB_SUFFIX=".so" + # Use newer C++ library for C++ extensions + #if test "$GCC" != "yes" ; then + # CPPFLAGS="-AA" + #fi + else + SHLIB_SUFFIX=".sl" + fi + AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS='${LIBS}' + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + if test "$GCC" = "yes" ; then + SHLIB_LD="gcc -shared" + SHLIB_LD_LIBS='${LIBS}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc + #CFLAGS="$CFLAGS +DAportable" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + hpux_arch=`${CC} -dumpmachine` + case $hpux_arch in + hppa64*) + # 64-bit gcc in use. Fix flags for GNU ld. + do64bit_ok=yes + SHLIB_LD="${CC} -shared" + SHLIB_LD_LIBS='${LIBS}' + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + ;; + *) + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + ;; + esac + else + do64bit_ok=yes + CFLAGS="$CFLAGS +DD64" + LDFLAGS_ARCH="+DD64" + fi + fi + ;; + HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + SHLIB_SUFFIX=".sl" + AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = yes; then + SHLIB_CFLAGS="+z" + SHLIB_LD="ld -b" + SHLIB_LD_LIBS="" + DL_OBJS="tclLoadShl.o" + DL_LIBS="-ldld" + LDFLAGS="$LDFLAGS -Wl,-E" + CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' + LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' + LD_LIBRARY_PATH_VAR="SHLIB_PATH" + fi + ;; + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + ;; + IRIX-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mabi=n32" + LDFLAGS="$LDFLAGS -mabi=n32" + else + case $system in + IRIX-6.3) + # Use to build 6.2 compatible binaries on 6.3. + CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" + ;; + *) + CFLAGS="$CFLAGS -n32" + ;; + esac + LDFLAGS="$LDFLAGS -n32" + fi + ;; + IRIX64-6.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -n32 -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + + # Check to enable 64-bit flags for compiler/linker + + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN([64bit mode not supported by gcc]) + else + do64bit_ok=yes + SHLIB_LD="ld -64 -shared -rdata_shared" + CFLAGS="$CFLAGS -64" + LDFLAGS_ARCH="-64" + fi + fi + ;; + Linux*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings + # when you inline the string and math operations. Turn this off to + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + if test $do64bit = yes; then + AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -m64" + AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_m64 = yes; then + CFLAGS="$CFLAGS -m64" + do64bit_ok=yes + fi + fi + + # The combo of gcc + glibc has a bug related + # to inlining of functions like strtod(). The + # -fno-builtin flag should address this problem + # but it does not work. The -fno-inline flag + # is kind of overkill but it works. + # Disable inlining only when one of the + # files in compat/*.c is being linked in. + if test x"${USE_COMPAT}" != x ; then + CFLAGS="$CFLAGS -fno-inline" + fi + + ;; + GNU*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + + SHLIB_LD="${CC} -shared" + DL_OBJS="" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,--export-dynamic" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + if test "`uname -m`" = "alpha" ; then + CFLAGS="$CFLAGS -mieee" + fi + ;; + Lynx*) + SHLIB_CFLAGS="-fPIC" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + CFLAGS_OPTIMIZE=-02 + SHLIB_LD="${CC} -shared " + DL_OBJS="tclLoadDl.o" + DL_LIBS="-mshared -ldl" + LD_FLAGS="-Wl,--export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + ;; + MP-RAS-02*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + MP-RAS-*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LDFLAGS="$LDFLAGS -Wl,-Bexport" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + NetBSD-*|FreeBSD-[[1-2]].*) + # NetBSD/SPARC needs -fPIC, -fpic will not do. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ + AC_EGREP_CPP(yes, [ +#ifdef __ELF__ + yes +#endif + ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) + if test $tcl_cv_ld_elf = yes; then + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + else + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + fi + + # Ancient FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + OpenBSD-*) + # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. + case `machine` in + sparc|sparc64) + SHLIB_CFLAGS="-fPIC";; + *) + SHLIB_CFLAGS="-fpic";; + esac + SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ + AC_EGREP_CPP(yes, [ +#ifdef __ELF__ + yes +#endif + ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) + if test $tcl_cv_ld_elf = yes; then + LDFLAGS=-Wl,-export-dynamic + else + LDFLAGS="" + fi + + # OpenBSD doesn't do version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS -export-dynamic" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "${TCL_THREADS}" = "1" ; then + # The -pthread needs to go in the CFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + case $system in + FreeBSD-3.*) + # FreeBSD-3 doesn't handle version numbers with dots. + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' + TCL_LIB_VERSIONS_OK=nodots + ;; + esac + ;; + Darwin-*) + CFLAGS_OPTIMIZE="-Os" + SHLIB_CFLAGS="-fno-common" + # To avoid discrepancies between what headers configure sees during + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: + CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" + if test $do64bit = yes; then + case `arch` in + ppc) + AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], + tcl_cv_cc_arch_ppc64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes, + tcl_cv_cc_arch_ppc64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_arch_ppc64 = yes; then + CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" + do64bit_ok=yes + fi;; + i386) + AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], + tcl_cv_cc_arch_x86_64, [ + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -arch x86_64" + AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes, + tcl_cv_cc_arch_x86_64=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_arch_x86_64 = yes; then + CFLAGS="$CFLAGS -arch x86_64" + do64bit_ok=yes + fi;; + *) + AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; + esac + else + # Check for combined 32-bit and 64-bit fat build + echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ + echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ + fat_32_64=yes + fi + # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' + AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" + AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_single_module = yes; then + SHLIB_LD="${SHLIB_LD} -Wl,-single_module" + fi + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" + DL_LIBS="" + # Don't use -prebind when building for Mac OS X 10.4 or later only: + test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \ + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \ + LDFLAGS="$LDFLAGS -prebind" + LDFLAGS="$LDFLAGS -headerpad_max_install_names" + AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_search_paths_first = yes; then + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + + # TEA specific: for Tk extensions, remove 64-bit arch flags from + # CFLAGS et al. for combined 32 & 64 bit fat builds as neither + # TkAqua nor TkX11 can be built for 64-bit at present. + test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done + ;; + NEXTSTEP-*) + SHLIB_CFLAGS="" + SHLIB_LD="cc -nostdlib -r" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadNext.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OS/390-*) + CFLAGS_OPTIMIZE="" # Optimizer is buggy + AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h + [Should OS/390 do the right thing with sockets?]) + ;; + OSF1-1.0|OSF1-1.1|OSF1-1.2) + # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 + SHLIB_CFLAGS="" + # Hack: make package name same as library name + SHLIB_LD='ld -R -export $@:' + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadOSF.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-1.*) + # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 + SHLIB_CFLAGS="-fPIC" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD="ld -shared" + else + SHLIB_LD="ld -non_shared" + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + OSF1-V*) + # Digital OSF/1 + SHLIB_CFLAGS="" + if test "$SHARED_BUILD" = "1" ; then + SHLIB_LD='ld -shared -expect_unresolved "*"' + else + SHLIB_LD='ld -non_shared -expect_unresolved "*"' + fi + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' + if test "$GCC" = "yes" ; then + CFLAGS="$CFLAGS -mieee" + else + CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" + fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = "1" ; then + CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" + CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + LIBS=`echo $LIBS | sed s/-lpthreads//` + if test "$GCC" = "yes" ; then + LIBS="$LIBS -lpthread -lmach -lexc" + else + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + fi + + ;; + QNX-6*) + # QNX RTP + # This may work for all QNX, but it was only reported for v6. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + # dlopen is in -lc on QNX + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SCO_SV-3.2*) + # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # this test works, since "uname -s" was non-standard in 3.2.4 and + # below. + if test "$GCC" = "yes" ; then + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + else + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + fi + SHLIB_LD="ld -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SINIX*5.4*) + SHLIB_CFLAGS="-K PIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + SunOS-4*) + SHLIB_CFLAGS="-PIC" + SHLIB_LD="ld" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + + # SunOS can't handle version numbers with dots in them in library + # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it + # requires an extra version number at the end of .so file names. + # So, the library has to have a name like libtcl75.so.1.0 + + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + SunOS-5.[[0-6]]) + # Careful to not let 5.10+ fall into this case + + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + + SHLIB_CFLAGS="-KPIC" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + fi + ;; + SunOS-5*) + # Note: If _REENTRANT isn't defined, then Solaris + # won't define thread-safe library routines. + + AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, + [Do we really want to follow the standard? Yes we do!]) + + SHLIB_CFLAGS="-KPIC" + + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + arch=`isainfo` + if test "$arch" = "sparcv9 sparc" ; then + if test "$GCC" = "yes" ; then + if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then + AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) + else + do64bit_ok=yes + CFLAGS="$CFLAGS -m64 -mcpu=v9" + LDFLAGS="$LDFLAGS -m64 -mcpu=v9" + SHLIB_CFLAGS="-fPIC" + fi + else + do64bit_ok=yes + if test "$do64bitVIS" = "yes" ; then + CFLAGS="$CFLAGS -xarch=v9a" + LDFLAGS_ARCH="-xarch=v9a" + else + CFLAGS="$CFLAGS -xarch=v9" + LDFLAGS_ARCH="-xarch=v9" + fi + # Solaris 64 uses this as well + #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" + fi + elif test "$arch" = "amd64 i386" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN([64bit mode not supported with GCC on $system]) + else + do64bit_ok=yes + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64" + fi + else + AC_MSG_WARN([64bit mode not supported for $arch]) + fi + fi + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$GCC" = "yes" ; then + SHLIB_LD="$CC -shared" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + if test "$do64bit_ok" = "yes" ; then + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + # JH: static-libgcc is necessary for core Tcl, but may + # not be necessary for extensions. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + fi + else + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + fi + ;; + UNIX_SV* | UnixWare-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD="cc -G" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers + # that don't grok the -Bexport option. Test that it does. + AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-Bexport" + AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_Bexport = yes; then + LDFLAGS="$LDFLAGS -Wl,-Bexport" + fi + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + ;; + esac + + if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then + AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) + fi + +dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so +dnl # until the end of configure, as configure's compile and link tests use +dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's +dnl # preprocessing tests use only CPPFLAGS. + AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) + + # Step 4: disable dynamic loading if requested via a command-line switch. + + AC_ARG_ENABLE(load, + AC_HELP_STRING([--enable-load], + [allow dynamic loading and "load" command (default: on)]), + [tcl_ok=$enableval], [tcl_ok=yes]) + if test "$tcl_ok" = "no"; then + DL_OBJS="" + fi + + if test "x$DL_OBJS" != "x" ; then + BUILD_DLTEST="\$(DLTEST_TARGETS)" + else + echo "Can't figure out how to do dynamic loading or shared libraries" + echo "on this system." + SHLIB_CFLAGS="" + SHLIB_LD="" + SHLIB_SUFFIX="" + DL_OBJS="tclLoadNone.o" + DL_LIBS="" + LDFLAGS="$LDFLAGS_ORIG" + CC_SEARCH_FLAGS="" + LD_SEARCH_FLAGS="" + BUILD_DLTEST="" + fi + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" + + # If we're running gcc, then change the C flags for compiling shared + # libraries to the right flags for gcc, instead of those for the + # standard manufacturer compiler. + + if test "$DL_OBJS" != "tclLoadNone.o" ; then + if test "$GCC" = "yes" ; then + case $system in + AIX-*) + ;; + BSD/OS*) + ;; + IRIX*) + ;; + NetBSD-*|FreeBSD-*) + ;; + Darwin-*) + ;; + SCO_SV-3.2*) + ;; + windows) + ;; + *) + SHLIB_CFLAGS="-fPIC" + ;; + esac + fi + fi + + if test "$SHARED_LIB_SUFFIX" = "" ; then + SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' + fi + if test "$UNSHARED_LIB_SUFFIX" = "" ; then + UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' + fi + + AC_SUBST(DL_LIBS) + + AC_SUBST(CFLAGS_DEBUG) + AC_SUBST(CFLAGS_OPTIMIZE) + AC_SUBST(CFLAGS_WARNING) + + AC_SUBST(STLIB_LD) + AC_SUBST(SHLIB_LD) + + AC_SUBST(SHLIB_LD_LIBS) + AC_SUBST(SHLIB_CFLAGS) + + AC_SUBST(LD_LIBRARY_PATH_VAR) + + # These must be called after we do the basic CFLAGS checks and + # verify any possible 64-bit or similar switches are necessary + TEA_TCL_EARLY_FLAGS + TEA_TCL_64BIT_FLAGS +]) + +#-------------------------------------------------------------------- +# TEA_SERIAL_PORT +# +# Determine which interface to use to talk to the serial port. +# Note that #include lines must begin in leftmost column for +# some compilers to recognize them as preprocessor directives, +# and some build environments have stdin not pointing at a +# pseudo-terminal (usually /dev/null instead.) +# +# Arguments: +# none +# +# Results: +# +# Defines only one of the following vars: +# HAVE_SYS_MODEM_H +# USE_TERMIOS +# USE_TERMIO +# USE_SGTTY +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_SERIAL_PORT], [ + AC_CHECK_HEADERS(sys/modem.h) + AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ + AC_TRY_RUN([ +#include + +int main() { + struct termios t; + if (tcgetattr(0, &t) == 0) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include + +int main() { + struct termio t; + if (ioctl(0, TCGETA, &t) == 0) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include + +int main() { + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no ; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct termios t; + if (tcgetattr(0, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct termio t; + if (ioctl(0, TCGETA, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; + }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) + fi + if test $tcl_cv_api_serial = no; then + AC_TRY_RUN([ +#include +#include + +int main() { + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) + fi]) + case $tcl_cv_api_serial in + termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; + termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; + sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; + esac +]) + +#-------------------------------------------------------------------- +# TEA_MISSING_POSIX_HEADERS +# +# Supply substitutes for missing POSIX header files. Special +# notes: +# - stdlib.h doesn't define strtol, strtoul, or +# strtod insome versions of SunOS +# - some versions of string.h don't declare procedures such +# as strstr +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# NO_DIRENT_H +# NO_ERRNO_H +# NO_VALUES_H +# HAVE_LIMITS_H or NO_LIMITS_H +# NO_STDLIB_H +# NO_STRING_H +# NO_SYS_WAIT_H +# NO_DLFCN_H +# HAVE_SYS_PARAM_H +# +# HAVE_STRING_H ? +# +# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and +# CHECK on limits.h +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ + AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ + AC_TRY_LINK([#include +#include ], [ +#ifndef _POSIX_SOURCE +# ifdef __Lynx__ + /* + * Generate compilation error to make the test fail: Lynx headers + * are only valid if really in the POSIX environment. + */ + + missing_procedure(); +# endif +#endif +DIR *d; +struct dirent *entryPtr; +char *p; +d = opendir("foobar"); +entryPtr = readdir(d); +p = entryPtr->d_name; +closedir(d); +], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) + + if test $tcl_cv_dirent_h = no; then + AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) + fi + + AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(limits.h, + [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], + [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) + AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) + AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) + AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) + if test $tcl_ok = 0; then + AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) + fi + AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) + AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) + AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) + + # See also memmove check below for a place where NO_STRING_H can be + # set and why. + + if test $tcl_ok = 0; then + AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) + fi + + AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) + AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) + + # OS/390 lacks sys/param.h (and doesn't need it, by chance). + AC_HAVE_HEADERS(sys/param.h) +]) + +#-------------------------------------------------------------------- +# TEA_PATH_X +# +# Locate the X11 header files and the X11 library archive. Try +# the ac_path_x macro first, but if it doesn't find the X stuff +# (e.g. because there's no xmkmf program) then check through +# a list of possible directories. Under some conditions the +# autoconf macro will return an include directory that contains +# no include files, so double-check its result just to be safe. +# +# This should be called after TEA_CONFIG_CFLAGS as setting the +# LIBS line can confuse some configure macro magic. +# +# Arguments: +# none +# +# Results: +# +# Sets the following vars: +# XINCLUDES +# XLIBSW +# PKG_LIBS (appends to) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_PATH_X], [ + if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then + TEA_PATH_UNIX_X + fi +]) + +AC_DEFUN([TEA_PATH_UNIX_X], [ + AC_PATH_X + not_really_there="" + if test "$no_x" = ""; then + if test "$x_includes" = ""; then + AC_TRY_CPP([#include ], , not_really_there="yes") + else + if test ! -r $x_includes/X11/Intrinsic.h; then + not_really_there="yes" + fi + fi + fi + if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then + AC_MSG_CHECKING([for X11 header files]) + found_xincludes="no" + AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") + if test "$found_xincludes" = "no"; then + dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" + for i in $dirs ; do + if test -r $i/X11/Intrinsic.h; then + AC_MSG_RESULT([$i]) + XINCLUDES=" -I$i" + found_xincludes="yes" + break + fi + done + fi + else + if test "$x_includes" != ""; then + XINCLUDES="-I$x_includes" + found_xincludes="yes" + fi + fi + if test found_xincludes = "no"; then + AC_MSG_RESULT([couldn't find any!]) + fi + + if test "$no_x" = yes; then + AC_MSG_CHECKING([for X11 libraries]) + XLIBSW=nope + dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" + for i in $dirs ; do + if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then + AC_MSG_RESULT([$i]) + XLIBSW="-L$i -lX11" + x_libraries="$i" + break + fi + done + else + if test "$x_libraries" = ""; then + XLIBSW=-lX11 + else + XLIBSW="-L$x_libraries -lX11" + fi + fi + if test "$XLIBSW" = nope ; then + AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) + fi + if test "$XLIBSW" = nope ; then + AC_MSG_RESULT([could not find any! Using -lX11.]) + XLIBSW=-lX11 + fi + if test x"${XLIBSW}" != x ; then + PKG_LIBS="${PKG_LIBS} ${XLIBSW}" + fi +]) + +#-------------------------------------------------------------------- +# TEA_BLOCKING_STYLE +# +# The statements below check for systems where POSIX-style +# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. +# On these systems (mostly older ones), use the old BSD-style +# FIONBIO approach instead. +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# HAVE_SYS_IOCTL_H +# HAVE_SYS_FILIO_H +# USE_FIONBIO +# O_NONBLOCK +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_BLOCKING_STYLE], [ + AC_CHECK_HEADERS(sys/ioctl.h) + AC_CHECK_HEADERS(sys/filio.h) + TEA_CONFIG_SYSTEM + AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) + case $system in + # There used to be code here to use FIONBIO under AIX. However, it + # was reported that FIONBIO doesn't work under AIX 3.2.5. Since + # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO + # code (JO, 5/31/97). + + OSF*) + AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) + AC_MSG_RESULT([FIONBIO]) + ;; + SunOS-4*) + AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) + AC_MSG_RESULT([FIONBIO]) + ;; + *) + AC_MSG_RESULT([O_NONBLOCK]) + ;; + esac +]) + +#-------------------------------------------------------------------- +# TEA_TIME_HANLDER +# +# Checks how the system deals with time.h, what time structures +# are used on the system, and what fields the structures have. +# +# Arguments: +# none +# +# Results: +# +# Defines some of the following vars: +# USE_DELTA_FOR_TZ +# HAVE_TM_GMTOFF +# HAVE_TM_TZADJ +# HAVE_TIMEZONE_VAR +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TIME_HANDLER], [ + AC_CHECK_HEADERS(sys/time.h) + AC_HEADER_TIME + AC_STRUCT_TIMEZONE + + AC_CHECK_FUNCS(gmtime_r localtime_r) + + AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ + AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], + tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) + if test $tcl_cv_member_tm_tzadj = yes ; then + AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) + fi + + AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ + AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], + tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) + if test $tcl_cv_member_tm_gmtoff = yes ; then + AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) + fi + + # + # Its important to include time.h in this check, as some systems + # (like convex) have timezone functions, etc. + # + AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ + AC_TRY_COMPILE([#include ], + [extern long timezone; + timezone += 1; + exit (0);], + tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) + if test $tcl_cv_timezone_long = yes ; then + AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) + else + # + # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. + # + AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ + AC_TRY_COMPILE([#include ], + [extern time_t timezone; + timezone += 1; + exit (0);], + tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) + if test $tcl_cv_timezone_time = yes ; then + AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) + fi + fi +]) + +#-------------------------------------------------------------------- +# TEA_BUGGY_STRTOD +# +# Under Solaris 2.4, strtod returns the wrong value for the +# terminating character under some conditions. Check for this +# and if the problem exists use a substitute procedure +# "fixstrtod" (provided by Tcl) that corrects the error. +# Also, on Compaq's Tru64 Unix 5.0, +# strtod(" ") returns 0.0 instead of a failure to convert. +# +# Arguments: +# none +# +# Results: +# +# Might defines some of the following vars: +# strtod (=fixstrtod) +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_BUGGY_STRTOD], [ + AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) + if test "$tcl_strtod" = 1; then + AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ + AC_TRY_RUN([ + extern double strtod(); + int main() { + char *infString="Inf", *nanString="NaN", *spaceString=" "; + char *term; + double value; + value = strtod(infString, &term); + if ((term != infString) && (term[-1] == 0)) { + exit(1); + } + value = strtod(nanString, &term); + if ((term != nanString) && (term[-1] == 0)) { + exit(1); + } + value = strtod(spaceString, &term); + if (term == (spaceString+1)) { + exit(1); + } + exit(0); + }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, + tcl_cv_strtod_buggy=buggy)]) + if test "$tcl_cv_strtod_buggy" = buggy; then + AC_LIBOBJ([fixstrtod]) + USE_COMPAT=1 + AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) + fi + fi +]) + +#-------------------------------------------------------------------- +# TEA_TCL_LINK_LIBS +# +# Search for the libraries needed to link the Tcl shell. +# Things like the math library (-lm) and socket stuff (-lsocket vs. +# -lnsl) are dealt with here. +# +# Arguments: +# Requires the following vars to be set in the Makefile: +# DL_LIBS +# LIBS +# MATH_LIBS +# +# Results: +# +# Subst's the following var: +# TCL_LIBS +# MATH_LIBS +# +# Might append to the following vars: +# LIBS +# +# Might define the following vars: +# HAVE_NET_ERRNO_H +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_LINK_LIBS], [ + #-------------------------------------------------------------------- + # On a few very rare systems, all of the libm.a stuff is + # already in libc.a. Set compiler flags accordingly. + # Also, Linux requires the "ieee" library for math to work + # right (and it must appear before "-lm"). + #-------------------------------------------------------------------- + + AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") + AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) + + #-------------------------------------------------------------------- + # Interactive UNIX requires -linet instead of -lsocket, plus it + # needs net/errno.h to define the socket-related error codes. + #-------------------------------------------------------------------- + + AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) + AC_CHECK_HEADER(net/errno.h, [ + AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) + + #-------------------------------------------------------------------- + # Check for the existence of the -lsocket and -lnsl libraries. + # The order here is important, so that they end up in the right + # order in the command line generated by make. Here are some + # special considerations: + # 1. Use "connect" and "accept" to check for -lsocket, and + # "gethostbyname" to check for -lnsl. + # 2. Use each function name only once: can't redo a check because + # autoconf caches the results of the last check and won't redo it. + # 3. Use -lnsl and -lsocket only if they supply procedures that + # aren't already present in the normal libraries. This is because + # IRIX 5.2 has libraries, but they aren't needed and they're + # bogus: they goof up name resolution if used. + # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. + # To get around this problem, check for both libraries together + # if -lsocket doesn't work by itself. + #-------------------------------------------------------------------- + + tcl_checkBoth=0 + AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) + if test "$tcl_checkSocket" = 1; then + AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, + LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) + fi + if test "$tcl_checkBoth" = 1; then + tk_oldLibs=$LIBS + LIBS="$LIBS -lsocket -lnsl" + AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) + fi + AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, + [LIBS="$LIBS -lnsl"])]) + + # Don't perform the eval of the libraries here because DL_LIBS + # won't be set until we call TEA_CONFIG_CFLAGS + + TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' + AC_SUBST(TCL_LIBS) + AC_SUBST(MATH_LIBS) +]) + +#-------------------------------------------------------------------- +# TEA_TCL_EARLY_FLAGS +# +# Check for what flags are needed to be passed so the correct OS +# features are available. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# _ISOC99_SOURCE +# _LARGEFILE64_SOURCE +# _LARGEFILE_SOURCE64 +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_EARLY_FLAG],[ + AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), + AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, + AC_TRY_COMPILE([[#define ]$1[ 1 +]$2], $3, + [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, + [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) + if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then + AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) + tcl_flags="$tcl_flags $1" + fi +]) + +AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ + AC_MSG_CHECKING([for required early compiler flags]) + tcl_flags="" + TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], + [char *p = (char *)strtoll; char *q = (char *)strtoull;]) + TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], + [struct stat64 buf; int i = stat64("/", &buf);]) + TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ], + [char *p = (char *)open64;]) + if test "x${tcl_flags}" = "x" ; then + AC_MSG_RESULT([none]) + else + AC_MSG_RESULT([${tcl_flags}]) + fi +]) + +#-------------------------------------------------------------------- +# TEA_TCL_64BIT_FLAGS +# +# Check for what is defined in the way of 64-bit features. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# TCL_WIDE_INT_IS_LONG +# TCL_WIDE_INT_TYPE +# HAVE_STRUCT_DIRENT64 +# HAVE_STRUCT_STAT64 +# HAVE_TYPE_OFF64_T +# +#-------------------------------------------------------------------- + +AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ + AC_MSG_CHECKING([for 64-bit integer type]) + AC_CACHE_VAL(tcl_cv_type_64bit,[ + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 + AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], + tcl_type_64bit=__int64, tcl_type_64bit="long long") + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + AC_TRY_COMPILE(,[switch (0) { + case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; + }],tcl_cv_type_64bit=${tcl_type_64bit})]) + if test "${tcl_cv_type_64bit}" = none ; then + AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) + AC_MSG_RESULT([using long]) + elif test "${tcl_cv_type_64bit}" = "__int64" \ + -a "${TEA_PLATFORM}" = "windows" ; then + # We actually want to use the default tcl.h checks in this + # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* + AC_MSG_RESULT([using Tcl header defaults]) + else + AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, + [What type should be used to define wide integers?]) + AC_MSG_RESULT([${tcl_cv_type_64bit}]) + + # Now check for auxiliary declarations + AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ + AC_TRY_COMPILE([#include +#include ],[struct dirent64 p;], + tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) + if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) + fi + + AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ + AC_TRY_COMPILE([#include ],[struct stat64 p; +], + tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) + fi + + AC_CHECK_FUNCS(open64 lseek64) + AC_MSG_CHECKING([for off64_t]) + AC_CACHE_VAL(tcl_cv_type_off64_t,[ + AC_TRY_COMPILE([#include ],[off64_t offset; +], + tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) + dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the + dnl functions lseek64 and open64 are defined. + if test "x${tcl_cv_type_off64_t}" = "xyes" && \ + test "x${ac_cv_func_lseek64}" = "xyes" && \ + test "x${ac_cv_func_open64}" = "xyes" ; then + AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + fi +]) + +## +## Here ends the standard Tcl configuration bits and starts the +## TEA specific functions +## + +#------------------------------------------------------------------------ +# TEA_INIT -- +# +# Init various Tcl Extension Architecture (TEA) variables. +# This should be the first called TEA_* macro. +# +# Arguments: +# none +# +# Results: +# +# Defines and substs the following vars: +# CYGPATH +# EXEEXT +# Defines only: +# TEA_VERSION +# TEA_INITED +# TEA_PLATFORM (windows or unix) +# +# "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. +# +# EXEEXT +# Select the executable extension based on the host type. This +# is a lightweight replacement for AC_EXEEXT that doesn't require +# a compiler. +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_INIT], [ + # TEA extensions pass this us the version of TEA they think they + # are compatible with. + TEA_VERSION="3.6" + + AC_MSG_CHECKING([for correct TEA configuration]) + if test x"${PACKAGE_NAME}" = x ; then + AC_MSG_ERROR([ +The PACKAGE_NAME variable must be defined by your TEA configure.in]) + fi + if test x"$1" = x ; then + AC_MSG_ERROR([ +TEA version not specified.]) + elif test "$1" != "${TEA_VERSION}" ; then + AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) + else + AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) + fi + case "`uname -s`" in + *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) + AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) + EXEEXT=".exe" + TEA_PLATFORM="windows" + ;; + *) + CYGPATH=echo + EXEEXT="" + TEA_PLATFORM="unix" + ;; + esac + + # Check if exec_prefix is set. If not use fall back to prefix. + # Note when adjusted, so that TEA_PREFIX can correct for this. + # This is needed for recursive configures, since autoconf propagates + # $prefix, but not $exec_prefix (doh!). + if test x$exec_prefix = xNONE ; then + exec_prefix_default=yes + exec_prefix=$prefix + fi + + AC_SUBST(EXEEXT) + AC_SUBST(CYGPATH) + + # This package name must be replaced statically for AC_SUBST to work + AC_SUBST(PKG_LIB_FILE) + # Substitute STUB_LIB_FILE in case package creates a stub library too. + AC_SUBST(PKG_STUB_LIB_FILE) + + # We AC_SUBST these here to ensure they are subst'ed, + # in case the user doesn't call TEA_ADD_... + AC_SUBST(PKG_STUB_SOURCES) + AC_SUBST(PKG_STUB_OBJECTS) + AC_SUBST(PKG_TCL_SOURCES) + AC_SUBST(PKG_HEADERS) + AC_SUBST(PKG_INCLUDES) + AC_SUBST(PKG_LIBS) + AC_SUBST(PKG_CFLAGS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_SOURCES -- +# +# Specify one or more source files. Users should check for +# the right platform before adding to their list. +# It is not important to specify the directory, as long as it is +# in the generic, win or unix subdirectory of $(srcdir). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_SOURCES +# PKG_OBJECTS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_SOURCES], [ + vars="$@" + for i in $vars; do + case $i in + [\$]*) + # allow $-var names + PKG_SOURCES="$PKG_SOURCES $i" + PKG_OBJECTS="$PKG_OBJECTS $i" + ;; + *) + # check for existence - allows for generic/win/unix VPATH + # To add more dirs here (like 'src'), you have to update VPATH + # in Makefile.in as well + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + AC_MSG_ERROR([could not find source file '$i']) + fi + PKG_SOURCES="$PKG_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" + fi + PKG_OBJECTS="$PKG_OBJECTS $j" + ;; + esac + done + AC_SUBST(PKG_SOURCES) + AC_SUBST(PKG_OBJECTS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_STUB_SOURCES -- +# +# Specify one or more source files. Users should check for +# the right platform before adding to their list. +# It is not important to specify the directory, as long as it is +# in the generic, win or unix subdirectory of $(srcdir). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_STUB_SOURCES +# PKG_STUB_OBJECTS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_STUB_SOURCES], [ + vars="$@" + for i in $vars; do + # check for existence - allows for generic/win/unix VPATH + if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ + -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ + ; then + AC_MSG_ERROR([could not find stub source file '$i']) + fi + PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" + # this assumes it is in a VPATH dir + i=`basename $i` + # handle user calling this before or after TEA_SETUP_COMPILER + if test x"${OBJEXT}" != x ; then + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" + else + j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" + fi + PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" + done + AC_SUBST(PKG_STUB_SOURCES) + AC_SUBST(PKG_STUB_OBJECTS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_TCL_SOURCES -- +# +# Specify one or more Tcl source files. These should be platform +# independent runtime files. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_TCL_SOURCES +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_TCL_SOURCES], [ + vars="$@" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) + fi + PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" + done + AC_SUBST(PKG_TCL_SOURCES) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_HEADERS -- +# +# Specify one or more source headers. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_HEADERS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_HEADERS], [ + vars="$@" + for i in $vars; do + # check for existence, be strict because it is installed + if test ! -f "${srcdir}/$i" ; then + AC_MSG_ERROR([could not find header file '${srcdir}/$i']) + fi + PKG_HEADERS="$PKG_HEADERS $i" + done + AC_SUBST(PKG_HEADERS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_INCLUDES -- +# +# Specify one or more include dirs. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_INCLUDES +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_INCLUDES], [ + vars="$@" + for i in $vars; do + PKG_INCLUDES="$PKG_INCLUDES $i" + done + AC_SUBST(PKG_INCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_LIBS -- +# +# Specify one or more libraries. Users should check for +# the right platform before adding to their list. For Windows, +# libraries provided in "foo.lib" format will be converted to +# "-lfoo" when using GCC (mingw). +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_LIBS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_LIBS], [ + vars="$@" + for i in $vars; do + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then + # Convert foo.lib to -lfoo for GCC. No-op if not *.lib + i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` + fi + PKG_LIBS="$PKG_LIBS $i" + done + AC_SUBST(PKG_LIBS) +]) + +#------------------------------------------------------------------------ +# TEA_ADD_CFLAGS -- +# +# Specify one or more CFLAGS. Users should check for +# the right platform before adding to their list. +# +# Arguments: +# one or more file names +# +# Results: +# +# Defines and substs the following vars: +# PKG_CFLAGS +#------------------------------------------------------------------------ +AC_DEFUN([TEA_ADD_CFLAGS], [ + PKG_CFLAGS="$PKG_CFLAGS $@" + AC_SUBST(PKG_CFLAGS) +]) + +#------------------------------------------------------------------------ +# TEA_PREFIX -- +# +# Handle the --prefix=... option by defaulting to what Tcl gave +# +# Arguments: +# none +# +# Results: +# +# If --prefix or --exec-prefix was not specified, $prefix and +# $exec_prefix will be set to the values given to Tcl when it was +# configured. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_PREFIX], [ + if test "${prefix}" = "NONE"; then + prefix_default=yes + if test x"${TCL_PREFIX}" != x; then + AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) + prefix=${TCL_PREFIX} + else + AC_MSG_NOTICE([--prefix defaulting to /usr/local]) + prefix=/usr/local + fi + fi + if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ + -o x"${exec_prefix_default}" = x"yes" ; then + if test x"${TCL_EXEC_PREFIX}" != x; then + AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) + exec_prefix=${TCL_EXEC_PREFIX} + else + AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) + exec_prefix=$prefix + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_SETUP_COMPILER_CC -- +# +# Do compiler checks the way we want. This is just a replacement +# for AC_PROG_CC in TEA configure.in files to make them cleaner. +# +# Arguments: +# none +# +# Results: +# +# Sets up CC var and other standard bits we need to make executables. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_SETUP_COMPILER_CC], [ + # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) + # in this macro, they need to go into TEA_SETUP_COMPILER instead. + + # If the user did not set CFLAGS, set it now to keep + # the AC_PROG_CC macro from adding "-g -O2". + if test "${CFLAGS+set}" != "set" ; then + CFLAGS="" + fi + + AC_PROG_CC + AC_PROG_CPP + + AC_PROG_INSTALL + + #-------------------------------------------------------------------- + # Checks to see if the make program sets the $MAKE variable. + #-------------------------------------------------------------------- + + AC_PROG_MAKE_SET + + #-------------------------------------------------------------------- + # Find ranlib + #-------------------------------------------------------------------- + + AC_PROG_RANLIB + + #-------------------------------------------------------------------- + # Determines the correct binary file extension (.o, .obj, .exe etc.) + #-------------------------------------------------------------------- + + AC_OBJEXT + AC_EXEEXT +]) + +#------------------------------------------------------------------------ +# TEA_SETUP_COMPILER -- +# +# Do compiler checks that use the compiler. This must go after +# TEA_SETUP_COMPILER_CC, which does the actual compiler check. +# +# Arguments: +# none +# +# Results: +# +# Sets up CC var and other standard bits we need to make executables. +#------------------------------------------------------------------------ +AC_DEFUN([TEA_SETUP_COMPILER], [ + # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. + AC_REQUIRE([TEA_SETUP_COMPILER_CC]) + + #------------------------------------------------------------------------ + # If we're using GCC, see if the compiler understands -pipe. If so, use it. + # It makes compiling go faster. (This is only a performance feature.) + #------------------------------------------------------------------------ + + if test -z "$no_pipe" -a -n "$GCC"; then + AC_CACHE_CHECK([if the compiler understands -pipe], + tcl_cv_cc_pipe, [ + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" + AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_pipe = yes; then + CFLAGS="$CFLAGS -pipe" + fi + fi + + #-------------------------------------------------------------------- + # Common compiler flag setup + #-------------------------------------------------------------------- + + AC_C_BIGENDIAN + if test "${TEA_PLATFORM}" = "unix" ; then + TEA_TCL_LINK_LIBS + TEA_MISSING_POSIX_HEADERS + # Let the user call this, because if it triggers, they will + # need a compat/strtod.c that is correct. Users can also + # use Tcl_GetDouble(FromObj) instead. + #TEA_BUGGY_STRTOD + fi +]) + +#------------------------------------------------------------------------ +# TEA_MAKE_LIB -- +# +# Generate a line that can be used to build a shared/unshared library +# in a platform independent manner. +# +# Arguments: +# none +# +# Requires: +# +# Results: +# +# Defines the following vars: +# CFLAGS - Done late here to note disturb other AC macros +# MAKE_LIB - Command to execute to build the Tcl library; +# differs depending on whether or not Tcl is being +# compiled as a shared library. +# MAKE_SHARED_LIB Makefile rule for building a shared library +# MAKE_STATIC_LIB Makefile rule for building a static library +# MAKE_STUB_LIB Makefile rule for building a stub library +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_MAKE_LIB], [ + if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then + MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" + MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" + else + MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" + MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" + fi + + if test "${SHARED_BUILD}" = "1" ; then + MAKE_LIB="${MAKE_SHARED_LIB} " + else + MAKE_LIB="${MAKE_STATIC_LIB} " + fi + + #-------------------------------------------------------------------- + # Shared libraries and static libraries have different names. + # Use the double eval to make sure any variables in the suffix is + # substituted. (@@@ Might not be necessary anymore) + #-------------------------------------------------------------------- + + if test "${TEA_PLATFORM}" = "windows" ; then + if test "${SHARED_BUILD}" = "1" ; then + # We force the unresolved linking of symbols that are really in + # the private libraries of Tcl and Tk. + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" + fi + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + else + eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + if test "$GCC" = "yes"; then + PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} + fi + # These aren't needed on Windows (either MSVC or gcc) + RANLIB=: + RANLIB_STUB=: + else + RANLIB_STUB="${RANLIB}" + if test "${SHARED_BUILD}" = "1" ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" + if test x"${TK_BIN_DIR}" != x ; then + SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" + fi + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" + RANLIB=: + else + eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" + fi + # Some packages build their own stubs libraries + eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" + fi + + # These are escaped so that only CFLAGS is picked up at configure time. + # The other values will be substituted at make time. + CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" + if test "${SHARED_BUILD}" = "1" ; then + CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" + fi + + AC_SUBST(MAKE_LIB) + AC_SUBST(MAKE_SHARED_LIB) + AC_SUBST(MAKE_STATIC_LIB) + AC_SUBST(MAKE_STUB_LIB) + AC_SUBST(RANLIB_STUB) +]) + +#------------------------------------------------------------------------ +# TEA_LIB_SPEC -- +# +# Compute the name of an existing object library located in libdir +# from the given base name and produce the appropriate linker flags. +# +# Arguments: +# basename The base name of the library without version +# numbers, extensions, or "lib" prefixes. +# extra_dir Extra directory in which to search for the +# library. This location is used first, then +# $prefix/$exec-prefix, then some defaults. +# +# Requires: +# TEA_INIT and TEA_PREFIX must be called first. +# +# Results: +# +# Defines the following vars: +# ${basename}_LIB_NAME The computed library name. +# ${basename}_LIB_SPEC The computed linker flags. +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LIB_SPEC], [ + AC_MSG_CHECKING([for $1 library]) + + # Look in exec-prefix for the library (defined by TEA_PREFIX). + + tea_lib_name_dir="${exec_prefix}/lib" + + # Or in a user-specified location. + + if test x"$2" != x ; then + tea_extra_lib_dir=$2 + else + tea_extra_lib_dir=NONE + fi + + for i in \ + `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ + `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ + `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do + if test -f "$i" ; then + tea_lib_name_dir=`dirname $i` + $1_LIB_NAME=`basename $i` + $1_LIB_PATH_NAME=$i + break + fi + done + + if test "${TEA_PLATFORM}" = "windows"; then + $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" + else + # Strip off the leading "lib" and trailing ".a" or ".so" + + tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` + $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" + fi + + if test "x${$1_LIB_NAME}" = x ; then + AC_MSG_ERROR([not found]) + else + AC_MSG_RESULT([${$1_LIB_SPEC}]) + fi +]) + +#------------------------------------------------------------------------ +# TEA_PRIVATE_TCL_HEADERS -- +# +# Locate the private Tcl include files +# +# Arguments: +# +# Requires: +# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has +# already been called. +# +# Results: +# +# Substs the following vars: +# TCL_TOP_DIR_NATIVE +# TCL_GENERIC_DIR_NATIVE +# TCL_UNIX_DIR_NATIVE +# TCL_WIN_DIR_NATIVE +# TCL_BMAP_DIR_NATIVE +# TCL_TOOL_DIR_NATIVE +# TCL_PLATFORM_DIR_NATIVE +# TCL_BIN_DIR_NATIVE +# TCL_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ + AC_MSG_CHECKING([for Tcl private include files]) + + TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` + TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" + TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" + TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" + TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" + TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" + TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" + TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" + + if test "${TEA_PLATFORM}" = "windows"; then + TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} + else + TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} + fi + # We want to ensure these are substituted so as not to require + # any *_NATIVE vars be defined in the Makefile + TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers and PrivateHeaders directories + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then + TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else + TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi + ;; + esac + else + if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then + AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) + fi + fi + + + AC_SUBST(TCL_TOP_DIR_NATIVE) + AC_SUBST(TCL_GENERIC_DIR_NATIVE) + AC_SUBST(TCL_UNIX_DIR_NATIVE) + AC_SUBST(TCL_WIN_DIR_NATIVE) + AC_SUBST(TCL_BMAP_DIR_NATIVE) + AC_SUBST(TCL_TOOL_DIR_NATIVE) + AC_SUBST(TCL_PLATFORM_DIR_NATIVE) + + AC_SUBST(TCL_INCLUDES) + AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) +]) + +#------------------------------------------------------------------------ +# TEA_PUBLIC_TCL_HEADERS -- +# +# Locate the installed public Tcl header files +# +# Arguments: +# None. +# +# Requires: +# CYGPATH must be set +# +# Results: +# +# Adds a --with-tclinclude switch to configure. +# Result is cached. +# +# Substs the following vars: +# TCL_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ + AC_MSG_CHECKING([for Tcl public headers]) + + AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) + + AC_CACHE_VAL(ac_cv_c_tclh, [ + # Use the value from --with-tclinclude, if it was given + + if test x"${with_tclinclude}" != x ; then + if test -f "${with_tclinclude}/tcl.h" ; then + ac_cv_c_tclh=${with_tclinclude} + else + AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) + fi + else + if test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use + # the framework's Headers directory + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tcl is not installed, + # and in that situation, look there before installed locations. + if test -f "${TCL_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + if test x"${TCL_INCLUDE_SPEC}" != x ; then + d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` + list="$list `ls -d ${d} 2>/dev/null`" + fi + fi + for i in $list ; do + if test -f "$i/tcl.h" ; then + ac_cv_c_tclh=$i + break + fi + done + fi + ]) + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tclh}" = x ; then + AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) + else + AC_MSG_RESULT([${ac_cv_c_tclh}]) + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` + + TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + AC_SUBST(TCL_INCLUDES) +]) + +#------------------------------------------------------------------------ +# TEA_PRIVATE_TK_HEADERS -- +# +# Locate the private Tk include files +# +# Arguments: +# +# Requires: +# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has +# already been called. +# +# Results: +# +# Substs the following vars: +# TK_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ + AC_MSG_CHECKING([for Tk private include files]) + + TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` + TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" + TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" + TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" + TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" + TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" + if test "${TEA_PLATFORM}" = "windows"; then + TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} + else + TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} + fi + # We want to ensure these are substituted so as not to require + # any *_NATIVE vars be defined in the Makefile + TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" + # Detect and add ttk subdir + if test -d ${TK_SRC_DIR_NATIVE}/generic/ttk; then + TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" + fi + if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ + -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" + fi + if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" + fi + if test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use + # the framework's Headers and PrivateHeaders directories + case ${TK_DEFS} in + *TK_FRAMEWORK*) + if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then + TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi + ;; + esac + else + if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then + AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) + fi + fi + + AC_SUBST(TK_TOP_DIR_NATIVE) + AC_SUBST(TK_UNIX_DIR_NATIVE) + AC_SUBST(TK_WIN_DIR_NATIVE) + AC_SUBST(TK_GENERIC_DIR_NATIVE) + AC_SUBST(TK_XLIB_DIR_NATIVE) + AC_SUBST(TK_PLATFORM_DIR_NATIVE) + + AC_SUBST(TK_INCLUDES) + AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) +]) + +#------------------------------------------------------------------------ +# TEA_PUBLIC_TK_HEADERS -- +# +# Locate the installed public Tk header files +# +# Arguments: +# None. +# +# Requires: +# CYGPATH must be set +# +# Results: +# +# Adds a --with-tkinclude switch to configure. +# Result is cached. +# +# Substs the following vars: +# TK_INCLUDES +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ + AC_MSG_CHECKING([for Tk public headers]) + + AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) + + AC_CACHE_VAL(ac_cv_c_tkh, [ + # Use the value from --with-tkinclude, if it was given + + if test x"${with_tkinclude}" != x ; then + if test -f "${with_tkinclude}/tk.h" ; then + ac_cv_c_tkh=${with_tkinclude} + else + AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) + fi + else + if test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use + # the framework's Headers directory. + case ${TK_DEFS} in + *TK_FRAMEWORK*) + list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" + ;; + esac + fi + + # Look in the source dir only if Tk is not installed, + # and in that situation, look there before installed locations. + if test -f "${TK_BIN_DIR}/Makefile" ; then + list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" + fi + + # Check order: pkg --prefix location, Tk's --prefix location, + # relative to directory of tkConfig.sh, Tcl's --prefix location, + # relative to directory of tclConfig.sh. + + eval "temp_includedir=${includedir}" + list="$list \ + `ls -d ${temp_includedir} 2>/dev/null` \ + `ls -d ${TK_PREFIX}/include 2>/dev/null` \ + `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" + if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then + list="$list /usr/local/include /usr/include" + fi + for i in $list ; do + if test -f "$i/tk.h" ; then + ac_cv_c_tkh=$i + break + fi + done + fi + ]) + + # Print a message based on how we determined the include path + + if test x"${ac_cv_c_tkh}" = x ; then + AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) + else + AC_MSG_RESULT([${ac_cv_c_tkh}]) + fi + + # Convert to a native path and substitute into the output files. + + INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` + + TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + + AC_SUBST(TK_INCLUDES) + + if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ + -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then + # On Windows and Aqua, we need the X compat headers + AC_MSG_CHECKING([for X11 header files]) + if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then + INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" + TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" + AC_SUBST(TK_XINCLUDES) + fi + AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) + fi +]) + +#------------------------------------------------------------------------ +# TEA_PROG_TCLSH +# Determine the fully qualified path name of the tclsh executable +# in the Tcl build directory or the tclsh installed in a bin +# directory. This macro will correctly determine the name +# of the tclsh executable even if tclsh has not yet been +# built in the build directory. The tclsh found is always +# associated with a tclConfig.sh file. This tclsh should be used +# only for running extension test cases. It should never be +# or generation of files (like pkgIndex.tcl) at build time. +# +# Arguments +# none +# +# Results +# Subst's the following values: +# TCLSH_PROG +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PROG_TCLSH], [ + AC_MSG_CHECKING([for tclsh]) + if test -f "${TCL_BIN_DIR}/Makefile" ; then + # tclConfig.sh is in Tcl build directory + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="${TCL_BIN_DIR}/tclsh" + fi + else + # tclConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" + fi + list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${TCLSH_PROG}" ; then + REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" + fi + AC_MSG_RESULT([${TCLSH_PROG}]) + AC_SUBST(TCLSH_PROG) +]) + +#------------------------------------------------------------------------ +# TEA_PROG_WISH +# Determine the fully qualified path name of the wish executable +# in the Tk build directory or the wish installed in a bin +# directory. This macro will correctly determine the name +# of the wish executable even if wish has not yet been +# built in the build directory. The wish found is always +# associated with a tkConfig.sh file. This wish should be used +# only for running extension test cases. It should never be +# or generation of files (like pkgIndex.tcl) at build time. +# +# Arguments +# none +# +# Results +# Subst's the following values: +# WISH_PROG +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PROG_WISH], [ + AC_MSG_CHECKING([for wish]) + if test -f "${TK_BIN_DIR}/Makefile" ; then + # tkConfig.sh is in Tk build directory + if test "${TEA_PLATFORM}" = "windows"; then + WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" + else + WISH_PROG="${TK_BIN_DIR}/wish" + fi + else + # tkConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" + else + WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" + fi + list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TK_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${WISH_PROG}" ; then + REAL_TK_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" + fi + AC_MSG_RESULT([${WISH_PROG}]) + AC_SUBST(WISH_PROG) +]) + +#------------------------------------------------------------------------ +# TEA_PATH_CONFIG -- +# +# Locate the ${1}Config.sh file and perform a sanity check on +# the ${1} compile flags. These are used by packages like +# [incr Tk] that load *Config.sh files from more than Tcl and Tk. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-$1=... +# +# Defines the following vars: +# $1_BIN_DIR Full path to the directory containing +# the $1Config.sh file +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_CONFIG], [ + # + # Ok, lets find the $1 configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-$1 + # + + if test x"${no_$1}" = x ; then + # we reset no_$1 in case something fails here + no_$1=true + AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) + AC_MSG_CHECKING([for $1 configuration]) + AC_CACHE_VAL(ac_cv_c_$1config,[ + + # First check to see if --with-$1 was specified. + if test x"${with_$1config}" != x ; then + case ${with_$1config} in + */$1Config.sh ) + if test -f ${with_$1config}; then + AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) + with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` + fi;; + esac + if test -f "${with_$1config}/$1Config.sh" ; then + ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` + else + AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) + fi + fi + + # then check for a private $1 installation + if test x"${ac_cv_c_$1config}" = x ; then + for i in \ + ../$1 \ + `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ../../$1 \ + `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ../../../$1 \ + `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ${srcdir}/../$1 \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ + `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ + ; do + if test -f "$i/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i; pwd)` + break + fi + if test -f "$i/unix/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i/unix; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_$1config}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/$1Config.sh" ; then + ac_cv_c_$1config=`(cd $i; pwd)` + break + fi + done + fi + ]) + + if test x"${ac_cv_c_$1config}" = x ; then + $1_BIN_DIR="# no $1 configs found" + AC_MSG_WARN([Cannot find $1 configuration definitions]) + exit 0 + else + no_$1= + $1_BIN_DIR=${ac_cv_c_$1config} + AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) + fi + fi +]) + +#------------------------------------------------------------------------ +# TEA_LOAD_CONFIG -- +# +# Load the $1Config.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# $1_BIN_DIR +# +# Results: +# +# Subst the following vars: +# $1_SRC_DIR +# $1_LIB_FILE +# $1_LIB_SPEC +# +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_LOAD_CONFIG], [ + AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) + + if test -f "${$1_BIN_DIR}/$1Config.sh" ; then + AC_MSG_RESULT([loading]) + . "${$1_BIN_DIR}/$1Config.sh" + else + AC_MSG_RESULT([file not found]) + fi + + # + # If the $1_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable $1_LIB_SPEC will be set to the value + # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC + # instead of $1_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + # + + if test -f "${$1_BIN_DIR}/Makefile" ; then + AC_MSG_WARN([Found Makefile - using build library specs for $1]) + $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} + $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} + $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} + fi + + AC_SUBST($1_VERSION) + AC_SUBST($1_BIN_DIR) + AC_SUBST($1_SRC_DIR) + + AC_SUBST($1_LIB_FILE) + AC_SUBST($1_LIB_SPEC) + + AC_SUBST($1_STUB_LIB_FILE) + AC_SUBST($1_STUB_LIB_SPEC) + AC_SUBST($1_STUB_LIB_PATH) +]) + +#------------------------------------------------------------------------ +# TEA_PATH_CELIB -- +# +# Locate Keuchel's celib emulation layer for targeting Win/CE +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-celib=... +# +# Defines the following vars: +# CELIB_DIR Full path to the directory containing +# the include and platform lib files +#------------------------------------------------------------------------ + +AC_DEFUN([TEA_PATH_CELIB], [ + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-celib + + if test x"${no_celib}" = x ; then + # we reset no_celib in case something fails here + no_celib=true + AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) + AC_MSG_CHECKING([for Windows/CE celib directory]) + AC_CACHE_VAL(ac_cv_c_celibconfig,[ + # First check to see if --with-celibconfig was specified. + if test x"${with_celibconfig}" != x ; then + if test -d "${with_celibconfig}/inc" ; then + ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` + else + AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) + fi + fi + + # then check for a celib library + if test x"${ac_cv_c_celibconfig}" = x ; then + for i in \ + ../celib-palm-3.0 \ + ../celib \ + ../../celib-palm-3.0 \ + ../../celib \ + `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ + ${srcdir}/../celib-palm-3.0 \ + ${srcdir}/../celib \ + `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ + ; do + if test -d "$i/inc" ; then + ac_cv_c_celibconfig=`(cd $i; pwd)` + break + fi + done + fi + ]) + if test x"${ac_cv_c_celibconfig}" = x ; then + AC_MSG_ERROR([Cannot find celib support library directory]) + else + no_celib= + CELIB_DIR=${ac_cv_c_celibconfig} + CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` + AC_MSG_RESULT([found $CELIB_DIR]) + fi + fi +]) + + +# Local Variables: +# mode: autoconf +# End: Index: tests/UNIVERSAL.test =================================================================== diff -u -N --- tests/UNIVERSAL.test (revision 0) +++ tests/UNIVERSAL.test (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,48 @@ +# $Id $ +#if {[set ::tcl_platform(platform)] == "windows"} {lappend auto_path .} + +package require XOTcl; namespace import -force xotcl::* +set pkgdir [file dir [info script]]/.. +lappend auto_path $pkgdir + +package require xotcl::test + +set tclsh [info nameofexecutable] +set dir [file dir [info script]] +set univApps $dir/../apps/actiweb/univ + +set startCmd "$tclsh $univApps/UNIVERSAL.xotcl \ + -instanceFile $univApps/UNIVERSAL.rdf \ + -cssFile UNIVERSAL.css \ + -root $dir/../apps/actiweb/univ \ + -pkgdir $pkgdir" +puts stderr "starting $startCmd" +set PIPE [open "|$startCmd"] + +package require xotcl::comm::httpAccess +proc printError msg {puts stderr !!!$msg!!!} + +Class T -superclass Test -parameter { + {count 1} + {errorReport { + puts "\tcontent-length: \[r0::sink set contentLength\]\n\ + \tstatus-code: \[\[r0 set token\] set responseCode\]\n\[r0 getContent]" + }}} + +T new -msg "Load homepage frame von univ ... " \ + -setResult {expr [r0::sink set contentLength] == 358} \ + -cmd [list SimpleRequest r0 -url http://localhost:8095/ ] +T new -msg "Load Catalog ... " \ + -setResult {expr [r0::sink set contentLength] == 1744} \ + -cmd [list SimpleRequest r0 -url http://localhost:8095/univ+catalog ] +T new -msg "Detail Page ... " \ + -setResult {expr [r0::sink set contentLength] == 2327} \ + -cmd [list SimpleRequest r0 -url http://localhost:8095/univ+details+http://nm.wu-wien.ac.at/Lehre/oo1/] +T new -msg "terminate" -cmd [list SimpleRequest r0 -url http://localhost:8095/receiver::exit] \ + -setResult {set x 1} \ + -post {catch {close $::PIPE}; exit} + +after 1000 {Test run} +vwait forever + + Index: tests/actiweb.test =================================================================== diff -u -N --- tests/actiweb.test (revision 0) +++ tests/actiweb.test (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,84 @@ +# -*- Mode: tcl -*- +# $Id: actiweb.test,v 1.9 2006/09/27 08:12:40 neumann Exp $ +# regression test for actiweb examples +#if {[set ::tcl_platform(platform)] == "windows"} { +# lappend auto_path . +#} +package require XOTcl; namespace import -force ::xotcl::* +set pkgDir [file dirname [info script]]/.. +lappend auto_path $pkgDir +package require xotcl::test +#package require xotcl::package; package verbose 1 +package require xotcl::comm::httpAccess +#package require xotcl::trace + +set tclsh [info nameofexecutable] +set dir [file dir [info script]] +set actiwebApps $dir/../apps/actiweb + +# remove persitent vars to get reproducible behavior +catch [file delete -force receiver] +proc terminate {} { + catch [file delete -force receiver] + exit +} + +puts "$tclsh ${actiwebApps}/Counter.xotcl" +puts "------------------------------------ $tclsh ${actiwebApps}/Counter.xotcl -pkgdir $pkgDir" +set PIPE1 [open "| $tclsh ${actiwebApps}/Counter.xotcl -pkgdir $pkgDir"] +set PIPE2 [open "| $tclsh ${actiwebApps}/Counter2.xotcl -pkgdir $pkgDir"] +set PIPE3 [open "| $tclsh ${actiwebApps}/Counter3.xotcl -pkgdir $pkgDir"] +set PIPE4 [open "| $tclsh ${actiwebApps}/Counter4.xotcl -pkgdir $pkgDir"] +set PIPE5 [open "| $tclsh ${actiwebApps}/MC.xotcl -pkgdir $pkgDir"] + +proc printError msg {puts stderr !!!$msg!!!} + +Class T -superclass Test -parameter { + {count 1} + {errorReport { + puts "\tcontent-length: \[r0::sink set contentLength\]\n\ + \tstatus-code: \[\[r0 set token\] set responseCode\]" + }}} + + +T new -msg "Trying Counter.xotcl ... " \ + -setResult {regexp {^The value in counter-1.html is now: 0} [r0::sink set d]} \ + -cmd [list SimpleRequest r0 -url http://localhost:8090/counter-1.html] +T new -msg "terminate Counter" -setResult {set x 1} \ + -cmd [list SimpleRequest r0 -url http://localhost:8090/receiver::exit] \ + -post {catch {close $::PIPE1}} + +T new -msg "Trying Counter2.xotcl ... " \ + -setResult {r0 getContentLength} \ + -expected 238 \ + -cmd [list SimpleRequest r0 -url http://localhost:8091/web-c1] +T new -msg "terminate Counter1" -setResult {set x 1} \ + -cmd [list SimpleRequest r0 -url http://localhost:8091/receiver::exit] \ + -post {catch {close $::PIPE2}} + +T new -msg "Trying Counter3.xotcl ... " \ + -setResult {r0 getContentLength} \ + -expected 122 \ + -cmd [list SimpleRequest r0 -url http://localhost:8093/c1] +T new -msg "terminate Counter3" -setResult {set x 1} \ + -cmd [list SimpleRequest r0 -url http://localhost:8093/receiver::exit] \ + -post {catch {close $::PIPE3}} + +T new -msg "Trying Counter4.xotcl (a) ... " \ + -setResult {r0 getContentLength} \ + -expected 126 \ + -cmd [list SimpleRequest r0 -url http://localhost:8094/wc1] +T new -msg "terminate Counter4" -setResult {set x 1} \ + -cmd [list SimpleRequest r0 -url http://localhost:8094/receiver::exit] \ + -post {catch {close $::PIPE4}} + +T new -msg "Trying MC.xotcl ... " \ + -setResult {r0 getContentLength} \ + -expected 1767 \ + -cmd [list SimpleRequest r0 -url http://localhost:8092/Gustaf.html ] +T new -msg "terminate MC" -setResult {set x 1} \ + -cmd [list SimpleRequest r0 -url http://localhost:8092/receiver::exit] \ + -post {catch {close $::PIPE5}; exit} + +after 4000 {Test run} +catch {vwait forever} Index: tests/forwardtest.xotcl =================================================================== diff -u -N --- tests/forwardtest.xotcl (revision 0) +++ tests/forwardtest.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,323 @@ +# $Id: forwardtest.xotcl,v 1.12 2007/08/14 16:38:27 neumann Exp $ +package require XOTcl +namespace import -force xotcl::* +package require xotcl::test + +proc ? {cmd expected} { + set t [Test new -cmd $cmd] + $t expected $expected + $t run +} + +########################################### +# trivial object delegation +########################################### +Object dog +Object tail +tail proc wag args { return $args } +dog forward wag tail %proc + +? {dog wag 100} 100 + + +########################################### +# evaluating in scope +########################################### +Class X -parameter {{x 1}} +X instforward Incr -objscope incr + +X x1 -x 100 +x1 Incr x +x1 Incr x +x1 Incr x +? {x1 x} 103 +#puts "======" + +########################################### +# adding +########################################### +Object obj +obj forward addOne expr 1 + + +? {obj addOne 5} 6 +#puts "======" + +########################################### +# more arguments +########################################### +Object target +target proc foo args {return $args} +obj forward foo target %proc %self a1 a2 + +? {obj foo x1 x2} [list ::obj a1 a2 x1 x2] + +obj forward foo target %proc %self %%self %%p +? {obj foo x1 x2} [list ::obj %self %p x1 x2] + +#puts "======" + + +########################################### +# mixin example +########################################### +Object create mixin +mixin proc unknown {m args} {return [concat [self] $m $args]} + +obj forward Mixin mixin %1 %self +? {obj Mixin add M1} [list ::mixin add ::obj M1] +? {catch {obj Mixin}} 1 + + +obj forward Mixin -default {getter setter} mixin %1 %self +? {obj Mixin add M1} [list ::mixin add ::obj M1] +? {obj Mixin M1} [list ::mixin setter ::obj M1] +? {obj Mixin} [list ::mixin getter ::obj] +#puts "======" + + +########################################### +# sketching extensibe info +########################################### +Object Info +Info proc @mixin {o} { + $o info mixin +} +Info proc @class {o} { ;# without prefix, doing here a [Info class] wod be wrong + $o info class +} +Info proc @help {o} { ;# define a new subcommand for info + foreach c [my info procs] {lappend result [string range $c 1 end]} + return $result +} +Object instforward Info -methodprefix @ Info %1 %self + +? {x1 Info class} ::X +? {x1 Info help} [list help mixin class] + +########################################### +# variations of placement of options +########################################### +obj set x 1 +obj forward i1 -objscope incr x + +? {obj i1} 2 +#puts "======" + +########################################### +# introspeciton options +########################################### +Class C +C instforward Info -methodprefix @ Info %1 %self + +? {C info instforward} Info +C instforward XXXo x +? {lsort [C info instforward]} [list Info XXXo] + +? {C info instforward X*} [list XXXo] +? {lsort [C info instforward *o]} [list Info XXXo] + +# delete the forwarder +C instproc XXXo {} {} +? {C info instforward} [list Info] +# get the definition of a instforwarder +? {C info instforward -definition Info} [list -methodprefix @ Info %1 %self] + +# chek introspection for objects +? {lsort [obj info forward]} "Mixin addOne foo i1" +? {obj info forward -definition Mixin} "-default {getter setter} mixin %1 %self" +? {obj info forward -definition addOne} "expr 1 +" +? {obj info forward -definition foo} "target %proc %self %%self %%p" +? {obj info forward -definition i1} "-objscope ::incr x" +#puts "======" + +########################################### +# test serializer +########################################### +package require xotcl::serializer +obj proc test {} {puts "i am [self proc]"} +set a [Serializer deepSerialize obj] +#puts <<$a>> +eval $a +? {set ::a} [Serializer deepSerialize obj] + +########################################### +# test optional target cmd +########################################### +obj set x 2 +obj forward append -objscope +? {obj append x y z} 2yz + +Object n; Object n::x; Object o; +o forward ::n::x +? {o x self} ::n::x + +########################################### +# arg including instvar +########################################### +obj set x 10 +obj forward x* expr {%my set x} * +? {obj x* 10} "100" + +########################################### +# positional arguments +########################################### + +obj forward @end-13 list {%@end 13} +? {obj @end-13 1 2 3 } [list 1 2 3 13] + +obj forward @-1-13 list {%@-1 13} +? {obj @-1-13 1 2 3 } [list 1 2 13 3] + +obj forward @1-13 list {%@1 13} +? {obj @1-13 1 2 3 } [list 13 1 2 3] +? {obj @1-13} [list 13] + +obj forward @2-13 list {%@2 13} +? {obj @2-13 1 2 3 } [list 1 13 2 3] + +obj forward @list 10 {%@0 list} {%@end 99} +? {obj @list} [list 10 99] +? {obj @list a b c} [list 10 a b c 99] + +obj forward @list {%@end 99} {%@0 list} 10 +? {obj @list} [list 10 99] +? {obj @list a b c} [list 10 a b c 99] + +obj forward @list {%@2 2} {%@1 1} {%@0 list} +? {obj @list} [list 1 2] +? {obj @list a b c} [list 1 2 a b c] + +obj forward @list x y z {%@0 list} {%@1 1} {%@2 2} +? {obj @list} [list 1 2 x y z] +? {obj @list a b c} [list 1 2 x y z a b c] + +obj forward @list x y z {%@2 2} {%@1 1} {%@0 list} +? {obj @list} [list x 1 y 2 z] +? {obj @list a b c} [list x 1 y 2 z a b c] + +############################################### +# substitution depending on number of arguments +############################################### + +obj forward f %self [list %argclindex [list a b c]] +obj proc a args {return [list [self proc] $args]} +obj proc b args {return [list [self proc] $args]} +obj proc c args {return [list [self proc] $args]} +? {obj f} [list a {}] +? {obj f 1 } [list b 1] +? {obj f 1 2} [list c {1 2}] +? {catch {obj f 1 2 3}} 1 + +############################################### +# option earlybinding +############################################### +obj forward s -earlybinding ::set %proc +? {obj s 100} 100 +? {obj s} 100 + +Object instproc f args { next } + +Class NS +Class NS::Main + +NS::Main proc m1 {} { my m2 } + +NS::Main proc m2 {} { + ? {namespace eval :: {Object toplevelObj1}} ::toplevelObj1 + + ? [list set _ [namespace current]] ::NS + ? [list set _ [NS create m1]] ::NS::m1 + NS filter f + ? [list set _ [NS create m2]] ::NS::m2 + NS filter "" + + namespace eval ::test { + ? [list set _ [NS create m3]] ::test::m3 + NS filter f + ? [list set _ [NS create m4]] ::test::m4 + NS filter "" + } + + namespace eval test { + ? [list set _ [NS create m5]] ::NS::test::m5 + NS filter f + ? [list set _ [NS create m6]] ::NS::test::m6 + NS filter "" + } + +} + +NS::Main instproc i1 {} { my i2 } + +NS::Main instproc i2 {} { + ? {namespace eval :: {Object toplevelObj2}} ::toplevelObj2 + + ? [list set _ [namespace current]] ::NS + ? [list set _ [NS create i1]] ::NS::i1 + NS filter f + ? [list set _ [NS create i2]] ::NS::i2 + NS filter "" + + namespace eval ::test { + ? [list set _ [NS create i3]] ::test::i3 + NS filter f + ? [list set _ [NS create i4]] ::test::i4 + NS filter "" + } + + namespace eval test { + ? [list set _ [NS create i5]] ::NS::test::i5 + NS filter f + ? [list set _ [NS create i6]] ::NS::test::i6 + NS filter "" + } + +} + +#puts ==== +NS::Main m1 +NS::Main create m +m i1 + +#puts ==== +? [list set _ [NS create n1]] ::n1 +NS filter f +? [list set _ [NS create n2]] ::n2 +NS filter "" + +#puts ==== +namespace eval test { + ? [list set _ [NS create n1]] ::test::n1 + ? [list set _ [NS create n3]] ::test::n3 + NS filter f + ? [list set _ [NS create n4]] ::test::n4 + NS filter "" +} + +########################################### +# forward to expr + callstack +########################################### + +Object instforward expr -objscope + +Class C +C instproc xx {} {self} +C proc t {o expr} { + return [$o expr $expr] +} +C create c1 + +#puts ==== +? {c1 expr {[self]}} ::c1 +? {c1 expr {[self] == "::c1"}} 1 +? {c1 expr {[my xx]}} ::c1 +? {c1 expr {[my info class]}} ::C +? {c1 expr {[my istype C]}} 1 +? {c1 expr {[my istype ::C]}} 1 + +? {C t ::c1 {[self]}} ::c1 +? {C t ::c1 {[self] == "::c1"}} 1 +? {C t ::c1 {[my xx]}} ::c1 +? {C t ::c1 {[my info class]}} ::C +? {C t ::c1 {[my istype C]}} 1 +? {C t ::c1 {[my istype ::C]}} 1 \ No newline at end of file Index: tests/persistence.test =================================================================== diff -u -N --- tests/persistence.test (revision 0) +++ tests/persistence.test (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,401 @@ +#!../../src/xotclsh +# -*- Tcl -*- $Id: persistence.test,v 1.1 2004/05/23 22:50:39 neumann Exp $ +package require XOTcl; namespace import -force xotcl::* + +@ @File { + description { + Several tests for persistent stores and performance comparison. + The "-bigdb" command line option additionally starts a (longer) + big database test. The test automatically detects which storages + are avaiable. + } +} +array set opt {-bigdb 0 -bench 0} +array set opt $argv + +lappend auto_path [file dir [info script]]/.. + +#set auto_path ".. ../../src $auto_path" +#package require xotcl::package;package verbose 1 + +set storageCandidates {Sdbm Jufgdbm Mem Gdbm TextFile} +set storageCandidates {Sdbm Mem Gdbm TextFile} +#set storageCandidates {Gdbm} +set stores "" + +foreach store $storageCandidates { + if {![catch {package require xotcl::store::[string tolower $store]}]} { + lappend stores $store + } else { + puts "FAILED: package require xotcl::store::[string tolower $store]" + } +} + +puts "\nPersistence Test\n\nUsing the following Storages: \n $stores\n" + +set ::tests { + testStorageFeatures + Stores + Traverse + Store_Fetch_List + Store_Fetch_List_Same_Key + SimplePersistentObjects + LotsOfObjects +} + +if {$opt(-bigdb)} { + lappend ::tests bigdb + puts " ... bigdb test enabled.\n" +} else { + puts " ... bigdb test disabled.\n" +} +if {$opt(-bench)} { + set ::runs 10 + # don't use number >= 1000 because of SDBMs's char key length with the + # test SimplePersistentObjects + # don't use number > 272 because of SDBMs's key pairs max length of 1024 + # FIX THIS in FUTURE RELEASES!! + set ::iterations 272 +} else { + set ::runs 1 + set ::iterations 10 +} + +#package require xotcl::store::trace +#Storage=Gdbm instmixin TraceStorage + + +package require xotcl::store::persistence + +proc ::errorCheck {got expected msg} { + if {$got != $expected} { + puts stderr "FAILED: $msg\nGot: $got\nExpected: $expected" + exit -1 + } +} +proc ::errorCheckList {got expected msg} { + if {[lsort $got] != [lsort $expected]} { + puts stderr "FAILED: $msg\nGot: $got\nExpected: $expected" + exit -1 + } +} + +Class PersistenceTest + +@ Class PersistenceTest + +PersistenceTest instproc init args { + next +} + +PersistenceTest instproc testStorageFeatures {store} { + Storage=$store s + s open testDB + s set "{::a::s x} {x}" {a b c d} + s set "::a::s x" {{r t} a b c r} + s set ::a::t 7 + set result [s set ::a::t] + errorCheck $result 7 "Failed fetch ::a::t" + set result [s set "{::a::s x} {x}"] + errorCheck $result "a b c d" "Failed fetch {::a::s x} {x}" + set result [s set "::a::s x"] + errorCheck $result "{r t} a b c r" "Failed fetch ::a::s x" + + errorCheckList [s names] "{::a::s x} {{::a::s x} {x}} ::a::t" "Failed list -- all" + + set keys [list [s firstkey]] + while {[set nk [s nextkey]] != ""} {lappend keys $nk} + set keys [lappend keys [s firstkey]] + while {[set nk [s nextkey]] != ""} {lappend keys $nk} + + errorCheckList $keys "{{::a::s x} {x}} {::a::s x} ::a::t {{::a::s x} {x}} {::a::s x} ::a::t" "First/next key traversal failed." + + s unset "{::a::s x} {x}" + errorCheckList [s names] "{::a::s x} ::a::t" "Failed delete {::a::s x} {x}" + s unset "::a::s x" + errorCheckList [s names] "::a::t" "Failed delete ::a::s x" + + s close + s destroy + return " PASSED with $store" +} + +PersistenceTest instproc Traverse { store} { + Storage=$store s + s open testDB + for {set i 0} {$i < $::iterations} {incr i} { + set key "::a${i}" + set value "An value for the test $i $i $i\0" + s set $key $value + lappend resultKeys $key + lappend resultValues $value + } + + set keys [list [s firstkey]] + set values [list [s set $keys]] + while {[set nk [s nextkey]] != ""} { + lappend keys $nk + lappend values [s set $nk] + } + errorCheckList $keys $resultKeys "Failed Traverse keys" + errorCheckList $values $resultValues "Failed Traverse values" + s close + s destroy + return " PASSED with $store" +} + +PersistenceTest instproc Stores {store} { + Storage=$store s + s open testDB + for {set i 0} {$i < $::iterations} {incr i} { + s set "::a${i}" "An value for the test $i $i $i" + } + set list [s names] + errorCheck [llength $list] $::iterations "Failed Stores $::iterations -- Wrong \# of stored elements" + s close + s destroy + return " PASSED with $store" +} + +PersistenceTest instproc Store_Fetch_List {store} { + Storage=$store s + s open testDB + for {set i 0} {$i < $::iterations} {incr i} { + set key "::a${i}" + set value "An value for the test $i $i $i" + s set $key $value + set list [s names] + errorCheck [llength $list] [expr $i +1] "Failed Store_Fetch_List $::iterations -- Wrong \# of stored elements" + set result [s set $key] + errorCheck $result $value "Failed fetch Store_Fetch_List current key" + set result [s set "::a0"] + errorCheck $result "An value for the test 0 0 0" "Failed fetch Store_Fetch_List first key" + } + s close + s destroy + return " PASSED with $store" +} + +PersistenceTest instproc Store_Fetch_List_Same_Key {store} { + Storage=$store s + s open testDB + set key "Always the same key" + for {set i 0} {$i < $::iterations} {incr i} { + set value "An value for the test $i $i $i" + s set $key $value + set list [s names] + errorCheck [llength $list] 1 "Failed Store_Fetch_List_Same_Key $::iterations -- Wrong \# of stored elements" + set result [s set $key] + errorCheck $result $value "Failed fetch Store_Fetch_List_Same_Key current key" + } + + s close + s destroy + return " PASSED with $store" +} + +# +# tests dependent on the Persistence package +# + +PersistenceTest instproc SimplePersistentObjects {store} { + set ox 1; set oy 1; set py 1; set px 1; + set oza 1; set ozb 1; set onames [list a b] + set pza 1; set pzb 1; set pnames [list a b] + + + + #puts stderr mixin=[pmgr info mixin] + #pmgr mixin [concat TraceStorage [pmgr info mixin]] + + for {set i 0} {$i < $::iterations} {incr i} { + PersistenceMgr pmgr -dirName . \ + -fileName testDB -dbPackage $store + # Two example objects with variables set to default values + Object o + o set x 1 + o set y 1 + o set threeLines "a +b +c" + + o array set z {a 1 b 1} + Object p + p set x 1 + p set y 1 + p array set z {a 1 b 1} + + o mixin Persistent=Eager + p mixin Persistent=Lazy + # for the mem storage Lazy Persistence makes not much sense + if {$store == "Mem"} {p mixin Persistent=Eager} + + o persistenceMgr pmgr + p persistenceMgr pmgr + o persistent {x y z threeLines} + p persistent {x y z} + + o incr x 2 + incr ox 2 + o append y 1 + append oy 1 + p incr x 3 + incr px 3 + p append y 2 + append py 2 + + o incr z(a) 2 + incr oza 2 + o append z(b) 1 + append ozb 1 + o set z($i) 5 + lappend onames $i + + p incr z(a) 2 + incr pza 2 + p append z(b) 1 + append pzb 1 + p set z($i) 5 + lappend pnames $i + + errorCheck [o set x] $ox "Persistence: o->x Failed" + errorCheck [o set y] $oy "Persistence: o->y Failed" + errorCheck [o set z(a)] $oza "Persistence: o->z(a) Failed" + errorCheck [o set z(b)] $ozb "Persistence: o->z(b) Failed" + errorCheckList [o array names z] $onames "Array indizes got lost - o -" + errorCheck [p set x] $px "Persistence: p->x Failed" + errorCheck [p set y] $py "Persistence: p->y Failed" + errorCheckList [o array names z] $onames "Array indizes got lost" + errorCheck [p set z(a)] $pza "Persistence: p->z(a) Failed" + errorCheck [p set z(b)] $pzb "Persistence: p->z(b) Failed" + errorCheckList [p array names z] $pnames "Array indizes got lost - p -" + + errorCheck [o set threeLines] {a +b +c} "Three Lines Failed" + + o destroy + p destroy + pmgr destroy + } + + #errorCheck $ox 21 "Persistence: o->x End Result Failed" + #errorCheck $oy 11111111111 "Persistence: o->y End Result Failed" + #errorCheck $px 31 "Persistence: p->x End Result Failed" + #errorCheck $py 12222222222 "Persistence: p->y End Result Failed" + + return " PASSED with $store" +} + +PersistenceTest instproc LotsOfObjects {store} { + set secondLoopMax 1 + PersistenceMgr pmgr -dirName . \ + -fileName testDB -dbPackage $store + for {set i 0} {$i < $::iterations} {incr i} { + # we create 10 objects per iteration + for {set j 0} {$j < $secondLoopMax} {incr j} { + Object iHaveaVeryLongName${i}${j} + Object iHaveaVeryLongName${i}${j}::meToo${i}${j} + iHaveaVeryLongName${i}${j} mixin Persistent=Eager + iHaveaVeryLongName${i}${j} persistenceMgr pmgr + iHaveaVeryLongName${i}${j}::meToo${i}${j} mixin Persistent=Eager + iHaveaVeryLongName${i}${j}::meToo${i}${j} persistenceMgr pmgr + foreach var {a b c d e f g h i j k l m n o p} { + iHaveaVeryLongName${i}${j} set $var " some useless test ...... + with spaces and lines breaks iHaveaVeryLongName$i $var $i + " + iHaveaVeryLongName${i}${j} persistent $var + iHaveaVeryLongName${i}${j}::meToo${i}${j} set $var " some useless test ...... + with spaces and lines breaks iHaveaVeryLongName$i $var $i + " + iHaveaVeryLongName${i}${j}::meToo${i}${j} persistent $var + } + } + } + pmgr destroy + return " PASSED with $store" +} + +PersistenceTest instproc random modulo { ;### random number generator + [self] instvar seed + set seed [expr {($seed*12731+34197) % 21473}] + return [expr {$seed % $modulo}] +} + +PersistenceTest instproc bigdb {store} { + Storage=$store s + s open testDB + set max 100000 + [self] set seed 4711 + for {set i 0} {$i < $max} {incr i} { + s set $i $i + } + [self] set seed 4711 + for {set i 0} {$i < $max} {incr i} { + set key [[self] random $max] + set r [s set $key] + errorCheck $r $key "Failed bigdb $::iterations -- Wrong result $r instead of $key" + } + s close + s destroy + return " PASSED with $store" +} + + + +PersistenceTest instproc runOnce {} { + eval file delete -force testDB [glob -nocomplain testDB*] + catch {xotcl::memStoragePool remove testDB} + foreach test $::tests { + puts "[[self] set run]: $test $::iterations" + foreach s $::stores { + set t [time {set result [[self] $test $s]}] + [self] report $test $s $t $result + eval file delete -force testDB [glob -nocomplain testDB*] + catch {xotcl::memStoragePool remove testDB} + } + } +} +PersistenceTest instproc run {runs} { + [self] instvar run + for {set run 1} {$run<=$runs} {incr run} { + pt runOnce + } +} + +PersistenceTest instproc report {test store time result} { + if {![regexp {^(-?[0-9]+) +(.*)$} $time _ ms string]} { + puts stderr "time <$time> could not be parsed" + return + } + set key bench($test,$store) + set better " " + if {[[self] exists $key]} { + if {[[self] set $key] > $ms} { + [self] set $key $ms + set better "+" + } + } else { + [self] set $key $ms + } + puts "[[self] set run]: [format %-22s $result]\ + $better[format %10d $ms] $string" +} + +PersistenceTest instproc table {} { + set f [open "persistent.cvs" w] + foreach test $::tests { + set values "" + foreach store $::stores { + lappend values [[self] set bench($test,$store)] + } + puts "[format %-30s $test];[join $values {;}]" + puts $f "[format %-30s $test];[join $values {;}]" + } + close $f +} + +PersistenceTest pt -run $::runs +if {$opt(-bench)} { + pt table +} Index: tests/slottest.xotcl =================================================================== diff -u -N --- tests/slottest.xotcl (revision 0) +++ tests/slottest.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,618 @@ +# $Id: slottest.xotcl,v 1.5 2007/08/14 16:38:27 neumann Exp $ +package require XOTcl +namespace import -force xotcl::* +package require xotcl::test + +proc ? {cmd expected} { + set t [Test new -cmd $cmd -count 100] + $t expected $expected + $t run +} + +proc t {cmd expected {txt ""}} { + set t [Test new -cmd $cmd -msg $txt] + $t expected $expected + $t run +} + +# what's new: +# - slots instances are manager objects for slot values +# - generalization of slots to have different kind of domains and managers +# - slots for objects and classes (slot parameter 'per-object' true|false, +# when to used on a class object) +# - works for mixins/filters/class/superclass (e.g ... superclass add ::M) +# - initcmd and valuecmd +# initcmd: is executed when the instance variable is read the first time +# valuecmd: is executed whenever the instance variable is read +# (implemented via trace; alternate approach for similar behavior +# is to define per-object procs for get/assign, see e.g. slots for +# class and superclass; slots require methods to be invoked, +# not var references; +# otoh, trace are somewhat more fragile and harder to debug) +# default, initcmd and valuecmd are to be used mutually exclusively +# - valuechangedcmd: executed after the change of an instance variable, +# can be used e.g. for validation +# +# -gustaf neumann 21.Jan. 2006 + +package require xotcl::serializer + +#proc ? {cmd expected} { +# set r [eval $cmd] +# if {$r ne $expected} {error "$cmd returned '$r' ne '$expected'"} +#} + +# proc t {cmd {txt ""}} { +# set n 1000 +# #set ms [lindex [time [list time $cmd $n] 10] 0] +# set ms [lindex [time [list time $cmd $n] 5] 0] +# puts "[format %7.4f [expr {$ms*1.0/$n}]]ms for [format %-30s $cmd] ($txt)" +# } +####################################################### +# testing __initcmds +set ::hu 0 +proc T1 {var sub op} {c1 set $var t1} +proc T2 {var sub op} {c1 set $var t2} +Class C -array set __initcmds { + x {set x 1} + y {incr ::hu} + z {my trace add variable z read T1}} +C create c1 +? {c1 info vars x} x +? {c1 info vars y} "" +? {c1 set x} 1 +? {set ::hu} 1 + +Class D -array set __initcmds { + x {set x 2} + z {my trace add variable z read T2}} -superclass C +D create c1 +? {c1 set x} 2 +? {c1 set z} t2 +? {set ::hu} 2 + +####################################################### +# +# a small helper +Object instproc slots cmds { + if {![my isobject [self]::slot]} {Object create [self]::slot} + namespace eval [self]::slot $cmds +} + +###################### +# system slots +###################### + +Class M +Class O -mixin M +? {catch {Object o -mixin check1 M}} 1 +? {O mixin} ::M +Class M2 +O mixin add M2 +? {O mixin} {::M2 ::M} +O mixin M2 +? {O mixin} ::M2 +O mixin "" +? {O mixin} "" +O mixin set M ;# not sure, whether we should keep set here, or use assign or some better term +? {O mixin} ::M +? {O mixin ""} "" + +# with slots like class etc. we have to option to +# a) rename the original command like in the following +# b) provide a no-op value, such that we define only meta-data in the slot +# c) define a low-level tcl command like setrelation (or extend it) to handle the setter + +# "class" is not multivalued, therefore we should not add (or remove) add/delete +# from the set of subcommands... +? {::xotcl::InfoSlot class} "::xotcl::MetaSlot" +O o1 +? {o1 class} "::O" +o1 class Object +? {o1 class} "::xotcl::Object" +? {catch {o1 class add M}} 1 + + +? {O superclass} "::xotcl::Object" +Class O2 -superclass O + +#t {O2 superclass O} "superclass 1" +? {O superclass} "::xotcl::Object" + +::xotcl::Slot instproc slot {object name property} { + switch $property { + self {return [self]} + domain {return [my domain]} + } +} + +? {O superclass slot self} "::xotcl::Class::slot::superclass" +? {O superclass slot domain} "::xotcl::Class" + + +? {O2 superclass} "::O" +O2 superclass add M +? {O2 superclass} "::M ::O" +O2 superclass delete ::O +? {O2 superclass} "::M" + + +# the main difference between an Attribute and a Role is that +# it references some other objects +#Class Attribute -superclass ::xotcl::Slot +Class Role -superclass Attribute -parameter {references} + +###################### +# application classes +###################### +Class Person -slots { + Attribute name + Attribute age -default 0 +} + +Class Article -slots { + Attribute title + Attribute date +} + +Class publishes -slots { + Role written_by -references Person -multivalued true + Role has_published -references Paper -multivalued true +} + +Class Project -slots { + Attribute name + Role manager -references Person + Role member -references Person -multivalued true +} + +puts [Person serialize] +Person slot name default "gustaf" +? {Person slot name default} gustaf +Person p1 -name neophytos +? {p1 name} neophytos +? {p1 age} 0 +p1 age 123 +? {p1 age} 123 + + +Object o1 +o1 set i 0 +::xotcl::alias o1 Incr -objscope ::incr +t {o1 incr i} 1 "method incr" +t {o1 Incr i} 1002 "aliased tcl incr" +t {o1 incr i} 2003 "method incr" +t {o1 Incr i} 3004 "aliased tcl incr" + +::xotcl::alias ::xotcl::Object Set -objscope ::set +t {o1 set i 1} 1 "method set" +t {o1 set i} 1 "method set" +t {o1 Set i 1} 1 "aliased tcl set" +t {o1 Set i} 1 "aliased tcl set" +::xotcl::alias o1 Set -objscope ::set +t {o1 Set i 1} 1 "aliased object tcl set" +t {o1 Set i} 1 "aliased object tcl set" +::xotcl::Object instforward SSet -earlybinding -objscope ::set +t {o1 SSet i 1} 1 "forward earlybinding tcl set" +t {o1 SSet i} 1 "forward earlybinding tcl set" +#exit + +o1 set z 100 +#o1 forward z o1 [list %argclindex [list set set]] %proc +#o1 proc get name {my set $name} +o1 forward get -earlybinding ::xotcl::setinstvar %self %1 +? {o1 get z 101} 101 +? {o1 get z} "101" + +t {o1 get z} 101 "get value via new parametercmd get" +t {o1 get z 124} 124 "set value via new parametercmd get" + + +o1 forward zz -earlybinding ::xotcl::setinstvar %self %proc +? {o1 zz 123} 123 +? {o1 zz} 123 + +t {o1 zz} 123 "parametercmd forward earlybinding setinstvar" +t {o1 zz 124} 124 "parametercmd forward earlybinding setinstvar" + +o1 forward z2 -earlybinding -objscope ::set %proc +t {o1 z2 111} 111 "parametercmd forward earlybinding tcl set" +t {o1 z2} 111 "parametercmd forward earlybinding tcl set" + +o1 forward z3 -objscope ::set %proc +t {o1 z3 111} 111 "parametercmd forward tcl set" +t {o1 z3} 111 "parametercmd forward tcl set" + +o1 set y 11 +o1 parametercmd y +t {o1 y} 11 "parametercmd" +t {o1 y 1} 1 "parametercmd" + +#Class C -parameter {a {b 10} {c "Hello World"}} +#C copy V + +#puts [C serialize] +#puts [V serialize] + +#C destroy +#V v1 +#puts [v1 b] + +# ::xotcl::Object instproc param arglist { +# foreach arg $arglist { +# puts "arg=$arg" +# set l [llength $arg] +# set name [lindex $arg 0] +# if {![my isobject [self]::slot]} {::xotcl::Object create [self]::slot} +# if {$l == 1} { +# Attribute create [self]::slot::$name +# } elseif {$l == 2} { +# Attribute create [self]::slot::$name -default [lindex $arg 1] +# } else { +# set paramstring [string range $arg [expr {[string length $name]+1}] end] +# #puts stderr "remaining arg = '$paramstring'" +# if {[string match {[$\[]*} $paramstring]} { +# #puts stderr "match, $cl set __defaults($name) $paramstring" +# Attribute create [self]::slot::$name -default $paramstring +# continue +# } +# } +# } +# } + + +::xotcl::Slot instmixin delete ::xotcl::Slot::Optimizer + +Class C1 -parameter {a {b 10} {c "Hello World"}} +C1 c1 -a 1 +? {c1 a} 1 +? {c1 b} 10 +? {c1 c} "Hello World" + +##### is short form of + + +Class C2 -slots { + Attribute a + Attribute b -default 10 + Attribute c -default "Hello World" +} +C2 c2 -a 1 +? {c2 procsearch a} "::C2 instforward a" +? {c2 a} 1 +? {c2 b} 10 +? {c2 c} "Hello World" + + +t {c2 a} 1 "new indirect parametercmd" +t {c2 a 1} 1 "new indirect parametercmd" + +::xotcl::Slot instmixin add ::xotcl::Slot::Optimizer +Class C3 -slots { + Attribute a + Attribute b -default 10 + Attribute c -default "Hello World" +} +C3 c3 -a 1 +? {c3 procsearch a} "::C3 instparametercmd a" +? {c3 a} 1 +? {c3 b} 10 +? {c3 c} "Hello World" + +t {c3 a} 1 "new indirect parametercmd optimized" +t {c3 a 1} 1 "new indirect parametercmd optimized" + +####### nasty names +Class create D -slots { + Attribute create create -default 1 +} +D d1 + +####### gargash 2 +Class create A -parameter {{foo 1}} +# or +Class create A -slots { + Attribute foo -default 1 +} + +A create a1 -foo 234 ;# calls default foo setter + +A instproc f1 {} {puts hu} +A instforward f2 puts hu +A create a0 +#a0 f1 +a0 proc f3 {} {puts hu} +a0 forward f4 puts hu +? {a0 procsearch f1} "::A instproc f1" +? {a0 procsearch f2} "::A instforward f2" +? {a0 procsearch f3} "::a0 proc f3" +? {a0 procsearch f4} "::a0 forward f4" +? {a0 procsearch set} "::xotcl::Object instcmd set" +? {A slot foo procsearch assign} "::xotcl::Slot instcmd assign" + +# redefine setter for foo of class A +A slot foo proc assign {domain var val} { + # Do something with [self] that isn't valid pre-init + puts setter-[self proc] + $domain set $var $val +} + +a1 foo ;# calls default foo getter +a1 foo 123 ;# calls overridden foosetter +? {a1 foo} 123 + + +#puts [A serialize] + +################### +# Application Slots +# + +Class Person -slots { + Attribute name + Attribute age -default 0 + Attribute projects -default {} -multivalued true +} + +Person p1 -name "Gustaf" +? {p1 name} Gustaf +? {p1 age} 0 +? {p1 projects} {} + +Class Project -slots { + Attribute name + Attribute description +} + +Project project1 -name XOTcl -description "A highly flexible OO scripting language" + +p1 projects add ::project1 +? {p1 projects} ::project1 +#p1 projects add some-other-value +#? {p1 projects} "some-other-value ::project1" + +::xotcl::Slot instproc check { + {-keep_old_value:boolean true} + value predicate type obj var +} { + puts "+++ checking $value with $predicate ==> [expr $predicate]" + if {![expr $predicate]} { + if {[$obj exists __oldvalue($var)]} { + $obj set $var [$obj set __oldvalue($var)] + } else { + $obj unset $var + } + error "$value is not of type $type" + } + if {$keep_old_value} {$obj set __oldvalue($var) $value} +} + +::xotcl::Slot instproc checkall {values predicate type obj var} { + foreach value $values { + my check -keep_old_value false $value $predicate $type $obj $var + } + $obj set __oldvalue($var) $value +} + +Person slots { + Attribute projects -default "" -multivalued true -type ::Project + Attribute salary -type integer +} + +Person p2 -name "Gustaf" +p2 projects add ::project1 +? {catch {p2 projects add ::o1}} 1 +p2 salary 100 +? {catch {p2 salary 100.9}} 1 +? {p2 salary} 100 +p2 append salary 9 +? {p2 salary} 1009 +? {catch {p2 append salary b}} 1 +? {p2 salary} 1009 + +Person slots { + Attribute sex -type "my sex" -proc sex {value} { + switch -glob $value { + m* {my uplevel {$obj set $var m}; return 1} + f* {my uplevel {$obj set $var f}; return 1} + default {return 0} + } + } +} +Person p3 -sex male +? {p3 sex} m + +set ::hu 0 +Class C -slots { + Attribute x -initcmd {incr ::hu; set x 101} +} +C c1 +? {c1 info vars} "" +? {c1 set x} 101 +? {c1 info vars} "x" +? {set ::hu 1} 1 + + +Class Point -parameter {{x 100} {y 300}} +Class Rectangle -parameter {color} + +Rectangle r0 -color pink -contains { + Rectangle r1 -color red -contains { + Point x1 -x 1 -y 2 + Point x2 -x 1 -y 2 + } + Rectangle r2 -color green -contains { + Point x1 + Point x2 + } +} + +? {r0 color} pink +? {r0 r1 color} red +? {r0 r1 x1 x} 1 +? {r0 r1 x2 y} 2 +? {r0 r2 color} green +#puts [r0 serialize] + + +##### +Class create A -slots { + Attribute foo -default 1 -proc assign { domain var value} { + if {$value < 0 || $value > 99} { + error "$value is not in the range of 0 .. 99" + } + $domain set $var $value + } +} + +A create a1 +? {a1 foo 10} 10 +? {a1 foo 20} 20 +? {a1 foo} 20 +? {catch {a1 foo -1}} 1 +? {catch {a1 foo 100}} 1 +? {catch {a1 foo 99}} 0 + +set x [Object new -set x 1 -contains { + Object new -set x 1.1 + Object new -set x 1.2 -contains { + Object new -set x 1.2.1 + Object new -set x 1.2.2 -contains { + Object new -set x 1.2.2.1 + } + Object new -set x 1.2.3 + } + Object new -set x 1.3 +}] + +? {llength [$x info children]} 3 +? {llength [[lindex [lsort [$x info children]] 0] info children]} 0 +? {llength [[lindex [lsort [$x info children]] 1] info children]} 3 +? {llength [[lindex [lsort [$x info children]] 2] info children]} 0 + +exit + +#puts [Person array get __defaults] +#puts [Person serialize] +puts [Serializer all] +eval [Serializer all] + +? {p2 salary} 1009 +? {catch {p2 append salary b}} 1 +? {p2 salary} 1009 +#p2 projects add ::o1 +exit +p1 set x 0 +t {p1 set x} "get instvar value via set" +t {p1 set x 1} "set instvar value via set" + + + +Object o1 +proc f {x} {return $x} +o1 forward myf -earlybinding f +? {o1 myf abc} abc + +rename f "" +proc f {x} {return 11} +? {o1 myf abc} 11 + +Object o2 +o2 proc f {x} {expr {$x*2}} +o1 forward myf -earlybinding o2 f + +? {o1 myf 100} 200 + +o1 set x 42 +o1 forward x -earlybinding ::xotcl::setinstvar %self %proc +? [list o1 x] 42 +? [list o1 x 41] 41 +t {o1 x} "get parametercmd via forward (earlybinding)" +t {o1 x 41} "set parametercmd via forward (earlybinding)" + +#obj forward Mixin -default {getter setter} mixin %1 %self +o1 forward z -default {getter setter} %self + +o1 forward myfset -objscope set +o1 myfset y 102 +? {o1 myfset y} 102 + +t {o1 myfset y} "get instvar value via forward" +t {o1 myfset y 122} "set instvar value via forward" + +o1 forward myfdset -earlybinding -objscope set +o1 myfdset y 103 +? {o1 myfdset y} 103 + +t {o1 myfdset y} "get instvar value via forward -earlybinding" +t {o1 myfdset y 123} "set instvar value via forward -earlybinding" + +::xotcl::alias o1 myset -objscope ::set +o1 myset x 101 +? {o1 myset x} 101 + +t {o1 myset x} "get instvar value via set alias" +t {o1 myset x 123} "set instvar value via set alias" + + +t {p1 age} "slot read" +Class P -parameter {age {s -setter sets}} +P instproc sets {var value} { + my set $var $value +} +P create p2 -age 345 -s 567 + +t {p2 age} "parametercmd read" +t {::xotcl::setinstvar p2 age} "via setinstvar" +t {p2 s} "parameter read with setter" + + + + +Slot create Project::fullbudget \ + -initcmd {$obj set __x 100} \ + -valuechangedcmd { + puts "budget is now [$obj set fullbudget]" + $obj set __x [$obj set fullbudget] + } + +Slot create Project::currentbudget -valuecmd {$obj incr __x -1} + +Person p2 -name gustaf +Person p3 -name frido +Article a1 -title "My life as a saint" -date "1.1.2006" +publishes new -written_by p1 -has_published a1 +set p [Project new -name icamp -manager p2 -member add p1 -member add p3] +$p member add X end +puts [$p member] + +? [list $p fullbudget] 100 +? [list $p fullbudget] 100 +? [list $p currentbudget] 99 +? [list $p currentbudget] 98 +? [list $p fullbudget 200] 200 +? [list $p currentbudget] 199 +exit + +foreach o [Object allinstances] { + if {[$o isclass]} continue + if {[$o istype Slot]} continue + if {$o eq "::xotcl::relmgr"} continue + set string "$o\n" + foreach v [$o info vars] { + append string " $v = [$o set $v]\n" + } + puts $string +} + +puts stderr DONE-[p1 name]-[p1 age] + +p3 age 77 +exit + +puts [XoXML asXML] + +puts ==== +foreach n [XoXML selectNodes {//object[age > 1]}] {puts [$n asXML]} + +exit Index: tests/speedtest.xotcl =================================================================== diff -u -N --- tests/speedtest.xotcl (revision 0) +++ tests/speedtest.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,406 @@ +#memory trace on +# $Id: speedtest.xotcl,v 1.10 2007/08/14 16:38:27 neumann Exp $ +package require XOTcl +namespace import -force xotcl::* +lappend auto_path [file dirname [info script]]/.. +package require xotcl::test + +@ @File {description { + Regression and speed test for various ways to achieve a similar + behaviour. + } +} +Class M1; Class M2 +Class C -parameter {{p 99} {q 98} r} +C instproc f args {next} +C instproc init args { + my instvar n v + for {set i 1} {$i<1000} {incr i} {set n($i) 1} + for {set i 1} {$i<1000} {incr i} {Object [self]::$i} + set v 1 +} + +C instproc mixinappend m { + my mixin [concat [my info mixin] $m] + my info mixin +} +C instproc ma m { + set mix [my info mixin] + my mixin [lappend mix $m] + my info mixin +} + +C instproc existsViaInstvar {} { + my instvar v + info exists v +} +C instproc existsViaMyInstvar {} { + my instvar v + info exists v +} +C instproc existsViaExistsMethod {} { + my exists v +} +C instproc existsViaMyExistsMethod {} { + my exists v +} +C instproc notExistsViaInstvar {} { + my instvar xxx + info exists xxx +} +C instproc notExistsViaExistsMethod {} { + my exists xxx +} + +C instproc existsAndReturnValue1 {} { + if {[my exists v]} { + my set v + } +} +C instproc existsAndReturnValue3 {} { + if {[my exists v]} { + set x [my set v] + } +} + +C instproc setViaInstvar x { + my instvar v + set v $x +} +C instproc setViaSetMethod x { + my set v $x +} +C instproc setViaParameter x { + my r $x +} +C instproc testAndSetViaInstvar x { + my instvar v + if {[info exists v]} {set v $x} +} +C instproc testAndSetViaSetMethod x { + if {[my info vars v] ne ""} {my set v $x} +} + +C instproc readViaInstvar {} { + my instvar p + set p +} +C instproc readViaSetMethod {} { + my set p +} +C instproc readViaSetMethodNoSelf {} { + ::c set p +} +C instproc readViaParameter {} { + my p +} + +C instproc readTwiceViaInstvar {} { + my instvar p + set p + set p +} +C instproc readTwiceViaSetMethod {} { + my set p + my set p +} +C instproc readTwiceViaSetMethodNoSelf {} { + ::c set p + ::c set p +} +C instproc readTwiceViaParameter {} { + my p + my p +} +C instproc readTwovarsViaInstvar {} { + my instvar p q + set p + set q +} +C instproc readTwovarsViaSetMethod {} { + my set p + my set q +} +C instproc readTwovarsViaSetMethodNoSelf {} { + ::c set p + ::c set q +} +C instproc readTwovarsViaParameter {} { + my p + my q +} + +C instproc instvarAlias {} { + my instvar {a b} + set b 1 + my exists a +} + + +C instproc explicitReturn {} { + return [set i 1] +} +C instproc implicitReturn {} { + set i 1 +} +C instproc explicitReturnFromVar {} { + set i 1 + return $i +} +C instproc implicitReturnFromVar {} { + set i 1 + set i +} + +C instproc childNodeNamespace {} { + Object [self]::13 +} +C instproc childNodeNamespaceCreate {} { + Object create [self]::13 +} +C instproc createVolatileRc {} { + Object new -volatile + return 2 +} + + +C c +Class D -superclass C +D instproc init args {} +D d + + + + + +Test new -cmd {d istype D} -expected 1 + +Test new -cmd {c setViaInstvar 100} -expected 100 +Test new -cmd {c setViaSetMethod 100} -expected 100 +Test new -cmd {c setViaParameter 100} -expected 100 + +Test new -cmd {c existsViaInstvar} +Test new -cmd {c existsViaMyInstvar} +Test new -cmd {c existsViaExistsMethod} +Test new -cmd {c existsViaMyExistsMethod} +Test new -cmd {c exists v} +Test new -cmd {c notExistsViaInstvar} -expected 0 +Test new -cmd {c notExistsViaExistsMethod} -expected 0 +Test new -cmd {c exists xxx} -expected 0 + +Test new -cmd {c existsAndReturnValue1} -expected 100 +Test new -cmd {c existsAndReturnValue3} -expected 100 + +Test new -cmd {c testAndSetViaInstvar 100} -expected 100 +Test new -cmd {c testAndSetViaSetMethod 100} -expected 100 + +Test new -cmd {c readViaInstvar} -expected 99 +Test new -cmd {c readViaSetMethod} -expected 99 +Test new -cmd {c readViaParameter} -expected 99 +Test new -cmd {c readViaSetMethodNoSelf} -expected 99 + +Test new -cmd {c readTwiceViaInstvar} -expected 99 +Test new -cmd {c readTwiceViaSetMethod} -expected 99 +Test new -cmd {c readTwiceViaParameter} -expected 99 +Test new -cmd {c readTwiceViaSetMethodNoSelf} -expected 99 + +Test new -cmd {c readTwovarsViaInstvar} -expected 98 +Test new -cmd {c readTwovarsViaSetMethod} -expected 98 +Test new -cmd {c readTwovarsViaParameter} -expected 98 +Test new -cmd {c readTwovarsViaSetMethodNoSelf} -expected 98 + +Test new -cmd {c instvarAlias} + +Test new -cmd {c incr v} -post {c set v 1} -expected 101 +Test new -cmd {c unset v; set r [c exists v]; c set v 1; set r} -expected 0 + +Test new -cmd {c explicitReturn} +Test new -cmd {c implicitReturn} +Test new -cmd {c explicitReturnFromVar} +Test new -cmd {c implicitReturnFromVar} + +Test new -cmd {c childNodeNamespace} -expected ::c::13 +Test new -cmd {c childNodeNamespaceCreate} -expected ::c::13 +Test new -cmd {c createVolatileRc} -expected 2 + +Test new -cmd {Object new -volatile} -expected ::xotcl::__\#F9 -count 2000 \ + -post {foreach o [Object info instances ::xotcl::__*] {$o destroy}} +Test new -cmd {Object new} -expected ::xotcl::__\#lQ -count 2000 \ + -post {foreach o [Object info instances ::xotcl::__*] {$o destroy}} +Test new -cmd {Object new -childof o} -expected ::o::__\#0Hh \ + -pre {Object o} -post {o destroy} + +Test new -count 1000 -pre {::set ::count 0} \ + -cmd {Object create [incr ::count]} \ + -expected ::1 \ + -post {::unset ::count} +Test new -count 1000 -pre {::set ::count 0} \ + -cmd {[incr ::count] destroy} \ + -post {::unset ::count} \ + -expected "" +Test new -cmd {Object create x} -expected ::x +Test new -cmd {Object create x -set a -1 -set b ,, -set c a--} \ + -expected ::x +Test new -cmd {expr {[c array names n 500] ne ""}} +Test new -cmd {info exists c::n(500)} +Test new -cmd {c exists n(500)} + +Test new -cmd {llength [c info children]} -expected 999 +Test new -cmd {c info children ::c::500} -expected ::c::500 +if {[info exists xotcl_version]} { + Test new -cmd {llength [Object info instances]} -expected 1001 +} else { + Test new -cmd {llength [Object info instances]} -expected 1007 +} + +Test new -cmd {Object info instances ::c::500} -expected ::c::500 + +Test new -count 100 -pre {set ::c::l ""} \ + -cmd {lappend ::c::l 1} \ + -post {c unset l} + +Test new \ + -count 100 \ + -cmd {c mixinappend M1} \ + -expected ::M1 \ + -post {c mixin ""} + +Test new \ + -count 100 \ + -cmd {c ma M1} \ + -expected ::M1 \ + -post {c mixin ""} + +Test new \ + -count 100 \ + -cmd {c mixinappend M1; c mixinappend M2} \ + -expected {::M1 ::M2} \ + -post {c mixin ""} + +Test new \ + -count 100 \ + -cmd {c ma M1; c ma M2} \ + -expected {::M1 ::M2} \ + -post {c mixin ""} + +Test new \ + -cmd {C instfilter f; C info instfilter} \ + -expected f \ + -post {C instfilter ""} + +Test new -pre {set s \#hallo} -cmd {string match "\#*" $s} +Test new -pre {set s \#hallo} -cmd {regexp {^\#} $s} +Test new -pre {set s \#hallo} -cmd {expr {[string first "\#" $s] == 0}} +Test new -pre {set s \#hallo} -cmd {expr {[string range $s 0 0] == "\#"}} + +Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a} $s} +Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a.*o} $s} +Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s} +Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s _} +Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s _ out} + +Test new -msg {call proc of subobject directly} \ + -pre {C c2; C c2::o; c2::o proc f a {incr a}} \ + -cmd {c2::o::f 10} -expected 11 -count 5000 \ + -post {c2 destroy} +Test new -msg {call proc of subobject via dispatch} \ + -pre {C c2; C c2::o; c2::o proc f a {incr a}} \ + -cmd {c2::o f 10} -expected 11 -count 5000 \ + -post {c2 destroy} +Test new -msg {call proc of object and subobject via dispatch} \ + -pre {C c2; C c2::o; c2::o proc f a {incr a}} \ + -cmd {c2 o f 10} -expected 11 -count 5000 \ + -post {c2 destroy} + +Test new -msg {dispatch subobject directy via [self]} \ + -pre {C c2; C c2::o; c2::o proc f a {incr a}; c2 proc t a {[self]::o f $a}} \ + -cmd {c2 t 12} -expected 13 -count 5000 \ + -post {c2 destroy} +Test new -msg {dispatch subobject via my} \ + -pre {C c2; C c2::o; c2::o proc f a {incr a}; c2 proc t a {my o f $a}} \ + -cmd {c2 t 12} -expected 13 -count 5000 \ + -post {c2 destroy} + + +###### insttclcmd tests +set cnt 10000 +#Test new -msg {call insttclcmd (append) and check created variable} \ + -pre {Object o} \ + -cmd {o append X 1; o exists X} -expected 1 \ + -post {o destroy} +#Test new -msg {call tclcmd (regexep) and check created variable} \ + -pre {Object o; o tclcmd regexp} \ + -cmd {o regexp (a) a _ x; o exists x} -expected 1 -count $cnt \ + -post {o destroy} +Test new -msg {call forwarder for (append) and check created variable} \ + -pre {Object o; o forward append -objscope} \ + -cmd {o append X 1; o exists X} -expected 1 \ + -post {o destroy} +Test new -msg {call forwarder (regexep) and check created variable} \ + -pre {Object o; o forward regexp -objscope} \ + -cmd {o regexp (a) a _ x; o exists x} -expected 1 -count $cnt \ + -post {o destroy} +Test new -msg {call forwarder to another obj} \ + -pre {Object o; Object t; o forward set t set; t set x 100} \ + -cmd {o set x} -expected 100 -count $cnt \ + -post {o destroy} + +set cnt 100000 +Test new -msg {call handcoded incr} \ + -pre {Class C; C create o; o set x 1} \ + -cmd {o incr x 77} -expected 78 -count $cnt \ + -post {o destroy} +Test new -msg {call incr via instforward} \ + -pre {Class C; C instforward ::incr -objscope; C create o; o set x 1} \ + -cmd {o incr x 77} -expected 78 -count $cnt \ + -post {o destroy} +Test new -msg {call incr via forward} \ + -pre {Class C; C create o; o forward ::incr -objscope; o set x 1} \ + -cmd {o incr x 77} -expected 78 -count $cnt \ + -post {o destroy} +set cnt 10000 +Test new -msg {call obj with namespace via forward} \ + -pre {Object n; Object n::x; Object o -forward ::n::x} \ + -cmd {o x self} -expected ::n::x -count $cnt \ + -post {o destroy} +Test new -msg {call obj with namespace via instforward} \ + -pre {Object n; Object n::x; Class C; C create o; C instforward ::n::x} \ + -cmd {o x self} -expected ::n::x -count $cnt \ + -post {o destroy} +Test new -msg {call obj with namespace via instforward and mixinclass} \ + -pre {Object n; Object n::x; Class M -instforward ::n::x; + Class C -instmixin M; C create o } \ + -cmd {o x self} -expected ::n::x -count $cnt \ + -post {o destroy} +Test new -msg {call obj with namespace via instforward and next from proc} \ + -pre { + Object n; Object n::x; + Class C -instforward ::n::x; + C create o -proc x args {next} } \ + -cmd {o x self} -expected ::n::x -count $cnt \ + -post {o destroy} +Test new -msg {call obj with namespace via instforward and next from instproc} \ + -pre { + Object n; Object n::x; + Class C -instforward ::n::x; + Class D -superclass C -instproc x args {next}; + D create o } \ + -cmd {o x self} -expected ::n::x -count $cnt \ + -post {o destroy} +Test new -msg {call obj with namespace via mixin and instforward and next} \ + -pre {Object n; Object n::x; + Class M -instforward ::n::x; + Class N -superclass M -instproc x args {next}; + Class C -instmixin N; C create o} \ + -cmd {o x self} -expected ::n::x -count $cnt \ + -post {o destroy} +Test new -msg {return -code break} \ + -pre {Class A -instproc br {} {return -code break}; A create a1} \ + -cmd {catch {a1 br}} -expected 3 -count 2 \ + -post {A destroy; a1 destroy} + + +Test run; exit + + + Index: tests/testo.xotcl =================================================================== diff -u -N --- tests/testo.xotcl (revision 0) +++ tests/testo.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,609 @@ +# $Id: testo.xotcl,v 1.9 2007/08/14 16:38:27 neumann Exp $ +# +# Copyright 1993 Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +package require XOTcl +namespace import -force xotcl::* + +@ @File {description { + This is a class which provides regression test objects + for the OTcl derived features of the XOTcl - Language. + This script is based upon the test.tcl script of the OTcl distribution + and adopted for XOTcl. + } +} +# +# a meta-class for test objects, and a class for test suites +# + +Class TestSuite +@ Class TestSuite + +Class TestClass -superclass Class +@ Class TestClass { + description { + A meta-class for test objects. + } +} + +# +# check basic argument dispatch and unknown +# + +TestSuite objectdispatch + +objectdispatch proc run {{n 50}} { + Object adispatch + + adispatch proc unknown {m args} {eval list [list $m] $args} + adispatch proc cycle {l n args} { + if {$l>=$n} then {return ok} + set i [llength $args] + foreach a $args { + if {$a != $i} then { + error "wrong order in arguments: $l $n $args" + } + incr i -1 + } + incr l + + set ukn [eval [list [self]] $args] + if {$ukn != $args} then { + error "wrong order in unknown: $ukns" + } + eval [list [self]] [list [self proc]] [list $l] [list $n] [list $l] $args + } + + if {[catch {adispatch cycle 1 $n 1} msg]} then { + error "FAILED [self]: cycle: $msg" + } + + return "PASSED [self]" +} + +# +# examples from the workshop paper +# + +TestSuite paperexamples + +paperexamples proc example1 {} { + Object astack + + astack set things {} + + astack proc put {thing} { + my instvar things + set things [concat [list $thing] $things] + return $thing + } + + astack proc get {} { + my instvar things + set top [lindex $things 0] + set things [lrange $things 1 end] + return $top + } + + astack put bagel + astack get + astack destroy +} + +paperexamples proc example2 {} { + Class Safety + + Safety instproc init {} { + next + my set count 0 + } + + Safety instproc put {thing} { + my instvar count + incr count + next + } + + Safety instproc get {} { + my instvar count + if {$count == 0} then { return {empty!} } + incr count -1 + next + } + + Class Stack + + Stack instproc init {} { + next + my set things {} + } + + Stack instproc put {thing} { + my instvar things + set things [concat [list $thing] $things] + return $thing + } + + Stack instproc get {} { + my instvar things + set top [lindex $things 0] + set things [lrange $things 1 end] + return $top + } + + Class SafeStack -superclass {Safety Stack} + + SafeStack s + s put bagel + s get + s get + s destroy + + SafeStack destroy + Stack destroy + Safety destroy +} + +paperexamples proc run {} { + set msg {} + + if {[catch {my example1; my example2} msg] == "0"} then { + return "PASSED [self]" + } else { + error "FAILED [self]: $msg" + } +} + + +# +# create a graph of classes +# + +TestSuite classcreate + +classcreate proc factorgraph {{n 3600}} { + TestClass $n + + + for {set i [expr {$n/2}]} {$i>1} {incr i -1} { + if {($n % $i) == 0} then { + + # + # factors become subclasses, direct or indirect + # + + + if {[TestClass info instances $i] eq ""} then { + my factorgraph $i + $i superclass $n + } elseif {[$i info superclass $n] == 0} then { + + $i superclass [concat [$i info superclass] $n] + } + } + } +} + +classcreate proc run {} { + set msg {} + if {[catch {my factorgraph} msg] == "0"} then { + return "PASSED [self]" + } else { + error "FAILED [self]: $msg" + } +} + + +# +# lookup superclasses and combine inherited methods +# + +TestSuite inheritance + +inheritance proc meshes {s l} { + set p -1 + foreach j $s { + set n [lsearch -exact $l $j] + if {$n == -1} then { + error "FAILED [self] - missing superclass" + } + if {$n <= $p} then { + error "FAILED [self] - misordered heritage: $s : $l" + } + set p $n + } +} + +inheritance proc superclass {} { + foreach i [TestClass info instances] { + set s [$i info superclass] + set h [$i info heritage] + + # + # superclasses should mesh with heritage + # + + my meshes $s $h + } +} + +inheritance proc combination {} { + foreach i [lsort [TestClass info instances]] { + # + # combination should mesh with heritage + # + + $i anumber + set obj [lrange [anumber combineforobj] 1 end] + set h [$i info heritage] + my meshes $obj $h + anumber destroy + + if {[$i info procs combineforclass] ne ""} then { + set cls [lrange [$i combineforclass] 1 end] + my meshes $cls $h + } + } +} + +inheritance proc run {} { + + # + # add combine methods to "random" half of the graph + # + + set t [TestClass info instances] + for {set i 0} {$i < [llength $t]} {incr i 2} { + set o [lindex $t $i] + $o instproc combineforobj {} { + return [concat [list [self class]] [next]] + } + $o proc combineforclass {} { + return [concat [list [self class]] [next]] + } + } + + # + # and to Object as a fallback + # + + Object instproc combineforobj {} { + return [concat [list [self class]] [next]] + } + Object proc combineforclass {} { + return [concat [list [self class]] [next]] + } + + my superclass + my combination + + return "PASSED [self]" +} + + +# +# destroy graph of classes +# + +TestSuite classdestroy + +classdestroy proc run {} { + + # + # remove half of the graph at a time + # + + TestClass instproc destroy {} { + global TCdestroy + set TCdestroy [self] + next + } + while {[TestClass info instances] ne ""} { + set t [TestClass info instances] + for {set i 0} {$i < [llength $t]} {incr i} { + set o [lindex $t $i] + # + # quarter dies directly, quarter indirectly, quarter renamed + # + + if {($i % 2) == 0} then { + global TCdestroy + set sb [$o info subclass] + + if {[info tclversion] >= 7.4 && ($i % 4) == 0} then { + $o move "" + } else { + $o destroy + } + if {[catch {set TCdestroy}] || $TCdestroy != $o} then { + error "FAILED [self] - destroy instproc not run for $o" + } + if {[info commands $o] ne ""} then { + error "FAILED [self] - $o not removed from interpreter" + } + unset TCdestroy + + # + # but everyone must still have a superclass + # + foreach j $sb { + if {[$j info superclass] eq ""} then { + $j superclass Object + } + } + } elseif {[info tclversion] >= 7.4 && ($i % 3) == 0} then { + $o move $o.$i + } + + } + + inheritance superclass + inheritance combination + } + + return "PASSED [self]" +} + + +TestSuite objectinits + +objectinits proc prepare {n} { + + # + # head of a chain of classes that do add inits + # + + TestClass 0 + 0 instproc init {args} { + next + my set order {} + } + + # + # and the rest + # + + for {set i 1} {$i < $n} {incr i} { + TestClass $i -superclass [expr {$i-1}] + + # + # record the reverse order of inits + # + + $i instproc init {args} { + eval next $args + my instvar order + lappend order [namespace tail [self class]] + } + + # + # add instproc for init options + # + + $i instproc m$i.set {val} { + my instvar [namespace tail [self class]] + set [namespace tail [self class]] [self proc].$val + } + } +} + +objectinits proc run {{n 15}} { + my prepare $n + + set il {} + for {set i 1} {$i < $n} {incr i} { + lappend il $i + set al {} + set args {} + for {set j $i} {$j > 0} {incr j -1} { + lappend al $j + lappend args -m$j.set $j + + # + # create obj of increasing class with increasing options + # + if {[catch {eval $i m$i.$j $args} msg] != 0} then { + error "FAILED [self] - $msg" + } + if {[m$i.$j set order] != $il} then { + error "FAILED [self] - inited order was wrong" + } + set vl [lsort -decreasing -integer [m$i.$j info vars {[0-9]*}]] + + if {$vl != $al} then { + error "FAILED [self] - wrong instvar names: $vl : $al" + } + foreach k $vl { + if {[m$i.$j set $k] != "m$k.set.$k"} then { + error "FAILED [self] - wrong instvar values" + } + } + } + } + + return "PASSED [self]" +} + + +TestSuite objectvariables + +objectvariables proc run {{n 100}} { + TestClass Variables + Variables avar + + foreach obj {avar Variables TestClass xotcl::Class xotcl::Object} { + + # + # set up some variables + # + $obj set scalar 0 + $obj set array() {} + $obj unset array() + $obj set unset.$n {} + + # + # mess with them recursively + # + + $obj proc recurse {n} { + my instvar scalar array + incr scalar + set array($n) $n + my instvar unset.$n + unset unset.$n + incr n -1 + my instvar unset.$n + set unset.$n [array names array] + if {$n > 0} then { + my recurse $n + } + } + + $obj recurse $n + + # + # check the result and clean up + # + + if {[$obj set scalar] != $n} then { + error "FAILED [self] - scalar" + } + + $obj unset scalar + + for {set i $n} {$i > 0} {incr i -1} { + if {[$obj set array($i)] != $i} then { + error "FAILED [self] - array" + } + } + $obj unset array + if {[$obj info vars "unset.0"] eq ""} then { + error "FAILED [self] - unset: [$obj info vars]" + } + } + + # + # trace variables + # + Variables avar2 + + avar2 proc trace {var ops} { + my instvar $var + ::trace variable $var $ops "avar2 traceproc" + } + + avar2 proc traceproc {maj min op} { + set majTmp [namespace tail "$maj"] + global trail; lappend trail [list $majTmp $min $op] + } + + avar2 proc killSelf {} { + my destroy + } + + global guide trail + set trail {} + set guide {} + avar2 trace array wu + + for {set i 0} {$i < $n} {incr i} { + + avar2 trace scalar$i wu + avar2 set scalar$i $i + lappend guide [list scalar$i {} w] + avar2 set array($i) [avar2 set scalar$i] + lappend guide [list array $i w] + } + + + if {$guide != $trail} then { + error "FAILED [self] - trace: expected $guide, got $trail" + } + + # + # destroy must trigger unset traces + # + set trail {} + set guide {} + lappend guide [list array {} u] + for {set i 0} {$i < $n} {incr i} { + lappend guide [list scalar$i {} u] + } + + avar2 killSelf + + if {[lsort $guide] != [lsort $trail]} then { + error "FAILED [self] - trace: expected $guide, got $trail" + } + + Variables destroy + + return "PASSED [self]" +} + + +# +# c api, if compiled with -DTESTCAPI +# + +TestSuite capi + +capi proc run {{n 50}} { + set start [dawnoftime read] + for {set i 0} {$i < $n} {incr i} { + Timer atime$i + if {$i % 3} {atime$i stop} + if {$i % 7} {atime$i read} + if {$i % 2} {atime$i start} + if {$i % 5} {atime$i stop} + } + set end [dawnoftime read] + if {$end < $start} { + error "FAILED [self]: timer doesn't work" + } + + foreach i [Timer info instances] {$i destroy} + Timer destroy + + return "PASSED [self]" +} + + + +TestSuite proc run {} { + # + # run individual tests in needed order + # + puts [objectdispatch run] + puts [paperexamples run] + puts [classcreate run] + puts [inheritance run] + puts [classdestroy run] + puts [objectinits run] + puts [objectvariables run] + if {[info commands Timer] ne ""} then { + puts [capi run] + } +# puts [autoload run] + +} + +puts [time {TestSuite run} 1] + +#exit + +# Local Variables: +# mode: tcl +# tcl-indent-level: 2 +# End: + Index: tests/testx.xotcl =================================================================== diff -u -N --- tests/testx.xotcl (revision 0) +++ tests/testx.xotcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,3988 @@ +#$Id: testx.xotcl,v 1.36 2007/10/12 19:53:32 neumann Exp $ +package require XOTcl +namespace import -force xotcl::* + +proc ::errorCheck {got expected msg} { + if {$got != $expected} { + puts stderr "[self] FAILED: $msg\nGot: $got\nExpected: $expected" + foreach g $got e $expected { + set result [expr {$g == $e}] + if {[string length $g]>60} { + puts "$result g='$g'\n e='$e'" + } else { + puts "$result g='$g' e='$e'" + } + } + exit -1 + } +} + +proc ::cutSpaces {string} { + regsub -all " " $string "" result + regsub -all "\n" $result " " result + return $result +} + + +Class TestX \ + -instmixin [Class TestXM -instproc run args {next; puts "[self] PASSED"}] + +@ @File {description { + This is a file which provides a regression test + for the features of the XOTcl - Language. + } +} +@ Class TestX + +@ TestX nestingClasses { + description {Regression test object testing the class nesting feature.} +} +TestX nestingClasses -proc run {{n 20}} { + for {set i 0} {$i < $n} {incr i} { + Class x($i) + + Class x($i)::y + ::errorCheck [x($i) info commands y] "y" " -- creating Nested Class " + Class x($i)::z + Class x($i)::z::t + Class x($i)::t + ::errorCheck [x($i) info classchildren] "::x($i)::t ::x($i)::y ::x($i)::z" \ + "info classchildren" + ::errorCheck [x($i)::z info classparent] "::x($i)" \ + "info classparent" + + + ::errorCheck [x($i) info commands t] "t" \ + "-- MakeClass " + + x($i) a + x($i)::z a + x($i)::z::t a + x($i)::z::t move x($i)::z::rt + x($i)::z::rt a + ::errorCheck [x($i)::z info commands rt] "rt" \ + "renaming leaf " + + x($i)::z move x($i)::rz + + ::errorCheck [x($i) info commands rz] "rz" \ + "renaming node (node itself)" + + ::errorCheck [x($i)::rz info commands rt] "rt" \ + "renaming node (leaf in node)" + + ::errorCheck [x($i)::rz info classchildren] "::x($i)::rz::rt" \ + "info classchildren (2)" + ::errorCheck [x($i)::rz::rt info classparent] "::x($i)::rz" \ + "info classparent (2)" + + x($i) move rx + ::errorCheck [rx info commands rz] "rz" \ + "renaming root " + ::errorCheck [info commands rx] "rx" \ + "renaming root " + rx destroy + } +} + +@ TestX nestingObjects { + description {Regression test object testing the object nesting feature.} +} +TestX nestingObjects -proc run {{n 20}} { + for {set i 0} {$i < $n} {incr i} { + Class C($i) + + C($i) instproc testinstproc {} { + return + } + C($i) o + o proc testproc {} { + return + } + o testproc; o testinstproc + C($i) o::y + ::errorCheck [o info commands y] y "creating Nested Object " + C($i) o::z + C($i) o::z::t + C($i) o::t + + ::errorCheck [o info children] "::o::t ::o::y ::o::z" "info children" + ::errorCheck [o::t info parent] "::o" "info parent" + + ::errorCheck [o info commands t] t "MakeObject" + o::z::t move o::z::rt + ::errorCheck [o::z info commands rt] rt "renaming leaf" + o::z move o::rz + ::errorCheck [o::rz info commands rt] rt "renaming node" + ::errorCheck [o info commands rz] rz "renaming node" + o move rx + ::errorCheck [rx info commands rz] rz "renaming root " + ::errorCheck [info commands rx] rx "renaming root" + rx destroy + C($i) destroy + + Class A + A instproc x {a1 args} { + my set var $a1 + } + A a + A a::n -x "1 2 3" + ::errorCheck [::a::n set var] "1 2 3" "arg passing - init dash" + } +} + +@ TestX assertions { + description {Regression test object testing the assertions.} + } +TestX assertions -proc run {{n 20}} { + for {set i 0} {$i < $n} {incr i} { + Class C($i) + C($i) invar { + {$a > 2} {$c < 3} {$d > 5} + {#a} {#b} + } + C($i) instinvar { + {$a > 2} {$c < 3} {$d > 5} + {#a} {#b} + } + + ::errorCheck [C($i) info invar] {{$a > 2} {$c < 3} {$d > 5} {#a} {#b}} \ + "Class invar " + + ::errorCheck [C($i) info invar] {{$a > 2} {$c < 3} {$d > 5} {#a} {#b}} \ + "Class instinvar " + + Object b($i) + + b($i) invar { + {$a > 2} {$c < 3} {$d > 5} + {#a} {#b} + } + ::errorCheck [C($i) info invar] {{$a > 2} {$c < 3} {$d > 5} {#a} {#b}} \ + "Object invar " + + b($i) proc p {a b c} { + return p + } {pre1 pre2 pre3} {post1 post2 post3} + + ::errorCheck [b($i) info pre p] {{pre1} {pre2} {pre3}} \ + "Obj proc pre assertion " + ::errorCheck [b($i) info post p] {{post1} {post2} {post3}} \ + "Obj proc post assertion " + C($i) instproc p {a b c} { + return p + } {} {post1 post2 post3} + + ::errorCheck [C($i) info instpre p] "" \ + "CL proc pre assertion " + ::errorCheck [C($i) info instpost p] {{post1} {post2} {post3}} \ + "CL proc post assertion " + + C(0) set a 3; C(0) set c 2; C(0) set d 7; C(0) set f 50; + C(0) check all + C(0) proc checkit {} { + C(0) instvar a c d f + ::errorCheck [my info check] {invar instinvar pre post} \ + "check options != all" + # turn obj-invar off + C(0) check {pre post instinvar} + C(0) set c 10 + ::errorCheck [my info check] {instinvar pre post} \ + "check options != instinvar pre post" + } {{$f > 10}} {{$f < 100}} + C(0) checkit + } + for {set i 0} {$i < $n} {incr i} { + b($i) destroy + C($i) destroy + } + + Object b + b proc p {a b c} { + return p + } {pre1 pre2 pre3} {post1 post2 post3} + ::rename b a + ::errorCheck [a info pre p] {{pre1} {pre2} {pre3}} \ + "Obj proc pre assertion " + ::errorCheck [a info post p] {{post1} {post2} {post3}} \ + "Obj proc post assertion " + + + Class Sensor -parameter {{value 1}} + Sensor instinvar { + {[regexp {^[0-9]$} [my value]] == 1} + } + Sensor s + s check all + + Sensor instproc x {} { + s value + } { + {[regexp {^[0-9]$} [my value]] == 1} + } {} + s x + s value + + # inheritance + + Class A -parameter {{x 1} {y 1}} + + A instinvar {{$x == 1}} + + A instproc xTo2 args { + my set x 2 + } + A instproc yTo2 args { + my set y 2 + } {} {{$y == 1}} + A a -check all + + if {![catch {a xTo2} err]} { + set err "ok" + } else { + a check {} + a set x 1 + a check all + } + ::errorCheck $err {Assertion failed check: {$x == 1} in proc 'xTo2'} \ + "inheritance a xTo2" + + if {![catch {a yTo2} err]} { + set err "ok" + } + ::errorCheck $err {Assertion failed check: {$y == 1} in proc 'yTo2'} \ + "inheritance a yTo2" + + Class B -superclass A + B b -check all + + if {![catch {b xTo2} err]} { + set err "ok" + } else { + b check {} + b set x 1 + b check all + } + ::errorCheck $err {Assertion failed check: {$x == 1} in proc 'xTo2'} \ + "inheritance b xTo2" + + if {![catch {b yTo2} err]} { + set err "ok" + } + ::errorCheck $err {Assertion failed check: {$y == 1} in proc 'yTo2'} \ + "inheritance b yTo2" +} + +@ TestX filterAddRemove { + description {Regression test object testing adding/removing of filters.} +} +TestX filterAddRemove -proc run {{n 20}} { + set ::filterCount 0 + for {set i 0} {$i < $n} {incr i} { + Class SA($i) + Class SB($i) + Class SC($i) -superclass [list SB($i) SA($i)] + SA($i) instproc fa args { + incr ::filterCount + my set x 150 + return "[next]-[self class]::[self proc]" + } + SA($i) instproc f2 args { + incr ::filterCount + my set x 150 + return "[next]-[self class]::[self proc]" + } + SB($i) instproc f2 args { + incr ::filterCount + my set x 150 + return "[next]-[self class]::[self proc]" + } + SB($i) instproc fb args { + incr ::filterCount + my set x 150 + return "[next]-[self class]::[self proc]" + } + SC($i) instproc fc args { + incr ::filterCount + my set x 150 + return "[next]-[self class]::[self proc]" + } + SC($i) instfilter fc + SB($i) instfilter {fb f2} + SA($i) instfilter {fa f2} + Class T + T proc s {} { return } + Class Filtered${i} -superclass SC($i) + Filtered${i} instproc testfilter args { + incr ::filterCount + T s + return "[next]-[self class]::[self proc]" + } + Filtered${i} instfilter testfilter + Filtered${i} instproc a args { + return "in a" + } + Filtered${i} f${i} + set erg [f${i} a] + ::errorCheck $erg \ + "in a-::SA(${i})::f2-::SA(${i})::fa-::SB(${i})::f2-::SB(${i})::fb-::SC(${i})::fc-::Filtered${i}::testfilter" \ + "Filter Test - add" + SC($i) instfilter {} + SB($i) instfilter fb + SA($i) instfilter {} + set erg [f${i} a] + ::errorCheck $erg "in a-::SB(${i})::fb-::Filtered${i}::testfilter" \ + "Filter Test - remove" + + f${i} proc procFilter args { + return "[next]-[self class]::[self proc]" + } + f${i} filter {fa f2 procFilter} + + + set erg [f${i} a] + ::errorCheck $erg "in a-::SB(${i})::fb-::Filtered${i}::testfilter-::procFilter-::SB(${i})::f2-::SA(${i})::fa" \ + "Obj Filter Test call three filter + instfilter" + + ::errorCheck "[f${i} info filter]-[SB($i) info instfilter]-[SC($i) info instfilter]" \ + "fa f2 procFilter-::SB(${i})::fb-::Filtered${i}::testfilter-::procFilter-::SB(${i})::f2-::SA(${i})::fa-fb-"\ + "filter infos" + + ::errorCheck [f${i} filtersearch fa]-[f${i} filtersearch fb]-[f${i} filtersearch procFilter] "::SA(${i}) instproc fa-::SB(${i})::fb-::Filtered${i}::testfilter-::procFilter-::SB(${i})::f2-::SA(${i})::fa-::SB(${i}) instproc fb-::SB(${i})::fb-::Filtered${i}::testfilter-::procFilter-::SB(${i})::f2-::SA(${i})::fa-::f${i} proc procFilter-::SB(${i})::fb-::Filtered${i}::testfilter-::procFilter-::SB(${i})::f2-::SA(${i})::fa" "filtersearch" + + Filtered${i} instfilter {} + SB($i) instfilter {} + set erg [f${i} a] + + ::errorCheck $erg "in a-::procFilter-::SB(${i})::f2-::SA(${i})::fa" \ + "only obj filter" + + f${i} filter {} + set erg [f${i} a] + ::errorCheck $erg "in a" \ + "obj filter remove" + } + for {set i 0} {$i < $n} {incr i} { + SA($i) destroy + SB($i) destroy + SC($i) destroy + } + + ::errorCheck $::filterCount 960 \ + "Filter Test - Filter Count -- Got: $::filterCount" + + # + # instvar test + # + + Object o + o set x 1 + Object o1 + o1 set x 11 + Object o2 + o2 proc t {} { + # multiple imports for existing (x) and not existing vars (y) + o instvar x y + append result "x: $x " + append result "y: ie [info exists y] me [my exists y] " \ + "iv '[info vars y]' oe [o exists y] oiv '[o info vars y]' // " + set y 100 + append result "y: ie [info exists y] me [my exists y] " \ + "iv '[info vars y]' oe [o exists y] oiv '[o info vars y]'" + ::errorCheck $result \ + "x: 1 y: ie 0 me 0 iv 'y' oe 0 oiv '' // y: ie 1 me 0 iv 'y' oe 1 oiv 'y'" \ + "instvar test 1 failed" + set result "" + o1 instvar x y + append result "x: $x " + append result "y: ie [info exists y] me [my exists y] " \ + "iv '[info vars y]' oe [o1 exists y] oiv '[o1 info vars y]' // " + set y 101 + append result "y: ie [info exists y] me [my exists y] " \ + "iv '[info vars y]' oe [o1 exists y] oiv '[o1 info vars y]'" + ::errorCheck $result \ + "x: 11 y: ie 0 me 0 iv 'y' oe 0 oiv '' // y: ie 1 me 0 iv 'y' oe 1 oiv 'y'" \ + "instvar test 2 failed" + } + o2 t + + o destroy + o1 destroy + o2 destroy + + global filterResult + set filterResult "" + Object a + a set o 12 + a set p 13 + Class A + A set m 14 + + Object instproc f args { + global filterResult + a instvar o p + A instvar m + ::append filterResult " [self] [self calledproc] [self callingproc]" + ::append filterResult " $o $p $m" + next + } + + proc x {} { + set ::a::e xxx + } + + Object instfilter f + + x + ::errorCheck $::a::e xxx \ + "filterAddRemove: instvar test -- proc set failed" + a set e yyy + + ::errorCheck $::a::e yyy \ + "filterAddRemove: instvar test -- obj set failed" + + ::errorCheck $filterResult " ::A instvar f 12 13 14 ::a set run 12 13 14" \ + "filterAddRemove: instvar test -- instvar filter failed" + + Object instfilter "" + + Object instproc f args { + next + } + Object instfilter f + + ::errorCheck [Object o] "::o" \ + "filterAddRemove: Object creation with filter" + + # This produces a bug, if not + # RUNTIME_STATE(in)->returnCode = TCL_OK; + # in ObjDispatch -> UNKNOWN handling */ + # abrupt stop of program because result is set to XOTCL_UNKNOWN + # instead of TCL_ERROR, as it should be + catch {puts ${ZZZZZZZZZZZZZZZ::ZZZZZ}} + + o set r 43 + + ::errorCheck [o set r] "43" \ + "filterAddRemove: Object creation with filter: setting var" + + Object instfilter "" + + # test for CmdListReplaceCmd + set ::r "" + Class A + A instproc f2 args {lappend ::r [self class]-[self proc]; next} + Class C -superclass A + Class D -superclass C + D instfilter {f2} + D d + d filter {f2} + C instproc f2 args {lappend ::r [self class]-[self proc]; next} + set ::r "" + d set r 1 + + ::errorCheck $::r "::C-f2 ::A-f2" \ + "filter method addition" + + o proc m {} { + } + o proc f args { + my incr count + next + } + o set count 0 + o filter f + o m + ::errorCheck [o set count] 2 "filter count" + o filter "" + set filterstate [::xotcl::configure filter off] + o set count 0 + o m + ::errorCheck [o set count]-$filterstate 0-1 "filter off + old state" + o filter "" + ::xotcl::configure filter on + + set ::r "" + Object instproc f args { + set r [next] + lappend ::r [self]-[self calledproc] + return $r + } + + Class D + D filter f + D d1 + ::errorCheck $::r "::D-d1 ::D-alloc ::D-create ::D-unknown" "filter state after next" + +} + +@ TestX filterClassChange { + description {Regression test object testing class changes of filters.} +} +TestX filterClassChange -proc run {{n 20}} { + for {set i 0} {$i < $n} {incr i} { + Class A($i) + Class B + + A($i) instproc f args { + set result pre*[self]*[self proc]*$args + lappend result [next] post*[self]*[self proc] + return $result + } + + A($i) o($i) + o($i) proc change {} { + my class B + } + o($i) proc call {} { + return in-call + } + + A($i) instfilter f + + set erg [o($i) call] + ::errorCheck $erg "pre*::o($i)*f* in-call post*::o($i)*f" \ + "Filter Class Change -- Call before change" + o($i) change + + set erg [o($i) call] + ::errorCheck $erg "in-call" \ + "Filter Class Change -- Call after change" + # testing deleting a filter proc + Class F + F instproc testf args {return filtered} + F instfilter testf + F f1 + ::errorCheck [f1 set r 45] "filtered" "Deleting a filter proc ... before" + F instproc testf {} {} + ::errorCheck [f1 set r 45] "45" "Deleting a filter proc ... after" + + # testing remove a superclass + Class F1 + Class F2 -superclass F1 + Class F3 -superclass F2 + + F1 instproc testf args {return [next]-filtered} + F2 instproc testf2 args {return [next]-filtered} + F3 instfilter {testf testf2} + F3 f2 + + ::errorCheck [f2 filtersearch testf2] "::F2 instproc testf2-filtered-filtered" "filtersearch 2" + + ::errorCheck [f2 set r 45] "45-filtered-filtered" \ + "Removing a superclass ... before" + F3 superclass [F1 info superclass] + ::errorCheck [f2 filtersearch testf2] "" "filtersearch 2 after" + ::errorCheck [f2 set r 45] "45" "Class F2 removed from classtree ... after" + } + B destroy + for {set i 0} {$i < $n} {incr i} {A($i) destroy} +} + +@ TestX filterGuards { + description {Regression test object testing filter guards.} +} +TestX filterGuards -proc run {{n 20}} { + global filterResult + + for {set i 0} {$i < $n} {incr i} { + set ::filterResult "" + Class A + A instproc f2 args { + global filterResult + append filterResult "-[self]-[self proc]-[self class]-[self calledproc]" + next + } + Class B -superclass A + B instproc f1 args { + global filterResult + append filterResult "-[self]-[self proc]-[self class]-[self calledproc]" + next + } + B instproc f3 args { + global filterResult + append filterResult "-[self]-[self proc]-[self class]-[self calledproc]" + next + } + + B instfilter {{f1 -guard "1<0"}} + B b + ::errorCheck $filterResult "" "Filter guard: Filter never to be applied" + + b destroy + + A instproc f1 args { + global filterResult + append filterResult "-[self]-[self proc]-[self class]-[self calledproc]" + next + } + set filterResult "" + B b + ::errorCheck $filterResult "" \ + "Filter guard: Filter never to be applied + filter inheritance on this filter" + # filter w/o guard -> has to be applied + A instfilter f1 + b destroy + set filterResult "" + B b + ::errorCheck $filterResult "-::b-f1-::A-configure-::b-f1-::A-init" \ + "Filter guard: two different filters, same name + different class, one guarded, one not" + + # two filter w/o guard -> both have to be applied + B instfilter f1 + b destroy + set filterResult "" + B b + ::errorCheck $filterResult "-::b-f1-::B-configure-::b-f1-::A-configure-::b-f1-::B-init-::b-f1-::A-init" \ + "Filter guard: two different filters, both not guarded anymore" + + # three filters with guards, not to be applied, in one chain + b destroy + A instfilter {} + B instfilter {{f1 -guard {0}} {f3 -guard {0}} {f2 -guard {0}}} + set filterResult "" + B b + ::errorCheck $filterResult "" "Filter guard: three filters in one chain" + + # three times the same filter --> guards are and-combined + set filterResult "" + B instfilter {{f2 -guard {[self calledproc] eq "set" || [self] == "::b2"}}} + A instfilter {{f2 -guard {[self] == "::b2"}}} + B b1 + + B b2 + if {$i == 0} { + ::errorCheck $filterResult "-::b2-f2-::A-configure-::b2-f2-::A-init" \ + "Filter guard: creation with less restrictive guards" + } else { + ::errorCheck $filterResult "-::b2-f2-::A-cleanup-::b2-f2-::A-configure-::b2-f2-::A-init" \ + "Filter guard: creation with less restrictive guards (b)" + } + set filterResult "" + b1 set x 45 + ::errorCheck $filterResult "-::b1-f2-::A-set" \ + "Filter guard: setting restricted object" + + set filterResult "" + b1 info class + ::errorCheck $filterResult "" \ + "Filter guard: info restricted object (no guard applies)" + + set filterResult "" + b2 info class + ::errorCheck $filterResult "-::b2-f2-::A-info" \ + "Filter guard: setting restricted object (2nd guard applies)" + + b1 filter {{f2 -guard {[self calledproc] eq "info"}}} + + set filterResult "" + b1 proc a {} { + # + } + ::errorCheck $filterResult "" \ + "Filter guard: proc on restricted object (no guard applies)" + + set filterResult "" + b1 info class + ::errorCheck $filterResult "-::b1-f2-::A-info" \ + "Filter guard: info filtered by object filter guard" + + + # checking infos + ::errorCheck [b1 info filterguard f2]-[B info instfilterguard f2]-[A info instfilterguard f2] \ + {[self calledproc] eq "info"-[self calledproc] eq "set" || [self] == "::b2"-[self] == "::b2"} \ + "Filter guard: info filtered by object filter guard" + + # checking info -guards option + Class A + A instproc f1 args {next} + A instproc fx args {next} + Class B -superclass A + B instproc f1 args {next} + B instproc f2 args {next} + B b + B instfilter {{f1 -guard {[self] eq "::b"}} {f2 -guard 0} f1} + b filter {{f1 -guard {[self] eq "::b"}} {f2 -guard 0}} + + ::errorCheck [B info instfilter]-[B info instfilter -guards]-[b info filter]-[b info filter -guards] \ + {f1 f2-f1 {f2 -guard 0}-f1 f2-{f1 -guard {[self] eq "::b"}} {f2 -guard 0}}\ + {[self] -- Filter guard: -guards option} + + A instfilter {f1 fx} + A a + a proc x args {next} + a filter x + + ::errorCheck [b info filter -order]-[a info filter -order] "{::B instproc f1} {::B instproc f2} {::A instproc f1} {::A instproc fx}-{::a proc x} {::A instproc f1} {::A instproc fx}" \ + {[self] -- Filter guard: -order option} + + ::errorCheck [b info filter -order -guards]-[a info filter -order -guards] {{f1 -guard {[self] eq "::b"}} {f2 -guard 0} f1 fx-x f1 fx} \ + {[self] -- Filter guard: -order -guards options} + + + Class Foo + Foo instproc init {args} {my set bar hello} + Foo instproc baz {args} { + my instvar bar + return $bar + } + Foo instproc myFilter {args} { + lappend ::r myFilter->[self calledproc] + my set r 4 + next + } + Foo instfilter myFilter + Foo instfilterguard myFilter { ([self calledproc] eq "baz") } + Foo instfilterguard myFilter { ([self calledproc] eq "baz") } + set f [Foo new] + $f baz + ::errorCheck [$f baz] "hello" {Filter guard from method call} + Foo instfilterguard myFilter {} + + set ::r "" + Foo create f + f filter myFilter + f filterguard myFilter { ([self calledproc] eq "baz") } + lappend ::r [f baz] [f set r 1] + f filterguard myFilter {} + lappend ::r [f baz] [f set r 1] + ::errorCheck $::r [list myFilter->configure myFilter->init \ + myFilter->set myFilter->filter \ + myFilter->filterguard myFilter->baz \ + hello 1 myFilter->baz \ + myFilter->instvar myFilter->set hello 1] \ + {Filter guard from method call} + f destroy + + Class Room + Room instproc open {} {lappend ::r [self proc]} + Room instproc x {} {lappend ::r [self proc]} + Room instproc loggingFilter args { + lappend ::r [self proc]-[self calledproc] + next + } + Room instproc callsMethod {method calledproc} { + return [string match $calledproc $method] + } + Room instproc callsLevel2 {} { + set level [self guardedlevel] + lappend ::r $level + set calledproc [uplevel $level self calledproc] + lappend ::r $calledproc + } + Room instfilter loggingFilter + Room instfilterguard loggingFilter {[my callsMethod open [self calledproc]]} + + Room r + + set ::r "" + + r open + r x + + ::errorCheck $::r "loggingFilter-open open x" {info guarded scope} + } +} + + +@ TestX mixinGuards { + description {Regression test object testing mixin guards.} +} +TestX mixinGuards -proc run {{n 20}} { + set ::r "" + Class Fly + Fly instproc fly {} {lappend ::r "[my signature]: yippee, fly like an eagle!"} + + Class Sing + Sing instproc sing {} {lappend ::r "[my signature]: what a difference a day make"} + + Class Animal -parameter age + Animal instproc unknown args { lappend ::r "[my signature]: how should i $args?"} + Animal instproc signature {} { + return "[self] [my info class] ([my age] years)" + } + + Class Bird -superclass Animal + Class Penguine -superclass Bird + Class Parrot -superclass Bird + Class Duck -superclass Bird + + Parrot tweedy -age 1 + Penguine pingo -age 5 + Duck donald -age 4 + Parrot lora -age 6 + + Bird instmixin {{Fly -guard {[my age]>2 && ![my istype Penguine]}} Sing} + + foreach bird {tweedy pingo donald lora} { $bird fly } + + ::errorCheck [set ::r] [list \ + {::tweedy ::Parrot (1 years): how should i fly?} \ + {::pingo ::Penguine (5 years): how should i fly?} \ + {::donald ::Duck (4 years): yippee, fly like an eagle!} \ + {::lora ::Parrot (6 years): yippee, fly like an eagle!}] \ + {Simple Instmixin Guard} + + set ::r "" + tweedy age 3 + pingo class Duck + lora class Penguine + foreach bird {tweedy pingo donald lora} { $bird fly } + + ::errorCheck [set ::r] [list \ + {::tweedy ::Parrot (3 years): yippee, fly like an eagle!} \ + {::pingo ::Duck (5 years): yippee, fly like an eagle!} \ + {::donald ::Duck (4 years): yippee, fly like an eagle!} \ + {::lora ::Penguine (6 years): how should i fly?}] \ + {Simple Instmixin Guard ... Class Change} + + set ::r "" + pingo mixin {{Fly -guard {[my age]>2}} Sing} + foreach i { + {Bird info instmixin -guards} + {pingo info mixin -guards} + {pingo info mixin -order -guards}} { + lappend ::r "$i [eval $i]" + } + + ::errorCheck [set ::r] [list \ + {Bird info instmixin -guards {::Fly -guard {[my age]>2 && ![my istype Penguine]}} ::Sing} \ + {pingo info mixin -guards {::Fly -guard {[my age]>2}} ::Sing} \ + {pingo info mixin -order -guards {::Fly -guard {[my age]>2}} ::Sing}] \ + {Simple Instmixin Guard ... Info} + + set ::r "" + Class POM-start + Class POM-end + Class PCM-start + Class PCM-end + pingo mixin {POM-start {Fly -guard {[my age]>2}} Sing POM-end} + Bird instmixin {PCM-start {Fly -guard {[my age]>2 && ![my istype Penguine]}} Sing PCM-end} + + pingo class Penguine + foreach i { + {Bird info instmixin -guards} + {pingo info mixin -guards} + {pingo info mixin -order -guards}} { + lappend ::r "$i [eval $i]" + } + + + ::errorCheck [set ::r] [list \ + {Bird info instmixin -guards ::PCM-start {::Fly -guard {[my age]>2 && ![my istype Penguine]}} ::Sing ::PCM-end} \ + {pingo info mixin -guards ::POM-start {::Fly -guard {[my age]>2}} ::Sing ::POM-end} \ + {pingo info mixin -order -guards ::POM-start ::POM-end ::PCM-start {::Fly -guard {[my age]>2}} ::Sing ::PCM-end}] \ + {Same Mixin Guard ... Info} + + set ::r "" + pingo fly + ::errorCheck [set ::r] [list \ + {::pingo ::Penguine (5 years): yippee, fly like an eagle!}] \ + {Same Mixin Guard ... most specific counts} + + + set ::r "" + Animal a -set age 20 + a mixin Fly + a mixinguard ::Fly {[my age] > 3} + a fly + lappend ::r [a info mixin -guards] + lappend ::r [a info mixin -order -guards] + a set age 2 + a fly + a mixinguard ::Fly {[my age] > 4} + a fly + set info "" + lappend info [a info mixinguard Fly] + lappend ::r [a info mixin -guards] + lappend ::r [a info mixin -order -guards] + a mixinguard ::Fly {} + a fly + lappend ::r [a info mixin -guards] + lappend info [a info mixinguard Fly] + lappend ::r [a info mixin -order -guards] + ::errorCheck [set ::r] [list \ + {::a ::Animal (20 years): yippee, fly like an eagle!} \ + {{::Fly -guard {[my age] > 3}}} {{::Fly -guard {[my age] > 3}}} \ + {::a ::Animal (2 years): how should i fly?} \ + {::a ::Animal (2 years): how should i fly?} \ + {{::Fly -guard {[my age] > 4}}} {{::Fly -guard {[my age] > 4}}} \ + {::a ::Animal (2 years): yippee, fly like an eagle!} \ + ::Fly ::Fly] \ + {mixinguard method} + + set ::r "" + Class A -superclass Animal + A a -set age 20 + A instmixin Fly + A instmixinguard ::Fly {[my age] > 3} + lappend info [A info instmixinguard ::Fly] + a fly + lappend ::r [A info instmixin -guards] + lappend ::r [a info mixin -order -guards] + a set age 2 + a fly + A instmixinguard ::Fly {[my age] > 4} + lappend info [A info instmixinguard ::Fly] + a fly + lappend ::r [A info instmixin -guards] + lappend ::r [a info mixin -order -guards] + A instmixinguard ::Fly {} + lappend info [A info instmixinguard ::Fly] + a fly + lappend ::r [A info instmixin -guards] + lappend ::r [a info mixin -order -guards] + ::errorCheck [set ::r] [list \ + {::a ::A (20 years): yippee, fly like an eagle!} \ + {{::Fly -guard {[my age] > 3}}} {{::Fly -guard {[my age] > 3}}} \ + {::a ::A (2 years): how should i fly?} \ + {::a ::A (2 years): how should i fly?} \ + {{::Fly -guard {[my age] > 4}}} {{::Fly -guard {[my age] > 4}}} \ + {::a ::A (2 years): yippee, fly like an eagle!} \ + ::Fly ::Fly] \ + {instmixinguard method} + + ::errorCheck [set info] [list {[my age] > 4} {} {[my age] > 3} \ + {[my age] > 4} {} ] {info (inst)mixinguard} + +} + +@ TestX filterSimpleObserver { + description {Regression test object testing a simple observer using filters. + } +} +TestX filterSimpleObserver -proc run {{n 20}} { + set ::filterCount 0 + for {set i 0} {$i < $n} {incr i} { + Class NetAccess$i + Class Http$i -superclass NetAccess$i + Class TransferDialog$i + + TransferDialog$i proc addObserver cl { + $cl instproc observerFilter args { + set calledMethod [self calledproc] + set callingClass [my info class] + incr ::filterCount + set result [next] + + my set r 34 + + foreach var {args calledMethod callingClass result} { + if {[info vars $var] != $var} { + puts stderr "[self] -- Simple Observer - info vars in filter" + exit + } + } + + + return [self]-[self class]-[my info class]-$args-[self calledproc]-[self callingproc]-$result + } + $cl instfilter observerFilter + } + + TransferDialog$i instproc show {i} { + next + TransferDialog${i} addObserver NetAccess$i + [self class] instvar observingObjects + lappend observingObjects(::NetAccess$i) [self] + } + + Http$i parameter {a be bu} + Http$i instproc path x { my set path $x } + + Http$i instproc query x { + my set [self proc] $x + } + Http$i instproc init {args} { + my set url abc + next + my instvar query path bu + if {![info exists query] || + ![info exists path] || + ![info exists bu] || + $query ne "q"} { + puts stderr "FAILED - [self] -- Simple Observer - Variable Init"; exit + } + } + + Http$i instproc GET {x} { + my instvar query url path + if {[info exists query]} { + append url ?$query + append path ?$query + } + set ::baseLevel [info level] + + + if {0 != [expr {[info level] - $::baseLevel}]} { + puts stderr "FAILED - [self] -- Simple Observer - info level in filtered proc\n\ + expected 0, got [expr {[info level] - $::baseLevel}]" + exit + } + foreach var {x path query url} { + if {[info vars $var] != $var} { + puts stderr "FAILED - [self] -- Simple Observer - info vars in filtered proc"; + exit + } + } + return $url + } + + TransferDialog$i t($i) + t($i) show $i + + Http$i h($i) -query q -path p -bu b + + set erg [h($i) GET 1] + ::errorCheck $erg "::h($i)-::NetAccess$i-::Http$i-1-GET-run-abc?q" \ + "Simple Observer - Filter Return" + + } + for {set i 0} {$i < $n} {incr i} { + NetAccess$i instfilter {} + + h($i) destroy + t($i) destroy + + Http$i destroy + NetAccess$i destroy + TransferDialog$i destroy + } + + ::errorCheck $::filterCount 220 \ + "Simple Observer - Filter Count" +} + + + +@ TestX stdargs { + description { + Regression test object testing the ability of the next primitive to pass + arguments without naming them. + } +} +TestX stdargs -proc run {{n 20}} { + for {set i 0} {$i < $n} {incr i} { + Class C + Class D + Class A -superclass {C D} + Class B -superclass A + + C instproc t {} { + next + return + } + D instproc t args { + ::errorCheck $args "" --noArgs + next + return + } + + A instproc t {a b args} { + if {$a != 1 || $b != 2 || $args != {3 4 5 6 7 8 9}} { + puts stderr "FAILED - [self] -- StdArgs not computed"; exit + } + next --noArgs + return + } + + B instproc t {a b args} { + if {$a != 1 || $b != 2 || $args != {3 4 5 6 7 8 9}} { + puts stderr "FAILED -[self] -- StdArgs not computed"; exit + } + next + return + } + + B x + x t 1 2 3 4 5 6 7 8 9 + } + foreach o {x A B C D} {$o destroy} + +} + + +@ TestX filterInfo { + description{ + Regression test object testing introspection of filters. + } +} + +TestX filterInfo +# Helper Procs +proc ::showStack {{m 100}} { + set r "" + set max [info level] + if {$m<$max} {set max $m} + for {set i 0} {$i < $max} {incr i} { + set r ${r}-$i=[info level [expr -$i]] + } + return $r +} +proc ::showCall {} { + set n "" + for {set level -1} {1} {incr level -1} { + set p [info level $level] + if {[lindex $p 0] eq "next"} {set n "next:"} break + } + return [showStack] +} + +filterInfo proc run {{n 20}} { + for {set i 0} {$i < $n} {incr i} { + global FInfo + set FInfo "" + + Class FI + + FI proc addFilter {classname} { + $classname instproc infoFilter args { + global FInfo + lappend FInfo \ + [list callingclass [self callingclass] \ + filterreg [self filterreg] \ + callingobject [self callingobject] \ + callingproc [self callingproc] \ + calledproc [self calledproc]] + set r [next] + lappend FInfo \ + [list self [self] proc [self proc] class [self class] \ + infoclass [my info class] r $r] + return $r + } + $classname instfilter infoFilter + } + + Class C0 + FI addFilter C0 + C0 instproc m1 {} { + my instvar aa bb cc + set cc 1 + } + + Class C1 -superclass C0 + C1 instproc init args { + my set a 1 + my set c 22 + next + } + C1 instproc m1 args { + set r [next] + my instvar a b cc + return $r--${a}--[set cc] + } + + set safedObjFilters [Object info filter] + Object instfilter "" + C1 c1 + Object instfilter $safedObjFilters + + if {$i == 0} { + ::errorCheck "$FInfo" \ + "{callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc configure} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 0} {callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc init} {callingclass ::C1 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc init calledproc set} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 1} {callingclass ::C1 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc init calledproc set} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 22} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r {}}" \ + "Wrong filtering of instproc creation C/C1" + } else { + ::errorCheck "$FInfo" \ + "{callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc cleanup} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r {}} {callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc configure} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 0} {callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc init} {callingclass ::C1 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc init calledproc set} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 1} {callingclass ::C1 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc init calledproc set} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 22} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r {}}" \ + "Wrong filtering of instproc creation C/C1 (b)" + } + + set FInfo "" + set result [c1 m1] + + ::errorCheck $FInfo \ + "{callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc m1} {callingclass ::C0 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc m1 calledproc instvar} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r {}} {callingclass ::C1 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc m1 calledproc instvar} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r {}} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 1--1--1}" \ + "Wrong filtering of c1 m1" + + set FInfo "" + + ::errorCheck $result \ + "1--1--1" "Wrong return result of Filter Example 2 'c1 m1' " + + + Class T0 + FI addFilter T0 + T0 instproc m {} { + set e -0=showStack-1=showCall-2=m-3=m-4=m-5=run-6=run + if {[string first $e [showCall]] == -1} { + puts stderr "FAILED - Wrong calling stack in T0 m: [showCall]" + puts stderr "expected = '$e'" + puts stderr "got = '[showCall]'" + exit + } + return [self]-[self proc]-[self class]-[my info class] + } + Class T1 -superclass T0 + T1 instproc m {} { + set e 0=showStack-1=showCall-2=m-3=m-4=run-5=run + if {[string first $e [showCall]] == -1} { + puts stderr "FAILED - Wrong calling stack in T1 m: [showCall]" + puts stderr "expected = '$e'" + puts stderr "got = '[showCall]'" + exit + } + + set r1 before-[self]-[self proc]-[self class]-[my info class] + set r2 [next] + set r after-[self]-[self proc]-[self class]-[my info class]-${r1}-$r2 + } + + T1 t + + set FInfo "" + set result [t m] + ::errorCheck $FInfo \ + "{callingclass {} filterreg {::T0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc m} {callingclass ::T1 filterreg {::T0 instfilter infoFilter} callingobject ::t callingproc m calledproc info} {self ::t proc infoFilter class ::T0 infoclass ::T1 r ::T1} {callingclass ::T0 filterreg {::T0 instfilter infoFilter} callingobject ::t callingproc m calledproc info} {self ::t proc infoFilter class ::T0 infoclass ::T1 r ::T1} {callingclass ::T1 filterreg {::T0 instfilter infoFilter} callingobject ::t callingproc m calledproc info} {self ::t proc infoFilter class ::T0 infoclass ::T1 r ::T1} {self ::t proc infoFilter class ::T0 infoclass ::T1 r after-::t-m-::T1-::T1-before-::t-m-::T1-::T1-::t-m-::T0-::T1}" \ + "Wrong filtering of t m" + + set FInfo "" + ::errorCheck $result \ + "after-::t-m-::T1-::T1-before-::t-m-::T1-::T1-::t-m-::T0-::T1" \ + "Wrong return result of Filter Example 2 \"t m\" " + } + c1 destroy + + for {set i 0} {$i < $n} {incr i} { + global InfoTraceResult + + Object instfilter "" + Object InfoTrace + + InfoTrace proc createInfoTrace cl { + $cl instproc infoTraceFilter args { + global InfoTraceResult + ::set r [next] + ::lappend InfoTraceResult [list \ + $r-[self]-[self proc]-[self class] \ + [my info class]-[self calledproc] \ + [self callingproc]-[self callingobject] \ + [self callingclass]-[self filterreg]] + return $r + } + $cl instfilter infoTraceFilter + } + Class ObjectsClass + ObjectsClass anObject + Class aClass + ObjectsClass instproc aProc {} {aClass create anotherObject} + InfoTrace createInfoTrace Object + set InfoTraceResult "" + set r [anObject aProc] + if {$i > 0} { + ::errorCheck $InfoTraceResult \ + "{-::anotherObject-infoTraceFilter-::xotcl::Object ::aClass-cleanup aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {-::xotcl::Class::Parameter-infoTraceFilter-::xotcl::Object ::xotcl::Class-searchDefaults aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {0-::anotherObject-infoTraceFilter-::xotcl::Object ::aClass-configure aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {-::anotherObject-infoTraceFilter-::xotcl::Object ::aClass-init aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {::anotherObject-::aClass-infoTraceFilter-::xotcl::Object ::xotcl::Class-recreate aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {::anotherObject-::aClass-infoTraceFilter-::xotcl::Object ::xotcl::Class-create aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {::anotherObject-::anObject-infoTraceFilter-::xotcl::Object ::ObjectsClass-aProc run-::filterInfo {-::xotcl::Object instfilter infoTraceFilter}}" \ + "FilterInfo InfoTrace: Filter information wrong (b)" + } else { + ::errorCheck $InfoTraceResult \ + "{::anotherObject-::aClass-infoTraceFilter-::xotcl::Object ::xotcl::Class-alloc aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {-::xotcl::Class::Parameter-infoTraceFilter-::xotcl::Object ::xotcl::Class-searchDefaults aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {0-::anotherObject-infoTraceFilter-::xotcl::Object ::aClass-configure aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {-::anotherObject-infoTraceFilter-::xotcl::Object ::aClass-init aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {::anotherObject-::aClass-infoTraceFilter-::xotcl::Object ::xotcl::Class-create aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {::anotherObject-::anObject-infoTraceFilter-::xotcl::Object ::ObjectsClass-aProc run-::filterInfo {-::xotcl::Object instfilter infoTraceFilter}}" \ + "FilterInfo InfoTrace: Filter information wrong" + } + } + + Object instfilter {} + global fUplevelResult + set fUplevelResult "" + + Class FilterMix + FilterMix instproc calls args { + global fUplevelResult + set calledproc [uplevel 1 {self calledproc}] + set calledclass [uplevel 1 {self calledclass}] + append fUplevelResult "-[self class]-[self proc]-$calledproc-$calledclass" + } + Class FilterCL -instmixin FilterMix + FilterCL instproc filterA args { + global fUplevelResult + append fUplevelResult -[self class]-[self proc]-[self calledproc]-[self calledclass] + my calls + next + } + FilterCL instproc fclproc args {} + + FilterCL instfilter filterA + + FilterCL fcl + fcl fclproc + +# ::errorCheck $fUplevelResult "-::FilterCL-filterA-configure-::xotcl::Object-::FilterMix-calls-configure-::xotcl::Object-::FilterCL-filterA-init-::xotcl::Object-::FilterMix-calls-init-::xotcl::Object-::FilterCL-filterA-fclproc-::FilterCL-::FilterMix-calls-fclproc-::FilterCL" "Filter/Mixin Info Uplevel Test" +} + + + +@ TestX nextTest { + description {Regression test object testing the next primitive.} +} +TestX nextTest -proc run {{n 20}} { + for {set i 0} {$i < $n} {incr i} { + + global result infoNext + set result "" + set infoNext "" + + Class X + X instproc n {} { + append ::infoNext " [self]+[self class]->[self proc]*<[self next]>" + next + } + Class Y -superclass X + Y instproc m {} { + append ::infoNext " [self]+[self class]->[self proc]*<[self next]>" + next + } + Y instproc n {} { + append ::infoNext " [self]+[self class]->[self proc]*<[self next]>" + next + } + Y y + + y m + y n + y proc n {} { + append ::infoNext " [self]+[self class]->[self proc]*<[self next]>" + next + } + y n + ::errorCheck $infoNext " ::y+::Y->m*<> ::y+::Y->n*<::X instproc n> ::y+::X->n*<> ::y+->n*<::Y instproc n> ::y+::Y->n*<::X instproc n> ::y+::X->n*<>" \ + "simple self next test" + set infoNext "" + set result "" + + Class A + A instproc m arg { + global result infoNext + set result ${result}-[self]-$arg + } + Class B -superclass A + B instproc m arg { + global result infoNext + set result ${result}-[self]-$arg + append infoNext " 2[self]+[self class]->[self proc]*<[self next]>" + next + } + B b0 -m 1 + B b -m "" + + ::errorCheck $result "-::b0-1-::b0-1-::b--::b-" \ + "Next Test A/B -- Wrong result" + + set result "" + + Class X + X instproc init args { + global result infoNext + set result ${result}-[self]-$args + append infoNext " 1[self]+[self class]->[self proc]*<[self next]>" + next + } + X instproc test {} { + global result + set result ${result}-[self] + } + + X x -test + ::errorCheck $result "-::x-::x-" \ + "Next Test X -- Wrong result" + ::errorCheck $infoNext " 2::b0+::B->m*<::A instproc m> 2::b+::B->m*<::A instproc m> 1::x+::X->init*<::xotcl::Object instproc init>" \ + "self next test 2" + X destroy + x destroy + A destroy + B destroy + b0 destroy + b destroy + + Class MIX + MIX instproc mProc args { + global result + append result "[self]-[self class]-[self next]" + next + } + Object o -mixin MIX + o proc mProc args { + global result + append result "[self]-[self class]-[self next]" + } + set result "" + o mProc + ::errorCheck $result "::o-::MIX-::o proc mProc::o--" \ + "Next Test Proc & Mixin" + + o destroy; MIX destroy + } + } + +@ TestX init_params { + description { + Regression test object testing the parameter instance method, + the init dash '-' and constructor calling. + } +} + +TestX init_params -proc run {{n 20}} { + for {set i 0} {$i < $n} {incr i} { + global dashResult + set dashResult "" + set dashResultEnd "" + Class A + A instproc t0 {} { + global dashResult + set dashResult ${dashResult}*[self proc] + } + A instproc t1 {a} { + global dashResult + set dashResult ${dashResult}*[self proc]-$a + } + A instproc t2 {a b} { + global dashResult + set dashResult ${dashResult}*[self proc]-${a}-$b + } + A instproc t3 {a b c} { + global dashResult + set dashResult ${dashResult}*[self proc]-${a}-${b}-$c + } + A a + set dashResultEnd "[A a -t0] $dashResultEnd" + + A a + set dashResultEnd "[A a -t1 1] $dashResultEnd" + A a + set dashResultEnd "[A a -t2 1 2] $dashResultEnd" + A a + set dashResultEnd "[A a -t3 1 2 3] $dashResultEnd" + A a + set dashResultEnd "[A a -t0 -t0 -t3 1 2 3 -t0 -t1 1 -t1 1 -t0] $dashResultEnd" + + + catch {A a t} + + ::errorCheck $dashResult \ + "*t0*t1-1*t2-1-2*t3-1-2-3*t0*t0*t3-1-2-3*t0*t1-1*t1-1*t0" \ + "Init Dash Test fails" + ::errorCheck $dashResultEnd \ + "::a ::a ::a ::a ::a " \ + "Init Dash Test fails -- result" + + Class Foo -parameter {{match -exact}} + Foo ff + ::errorCheck [ff match] "-exact" "default with dash" + } + + # parameter/defaults test + + proc ::cmd {a b} { + return in-cmd-${a}-${b} + } + + global parameterResult + global initResult + + for {set i 0} {$i < $n} {incr i} { + Class O -parameter { + {a -default 0} + {b -default {[cmd 3 4]}} c d + {e -default 3} + {Self -default [self]} + } + O instproc init args { + global initResult + set initResult ${initResult}-[self]-[self class]-[self proc]--$args + next + } + O instproc show {} { + global parameterResult + set parameterResult [self] + foreach v [lsort [my info vars]] { + set parameterResult ${parameterResult}-${v}=<[my set ${v}]> + } + } + Class Meta -superclass Class + Meta instproc create args {next; return Meta-create} + Meta C -superclass O -parameter {a {b -default ""} {c -default 1}} + Class D -parameter {a {c -default 1}} -superclass O + # create on class should not be called + D instproc create args {next; return D-create} + D instproc init args { + global initResult + set initResult ${initResult}-[self]-[self class]-[self proc]--$args + next + } + D instproc test i { + ::errorCheck [my set c]-[my set a] "2-0" "Wrong order of init call" + } + + set parameterResult "" + set initResult "" + C c0 -show + ::errorCheck $parameterResult "::c0-Self=<::c0>-a=<0>-b=<>-c=<1>-e=<3>" \ + "C c0 parameter Test failed" + if {$i == 0} { + ::errorCheck $initResult "-::c0-::O-init--" \ + "C c0 parameter init Test failed" + } else { + ::errorCheck $initResult "-::c0-::O-init--" \ + "C c0 parameter init Test failed (b)" + } + + set parameterResult "" + set initResult "" + set r [C c1 -c 2 -init a b c -a 1 -show] + + ::errorCheck $parameterResult "::c1-Self=<::c1>-a=<1>-b=<>-c=<2>-e=<3>" \ + "C c1 parameter Test failed (b)" + + ::errorCheck $initResult "-::c1-::O-init--a b c" \ + "C c1 parameter init Test failed" + + set parameterResult "" + set initResult "" + set r $r-[D d1 -c 2 -init a b c -test $i -a 1 -show] + ::errorCheck $parameterResult "::d1-Self=<::d1>-a=<1>-b=-c=<2>-e=<3>" \ + "D d1 parameter Test failed" + if {$i == 0} { + ::errorCheck $initResult "-::d1-::D-init--a b c-::d1-::O-init--a b c" \ + "D d1 parameter init Test failed" + } else { + ::errorCheck $initResult "-::d1-::D-init--a b c-::d1-::O-init--a b c" \ + "D d1 parameter init Test failed (b)" + } + + + ::errorCheck $r "Meta-create-::d1" "User defined object creation failed" + } +} + +@ TestX mixinTest { + description { + Regression test object testing per-object mixins. + } +} + +TestX mixinTest -proc run {{n 10}} { + + global mixinResult + set mixinResult "" + Class Agent + Agent instproc moveAgent {x y} { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + next + } + Agent instproc otherProc {} { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + next + } + Class InteractiveAgent -superclass Agent + InteractiveAgent instproc moveAgent {x y} { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + next + } + Class InteractiveAgent2 -superclass Agent + InteractiveAgent2 instproc moveAgent {x y} { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + next + } + Class InteractiveAgent3 -superclass Agent + InteractiveAgent3 instproc moveAgent {x y} { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + next + } + + # Addition-Classes + Class MovementLog + MovementLog instproc moveAgent {x y} { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + my otherProc + next + } + MovementLog instproc otherProc {} { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + next + } + Class MovementTest + MovementTest instproc moveAgent {x y} { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + next + } + InteractiveAgent i1; InteractiveAgent i2 + i1 mixin MovementLog + i2 mixin MovementTest + + InteractiveAgent2 instmixin {MovementLog MovementTest} + InteractiveAgent3 instmixin MovementTest + InteractiveAgent2 i3; InteractiveAgent3 i4; + + ::errorCheck [InteractiveAgent2 info instmixin] "::MovementLog ::MovementTest" "Mixin: info instmixin" + + + i2 moveAgent 1 2 + ::errorCheck $mixinResult \ + "-::i2-moveAgent-::MovementTest-::i2-moveAgent-::InteractiveAgent-::i2-moveAgent-::Agent" \ + "Mixin: 'i2 moveAgent 1 2' failed" + + set mixinResult "" + i1 moveAgent 3 4 + ::errorCheck $mixinResult \ + "-::i1-moveAgent-::MovementLog-::i1-otherProc-::MovementLog-::i1-otherProc-::Agent-::i1-moveAgent-::InteractiveAgent-::i1-moveAgent-::Agent" \ + "Mixin: 'i1 moveAgent 3 4' failed" + + set mixinResult "" + i3 moveAgent 3 4 + ::errorCheck $mixinResult \ + "-::i3-moveAgent-::MovementLog-::i3-otherProc-::MovementLog-::i3-otherProc-::Agent-::i3-moveAgent-::MovementTest-::i3-moveAgent-::InteractiveAgent2-::i3-moveAgent-::Agent" \ + "Instmixin: 'i3 moveAgent 3 4' failed" + + set mixinResult "" + i4 moveAgent 3 4 + + ::errorCheck $mixinResult \ + "-::i4-moveAgent-::MovementTest-::i4-moveAgent-::InteractiveAgent3-::i4-moveAgent-::Agent" \ + "Instmixin: 'i4 moveAgent 3 4' failed" + + i4 mixin {MovementTest MovementLog} + + i4 proc aaa args {puts TEST} + ::errorCheck [i4 procsearch moveAgent]-[i4 procsearch aaa]-[i4 procsearch set] "::MovementLog instproc moveAgent-::i4 proc aaa-::xotcl::Object instcmd set" "procsearch" + + Class create A + A instproc f1 {} {puts hu} + A instforward f2 puts hu + A instparametercmd f5 + A create a0 + a0 proc f3 {} {puts hu} + a0 forward f4 puts hu + a0 parametercmd f6 puts hu + ::errorCheck [a0 procsearch f1] "::A instproc f1" procsearch-1 + ::errorCheck [a0 procsearch f2] "::A instforward f2" procsearch-2 + ::errorCheck [a0 procsearch f3] "::a0 proc f3" procsearch-3 + ::errorCheck [a0 procsearch f4] "::a0 forward f4" procsearch-4 + ::errorCheck [a0 procsearch f5] "::A instparametercmd f5" procsearch-4 + ::errorCheck [a0 procsearch f6] "::a0 parametercmd f6" procsearch-6 + ::errorCheck [a0 procsearch set] "::xotcl::Object instcmd set" procsearch-6 + + set mixinResult "" + i4 moveAgent 5 6 + ::errorCheck $mixinResult \ + -::i4-moveAgent-::MovementLog-::i4-otherProc-::MovementLog-::i4-otherProc-::Agent-::i4-moveAgent-::MovementTest-::i4-moveAgent-::InteractiveAgent3-::i4-moveAgent-::Agent \ + "Instmixin: 'i4 moveAgent 5 6' failed" + + Class A + A instproc test {} { + global mixinResult + set mixinResult "test" + i1 moveAgent 3 4 + } + A a + a test + ::errorCheck $mixinResult \ + "test-::i1-moveAgent-::MovementLog-::i1-otherProc-::MovementLog-::i1-otherProc-::Agent-::i1-moveAgent-::InteractiveAgent-::i1-moveAgent-::Agent" \ + "Mixin: 'a test' failed" + + i2 mixin {MovementLog MovementTest} + + set mixinResult "" + + i2 moveAgent a b + ::errorCheck $mixinResult \ + "-::i2-moveAgent-::MovementLog-::i2-otherProc-::MovementLog-::i2-otherProc-::Agent-::i2-moveAgent-::MovementTest-::i2-moveAgent-::InteractiveAgent-::i2-moveAgent-::Agent" \ + "Mixin: 'i2 moveAgent a b' failed" + + ::errorCheck "[i2 info mixin]-[i1 info mixin]-[a info mixin]" \ + "::MovementLog ::MovementTest-::MovementLog-" \ + "Mixin: Info failed" + + + ::errorCheck "[i2 ismixin MovementTest]-[i4 ismixin MovementTest]-[a ismixin MovementTest]-[i3 ismixin MovementTest]-[i4 ismixin MovementTest]-[i4 ismixin MovementLog]-[i3 ismixin YXZ]-[i3 ismixin InteractiveAgent]" \ + "1-1-0-1-1-1-0-0" \ + "'ismixin test' failed" + + ::errorCheck "[i2 hasclass MovementTest]-[i4 hasclass MovementTest]-[a hasclass MovementTest]-[i3 hasclass MovementTest]-[i4 hasclass MovementTest]-[i4 hasclass MovementLog]-[i3 hasclass YXZ]-[i3 hasclass InteractiveAgent]-[a hasclass A]-[i3 hasclass Agent]" \ + "1-1-0-1-1-1-0-0-1-1" \ + "'hasclass test' failed" + + set mixinResult "" + i2 mixin "" + i2 moveAgent a b + + ::errorCheck $mixinResult \ + "-::i2-moveAgent-::InteractiveAgent-::i2-moveAgent-::Agent" \ + "Mixin: remove failed" + + + set mixinResult "" + Class A + A instproc destroy args { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + next + } + A instproc y args { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + next + } + Class B + B instproc destroy args { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + next + } + B instproc y args { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + my mixin "" + next + } + B instproc x args { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + my destroy + } + + A a -mixin B + a destroy + + A a -mixin B + a x + + A a -mixin B + a y + + ::errorCheck $mixinResult \ + "-::a-destroy-::B-::a-destroy-::A-::a-x-::B-::a-destroy-::B-::a-destroy-::A-::a-y-::B-::a-y-::A" \ + "Mixin: destroy failed" + + A instmixin B + set mixinResult "" + A a2 + a2 destroy + A a2 + a2 x + A a2 + a2 y + + ::errorCheck $mixinResult \ + "-::a2-destroy-::B-::a2-destroy-::A-::a2-x-::B-::a2-destroy-::B-::a2-destroy-::A-::a2-y-::B-::a2-y-::A" \ + "Instmixin: destroy failed" + + # mixin Test: calls the mixins and a proc of the object + set ::mixinResult "" + Class A + Class B + A instproc a {} {set ::mixinResult ${::mixinResult}-[self]-[self class]-[self proc];next} + B instproc a {} {set ::mixinResult ${::mixinResult}-[self]-[self class]-[self proc]; next} + A d -mixin B + d proc a {} {set ::mixinResult ${::mixinResult}-[self]-[self class]-[self proc]; next} + d a + ::errorCheck $::mixinResult \ + "-::d-::B-a-::d--a-::d-::A-a" \ + "Mixin: calling of object's proc" + + set mixinResult "" + + d mixin {} + A instmixin B + d a + + ::errorCheck $::mixinResult \ + "-::d-::B-a-::d--a-::d-::A-a" \ + "Instmixin: calling of object's proc" + + # + # combining filters with mixins + # + set ::traceResults "" + + Class M1 + M1 instproc test args { + global traceResults + lappend traceResults "[self] [self proc] [self class]" + next + } + Class M2 + M2 instproc test args { + global traceResults + lappend traceResults "[self] [self proc] [self class]" + next + } + Class A + A instproc test args { + global traceResults + lappend traceResults "[self] [self proc] [self class]" + next + } + A instproc f1 args { + global traceResults + lappend traceResults "[self] [self proc] [self class]" + next + } + A instproc f2 args { + global traceResults + lappend traceResults "[self] [self proc] [self class]" + next + } + + A a + A instmixin {M1 M2} + A instfilter {f1 f2} + a test + + ::errorCheck $::traceResults \ + "{::a f1 ::A} {::a f2 ::A} {::a test ::M1} {::a test ::M2} {::a test ::A}" \ + "Combining mixins and filters" + + # mixin recursion test + set mixinResult "" + + Class Computation + Computation instproc compute args { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + # abstract interface for computations + } + Class ComputationOutput -superclass Computation + Computation instproc compute args { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + return $args + } + + Class RecFacultyMixin + RecFacultyMixin instproc compute args { + global mixinResult + set mixinResult ${mixinResult}-[self]-[self proc]-[self class] + set n [lindex $args 0] + set callingClass - + #puts stderr [self class]=[uplevel 1 self class]-[self callingclass] + #catch {set callingClass [uplevel 1 self class]} + set callingClass [self callingclass] + if {$n == 0} { + set result 1 + } else { + set f [my compute [expr {$n - 1}] x] + set result [expr {$n * $f}] + } + + if {$callingClass != [self class]} { + next $result + return $result + } else { + return $result + } + } + + ComputationOutput faculty + faculty mixin RecFacultyMixin + + ::errorCheck [faculty compute 3] 6 \ + "Mixin: faculty wrong result" + + ::errorCheck $mixinResult \ + "-::faculty-compute-::RecFacultyMixin-::faculty-compute-::RecFacultyMixin-::faculty-compute-::RecFacultyMixin-::faculty-compute-::RecFacultyMixin-::faculty-compute-::Computation" \ + "Mixin: faculty failed" + set mixinResult "" + + ComputationOutput faculty + ComputationOutput instmixin RecFacultyMixin + ::errorCheck [faculty compute 3] 6 "Mixin: faculty wrong result" + + ::errorCheck $mixinResult \ + "-::faculty-compute-::RecFacultyMixin-::faculty-compute-::RecFacultyMixin-::faculty-compute-::RecFacultyMixin-::faculty-compute-::RecFacultyMixin-::faculty-compute-::Computation" \ + "Mixin: faculty failed" + + + set ::mixinResult "" + set ::calling "" + + Class GrObject + GrObject instproc draw args { + lappend ::mixinResult [list grObject [self] [self proc] [self class]] + lappend ::calling [list grObject [self proc]: [self callingobject] [self callingclass] [self callingproc] [self next]] + } + + Class Image -superclass GrObject + Image instproc draw args { + lappend ::mixinResult [list image [self] [self proc] [self class]] + lappend ::calling [list image [self proc]: [self callingobject] [self callingclass] [self callingproc] [self next]] + next + } + + Class MenuDecorator + MenuDecorator instproc draw args { + lappend ::mixinResult [list m1 [self] [self proc] [self class]] + lappend ::calling [list m1 [self proc]: [self callingobject] [self callingclass] [self callingproc] [self next]] + next + } + + Class ScrollBarDecorator + ScrollBarDecorator instproc draw args { + lappend ::mixinResult [list m2 [self] [self proc] [self class]] + lappend ::calling [list m2 [self proc]: [self callingobject] [self callingclass] [self callingproc] [self next]] + next + } + + Image mainImage -mixin {MenuDecorator ScrollBarDecorator} + Image zoom -mixin {ScrollBarDecorator} + + Object instproc f args { + if {[self calledproc] ne "filter"} { + lappend ::mixinResult [list filter [self] [self proc] [self class]] + lappend ::calling [list filter [self proc]: [self callingobject] [self callingclass] [self callingproc] [self calledproc] [self next]] + } + return [next] + } + Object instfilter f + mainImage draw + zoom draw + + Object instfilter "" + + ::errorCheck $::calling \ + "{filter f: ::mixinTest {} run draw {::MenuDecorator instproc draw}} {m1 draw: ::mixinTest {} run {::ScrollBarDecorator instproc draw}} {m2 draw: ::mixinTest {} run {::Image instproc draw}} {image draw: ::mixinTest {} run {::GrObject instproc draw}} {grObject draw: ::mixinTest {} run {}} {filter f: ::mixinTest {} run draw {::ScrollBarDecorator instproc draw}} {m2 draw: ::mixinTest {} run {::Image instproc draw}} {image draw: ::mixinTest {} run {::GrObject instproc draw}} {grObject draw: ::mixinTest {} run {}} {filter f: ::mixinTest {} run instfilter {::xotcl::Class instforward instfilter}} {filter f: ::xotcl::Object ::xotcl::Class instfilter assign {::xotcl::InterceptorSlot instcmd assign}}" \ + "Mixin: Calling-Obj/Cl/Proc failed" + + ::errorCheck $::mixinResult \ + "{filter ::mainImage f ::xotcl::Object} {m1 ::mainImage draw ::MenuDecorator} {m2 ::mainImage draw ::ScrollBarDecorator} {image ::mainImage draw ::Image} {grObject ::mainImage draw ::GrObject} {filter ::zoom f ::xotcl::Object} {m2 ::zoom draw ::ScrollBarDecorator} {image ::zoom draw ::Image} {grObject ::zoom draw ::GrObject} {filter ::xotcl::Object f ::xotcl::Object} {filter ::xotcl::Class::slot::instfilter f ::xotcl::Object}" \ + "Mixin: Filter failed" + + set ::mixinResult "" + set ::calling "" + + Class InfoTrace2 + InfoTrace2 instproc infoTraceFilter2 args { + lappend ::calling \ + self [self] \ + "self proc" [self proc] \ + "self class" [self class] \ + "self calledproc" [self calledproc] \ + "self callingproc" [self callingproc] \ + "self callingobject" [self callingobject] \ + "self callingclass" [self callingclass] \ + "self filterreg" [self filterreg] \ + "self next" [self next] + next + } + + Class CallingObjectsClass + CallingObjectsClass create callingObject + + Class FilterRegClass -superclass InfoTrace2 + Class FilteredObjectsClass -superclass FilterRegClass + FilteredObjectsClass filteredObject + + CallingObjectsClass instproc callingProc args { + filteredObject set someVar 0 + } + FilterRegClass instfilter infoTraceFilter2 + + callingObject callingProc + + ::errorCheck $::calling \ + {self ::filteredObject {self proc} infoTraceFilter2 {self class} ::InfoTrace2 {self calledproc} set {self callingproc} callingProc {self callingobject} ::callingObject {self callingclass} ::CallingObjectsClass {self filterreg} {::FilterRegClass instfilter infoTraceFilter2} {self next} {::xotcl::Object instcmd set}} \ + "call stack info" + + Class M1; Class M2; Class M3; Class M4 + Class A; Class B -superclass A; B b + A instmixin {M1 M2} + B instmixin {M3 M1 M1 M4} + b mixin {M1 M1 M4} + + ::errorCheck [b info mixin -order] "::M3 ::M4 ::M1 ::M2" "Mixin Info: -order option" + ::errorCheck [B info instmixin]-[b info mixin] "::M3 ::M1 ::M4-::M1 ::M4" "Mixin Info: no duplicates" + B instmixin {} + ::errorCheck [b info mixin -order] "::M4 ::M1 ::M2" "Mixin Info: -order option" + + set ::r "" + Class X11 -instproc test {args} { + lappend ::r [self class] + next + } + Class X12 -instproc test {args} { + lappend ::r [self class] + next + } + Class X -instmixin {X11 X12} -instproc test {args} { + lappend ::r [self class] + next + } + + Class Y -instmixin X + Y create y -test + + X create x -test + + ::errorCheck $::r [list ::X11 ::X12 ::X ::X11 ::X12 ::X] \ + {transitive mixin} + + unset ::r + + # test for MixinRemoveFromMixinStack, MixinRemoveFromCmdPtr, + # MixinRemoveOnObjFromCmdPtr + Class A + A instproc x {} {B destroy; next} + Class B + B instproc x {} {next} + Class C + C instproc x {} {next} + + Object o -mixin {A B C} + o proc x {} {return x} + ::errorCheck [o x] {x} {mixin destroy on stack} + o destroy + + # testing transitive mixins; should be in both cases the same + Class IM + Class M + Object o -mixin M + M instmixin IM + ::errorCheck [o info precedence] {::IM ::M ::xotcl::Object} \ + {trans. mixin precedence 1} + + Object o -mixin M + ::errorCheck [o info precedence] {::IM ::M ::xotcl::Object} \ + {trans. mixin precedence 2} + o destroy +} + + +@ TestX mixinInheritanceTest { + description { + Regression test object testing per-object mixin inheritance. + } +} + +TestX mixinInheritanceTest -proc run {{n 10}} { + for {set i 0} {$i < $n} {incr i} { + global mixinResult + set mixinResult "" + + Class A + Class B + Class C -superclass {A B} + + Class GeneralMixin + Class RefinedMixin1 -superclass GeneralMixin + Class RefinedMixin2 -superclass GeneralMixin + Class AppMixin1 -superclass {RefinedMixin1 RefinedMixin2} + Class AppMixin2 -superclass {RefinedMixin2 RefinedMixin1} + Class AppMixin3 -superclass {RefinedMixin1} + + A instproc aProc args { + global mixinResult; + ::set mixinResult "$mixinResult [self class]" + return $args + } + B instproc aProc args { + global mixinResult; + ::set mixinResult "$mixinResult [self class]" + return $args + } + C instproc aProc args { + global mixinResult; + ::set mixinResult "$mixinResult [self class]" + return [next "$args [self class]"] + } + GeneralMixin instproc aProc args { + global mixinResult; + ::set mixinResult "$mixinResult [self class]" + return [next "$args [self class]"] + } + RefinedMixin1 instproc aProc args { + global mixinResult; + ::set mixinResult "$mixinResult [self class]" + return [next "$args [self class]"] + } + RefinedMixin2 instproc aProc args { + global mixinResult; + ::set mixinResult "$mixinResult [self class]" + return [next "$args [self class]"] + } + AppMixin1 instproc aProc args { + global mixinResult; + ::set mixinResult "$mixinResult [self class]" + return [next "$args [self class]"] + } + + AppMixin1 mixinInstance + set r [mixinInstance aProc ARGS1 ARGS2] + ::errorCheck $mixinResult \ + " ::AppMixin1 ::RefinedMixin1 ::RefinedMixin2 ::GeneralMixin" \ + "Mixin inheritance: mixinInstance aProc" + set mixinResult "" + + AppMixin3 mixinInstance2 + set r [mixinInstance2 aProc ARGS1 ARGS2] + ::errorCheck $mixinResult \ + " ::RefinedMixin1 ::GeneralMixin" \ + "Mixin inheritance: mixinInstance2 aProc" + set mixinResult "" + + A a + a mixin AppMixin1 + set r [a aProc ARGS1 ARGS2] + ::errorCheck $mixinResult \ + " ::AppMixin1 ::RefinedMixin1 ::RefinedMixin2 ::GeneralMixin ::A" \ + "Mixin inheritance: a aProc" + + + ::errorCheck $r \ + "{{{{ARGS1 ARGS2 ::AppMixin1} ::RefinedMixin1} ::RefinedMixin2} ::GeneralMixin}" \ + "Mixin inheritance result: a aProc" + + A a + A instmixin AppMixin1 + + set mixinResult "" + + set r [a aProc ARGS1 ARGS2] + ::errorCheck $mixinResult \ + " ::AppMixin1 ::RefinedMixin1 ::RefinedMixin2 ::GeneralMixin ::A" \ + "Instmixin inheritance: a aProc" + ::errorCheck $r \ + "{{{{ARGS1 ARGS2 ::AppMixin1} ::RefinedMixin1} ::RefinedMixin2} ::GeneralMixin}" \ + "Instmixin inheritance: a aProc" + set mixinResult "" + + C c + c mixin {AppMixin3 AppMixin2} + + set r [c aProc ARGS1 ARGS2] + ::errorCheck $mixinResult \ + " ::AppMixin1 ::RefinedMixin1 ::RefinedMixin2 ::GeneralMixin ::C ::A" \ + "Mixin/Instmixin inheritance: c aProc" + set mixinResult "" + A instmixin {} + + set r [c aProc ARGS1 ARGS2] + ::errorCheck $mixinResult \ + " ::RefinedMixin2 ::RefinedMixin1 ::GeneralMixin ::C ::A" \ + "Mixin/Instmixin inheritance: c aProc" + + GeneralMixin instproc set args { + global mixinResult; + ::set mixinResult "$mixinResult [self class]" + return [next] + } + RefinedMixin1 instproc set args { + global mixinResult; + ::set mixinResult "$mixinResult [self class]" + return [next] + } + AppMixin1 instproc set args { + global mixinResult; + ::set mixinResult "$mixinResult [self class]" + return [next] + } + + global setFilterResult + set setFilterResult "" + Object instproc setFilter args { + global setFilterResult + ::append setFilterResult \ + -[self]-[self calledproc]-[self calledclass] + next + } + + Object instfilter setFilter + + set mixinResult "" + set r [c set setVar 111] + + ::errorCheck $mixinResult \ + " ::RefinedMixin1 ::GeneralMixin" \ + "Mixin inheritance: c set" + # UNKNOWN PROBLEM 2 + # ::errorCheck [c setsetVar] 111 "Mixin inheritance: c set - value" + + ::errorCheck [c set setVar] 111 "Mixin inheritance: c set - value" + set mixinResult "" + mixinInstance set setVar 222 + + ::errorCheck $mixinResult \ + " ::AppMixin1 ::RefinedMixin1 ::GeneralMixin" \ + "Mixin inheritance: mixinInstance set" + ::errorCheck [mixinInstance set setVar] 222\ + "Mixin inheritance: mixinInstance set - value" + + ::errorCheck $setFilterResult \ + "-::c-set-::xotcl::Object-::c-set-::xotcl::Object-::mixinInstance-set-::AppMixin1-::mixinInstance-set-::AppMixin1" \ + "Mixin inheritance: Wrong classes in mixin set test" + + Object instfilter "" + } + + # Mixin init test + global initResult + set initResult "" + Class A + A instproc init args { + my mixin B + global initResult + append initResult [self class]- + next + } + + Class C + C instproc init args { + global initResult + append initResult [self class]- + next + } + + Class B -superclass C + B instproc init args { + global initResult + append initResult [self class]- + next + } + + Class D + D instproc init args { + global initResult + append initResult [self class]- + next + } + + A a + ::errorCheck $initResult "::A-" "Mixin init 1 failed" + set initResult "" + # in A mixin changes to B - before D's constructor must + # be called + A b -mixin D + ::errorCheck $initResult "::D-::A-" "Mixin init 2 failed" + + Class Mix + Mix instproc init args { + global initResult + append initResult [self class]- + next + } + Class Mix1 + Mix1 instproc init args { + global initResult + append initResult [self class]- + next + } + Class Mix2 + Mix2 instproc init args { + global initResult + append initResult [self class]- + next + } + Class A + A instproc init args { + global initResult + append initResult [self class]- + next + } + Class B + B instproc init args { + my mixin {Mix Mix1} + global initResult + append initResult [self class]- + next + } + + set initResult "" + A a + a mixin {Mix Mix1} + ::errorCheck $initResult ::A- "Mixin init 3 failed" + + set initResult "" + B b + ::errorCheck $initResult ::B- "Mixin init 4 failed" + + set initResult "" + B mixin add Mix2 + ::errorCheck $initResult "" "Mixin init 5 failed" + + set initResult "" + A mixin {}; A mixin {Mix Mix1} + ::errorCheck $initResult "" "Mixin init 6 failed" + + set initResult "" + A a -mixin {Mix} + ::errorCheck $initResult "::Mix-::A-" "Mixin init 7 failed" + + Class Strategy + Strategy instproc init args { + global initResult + append initResult [self class]- + next + } + Class A + A instproc strategy {n} { + set a [my info mixin] + my mixin [concat $n $a] + } + A instproc init args { + global initResult + append initResult [self class]- + next + } + Class Mix1 + Mix1 instproc init args { + global initResult + append initResult [self class]- + my strategy Strategy + next + } + set initResult "" + A a -mixin Mix1 + ::errorCheck $initResult ::Mix1-::A- "Mixin init 8 failed" + + set initResult "" + Class X + X instproc init args { + append ::initResult " [self]: [self class]->[self proc]" + next + } + Class Y -superclass X + Y instproc init args { + append ::initResult " [self]: [self class]->[self proc]" + next + } + + Class U -superclass X + U instproc init args { + append ::initResult " [self]: [self class]->[self proc]" + next + } + Class V + V instproc init args { + append ::initResult " [self]: [self class]->[self proc]" + next + } + + Class A + A instproc init args { + append ::initResult " [self]: [self class]->[self proc]" + next + } + Class B -superclass A + B instproc init args { + append ::initResult " [self]: [self class]->[self proc]" + next + } + A a + a mixin X + B b + b mixin Y + A a2 -mixin Y + B b2 -mixin X + A a3 -mixin {U V} + B b3 + b3 mixin {U V} + A a3 + A instmixin X + A instmixin {} + B instmixin Y + B b3 + b3 mixin Y + + ::errorCheck $initResult \ + " ::a: ::A->init ::b: ::B->init ::b: ::A->init ::a2: ::Y->init ::a2: ::X->init ::a2: ::A->init ::b2: ::X->init ::b2: ::B->init ::b2: ::A->init ::a3: ::U->init ::a3: ::X->init ::a3: ::V->init ::a3: ::A->init ::b3: ::B->init ::b3: ::A->init ::a3: ::A->init ::b3: ::Y->init ::b3: ::X->init ::b3: ::B->init ::b3: ::A->init" \ + "Mixin init 9 failed" + +} + + +@ TestX copymove { + description {Regression test for copy/move methods} +} + +TestX copymove -proc run {{n 10}} { + # Composite + Class Composite -superclass Class + Composite instproc addop {op} { + my instvar ops + set ops($op) $op + } + Composite instproc compositeFilter args { + set m [self calledproc] + set c [lindex [self filterreg] 0] + set r [next] + + if {[$c exists ops($m)]} { + foreach child [my info children] { + eval [self]::$child $m $args + } + } + return $r + } + + Composite AbstractNode + AbstractNode abstract instproc iterate v + AbstractNode addop iterate + for {set i 0} {$i < $n} {incr i} { + # + # class copy + # + Class X + Class X::Y + Class X::Y::Z -parameter { + {param1 1} + {param2 2} + } + #X::Y::Z metadata add {Version Author Nothing} + #X::Y::Z metadata Version {0.0.9} + #X::Y::Z metadata Author {Uwe} + X::Y::Z instproc defaultValueIP {{a defA} {b defB} v} { + return + } + X::Y::Z proc defaultValueP {{c defC} {d defD} v} { + return + } + + X::Y::Z instinvar {{7 > 6} { + #a comment + } + } + X::Y::Z instproc assProc {} {puts x} {{5 > 4} { + #pre + }} {{5 > 4} { + #post + } + } + + X::Y::Z check {pre post instinvar} + + foreach C {X X::Y X::Y::Z} { + $C instproc q {a b c} { + return [self]--[self class]--[self proc]--[next]-- + } + } + X::Y::Z z + X::Y::Z copy V + V v + ::errorCheck "[z q 1 2 3]--[X::Y::Z info class]--[X::Y::Z info classparent]" \ + "::z--::X::Y::Z--q------::xotcl::Class--::X::Y"\ + "class copy z" + ::errorCheck "[v q 1 2 3]--[V info class]--[V info classparent]" "::v--::V--q------::xotcl::Class--::"\ + "class copy v" + ::errorCheck "[::cutSpaces [V info parameter]--[v set param1]--[v set param2]]" \ + " {param1 1} {param2 2} --1--2" \ + "parameter test" + ::errorCheck "[::cutSpaces [V info instinvar]--[V info instpre assProc]--[V info instpost assProc]]"\ + "{7 > 6} { #a comment }--{5 > 4} { #pre }--{5 > 4} { #post }"\ + "Copy Class Assertions" + #::errorCheck "[V info metadata]--[V metadata Author]--[V metadata Version]--[V metadata Nothing]"\ + "Version Author Nothing--Uwe--0.0.9--"\ + "Copy Metadata" + + set df1 [V info default defaultValueP v dfv1] + set df2 [V info default defaultValueP c dfv2] + set df3 [V info instdefault defaultValueIP v dfv3] + set df4 [V info instdefault defaultValueIP a dfv4] + ::errorCheck "$df1 $dfv1 $df2 $dfv2 $df3 $dfv3 $df4 $dfv4"\ + "0 1 defC 0 1 defA"\ + "Copy Default Values" + + # class hierarchy copy + Class O + X copy O::X + O::X x1; O::X::Y y1; O::X::Y::Z z1 + ::errorCheck "[x1 q 1 2 3]--[y1 q 1 2 3]--[z1 q 1 2 3]" \ + "::x1--::O::X--q------::y1--::O::X::Y--q------::z1--::O::X::Y::Z--q----"\ + "class hierarchy copy" + # + # object copy + # + X x -set var1 12 -requireNamespace + proc ::x::tclProc args {return tclProc} + x proc q {a b c} {return [self]--[self class]--[self proc]--[next]--} + x copy y + ::errorCheck "[::y::tclProc]--[x q 1 2 3]--[y q 1 2 3]" \ + "tclProc--::x----q--::x--::X--q--------::y----q--::y--::X--q------"\ + "object copy" + # object hierarchy copy + x copy x::a + + x copy x::a::z + + ::errorCheck "[::x::a::tclProc]--[::x::a::z::a::tclProc]" \ + "tclProc--tclProc"\ + "object hierarchy copy" + + Class O + O x + x invar {{7 > 5} { + #a comment + }} + x proc assProc {} {return} {{5 > 3} { + #pre + }} {{5 > 4} {#post + }} + x set var1 12 + x proc p1 {} {return [self]-p1} + x copy y + ::errorCheck "[x p1]--[x set var1]--[::x info class]" "::x-p1--12--::O"\ + "Simple Copy - Origin" + ::errorCheck "[y p1]--[y set var1]--[::y info class]" "::y-p1--12--::O"\ + "Simple Copy - Duplicate" + ::errorCheck "[::cutSpaces [y info invar]--[y info pre assProc]--[y info post assProc]]"\ + "{7 > 5} { #a comment }--{5 > 3} { #pre }--{5 > 4} {#post }"\ + "Copy Obj Assertions" + + # + # move test + # + V destroy + X::Y::Z move V + V v + + ::errorCheck "[v q 1 2 3]--[V info class]--[V info classparent]" "::v--::V--q------::xotcl::Class--::"\ + "class move v" + ::errorCheck "[::cutSpaces [V info parameter]--[v set param1]--[v set param2]]" \ + " {param1 1} {param2 2} --1--2" \ + "parameter move test" + ::errorCheck "[::cutSpaces [V info instinvar]--[V info instpre assProc]--[V info instpost assProc]]"\ + "{7 > 6} { #a comment }--{5 > 4} { #pre }--{5 > 4} { #post }"\ + "Move Class Assertions" + #::errorCheck "[V info metadata]--[V metadata Author]--[V metadata Version]--[V metadata Nothing]"\ + "Version Author Nothing--Uwe--0.0.9--"\ + "Move Metadata" + + set df1 [V info default defaultValueP v dfv1] + set df2 [V info default defaultValueP c dfv2] + set df3 [V info instdefault defaultValueIP v dfv3] + set df4 [V info instdefault defaultValueIP a dfv4] + ::errorCheck "$df1 $dfv1 $df2 $dfv2 $df3 $dfv3 $df4 $dfv4"\ + "0 1 defC 0 1 defA"\ + "Move Default Values" + + ::errorCheck [::info commands X::Y::Z] "" "Moved command still exists" + + # + # copy with filters test + # + foreach filters {{} compositeFilter} { + Composite instfilter $filters + AbstractNode instfilter $filters + Object commands + Class Commands -superclass AbstractNode + Class Command -superclass Commands + Command instproc init args { + my instvar label + set label [self] + next + } + Command instproc setlabel {{arg ""}} { + my instvar label + if {$arg eq ""} { + set label + } else { + set label $arg + } + } + Command instproc setproc {value} { + my instvar src + set src $value + } + # prototypes + Command commands::cellcmd + commands::cellcmd setlabel cell + commands::cellcmd setproc {return "coucou" } + commands::cellcmd proc x args {return xxx} + commands::cellcmd copy toto + ::errorCheck [::toto info class] ::Command "Copy with Filter: info class" + ::errorCheck [toto set label] cell "Copy with Filter: set var" + ::errorCheck [toto x] xxx "Copy with Filter: call proc" + ::errorCheck [commands::cellcmd set label] cell \ + "Copy with Filter: set var" + } + Class A + Class V + Class Z + Class B -superclass A + Class B1 -superclass {V A Z} + A move X + ::errorCheck [B info superclass]-[B1 info superclass]-[X info subclass] \ + "::X-::V ::X ::Z-::B ::B1" \ + "Move of subclass relationship" + } +} + + +@ TestX recreation { + description { Regression test for object recreation/cleanup. } +} + +TestX recreation -proc run {{n 10}} { + for {set i 0} {$i < $n} {incr i} { + set ::recreateResult "" + Class R + R instproc recreate args { + global recreateResult + append recreateResult "*recreate [self] $args* " + set r [next] + append recreateResult "*recreate [self] <[lindex $args 0]> $r * " + return $r + } + Object instmixin R + + catch { + C destroy + c1 destroy + } + Class C -parameter {a b} + C instproc cProc {} {return cProc} + C set r 4 + C set v 5 + + C c1 -a 1 + c1 proc x {} {return p} + c1 set x 3 + C c1 -b 2 + append ::recreateResult "+[c1 info vars]," + append ::recreateResult "[c1 info procs] +" + + Class C + C set w 3 + append ::recreateResult "+[C info vars]," + append ::recreateResult "[C info instprocs] +" + if {$i > 0} { + errorCheck [set ::recreateResult] \ + "*recreate ::xotcl::Class ::R* *recreate ::xotcl::Class <::R> ::R * *recreate ::C ::c1 -b 2* *recreate ::C <::c1> ::c1 * +b, +*recreate ::xotcl::Class ::C* *recreate ::xotcl::Class <::C> ::C * +w, +" \ + "Var/proc recreate delete failed (n)" + } else { + errorCheck [set ::recreateResult] \ + "*recreate ::C ::c1 -b 2* *recreate ::C <::c1> ::c1 * +b, +*recreate ::xotcl::Class ::C* *recreate ::xotcl::Class <::C> ::C * +w, +" \ + "Var/proc recreate delete failed (0)" + } + global recreateMixinResult + global recreateFilterResult + set recreateMixinResult "" + set recreateFilterResult "" + Class RecreateObserve + foreach ip {create destroy instdestroy init configure + recreate cleanup alloc class} { + RecreateObserve instproc $ip args { + append ::recreateMixinResult " [self]+[self class]->[self proc]" + next + } + } + + Class Recreated + Recreated instproc recreationFilter args { + append ::recreateFilterResult " [self]+[self calledclass]->[self calledproc]" + next + } + Recreated instfilter recreationFilter + Recreated mixin RecreateObserve + Recreated instmixin RecreateObserve + + Recreated recreateObj + Recreated recreateObj + recreateObj destroy + errorCheck [set ::recreateFilterResult] \ + " ::recreateObj+::xotcl::Object->configure ::recreateObj+::xotcl::Object->init ::recreateObj+::xotcl::Object->cleanup ::recreateObj+::xotcl::Object->configure ::recreateObj+::xotcl::Object->init ::recreateObj+::xotcl::Object->destroy" \ + "recreateObj - recreateFilterResult" + if {$i == 0} { + errorCheck [set ::recreateMixinResult] \ + " ::Recreated+::RecreateObserve->create ::Recreated+::RecreateObserve->alloc ::recreateObj+::RecreateObserve->configure ::recreateObj+::RecreateObserve->init ::Recreated+::RecreateObserve->create ::Recreated+::RecreateObserve->recreate ::recreateObj+::RecreateObserve->cleanup ::recreateObj+::RecreateObserve->configure ::recreateObj+::RecreateObserve->init ::recreateObj+::RecreateObserve->destroy ::Recreated+::RecreateObserve->instdestroy" \ + "recreateObj - recreateMixinResult (0)" + } else { + errorCheck [set ::recreateMixinResult] \ + " ::Recreated+::RecreateObserve->cleanup ::Recreated+::RecreateObserve->create ::Recreated+::RecreateObserve->alloc ::recreateObj+::RecreateObserve->configure ::recreateObj+::RecreateObserve->init ::Recreated+::RecreateObserve->create ::Recreated+::RecreateObserve->recreate ::recreateObj+::RecreateObserve->cleanup ::recreateObj+::RecreateObserve->configure ::recreateObj+::RecreateObserve->init ::recreateObj+::RecreateObserve->destroy ::Recreated+::RecreateObserve->instdestroy" \ + "recreateObj - recreateMixinResult (n)" + } + } + + set ::cleanupResult "" + + catch {a destroy} + catch {A destroy} + catch {X destroy} + catch {META destroy} + + Class A + A proc instdestroy args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} + A proc recreate args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} + A instproc destroy args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} + A instproc cleanup args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} + + A a + A a::b + errorCheck [set ::cleanupResult] "" "Cleanup Create Failed" + A a + errorCheck [a info children] "" "Cleanup Object Children Destroy Failed" + A a::b + + errorCheck [set ::cleanupResult] \ + " ::A+->recreate ::a+::A->cleanup ::a::b+::A->destroy ::A+->instdestroy" \ + "Cleanup a/a::b Failed (n)" + a destroy; + set ::cleanupResult "" + A instproc cleanup args {append ::cleanupResult " [self]+[self class]->[self proc]"} + + A a + A a::b + errorCheck [set ::cleanupResult] "" "Cleanup Redefine Create Failed" + A a + errorCheck [a info children] ::a::b \ + "Cleanup Redefine Object Children Survive Failed" + A a::b + errorCheck [set ::cleanupResult] \ + " ::A+->recreate ::a+::A->cleanup ::A+->recreate ::a::b+::A->cleanup" \ + "Cleanup Redefine a/a::b Failed" + + a destroy + set ::cleanupResult "" + + + Class META -superclass Class + META proc instdestroy args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} + META proc recreate args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} + META instproc destroy args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} + META instproc cleanup args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} + + META X + META X::Y + errorCheck [set ::cleanupResult] "" "Class Cleanup Create Failed" + META X + errorCheck [X info classchildren] "" "Class Cleanup Class Children Destroy Failed" + META X::Y + errorCheck [set ::cleanupResult] \ + " ::META+->recreate ::X+::META->cleanup ::X::Y+::META->destroy ::META+->instdestroy" \ + "Class Cleanup X/X::Y Failed" + + X destroy + set ::cleanupResult "" + META instproc cleanup args {append ::cleanupResult " [self]+[self class]->[self proc]"} + + META X + META X::Y + errorCheck [set ::cleanupResult] "" "Class Cleanup Redefine Create Failed" + META X + errorCheck [X info classchildren] ::X::Y \ + "Class Cleanup Redefine Class Children Survive Failed" + META X::Y + errorCheck [set ::cleanupResult] \ + " ::META+->recreate ::X+::META->cleanup ::META+->recreate ::X::Y+::META->cleanup" \ + "Class Cleanup Redefine X/X::Y Failed" + + X destroy + A destroy + META destroy + unset ::cleanupResult + + Object instmixin "" +} + + +@ TestX smallScripts { + description { + Regression test object testing arbitrary features. + } +} +TestX smallScripts +proc ::up1 {} { + return [uplevel 1 self] +} +proc ::up3 {} { + return [uplevel 3 self] +} +proc ::up2 {} { + return [up3] +} +smallScripts proc run {{n 20}} { + catch {Object o; o r} errMsg + ::errorCheck $errMsg "::o: unable to dispatch method 'r'" "Unknown Test" + + # uplevel test + for {set i 0} {$i < $n} {incr i} { + Object o + o proc u2 {} {return [::up2]} + o proc u1 {} {return [::up1]} + + Class SM + SM instproc init args { + ::errorCheck [o u1] "::o" "FAILED - UpLevel Test 1" + ::errorCheck [o u2] "::s" "FAILED - UpLevel Test 2" + } + SM s + } + + for {set i 1} {$i < $n} {incr i} { + Class A + A a + set oname1 [Object autoname ooo] + set oname2 [Object autoname -instance OOO] + A autoname -reset AAA + set names [A autoname AAA] + a autoname -reset aaa + lappend names [a autoname aaa] + lappend names [a autoname aaa] + ::errorCheck $names "AAA1 aaa1 aaa2" "Autoname creation" + ::errorCheck $oname1 "ooo$i" "Autoname Object 1" + ::errorCheck $oname2 "oOO$i" "Autoname Object 2" + ::errorCheck [xotcl::Object set __autonames(ooo)] $i \ + "Autoname Object Count" + } + + Class P; P p + P instproc x {} { + my instvar "x(1) t" + return $t + } + p set x(1) rrr + ::errorCheck [p x] rrr "Array member alias, no ns" + + Object o + o proc x {} { + my instvar "x(1) t" + return $t + } + o set x(1) rrr + ::errorCheck [o x] rrr "Array member alias, with ns" + + Object o + o proc x args {puts r} + ::errorCheck [o info body x] "puts r" "Info Body" + ::errorCheck [info body o::x] "puts r" "Info Body" + + Object o + o proc a {} { + my lappend table(i) xxx + } + ::errorCheck [o a]-[o set table(i)] "xxx-xxx" "Array instvar create" + + Class A + A instproc myProc args {} + Class Mix1 + Mix1 instproc myProcMix1 args {} + Class Mix2 + Mix2 instproc myProcMix2 args {} + Class B -superclass A -instmixin Mix1 + B instproc myProc2 args {} + B b -mixin Mix2 + b proc objproc args {} + + ::errorCheck [b info procs] objproc "info procs" + ::errorCheck [B info instprocs] myProc2 "info instprocs" + + ::errorCheck [lsort [b info methods]] "__next abstract append array autoname check class cleanup configure contains copy defaultmethod destroy eval exists extractConfigureArg f filter filterguard filtersearch forward hasclass incr info infoTraceFilter init instvar invar isclass ismetaclass ismixin isobject istype lappend method mixin mixinguard move myProc myProc2 myProcMix1 myProcMix2 noinit objproc parametercmd proc procsearch requireNamespace self set setFilter signature subst trace unset uplevel upvar volatile vwait" "b info methods" + + ::errorCheck [lsort [b info methods -nocmds]] "abstract contains copy defaultmethod extractConfigureArg f hasclass infoTraceFilter init method move myProc myProc2 myProcMix1 myProcMix2 objproc self setFilter signature" "b info methods -nocmds" + + ::errorCheck [lsort [b info methods -noprocs]] "__next append array autoname check class cleanup configure destroy eval exists filter filterguard filtersearch forward incr info instvar invar isclass ismetaclass ismixin isobject istype lappend mixin mixinguard noinit parametercmd proc procsearch requireNamespace set subst trace unset uplevel upvar volatile vwait" "b info methods -noprocs" + ::errorCheck [lsort [b info methods -nocmds -nomixins]] "abstract contains copy defaultmethod extractConfigureArg f hasclass infoTraceFilter init method move myProc myProc2 objproc self setFilter signature" "b info methods -nocmds -nomixins" + + ::errorCheck [b info methods -nocmds -noprocs] "" "b info methods -nocmds -noprocs" + + ::errorCheck [lsort [B info methods -nocmds]] "abstract allinstances contains copy defaultmethod extractConfigureArg f hasclass infoTraceFilter init method move parameter self setFilter signature uses" "B info methods -nocmds" + + namespace eval a { + proc o args {return o} + } + namespace eval a::b { + proc b args {return b} + } + + Object a + a requireNamespace + + set r [a::b::b] + + Object a::b + a::b proc x args { + return x + } + set r "$r-[a::b x]-[a o]" + ::errorCheck $r b-x-o "Tcl Namespace should survive requireNamespace" + + xotcl::interp create in + set ::r [in eval { + namespace import -force xotcl::* + Object o}] + xotcl::interp delete in + ::errorCheck $::r ::o "XOTcl slave interpreter " + + Object o -requireNamespace + o set r 1 + after 100 {o set r 3} + o vwait r + ::errorCheck [o set r] 3 "Vwait test" + + Class NS + Class NS::Main + + NS::Main proc m1 {} { + my m2 + } + + NS::Main proc m2 {} { + namespace eval :: Object toplevelObj + } + + NS::Main m1 + ::errorCheck [::toplevelObj set a 1] 1 "toplevel object allocated in ns" + + + namespace eval foo { + Class Foo + Foo instproc blah {} {puts jou} + Foo proc bar {} {puts bar} + } + namespace delete foo + ::errorCheck [Object isobject ::foo::Foo] 0 "Namespace delete under object" + + # destroy test + set x [Object create x] + x destroy + ::errorCheck [catch {$x set a 1}] 1 "Reference to destroyed object still valid" + + Object create x -volatile + unset x + ::errorCheck [catch {x destroy}] 1 "Object should not exist anymore" + + Object create x -volatile + x destroy + ::errorCheck [catch {unset x}] 1 "Variable should not exist anymore" +} + + +@ TestX objectReferences { + description { + Regression test for object and class references in tcl_objs + } +} + +TestX objectReferences -proc run {{n 20}} { + my proc ok01 {} { + Class AAA + AAA destroy + Class AAA + } + my proc ok02 {} { + Class ::AAA + AAA destroy + Class AAA + } + my proc ok03 {} { + Class ::AAA + ::AAA destroy + Class AAA + } + my proc ok04 {} { + Class ::AAA + ::AAA destroy + Class ::AAA + } + my proc ok05 {} { + set c [Class AAA] + $c destroy + Class AAA + } + my proc ok06 {} { + set c [Class ::AAA] + $c destroy + Class AAA + } + my proc ok07 {} { + set c [Class ::AAA] + $c destroy + Class ::AAA + } + my proc ok08 {} { + set c [Class ::AAA] + $c destroy + Class $c + } + my proc ok09 {} { + [Class AAA] destroy + Class AAA + } + my proc ok10 {} { + [Class ::AAA] destroy + Class AAA + } + my proc ok11 {} { + [Class ::AAA] destroy + Class ::AAA + } + + + for {set i 1} {$i < 20} {incr i} { + # "reference to xotcl object in instvar" + Class LexxTreeMounter + Class LexxTree + LexxTreeMounter proc new {args} { + if {[LexxTree exists LexxTreeMounter]} { + set o [LexxTree set LexxTreeMounter] + } else { + set o [my create [my autoname [self]]] + } + $o incr C(refcnt) + return $o + } + LexxTreeMounter instproc init {args} { + my instvar C + set C(refcnt) 0 + if {[LexxTree exists LexxTreeMounter] == 0} { + LexxTree set LexxTreeMounter [self] + } + next + } + set x [LexxTreeMounter new] + set x [LexxTreeMounter new] + + ::errorCheck [llength [LexxTreeMounter info instances]] 1 singleton + + # "Global reference to xotcl object" + set ::v [Object ::a] + set ::w [Object ::b] + set ::z(1) [Object ::c] + unset ::v + + # "Class creation and Class destroys, after 2nd round procs contain xotcl-object references" + foreach m [lsort [my info procs ok*]] {my $m} + ::errorCheck [my isobject AAA] 1 classdestroys + } + + catch {UnknownClass destroy} + set ::utest "" + Class proc __unknown args { + lappend ::utest $args + set x [Class $args] + set r [$x] + #puts r=$r + return $r + } + Class O -superclass UnknownClass + ::errorCheck $::utest ::UnknownClass "__unknown 1" + + Object o + ::errorCheck [o mixin XX1] ::XX1 "__unknown XX1" + + namespace eval "" { + Object o + ::errorCheck [o mixin XX2] ::XX2 "__unknown XX2" + } + + namespace eval "::" { + Object o + ::errorCheck [o mixin XX3] ::XX3 "__unknown XX3" + } + + + # this version of unknown creates gobal objects + Class proc __unknown {name} { + #puts "unkown called with $name" + set name ::[namespace tail $name] + set x [Class $name] + set r [$x] + #puts "... created $r" + return $r + } + + Object o + ::errorCheck [o mixin XY1] ::XY1 " __unknown XY1" + + namespace eval "" { + Object o + ::errorCheck [o mixin XY2] ::XY2 " __unknown XY2" + } + + namespace eval :: { + Object o + ::errorCheck [o mixin XY3] ::XY3 " __unknown XY3" + } + + Class C + namespace eval ::tmp { + Object o -mixin C + ::errorCheck [o mixin XY4] ::XY4 " __unknown XY4" + } + + + + ::errorCheck [lsort [UnknownClass info info]] {args body children class classchildren classparent commands default filter filterguard forward heritage info instances instbody instcommands instdefault instfilter instfilterguard instforward instinvar instmixin instpost instpre instprocs invar methods mixin parameter parent post pre precedence procs subclass superclass vars} "info info" + + ::errorCheck [Class info instances *Unk*] ::UnknownClass "match in info instances" + ::errorCheck [Class info instances Unk*] "" "no match in info instances" + ::errorCheck [Class info instances Unk] "" "no match in info instances (no metachars)" + ::errorCheck [Class info class] ::xotcl::Class "info class of Class" + ::errorCheck [Class info class Object] 1 "info class of Class Object" + Class C + Class D -superclass C + Class E -superclass D -parameter {{x 1}} + E instproc t {a b {c 1}} {return ok} + E proc p {a b {c 1}} {return ok} + E instproc q {} {return [self proc]} + ::errorCheck [C info subclass E] 1 "transitive subclass 1" + ::errorCheck [Object info subclass E] 1 "transitive subclass 2" + ::errorCheck [D info subclass C] 0 "transitive subclass 3" + ::errorCheck [E info heritage] "::D ::C ::xotcl::Object" "heritage" + ::errorCheck [E info instargs t] "a b c" "instargs" + ::errorCheck [E info instdefault t c x] 1 "instdefault" + ::errorCheck [E info args p] "a b c" "args" + ::errorCheck [E info default p c x] 1 "default" + ::errorCheck [E configure [list -p -x -y]] 0 "list params 1" + ::errorCheck [E e1 [list -t -1 -e -3]] ::e1 "list params 2" + ::errorCheck [e1 x] 1 "instparameter cmd 1" + ::errorCheck [e1 x 2] 2 "instparameter cmd 2" + ::errorCheck [e1 x] 2 "instparameter cmd 3" + ::errorCheck [e1 parametercmd y] "" "parametercmd 1" + ::errorCheck [e1 y 3] 3 "parametercmd 2" + ::errorCheck [e1 y] 3 "parametercmd 3" + ::errorCheck [e1 forward regexp -objscope] "" "forward 1" + ::errorCheck [e1 regexp (y) xyz _ X] "1" "forward 2" + ::errorCheck [e1 exists X] "1" "forward 3" + ::errorCheck [e1 q] q "self proc" + + ::errorCheck [E info commands] {p slot} "class commands" + ::errorCheck [E info instcommands] "t x q" "class instcommands" + ::errorCheck [E info instbody t] "return ok" "class info instbody" + + Object o + Object o::abc + Object o::bcd + Object o::cde + namespace eval ns1 {Class C; namespace export C} + o eval {namespace import ::ns1::*} + + ::errorCheck [o info children] "::o::cde ::o::bcd ::o::abc" "info children 1" + ::errorCheck [o info children *cd*] "::o::cde ::o::bcd" "info children 2" + ::errorCheck [o info children ::o::cde] ::o::cde "info children 3" + ::errorCheck [o info children ::o::def] "" "info children 4" + Object new -childof o + ::errorCheck [llength [o info children]] 4 "info children 5" + + ::errorCheck [Object isobject o] 1 "is object 1" + ::errorCheck [Object isobject ox] 0 "is object 2" + + Class M -superclass Class + ::errorCheck [Object ismetaclass M] 1 "is metaclass 1" + ::errorCheck [Object ismetaclass C] 0 "is metaclass 0" + + Class C -parameter {number name} + C instproc test {} { + my instvar {number x} name + return [list $name $x] + } + C c -name koen -number 25 + ::errorCheck [c test] "koen 25" "instvar with alias" +} + + +@ TestX condMixins { + description { + Regression test for conditional mixins + } +} + +TestX create condMixins -proc show {c obj} { + set ::context $c + set r [list] + foreach x [list \ + [list $obj info methods salary] \ + [list $obj info methods -incontext salary] \ + [list $obj info methods driv*] \ + [list $obj info methods -incontext driv*] \ + ] { + lappend r "$::context: $x => [lsort [eval $x]]" + } + return $r +} +condMixins proc run {{n 20}} { + Object instproc signature {} {return "[self] [my info class] ([my age] years)"} + Class Person -parameter {id name age} + + Class Payroll-aspect -parameter salary + Payroll-aspect instproc print {} {puts "[my signature]: [my salary]"} + Class Driver-aspect -parameter driving-license + Payroll-aspect instproc print {} {puts "[my signature]: [my driving-license]"} + + Person instmixin {{Payroll-aspect -guard {[string equal $::context "payrollApp"]}}} + Person jim -mixin {{Driver-aspect -guard {[string equal $::context "shipmentApp"]}}} + + set ::context payrollApp + + ::errorCheck [lsort [jim info methods]] "__next abstract age append array autoname check class cleanup configure contains copy defaultmethod destroy driving-license eval exists extractConfigureArg filter filterguard filtersearch forward hasclass id incr info init instvar invar isclass ismetaclass ismixin isobject istype lappend method mixin mixinguard move name noinit parametercmd print proc procsearch requireNamespace salary self set signature subst trace unset uplevel upvar volatile vwait" "condmixin all methods" + + ::errorCheck "[lsort [jim info methods -incontext]]" "__next abstract age append array autoname check class cleanup configure contains copy defaultmethod destroy eval exists extractConfigureArg filter filterguard filtersearch forward hasclass id incr info init instvar invar isclass ismetaclass ismixin isobject istype lappend method mixin mixinguard move name noinit parametercmd print proc procsearch requireNamespace salary self set signature subst trace unset uplevel upvar volatile vwait" "all methods in context" + + ::errorCheck [my show payrollApp jim] "{payrollApp: jim info methods salary => salary} {payrollApp: jim info methods -incontext salary => salary} {payrollApp: jim info methods driv* => driving-license} {payrollApp: jim info methods -incontext driv* => }" "payrollApp jim" + ::errorCheck [my show shipmentApp jim] "{shipmentApp: jim info methods salary => salary} {shipmentApp: jim info methods -incontext salary => } {shipmentApp: jim info methods driv* => driving-license} {shipmentApp: jim info methods -incontext driv* => driving-license}" "shipmentApp jim" + +} + + +@ TestX volatileObjects { + description { + Regression test for volatile objects + } +} + +TestX create volatileObjects +volatileObjects proc inscope {} { + set r 0 + set y 0 + set z 0 + set c [C new -volatile] + catch {incr r [$c test]} + catch {set y [$c y]} + catch {set z [$c z]} + if {[catch {set u [$c u]} err]} {puts stderr $err} + return $r-[llength [C info instances]]-$y-$z-$u +} +volatileObjects proc run {{n 20}} { + Class create ::xotcl::_creator -instproc create {args} { + set result [next] + return $result + } + Class instproc f args { + #puts stderr "*****F [self calledproc]" + return [next] + } + + Class C -parameter {{x 0}} + C instproc f args { + #puts stderr "*****C [self calledproc]" + return [next] + } + C instproc test {} { my incr x } + C instproc y {} { my instvar x; incr x } + C instproc z {} { my set x 10 } + C instproc u {} { upvar [self callinglevel] z b; info exists b } + + Class create ::xotcl::I -instproc instvar args { + #puts [self proc] + next + } -instproc set args { + #puts [self proc] + next + } -instproc u args { + #puts [self proc] + next + } + + ::errorCheck [llength [C info instances]] 0 "foreign instances" + ::errorCheck [my inscope] 1-1-2-10-1 "volatile objects in scope" + ::errorCheck [llength [C info instances]] 0 "instances survived scope" + + Class instmixin ::xotcl::_creator + ::errorCheck [my inscope] 1-1-2-10-1 "volatile objects in scope through mixin" + ::errorCheck [llength [C info instances]] 0 \ + "instances survived scope through mixin" + + Class instfilter f + ::errorCheck [my inscope] 1-1-2-10-1 \ + "volatile objects in scope through mixin + filter" + ::errorCheck [llength [C info instances]] 0 \ + "instances survived scope through mixin + filter" + + Class instmixin {} + + Class instfilter f + ::errorCheck [my inscope] 1-1-2-10-1 \ + "volatile objects in scope through filter" + ::errorCheck [llength [C info instances]] 0 \ + "instances survived scope through filter" + + Class instfilter {} + C instmixin ::xotcl::I + ::errorCheck [my inscope] 1-1-2-10-1 \ + "instvar overload in scope through mixin" + + C instfilter f + ::errorCheck [my inscope] 1-1-2-10-1 \ + "instvar overload in scope through mixin and filter" + + C instfilter {} + Class instproc f {} {} +} + + + +TestX create uplevelCmds +uplevelCmds proc upproc {} { + lappend ::result [list \ + self=[self] \ + up1=[uplevel 1 self] \ + up2=[uplevel 2 self] \ + up3=[uplevel 3 self] ] +} +uplevelCmds proc run {{n 20}} { + Object o1 -proc m {} { + set ::result [list] + lappend ::result [list \ + self=[self] \ + up1=[uplevel 1 self] \ + up2=[uplevel 2 self] \ + up3=[uplevel 3 self] ] + uplevelCmds::upproc + return $::result + } + Object o2 -proc m {} { + o1 m + } + Object o3 -proc m {} { + o2 m + } + Object o4 -proc m {} { + o3 m + } + ::errorCheck [o4 m] \ + "{self=::o1 up1=::o2 up2=::o3 up3=::o4} {self=::o1 up1=::o1 up2=::o2 up3=::o3}" \ + "uplevel self" + o4 m + + proc showstack {} { + set l [info level] + for {set i $l} {$i>0} {incr i -1} { + set vars [uplevel \#$i info vars] + upvar \#$i what w + if {![info exists w]} {set w ""} + puts "$i: $w[info level $i] vars=$vars" + } + } + + Class C + C instproc u0 {} { + upvar [self callinglevel] x y; incr y + return [uplevel [self callinglevel] {incr x 1}] + } + C instproc u1 {} { + upvar [self callinglevel] x y; incr y + set r [uplevel [self callinglevel] {incr x 1}] + set z [uplevel [self activelevel] incr z] + return $z-$r + } + C instproc p0 {y} { + set x $y + set r [my u0] + return $r-$x + } + C instproc p1 {y} { + set z 0 + set x $y + set r [my u1] + return $r-$x + } + Class D -superclass C + D instproc u0 {} { + upvar [self callinglevel] x y; incr y + return [uplevel [self callinglevel] {incr x 1}] + } + D instproc u1 {} { + set z [uplevel [self activelevel] incr z] + set r [next] + return $z-$r + } + Class M + M instproc u1 {} { + set z [uplevel [self activelevel] incr z] + set r [next] + return $z-$r + } + Object instproc f args { + next + } + + D create d1 + errorCheck [d1 p0 1] 3-3 "simple uplevel" + errorCheck [d1 p1 1] 2-2-3-3 "uplevel through next in class hierarchy + activelevel" + D instmixin M + errorCheck [d1 p1 1] 1-3-3-3-3 "uplevel through mixin and class hierarchy + activelevel" + Object instfilter f + errorCheck [d1 p1 1] 1-3-3-3-3 "uplevel through filter, mixin and class hierarchy + activelevel" + Object instfilter "" + D instmixin {} + + # now again the same tests with upvar and uplevel methods + + C instproc u0 {} { + my upvar [self callinglevel] x y; incr y + return [my uplevel {incr x 1}] + } + C instproc u1 {} { + my upvar [self callinglevel] x y; incr y + set r [my uplevel {incr x 1}] + set z [my uplevel [self activelevel] incr z] + return $z-$r + } + D instproc u0 {} { + my upvar [self callinglevel] x y; incr y + return [my uplevel {incr x 1}] + } + Class M + M instproc u1 {} { + set z [my uplevel [self activelevel] incr z] + set r [next] + return $z-$r + } + errorCheck [d1 p0 1] 3-3 "upvar method: simple uplevel" + errorCheck [d1 p1 1] 2-2-3-3 \ + "upvar method: uplevel through next in class hierarchy + activelevel" + D instmixin M + errorCheck [d1 p1 1] 1-3-3-3-3 \ + "upvar method: uplevel through mixin and class hierarchy + activelevel" + Object instfilter f + errorCheck [d1 p1 1] 1-3-3-3-3 \ + "upvar method: uplevel through filter, mixin and class hierarchy + activelevel" + Object instfilter "" + D instmixin {} + + # now again the same tests with upvar and uplevel methods with default levels + + C instproc u0 {} { + my upvar x y; incr y + return [my uplevel {incr x 1}] + } + C instproc u1 {} { + my upvar x y; incr y + set r [my uplevel {incr x 1}] + set z [my uplevel [self activelevel] incr z] + return $z-$r + } + D instproc u0 {} { + my upvar x y; incr y + return [my uplevel {incr x 1}] + } + Class M + M instproc u1 {} { + set z [my uplevel [self activelevel] incr z] + set r [next] + return $z-$r + } + errorCheck [d1 p0 1] 3-3 "upvar method: simple uplevel (dl)" + errorCheck [d1 p1 1] 2-2-3-3 \ + "upvar method: uplevel through next in class hierarchy + activelevel (dl)" + D instmixin M + errorCheck [d1 p1 1] 1-3-3-3-3 \ + "upvar method: uplevel through mixin and class hierarchy + activelevel (dl)" + Object instfilter f + errorCheck [d1 p1 1] 1-3-3-3-3 \ + "upvar method: uplevel through filter, mixin and class hierarchy + activelevel (dl)" + Object instfilter "" + D instmixin {} + + C instproc selftest args { + return [self class]/[self isnextcall]-[next] + } + D instproc selftest args { + return [self class]/[self isnextcall]-[next] + } + errorCheck [d1 selftest] "::D/0-::C/1-" \ + "self isnextcall" + + Object instproc each {objName body} { + #puts " *** level = [info level] self callinglevel = [self callinglevel]" + uplevel [self callinglevel] [list foreach $objName [lsort [[self] info children]] $body] + } + + Class TestB + Class TestA + TestA instproc init {args} { + next + TestB [self]::b1 + TestB [self]::b2 + TestB [self]::b3 + } + + Class Test + Test instproc init {args} { + next + TestA [self]::a1 + TestA [self]::a2 + TestA [self]::a3 + } + Test instproc loop1 {} { + set i 0 + [self] each a { + incr i + #puts "$a" + } + #puts "Total = $i" + return $i + } + Test instproc loop2 {} { + set i 0 + [self] each a { + incr i + #puts "$a" + $a each b { + incr i + #puts " $b" + } + } + #puts "Total = $i" + return $i + } + Object instproc f args {next} + + Test t + + errorCheck [t loop1] 3 "uplevel eval loop" + errorCheck [t loop2] 12 "nested uplevel eval loop" + t filter f + errorCheck [t loop1] 3 "uplevel eval loop" + errorCheck [t loop2] 12 "nested uplevel eval loop" + t destroy + +} + + +TestX create namespaceCommands -proc run {{n 20}} { + errorCheck [catch { + namespace eval foo { + Class m + Object o -mixin m + } + }] 0 "mixin resolved from namespace" + + Class create ::xotcl::_creator -instproc create {args} { + set result [next] + return $result + } + + errorCheck [catch { + namespace eval bar { + Class A + namespace export A + } + + namespace eval foo { + Class M -superclass Class + + namespace import ::bar::* + Class B -superclass A -instmixin M + + Class instmixin ::xotcl::_creator + Class C -superclass A -instmixin B + Class instmixin "" + } + } error] 0 "mixin and Class resolve and import into namespace\n$error" + +} + +TestX create metaClassAsMixin -proc run {{n 20}} { + Class create A -instmixin Class + Class create B -superclass A + B create b1 + errorCheck [A ismetaclass]-[B ismetaclass]-[b1 ismetaclass]-[b1 isclass] \ + "1-1-0-1" "metaclass through mixin" +} + +TestX create nonposargs -proc run {{n 20}} { + Object o + o set result "" + o proc test1 {-x:switch y} { + my append result "x=$x y=$y, " + } + o test1 1 + o test1 -x 1 + + o proc test2 {{-x:switch true} y} { + my append result "x=$x y=$y, " + } + o test2 2 + o test2 -x 2 + + o proc test3 {{-x:switch false} y} { + my append result "x=$x y=$y, " + } + o test3 3 + o test3 -x 3 + errorCheck [o set result] \ + "x=0 y=1, x=1 y=1, x=true y=2, x=0 y=2, x=false y=3, x=1 y=3, " \ + "nonpos args switch" + + Object o + o proc x {a b} { + return "$a $b" + } + o proc x {} {a b} { + return "$a $b" + } + o proc y {-x {-a {1 2 3}}} {a b} { + return "$args" + } + o proc z1 {-x:required {-a {1 2 3}}} {a args} { + return "$x -- $args" + } + o proc z2 {-x:required {-a {1 }} {-b {1 2}}} {args} {return "$x -- $args -- $a -- $b"} + o proc z3 {-b:boolean} {arg} { + return "$b $arg" + } + Object colorchecker + colorchecker proc color {var value} { + lappend ::r "color <$var> <$value>" + } + colorchecker proc reddish {var value} { + lappend ::r "reddish <$var> <$value>" + } + + o proc z4 {{{-b: required, checkobj colorchecker,color, reddish, + checkobj xotcl::nonposArgs,required} red} + {{-c: required }}} {arg} { + lappend ::r "$b $arg" + return "$b $arg" + } + o proc z5 {-pos args} { + return [list $pos $args] + } + + Class P + P instproc x {a b} { + return "$a $b" + } + P instproc z2 {-x:required {-a 1} {-b {1 2}}} {args} {return "$x -- $args -- $a -- $b"} + + P instproc z3 {-x:required {-a 1} {-b {1 2}}} {a b c} { + return "$x -- $args -- $a -- $b" + } + P p + + errorCheck [o x 1 2] "1 2" "Ordinary Method" + errorCheck [p x 3 4] "3 4" "Ordinary Method (2)" + catch { + o y 4 56 5 + } m + errorCheck $m {unknown argument '5' for method 'y': valid arguments -x {-a {1 2 3}} a b} "wrong \# check 1" + catch { + o y + } m + errorCheck $m "wrong # args for method 'y': valid arguments -x {-a {1 2 3}} a b" "wrong \# check 2" + catch { + o y -x 1 + } m + errorCheck $m "wrong # args for method 'y': valid arguments -x {-a {1 2 3}} a b" "wrong \# check 3" + catch { + o z1 a 1 2 3 + } m + errorCheck $m "required arg: 'x' missing" "required missing" + errorCheck [o z1 -x 1 a 1 2 3] "1 -- 1 2 3" "invocation 1" + errorCheck [o z2 -x 2 a 1 2 3] "2 -- a 1 2 3 -- 1 -- 1 2" "invocation 2" + catch { + o y -x 1 -a 2 2 3 + } m + errorCheck $m "can't read \"args\": no such variable" "args unset?" + errorCheck [o z2 -a 2 -x 1 -b 3 a b c] \ + "1 -- a b c -- 2 -- 3" "invocation 3" + errorCheck [p z2 -x 1 -a 2 -b 3 a b c] \ + "1 -- a b c -- 2 -- 3" "invocation 4" + + errorCheck [o z3 -b true -- -b] "true -b" "dash dash" + + errorCheck [o z5 -pos 1 a b] "1 {a b}" "nonpos with given args" + errorCheck [o z5 -pos 1 a] "1 a" "nonpos with given args" + errorCheck [o z5 -pos 1] "1 {}" "nonpos without given args" + + catch { + o z3 -b abc -- -b + } m + errorCheck $m "non-positional argument: 'b' with value 'abc' is not of type boolean" "not boolean" + + set ::r "" + o z4 -c 1 1 + errorCheck $::r "{color } {reddish } {red 1}" \ + "multiple check options + checkobject" + + errorCheck [o info body z2] {return "$x -- $args -- $a -- $b"} "info body 1" + errorCheck [P info instbody z2] {return "$x -- $args -- $a -- $b"} "info instbody z2" + errorCheck [o info args z4] {arg} "info args" + errorCheck [o info nonposargs z4] "{{-b:required,checkobj colorchecker,color,reddish,checkobj xotcl::nonposArgs,required} red} -c:required" "info nonposargs 1" + errorCheck [o info nonposargs x] {} "info nonposargs 2" + errorCheck [P info instargs z3] {a b c} "info instargs" + errorCheck [P info instnonposargs z3] {-x:required {-a 1} {-b {1 2}}} "info instnonposargs 1" + errorCheck [P info instnonposargs x] {} "info instnonposargs 2" + + + Object o + o proc foo {{-a apple}} {{b banana}} { + return [list [info locals] a: $a b: $b] + } + o proc foo2 {{-a apple}} {{b banana} {c apple}} { + return [list [info locals] a: $a b: $b c: $c] + } + o proc foo3 {{-a apple}} {x y {b banana} {c apple}} { + return [list [info locals] x: $x y: $y a: $a b: $b c: $c] + } + + errorCheck [o foo] [list {a b} a: apple b: banana] \ + "non pos + default values 1" + errorCheck [o foo -a ack] [list {a b} a: ack b: banana] \ + "non pos + default values 2" + errorCheck [o foo bar] [list {a b} a: apple b: bar] \ + "non pos + default values 3" + errorCheck [o foo -a ack bar] [list {a b} a: ack b: bar] \ + "non pos + default values 4" + errorCheck [o foo2 -a ack] [list {a b c} a: ack b: banana c: apple] \ + "non pos + default values 5" + errorCheck [ o foo3 -a ack 1 2] [list {x y a b c} x: 1 y: 2 \ + a: ack b: banana c: apple] \ + "non pos + default values 6" + + Object o + o proc foo {{-foo 1}} {} { + #puts "foo: $foo" + } + o foo + o foo -foo 0 + catch {o foo -foo} msg + errorCheck $msg "Non positional arg '-foo': value missing" "Empty non-pos arg" + + Object oa + oa proc foo {{-a A}} {b} { + #puts "$a $b" + } + oa foo "B" + oa foo "-" + oa foo "---" + catch {oa foo "--"} msg + + errorCheck $msg "wrong # args for method 'foo': valid arguments {-a A} b" "Non-pos arg: double dash alone" + + Class C + C create c1 + C instproc m2 { + {-flag:boolean false} + } {x y {z 15}} { + return $flag-$z + } + c1 proc m14 { + {-flag:boolean false} + } {x y {z 15}} { + return $flag-$z + } + + errorCheck [list [c1 m14 1 2 3] [c1 info args m14] \ + [c1 info default m14 z e] [set e]] \ + "false-3 {x y z} 1 15" \ + "Defaults proc" + + + errorCheck [list [c1 m2 1 2 3] [C info instargs m2]] \ + "false-3 {x y z}" \ + "info instargs" + + errorCheck [list [C info instdefault m2 x d] [C info instdefault m2 z d] [set d]] \ + "0 1 15" \ + "Defaults for instproc" + + catch {C info instdefault m2 xxx e} msg + errorCheck $msg "method 'm2' doesn't have an argument 'xxx'" \ + "Defaults instproc error" + + C instproc m3 { + {-flag:boolean} + } {x y z} { + return hu3 + } + + errorCheck [c1 m3 1 2 3] "hu3" "Defaults instproc no flag" + + Object o + o proc f1 {{-x:boolean true} a } { + if {![info exists a]} {error "pos arg a does not exist"} + if {$x ne "true"} {error "x $x ne true"} + if {$a ne "x"} {error "a $a ne x"} + if {[info exists args]} {error "args still exists"} + } + o proc f2 {{-x:boolean true} {a x}} { + if {![info exists a]} {error "pos arg a does not exist"} + if {$x ne "false"} {error "x $x ne false"} + if {$a ne "x"} {error "a $a ne x"} + if {[info exists args]} {error "args still exists"} + } + o proc f3 {{-x:boolean true} } { + if {$x ne "true"} {error "x $x ne true"} + if {[info exists args]} {error "args still exists"} + } + o proc p0 {{-x 1} a} { + #puts "--- [self proc] x=$x [info exists a]" + if {![info exists a]} {error "pos arg a does not exist"} + if {$a != 1} {error "a $a != 1"} + if {$x != 1} {error "x $x != 1"} + if {[info exists args]} {error "args still exists"} + } + o proc p1 {{-x 1} a args} { + #puts "--- [self proc] x=$x [info exists a] args=$args" + if {![info exists a]} {error "pos arg a does not exist"} + if {$a != 1} {error "a $a != 1"} + if {$x != 1} {error "x $x != 1"} + if {$args ne ""} {error "args $args ne {}"} + } + o proc p2 {{-x 1} args} { + if {$x != 1} {error "x $x != 1"} + if {$args ne ""} {error "args $args ne {}"} + } + o proc p3 {{-x 1} args} { + if {$x != 1} {error "x $x != 1"} + if {$args ne "a b c"} {error "args $args ne {}"} + } + o proc p4 {{-x 1} args} { + if {$x != 2} {error "x $x != 2"} + if {$args ne "a b c"} {error "args $args ne {a b c}"} + } + o proc p5 {{-x 1} a args} { + #puts "--- [self proc] x=$x [info exists a] args=$args" + if {![info exists a]} {error "pos arg a does not exist"} + if {$a != 1} {error "a $a != 1"} + if {$x != 1} {error "x $x != 1"} + if {$args ne "a b c"} {error "args $args ne {a b c}"} + } + o proc p6 {{-x 1} a args} { + #puts "--- [self proc] x=$x [info exists a] args=$args" + if {![info exists a]} {error "pos arg a does not exist"} + if {$a != 1} {error "a $a != 1"} + if {$x != 2} {error "x $x != 2"} + if {$args ne "a b c"} {error "args $args ne {a b c}"} + } + o proc p7 {{-x 1} a args} { + #puts "--- [self proc] x=$x [info exists a] args=$args" + if {![info exists a]} {error "pos arg a does not exist"} + if {$a != 1} {error "a $a != 1"} + if {$x != 2} {error "x $x != 2"} + if {$args ne ""} {error "args $args ne {}"} + } + o proc p8 {{-x 1} {a 1} args} { + #puts "--- [self proc] x=$x [info exists a] args=$args" + if {![info exists a]} {error "pos arg a does not exist"} + if {$a != 1} {error "a $a != 1"} + if {$x != 2} {error "x $x != 2"} + if {$args ne ""} {error "args $args ne {}"} + } + errorCheck [catch {o f1 x}] 0 nonpos-1 + errorCheck [catch {o f1 -y 1}] 1 nonpos-2 + errorCheck [catch {o f1 -x false}] 1 nonpos-3 + errorCheck [catch {o f2 -x false}] 0 nonpos-4 + errorCheck [catch {o f3}] 0 nonpos-5 + errorCheck [catch {o f3 -x true -y 1}] 1 nonpos-6 + errorCheck [catch {o f3-y 1}] 1 nonpos-7 + errorCheck [catch {o p0 1}] 0 nonpos-8 + errorCheck [catch {o p1 1}] 0 nonpos-9 + errorCheck [catch {o p1 }] 1 nonpos-10 + errorCheck [catch {o p2 }] 0 nonpos-11 + errorCheck [catch {o p3 a b c}] 0 nonpos-12 + errorCheck [catch {o p4 -x 2 a b c}] 0 nonpos-13 + errorCheck [catch {o p5 1 a b c}] 0 nonpos-14 + errorCheck [catch {o p7 -x 2 1}] 0 nonpos-15 + errorCheck [catch {o p7 -x 2 }] 1 nonpos-16 + errorCheck [catch {o p8 -x 2 }] 0 nonpos-17 + o destroy +} + + +TestX copymove2 -proc run {{n 10}} { + # Composite + Class Composite -superclass Class + Composite instproc addop {op} { + my instvar ops + set ops($op) $op + } + Composite instproc compositeFilter args { + set m [self calledproc] + set c [lindex [self filterreg] 0] + set r [next] + + if {[$c exists ops($m)]} { + foreach child [my info children] { + eval [self]::$child $m $args + } + } + return $r + } + + Composite AbstractNode + AbstractNode abstract instproc iterate v + AbstractNode addop iterate + for {set i 0} {$i < $n} {incr i} { + # + # class copy + # + foreach filters {{} compositeFilter} { + Composite instfilter $filters + AbstractNode instfilter $filters + Object commands + Class Commands -superclass AbstractNode + Class Command -superclass Commands + Command instproc init args { + my instvar label + set label [self] + next + } + Command instproc setlabel {{arg ""}} { + my instvar label + if {$arg eq ""} { + set label + } else { + set label $arg + } + } + Command instproc setproc {value} { + my instvar src + set src $value + } + # prototypes + Command commands::cellcmd + commands::cellcmd copy toto + } + } +} + +TestX proc run {} { + foreach test [lsort [TestX info instances]] { + $test run + } +} + +puts "XOTcl - Test" + +puts "Time used: [time {TestX run} 1]" + +# toplevel tests ################################################# +Class instmixin {} +C instmixin {} +set o [C new -volatile];errorCheck [Object isobject $o] 1 "topLevel, check object 1 - $o" +Class instmixin ::xotcl::_creator +set o [C new -volatile];errorCheck [Object isobject $o] 1 "topLevel, check object 2 - $o" +C instmixin ::xotcl::I +set o [C new -volatile];errorCheck [Object isobject $o] 1 "topLevel, check object 3 - $o" +foreach i [C info instances] {$i destroy} + +proc x {} { + Class instmixin {} + C instmixin {} + set c0 [llength [C info instances]] + set o [C new -volatile]; errorCheck [Object isobject $o] 1 "x, check object" + Class instmixin ::xotcl::_creator + set o [C new -volatile]; errorCheck [Object isobject $o] 1 "x, check object" + C instmixin ::xotcl::I + set o [C new -volatile]; errorCheck [Object isobject $o] 1 "x, check object" + set c1 [llength [C info instances]] + errorCheck [expr {$c1 - $c0 != 3}] 0 "exit x, three more objects" +} + +x +errorCheck [expr {[llength [C info instances]] > 0}] 0 "top, all volatile object gone" + +proc x1 {} { + set c0 [llength [C info instances]] + set o [C new -volatile]; errorCheck [Object isobject $o] 1 "x1, check object" + x + set o [C new -volatile]; errorCheck [Object isobject $o] 1 "x1, check object" + set c1 [llength [C info instances]] + errorCheck [expr {$c1 - $c0 != 2}] 0 "exit x1, two more objects" +} + +x1 +errorCheck [expr {[llength [C info instances]] > 0}] 0 "top, volatile objects gone" + +Object o +o proc test {} { + x1; errorCheck [expr {[llength [C info instances]] > 0}] 0 "x1 from o" +} +o test + +puts "PASSED ::topLevelCommands" Index: tests/xoRDF.test =================================================================== diff -u -N --- tests/xoRDF.test (revision 0) +++ tests/xoRDF.test (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,1663 @@ +#!../../src/xotclsh +# $Id: xoRDF.test,v 1.5 2007/08/14 16:38:27 neumann Exp $ +# +package require XOTcl; namespace import -force xotcl::* + +lappend auto_path [file dir [info script]]/.. +#package require xotcl::test +#package require package;package verbose 1 +package require xotcl::rdf::parser +package require xotcl::rdf::recreatorVisitor +package require xotcl::rdf::triple + +proc errorCheck {expected result msg} { + set expected [string trim $expected \n] + set result [string trim $result \n] + foreach e [split $expected \n] r [split $result \n] { + set e [string trim $e] + set r [string trim $r] + if {$e != $r} { + puts stderr "FAILED: $msg\nGot: '$r'\nExpected: '$e'" + puts stderr "Full Result:\n$result" + puts stderr "RAW Triples:" + foreach t [lsort [tripleVisitor::db getTriples]] { + puts -nonewline stderr [$t dump] + } + exit -1 + return + } + } +} + +Class TestVisitor -superclass NodeTreeVisitor +TestVisitor instproc visit objName { + my append result [string trim [$objName print]] \n +} +TestVisitor instproc interpretNodeTree {node} { + my set result "" + $node accept [self] + return [my set result] +} + +TestVisitor testVisitor +RDFRecreatorVisitor reVisitor +TripleVisitor tripleVisitor +tripleVisitor proc interpret {parser topNode {asBag 1}} { + set result "" + my descriptionAsBag $asBag + my reset + my interpretNodeTree $topNode + return [[self]::db prettyTriples] + # foreach t [lsort [[self]::db getTriples]] { + # append result [string trim [$t dump]]\n + # } + # return $result +} + +RDFParser rp +rp proc time {cmd time} { + upvar $time ms + regexp {^(-?[0-9]+) } [::time {set r [eval $cmd]}] _ ms + return $r +} + +rp proc test {name text nodeResult tripleResult {descriptionAsBagResult ""}} { + my reset + foreach time {nodeTime recreateTime tripleTime} { + if {![my exists $time]} {my set $time 0} + } + my parse $text + set r [rp time [list testVisitor interpretNodeTree [self]::topNode1] ct] + regsub -all "[self]::topNode1" $r "" r + ::errorCheck $nodeResult $r "RDF Node Creation: $name" + + #set r [time [list reVisitor interpretNodeTree [self]::topNode1] rt] + #::errorCheck $recreateResult $r "RDF Recreation: $name" + set r [rp time [list tripleVisitor interpret rp [self]::topNode1 0] tt] + ::errorCheck $tripleResult $r "RDF Triples: $name" + if {$descriptionAsBagResult != ""} { + set r [tripleVisitor interpret rp [self]::topNode1 1] + ::errorCheck $descriptionAsBagResult $r "RDF Triples -- Description as Bag: $name" + } + + # test recreation by recreating XML text and by parsing + # and testing it again + set recreatedText [rp time [list reVisitor interpretNodeTree [self]::topNode1] rt] + [self]::topNode1 destroy + + my reset + my parse $recreatedText + + #puts "RECREATED: \n$recreatedText" + + # test recreated node tree + set r [testVisitor interpretNodeTree [self]::topNode1] + regsub -all "[self]::topNode1" $r "" r + ::errorCheck $nodeResult $r "RDF Node Recreation: $name" + set r [tripleVisitor interpret rp [self]::topNode1 0] + + ::errorCheck $tripleResult $r "RDF Triple Recreation: $name" + + my incr nodeTime $ct + my incr recreateTime $rt + my incr tripleTime $tt + puts "PASSED: $name ($ct + $rt + $tt)" +} + +############################################################################## +rp test "Namespace" { + + + + + xyz + dfg + + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- Description +ATTR: ID = nsd +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:ABC +PCDATA: +xyz +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- fromXYZ +PCDATA: +dfg +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator nsd + nsd http://description.org/schema/ABC xyz + nsd http://xyz.com/fromXYZ dfg +} + +############################################################################## +rp test descriptionNestedNS { + + + Ora Lassila + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +PCDATA: +Ora Lassila +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator Ora Lassila +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator Ora Lassila + +=================== unreferenced: + rdfdoc#id1 #type #Bag + rdfdoc#id1 #_1 rdfdoc#id2 + rdfdoc#id2 #predicate http://description.org/schema/Creator + rdfdoc#id2 #subject http://www.w3.org/Home/Lassila + rdfdoc#id2 #object Ora Lassila + rdfdoc#id2 #type #Statement +} + +############################################################################## +rp test NSDescription { + + + Ora Lassila + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +PCDATA: +Ora Lassila +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator Ora Lassila +} + +############################################################################## +rp test PropertyAttr { + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +PCDATA: +Ora Lassila +} { + http://www.w3.org/Home/Lassila s:Creator Ora Lassila +} + +############################################################################## +rp test properties { + + + World Wide Web Consortium + W3C Home Page + 1998-10-03T02:27 + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Publisher +PCDATA: +World Wide Web Consortium +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- s:Title +PCDATA: +W3C Home Page +::xotcl::rdf::parser::RDFProperty-::res1::prop3 --- s:Date +PCDATA: +1998-10-03T02:27 +} { + http://www.w3.org s:Publisher World Wide Web Consortium + http://www.w3.org s:Title W3C Home Page + http://www.w3.org s:Date 1998-10-03T02:27 +} + +############################################################################## +rp test propertyAttr2 { + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Publisher +PCDATA: +World Wide Web Consortium +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- s:Title +PCDATA: +W3C Home Page +::xotcl::rdf::parser::RDFProperty-::res1::prop3 --- s:Date +PCDATA: +1998-10-03T02:27 +} { + http://www.w3.org s:Publisher World Wide Web Consortium + http://www.w3.org s:Title W3C Home Page + http://www.w3.org s:Date 1998-10-03T02:27 +} + +############################################################################## +rp test bag1 { + + + + + + + + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://mycollege.edu/courses/6.001 +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students +::xotcl::rdf::parser::RDFBag-::res1::prop1::res1 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Amy +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Tim +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li +ATTR: resource = http://mycollege.edu/students/John +MEMBER-INDEX: rdf:_3 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop4 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Mary +MEMBER-INDEX: rdf:_4 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop5 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Sue +MEMBER-INDEX: rdf:_5 +} { + http://mycollege.edu/courses/6.001 s:students rdfdoc#id2 + rdfdoc#id2 #type #Bag + rdfdoc#id2 #_1 http://mycollege.edu/students/Amy + rdfdoc#id2 #_2 http://mycollege.edu/students/Tim + rdfdoc#id2 #_3 http://mycollege.edu/students/John + rdfdoc#id2 #_4 http://mycollege.edu/students/Mary + rdfdoc#id2 #_5 http://mycollege.edu/students/Sue +} + + +############################################################################## +rp test bagGivenAsType1 { + + + + + + + + + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://mycollege.edu/courses/6.001 +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students +::xotcl::rdf::parser::RDFBag-::res1::prop1::res1 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Amy +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Tim +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li +ATTR: resource = http://mycollege.edu/students/John +MEMBER-INDEX: rdf:_3 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop4 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Mary +MEMBER-INDEX: rdf:_4 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop5 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Sue +MEMBER-INDEX: rdf:_5 +} { + http://mycollege.edu/courses/6.001 s:students rdfdoc#id2 + rdfdoc#id2 #type #Bag + rdfdoc#id2 #_1 http://mycollege.edu/students/Amy + rdfdoc#id2 #_2 http://mycollege.edu/students/Tim + rdfdoc#id2 #_3 http://mycollege.edu/students/John + rdfdoc#id2 #_4 http://mycollege.edu/students/Mary + rdfdoc#id2 #_5 http://mycollege.edu/students/Sue +} + +############################################################################## +rp test bagGivenAsType2 { + + + + + + + + + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://mycollege.edu/courses/6.001 +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students +::xotcl::rdf::parser::RDFBag-::res1::prop1::res1 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Amy +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Tim +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li +ATTR: resource = http://mycollege.edu/students/John +MEMBER-INDEX: rdf:_3 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop4 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Mary +MEMBER-INDEX: rdf:_4 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop5 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Sue +MEMBER-INDEX: rdf:_5 +} { + http://mycollege.edu/courses/6.001 s:students rdfdoc#id2 + rdfdoc#id2 #type #Bag + rdfdoc#id2 #_1 http://mycollege.edu/students/Amy + rdfdoc#id2 #_2 http://mycollege.edu/students/Tim + rdfdoc#id2 #_3 http://mycollege.edu/students/John + rdfdoc#id2 #_4 http://mycollege.edu/students/Mary + rdfdoc#id2 #_5 http://mycollege.edu/students/Sue +} + + +############################################################################## +rp test bagAndAltGivenAsType { + + + + + + + + + + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://mycollege.edu/courses/6.001 +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students +::xotcl::rdf::parser::RDFAlt-::res1::prop1::res1 --- rdf:Alt +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Amy +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Tim +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li +ATTR: resource = http://mycollege.edu/students/John +MEMBER-INDEX: rdf:_3 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop4 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Mary +MEMBER-INDEX: rdf:_4 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop5 --- rdf:li +ATTR: resource = http://mycollege.edu/students/Sue +MEMBER-INDEX: rdf:_5 +} { + http://mycollege.edu/courses/6.001 s:students rdfdoc#id2 + rdfdoc#id2 #type #Alt + rdfdoc#id2 #type #Bag + rdfdoc#id2 #_1 http://mycollege.edu/students/Amy + rdfdoc#id2 #_2 http://mycollege.edu/students/Tim + rdfdoc#id2 #_3 http://mycollege.edu/students/John + rdfdoc#id2 #_4 http://mycollege.edu/students/Mary + rdfdoc#id2 #_5 http://mycollege.edu/students/Sue +} + +############################################################################## +rp test alt1 { + + + + + + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://x.org/packages/X11 +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:DistributionSite +::xotcl::rdf::parser::RDFAlt-::res1::prop1::res1 --- rdf:Alt +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +ATTR: resource = ftp://ftp.x.org +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +ATTR: resource = ftp://ftp.cs.purdue.edu +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li +ATTR: resource = ftp://ftp.eu.net +MEMBER-INDEX: rdf:_3 +} { + http://x.org/packages/X11 s:DistributionSite rdfdoc#id2 + rdfdoc#id2 #type #Alt + rdfdoc#id2 #_1 ftp://ftp.x.org + rdfdoc#id2 #_2 ftp://ftp.cs.purdue.edu + rdfdoc#id2 #_3 ftp://ftp.eu.net +} + +############################################################################## +rp test bag2 { + + + + + + + + Ora Lassila + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFBag-::res1 --- rdf:Bag +ATTR: ID = pages +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1 --- rdf:li +ATTR: resource = http://foo.org/foo.html +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop2 --- rdf:li +ATTR: resource = http://bar.org/bar.html +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFDescription-::res2 --- rdf:Description +ATTR: about = #pages +::xotcl::rdf::parser::RDFProperty-::res2::prop1 --- s:Creator +PCDATA: +Ora Lassila +} { +=================== unreferenced: + rdfdoc#pages #type #Bag + rdfdoc#pages #_1 http://foo.org/foo.html + rdfdoc#pages #_2 http://bar.org/bar.html + rdfdoc#pages s:Creator Ora Lassila +} + +############################################################################## +rp test aboutEach { + + + (c) 1998, The Foo Organization + + + (c) 1998, The Foo Organization + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: aboutEachPrefix = http://foo.org/doc +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Copyright +PCDATA: +(c) 1998, The Foo Organization +::xotcl::rdf::parser::RDFDescription-::res2 --- rdf:Description +ATTR: aboutEach = #docpages +::xotcl::rdf::parser::RDFProperty-::res2::prop1 --- s:Copyright +PCDATA: +(c) 1998, The Foo Organization +::xotcl::rdf::parser::RDFBag-::res3 --- rdf:Bag +ATTR: ID = docpages +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res3::prop1 --- rdf:li +ATTR: resource = http://foo.org/doc/page1 +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res3::prop2 --- rdf:li +ATTR: resource = http://foo.org/doc/page2 +MEMBER-INDEX: rdf:_2 +} { + http://foo.org/doc/page1 http://description.org/schema/Copyright (c) 1998, The Foo Organization + http://foo.org/doc/page2 http://description.org/schema/Copyright (c) 1998, The Foo Organization + +=================== unreferenced: + rdfdoc#docpages #type #Bag + rdfdoc#docpages #_1 http://foo.org/doc/page1 + rdfdoc#docpages #_2 http://foo.org/doc/page2 +} + +############################################################################## +rp test "BagID on List" { + + + + + + + + + Me + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: aboutEach = #docpages +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:somebag +::xotcl::rdf::parser::RDFBag-::res1::prop1::res1 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +ATTR: resource = http://foo.org/foo.html +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +ATTR: resource = http://bar.org/bar.html +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- s:Creator +PCDATA: +Me +::xotcl::rdf::parser::RDFBag-::res2 --- rdf:Bag +ATTR: ID = docpages +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res2::prop1 --- rdf:li +ATTR: resource = http://foo.org/doc/page1 +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res2::prop2 --- rdf:li +ATTR: resource = http://foo.org/doc/page2 +MEMBER-INDEX: rdf:_2 +} { + http://foo.org/doc/page1 http://description.org/schema/somebag rdfdoc#id2 + rdfdoc#id2 #type #Bag + rdfdoc#id2 #_1 http://foo.org/foo.html + rdfdoc#id2 #_2 http://bar.org/bar.html + http://foo.org/doc/page1 http://description.org/schema/Creator Me + http://foo.org/doc/page2 http://description.org/schema/somebag rdfdoc#id2 + http://foo.org/doc/page2 http://description.org/schema/Creator Me + +=================== unreferenced: + rdfdoc#docpages #type #Bag + rdfdoc#docpages #_1 http://foo.org/doc/page1 + rdfdoc#docpages #_2 http://foo.org/doc/page2 +} + +############################################################################## +rp test "Sharing Values" { + + + + + + + + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFSeq-::res1 --- rdf:Seq +ATTR: ID = JSPapersByDate +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq +::xotcl::rdf::parser::RDFMember-::res1::prop1 --- rdf:li +ATTR: resource = http://www.dogworld.com/Aug96.doc +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop2 --- rdf:li +ATTR: resource = http://www.webnuts.net/Jan97.html +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res1::prop3 --- rdf:li +ATTR: resource = http://www.carchat.com/Sept97.html +MEMBER-INDEX: rdf:_3 +::xotcl::rdf::parser::RDFSeq-::res2 --- rdf:Seq +ATTR: ID = JSPapersBySubj +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq +::xotcl::rdf::parser::RDFMember-::res2::prop1 --- rdf:li +ATTR: resource = http://www.carchat.com/Sept97.html +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res2::prop2 --- rdf:li +ATTR: resource = http://www.dogworld.com/Aug96.doc +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res2::prop3 --- rdf:li +ATTR: resource = http://www.webnuts.net/Jan97.html +MEMBER-INDEX: rdf:_3 +} { +=================== unreferenced: + rdfdoc#JSPapersByDate #type #Seq + rdfdoc#JSPapersByDate #_1 http://www.dogworld.com/Aug96.doc + rdfdoc#JSPapersByDate #_2 http://www.webnuts.net/Jan97.html + rdfdoc#JSPapersByDate #_3 http://www.carchat.com/Sept97.html + rdfdoc#JSPapersBySubj #type #Seq + rdfdoc#JSPapersBySubj #_1 http://www.carchat.com/Sept97.html + rdfdoc#JSPapersBySubj #_2 http://www.dogworld.com/Aug96.doc + rdfdoc#JSPapersBySubj #_3 http://www.webnuts.net/Jan97.html +} + +############################################################################## + +rp test "aggregates" { + + + + + Mary Andrew + Jacky Crystal + + + + + + + + + + + + + The Coolest Web Page + Il Pagio di Web Fuba + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.foo.com/cool.html +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Creator +::xotcl::rdf::parser::RDFSeq-::res1::prop1::res1 --- rdf:Seq +ATTR: ID = CreatorsAlphabeticalBySurname +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li +PCDATA: +Mary Andrew +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li +PCDATA: +Jacky Crystal +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- dc:Identifier +::xotcl::rdf::parser::RDFBag-::res1::prop2::res1 --- rdf:Bag +ATTR: ID = MirroredSites +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop1 --- rdf:li +ATTR: rdf:resource = http://www.foo.com.au/cool.html +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop2 --- rdf:li +ATTR: rdf:resource = http://www.foo.com.it/cool.html +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFProperty-::res1::prop3 --- dc:Title +::xotcl::rdf::parser::RDFAlt-::res1::prop3::res1 --- rdf:Alt +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt +::xotcl::rdf::parser::RDFMember-::res1::prop3::res1::prop1 --- rdf:li +ATTR: xml:lang = en +PCDATA: +The Coolest Web Page +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop3::res1::prop2 --- rdf:li +ATTR: xml:lang = it +PCDATA: +Il Pagio di Web Fuba +MEMBER-INDEX: rdf:_2 +} { + http://www.foo.com/cool.html http://purl.org/metadata/dublin_core#Creator rdfdoc#CreatorsAlphabeticalBySurname + rdfdoc#CreatorsAlphabeticalBySurname #type #Seq + rdfdoc#CreatorsAlphabeticalBySurname #_1 Mary Andrew + rdfdoc#CreatorsAlphabeticalBySurname #_2 Jacky Crystal + http://www.foo.com/cool.html http://purl.org/metadata/dublin_core#Identifier rdfdoc#MirroredSites + rdfdoc#MirroredSites #type #Bag + rdfdoc#MirroredSites #_1 http://www.foo.com.au/cool.html + rdfdoc#MirroredSites #_2 http://www.foo.com.it/cool.html + http://www.foo.com/cool.html http://purl.org/metadata/dublin_core#Title rdfdoc#id4 + rdfdoc#id4 #type #Alt + rdfdoc#id4 #_1 The Coolest Web Page + rdfdoc#id4 #_2 Il Pagio di Web Fuba +} + +############################################################################## +rp test "bagReification" { + + + + literal, well-formed tag + + + xyz + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFBag-::res1 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop1 --- rdf:li +ATTR: parseType = Literal +PCDATA: + + literal, well-formed tag + +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res1::prop2 --- rdf:li +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1 --- s:x +PCDATA: +xyz +} { +=================== unreferenced: + rdfdoc#id1 #type #Bag + rdfdoc#id1 #_1 + literal, well-formed tag + + rdfdoc#id1 #_2 rdfdoc#id2 + rdfdoc#id2 http://description.org/schema/x xyz +} + +# the following reification is done by SirPac, but it does not seem necessary +# (uncomment reify property in RDFTriple, if needed +#{ +#=================== unreferenced: +# rdfdoc#id1 #type #Bag +# rdfdoc#id1 #_1 +# literal, well-formed tag +# +# rdfdoc#id1 #_2 rdfdoc#id2 +# rdfdoc#id2 http://description.org/schema/x xyz +# rdfdoc#id3 #predicate http://description.org/schema/x +# rdfdoc#id3 #subject rdfdoc#id2 +# rdfdoc#id3 #object xyz +# rdfdoc#id3 #type #Statement +#} + +############################################################################## +rp test "parseLiteral" { + + + + xyz + + + + + + + xyz + + + + + + + + + + + + + + literal, well-formed tag + + + literal, well-formed tag + + + xyz + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://mycollege.edu/ +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students +ATTR: parseType = Literal +PCDATA: + + xyz +::xotcl::rdf::parser::RDFDescription-::res2 --- rdf:Description +ATTR: about = http://mycollege.edu/ +::xotcl::rdf::parser::RDFProperty-::res2::prop1 --- s:students +ATTR: parseType = Literal +PCDATA: + + + xyz + + + + + + + + +::xotcl::rdf::parser::RDFBag-::res3 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res3::prop1 --- rdf:li +ATTR: parseType = Literal +PCDATA: + + literal, well-formed tag + +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFMember-::res3::prop2 --- rdf:li +ATTR: parseType = AllOtherMustbeLiteral +PCDATA: + + literal, well-formed tag + +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFMember-::res3::prop3 --- rdf:li +MEMBER-INDEX: rdf:_3 +::xotcl::rdf::parser::RDFDescription-::res3::prop3::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res3::prop3::res1::prop1 --- s:x +PCDATA: +xyz +} { + http://mycollege.edu/ http://description.org/schema/students + xyz + + http://mycollege.edu/ http://description.org/schema/students + + xyz + + + + + + + + + + +=================== unreferenced: + rdfdoc#id3 #type #Bag + rdfdoc#id3 #_1 + literal, well-formed tag + + rdfdoc#id3 #_2 + literal, well-formed tag + + rdfdoc#id3 #_3 rdfdoc#id4 + rdfdoc#id4 http://description.org/schema/x xyz +} + +############################################################################## +rp test typedNode1 { + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.xyz.com +TYPES: http://purl.org/dc/elements/1.0/typed +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- DC:Creator +ATTR: rdf:resource = http://www.xyz.com/homepage/ +} { + http://www.xyz.com http://purl.org/dc/elements/1.0/Creator http://www.xyz.com/homepage/ + http://www.xyz.com #type http://purl.org/dc/elements/1.0/typed +} + +################################################################### +## UWE: im wiedererzeugten XML/RDF fehlt m.M. das parseType="Resosurce" + +rp test nestedProperty { + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- Description +ATTR: about = http://www.webnuts.net/Jan97.html +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Subject +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- value +PCDATA: +020 - Library Science +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- l:Classification +PCDATA: +Dewey Decimal Code +} { + http://www.webnuts.net/Jan97.html http://purl.org/metadata/dublin_core#Subject rdfdoc#id2 + rdfdoc#id2 #value 020 - Library Science + rdfdoc#id2 http://mycorp.com/schemas/my-schema#Classification Dewey Decimal Code +} + + +rp test nestedProperty2 { + + + + 020 - Library Science + Dewey Decimal Code + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- Description +ATTR: about = http://www.webnuts.net/Jan97.html +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Subject +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- value +PCDATA: +020 - Library Science +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- l:Classification +PCDATA: +Dewey Decimal Code +} { + http://www.webnuts.net/Jan97.html http://purl.org/metadata/dublin_core#Subject rdfdoc#id2 + rdfdoc#id2 #value 020 - Library Science + rdfdoc#id2 http://mycorp.com/schemas/my-schema#Classification Dewey Decimal Code + +} + +rp test nestedProperty3 { + + + + + 020 - Library Science + Dewey Decimal Code + + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- Description +ATTR: about = http://www.webnuts.net/Jan97.html +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Subject +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- value +PCDATA: +020 - Library Science +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- l:Classification +PCDATA: +Dewey Decimal Code +} { + http://www.webnuts.net/Jan97.html http://purl.org/metadata/dublin_core#Subject rdfdoc#id2 + rdfdoc#id2 #value 020 - Library Science + rdfdoc#id2 http://mycorp.com/schemas/my-schema#Classification Dewey Decimal Code + +} + +rp test nestedProperty4 { + + + + 020 - Library Science + + en + Dewey Decimal Code + + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- Description +ATTR: about = http://www.webnuts.net/Jan97.html +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Subject +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- value +PCDATA: +020 - Library Science +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- l:Classification +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1::prop2::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2::res1::prop1 --- l:lang +PCDATA: +en +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2::res1::prop2 --- l:string +PCDATA: +Dewey Decimal Code +} { + http://www.webnuts.net/Jan97.html http://purl.org/metadata/dublin_core#Subject rdfdoc#id2 + rdfdoc#id2 #value 020 - Library Science + rdfdoc#id2 http://mycorp.com/schemas/my-schema#Classification rdfdoc#id3 + rdfdoc#id3 http://mycorp.com/schemas/my-schema#lang en + rdfdoc#id3 http://mycorp.com/schemas/my-schema#string Dewey Decimal Code +} + +rp test thirdAbbrev1 { + + + + + + Ora Lassila + lassila@w3.org + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +ATTR: about = http://www.w3.org/staffId/85740 +TYPES: http://description.org/schema/Person +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator http://www.w3.org/staffId/85740 + http://www.w3.org/staffId/85740 http://description.org/schema/Name Ora Lassila + http://www.w3.org/staffId/85740 http://description.org/schema/Email lassila@w3.org + http://www.w3.org/staffId/85740 #type http://description.org/schema/Person +} + +rp test thirdAbbrev2 { + + + + + + Ora Lassila + lassila@w3.org + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +TYPES: http://description.org/schema/Person +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator rdfdoc#id2 + rdfdoc#id2 http://description.org/schema/Name Ora Lassila + rdfdoc#id2 http://description.org/schema/Email lassila@w3.org + rdfdoc#id2 #type http://description.org/schema/Person +} + +rp test thirdAbbrev3 { + + + + + Ora Lassila + lassila@w3.org + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +ATTR: about = http://www.w3.org/staffId/85740 +TYPES: http://description.org/schema/Person +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator http://www.w3.org/staffId/85740 + http://www.w3.org/staffId/85740 http://description.org/schema/Name Ora Lassila + http://www.w3.org/staffId/85740 http://description.org/schema/Email lassila@w3.org + http://www.w3.org/staffId/85740 #type http://description.org/schema/Person +} + +rp test thirdAbbrev4 { + + + + + Ora Lassila + lassila@w3.org + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +TYPES: http://description.org/schema/Person +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator rdfdoc#id2 + rdfdoc#id2 http://description.org/schema/Name Ora Lassila + rdfdoc#id2 http://description.org/schema/Email lassila@w3.org + rdfdoc#id2 #type http://description.org/schema/Person +} + + +rp test secondAbbrev1 { + + + + + Ora Lassila + lassila@w3.org + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +ATTR: about = http://www.w3.org/staffId/85740 +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator http://www.w3.org/staffId/85740 + http://www.w3.org/staffId/85740 http://description.org/schema/Name Ora Lassila + http://www.w3.org/staffId/85740 http://description.org/schema/Email lassila@w3.org +} + +rp test secondAbbrev2 { + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +ATTR: about = http://www.w3.org/staffId/85740 +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator http://www.w3.org/staffId/85740 + http://www.w3.org/staffId/85740 http://description.org/schema/Name Ora Lassila + http://www.w3.org/staffId/85740 http://description.org/schema/Email lassila@w3.org +} + +rp test secondAbbrev3 { + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://description.org/schema/Creator rdfdoc#id2 + rdfdoc#id2 http://description.org/schema/Name Ora Lassila + rdfdoc#id2 http://description.org/schema/Email lassila@w3.org +} + + +################################################################### +rp test resource1 { + + + + + + + Ora Lassila + lassila@w3.org + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +ATTR: rdf:resource = http://www.w3.org/staffId/85740 +::xotcl::rdf::parser::RDFDescription-::res2 --- rdf:Description +ATTR: about = http://www.w3.org/staffId/85740 +::xotcl::rdf::parser::RDFProperty-::res2::prop1 --- v:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res2::prop2 --- v:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://schema.org/Creator http://www.w3.org/staffId/85740 + http://www.w3.org/staffId/85740 v:Name Ora Lassila + http://www.w3.org/staffId/85740 v:Email lassila@w3.org +} + +################################################################### +rp test resource2 { + + + + + Ora Lassila + lassila@w3.org + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.w3.org/Home/Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +ATTR: about = http://www.w3.org/staffId/85740 +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- v:Name +PCDATA: +Ora Lassila +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- v:Email +PCDATA: +lassila@w3.org +} { + http://www.w3.org/Home/Lassila http://schema.org/Creator http://www.w3.org/staffId/85740 + http://www.w3.org/staffId/85740 v:Name Ora Lassila + http://www.w3.org/staffId/85740 v:Email lassila@w3.org +} + + + +################################################################### +rp test typedNode1 { + + + Uwe Zdun + uwe@xotcl.org + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://www.xotcl.org/uwe +TYPES: http://description.org/schema/Person +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Name +PCDATA: +Uwe Zdun +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- s:Email +PCDATA: +uwe@xotcl.org +} { + http://www.xotcl.org/uwe http://description.org/schema/Name Uwe Zdun + http://www.xotcl.org/uwe http://description.org/schema/Email uwe@xotcl.org + http://www.xotcl.org/uwe #type http://description.org/schema/Person +} + +rp test typedNode2 { + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: rdf:about = http://www.xotcl.org/uwe +TYPES: http://description.org/schema/Person +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- Name +PCDATA: +Uwe Zdun +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- Email +PCDATA: +uwe@xotcl.org +} { + http://www.xotcl.org/uwe http://description.org/schema/Name Uwe Zdun + http://www.xotcl.org/uwe http://description.org/schema/Email uwe@xotcl.org + http://www.xotcl.org/uwe #type http://description.org/schema/Person +} + +################################################################### +rp test complexListItems { + + + + + en + Object Oriented Design and System Development + + + + + en + Introduction to the concepts of object-oriented programing + + + de + Einf�hrung in die Konzepte objekt-orientierter Programmierung + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://nm.wu-wien.ac.at/Lehre/oo1/ +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- gen:Title +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- xml:lang +PCDATA: +en +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- gen:String +PCDATA: +Object Oriented Design and System Development +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- gen:Description +::xotcl::rdf::parser::RDFBag-::res1::prop2::res1 --- rdf:Bag +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag +::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop1 --- rdf:li +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop1 --- xml:lang +PCDATA: +en +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop2 --- gen:String +PCDATA: +Introduction to the concepts of object-oriented programing +::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop2 --- rdf:li +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop2::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop2::res1::prop1 --- xml:lang +PCDATA: +de +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop2::res1::prop2 --- gen:String +PCDATA: +Einf�hrung in die Konzepte objekt-orientierter Programmierung +} { + http://nm.wu-wien.ac.at/Lehre/oo1/ http://universal.org/metadata/ims#Title rdfdoc#id2 + rdfdoc#id2 xml:lang en + rdfdoc#id2 http://universal.org/metadata/ims#String Object Oriented Design and System Development + http://nm.wu-wien.ac.at/Lehre/oo1/ http://universal.org/metadata/ims#Description rdfdoc#id3 + rdfdoc#id3 #type #Bag + rdfdoc#id3 #_1 rdfdoc#id4 + rdfdoc#id4 xml:lang en + rdfdoc#id4 http://universal.org/metadata/ims#String Introduction to the concepts of object-oriented programing + rdfdoc#id3 #_2 rdfdoc#id5 + rdfdoc#id5 xml:lang de + rdfdoc#id5 http://universal.org/metadata/ims#String Einf�hrung in die Konzepte objekt-orientierter Programmierung +} + +################################################################### +rp test complexListItems2 { + + + + + en + Object Oriented Design and System Development + + + + + + en + Introduction to the concepts of object-oriented programing + + + + de + Einf�hrung in die Konzepte objekt-orientierter Programmierung + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = http://nm.wu-wien.ac.at/Lehre/oo1/ +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- gen:Title +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- xml:lang +PCDATA: +en +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- gen:String +PCDATA: +Object Oriented Design and System Development +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- gen:Description +::xotcl::rdf::parser::RDFSeq-::res1::prop2::res1 --- rdf:Seq +TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq +::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop1 --- rdf:li +MEMBER-INDEX: rdf:_1 +::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop1 --- cls:entry +::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop1::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop1::res1::prop1 --- gen:language +PCDATA: +en +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop1::res1::prop2 --- gen:String +PCDATA: +Introduction to the concepts of object-oriented programing +::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop2 --- rdf:li +MEMBER-INDEX: rdf:_2 +::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop2::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop2::res1::prop1 --- xml:lang +PCDATA: +de +::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop2::res1::prop2 --- gen:String +PCDATA: +Einf�hrung in die Konzepte objekt-orientierter Programmierung +} { + http://nm.wu-wien.ac.at/Lehre/oo1/ http://universal.org/metadata/ims#Title rdfdoc#id2 + rdfdoc#id2 xml:lang en + rdfdoc#id2 http://universal.org/metadata/ims#String Object Oriented Design and System Development + http://nm.wu-wien.ac.at/Lehre/oo1/ http://universal.org/metadata/ims#Description rdfdoc#id3 + rdfdoc#id3 #type #Seq + rdfdoc#id3 #_1 rdfdoc#id4 + rdfdoc#id4 cls:entry rdfdoc#id5 + rdfdoc#id5 http://universal.org/metadata/ims#language en + rdfdoc#id5 http://universal.org/metadata/ims#String Introduction to the concepts of object-oriented programing + rdfdoc#id3 #_2 rdfdoc#id6 + rdfdoc#id6 xml:lang de + rdfdoc#id6 http://universal.org/metadata/ims#String Einf�hrung in die Konzepte objekt-orientierter Programmierung +} + +################################################################### +rp test dmoz { + + + + Computers + + + + +} { +::xotcl::rdf::parser::RDFTag- --- r:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- r:Description +ATTR: r:ID = Top/Computers +TYPES: http://dmoz.org/rdf/Topic +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- tag +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- r:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- catid +PCDATA: +4 +::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- d:Title +PCDATA: +Computers +::xotcl::rdf::parser::RDFProperty-::res1::prop3 --- link +ATTR: r:resource = http://www.cs.tcd.ie/FME/ +::xotcl::rdf::parser::RDFProperty-::res1::prop4 --- link +ATTR: r:resource = http://pages.whowhere.com/computers/pnyhlen/Timeline.html +} { + Top/Computers http://dmoz.org/rdf/tag rdfdoc#id2 + rdfdoc#id2 http://dmoz.org/rdf/catid 4 + Top/Computers http://purl.org/dc/elements/1.0/Title Computers + Top/Computers http://dmoz.org/rdf/link http://www.cs.tcd.ie/FME/ + Top/Computers http://dmoz.org/rdf/link http://pages.whowhere.com/computers/pnyhlen/Timeline.html + Top/Computers #type http://dmoz.org/rdf/Topic +} + +############################################################################## +rp test "IDforNestedDescription" { + + + + + +} { +::xotcl::rdf::parser::RDFTag- --- rdf:RDF +::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description +ATTR: about = page +::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- g2k:area +ATTR: rdf:ID = b14711 +::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- g2k:term +PCDATA: +Hessen +::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- g2k:type +PCDATA: +Land +} { + b14711 http://g2k-schema#term Hessen + b14711 http://g2k-schema#type Land + page http://g2k-schema#area b14711 +} + +puts "FINISHED TEST! ([rp set nodeTime] + [rp set recreateTime] + [rp set tripleTime] = [expr {[rp set nodeTime] + [rp set recreateTime] + [rp set tripleTime]}])" + Index: tests/xocomm.test =================================================================== diff -u -N --- tests/xocomm.test (revision 0) +++ tests/xocomm.test (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,108 @@ +#!../../xotcl-0.9.4/xotclsh +# $Id: xocomm.test,v 1.4 2005/09/09 21:09:01 neumann Exp $ +package require XOTcl; namespace import -force xotcl::* +lappend auto_path [file dirname [info script]]/.. +package require xotcl::test + +@ @File { + description { + This is a webclient used as a regression test. + When it is started it launches an xotcl-Web server as partner process. + It tests currently the basic functionality of: +

      +
    • GET and PUT requests +
    • Basic Access Control +
    + } +} +array set opt {-startServer 1} +array set opt $argv + +set xotclsh [info nameofexecutable] +set dir [file dir [info script]] +set serverScript $dir/../apps/comm/webserver.xotcl +set startCmd "$xotclsh $serverScript -root $dir/../doc -pkgdir $dir/.." +puts $startCmd +if {$opt(-startServer)} { + set PIPE [open "| $startCmd"] +} else { + puts $startCmd +} + +package require xotcl::comm::httpAccess +package require xotcl::comm::ftp +package require xotcl::trace + +#::xotcl::package verbose 1 +#::xotcl::package require xotcl::comm::httpAccess +#::xotcl::package require xotcl::comm::ftp +#::xotcl::package require xotcl::trace + +set hostport localhost:8086 +set protectedhostport localhost:9096 + +set slowURL "http://quote.yahoo.com/q?s=^DJI&d=1d" +set ftpURL "ftp://mohegan.wi-inf.uni-essen.de/welcome.msg" + + +proc printError msg {puts stderr !!!$msg!!!} + +Object userPwd +userPwd proc user {u} { + my set user $u + if {[set ::tcl_platform(platform)] == "windows"} { + my set user unknown + } +} +userPwd proc show {realm userVar pwVar} { + upvar $userVar u $pwVar pw + set u [my set user] + set pw test + return 1 +} + +Test parameter {{errorReport { + puts "\tcontent-length: \[r0::sink set contentLength\]\n\ + \tstatus-code: \[\[r0 set token\] set responseCode\]" +}}} + +Test new -msg "Trying to load image logo-100.jpg ... " -count 1 \ + -verbose 1 \ + -pre "puts starting..." \ + -setResult {expr {[r0::sink set contentLength] == 1706}} \ + -cmd [list SimpleRequest r0 -url http://$hostport/logo-100.jpg] \ + +Test new -msg "Trying to PUT a file on web-server ... " -count 1 \ + -setResult {expr [[r0 set token] set responseCode] == 201} \ + -pre [list file delete -force $dir/../doc/junk.junk] \ + -cmd [list SimpleRequest r0 \ + -url http://$hostport/junk.junk \ + -method PUT \ + -data "this is a test\n" \ + -contentType plain/text] + +Test new -msg "And download it again ... " -count 1 \ + -setResult {expr [r0 getContentLength] == 15} \ + -post {file delete -force ../doc/junk.junk} \ + -cmd [list SimpleRequest r0 -url http://$hostport/junk.junk] + +Test new -msg "Get protected resource ... " -count 1 \ + -setResult {expr [r0 getContentLength] > 500} \ + -cmd [list SimpleRequest r0 -url http://$protectedhostport/ ] + +#Test new -msg "Try an FTP request $ftpURL ... " -count 1 \ + -setResult {expr [r0 getContentLength] > 100} \ + -cmd [list SimpleRequest r0 -url $ftpURL] + +#Test new -msg "Try timeout with slow URL $slowURL ... " -count 1 \ + -setResult {expr {[[r0 set token] set errormsg] == {timeout exceeded}}} \ + -cmd [list SimpleRequest r0 -url $slowURL -timeout 100] + +Test new -msg terminate -count 1 \ + -setResult {set x 1} \ + -cmd [list SimpleRequest r0 -url http://$protectedhostport/exit] \ + -post exit + +after 1000 {Test run} +catch {vwait forever} + Index: unix/pkgIndex.unix =================================================================== diff -u -N --- unix/pkgIndex.unix (revision 0) +++ unix/pkgIndex.unix (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,4 @@ + package ifneeded XOTcl 1.5.6 [list load \ + [file join $dir libxotcl1.5.6.dylib] XOTcl] + + Index: unix/pkgIndex.unix.in =================================================================== diff -u -N --- unix/pkgIndex.unix.in (revision 0) +++ unix/pkgIndex.unix.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,4 @@ + package ifneeded XOTcl @PACKAGE_VERSION@ [list load \ + [file join $dir @PKG_LIB_FILE@] XOTcl] + + Index: unix/tclAppInit.c =================================================================== diff -u -N --- unix/tclAppInit.c (revision 0) +++ unix/tclAppInit.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,186 @@ +/* + * tclAppInit.c -- + * + * Provides a default version of the main program and Tcl_AppInit + * procedure for Tcl applications (without Tk). + * + * Copyright (c) 1993 The Regents of the University of California. + * Copyright (c) 1994-1997 Sun Microsystems, Inc. + * Copyright (c) 1998-1999 by Scriptics Corporation. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: @(#) $Id: tclAppInit.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ + */ + +#include "tcl.h" + +#ifdef TCL_TEST + +#include "tclInt.h" + +extern int Procbodytest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +extern int Procbodytest_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)); +extern int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +#ifdef TCL_THREADS +extern int TclThread_Init _ANSI_ARGS_((Tcl_Interp *interp)); +#endif + +#endif /* TCL_TEST */ + +#ifdef TCL_XT_TEST +extern void XtToolkitInitialize _ANSI_ARGS_((void)); +extern int Tclxttest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +#endif + +/* + *---------------------------------------------------------------------- + * + * main -- + * + * This is the main program for the application. + * + * Results: + * None: Tcl_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. */ +{ + /* + * The following #if block allows you to change the AppInit + * function by using a #define of TCL_LOCAL_APPINIT instead + * of rewriting this entire file. The #if checks for that + * #define and uses Tcl_AppInit if it doesn't exist. + */ + +#ifndef TCL_LOCAL_APPINIT +#define TCL_LOCAL_APPINIT Tcl_AppInit +#endif + extern int TCL_LOCAL_APPINIT _ANSI_ARGS_((Tcl_Interp *interp)); + + /* + * The following #if block allows you to change how Tcl finds the startup + * script, prime the library or encoding paths, fiddle with the argv, + * etc., without needing to rewrite Tcl_Main() + */ + +#ifdef TCL_LOCAL_MAIN_HOOK + extern int TCL_LOCAL_MAIN_HOOK _ANSI_ARGS_((int *argc, char ***argv)); +#endif + +#ifdef TCL_XT_TEST + XtToolkitInitialize(); +#endif + +#ifdef TCL_LOCAL_MAIN_HOOK + TCL_LOCAL_MAIN_HOOK(&argc, &argv); +#endif + + Tcl_Main(argc, argv, TCL_LOCAL_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 the interp's 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; + } + +#ifdef TCL_TEST +#ifdef TCL_XT_TEST + if (Tclxttest_Init(interp) == TCL_ERROR) { + return TCL_ERROR; + } +#endif + 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; + } +#ifdef TCL_THREADS + if (TclThread_Init(interp) == TCL_ERROR) { + return TCL_ERROR; + } +#endif + if (Procbodytest_Init(interp) == TCL_ERROR) { + return TCL_ERROR; + } + Tcl_StaticPackage(interp, "procbodytest", Procbodytest_Init, + Procbodytest_SafeInit); +#endif /* TCL_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 (Xotcl_Init(interp) == TCL_ERROR) { + return TCL_ERROR; + } + + Tcl_StaticPackage(interp, "XOTcl", Xotcl_Init, 0); + if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), + "::xotcl::*", /* allowOverwrite */ 1) != 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. + */ + +#ifdef DJGPP + Tcl_SetVar(interp, "tcl_rcFileName", "~/tclsh.rc", TCL_GLOBAL_ONLY); +#else + Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY); +#endif + return TCL_OK; +} Index: unix/tkAppInit.c =================================================================== diff -u -N --- unix/tkAppInit.c (revision 0) +++ unix/tkAppInit.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,91 @@ +/* + * tkAppInit.c -- + * $Id: tkAppInit.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ + * + * 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. + */ + +#ifndef lint +/* static char sccsid[] = "@(#) tkAppInit.c 1.12 94/12/17 16:30:56"; */ +#endif /* not lint */ + +#include "tk.h" +#include "locale.h" +#include + +/* + *---------------------------------------------------------------------- + * + * 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; + } + if (Xotcl_Init(interp) == TCL_ERROR) { + return TCL_ERROR; + } + Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit); + Tcl_StaticPackage(interp, "XOTcl", Xotcl_Init, 0); + + if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), + "::xotcl::*", /* allowOverwrite */ 1) != TCL_OK) { + return TCL_ERROR; + } + Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY); + + return TCL_OK; +} Index: unix/xotcl.spec =================================================================== diff -u -N --- unix/xotcl.spec (revision 0) +++ unix/xotcl.spec (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,56 @@ +Summary: Object Oriented Extension for Tcl +Name: xotcl +Version: 1.5.6 +Release: 0 +License: bsd style open source +Group: Development/Languages +Source: http://www.xotcl.org/xotcl-1.5.6.tar.gz +URL: http://www.xotcl.org +Packager: Gustaf.Neumann@wu-wien.ac.at +Distribution: Fedorea Core 7 +Requires: tcl +Prefix: /usr +BuildRoot: %{_tmppath}/%{name}-root +BuildRequires: autoconf + +%description +XOTcl is an object-oriented scripting language based on MIT's OTcl. +This packages provides a pre-packaged tcl-shell (xotclsh) and tk-shell +(xowish) together with the Tcl-extension (libxotcl.so) which can be +loaded to any Tcl-application. Furthermore it includes several +xotcl-based packages for e.g. HTTP client and server, XML, RDF, +persistent object store, mobile code system, etc. For more details +consult http://www.xotcl.org + +%prep +%setup -q -n xotcl-1.5.6 + + +%build +autoconf +# ./configure --with-tcl=/usr/lib --with-all --prefix=/usr/local --exec-prefix=/usr/local +./configure --with-tcl=/usr/lib --with-all --prefix=/usr --exec-prefix=/usr +# make CFLAGS_DEFAULT='-O3 -mcpu=i686 -Wall -fomit-frame-pointer' +make CFLAGS_DEFAULT='-O3 -Wall -fomit-frame-pointer' + +%install +rm -rf $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install +rm -f $RPM_BUILD_ROOT/usr/lib/libxotcl1.5.6.so +ln -s xotcl1.5.6/libxotcl1.5.6.so $RPM_BUILD_ROOT/usr/lib + +%files +%defattr(-, root, root) +%doc doc +%_bindir/xotclsh +%_bindir/xowish +%_prefix/lib/xotcl1.5.6 +%_prefix/lib/libxotcl1.5.6.so +%_prefix/lib/xotclexpat* +%_prefix/lib/xotclgdbm* +%_prefix/lib/xotclsdbm* +%_prefix/lib/xotclConfig.sh +%_includedir/xotcl.h +%_includedir/xotclInt.h +%_includedir/xotclDecls.h +%_includedir/xotclIntDecls.h Index: unix/xotcl.spec.in =================================================================== diff -u -N --- unix/xotcl.spec.in (revision 0) +++ unix/xotcl.spec.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,56 @@ +Summary: Object Oriented Extension for Tcl +Name: xotcl +Version: @PACKAGE_VERSION@ +Release: 0 +License: bsd style open source +Group: Development/Languages +Source: http://www.xotcl.org/xotcl-@PACKAGE_VERSION@.tar.gz +URL: http://www.xotcl.org +Packager: Gustaf.Neumann@wu-wien.ac.at +Distribution: Fedorea Core 7 +Requires: tcl +Prefix: /usr +BuildRoot: %{_tmppath}/%{name}-root +BuildRequires: autoconf + +%description +XOTcl is an object-oriented scripting language based on MIT's OTcl. +This packages provides a pre-packaged tcl-shell (xotclsh) and tk-shell +(xowish) together with the Tcl-extension (libxotcl.so) which can be +loaded to any Tcl-application. Furthermore it includes several +xotcl-based packages for e.g. HTTP client and server, XML, RDF, +persistent object store, mobile code system, etc. For more details +consult http://www.xotcl.org + +%prep +%setup -q -n xotcl-@PACKAGE_VERSION@ + + +%build +autoconf +# ./configure --with-tcl=/usr/lib --with-all --prefix=@prefix@ --exec-prefix=@prefix@ +./configure --with-tcl=/usr/lib --with-all --prefix=/usr --exec-prefix=/usr +# make CFLAGS_DEFAULT='-O3 -mcpu=i686 -Wall -fomit-frame-pointer' +make CFLAGS_DEFAULT='-O3 -Wall -fomit-frame-pointer' + +%install +rm -rf $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install +rm -f $RPM_BUILD_ROOT/usr/lib/libxotcl@PACKAGE_VERSION@.so +ln -s xotcl@PACKAGE_VERSION@/libxotcl@PACKAGE_VERSION@.so $RPM_BUILD_ROOT/usr/lib + +%files +%defattr(-, root, root) +%doc doc +%_bindir/xotclsh +%_bindir/xowish +%_prefix/lib/xotcl@PACKAGE_VERSION@ +%_prefix/lib/libxotcl@PACKAGE_VERSION@.so +%_prefix/lib/xotclexpat* +%_prefix/lib/xotclgdbm* +%_prefix/lib/xotclsdbm* +%_prefix/lib/xotclConfig.sh +%_includedir/xotcl.h +%_includedir/xotclInt.h +%_includedir/xotclDecls.h +%_includedir/xotclIntDecls.h \ No newline at end of file Index: win/Makefile.vc =================================================================== diff -u -N --- win/Makefile.vc (revision 0) +++ win/Makefile.vc (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,442 @@ +###################################################################### +# +# Microsoft Visual C++ makefile for XOTcl +# +# do not edit in this file, edit "configs.vc" +# +###################################################################### + +!include "configs.vc" + +BINROOT = . +ROOT = .. +NAMEPREFIX = lib +NAME = xotcl +STUBSUFFIX = stub + +XOTCL_DIR = .. +XOTCL_BUILD_DIR = ..\win +SDBM_DIR = ..\library\store\XOTclSdbm +EXPAT_DIR = ..\library\xml\TclExpat-1.1 +MAKE_XOTCL = .\library\lib\make.xotcl + +MAKECMD = nmake.exe -nologo /$(MAKEFLAGS) -f makefile.vc + +######################################################################## + +lflags = /NODEFAULTLIB /NOLOGO /MACHINE:$(MACHINE) $(libpath32) +conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup +guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup + +!IF "$(MACHINE)" == "PPC" +libc = libc$(DBGX).lib +libcdll = crtdll$(DBGX).lib +!ELSE +libc = libc$(DBGX).lib oldnames.lib +libcdll = msvcrt$(DBGX).lib oldnames.lib +!ENDIF + +baselibs = kernel32.lib $(optlibs) advapi32.lib user32.lib +winlibs = $(baselibs) gdi32.lib comdlg32.lib winspool.lib + +guilibs = $(libc) $(winlibs) +conlibs = $(libc) $(baselibs) +guilibsdll = $(libcdll) $(winlibs) +conlibsdll = $(libcdll) $(baselibs) + +######################################################################## + +!if $(DEBUG) +TMPNAME = Debug +DBGX = d +!else +TMPNAME = Release +DBGX = +!endif + +TMP_DIR = $(BINROOT)\$(TMPNAME) + +!ifndef OUT_DIR +OUT_DIR = $(TMP_DIR) +!endif + +!if $(STATIC_BUILD) +XOTCLOUTNAME = $(NAMEPREFIX)$(NAME)$(XOTCL_VERSION)$(DBGX) +XOTCLTARGET = "$(OUT_DIR)\$(XOTCLOUTNAME).lib" +!else +XOTCLOUTNAME = $(NAMEPREFIX)$(NAME)$(XOTCL_VERSION)$(DBGX) +XOTCLIMPLIB = "$(OUT_DIR)\$(XOTCLOUTNAME).lib" +XOTCLTARGET = "$(OUT_DIR)\$(XOTCLOUTNAME).dll" +!endif + +TCLSTUBLIB = "$(TCLROOT)\win\Release\tclstub$(TCL_VERSION).lib" +TCLIMPLIB = "$(TCLROOT)\win\$(OUT_DIR)\tcl$(TCL_VERSION)$(DBGX).lib" +TKIMPLIB = "$(TKROOT)\win\$(OUT_DIR)\tk$(TCL_VERSION)$(DBGX).lib" +TCLSH = "$(TCLROOT)\win\$(OUT_DIR)\tclsh$(TCL_VERSION)$(DBGX).exe" + +XOTCLSTUBLIBNAME = $(NAMEPREFIX)$(NAME)$(STUBSUFFIX)$(XOTCL_VERSION)$(DBGX).lib +XOTCLSTUBLIB = "$(OUT_DIR)\$(XOTCLSTUBLIBNAME)" + +LIB_INSTALL_DIR = $(INSTALLDIR)\lib +BIN_INSTALL_DIR = $(INSTALLDIR)\bin +SCRIPT_INSTALL_DIR = $(INSTALLDIR)\lib\xotcl$(XOTCL_DOTVERSION) +INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include + +XOTCLOBJS_STUB = $(TMP_DIR)\xotclStubInit.obj +COMPILE_XOTCL_STUBS = -DCOMPILE_XOTCL_STUBS=1 + +!if $(TCLMAJOR) == 8 +!if $(TCLMINOR) == 0 +XOTCLOBJS_STUB = "" +COMPILE_XOTCL_STUBS="" +!endif +!endif + +XOTCLOBJS = $(XOTCLOBJS_STUB) \ + $(TMP_DIR)\xotcl.obj \ + $(TMP_DIR)\xotclError.obj \ + $(TMP_DIR)\xotclMetaData.obj \ + $(TMP_DIR)\xotclObjectData.obj \ + $(TMP_DIR)\xotclProfile.obj \ + $(TMP_DIR)\xotclTrace.obj \ + $(TMP_DIR)\xotclShadow.obj \ + $(TMP_DIR)\xotclUtil.obj \ + $(TMP_DIR)\aolstub.obj \ +!if $(STATIC_BUILD) == 0 + $(TMP_DIR)\dllEntryPoint.obj \ + $(TMP_DIR)\dllResource.obj \ +!endif + +XOTCLSHOBJS = $(TMP_DIR)\xotclAppInit.obj +XOWISHOBJS = $(TMP_DIR)\winMain.obj + +XOTCLSTUBOBJS = \ + $(TMP_DIR)\xotclStubLib.obj + +WINDIR = $(ROOT)\win +GENERICDIR = $(ROOT)\generic +RCDIR = $(ROOT)\win\rc + +###################################################################### +# Link flags +###################################################################### + +!if $(DEBUG) +ldebug = -debug:full -debugtype:cv +!else +ldebug = -release +!endif + +# declarations common to all linker options +lcommon = -nologo -link50compat -machine:$(MACHINE) + +XOTCL_LFLAGS = $(lcommon) $(ldebug) -subsystem:windows -dll + +!if $(USE_TCL_STUBS) == 0 +XOTCL_LLIBS = $(TCLIMPLIB) +!else +XOTCL_LLIBS = $(TCLSTUBLIB) +!endif + +###################################################################### +# Compile flags +###################################################################### + +!if !$(DEBUG) +# This cranks the optimization level to maximize speed +cdebug = -O2 -Gs +!else if "$(MACHINE)" == "IA64" +cdebug = -Od -Zi +!else +cdebug = -Z7 -Od -WX +DBGX = d +!endif + +!if $(STATIC_BUILD) +cdll = +!else +cdll = -GD +!endif + +# declarations common to all compiler options +ccommon = -nologo -c -W3 -YX \ + + +!if $(STATIC_BUILD) && $(NOMSVCRT) +crt = -MT$(DBGX) +!else +crt = -MD$(DBGX) +!endif + +TCL_INCLUDES = -I"$(TCLROOT)\generic" +TK_INCLUDES = -I"$(TKROOT)\generic" -I$(TKROOT)\win -I$(TKROOT)\xlib + +XOTCL_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) +XOTCL_DEFINES = -DBUILD_$(NAME) -DTCL_THREADS=1 \ + -DXOLIBPKG=$(INST_XOLIBPKG) \ + -DXOTCLVERSION=$(XOTCLVERSION) \ + -DPACKAGE_VERSION=$(PACKAGE_VERSION) \ + -DXOTCLPATCHLEVEL=$(XOTCLPATCHLEVEL) \ + -D__WIN32__ -DVISUAL_CC $(COMPILE_XOTCL_STUBS) + +XOTCL_EXE_CFLAGS = $(ccommon) $(cdebug) $(crt) $(cdll) $(XOTCL_INCLUDES) \ + $(XOTCL_DEFINES) $(TCL_INCLUDES) $(TK_INCLUDES) + +!if $(USE_TCL_STUBS) +XOTCL_CFLAGS = $(XOTCL_EXE_CFLAGS) -DUSE_TCL_STUBS +!else +XOTCL_CFLAGS = $(XOTCL_EXE_CFLAGS) +!endif + +###################################################################### +# Project specific targets +###################################################################### + +all : libs packages end + +#xotcl : xotclsh xowish + +libs : setup $(XOTCLTARGET) $(XOTCLSTUBLIB) ./pkgIndex.tcl + cd $(SDBM_DIR) + $(MAKECMD) + cd ..\.. + cd $(EXPAT_DIR) + $(MAKECMD) + cd ..\..\..\win + +end: + @echo ************************************************************ + @echo * + @echo * Make completed. + @echo * + @echo * In order to test XOTcl, invoke: + @echo * + @echo * nmake -fmakefile.vc test + @echo * + @echo * In order install XOTcl, invoke the installWin.tcl + @echo * installation script, like: + @echo * + @echo * tclsh83 installWin.tcl c:\Progra~1 + @echo * + @echo * or: + @echo * + @echo * nmake -fmakefile.vc install + @echo * + @echo * To run XOTcl from the local directory, set the environment + @echo * variable TCLLIBPATH to the toplevel directory of xotcl and + @echo * execute tclsh: + @echo * + @echo * set TCLLIBPATH=$(ROOT) + @echo * tclsh83 + @echo * package require XOTcl; namespace import -force xotcl::* + @echo * + @echo ************************************************************ + +packages : libs + cd ..\library + set TCLLIBPATH=$(ROOT) + $(TCLSH) ..\$(MAKE_XOTCL) -target $(INST_XOLIBPKG) -all + cd ..\win + +install : all + set TCLLIBPATH=$(ROOT) + $(TCLSH) .\installWin.tcl + +test : $(TCLSH) + set TCLLIBPATH=$(ROOT) + $(TCLSH) $(ROOT)\tests\speedtest.xotcl + $(TCLSH) $(ROOT)\tests\testx.xotcl + $(TCLSH) $(ROOT)\tests\testo.xotcl + $(TCLSH) $(ROOT)\tests\forwardtest.xotcl + $(TCLSH) $(ROOT)\tests\actiweb.test + $(TCLSH) $(ROOT)\tests\persistence.test + $(TCLSH) $(ROOT)\tests\xoRDF.test + $(TCLSH) $(ROOT)\tests\xocomm.test + +tar : distclean + cd .. + tar cvfz xotcl-$(FULLVERSION).tar.gz xotcl-$(FULLVERSION)/* + cd xotcl-$(FULLVERSION) + + +./pkgIndex.tcl : $(XOTCLTARGET) + echo package ifneeded XOTcl $(XOTCL_VERSION) [list load [file join $$dir $(TMPNAME)/$(XOTCLOUTNAME).dll] XOTcl] > \ + ".\pkgIndex.tcl" + +setup : + @$(vcvars) > nul + @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) &\ + echo Created directory '$(TMP_DIR)' + @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) &\ + echo Created directory '$(OUT_DIR)' + +$(XOTCLTARGET) : $(XOTCLOBJS) +!if $(STATIC_BUILD) + $(lib32) -nologo -machine:$(MACHINE) -out:$@ @<< +!else + $(link32) $(XOTCL_LFLAGS) -base:@$(XOTCL_DIR)\win\dllBase.txt,$@ -out:$@ $(XOTCL_LLIBS) @<< +!endif + $(XOTCLOBJS) +<< + +#!if $(DEBUG) == 0 +$(XOTCLSTUBLIB) : $(XOTCLSTUBOBJS) + $(lib32) -nologo -out:$@ $(XOTCLSTUBOBJS) +#!else +#$(XOTCLSTUBLIB) : +#!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 $(XOTCLTARGET) "$(SCRIPT_INSTALL_DIR)" +# -copy $(XOTCLSTUBLIB) "$(LIB_INSTALL_DIR)" +# copy $(ROOT)\generic\xotcl.h "$(INCLUDE_INSTALL_DIR)" +# copy $(ROOT)\generic\xotclDecls.h "$(INCLUDE_INSTALL_DIR)" +# copy $(ROOT)\library\*.* "$(SCRIPT_INSTALL_DIR)" +# echo package ifneeded XOTcl $(XOTCL_DOTVERSION) [list load [file join $$dir ../../bin $(XOTCLOUTNAME).dll] XOTcl] > \ +# "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" + +###################################################################### +# Regenerate the stubs files. +###################################################################### + +genstubs: + $(TCLSH) $(TCLROOT)\tools\genStubs.tcl $(GENERICDIR) \ + $(GENERICDIR)\xotcl.decls $(GENERICDIR)\xotclInt.decls + +###################################################################### +# Special case object file targets +###################################################################### + +# 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)\xotclStubLib.obj : $(GENERICDIR)\xotclStubLib.c + $(cc32) -DSTATIC_BUILD $(XOTCL_EXE_CFLAGS) -Zl -Fo$@ $? + +$(TMP_DIR)\dllResource.obj : $(TMP_DIR)\xotcl.res + $(cvtres32) -nologo -machine:$(MACHINE) -out:$@ $? + +predefined : $(GENERICDIR)\predefined.xotcl + cd $(GENERICDIR) + $(TCLSH) mk_predefined.xotcl > predefined.h + cd ..\win + +###################################################################### +# Inference rules. Use batch-mode when supported. +###################################################################### + +$(TMP_DIR)\xotclAppInit.obj : $(GENERICDIR)\xotclAppInit.c + $(cc32) $(XOTCL_EXE_CFLAGS) -Fo$@ $? + +$(TMP_DIR)\findXOTcl.obj : $(GENERICDIR)\findXOTcl.c + $(cc32) $(XOTCL_EXE_CFLAGS) -Fo$@ $? + +$(TMP_DIR)\winMain.obj : $(WINDIR)\winMain.c + $(cc32) $(XOTCL_EXE_CFLAGS) -Fo$@ $? + + + +!if $(_NMAKE_VER) < 162 +{$(WINDIR)}.c{$(TMP_DIR)}.obj : +!else +{$(WINDIR)}.c{$(TMP_DIR)}.obj :: +!endif + $(cc32) -DDLL_BUILD $(XOTCL_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +!if $(_NMAKE_VER) < 162 +{$(GENERICDIR)}.c{$(TMP_DIR)}.obj : +!else +{$(GENERICDIR)}.c{$(TMP_DIR)}.obj :: +!endif + $(cc32) -DDLL_BUILD $(XOTCL_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +XOTCL_VERSION_DEFINES = \ + -DXOTCL_MAJOR_VERSION=$(XOTCL_MAJOR_VERSION) \ + -DXOTCL_MINOR_VERSION=$(XOTCL_MINOR_VERSION) \ + -DXOTCL_VERSION=\"$(XOTCL_VERSION)\" + + +{$(RCDIR)}.rc{$(TMP_DIR)}.res : + $(rc32) -fo $@ -DDEBUG=$(DEBUG) $(XOTCL_VERSION_DEFINES) $(XOTCL_INCLUDES) $(TCL_INCLUDES) $(XOTCL_DEFINES) $< + +###################################################################### +# Clean up +###################################################################### + +tidy : + -del $(TMP_DIR)\*.pch + -del $(TMP_DIR)\*.obj + -del $(TMP_DIR)\*.res + -del .\*.pdb + -del .\*.pch + cd $(SDBM_DIR) + $(MAKECMD) tidy + cd ..\.. + cd $(EXPAT_DIR) + $(MAKECMD) tidy + cd ..\..\..\win + +clean : + -del $(TMP_DIR)\*.pch + -del $(TMP_DIR)\*.obj + -del $(TMP_DIR)\*.res + -del .\*.pdb + -del .\*.pch + -del $(OUT_DIR)\*.exp + -del $(OUT_DIR)\*.lib + -del $(OUT_DIR)\*.dll + -del ..\*.exp + -del ..\*.lib + -del ..\xotclsh.exe + -del ..\xowish.exe + cd $(SDBM_DIR) + $(MAKECMD) clean + cd ..\.. + cd $(EXPAT_DIR) + $(MAKECMD) clean + cd ..\..\..\win + +distclean : clean + -rmdir $(OUT_DIR) + -rmdir $(TMP_DIR) + cd $(SDBM_DIR) + $(MAKECMD) distclean + cd ..\.. + cd $(EXPAT_DIR) + $(MAKECMD) distclean + cd ..\..\..\win + +# +# tar +# + +tar : distclean + cd ..\.. + tar cvfz xotcl-$(FULLVERSION).tar.gz xotcl-$(FULLVERSION)/* + cd xotcl-$(FULLVERSION)\win + +# +# XOTcl Shells +# +../xotclsh.exe: $(XOTCLSHOBJS) $(TCLIMPLIB) $(TMP_DIR)\xotcl.res + $(link32) $(ldebug) $(conlflags) $(TMP_DIR)\xotcl.res -stack:2300000 \ + -out:$@ $(conlibsdll) $(TCLIMPLIB) $(XOTCLSHOBJS) + +../xowish.exe: $(XOWISHOBJS) $(TCLIMPLIB) $(TKIMPLIB) $(TMP_DIR)\xotcl.res + $(link32) $(ldebug) $(guilflags) $(TMP_DIR)\xotcl.res -out:$@ \ + $(guilibsdll) $(TCLIMPLIB) $(TKIMPLIB) $(XOTCLLIB) $(XOWISHOBJS) + + +xotclsh: ../xotclsh.exe +xowish: ../xowish.exe + +xotclshells: xotclsh xowish Index: win/configs.vc =================================================================== diff -u -N --- win/configs.vc (revision 0) +++ win/configs.vc (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,135 @@ +# +# Config file for MS Visual CC compile with nmake; only edit in this file +# + +# are we using MSVC++ version 5 or 6 ? +MSDEV_VER = 6 + +# Where is MSVC++ located? +MSDEVROOT = c:\progra~1\Micros~3\ + +# Where is Tcl and Tk? Which Version? +#TCLMAJOR = 8 +#TCLMINOR = 3 +#TCLPATCHLEVEL = .5 +TCLMAJOR = 8 +TCLMINOR = 4 +TCLPATCHLEVEL = .13 + +TCLROOT = c:\work\tcl\tcl$(TCLMAJOR).$(TCLMINOR)$(TCLPATCHLEVEL) +TKROOT = c:\tk$(TCLMAJOR).$(TCLMINOR)$(TCLPATCHLEVEL) + +TCL_VERSION = $(TCLMAJOR)$(TCLMINOR) +TCL_DOTVERSION = $(TCLMAJOR).$(TCLMINOR) + +# Where will we install XOTcl? Usually use the installWin.tcl script +INSTALLDIR = c:/progra~1/tcl + +# machine setting, pick from: +# ALPHA|ARM|IX86|MIPS|MIPS16|MIPSR41XX|PPC|SH3|SH4 +# Or set to IA64 to rearrange everything to use the Intel IA64 SDK. +# +MACHINE = IX86 + +!if "$(MACHINE)" == "IA64" +vcvars = "c:\ia64sdk17\vcvars32.bat" +!elseif $(MSDEV_VER) == 5 +vcvars = "$(MSDEVROOT)\vc\bin\vcvars32.bat" +!elseif $(MSDEV_VER) == 6 +vcvars = "$(MSDEVROOT)\vc98\bin\vcvars32.bat" +!endif + +# the VCC tools names +rc32 = rc +cc32 = cl +link32 = link +lib32 = lib +cvtres32 = cvtres + +# +# XOTCL VERSION SETTINGS (do not edit) +# +XOTCL_MAJOR_VERSION=1 +XOTCL_MINOR_VERSION=5 +XOTCL_RELEASE_LEVEL=.0 + +MAJOR_VERSION=$(XOTCL_MAJOR_VERSION) +MINOR_VERSION=$(XOTCL_MINOR_VERSION) +PATCHLEVEL=$(XOTCL_RELEASE_LEVEL) + +XOTCL_VERSION= $(MAJOR_VERSION).$(MINOR_VERSION) +FULLVERSION= $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCHLEVEL) +NODOT_VERSION= $(MAJOR_VERSION)$(MINOR_VERSION) +INST_XOLIBPKG = \"$(INSTALLDIR)/lib/xotcl$(MAJOR_VERSION).$(MINOR_VERSION)\" +XOTCLVERSION = \"$(XOTCL_VERSION)\" +PACKAGE_VERSION = \"$(FULLVERSION)\" +XOTCLPATCHLEVEL= \"$(PATCHLEVEL)\" + +## command line rules + +!ifndef HAVE_RULES +HAVE_RULES = 1 + +# Set DEBUG to 1 to compile with symbols. +!ifndef DEBUG +DEBUG = 0 +!endif + +# Set STATIC_BUILD to 1 to make a static library rather +# than a dll. +!ifndef STATIC_BUILD +STATIC_BUILD = 0 +!endif + +# Set USE_TCL_STUBS to 0 to disable Stubs support. Stubs +# will work fine even with static libraries, but you may +# disable it if you want to. +# +!ifndef USE_TCL_STUBS +!if $(STATIC_BUILD) == 0 +USE_TCL_STUBS = 1 +!else +USE_TCL_STUBS = 0 +!endif +!endif + +# no stubs support in Tcl 8.0 +!if $(TCLMAJOR) == 8 +!if $(TCLMINOR) == 0 +USE_TCL_STUBS = 0 +!endif +!endif + +# Set NOMSVCRT to 1 to use libcmt(d).lib instead of the +# dynamic run-time. +# +!ifndef NOMSVCRT +!if $(STATIC_BUILD) +NOMSVCRT = 1 +!else +NOMSVCRT = 0 +!endif +!endif + +!if $(STATIC_BUILD) == 0 && $(NOMSVCRT) == 1 +!error "The static runtime in a loadable (dll) extension is a useless configuration that will cause abnormal and unnecessary code bloat." +!endif + +!endif #!ifndef HAVE_RULES + +_NMAKE_VER = $(_NMAKE_VER:6.00.8168.0=600) + +!IF "$(MACHINE)" == "IA64" +TOOLS32 = c:\ia64sdk17 +TOOLS32_rc = c:\ia64sdk17 +!ELSE +TOOLS32 = $(MSDEVROOT)\Vc98 +TOOLS32_rc = $(MSDEVROOT)\Common\MsDev98 +!ENDIF + +cc32 = "$(TOOLS32)\bin\cl.exe" +link32 = "$(TOOLS32)\bin\link.exe" +rc32 = "$(TOOLS32_rc)\bin\rc.exe" +include32 = -I"$(TOOLS32)\include" +libpath32 = /LIBPATH:"$(TOOLS32)\lib" +lib32 = "$(TOOLS32)\bin\lib.exe" Index: win/dllBase.txt =================================================================== diff -u -N --- win/dllBase.txt (revision 0) +++ win/dllBase.txt (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,19 @@ +; +; This file defines the virtual base addresses for the Dynamic Link Libraries +; that are part of the XOTcl system. The first token on a line is the key (or +; name of the DLL) and the second token is the virtual base address, in hexidecimal. +; The third token is the maximum size of the DLL image file, including symbols. +; +; Using a specified "prefered load address" should speed loading time by avoiding +; relocations (NT supported only). It is assumed extension authors will contribute +; their modules to this grand-master list. You can use the dumpbin utility with +; the /headers option to get the "size of image" data (already in hex). If the +; maximum size is too small a linker warning will occur. Modules can overlap when +; they're mutually exclusive. This info is placed in the DLL's PE header by the +; linker with the `-base:@$(XOTCL_DIR)\win\dllBase.txt,` option. +; +; RCS: @(#) $$ + +.\Release\libxotcl1.1.dll 0x67000000 0x00020000 +.\Release\libxotclsdbm1.1.dll 0x67020000 0x00010000 +.\Release\libxotclexpat1.1.dll 0x67030000 0x00020000 Index: win/dllEntryPoint.c =================================================================== diff -u -N --- win/dllEntryPoint.c (revision 0) +++ win/dllEntryPoint.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,52 @@ +/* + * dllEntryPoint.c -- + * + * This file implements the Dll entry point as needed by Windows. + */ + +#define WIN32_LEAN_AND_MEAN +#include + +#ifdef _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 + +/* + *---------------------------------------------------------------------- + * + * DllEntryPoint -- + * + * This wrapper function is used by Windows to invoke the + * initialization code for the DLL. If we are compiling + * with Visual C++, this routine will be renamed to DllMain. + * + * Results: + * Returns TRUE; + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +#ifndef STATIC_BUILD + +BOOL APIENTRY +DllEntryPoint(hInst, reason, reserved) + HINSTANCE hInst; /* Library instance handle. */ + DWORD reason; /* Reason this function is being called. */ + LPVOID reserved; /* Not used. */ +{ + return TRUE; +} + +#endif \ No newline at end of file Index: win/installWin.tcl =================================================================== diff -u -N --- win/installWin.tcl (revision 0) +++ win/installWin.tcl (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,136 @@ +# $Id: installWin.tcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +if {$::argc > 0} { + set DESTINATION [lindex $argv 0] +} else { + # if now argument is given -> set to default + set DESTINATION "/Progra~1/Tcl" +} + +puts "Installing to Directory: $DESTINATION" + +#rename file tcl_file +#proc file args { +# puts stderr "...$args" +# eval ::tcl_file $args +#} + +# +# find out the XOTcl version +# +cd .. +set xotclDir . +set buildDir $xotclDir/win/Release +cd $buildDir +set xotcllib [lindex [glob -nocomplain libxotcl*.dll] 0] +cd ../.. +regexp {^libxotcl([0-9]\.[0-9]).dll$} $xotcllib _ xotclVersion +puts "XOTcl Version is $xotclVersion" +set MAKEXOTCL $xotclDir/library/lib/make.xotcl + +# +# copy binaries +# +file mkdir $DESTINATION/bin +set bin "xotclsh.exe xowish.exe" +foreach b $bin { + if {[file exists $buildDir/$b]} { + puts "Copying $b" + file copy -force $buildDir/$b $DESTINATION/bin + } elseif {[file exists $xotclDir/$b]} { + puts "Copying $b" + file copy -force $xotclDir/$b $DESTINATION/bin + } +} + +# +# copy libraries +# +file mkdir $DESTINATION/include +set includes "xotcl.h xotclInt.h xotclDecls.h xotclIntDecls.h" +foreach i $includes { + puts "Copying $i" + file copy -force $xotclDir/generic/$i $DESTINATION/include +} + +# +# create the XOTcl library directory +# +puts "Creating XOTcl Lib Dir" +file mkdir $DESTINATION/lib +file mkdir $DESTINATION/lib/xotcl$xotclVersion + +# +# copy the dll +# +set b libxotcl${xotclVersion}.dll +if {[file exists $buildDir/$b]} { + puts "Copying $b" + file copy -force $buildDir/$b $DESTINATION/lib +} elseif {[file exists $xotclDir/$b]} { + puts "Copying $b" + file copy -force $xotclDir/$b $DESTINATION/lib +} + +# +# create a pkgindex file for xotcl in the library directoy +# +#file mkdir $DESTINATION/lib/xotcl$xotclVersion/libxotcl +puts "Creating pkgindex files for xotcl in the library directory" +#set pkgIndex "package ifneeded XOTcl $xotclVersion \[list load \[file join \$dir ../../../bin \"libxotcl${xotclVersion}.dll\"\] XOTcl\]" +#set F [open $DESTINATION/lib/xotcl$xotclVersion/libxotcl/pkgIndex.tcl w] +#puts $F $pkgIndex +#puts $F "\n" +#close $F +## and one in the xotcl- directory +set pkgIndex "package ifneeded XOTcl $xotclVersion \[list load \[file join \$dir ../../ \"libxotcl${xotclVersion}.dll\"\] XOTcl\]" +file mkdir $DESTINATION/lib/xotcl$xotclVersion/xotcl +set F [open $DESTINATION/lib/xotcl$xotclVersion/xotcl/pkgIndex.tcl w] +puts $F $pkgIndex +puts $F "\n" +close $F + +proc copyDir {dir dest} { + puts "Copying directory: $dir" + set files [glob -nocomplain $dir/*] + foreach f $files { + doDir $f $dest + } +} + +proc doDir {f dest} { + if {[file isdirectory $f]} { + file mkdir $dest/$f + copyDir $f $dest + } else { + file copy -force $f $dest/$f + } +} + +cd library + +foreach f [glob -nocomplain *] { + doDir $f $DESTINATION/lib/xotcl$xotclVersion +} + +cd .. +set pwd [pwd] + +puts "Indexing the packages" +set shell [info nameofexecutable] +#puts "SHELL=$shell" +cd $DESTINATION/lib/xotcl$xotclVersion +if {[catch {exec $shell $pwd/$MAKEXOTCL -target $DESTINATION/lib/xotcl$xotclVersion -all} errMsg]} { + puts " ... resulting message: $errMsg\n" +} else { + puts " ... Package Indexing SUCCEEDED\n" +} + +puts stderr "***************************************************" +puts stderr "INSTALLATION COMPLETE." +puts stderr "\nIn order to use XOTcl set PATH to " +puts stderr " '$DESTINATION/bin' and" +puts stderr "set TCLLIBPATH to " +puts stderr " '$DESTINATION/lib/xotcl$xotclVersion'" +puts stderr "***************************************************" + + Index: win/pkgIndex.win =================================================================== diff -u -N --- win/pkgIndex.win (revision 0) +++ win/pkgIndex.win (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,3 @@ + package ifneeded XOTcl 1.1 [list load \ + [file join $dir ../../bin xotcl1.1.dll] XOTcl] + Index: win/pkgIndex.win.in =================================================================== diff -u -N --- win/pkgIndex.win.in (revision 0) +++ win/pkgIndex.win.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,3 @@ + package ifneeded XOTcl @VERSION@ [list load \ + [file join $dir ../../bin xotcl@VERSION@.dll] XOTcl] + Index: win/rc/xotcl.rc =================================================================== diff -u -N --- win/rc/xotcl.rc (revision 0) +++ win/rc/xotcl.rc (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,59 @@ +// +// Version resource script. +// + +#include + +#define RESOURCE_INCLUDED +#include + + +// +// build-up the name suffix that defines the type of build this is. +// +#if DEBUG == 1 +#define SUFFIX_DEBUG "d" +#else +#define SUFFIX_DEBUG "" +#endif + +#define SUFFIX SUFFIX_DEBUG + + +VS_VERSION_INFO VERSIONINFO + FILEVERSION XOTCL_MAJOR_VERSION ,XOTCL_MINOR_VERSION ,0 , 0 + PRODUCTVERSION XOTCL_MAJOR_VERSION ,XOTCL_MINOR_VERSION ,0 , 0 + FILEFLAGSMASK 0x3fL +#if DEBUG == 1 + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "XOTcl language extension for Tcl\0" + VALUE "Authors", "Gustaf Neumann and Uwe Zdun\0" + VALUE "OriginalFilename", "xotcl" STRINGIFY(JOIN(XOTCL_MAJOR_VERSION,XOTCL_MINOR_VERSION)) SUFFIX ".dll\0" + VALUE "CompanyName", "Vienna University of Economics and Business Administration, University of Essen\0" + VALUE "FileVersion", XOTCL_VERSION + VALUE "LegalCopyright", "Copyright \251 1999-2001\0" + VALUE "ProductName", "XOTcl " XOTCL_VERSION " for Windows\0" + VALUE "ProductVersion", XOTCL_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + + + + + Index: win/winMain.c =================================================================== diff -u -N --- win/winMain.c (revision 0) +++ win/winMain.c (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,430 @@ +/* + * winMain.c -- + * + * Main entry point for wish and other Tk-based applications. + * + * Copyright (c) 1995-1997 Sun Microsystems, Inc. + * Copyright (c) 1998-1999 by Scriptics Corporation. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: @(#) $Id: winMain.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ + */ + +#include +#define WIN32_LEAN_AND_MEAN +#include +#undef WIN32_LEAN_AND_MEAN +#include +#include +#if defined(VISUAL_CC) +# include "xotcl.h" +#else +# include +#endif + +#include "tkInt.h" + +/* + * The following declarations refer to internal Tk routines. These + * interfaces are available for use, but are not supported. + */ +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<2 +EXTERN void TkConsoleCreate(void); +EXTERN int TkConsoleInit(Tcl_Interp *interp); +#endif +/* + * Forward declarations for procedures defined later in this file: + */ + +static void setargv _ANSI_ARGS_((int *argcPtr, char ***argvPtr)); +static void WishPanic _ANSI_ARGS_(TCL_VARARGS(CONST char *,format)); + +#ifdef TK_TEST +extern int Tktest_Init(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 */ + +static BOOL consoleRequired = TRUE; + + +/* + *---------------------------------------------------------------------- + * + * WinMain -- + * + * Main entry point from Windows. + * + * Results: + * Returns false if initialization fails, otherwise it never + * returns. + * + * Side effects: + * Just about anything, since from here we call arbitrary Tcl code. + * + *---------------------------------------------------------------------- + */ + +int APIENTRY +WinMain(hInstance, hPrevInstance, lpszCmdLine, nCmdShow) + HINSTANCE hInstance; + HINSTANCE hPrevInstance; + LPSTR lpszCmdLine; + int nCmdShow; +{ + char **argv; + int argc; +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<2 + char buffer[MAX_PATH+1]; + char *p; +#endif + Tcl_SetPanicProc(WishPanic); + + /* + * Set up the default locale to be standard "C" locale so parsing + * is performed correctly. + */ + + setlocale(LC_ALL, "C"); +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION>1 + setargv(&argc, &argv); +#endif + /* + * Increase the application queue size from default value of 8. + * At the default value, cross application SendMessage of WM_KILLFOCUS + * will fail because the handler will not be able to do a PostMessage! + * This is only needed for Windows 3.x, since NT dynamically expands + * the queue. + */ + + SetMessageQueue(64); + + /* + * Create the console channels and install them as the standard + * channels. All I/O will be discarded until Tk_CreateConsoleWindow is + * called to attach the console to a text widget. + */ +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<2 + TkConsoleCreate(); + + setargv(&argc, &argv); + + /* + * Replace argv[0] with full pathname of executable, and forward + * slashes substituted for backslashes. + */ + + GetModuleFileName(NULL, buffer, sizeof(buffer)); + argv[0] = buffer; + for (p = buffer; *p != '\0'; p++) { + if (*p == '\\') { + *p = '/'; + } + } +#endif + consoleRequired = TRUE; + + Tk_Main(argc, argv, Tcl_AppInit); + return 1; +} + + +/* + *---------------------------------------------------------------------- + * + * 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 the interp's 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) { + goto error; + } + if (Tk_Init(interp) == TCL_ERROR) { + goto error; + } + Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit); + + /* + if (Xotcl_Init(interp) == TCL_ERROR) { + return TCL_ERROR; + } + Tcl_StaticPackage(interp, "XOTcl", Xotcl_Init, 0); + */ + if (Tcl_PkgRequire(interp, "XOTcl", XOTCLVERSION, 1) == NULL) { + return TCL_ERROR; + } + + /* + * This is xotclsh, so import all xotcl commands by + * default into the global namespace. + */ + if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), + "::xotcl::*", /* allowOverwrite */ 1) != TCL_OK) { + return TCL_ERROR; + } + + /* + * Initialize the console only if we are running as an interactive + * application. + */ +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<2 + if (TkConsoleInit(interp) == TCL_ERROR) { + goto error; + } +#else + if (consoleRequired) { + if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) { + goto error; + } + } +#endif + +#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) { + goto error; + } + Tcl_StaticPackage(interp, "Tktest", Tktest_Init, + (Tcl_PackageInitProc *) NULL); +#endif /* TK_TEST */ + + Tcl_SetVar(interp, "tcl_rcFileName", "~/wishrc.tcl", TCL_GLOBAL_ONLY); + return TCL_OK; + +error: + WishPanic(Tcl_GetStringResult(interp)); + return TCL_ERROR; +} + +/* + *---------------------------------------------------------------------- + * + * WishPanic -- + * + * Display a message and exit. + * + * Results: + * None. + * + * Side effects: + * Exits the program. + * + *---------------------------------------------------------------------- + */ + +void +WishPanic TCL_VARARGS_DEF(CONST char *,arg1) +{ + va_list argList; + char buf[1024]; + CONST char *format; + + format = TCL_VARARGS_START(CONST char *,arg1,argList); + vsprintf(buf, format, argList); + + MessageBeep(MB_ICONEXCLAMATION); + MessageBox(NULL, buf, "Fatal Error in Wish", + MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND); +#ifdef _MSC_VER + DebugBreak(); +#endif + ExitProcess(1); +} +/* + *------------------------------------------------------------------------- + * + * setargv -- + * + * Parse the Windows command line string into argc/argv. Done here + * because we don't trust the builtin argument parser in crt0. + * Windows applications are responsible for breaking their command + * line into arguments. + * + * 2N backslashes + quote -> N backslashes + begin quoted string + * 2N + 1 backslashes + quote -> literal + * N backslashes + non-quote -> literal + * quote + quote in a quoted string -> single quote + * quote + quote not in quoted string -> empty string + * quote -> begin quoted string + * + * Results: + * Fills argcPtr with the number of arguments and argvPtr with the + * array of arguments. + * + * Side effects: + * Memory allocated. + * + *-------------------------------------------------------------------------- + */ + +static void +setargv(argcPtr, argvPtr) + int *argcPtr; /* Filled with number of argument strings. */ + char ***argvPtr; /* Filled with argument strings (malloc'd). */ +{ + char *cmdLine, *p, *arg, *argSpace; + char **argv; + int argc, size, inquote, copy, slashes; + + cmdLine = GetCommandLine(); /* INTL: BUG */ + + /* + * Precompute an overly pessimistic guess at the number of arguments + * in the command line by counting non-space spans. + */ + + size = 2; + for (p = cmdLine; *p != '\0'; p++) { + if ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */ + size++; + while ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */ + p++; + } + if (*p == '\0') { + break; + } + } + } + argSpace = (char *) Tcl_Alloc( + (unsigned) (size * sizeof(char *) + strlen(cmdLine) + 1)); + argv = (char **) argSpace; + argSpace += size * sizeof(char *); + size--; + + p = cmdLine; + for (argc = 0; argc < size; argc++) { + argv[argc] = arg = argSpace; + while ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */ + p++; + } + if (*p == '\0') { + break; + } + + inquote = 0; + slashes = 0; + while (1) { + copy = 1; + while (*p == '\\') { + slashes++; + p++; + } + if (*p == '"') { + if ((slashes & 1) == 0) { + copy = 0; + if ((inquote) && (p[1] == '"')) { + p++; + copy = 1; + } else { + inquote = !inquote; + } + } + slashes >>= 1; + } + + while (slashes) { + *arg = '\\'; + arg++; + slashes--; + } + + if ((*p == '\0') + || (!inquote && ((*p == ' ') || (*p == '\t')))) { /* INTL: ISO space. */ + break; + } + if (copy != 0) { + *arg = *p; + arg++; + } + p++; + } + *arg = '\0'; + argSpace = arg + 1; + } + argv[argc] = NULL; + + *argcPtr = argc; + *argvPtr = argv; +} + + +/* + *---------------------------------------------------------------------- + * + * main -- + * + * Main entry point from the console. + * + * Results: + * None: Tk_Main never returns here, so this procedure never + * returns either. + * + * Side effects: + * Whatever the applications does. + * + *---------------------------------------------------------------------- + */ + +int main(int argc, char **argv) +{ + Tcl_SetPanicProc(WishPanic); + + /* + * Set up the default locale to be standard "C" locale so parsing + * is performed correctly. + */ + + setlocale(LC_ALL, "C"); + /* + * Increase the application queue size from default value of 8. + * At the default value, cross application SendMessage of WM_KILLFOCUS + * will fail because the handler will not be able to do a PostMessage! + * This is only needed for Windows 3.x, since NT dynamically expands + * the queue. + */ + + SetMessageQueue(64); + + /* + * Create the console channels and install them as the standard + * channels. All I/O will be discarded until Tk_CreateConsoleWindow is + * called to attach the console to a text widget. + */ + + consoleRequired = FALSE; + + Tk_Main(argc, argv, Tcl_AppInit); + return 0; +} + Index: xotcl.m4 =================================================================== diff -u -N --- xotcl.m4 (revision 0) +++ xotcl.m4 (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,139 @@ +# xotcl.m4 -- +# +# This file provides a set of autoconf macros to help TEA-enable +# a Tcl extension. +# +# Copyright (c) 1999 Scriptics Corporation. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. + +#------------------------------------------------------------------------ +# SC_PATH_XOTCLCONFIG -- +# +# Locate the xotclConfig.sh file and perform a sanity check on +# the Tcl compile flags +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-xotcl=... +# +# Defines the following vars: +# XOTCL_BIN_DIR Full path to the directory containing +# the xotclConfig.sh file +#------------------------------------------------------------------------ + +AC_DEFUN(SC_PATH_XOTCLCONFIG, [ + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + if test x"${no_xotcl}" = x ; then + # we reset no_xotcl in case something fails here + no_xotcl=true + AC_ARG_WITH(xotcl, [ --with-xotcl directory containing xotcl configuration (xotclConfig.sh)], with_xotclconfig=${withval}) + AC_MSG_CHECKING([for XOTcl configuration]) + AC_CACHE_VAL(ac_cv_c_xotclconfig,[ + + # First check to see if --with-xotcl was specified. + if test x"${with_xotclconfig}" != x ; then + if test -f "${with_xotclconfig}/xotclConfig.sh" ; then + ac_cv_c_xotclconfig=`(cd ${with_xotclconfig}; pwd)` + else + AC_MSG_ERROR([${with_xotclconfig} directory doesn't contain xotclConfig.sh]) + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_xotclconfig}" = x ; then + for i in \ + ${srcdir}/../xotcl \ + `ls -dr ${srcdir}/../xotcl-* 2>/dev/null` \ + ${srcdir}/../../xotcl \ + `ls -dr ${srcdir}/../../xotcl-* 2>/dev/null` \ + ${srcdir}/../../../xotcl \ + `ls -dr ${srcdir}/../../../xotcl-* 2>/dev/null` \ + ${srcdir}/../../../../xotcl \ + `ls -dr ${srcdir}/../../../../xotcl-* 2>/dev/null` \ + ${srcdir}/../../../../../xotcl \ + `ls -dr ${srcdir}/../../../../../xotcl-* 2>/dev/null` ; do + if test -f "$i/xotclConfig.sh" ; then + ac_cv_c_xotclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_xotclconfig}" = x ; then + for i in `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` ; do + if test -f "$i/xotclConfig.sh" ; then + ac_cv_c_xotclconfig=`(cd $i; pwd)` + break + fi + done + fi + + ]) + + if test x"${ac_cv_c_xotclconfig}" = x ; then + XOTCL_BIN_DIR="# no XOTcl configs found" + AC_MSG_WARN(Can't find XOTcl configuration definitions) + exit 0 + else + no_xotcl= + XOTCL_BIN_DIR=${ac_cv_c_xotclconfig} + AC_MSG_RESULT(found $XOTCL_BIN_DIR/xotclConfig.sh) + fi + fi +]) + +#------------------------------------------------------------------------ +# SC_LOAD_XOTCLCONFIG -- +# +# Load the tclConfig.sh file +# +# Arguments: +# +# Requires the following vars to be set: +# XOTCL_BIN_DIR +# +# Results: +# +# Subst the vars: +# +#------------------------------------------------------------------------ + +AC_DEFUN(SC_LOAD_XOTCLCONFIG, [ + AC_MSG_CHECKING([for existence of $XOTCL_BIN_DIR/xotclConfig.sh]) + + if test -f "$XOTCL_BIN_DIR/xotclConfig.sh" ; then + AC_MSG_RESULT([loading]) + . $XOTCL_BIN_DIR/xotclConfig.sh + else + AC_MSG_RESULT([file not found]) + fi + + # + # The eval is required to do the TCL_DBGX substitution in the + # TCL_LIB_FILE variable + # + AC_SUBST(XOTCL_VERSION) + AC_SUBST(XOTCL_MAJOR_VERSION) + AC_SUBST(XOTCL_MINOR_VERSION) + AC_SUBST(XOTCL_RELEASE_LEVEL) + AC_SUBST(XOTCL_LIB_FILE) + AC_SUBST(XOTCL_BUILD_LIB_SPEC) + AC_SUBST(XOTCL_LIB_SPEC) + AC_SUBST(XOTCL_STUB_LIB_FILE) + AC_SUBST(XOTCL_BUILD_STUB_LIB_SPEC) + AC_SUBST(XOTCL_STUB_LIB_SPEC) + AC_SUBST(XOTCL_SRC_DIR) +]) + Index: xotcl/COMPILE =================================================================== diff -u -N --- xotcl/COMPILE (revision 638782f84b31e4ebfd00529381e280c70f9950bc) +++ xotcl/COMPILE (revision 0) @@ -1,125 +0,0 @@ -$Id: COMPILE,v 1.2 2004/08/17 10:12:54 neumann Exp $ -******************************************************** -XOTcl Compilation Guide (Unix) -******************************************************** - -Note, that there is a file "COMPILE.win" describing Windows compilation. -Read this file, if you plan to build XOTcl under Windows. - -First, you have to get the necessary sources: - - Before you can start, you have to get the full sources of - XOTcl. These are packed in a tar.gz file, like xotcl-XXXXX.tar.gz, - and they are available from: - - http://www.xotcl.org - - - To compile XOTcl the sources of Tcl (and optionally Tk) are - needed. Tcl (and optionally Tk) must be installed properly. You get - the Tcl/tk sources from: - - www.tcl.tk - - The best is to unpack and compile Tcl (and optionally Tk) in the - same directory as XOTcl, so that XOTcl's configure can find it - automatically. For compilation instruction see Tcl's documentation. - - -The following steps have to be performed in order to -build XOTcl: - - 1) untar XOTcl in a directory of your choice by using one of: - - gunzip < xotcl-XXXXX.tar.gz | tar -xvf - - - or on some systems: - - tar xvfz xotcl-XXXXX.tar.gz - - - 2) run configure by issuing in the unix directory: - - cd xotcl* - ./configure - - on some platforms (e.g. under Windows Environment with - CygWin) you may have to type in "sh configure" explicitly. - - If you have Tcl, Tk, and XOTcl built in your home directory - and you want to install in standard locations, a simple configure - without arguments should be sufficient. You - can avoid searching/override the settings with - the follwoing switches: - - --prefix=DIR Place where lib/packages are - to be installed (default: /usr/local) - --exec-prefix=DIR Place where xotclsh/xowish - are to be installed (default: /usr/local) - --with-actiweb Build Actiweb packages as well (sdbm, expat) - (per default deactivated) - --with-xotclsh Build xotclsh (per default deactivated) - --with-xwish Build xowish (per default deactivated) - --with-gdbm=GDBM_INCLUDE_DIR,GDBM_LIB_DIR - absolute path to gdbm.h and optionally - the path to the gdbm library. The directory infos - may be omitted - --with-tcl=DIR Where to find a compiled Tcl version, i.e. - where to find tclConfig.sh - Note that you need a source built of - Tcl (including generic/tclInt.h)! - --with-tk=DIR Where to find a Tk version, i.e. - where to find tkConfig.sh. An installed - version is sufficient. It must be the same - Tk version as the version of the used Tcl. - --with-tk-include=DIR directory containing the public Tk header files - --with-all Turns on all options (actiweb, gdbm, - xotclsh, xowish) - - NOTE: the directories specified by DIR should not be addressed relatively: - be sure to use only absolute path names - (those starting with "/") only. - - NOTE: Tcl (and Tk if you build xowish) have to be installed. You - require a Tcl source build (of the same version as installed) - as well. - - Example: - - ./configure --prefix=/usr --exec-prefix=/usr --with-all --enable-threads - - 3) now you can make XOTcl and the configured packages with - - make - - which should be actually a GNU make (sometimes called gmake). - - There are a couple of compiler options, that can make the compiled - binary faster. On a Pentium 4 PC under Linux, i would recommend - to compile with - - make CFLAGS_DEFAULT='-O3 -mcpu=i686 -Wall -fomit-frame-pointer' - - 4) install with: - - make install - - - If you only want to build/install xotcl/xowish without packages - you can switch to xotcl-XXX directory and do there: - - ./configure - make - make install - - You can test XOTcl by switching to the src directory and by running: - - make test - - -Good Luck! - -Please report bugs and problems to the authors under one of these -mail adresses: - - uwe.zdun@wu-wien.ac.at, zdun@xotcl.org - gustaf.neumann@wu-wien.ac.at, neumann@xotcl.org - Index: xotcl/COMPILE.win =================================================================== diff -u -N --- xotcl/COMPILE.win (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/COMPILE.win (revision 0) @@ -1,77 +0,0 @@ -$Id: COMPILE.win,v 1.1 2004/05/23 22:50:39 neumann Exp $ -******************************** -XOTcl Windows compilation guide: -******************************** - -- Consider to get a binary distribution of XOTcl from: - - http://www.xotcl.org - -- XOTcl compiles with the Visual CC Compiler - -Visual CC Compilation: -********************** - -In order to compile with VCC the following steps have to be performed: - -1) Get tcl/tk sources, compile tcl and/or tk, and install them properly. - To compile XOTcl the sources of Tcl (and optionally Tk) are - needed. Tcl (and optionally Tk) must be installed properly. You get - the Tcl/tk sources from: - - www.tcl.tk - - For compilation instruction see Tcl's documentation. - -2) Set the PATH environment to the Tcl binary directory. For instance - in the DOS box you may write something like: - SET PATH=c:\Progra~1\Tcl\bin;%PATH% - where "c:\Progra~1\Tcl\bin" is the Tcl binary directory. - -3) Before you can start, you have to get the full sources of - XOTcl. These are packed in a tar.gz file, like xotcl-XXXXX.tar.gz, - and they are available from: - - http://www.xotcl.org - - Untar the xotcl source. You can do it using a program like Winzip - or with the tar command (e.g. in the cygwin distrbution). - - Change into the win directory. - - cd win - - Open the file "configs.vc". Edit the - first lines with the path information for your system, i.e., where - to find tcl and tk sources and where to find the VCC compiler, and - where tcl/tk binaries are installed. - -4) In the 'win' directory, invoke: - - nmake -f makefile.vc - - to compile xotcl.dll, XOTclSdbm, and Expat. - Moreover, package information and XOTcl documentation will be built. - - You can build the xotclsh/xowish (per defaul deactivated), if you - need them: - - nmake -f makefile.vc xotclshells - - -5) Optionally, you may test the XOTcl build: - - nmake -f makefile.vc test - -6) Now you can install XOTcl with: - - tclsh83 installWin.tcl - - More installation notes can be found in the README file. - - -Please report bugs and problems to the authors under one of these -mail adresses: - - uwe.zdun@wu-wien.ac.at, zdun@xotcl.org - gustaf.neumann@wu-wien.ac.at, neumann@xotcl.org Index: xotcl/COPYRIGHT =================================================================== diff -u -N --- xotcl/COPYRIGHT (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/COPYRIGHT (revision 0) @@ -1,41 +0,0 @@ - * XOTcl - Extended OTcl - * - * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) - * - * (a) Vienna University of Economics and Business Administration - * Dept. of Information Systems / New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - Index: xotcl/ChangeLog =================================================================== diff -u -N --- xotcl/ChangeLog (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/ChangeLog (revision 0) @@ -1,3334 +0,0 @@ - -2007-10-12: - * Release of XOTcl 1.5.6 - -2007-10-09: - * More fixes for treating gobal volatile objects - during shutdown: - - do not allow to create new objects during shutdown - - do not allow objects to be set volatile during shutdown - - handle cases, where application level destroy methods - fail (this could lead to remaining tcl traces pointing - to destroyed objects) - - handle namespaced variables helding deletion traces - for volatile objects - Guess, it would be much simpler to use Tcl-level - unset traces than C-level unset traces... - -2007-10-04: - - * Revise fix below. The problem was apparently that change of a - call of Tcl_FindCommand to Tcl_GetCommandFromObj(), where the - latter one had bad side-effects when it is called during - deletion. Although the fix below fixed the symptoms, the new - approach is better since it is apparently not required any more - to fetch the cmd during PrimitiveODestroy to ensure it is not - called twice. The problem appeared in XOTcl between 1.5.3 and - 1.5.4 and happens only in 8.4.* Tcl. - - * Improve debugging code to make it easier to trace - problems with Tcl_Objs. - - * Serializer: Added dependency rule in serializer to ensure slots of - superclasses are listed before subclasses. (Thanks to Stefan - Sobernig for reporting the problem) - - * Serializer: moved deactivation of traces into "Serializer all" - to get simpler results on "o serialize". - - * Regression tests: extended tests to address - the newly identified and fixed problem cases. - -2007-09-29: - * Fix for Tcl 8.4.16 (and maybe some other recent tcl 8.4.* - versions, 8.5 is fine) for situations, where Tcl variable - contain references to deleted XOTcl objects. The fix added a - epoch increment to CallStackDoDestroy(). - -2007-09-29: - * Fix for cases, where volatile objects are - deleted before the corrsoponding trace variable. - -2007-09-18: - * Release of XOTcl 1.5.5 - -2007-09-18: - * Fix rpm build (most probably due to TEA 3.6) - -2007-09-13: - * Use AssocData instead of the clientdata of the - global namespace to store the XOTcl interpreter's - -2007-09-13: - * Upgrade to TEA 3.6 - -2007-09-10: - * Make forward option -earlybinding more robust, when - forwards are done to Tcl procs - -2007-08-16: - * Fix introspection problem for copied objects and classes - (remove superfluous ::xotcl::initProcNS) - Must have been a bug from before XOTcl 1.0 - - * Allow to load XOTcl compiled for Tcl 8.4 to be loaded - into a tclsh8.5 (again, substantial change). - The behavior can be turned off by setting - FORWARD_COMPATIBLE to 0 - - One can now test now 4 versions: - a) a native version for Tcl 8.4 (without compatibility layer) - b) a native version for Tcl 8.5 - c) a version compiled for Tcl 8.4 with compatibility layer in tclsh8.4 - d) a version compiled for Tcl 8.4 with compatibility layer in tclsh8.5 - - Tests showed that the overhead is for the compatibility - layer is between 1.1% and 2.3%, the difference between - tcl8.5 and tcl8.4 is much larger. - -2007-08-10: - * Release of XOTcl 1.5.4 - -2007-08-10: - * fixed regression test in rdf-tests (introduced - due to autoname changes in 1.4.0) - -2007-08-10: - * Fixing bugs introduced by VarReform - * Extending regression test to handle the cases - -2007-08-07: - * More work on Tcl 8.5 and VarReform - Compiles now with stock Tcl 8.5 from CVS - * Make more use faster Tcl_Obj based interfaces - (Many thanks to Miguel Sofer for the suggestions and patch) - -2007-08-06: - * Changed all references to /tmp to [::xotcl::tmpdir] to honor - TMPDIR TEMP TMP if set - - * Handling of variable traces in serializer: - traces might require a different topological sort, - which is hard to handle. Similar as with filters, - we deactivate the variable traces during initialization. - This happens by - (1) replacing the XOTcl's trace method by a no-op - (2) collecting variable traces through collect-var-traces - (3) re-activating the traces after variable initialization - - (Many thanks to Stefan Sobernig for the help!) - -2007-08-05: - * Changes to compile xotcl with the new Var structures in the - head version of Tcl 8.5. This is a rather large change, - the patch is more than 800 lines. - - (Many thanks to Miguel Sofer for the help!) - - From the Tcl Changelog - - *** POTENTIAL INCOMPATIBILITY *** (tclInt.h and tclCompile.h) - Extensions that access internals defined in tclInt.h and/or - tclCompile.h may lose both binary and source compatibility. The - relevant changes are: - - 1. 'struct Var' is completely changed, all acceses to its - internals (either direct or via the TclSetVar* and TclIsVar* - macros) will malfunction. Var flag values and semantics - changed too. - - 2. 'struct Bytecode' has an additional field that has to be - initialised to NULL - - 3. 'struct Namespace' is larger, as the varTable is now one - pointer larger than a Tcl_HashTable. Direct access to its - fields will malfunction. - - 4. 'struct CallFrame' grew one more field (the second such - growth with respect to Tcl8.4). - - 5. api change for the functions TclFindCompiledLocal, - TclDeleteVars and many internal functions in tclVar.c - -2007-07-27: - * fixed a compile problem with a superfluous semicolon in a macro - (Many thanks for Andreas Kupries for reporting and sending a patch) - * fixed two compiler warnings in gcc 4.1.2 - -2007-07-23 - * Pre-Release of XOTcl 1.5.4 - -2007-07-23: - * fixed a bug with empty argument names - (Many thanks for Stefan Sobernig for reporting the bug) - -2007-07-03: - * allow to call methods from the class to be called - from slot objects (Many thanks for - Nico L'INSALATA for noting this problem). - -2007-06-05: - * Fixed spelling mistakes in the tutorial - (Many thanks to Robert Hicks for reporting) - -2007-05-27: - * Fixed potential error with default values for parameters - starting with a "-". (Many thanks to Shishir Ramam - for reporting) - -2007-03-16: - * fixed a bug where a Tcl call adds a namespace to an object, - but xotcl did not notice it. (Many thanks for Stefan Sobernig - for reporting the bug) - -2007-01-14: - * fixing error message propagation for methods called via - configure. (Many thanks for Kristoffer Lawson - for reporting the bug) - -2006-12-12 - * changing "test == " to "test =" as required by FreeBSD - (many thanks to Martin Matuska for providing - the patch) - -2006-12-07 - * MinGW patches - (many thanks to Martin Matuska for providing - the patch) - -2006-11-25 - * Release of XOTcl 1.5.3 - -2006-11-24 - * provided compatibility with Tcl 8.5 - (checking callframe level instead of empty varframe for toplevel - frames) - - * provided compatibility with Tcl 8.4.14 - proc->cmdPtr was used in prior releases only to determine the - namespace in which the proc is executed (documented in - tclInt.h). Starting with Tcl 8.4.14, this cmdPtr is used as - well for updating the client data of a cmd, in case the proc is - recompiled. Since XOTcl used the cmdPtr to control the - namespace, this code had to be rewritten differently. The new - version is faster, but uses for filters or mixins slightly more - storage. - - * reduced calling overhead of methods with nonpositional arguments - by about 10 percent by avoiding shimmering. - - * fixed handling of "return -code break" from xotcl methods - (thanks to Artur Trzewik for the bug report) - - * library/comm/Access.xotcl: fixed handling of chunked encoding - -2006-09-29 , Uwe Zdun - * Release of XOTcl 1.5.2 - -2006-09-28 - * Extended regression test for nested contains - * fix potential bug in copy-command with c-level client data - (don't copy commands with client data for the time being, rely on - introspection) - -2006-09-27 - * Fixed memory corruption (accessing feed memory) in the - invalidation of transitive mixins (many thanks to Don Porter for - reporting it and providing suggestions, how to trigger the bug - via Tcl memory debug) - * Removed c++ style comments (many thanks to Andreas Kupries for - reporting) - * package xotcl::trace: allow to trace objects with "Trace add - trace " not only classes as before (many thanks to jima for - suggesting this) - * fix for nested -contains with new (many thanks to Stefan - Sobernig for pointing this out) - * Added a target test-nohttp for automated regression tests - on machines with firewalls (used for FreeBSD build system) - -2006-09-26 - * xotcl.c: improved portability for 64bit AMD on FreeBSD (and - maybe on other 64bit platforms as well) all vararg lists are now - terminated by ..., (char *) NULL Previously, some were - terminated by an integer typed zero-value, which can lead to - problems when sizeof(int) != sizeof(char *) - * The vararg interface is used by the following API calls in the - XOTcl code: Tcl_AppendResult(), Tcl_AppendStringsToObj(), - Tcl_VarEval(), XOTclVarErrMsg(). all occurrences are fixed. - * All occurrences of Tcl_AppendResult() removed form xotcl.c - -2006-09-24 - * xotcl.c: make sure, that no - Tcl_SetIntObj(Tcl_GetObjResult(interp), 1); - happens on shared objects. - -2006-09-22 , Uwe Zdun - * Release of XOTcl 1.5.1 - -2006-09-22 - * XOTclNextCmd() exported to external (stub) interface, to allow - applications to call next without going through a Tcl_Eval() - (Many thanks to Scott Gargash for the constructive discussions) - * removed XOTclGetSelfObj() again from the external interface - since the object/class is passed anyhow. - * some minor cleanups and additions to tutorial. - * added small fix mentioned in c.l.t for a more backwards - compatible old parameter interface. - -2006-09-21 - * Changed interface of XOTclCallMethodWithArgs to contain the - specified number of elements in objv[] rather than the absolute - number. Changed name from XOTclCallMethodWithArg to - XOTclCallMethodWithArgs - * Added XOTclCallMethodWithArgs() to he external interface to - allow C applications faster invocation of XOTcl methods - * Simplified and standardized calling conventions for - C-implemented methods. ClientData receives always the - XOTcl_Object, no matter, what client data was specified during - registration (e.g. XOTCL_NONLEAF_METHOD). Users - can rely on using ClientData for Objects - * Some performance improvements in invocation of XOTcl methods - -2006-09-20 - * added XOTclGetSelfObj() to he external interface to obtain the - current object from a C application from the callstack - * fixed genstubs target in Makefile.in regenerated all stub files - * removed a few more compiler warnings for the power64 bit - architecture - -2006-09-19 - * added XOTCL_NONLEAF_METHOD: This constant - must be used fwhen registering C-implemented methods - that call "::xotcl::next" to push the XOTcl activation record. - - Example: - XOTclAddIMethod( interp, MyClass, "mymethod", MyMethod, - XOTCL_NONLEAF_METHOD, 0 ); - -2006-09-18 - * fixed a bug in parsing nonpositional arguments, when - e.g. square brackets are used in type declarations for - parameters. - Class C - C instproc foo {{-q:mult[2],optional 1} -x:boolean,optional args} {puts hu} - Tcl lists add another layer of braces - ... foo {{{-q:mult[2],optional} 1} -x:boolean,optional args} .... - which have to be removed at the definition time of the parameters. - * fixed a 64-bit problem for POWER5+ machines - * fixed serializer to handle deeper stratification layers - * fixed an autoname crash under NT - (Many thanks to Mark Jannsen for the patch) - -2006-09-17 - * fixed a bug in deprecated part, when -setter is used in parameter - options. - -2006-09-15 - * Changed "test -e" to "test -f" in Makefile.in, since - the standard test command in Solaris does not understand "test -e" - (Many thanks to Andreas Kupries for reporting) - -2006-09-14 , Uwe Zdun - * Release of XOTcl 1.5.0 - -2006-09-13 Uwe Zdun - * Update of build files for windows - -2006-09-10 - * added method "contains" to create objects aggregated into - other objects (essentially a value added back-port of the OpenACS - version). - * based method "slots" on method "contains" for improved orthogonality - * rearranging sections in the tutorial - * deleted obsolete sections from the tutorial - * serializer: when an object is defined as exported, export the whole - object tree (no need to specify export of all slots for exported objects) - -2006-09-08 - * added -verbose to forward options - * added subst to the tcl-impored methods - * fixed a bug with .... -slots {Attribute new -name a1} - (Many thanks to neophytos for reporting} - * provide method serialize (for Object), when the serializer package is loaded - -2006-09-07 - * provided Tcl 8.5a4 compatibility - * spellechecking langref, make terminology more consistent - (naming of arguments like .e.g methodName) - -2006-09-04 - * update of tcl.m4 for newest TEA from CVS - -2006-09-03 - * "mixin|filter|instmixin|instfilter set ..." deprecated, use - "mixin|filter|instmixin|instfilter assign ..." instead - -2006-09-01 - * fixed a bug in the xotcl trace module (many thanks to jima for reporting) - * extended procsearch to report parametercmd and instparametercmd - -2006-08-30 - * extended procsearch to report as well [inst]parametercmd - -2006-08-26 - * extended procsearch to report as well [inst]forward and [inst]cmd - -2006-08-25 - * new subcommand "info slots" - * implemented backwards bug-compatible "info parameter", deprecated - -2006-08-23 - * added system slots and attribute slots (see documentation) - -2006-08-21 - * changed the implementation of the configure command - and setrelation command to use Tcl_GetIndexFromObj(); - * added the subcommand "class" and "superclass" to the - the setrelation command. - -2006-08-22 - * fixed a bug with nonpositional arguments, some - positional arguments and "args" - * fixed a bug in nonpositional arguments when called without - arguments - * improved error messages in connection with nonpositional arguments - * extended interface of XOTclErrBadVal() to provide better error messages - (this changes the stub interface, so we have to change the version number) - -2006-08-21 - * new command for registering predefined C-implemented Tcl commands - as methods - ::xotcl::alias | \ - ?-objscope? ?-per-object? - "-objscope" has the same meaning as for forwarder, - "-per-object" has the same meaning as for the method "method", - This command is somewhat similar to "[inst]forward -earlybinding", - but can be used to bootstrap xotcl (when e.g. no methods are - available). - -2006-07-20 - * Documentation bug: method volatile was documented - as a method of class, but is documented as a method of object - (Many thanks to Kristoffer for reporting) - -2006-05-22 - * package.xotcl: evaluating calls to "tcl_package" in the - global namespace instead of the current. This fixes problem of - xotcl 1.4.* with xotclide. Many thanks to - Bill Paulsen and Artur Trzewik for identifying the problem and - suggesting a fix. - -2006-04-20 - * xotcl.c: new option for the argument substitution. When the argument - list of the forward command contains "%argclindex {a b c}", then - depending of the number of arguments at invocation "a", "b" - or "c" is substituted. - * New option for forwarder: The option -earlybinding can be used to look - up the function pointer of the called Tcl command at - definition time of the forwarder instead of invocation time. - This option should only be used for calling C-implemented Tcl commands) - -2006-03-22 - * deprecated command filterappend, instfilterappend, mixinappend, - instmixinappend, tclcmd, insttclcmd deleted - -2006-03-20 - * allow single colons in method names (fix in xotcl.c, NSTail()) - -2006-02-17 , Uwe Zdun - * release of 1.4.0 - -2006-02-17 - * fixed a bug with nonpositional arguments in connection with "args" - (Many thanks for Kurt Stoll pointing this out) - * added more regression tests - * fixed dependencies created for rpm binaries - * mak compile cleaner for gcc 4.* under linux - -2006-02-08 Uwe Zdun - * fixed a bug with transitive mixins - -2006-02-02 - * Upgrade to TEA 3.5 - -2006-01-10 - * fixing exit behavior with variable traces in multi-threaded - environments (volatile objects could be demalloced twice before) - -2006-01-08 - * allowing tcl commands and variables as default values for parameters; previously, - only one-word commands were allowed. - -2006-01-07 - * ::xotcl::configure options can be called with one (for query) - and two (for setting) arguments (similar to set) - * new option: ::xotcl::configure softrecreate on|off - if softrecreate is set, class relations (superclass, subclass, class, instances) - are not affected by a recreate; this allows files with class definitions - more easily to reload - * don't destroy namespace imported child objects - -2006-01-06 - * unsetting the global variable "cmd" from predefined.xotcl - (Many thanks to Koen Danckaert for reporting) - -2006-01-05 , Uwe Zdun - * fixing incorrect state in filters after next - * extended regression test - -2006-01-02 - * info children returns true children, no namespace imported objects/classes - * extended regression test - -2005-12-20 - * upgrading configure scripts of subcomponents to TEA 3.4 - -2005-12-17 - * fixing missing omitted message for unknown subcommand to self - -2005-12-07 , Uwe Zdun - * release of 1.3.9 - -2005-12-06 - * fixed bug with error propagation when gett/setter methods are - used for parameters (many thanks to Manfred Stelzhammer for - pointing this out) - -2005-12-04 - * Upgraded TEA to 3.4 - * updated rpm build (many thanks to Ildiko Schmidt and Alexander Bergolth) - -2005-11-28 - * new command ::xotcl::__qualify: convert an relative name - into an command name (exactly as create does it, ignoring - namespaces from transparent interceptors) - -2005-11-26 - * require automatically a namespace when a childobject is added - -2005-11-18 - * new switch -nocomplain for "mixin|instmixin|filter|instfilter delete" - to avoid error messages when deleting entries not there (similar unset) - -2005-11-10 - * " info vars" does not trigger read traces anymore - * fixing version numbers for package require - (many thanks to Andreas Kupries for the report) - * Serializer: exportMethods accepts forwards/instforwards now - as well - -2005-11-02 - * new subcommand of self: [self args] return the full argument list - of the current call - -2005-10-02 , Uwe Zdun - * release of 1.3.8 - -2005-10-01 - * fixed a bug concering __unknown called via mixin method - (many thanks to Zoran for the report) - * fixed a memory leak in isMetaClass() in connection with - instmixins (many thanks to Ben Thomasson for the report) - -2005-09-28 - * fixed bug in instvar (many thanks to Koen Danckaert for the report) - extended regression test - -2005-09-27 , Uwe Zdun - * release of distribution XOTcl 1.3.7 - -2005-09-26 - * new check option "switch" for non positional arguments. - If .... -somearg:switch is specified in the definition - of a method, this behaves like "boolean", except that - no additional argument is specified during invocation. - A default value of "off" can be turned on, as well as the - default value "on" can be turned off by specifying the switch - in an invocation. - -2005-09-25 - * defined an experimental method named "method" - * new global command "::xotcl::configure filter on|off" - to deactivate all filters for an interpreter. This is - needed for serializing code with active filters. - * Changed xotcl serializer to use "::xotcl::configure" - -2005-09-14 - * Fixing serializer to enforce methods on ::xotcl::Object or ::xotcl::Class - before other objects and classes - -2005-09-13 - * adding two package require into library files - (many thanks to Andreas Kupries for the report) - -2005-09-09 - * fixing various namespace issues in library files to make - regression test working again. - -2005-09-08 - * documentation and regressiontest for "self isnextcall" added - * added further regression tests, documentation improvements - * Httpd: changed classes - AccessControl BasicAccessControl - DigestAccessControl Responder - to Httpd::AccessControl ... Httpd::Responder - in order to reduce namespace pollution; applications - refering to these must use now these names - -2005-09-07 - * fixed callstack information for expr; old code could - believe (in connection with forward) to be in an uplevel when - a forward to expr was called. This could result in a wrong - result for [self].... - - * merged first bunch of files from Andreas Kupries to - make libraries more namespace clean. fixed a few namespace iusses - in the libraries. Many thanks to Andreas Kupries! - - * fixed refrence resolving in istype; the following works now the same - way: - C create c1 - c1 istype ::C - c1 istype C - -2005-09-02 - * code cleanup: removed ifdefs for TCLCMD - -2005-08-04 - * fixed instvar implementation when variable names - are empty strings (many thanks to Zoran for reporting this) - -2005-07-13 Uwe.Zdun@wu-wien.ac.at> - * new subcommand for self: [self isnextcall] - is true, if the current method was called via next. - This fixes the abstact method. - -2005-05-04 - * prevent new from overwriting an existing object - (increment further until unused name is found) - -2005-07-04 Jeff Hobbs - * providing update for configure - -2005-04-04 - * allow xotcl to be used in safe safe interpreters - - ~rlwrap /usr/bin/tclsh - % package req XOTcl - 1.3.7 - % interp create -safe slave - slave - % load "" xotcl slave - % slave eval ::xotcl::Object o1 - ::o1 - -2005-03-24 - * implemented resolving for references to classnames not - in the current namespace such that the following works - namespace eval foo { - Class M -superclass Class - } - without the need of specifying "-superclass ::Class" - - * implemented resolving for references to imported class names - such that the following works - namespace eval foo { - namespace import ::bar::A - Class M -superclass A - } - -2005-03-17 , Uwe Zdun - * release of distribution XOTcl 1.3.6 - -2005-03-16 - * extended semantics of meta class definitions: - old: - a meta class is either ::xotcl::Class or one of its - direct subclasses - new: - a meta class is either ::xotcl::Class or a class - inheriting from ::xotcl::Class - The subtle difference is that with the new definition - every class can be made to a superclass by adding an instmixin - of Class (or one of its subtypes) to it. Before this change - it was necessary to alter the Class hierary explicitely. - In order to define that every class should be a metaclass, - one can use now - Object instmixin Class - instead of the rather complicated solution i posted on the - xotcl mailing list not long ago. - - * new info subcommand: info precedence - * fixed possible crashes of objects are called with class methods - (e.g. due to instmixins) - * fixed bug when instmixins are defined recursively - (e.g. Class instmixin Class) - * code refactoring, fixed erroneous documentation of c code - * improved documentation in tutorial, als syntactically - such that htmldoc 1.8.24 works with it - * extended regression test, reduced dependency on tests - -2005-03-11 - * fixed bug noted by Kristoffer Lawson: - - Don't allow an object to be changed to a class via "o class Class" - - Don't allow an object to be recreated (without alloc) to a Class - * fixing the following command - namespace eval foo { - Class m - Object o -mixin m - } - such that m is resolved from the foo namespace. - The ::xotcl:: namespace is now skipped, since a - helper method that calles the primitive setting command - is defined there - -2005-03-01 - * improved documentation of next in langRef - -2005-02-23 - * fixed passing of error code from init methods - (thanks to Fabrice Pardo for noting it) - * returning PACKAGE_VERSION after a package require - (e.g. 'package req XOTcl' returns now 1.3.6) - -2005-01-15 , Uwe Zdun - * release of distribution XOTcl 1.3.5 - -2005-01-10 - * added instproc for ::xotcl::Class allinstances - to return all instances for the actual class - -2005-01-07 - * code cleanup for nonpos args - * new methods for Serialzer: - - Serializer methodSerialize (to serialize methods) - - Serializer exportMethods (to export methods from the - xotcl namespace via ::Serializer all - - Serializer exportObjects (to export Objects from ::xotcl::*) - * put Serializer into a namespace (::Serializer is auto-exported) - * fix for serializer, when xotcl is not imported globally - * aolserver: support for namespaced objects in xotcl.tcl - -2005-01-06 - * made introspection options for methods with nonpos args - compatible with Tcl - * adding functionality to allow nonpos args and positional args - to be specified in the same argument list (still supporting - the syntax with separate lists) - -2005-01-05 Uwe Zdun - * Added support for defaults + non-pos args in info args, - default, instargs, instdefault - * fixed bug: Check Boolean in non-pos args crashed with 2 args - -2004-12-15 - * fixed crash for empty arguments - (thanks to Gerald Stermsek for reporting this bug) - -2004-12-02 , Uwe Zdun - * release of distribution XOTcl 1.3.4 - -2004-12-02 - * changed metadata analyser from recursive to iterative - -2004-11-30 - * various fixes to improve portability - -2004-11-27 , Uwe Zdun - * release of distribution XOTcl 1.3.3 - -2004-11-20 - * fixed [self callinglevel] in nested uplevel loops - in the presence of filters, extended regression test - -2004-11-19 Uwe Zdun - * fixed bug: empty non-pos args, double dash alone. - Thanks to Bryan Schofield for reporting this bug. - Added tests. - -2004-11-18 - * changed internal communication between end-of-filterchanin - and "unknown" to flag instead of return code XOTCL_UNKNOWN - * fixed [self callinglevel] in nested uplevel loops - (many thanks to MichaelL@frogware.com for reporting the problem) - -2004-11-14 - * fixed yet another free memory read - (many thanks for Zoran for help with purify) - -2004-11-13 - * fixed entries for aolserver in configure.in - (many thanks for Zoran reporting this problem) - * fixed --enable symbols (many thanks for Zoran reporting this problem) - * fixed free memory read in namespace deletes - -2004-10-30 - * added error message when someone tries to delete a - non-existing proc/instproc - * using less memory for objects and classes with procs/instprocs, - when they do not use assertions (saving 14%) - * prettified langref with css - * documented deletions of object procs and instproc through - proc/instproc with empty args and empty body - -2004-10-13 - * make namespace handling code more orthogonal - * using resolver for exists method (might be used in future for - other methods as well) - * cleanup of dead code - -2004-10-09 - * fixed recreation bug in connection with namespace eval - * fixed exists for objects with own namespaces - -2004-09-20 - * Fixed bin-tar target to include sdbm+gdbm+expat - * Improved documentation (tutorial and langref) for forwarding options - * using $prefix in install-aol, provided a README.aol file - * more general fix for namespace handling; still possible problem - with shared Tcl_Objs of type XOTclObject, when referred to from - different namespaces. - -2004-09-15 Uwe Zdun - * fixed bug: non-pos args did not work correctly with default - values. Thanks to Bryan Schofield for reporting this bug. - Added tests for non-pos args + default values. - -2004-09-09 Uwe Zdun - * fixed possible accesses to object namespaces that got already - destroyed by TCL, by checking for ((Namespace - *)nsPtr)->deleteProc is not NULL, ie. it is still set to - XOTcl's Namespace Delete Proc, and not invalidated by - TclTeardownNamespace yet. add test for this to testx. Thanks - to Kristoffer Lawson for reporting this bug. - * fixed mis-formating in tutorial (only visible in browsers - other than Mozilla) - -2004-09-02 Uwe Zdun - * temporary fix for alloc behavior to deal with explicit namespace changes - by user, thanks to michael.heca@email.cz for reporting the - bug. Added a test for this change. - -2004-08-26 , Uwe Zdun - * release of distribution XOTcl 1.3.1 - -2004-08-26 - * removed dependencies on TclGetInterpProc(), added define - USE_INTERP_PROC if someone needs this. If nobody complains, - we will remove this in the future - -2004-08-22 - * fixed nonposargs, when used with checker procs and - spaces in arguments - * auto-generating docs in build tree (instead in - source tree) - * cleanup and documentation of somewhat confusing declations - in xotcl.h and xotclInt.h (XOTcl_Object and - XOTclObject) - * make tar makes distclean first - -2004-08-19 - * if configure is run outside the src tree the directory - structure is now built on the fly. All binary - output files are now placed in the built-tree. - -2004-08-18 - * added a regresion test for serialzer - * fixed a "last minute" bug in serializer - * configure changes: made subdirs relative to $srcdir, - set XOTCL_SRC_DIR to $srcdir to make build succeed - from outside dir - -2004-08-17 , Uwe Zdun - * release of distribution XOTcl 1.3.0 - -2004-08-17 - * fixing make for rpm - * tweaking configures stuff to work with rpm - -2004-08-16 - * adding two sections to tutorial, updated langref.xotcl - -2004-08-15 - * Adding non positional arguments to serializer - -2004-08-12 - * fixed a possible core dump when 'my' was called without - args (many thanks to Bryan Schofield for noting) - * some code generalization and cleanup - -2004-08-01 - * changes to forward and instforward: - providing positional arguments for the - forwarder. It is now possible to prefix the - arguments with "%@POS ", where POS can be a - positive or negative number or "end". A negative - offset can be used to address relative to the end - -2004-08-01 - * xotcl.c: calling __unknown when an object with an unknown - parent namespace is called (for handling nested object - classes in Zoran's ttrace package) - -2004-08-01 - * yet another fixed access to freed memory (when the configure - method returned a non numerical value, which was tried to be - converted into a number; setting refcounts properly helped. - (thanks to Zoran for his help with Purify ) - * minor code cleanup - * test with tcl 8.4.7 - -2004-07-29 - * changes to forward and instforward: - + %some-command executes some-command at invocation time and - substitutes result - + substitution extended to all arguments (also on callee) - -2004-07-28 - * yet another fixed access to freed memory - (thanks to Zoran for his help with Purify ) - -2004-07-26 - * fixed bug in filters in connection with instmixin; - inactive tcl callstack frame was dereferenced. This fixed as well - a potential uplevel bug - * fixed access to freed memory (thanks to Zoran for his help with Purify ) - -2004-07-23 - * implemented experimental next method for delegating same-named procs - to different objects - -2004-07-20 - * fixed a potential crash when a instmixin was registered on itself - -2004-07-19 Uwe Zdun - * added checkoptions to non pos args - * added tests & documentation of non pos args - -2004-07-18 jim@jam.sessionsnet.org - * Added file autogen.sh, to generate all configure files - * Added file autoclean.sh, to clean whole source tree, incl. configure - -2004-07-18 - * added removal of autom4te.cache to distclean - * make doc added to "all" target - * auto-generated html docs are removed in a make clean - * remove all *~ files in directory tree via find (ok with TEA3?) - -2004-07-11 jim@jam.sessionsnet.org - * revamped configure recursion - * added "--with-xotcl=" to child configure.ins - * arranged for root configure to call child configures specifying path - * located and fixed bug where parts of the build cannot find xotcl.h - if xotcl was not "make install"ed (bug implies build always finds - old includes) - * ensured "make clean" and "make distclean" still worked - * TODO: clean should remove emacs backup files - distclean should remove autom4te.cache - docs should be built during make, installed during make install - and removed from the build dir during make clean. - -2004-07-03 - * extended commands filter, mixin, instfilter, instmixin: - These commands are changed in a backward compatible manner. They - can be used as follows - - obj mixin same as: obj info mixin - obj mixin {C1 C2} same as: obj mixin set {C1 C2} - obj mixin set {C1 C2} sets the mixins for obj - obj mixin get same as: obj info mixin - obj mixin add C3 adds a mixin on front of the mixin list - obj mixin add C3 end adds a mixin at the end the mixin list - obj mixin add C3 3 adds a mixin at the 3rd position - obj mixin delete ::C3 removes the mixin from the mixin list - - The same semantics are available as well for filter, instmixin - and instfilter. - The implementation uses the forwarder and is extensible, new - subcommands can be added. As a side effect, the c-code was reduced - by 50 lines. - * the commands mixinappend, filterappend, instmixinappend and - instfilterappend were marked as deprecated and will be removed - in future versions - -2004-07-02 Uwe Zdun - * integrated support for non-positional arguments for procs - and instprocs - -2004-07-02 - * rename forward option -inscope to -objscope - * xotcl.c: added current namespace prefix, when a forwarder is - defined with -objscope and no namespace prefix was specified - * optimized forward/instforward such it reaches practically - same speed as tclcmd/insttclcmd. - * removed tclcmd/insttclcmd - * added tests for forward to regression test suite - * applied and fixed the config improvements by Jim Lynch - -2004-07-01 - * xotcl.c: allow literal %self, %proc, %1 etc. as arguments of the forwarder: - arguments in the definition of a forwarder proc - starting with two %-characters are changed into arguments starting - with one % - * xotcl.c: forced options to be placed in forward definition after - before - * xotcl.c: new info option for Object and Class: - info forward ?-definition? ?pattern? - list the defined forwarder for the class/object. - * Serializer.xotcl; Added handling of the forwarders to the serializer. - Therefore forwarders are kept in the serialized state. - -2004-06-29 - * changed name of delegator methods to forward/instforward - * removed most of the switches of the forwarder. We have now - - obj forward ?options? ?arglist? - where arglist might contain - * %self for inserting the forwarding object - * %proc for inserting the forwarding method - * %1 for using the first argument of the invocation - options might contain: - -inscope: evalute method in obj scope - -methodprefix: prefix, to be added in front of called method - (to avoid name clashes with methods like "set", "mixin" etc.) - -default list-of-methods: to be used in connection with %1, when there - are not enough arguments in the actual call. - -2004-06-24 - * fixed coredump for delegation to object without method specified - (many thanks for Bryan Schofield for the bug report) - -2004-06-20 - * removed inclusion of - * second version of delegator methods cmd and instcmd - - A delegator method is defined via - Class instcmd method COMMAND ARGS - a call to the defined method with some args - obj method arg1 arg2 arg3... - is mapped to - COMMAND ARGS arg1 INSERTTOKENS arg2 arg3... - - Class instcmd \ - ?-nocaller? \ - ?-nomethod? \ - ?-inscope? \ - ?-skip nr_of_tokens? \ - ?-insert tokens? - ?-prefix string? \ - ?-defaultmethod subcommand? \ - - where - methodname: name of an instcommand for the class - to be registered, - commandname: command that receives delegation - -nomethod: don't insert the callers method - -nocaller: don't insert caller after method - -inscope: evalute method in obj scope - -skip: skip n arguments from the call. "-skip 1" - means that not the "method" from the invocation is - used as the method call, but the first argument - -prefix: prefix, to be added in front of - called method (to avoid name clashes - with "set", etc.) - -insert: tokens to be inserted after the caller - - -defaultmethod: when number of arguments is not sufficient - to determine the called method, use the specified - value to be used as method name (only useful when - -skip is used and the arguments run out) - (e.g. [$obj info] be mapped to COMMAND showInfoOptions) - - -2004-06-18 - * added *.a to CLEANFILES in configure.in to rm stublibfile - on a "make clean" - * added subdir traversal for distclean - -2004-06-13 jim@jam.sessionsnet.org - * fixed make distclean target - factored list of configure output files into macro made sure - value of output files got through to make distclean target - -2004-06-12 - * changed namespace treatment in procs/instprocs - in provious versions, methods were evaluated in the - namespace where they are invoked. This has the problem that - either the xotcl primitives (next,my,self) have to be - prefixed in methods by ::xotcl::, or ::xotcl::* has to be - imported globally. Now, the instprocs are evaluated in the - namespace where they are defined. - * computing default prefixes in insttclcmd/tcllcmd for - not fully qualified commands - -2004-05-29 - * first version of instdelegatecommand - - * defined metaclass ::xotcl:.SelfApplicableClass to allow - for instprocs of this class to be applicable for itself - (useful for delegation objects) - - * first version of ::xotcl::relations - (for relations between objects and classes and for - inter-class-relations) - -2004-05-22 - * fixed path for installing files in Makefile.in - (many thanks to Jeffrey Hobbs) - * fixed path searching in xotcl.m4 - -2004-05-07 - * fixed compile problems under HPUX - (with the help of Attila Dona') - * fixed some compiler warnings in tcl-expat showing up - (some are still missing) - with -Wall -Wconversion -Wno-implicit-int - -2004-04-30 - * removed duplicates from results from [obj info methods] - * fixed GENERIC_HDRS in configure.in and Makefile.in - * fixed documentation bugs for "info children" and - "info classchildren" - * fixed an incorrect error message, when method called - from a mixin was not found. - -2004-04-25 - * alloc returns name of created object - * On an "Object create ::o1 -noinit" the noinit option - deactivates the search for default values - (as used in the serializer) - * TEA3 changes: - - re-included xotclConfig.sh file in xotcl dependent - libraries - - fixed variable contents in xotclConfig.sh file - - passing of include and spec file for gdbm - -2004-04-10 - * start to move to TEA3 - * moved tcl scripts xotclsh and xowish into apps/utils - * made minimal build independent from tclsh; - new target libraries-pkgindex, fulldoc, doc removed - from default targets - * at least for the time being, no static shells - -2004-03-23 - * added a flag --with-aolserver3 to configure and removed - the checking of the current directory to determine whether - or not to compile an AOLserver 3.* module. Thanks to Jim - Lynch to suggestion it. - -2004-03-03 - * fixed a potential crash in procSearch method (Thanks to - Artur Trzewik for the good error report) - -2004-02-29 - * callMethod* calls DoDispatch instead of ObjDispatch - * adding a callStackPush() for XOTclOEvalMethod() such that - 'o eval self' returns '::o' - -2004-02-21 - * added link to XOTcl wiki to xotcl homepage. - -2004-02-20 , Uwe Zdun - * release of distribution XOTcl 1.2.0 - -2004-02-17 Uwe Zdun - * fixed a Tcl_Obj ref count free that was called too early. - * fixed support for Visual CC debugger - * fixed Win version info - -2004-02-16 - * fixed a reference to a structure of a destroyed object - -2004-02-16 Uwe Zdun - * added self class and self proc context to GuardCall - * removed guardedScope and info guardedlevel completely - from the code - -> use parameters instead (see tutorial) - * rewritten the tutorial text for mixin/filter guards completely - * added new files to Win makefile.vc - -2004-02-14 - * experimental new command "self guardedlevel" as replacement - for getGuardedScope - * added documentation for self callinglevel, self - activelevel and the methods upvar and uplevel - * used a bold font for predefined Tcl and XOTcl words - in the HTML version of the tutorial - -2004-02-13 - * xotcl.c more code cleanup: - - some minor performance improvement - - used the same idiom for iterating over a class - hierarchy consistently - - simplified the usage of ComputeOrder() and let - the optimizer do more work - -2003-02-04 Uwe Zdun - * xotcl: removed MixinRemoveFromMixinStack, - MixinRemoveFromCmdPtr, MixinRemoveOnObjFromCmdPtr, - FilterRemoveFromFilterStack, - FilterRemoveFromCmdPtr, FilterRemoveOnObjFromCmdPtr ... and - replaced with simple forward stepping in cmd list. - * made the mem count work with multi, single-threaded interpreters - -2003-02-03 Uwe Zdun - * testx: tests for CmdListReplaceCmd, MixinRemoveFromMixinStack, - MixinRemoveFromCmdPtr, MixinRemoveOnObjFromCmdPtr, - XOTclOGetGuardedScopeMethod, XOTcl_InterpObjCmd, - XOTclOVwaitMethod, - * xotcl: removed XOTclAssertionRename, - simplified XOTcl_RenameObjCmd - * corrected mistakes in tutorial code for filterguards. - -2004-01-31 - * performed coverage analysis of regression test - * changed unsuccessful branches into asserts - * extended testx.xotcl for better coverage - -2004-01-28 - * Streamlined code; removed mixinChainOn from mixinStack and - filterChainOn from filterStack and use callstack - frameTypes instead. - * some performance improvements - -2004-01-27 - * implemented uplevel method - (uses [self callinglevel] when no level specified) - * fixed a bug in next, when methods on the same object are called - from within a mixin class and filters are defined - * some performance improvements - -2004-01-19 - * added more test cases, - * upvar method fully functional - * simplified CallFrame management on XOTcl stack - (wish, CallFrame had ClientData !!!) - * Reduced size of XOTclCallStackContent - * modularized xotcl more (new file xotclShadow.c; all shadowing - of Tcl commands and access of global tcl obj commands is - treated there) - * included a fix from Zoran for thread exit handlers. - -2004-01-16 - * defined upvar method (uses [self callinglevel] when no level - specified) - * simplified stringIncrement method and added a couple of - assert(). - -2004-01-15 - * allow volatile to be called from toplevel - * decrementing refcount of global objects as needed - (some had a high increment) - -2004-01-14 - * method 'new' now uses stringIncrement, which replaces the name - generation based on numbers by a name generation based on - strings. The strings are constructed by small and capital - letters plus digits and correspond to a number of a number - system with the basis of 26+26+10=62. These strings can grow - up to memory size. XOTcl can run as a server practically - infinitely long generating objects with 'new'. - - * new package xotcl::upvar-compat - This package provides backward compatibility with earlier - versions of xotcl that redefined upvar/uplevel such that - these commands ignore inactive filter and mixin frames - (upvar behaves the same whether or not a filter is - installed). Newer scripts should use - upvar/uplevel [self callinglevel] var/command - instead. This package can be used via - - package require xotcl::upvar-compat - - * moved resetting of shadowed tcl commands after the deletion - of object (as suggested by Zoran) - -2004-01-11 - * all occurrences of uplevel/upvar equipped with - [self callinglevel] such that library works with standard - uplevel/upvar - * faster version of 'new' method (more than 20% faster, - using c-variable, faster long to ascii conversion) - * objinst (of oo-bench) about 17% faster - -2004-01-10 - * polished macros XOTcl_FrameDecls, XOTcl_PushFrame, - XOTcl_PopFrame (2 versions, slower version with less - dependencies on tclInt.h) - * removed mixinCalls and filterCalls from interpreter state. - * removed unneeded macros - -2004-01-08 - * fixed bug on exit, when no threads are enabled - (different cleanup strategy in threads) - * fixed crash on deleted Tcl_Cmd, when xotcl debugging output - is turned on - * some more code cleanup - -2004-01-07 - * removed varFramePtr from xotcl callstack - * removed unneeded variables from runtime state - * resetting of csc->callsNext after a next call - * added "methods" to info info - -2004-01-06 - * cutting of callframes removed completely - * 2 new subcommands for self: - - self callinglevel: returns the tcl stack level to address - the invocation of the actual method - - self activelevel: returns the topmost active stack entry - from the xotcl stack - Both commands return the absolute level number (syntax #n) - if called from an xotcl method or 1 if called from a tcl - proc. These subcommands are designed to be used in the form - of "upvar [self callinglevel] a b" - * Replaced C implementation of uplevel and upvar - (with callstack manipulation) by a simple Tcl proc that uses - [self callinglevel] as default level (if is was not called - with an explicit level). - * Extended test suite - * Changed all variables of type "Interp *" to "Tcl_Interp *" - and defined macros Tcl_Interp_XXXX to access component XXXX - * Changed all variables of type "CallFrame *" to - "Tcl_CallFrame *" and defined macros Tcl_CallFrame_XXXX to - access component XXXX - -2004-01-04 - * callstack manipulation reduced significantly - * speedup on xoRDF.test about 7% - * self callingobject/callingclass/.... refers always to - last invocation (ignoring next-chain) - * consequence: mixins and filters are transparent on the - callstack - * possible extension "self previous ?n?" similar to "self next" - to obtain information about next chain - * possible extension "self level ?n?" similar to - "info level ?n?" to obtain information about call stack - -2004-01-02 - * Changed all variables of type "Namespace *" to - "Tcl_Namespace *" and defined macros Tcl_Namespace_XXXX to - access component XXXX - * generalized invocation on callProcCheck and - handling of calldata in new function DoCallProcCheck - * overall code cleanup - * extended test suite with tclmd and insttclcmd - -2004-01-01 - * fixed loop on invocation of methods registered by - the tclcmd method - * allowed to register fully qualified commands via - tclcmd or insttclcmd - * made insttclcmd to work from mixin or instmixclasses - * renamed "next" method to "__next" - * restored old behavior of defaultmethod - -2003-12-31 - * Changed all variables of type "Command *" to "Tcl_Command" - and defined macros Tcl_Command_XXXX to access component XXXX - * new predefined method self: [ self] returns fully - qualified name of object - * potential incompatibility: - calling an object without name does not return fully - qualified name, use "self" method (see above) instead. - To keep backward compatibility, define - Object instproc defaultmethod {} {return [my self]} - * New method " next" can be used to invoke next - on the last recent invocation of a method on . - must be on the callstack, otherwise an error message - is generated - * The new defaultmethod calls next on parent object to - prohibit shadowing of methods through sub-objects - -2003-12-28 - * new functions: CallStackUseActiveFrames()/CallStackRestoreSavedFrames() - to to avoid walking through and modifying the whole stack - when locating an active frame to set variables (using in - -volatile, instvar, info defaults) callstackcutframes still - used in info level, uplevel, upvar, info callingproc, - callingclass, callingobject - -2003-12-25 - * update of various library functions (such as Httpd) to - use sub-objects as methods (avoids calls of [self]::objname) - -2003-12-19 - * xotcl.c: allow to call sub-objects as methods via "my" - -2003-12-16 - * added logdir as parameter for Place (HttpPlace) - * fixed handling of content-length == 0 in Httpd.xotcl - to avoid Problem with microsoft explorer's WebDav queries - -2003-11-13 , Uwe Zdun - * release of distribution XOTcl 1.1.1 - -2003-12-13 - * Removed dependency that certain variable references in - tclConfig.sh (such as - TCL_SHARED_LIB_SUFFIX='${VERSION}${DBGX}.so'); There was a - problem on freebsd systems that use hardcoded "84" instead - of version in this definition, which leads to a problem when - the SHARED_LIB_SUFFIX is used with different VERSIONs (such - as in XOTcl). We set now the suffixes as follows - - eval "SHARED_LIB_SUFFIX=${VERSION}${TCL_DBGX}${TCL_SHLIB_SUFFIX}" - eval "UNSHARED_LIB_SUFFIX=${VERSION}${TCL_DBGX}.a" - - and pass it through xtoclConfig.sh to the c based - c-components (sdbm, gdbm, expat) - -2003-12-08 - * Some cleanup in tclexpat.c to make it compile on freebsd - * configure: made --with_gdbm configurable such that - include path and library path can be configured - * Httpd.xotcl: added simple redirects, can be used like e.g. - Httpd h2 -port 9086 -root /tmp \ - -redirect {^(mailman|pipermail|cgi-bin) - http://alice.wu-wien.ac.at>:80} - -2003-12-07 - * incorporated more fixes for build system suggested by Daniel - Steffen - * changed version number to 1.1.1 - * further cleanup in Makefiles, reduced redundancy in - distro by using symbolic links - * used everywhere for SHLIB_LD_LIBS XOTCL_BUILD_STUB_LIB_SPEC - instead of XOTCL_STUB_LIB_SPEC - -2003-12-06 - * httpd.xotcl: fixed return format in HTTP reply header - parameters Allow: and Public: for HTTP OPTIONS method - * library/store/XOTclGdbm/: fixed initialization of - xotcl stubs, usage of ck{free,alloc} vs. {free,malloc}. - * library/store/XOTclSdbm/: fixed handling of O_SYNC on - system that do not have it - * Configure can run now as well from outside of xotcl sources; - One can use now for example the following commands to - compile and install XOTcl - - % mkdir -p /tmp/xotcl/unix - % cd /tmp/xotcl/unix - % ~/xotcl-1.1.1/unix/configure --with-all - % make - % make test - % make install DESTDIR=/tmp - -2003-12-05 - * incorporated changes as suggested by Daniel Steffen - - using consequently DESTDIR for all directory references - - made procs in predefined.xotcl independent - from namespace import ::xotcl::* - - make references relative to $(srcdir) in all Makefile.in - -2003-12-02 - * added "--with-tkinclude" - * fixed "--with-tclinclude" to set TCL_INCLUDES (for all - subdirs) - -2003-11-29 , Uwe Zdun - * release of distribution XOTcl 1.1.0 - -2003-11-29 - * moved tcl command hooks into thread local storage - to fix a bug, when xotcl is loaded into a thread - * fixed various documentation bugs, added style files for - XOTcl tutorial, made presentation more uniform, made - distinction between literals and placeholders visible - * fixed a few issues with purify and mt (many thanks to Zoran!) - * some Makefile improvements (removed the need to generate - documentation on each run of make) - * Fixed compilation issues of expat with tcl 8.3 or younger - -2003-11-28 - * fixed include path for actiweb components (sdbm and expat) - * extended transparent mixins for upvar, uplevel - * extended regression test - -2003-11-27 Uwe Zdun - * added new version of Klaus' securePlaceDemo, some minor - corrections for new XOTcl version - * installed XOTcl library into lib directory under - windows instead of bin - -2003-11-26 - * removed ::xotcl::lib from predefined variables and from man - page - * added namespace require to xotclsh - * added transparent mixins for instvar - -2003-11-25 - * xotcl.c: further generalization of call stack entry - skipping; cutFrames can skip now over filters and/or mixins - * "Class new -volatile" works now through filters and mixins - * regression test updated - * reduced size of xotcl distro - * fixed various typos in language reference - -2003-11-22 - * xotcl.c: generalized cutting of call stack entries to - skip either filters or mixins - * "Class new -volatile" works now through mixins for create - * added test to regression test (testx) - * xotcl.c: some cleanup and speedup - * updated aol-xotcl.tcl (for loading xotcl into aolserver 4.0) - -2003-11-20 Uwe Zdun - * updated documentation: - - added a section "Integrating XOTcl Programs with C Extensions - (such as TK)" to the tutorial - - updated tutorial, readme, compile, compile.win - -2003-11-16 - * Httpd.xotcl: forced HTTP/1.1 requests over SSL - to use HTTP/1.0 due to a problem between OpenSSL - and certain incarnations of IE. - * Documenting requireNamespace in more detail. - -2003-11-13 Uwe Zdun - * various changes to support conditional shell building with - stubs - * various changes to build libxotcl/xotclsh with tcl 8.0 - (stub dependencies) - * Httpd.xotcl: added parameter to web server to - configure timeout for persistent connections - * eliminated a few compiler warnings from xotcl.c - -2003-11-12 - * removed namespace import/forget in predefined.xotcl - * Makefile cleanup (fixed duplicate dependencies, quoting in - loops) - * added tests for xoRDF and Persistence, when actiweb is - enabled - * building expat, when actiweb is enabled - * removed needless files from xotcl-distribution. - -2003-11-09 - * xotcl.c: fixed calling exit-handler twice for threads - -2003-11-06 - * xotcl.c: simplified handling of command substitutions; - starts to work with Zoran's nstrace.tcl for AOLserver - -2003-11-02 MichaelL@frogware.com - * XOTcl Stub lib configure files for C-based extensions. - -2003-11-02 - * XOTcl intercepts a few commands (info, rename, uplevel and - upvar) and assumed that these commands are defined in C. - Command intercepting was fixed such that intercepting - a proc info works as well; before xotcl produced a core. - Example: - % rename ::info ::tcl::info - % proc ::info args {uplevel ::tcl::info $args} - % package req XOTcl - -2003-10-31 - * Substituted config/config.sub and config/config.guess - (many thanks to Zoran) - * unix/Makefile.in fixed target install-aol - -2003-10-23 - * xotcl.c: new proc "__unknown" for Class; whenever - XOTcl references a class, which is not defined yet, - "Class __unknown" is called; this mechanism can be - used to autoload classes in a lightweight fashion - * fixes in the built system to avoid two different - "package ifneeded" (seems to cause troubles under - certain circumstances) - -2003-10-20 MichaelL@frogware.com - * Fixed the return value of TclExpatUnknownEncodingHandler - in tclexpat.c. The return value of the handler is now - correctly passed to expat. - -2003-10-14 MichaelL@frogware.com - * Changed library names on Windows to make library names more - similar across platforms. Changed xotcl.c and xotclStubLib.c - to support XOTcl stubs. Changed Windows Makefile.vc's to - build all libraries with XOTcl stubs by default. Changed - Windows Makefile.vc's to specify base load addresses for all - libraries. Fixed compiler warnings in winMain.c. Fixed - compiler warnings in tclexpat.c. - -2003-10-08 Uwe Zdun - * a number of changes to make XOTclSdbm and XOTclGdbm work - with xotcl.h solely ... in particular, introduced new stub - functions and Interface structs for XOTclClass and - XOTclObject: XOTcl_Class and XOTcl_Object. Changed XOTcl's - core to expose these in the extern functions that are - exposed via xotcl.decls. - -2003-09-10 Uwe Zdun - * Integrated bug fixes provided by Klaus Kolowratnik - for the secure http server. - -2003-08-27 Uwe Zdun - * moved config.vc, installWin.tcl to win dir and corrected them - * merged /makefile.vc and /win/makefile.vc; everything for win - now works from the win dir - * adapted other makefile.vc's in distro - * corrected stub table decls and auto generated table .h files - that where incorrect due to recent changes in external API - (XOTclRemoveClass, XOTclAddClass) - * corrected README - * added pkgIndex file for win local dir - * win version change to 1.1 - * corrected the wrong local TCLLIBPATH on unix from '$(TOP_DIR)' - to '$(TOP_DIR)/unix $(TOP_DIR)/library' to circumvent the win - dir on the auto_path - * added locale support to xotclAppInit - -2003-08-27 - * went with spell checker over tutorial and - fixed a hundred of typos - * fixed install of shells - * fixed optional built of xowish (TK_LIB_SPEC was not passed correctly) - * removed obsolete check_library_path in predefined.xotcl - * some fixes in ::xotcl::config mkindex for autoloadine files - -2003-08-26 Uwe Zdun - * doc for precedence order and transitive instmixins in - tutorial - -2003-08-25 - * Generate library/pkgIndex.tcl from configure - (contains version numbers) - * Fixed script for changing version numbers in xotcl - * Changed version of XOTcl to 1.1.0 - -2003-08-22 Uwe Zdun - * Added support for transitive instmixins in xotcl.c, - added test for transitive instmixins - * Various fixes for new build stuff on Windows - -2003-08-20 - * Fixed configure problem with autoconf coming with RH 9.0 - * Allow for the definition of parameters as objects. - It is now possible to have parameters with properties - (See tutorial, section "Objects as Parameter") - * fixed various bugs in the documentation. - MAKE TODO: make rpm, bin-tar, version-change, install-aol - -2003-07-13 - * Fixed potential crash with shared objects in configure - * First version of object tree creation via parameter - -2003-07-11 - * extended parameter handling code to support the creation - of parameter objects - * fixed a few documentation bugs - -2003-07-05 - * xotcl.c: if object is called without method and - arguments, xotcl calls now a method named 'defaultmethod'; - the default behavior (defined as an instproc on - Object) is that the name of the object is returned. - Example: - Object o - puts <[o]> ;# outputs <::o> - puts <[o defaultmethod]> ;# outputs <::o> - -2003-06-28 - * added --with-xotclsh and --with-xowish to create - shell optionally - -2003-05-28 Uwe Zdun - * added "info mixinguard" and "info instmixinguard" - * changed GuardList behavior to tolerate qualified names - * added tests for 'info instmixinguard' and 'info mixinguard' - * made -withGuard and -order work together for "info filter" - on objects. - * checked that guard is deleted, when redefined - with FilterAdd/MixinAdd - * add -guard modifier into filter, mixin definitions and infos - * updated tests - -2003-05-23 - * removed toplevel configure and Makefile for better - TEA compliance - (configure should be called from xotcl*/unix) - * added --with-actiweb to configure; - (use --with-actiweb=yes to enable it) - * standarized tests (using the same Test classes) - -2003-05-16 - * removed binary shells and XOTcl's context depending - auto_path setting; consequences: - - in order to invoke xotcl before installation, use - export TCLLIBPATH=`pwd` - in XOTcl's build directory - - instead of using the environment variable XOTCL - (as described in this Changelog on 2001-01-08, - use TCLLIBPATH - * Two small tcl scripts "xotclsh" and "xowish" are provided - for backward compatibility with xotclsh applications - * For interactive use, adding - package require XOTcl; namespace import -force xotcl::* - into your ~/.tclshrc is recommended - * Various changes and simplifications in configure and Makefiles - * XOTclGdbm: fixed it such it works with enable-threads without - crashing immediately - -2003-05-12 Uwe Zdun - * removed various bugs in new code and added tests for - redefinition and removal of filterguards - * added tests for 'instmixinguard' and 'mixinguard' - -2003-05-11 Uwe Zdun - * added new methods 'instmixinguard' and 'mixinguard' - -2003-05-09 Uwe Zdun - * changed the filter, mixin, and guard code to provide a new - composition strategy for (filter- and mixin-)guards, in - case a guard is defined more than once for the same filter - or mixin... now only the most specific guard counts, all - others are overridden by this guard. Example: - Class B -superclass A - A instfilter {{f2 {[self] == "::b2"}}} - B instfilter {{f2 {[self calledproc] == "set"}}} - Here: for an instance of B only the guard on B counts. - * updated the tests accordingly - * performance improvement: - removed ::xotcl::Object from mixin full list computation - * added new tests for mixinguards to testx.xotcl - -2003-05-03 - * xotcl.c: Changed mixinlist creation from quadratic to linear - (both, in XOTclAddClass and CmdListAdd) - -2003-04-29 - * xotcl.c: cleanup to avoid potential crashes on error messages - (varargs not terminated by NULL) - * introspection for mixin guards (o|cl info instmixin|mixin - -guards) - * new option for info methods to return only those methods where - the guard holds in the current context (info methods - -incontext) - -2003-04-25 - * fixed various typos in examples in tutorial - * first implementation of guarded mixins - -2003-04-24 Uwe Zdun - * document "info instdefault" in the language reference - * corrected a problem with move: it did not prevail the - subclass relationships; also added a regression test - -2003-04-22 - * xotcl.c: calling the "create" method from - the "new" method through the dispatcher (previous version - used a direct call, now create can be overloaded) - -2003-04-17 Uwe Zdun - * Unified ListObjChildren and ListClassChildren into one - method ListListChildren - -2003-04-16 - * xotcl.c: fixed segfault from classchildren - (many thanks to Michael Cleverly for pointing this out) - -2003-04-16 - * xotcl.c: Fixed passing of error codes from constructors - (instproc init). In previous releases, errors were - ignored - * xotcl.c: Passing correctly error messages from "set" to the - XOTcl set method. - -2003-03-19 , Uwe Zdun - * release of full distribution XOTcl 1.0.2 - -2003-03-19 , Uwe Zdun - * release of full distribution XOTcl 1.0.2 - -2003-03-19 Uwe Zdun - * changed requireNamespace so that contents of a - Tcl Namespace with the same name as the XOTcl Namespace to - be created survive the requireNamespace invocation & added - tests in testx.xotcl. Example: - namespace eval a {proc o args {puts o}} - Object a -requireNamespace - ### -> a::o survives - * some minor issues to everything work with tcl/tk 8.4.2 - -2003-03-08 , Zoran Vasiljevic - * some more code cleanup (do not abort when my is called outside - the scope of an object) - * Makefile less verbose - -2003-03-07 - * Made output of the serializer more compact - (omitting unnecessary references to ::xotcl::Object - -2003-03-07 Uwe Zdun - * Copy/Move to self had undefined or wrong results; corrected - both methods so that the objects stay untouched when copied - or moved to self. Added test in testx.xotcl. - -2003-03-04 , Zoran Vasiljevic - * Made xotcl capable to be loaded via "package require" into - aolserver-4 - * To build and install XOTcl for the aolserver-4 - the following commands can be used - - # cd /usr/homes/zv/tmp/xotcl-1.0.2 - # CC=gcc;export CC - ./configure --enable-threads --prefix=/var/tmp/aolserver \ - --enable-symbols --without-tk --without-gdbm \ - --with-tcl=/usr/homes/zv/dev/tcl8.4.1/unix - # make - # make install-aol - - This installs libxotcl*.so, the serializer, and the file - xotcl.tcl into aolserver/modules/tcl. The file xotcl.tcl - contains a "package require XOTcl" and "... serializer" and - sources the files aolserver/modules/tcl/*.xotcl - -2003-03-04 - * xotcl.c: abort, when a non-threaded xotcl version - is loaded into a threaded environment (e.g. aol-server) - -2003-02-28 - * xotcl.c: fixed a bug the lead to a crash in "self x" - -2003-02-20 - * fixes to compile xotcl as a module for aolserver-4 - -2003-02-06 - * made -volatile a method rather than an option of the - new method - -2003-01-18 - * aol-server adjustments (fix the documentation - for new directory structure, update serializer code, testing) - * provided simple replacements for xotclsh and xowish scripts - in the unix subdir for testing purposes (not yet installed) - -2003-01-17 Uwe Zdun - * new directory structure with no version information - * removed pwd from make.xotcl - * new method "ismixin": Test whether the argument is a - mixin or instmixin of the object. - * new method "hasclass": Test whether the argument is either - a mixin or instmixin of the object or - if it is on the class hierarchy of the object. - This method combines the functionalities of - istype and ismixin. - * documented and tested new methods. - -2003-01-12 - * Changed calls in the form of "[self] method" to "my method" - in 59 files in the xotcl distribution - * changed Serializer to use [list] in configure where necessary - -2003-01-09 - * configure methods can be placed into a list to avoid - ambiguity of "-". This character is used as a meta-char to - denote method names, but it has to be used in values as well. - Example: - Class Book -parameter {title author} - Book b1 -title "--the title--" -author a.b.c - has to be written as - Book b1 [list -title "--the title--"] -author a.b.c - Note, that XOTcl allows us to provide multiple arguments - to methods called via configure - -2003-01-05 - * configure returns now the number of preceding elements - without a "-" in its first place. This is needed - for convenient processing of argument lists with trailing - options from tcl. - * avoid processing configure list twice in c code. - -2002-12-29 - * some cleanup in c-code (to make -Wall slient) - * fixed a bug in the "all" method of the Serializer, changed - package name to "xotcl::serializer" - -2002-12-27 - * removed deprecated methods "parameters", "applymethods", - "newChild", "newChildOf" - -2002-12-23 - * release of full distribution XoTcl 1.0.1 - -2002-12-22 - * xotcl.c: some cleanup - * aol-server: improved namespace.tcl (using Serializer) - -2002-12-19 - * New Serialzer: - - up to 30% faster recreation of objects - - more control of objects or variables to be omitted - - provide mappings for (relative) object names - In general, the Serializer - - is used to generate the blueprint of a workspace - (e.g. in the aolserver) - - can be used migate objects between threads - - to cache objects in the aol-server - For details, see doc. - -2002-12-18 - * xotcl.c: new predefined method 'noinit' - can be used to create an object without calling its - constructor (used in the serializer to recreate objects - from a snapshot) - -2002-12-17 Uwe Zdun - * installWin.tcl: correction for patchlevel - * changed version to 1.0.1 - -2002-12-14 - * xotcl.c fixed a bug in "info default arg var" and - "info instdefault arg var" in connection with filters. - The output variable was created in the filter frame. - Many thanks to Oumung Mehrotra for reporting the problem. - * New switch for compilation USE_ASSOC_DATA to use Tcl_AssocData - instead of namespace client data for the runtime state - (without assoc data, 10-15% faster) - -2002-12-06 Uwe Zdun - * changed recreate semantics: recreate now calls the cleanup - method; so that one can preserve object information in the - recreate, call next (and do the cleanup), and finally handle - the correction for recreation. - * tutorial: added example of structure preserving recreate and - updated langRef.xotcl accordingly - -2002-11-22 - * fixes in documentation - * automatic generation of pdf files and make target - for the tutorial and the language reference - -2002-11-19 - * fixes for configure for aolserver 3.5.* - -2002-11-13 Uwe Zdun - * correct check for XOTcl lib on auto_path in predefined.xotcl; - it was checked for xotcl$VERSION, should be xotcl$VERSION - -2002-11-08 -2002-11-08 Uwe Zdun - * Win makefile.vc: let nmake install call the install script - * removed "class" hook from recreate ... - * updateding AOL-server patch and README - * finshing rpm and bin-tar generation - * release of full distribution XoTcl 1.0 - -2002-11-06 Uwe Zdun - * let the Unix Makefile also (try to) cleanup Win->Release dirs - -2002-10-30 Uwe Zdun - * fixes for tcl 8.0.5 - -2002-10-28 Uwe Zdun - * used a proc for exit handler (instead of Object variable), - old interface for exitHandler does still work - * eliminated a mem leak in FilterFindReg as indicated by - Zoran. - -2002-10-26 - * xotcl.c: fixed problem with external symbol for - cmdType and reactivated KEEP_TCL_CMD_TYPE for all - tcl versions - -2002-10-25 Zoran Vasiljevic - * xotcl.c: fixed memory leak for new method. - -2002-10-23 Uwe Zdun - * Object instproc extractConfigureArg: get one configure argument - (and possibly cut it) from a given args list. Especially used in - create before init is called with next to get args - before the object is actually created (& documentation). - -2002-10-22 Uwe Zdun - * used Tcl's Assoc structures for runtime state - -2002-10-21 Uwe Zdun - * corrected "abstract" next handling in predefined.xotcl - -2002-09-19 - * xotcl.c: prevent duplicate destroy calls during cleanup - * xotcl.c: error in exit handler does not panic anymore, but - writes to stderr (panic can't be used when exit handler - is called by a thread) - * Serializer.xotcl: {Serializer all] return exit handler - as well. - -2002-09-14 - * Trace.xotcl: fixed typos in documentation code, changes - for "my". - -2002-08-29 Uwe Zdun - * corrected findXOTcl.c: it got confused by an toplevel - XOTcl dir, like: ~/xotcl-1.0/x/xotcl-full-1.0 and didn't find - the libs then. - -2002-08-27 Uwe Zdun - * disabled KEEP_TCL_CMD_TYPE for 8.4, as it did not compile for 8.4b1 - -2002-08-04 - * Httpd.xotcl: order directories before files in directory - listings - -2002-07-18 - * Httpd.xotcl: fix for handling broken links - -2002-07-12 Uwe Zdun - * Win fixes for compilation with Tcl 8.4b1 - * fixed mem leak of filter search - -2002-07-10 - * fixes for compilation with Tcl 8.4b1 - -2002-07-06 - * Fixed a compilation bug concerning Tcl 8.2 and younger - -2002-05-30 - * xotcl.c: fixed destroy bug, when object was destroyed - during init - * xotcl.c: minor cleanup - -2002-05-16 Uwe Zdun - * xotcl.c: searching filter start commands again, if order is - invalidated. Otherwise filter commands of de-registered mixins - persist to be a filter. If no other filter or instfilter with - the name is found, the filter entry is removed from the filter - list. - -2002-05-15 Uwe Zdun - * COMPILE: an explicit sentence in the beginning that you need - Tcl/Tk sources to compile XOTcl. - * xotcl.c: FilterSearch has only search for object-specific - filters in the object's current order ... that was a bug. It - has to search for filters on mixins and instmixins as they are - specified by filter and instfilter. fixed. - * xotcl.c: Filter application order was: object filters -> mixin - filters -> class filters. Corrected to mixin filters -> object - filters -> class filters. Now it conforms to the order on - normal dispatches. - * xotcl.c: changed fatal abort to error, when self is called - without an active object - -2002-05-05 - * fixed UTF-8 conversion for filenames - -2002-04-30 - * Httpd.xotcl: minor cleanup (removed superfluous instvars) - * xotcl.c: removed incr/decr refcount on cl-names in DoDispatch - -2002-04-21 - * fixed a bug in path settings: - when xotclsh was called from an xotcl source directory where - no libxotcl*.so was located (e.g. before a compile) an error - was produced during load; xotclsh checks now whether it can - locate the .so file before setting the path. - -2002-04-20 Uwe Zdun - * fixed a bug in filter code (recursion blocking) - -2002-04-20 - * Http client code: fixed several small bugs: - - url composition - - error handling - - redirects to different ports - -2002-04-09 Uwe Zdun -2002-04-09 - * finshing rpm and bin-tar generation - * patch release of full distribution (0.9.4) - -2002-04-08 - * fixed a bug in copy/move (the constructor was called during - copying without instvars etc.; now the construcor is not - called here) Many thanks for Artur Trzewik for noting this. - -2002-04-08 Uwe Zdun - * fixed .add files for Windows - -2002-04-07 - * removed persistence dir in actiweb regression test to achieve - same behavior on each run of the test - * Storage.xotcl: fixed a bug when new persistence directories are - created - * fixed a small memory leak in autonames - -2002-04-05 - * defined the following policies for excplicit freeing in the - exit handler: - - NO_CLEANUP for processes, the physical free in the exit handler - is not needed - - CLEANUP for threads, just the xotcl classes/objects with - its instvars are reclaimed, annother - mechanism should take care of the global - procs and vars (automatically choosen, when - compiled with TCL_THREADS) - - FULL_CLEANUP for testing purposes, to check, whether xotcl - has memory leaks; all global procs and vars - are deleted as well. - -2002-04-04 - * fixed a bug with duplicated tcl_objs of XOTclObjectType - that could cause double frees. - -2002-04-02 - * Less agressive converison to tcl_objs of XOTclObjectType. - It will try to keep objects of type tclCmdType when - KEEP_TCL_CMD_TYPE is activated during compilation (default). - -2002-03-28 - * horrible bug fixed, when USE_ALLOCA or USE_MALLOC - was defined (macro substitution lead to wrong arithmetic). - These macros were defined for c-compilers that do not - support variable sized arrays as local variables. Gcc - were always fine, but e.g. under the standard AIX compiler - array boundaries were overwritten... I wonder, why we have - seen no bug reports, this bug was in since ages.... - -2002-03-27 Zoran Vasiljevic - * more code for volatile objects moved to C - -2002-03-26 - * Fixed a few more places, where recounted xotcl-objects - can cause troubles (mem-leaks + invalid pointers) - -2002-03-24 - * auto-deletion of global vars and proc to - get rid of references to xotcl-objects for deletion - -2002-03-20 Uwe Zdun - * added reference counts for xotcl objects to - avoid crashes for recreated objects (thanks for - Artur Trzewik for sending a good bug report) - -2002-03-11 Zoran Vasiljevic - * xotcl.c: fixed XOTclReplaceCommand for AOL-Server - (multi threading bug) - -2002-03-11 - * Httpd.xotcl: fixed relative pathname-bug for basic authentification - -2002-03-02 - * marked newChild as deprecated (use new -childof) - -2002-03-02 - * Changed name of selfdispatch to "my" - -2002-03-01 - * Httpd.xotcl: allow encoded characters in path and resource names - * Httpd.xotcl: use dictionary oder for directory listings - * Mime.xotcl: added some more default mime times - -2002-02-24 - * Httpd.xotcl: added functionality to provide directory listings - * Httpd.xotcl: create specified root directory if it does not - exist - -2002-02-13 - * Makefile.in: fixed a bug in make install - ("package require package" did not work) - -2002-02-12 - * HttpPlace: added Pragma no-cache for dynamic contents - * overworked persistence manager to separate storage - specific concerns (like directory checking) from generic ones - * new storage manager multi-storage to multiplex storage - requests to multiple sinks. - -2002-01-10 Uwe Zdun - * removed duplicated system library in library/system. The correct - one is in xotcl-XXX/library!! - -2002-01-09 - * fixed path determination code during - startup to avoid "cant read 'pf'" messages - -2002-01-08 Uwe Zdun - * introduced bcc (copy) database option for persistent databases and - configuration option for db file names and dirs in actiweb - places - * xotcl.c: found and fixed a small bug in unknown: - Object o; o r - with no unknown defined has looped (not for class -> unknown). - corrected it and added it to testx.xotcl - -2002-01-06 - * further improvement of bytecode compilation - * new bytecode instruction SELFDISPATCH - * methcall benchmar now more than 40% faster than in 0.9.3 - * some cleanup in xotcl dispatch code - * fixing external references for symbols not starting with xotcl - -2002-01-02 - * new xotcl byte codes for XOTcl primitives next, self, - and initProcNS. Speedup for the oo-shootout - + methcall 30% - + objinst 9% - some tests are now twice as fast than before, self is - now 10 times faster (about 1 microsecond on a 600 MHz PIII) - -2001-12-28 - * fixed changeXOTclVersion, made more generic - * fixed Agent migration, made all migrations synchronous - (for the time being) - -2001-12-17 Uwe Zdun -2001-12-17 - * finshing rpm and bin-tar generation - * patch release of full distribution (0.9.3) - -2001-12-10 Uwe Zdun - * removed two "! test" so that configures work with sh on Solaris - * added make bin-tar target - * removed all compiler warnings on windows - -2001-12-09 - * revived configure-code for aolserver, added patchlevel - to log message, updated aolserver README file - * renamed directory "script-creation" to "serialize" - * deactivated create of unneeded installed dirs - (xotclexpat, xotclgdbm, xotclsdbm) - -2001-12-07 Uwe Zdun - * documented recent changes in XOTcl for release - -2001-12-05 - * fixed call to unknown in copy method - -2001-12-01 Uwe Zdun - * xotcl.c: xotcl::interp rewritten - -2001-11/12 Uwe Zdun - * changed xotcl support a (more or less) TEA compliant - build process, use Tcl stub lib, and make shells - only shallow wrappers that load the XOTcl package - on demand - -2001-10-23 - * removed code for calling variable command - -2001-10-22 - * xotcl.c: fixed bug for empty superclass list - * fixed stub-install under 8.0.5 - -2001-10-20 -2001-10-20 Uwe Zdun - * patch release of source distribution (0.9.1) - -2001-10-20 - * reimplemented method 'new' of Class in C - * various cleanups for stub handling - * added regression test for stub library - -2001-10-18 Uwe Zdun - * removed linking glitch in 0.9: stub enabled lib was linked - with non-stub enabled obj-files. - * added a stub enabled lib to Windows make procedure - * renamed stub enabled lib to (lib)xotcl-tclstubs.(so|dll) - -2001-10-17 Uwe Zdun - * removed "can't instvar to link" problem during aliasing - to a link var - -2001-10-15 -2001-05-15 Uwe Zdun - * XOTcl 0.9 Release - -2001-10-14 - * new method of Object: parametercmd: - a convenient way to define a new getter/setter for - individual objects (similar to parameters for classes) - * polishing docu - -2001-10-11 - * improved make clean - * fixed incompatibilities in various - scripts distributed with xotcl - -2001-10-11 Uwe Zdun - * configure.in: fixed that --without-tk functions - ensured that user-defines with --with-tcl/tk - override found settings. - * xotcl.c: - - conditional for different TclIncrVar2 interfaces - in Tcl 8.05 and Tcl 8.3 - - added TCL_PARSE_PART1 to variable lookup in - GetInstVarIntoCurrentScope. TclLookupVar in 8.05 - requires it for looking up arrays with only part1 - given. - -2001-10-10 - * fixed autoname method for Tcl 8.0.5 - -2001-10-10 Uwe Zdun - * finished polishing mem leaks (thanks to Zoran Vasiljevic again) - * disallowed "[self] next" ... next is now only a command - * Gdbm,Sdbm,Expat: corrected Makefile.in to rely on - -L$(TCLLIBDIR) (thanks to J�rg Rudnik for the hint) - -2001-10-08 - * configure.in: fixes for AOLSERVER to ease configuration - * aolstub.c: fixes for namespace handling (XOTcl is - now a "well behaved" Tcl extension) - -2001-10-05 Uwe Zdun - * added PRESERVE and RELEASE functions for Tcl_Objs so that - we remember all Tcl_Objs that are temporarily allocated, - otherwise the ExitHandler would not free Tcl_Objs, like: - INCR_REF_COUNT(tclobj); - callaMethodContainingExit(); /* "exit" call */ - DECR_REF_COUNT(tclobj); /* not reached */ - * corrected filtersearch and procsearch to return the new - proc qualifier format: - proc|instproc - as a Tcl list. filtersearch does now operate on objs as well, - procsearch does support mixins now. Added tests for both. - * documented new features in tutorial and langRef - -2001-10-04 Uwe Zdun - * minor fixes to get WIN version to run again - -2001-10-03 Uwe Zdun - * removed some more mem leaks, - * reworked exit handler to destroy metaclasses and operate on a - instance list, instead of namespace cmdTable - * pop remaining callstack entries in ExitHandler to prevent - from false deletion order, if "exit" is called from within a - method - * changed XOTclErrInProc not to rely on obj/class Tcl_Obj* - so that we do not have to preserve them in DoDispatch - (mem problem) - -2001-10-02 Uwe Zdun - * added a optional simple mem counter functionality. DEFINE - XOTCL_MEM_COUNT so that you get a mem count dump after exit. - * removed some mem leaks - -2001-10-01 Uwe Zdun - * new info option "info methods" ... returns all methods (procs - and cmds) defined along the hierarchy for an object. - accepts modifiers: -noprocs, -nocmds, -nomixins - -2001-09-30 Uwe Zdun - * don't allow duplicates in filter/mixin structures (e.g. info - filter has returned "b c b", now the filter appears only - once. Filterguards are merged into one guard. - * new modifier "-order" for info filter and info mixin -> - returns order on a particular object, for filters with - syntax " proc/instproc " for mixins just a - class list - -2001-09-26 - * cleanup, removed a few bugs - * new instproc for Class: insttclcmd - creates an instmethod with the given name - that calls the Tcl command with the given name in the - variable environment of the object - * renamed instproc of Class parameteradd to: instparametercmd - * xotcl.c: more complete set of tracing options for debugging - * some speedups: - - instcommand array, append, lappend trace - are now more than 3 times faster than before - (through insttclcmd) - - condition checking (for pre and post conditions and guards) - is as well more than 3 times faster than before - * configure.in: made -Wall conditional for gcc - -2001-09-25 Uwe Zdun - * merge with - * xotcl.c: new XOTclObject member "flags", which - is a bitmap for various object states - (isClass, isDestroyed, etc.). Defined several - according macros XOTclObjectIsClass(obj), - XOTclObjectToClass(obj), etc. - * revitalized Tcl_Obj of type XOTclObj to speedup - access of Objects and classes by using - GetXOTclObjectFromObj - GetXOTclClassFromObj - (speedup of create by 15%, a few simple commands - are now more than twice as fast (Object isclass)) - -2001-09-20 Uwe Zdun - * xotcl.c: - - made objectData structure optional and moved - functions into file xotclObjectData.c - use XOTCL_OBJECTDATA to compile it in - - moved obj & cl clientDatas into optional memory, new extern - getter/setter functions: XOTclSetObjClientData, - XOTclGetObjClientData, XOTclSetClassClientData, - XOTclGetClassClientData. Used them in persistence store - wrappers xotclSdbm.c & xotclGdbm.c - * testx.xotcl: - - Added some obj filter tests - -2001-09-19 Uwe Zdun - * xotcl.c: - - added "opt" structures to XOTclObject and XOTclClass so that - optional info (filters, mixins, asssertion,...) is only - allocated on demand - - corrected bug ... search for epoched filter cmd in - FilterRemoveOnObjFromCmdPtr also in mixins - - added flags to XOTclObject instead of filterDefined, - mixinDefined, and destroyCalled shorts - -2001-09-18 Uwe Zdun - * xotcl.c: removed object reference code ... I guess we won't do - references this way - -2001-09-17 Uwe Zdun - * xotcl.c: added new instcommand "vwait" on object that mirrors - the behavior of Tcl's vwait, but does not operate on flag - TCL_GLOBAL_ONLY. The new xotcl obj var tables do not operate with - that. E.g.: - Object instproc vwait {varName} { - [self] instvar $varName - ::vwait [list $varName] - } - would wait for a global variable varName ... though: - Object instproc vwait {varName} { - [self] requireNamespace - ::vwait [self]::[list $varName] - } - should work ... - * xotcl.c: info classparent now returns object name of class, not - ::xotcl::classes*** - * xotcl.c: new method "objeval" on Object. It executes an command - in the scope of an object. This is an important convenience - method because something like: - Object instproc lappend {varName args} { - [self] instvar varName - eval ::lappend [list $varName] $args - } - is problematic if the object has a namespace and varName is an - array element ... then Tcl does want to upvar it (was also - present in all earlier xotcl versions ... we have used an - instvar alias then). Now we can do: - - Object instproc lappend {varName args} { - [self] objeval [concat ::lappend [list $varName] $args] - } - This is easier an faster than using an alias ... - -2001-09-16 Uwe Zdun - * predefined.xotcl: - - new method "trace" on Object ... simple forwarder to tcl's trace - - eliminated "cset" on Object and from the distribution, seems to - be nearly unused - * whole distr: - - replaced direct namespace variable accesses with [self] or - instvar accesses. Here's what I did: - (a) grep for <[self]::> - (b) grep for plus <::> together in one line - (c) grep for <}::> to get e.g. ${a}::b - that should find most occurrences of variable namespace access, - except for direct accesses like: set y::x, where y is an object - name and c a variable to be set. - -2001-09-15 Uwe Zdun - * xotcl.c: - - Namespaces of objects are now created only on demand, - that is when: - - obj proc is created - - obj command is created with XOTclAddPMethod - - child is created on the object - Note that this is a prominent change. Especially it saves a - significant amount of memory allocation per object. But you - cannot assume the existence of object namespaces anymore. - That means: - Object o - set o::var 1 - returns TCL_ERROR: parent namespace does not exist. Use - o set var 1 - instead. Same appears for append, lappend, trace, array and - other Tcl variable handling commands. - "info exists" is problematic because it does not return an - error message: - Object o - o set i 1 - info exists o::i - returns 0. - It is save to use all Tcl command together with instvar. - - - new method "requireNamespace" on Object. Creates an object - namespace explicitly. - - new info option "hasNamespace" on Object: returns 1, if the obj - currently has a namespace, otherwise: 0. - - eliminated "returnCode" on RUNTIME_STATE due to several bugs, - why was it there??? - -2001-09-14 Uwe Zdun - * xotcl.c: - - Changed XOTclCInfoMethod to be based on two switch statement - instead of ifs. Let List* functions return the state (such - as TCL_OK). - - introduced code for modifiers in info methods. Modifiers are - "-" options that change the behavior of an info method - - introduced -guard modifier for filter and instfilter (it - prints a filter list with guards) - -2001-09-13 Uwe Zdun - * xotcl.c: - - eliminated some flaws in filterguards - - forbid "new" filtering during checking a filterguard - -2001-09-06 Uwe Zdun - * xotcl.c: - - also allowed instfilters on a mixin class of an object - -2001-09-03 Uwe Zdun - * xotcl.c: - - bug corrected: filter correctly removed from all dependent - classes when filter proc is deleted or superclass is changed - - bug corrected: added cmdEpoch check on computation of full - filter/mixin lists - -2001-09-03 - * various cleanup and fixes due to new features - -2001-09-03 Uwe Zdun - * testx.xotcl: - - filterguard tests - * xotcl.c: - - bug corrected: filter order invalidation upon new proc/instproc - ... for filter inheritance - -2001-08-25 Uwe Zdun - * xotcl.c: - - new filter guards language construct for constraining filter - appliance - - introduced generic Tcl_obj* list instead of - XOTclAssertion*, - -2001-08-24 Uwe Zdun - * xotcl.c: - - CallStackGetFrame: iterate only over INACTIVE filters (was a bug) - - self filter & mixin infos: determine info position from - callstack with CallStackGetFrame, so that uplevel functions with - [self calling*,called*] - - NextMethod: passed XOTCL_UNKNOWN through at end of mixin/filter - chain, if no method was found. - * testx: added tests for these corrections. - -2001-08-23 Uwe Zdun - * xotcl.c and tests: added initProcNS command executed at - beginning of all XOTcl procs/instprocs ... it prevents from - jumping to the object's namespace, when a proc is opened. - Now: - namespace eval html { - Object o - o proc t {} {puts ns=[namespace current];li} - o t - } - results in: - li - ns=::html - - Now inside of a namespace, like ::Object, you can call global - methods, like ::set without preceding "::" ... - - => Incompatibility to former versions: direct XOTcl proc - calls, like: - Object rp - rp proc time {cmd time} {...} - rp proc x { - time "set x 3" t - } - are invalid ... you have to write: - rp proc x { - [self] time "set x 3" t - } - -2001-08-20 Uwe Zdun - * xotcl.c and all tests: moved Object, Class, and @ into ::xotcl - namespace, now - namespace import -force xotcl::* - has to be written at the beginning of each script to have - them in the global namespace. - - info options now return ::xotcl::Object, ::xotcl::Class, and - ::xotcl::@ - - direct sets and unsets of variable are not possible anymore: - "Object set a 5" functions, but not "set Object::a 5", - but "set xotcl::Object::a 5" is ok - -2001-08-20 Uwe Zdun - * xotcl.c and all tests: moved xotcl classes from ::XOTclClasses - to ::xotcl::classes - -2001-08-20 Uwe Zdun - * Actiweb -> made it run with new filter code ... what you have to - change on your existing code to make it run: - 1. change all invocations of "filter" to "instfilter" - 2. same for "info filter" to "info instfilter" - 3. same for "filterappend" to "instfilterappend" - 4. for all filters on metaclasses: you must not provide the - metaclass name anymore, the filter finds it - automatically, say, if you have a metaclass C and a - filter f, you had to write: - A filter C::f - now this is - A instfilter f - 5. replace regclass with [lindex [self filterreg] 0] ... - may be changed again - -2001-08-17 Uwe Zdun - * xotcl.c: integrated complete rewrite of filter code with - per-object filters - -2001-08-13 - * patch release of source distribution (0.85.3) - * following naming conventions of Tcl for minor changes - -2001-08-11 - * xotcl.c. predefined.xotcl: fast parameter inst-commands - * xotcl.c: new instcommand for Object: parameteradd - (to register the instcommand for parameters) - * xotcl.c: applymethods renamed to configure - * xotcl.c: small speedup for assertion checking - * xotcl.c: simplified set methods - -2001-08-09 - * fixes for actiweb (agent migration was broken) - * comm/Access.xotcl: a response to an HTTP-PUTS request should - not contain a body. If it does, Httpd complains shortly - and accepts it. - * mos/Agent.xotcl: fixed obsolete code (callcoder) - * mos/AgentManagement.xotcl: fixed broken RDF-interface - -2001-08-04 - * xotcl.c reduced size of XOTclObject structure from - 172 bytes to 68 bytes by allocating assertion - structures on demand and by deactivating per - default the old metadata structures - -2001-08-02 - * integrating AOL-server-changes from Zoran, solution for - threads, stublib and older tcl-versions - * improved stubs support - * generating a stub library src/libxotclstub.so - * AOL_DEFINES in Makefile (automatically activated - when xotcl is compiled within the source tree - of aolserver - * configure.in: using exec_prefix for platform dependent files - * new target: make libs (for AOL-server) - -2001-07-23 - * improved parameter support (see apps/scripts/parameter.xotcl) - * custom setter/getter methods - * xotcl.h: make it usable from C++ - -2001-07-13 Uwe Zdun - * TextFileStorage: bug in opening files with - TextFileStorage eliminated - * MemStorage: fix for Mem Storage to support lazy - persistence (mem store persists object destroy) - * Persistence.test: new test LotsOfObjects - -2001-07-13 - * patch release of source distribution (0.85-p2) - -2001-07-10 - * xotcl.c: first draft of new implementation of parameter - see apps/scripts/parameter.xotcl for a list of features - -2001-07-06 - * xotcl.c: fix for propagating special return codes through - next calls (e.g. ... return -code continue). - This is needed for Tk integration; - thanks to catherine letondal@pasteur.fr for - pointing out the problem - * Mime.xotcl: handling yet another file format for ~/.mime.types - -2001-06-21 Uwe Zdun - * fix for tclexpat in Tcl 8.2 versions - -2001-06-21 - * xotcl.c: more fixes for bug in copy/move for object - names with spaces - * predefined.h: fixes for xotcl methods for spaces in object - names (eval) - -2001-06-20 - * xotcl.c: fixes for bug in copy/move for object names - with spaces - * xotcl.c: reporting error codes when copy move does not work - -2001-06-13 - * AIX compatibility fixes (thanks to Adrian Wallaschek) - * improved portability - * easier export from bk - * Httpd.xotcl: added -ipaddr option to configure - IP-address of server - -2001-06-12 Uwe Zdun - * xotcl.c: fixed reference counting for volatile objects - -2001-05-01 - * patch release of source distribution (0.85p1) - -2001-05-30 - * new predefined method: newChildOf - -2001-05-28 - * HttpPlace.xotcl: added call to replyCode in front - of replyErrorMsg - * Httpd.xotcl: made httpd more robust in error cases - (invalid first line) - * ignore attic in tar - * xotclgdbm.c: faster exists test - * lib/xml/TclExpat-1.1/Makefile.in: better make clean - -2001-05-22 -2001-05-22 Uwe Zdun - * XOTcl 0.85 Release - -2001-05-15 Uwe Zdun - * xotcl.c: parameter defaults for (per-class) mixins are - evaluated upon creation - * tutorial: documented how to evaluate parameter defaults for - obj/class mixins - * win-files: adapted to new src directory tree - -2001-05-15 - * xotcl.c: fix for colon checking to determine parent namespace - * xotcl.c: Object and Class create returns absolute name (with leading ::) - -2001-05-15 Uwe Zdun - * xotcl.c: fix for checking in parent namespace - -2001-05-10 - * doc update (formatting, info instproc, ismetaclass and isclass) - * xotcl.c: argument for ismetaclass and isclass is now optional - * xotcl.c: checking for namespace parent in object creation to avoid crash - * Httpd.xotcl: fix for ie 5.5 under win98, - POST has not always contentlength set - -2001-04-14 - * xotcl.c: don't call unknown for dash-commands on class - objects to avoid errors like "Class C -superClass Object" - that lead to object creation in earlier versions - * first version of xoman - * Httpd.xotcl: new method replyErrorMsg; replyCode - does not produce HTML messages by itself - -2001-04-07 - * Access.xotcl: added :: in front of global objects, more robust - * using namespace for soap, implifying interface - -2001-04-03 Uwe Zdun - * xotcl::comm::httpd: added error code 500 {Server Error}, - errorReply hook in replyCode added to be able to prevent HTML - error response. - -2001-04-03 - * xotcl::comm::httpAccess: user-agent string more generic - -2001-03-27 Uwe Zdun - * xotcl.c: added inheritance feature for instinvars - * xotcl.c: standard cleanup now destroy aggregated children - * testx.xotcl: tests for both new features in xotcl.c - -2001-03-26 - * version number in xotcl references to allow multiple - xotcl-versions to coexist - * various changes to accommodate bitkeeper - * package.xotcl: fixes for argument passing - (thanks to Artur Trzewik) - * Httpd.xotcl: better error messages containing referer for - files which are not found on the server. - -2001-03-22 Uwe Zdun - * xotcl.c: "cleanup" does not receive args anymore - * xoXML.xotcl: used [self class] for parser autoname - -2001-03-19 - * removed dependencies form wafecompat - * Sccs support added to makefiles - * documentation for mixins updated - * decode POST moved before "respond" to ease overloading - ------------------------------------------------------------------------------ -2001-03-09 -2001-03-09 Uwe Zdun - * release of Version 0.84 - -2001-03-09 - * removed "exec date" from tests to ensure win compatibility - * fixed regression tests under win: don't use dependencies on - time-zones, fixed ordering problems and HTML bugs - -2001-03-08 - * fixed a few bugs in xodoc - * documentation for apps/utils/* - * package name xotcl::store::storage changed to xotcl::store - * PCache uses new Storage interface - * new predefined object ::xotcl::rcs to extract - info from RCS strings (methods date and version) - -2001-03-07 Uwe Zdun - * xotcl.c: Mutex patch for exit handlers in MT apps by - Zoran Vasiljevic - * xotcl.c: self next implemented ... enables callstack - information for the "next" method - * Persistent.test: bench test reduced to 272 - * tutorial/langref: documented new functionalities - -2001-03-06 Uwe Zdun - * htmllib.xotcl: integrated new version with HtmlBuilder; - thanks to Antti Salonen. - * package names: changed all package names to convention that - names are starting with lower cases. Separated names with :: - prefixes. For now, these names are just chosen to avoid name - clashes, in 0.85 they will probably be used as basis for a - hierarchical component model. - -2001-03-05 Uwe Zdun - * metadataAnalizer: split into dynamic and static variant (static - is used for xodoc - -2001-03-02 Uwe Zdun - * xotcl.c: moved callstack information (calledproc, calledclass, - callingproc, callingobject, callingclass, regclass) from - info to self; e.g. use in a filter instead of - [[self] info calledproc] - from now on - [self calledproc] - * testx.xotcl: integrated callstack information changes. - -2001-03-01 Uwe Zdun - * complete installation and test suite for Windows, i.e. doc, - packages, all tests, install, etc. now function on Windows - platforms - * XOTclSdbm ported to Windows - * Expat xotcl version running on Windows - * xotclsh.1, xowish.1 man pages added - -2001-02-27 - * new global variables for configuration and logging - ::xotcl::confdir ~/.xotcl - ::xotcl::logdir $::xotcl::confdir/log - * new script daemon.xotcl for starting/stopping - xotcl scripts in the background - -2001-02-22 Uwe Zdun - * xoDoc.xotcl, metadataAnalyzer.xotcl: added documentation and - handling for "abstract" methods, and corrected bugs in html - appearance - -2001-02-22 - * xotkAppInit.c: added static package Tk - -2001-02-22 Uwe Zdun - * splitted xodoc.xotcl into a generic static metadata analyzer - (metadataAnalyzer.xotcl) and the HTML documentation part - (xodoc.xotcl). - * htmllib.xotcl: incorporated fishpool's html lib for use - in xodoc; thanks to Antti Salonen. - -2001-02-17 - * Serializer.xotcl: new package for serialization of workspace - contents (Classes and Objects). Serialization of full - workspace: - Serializer s - s serializeWs ?filename? - Serialization of Object or Class - s serialize ObjectOrClass - * bugfix in mixins - * xotcl.c: tidying up - -2001-02-10 - * xotcl.c: some speed improvements - (next without args more than twice as fast due to moving - arguments to the stack, caching of stack pointers) - -2001-02-08 Uwe Zdun - ! xotcl.c: Removed mixin init logic. Mixin & instmixin inits - are only called if the mixin is registered for the object - during initialization. Beforehand "mixin" has called init, - when it wasn't called before. This was inconsistent with - behavior of class and instmixin. - -2001-02-06 Uwe Zdun - * xotcl.c, testx.xotcl, ...: tests for new destroy logic - -2001-02-04 - * xotcl.c: cleanup and various simplifications - ! using xotcl namespace for: - version, lib, check_library_path, - interp, trace, deprecated, mkindex, load, - namespace_copyvars, namespace_copycmd - potential incompatibility: use ::xotcl::version - instead of ::xotcl_version! - -2001-02-01 Uwe Zdun - * xotcl.c: new destroy logic with recreate - -2001-01-26 Uwe Zdun - * Persistence.xotcl: - - persistenceMgr now uses child object as storage - - persistent arrays bug fixed, lazy persistent arrays added - - added persistent arrays to test - -2001-01-25 Uwe Zdun - * xotcl.c: class redefinition logic instead of direct command - destroy added to solve destroy problems identified - by Kristoffer Lawson. - -2001-01-24 Uwe Zdun - * xotcl.c: fixed alias bug identified by Kristoffer Lawson. - -2001-01-22 - * fixed regression test for new path settings - * removed Unix dependencies from regression test (sleep) - -2001-01-18 Uwe Zdun - * all storages: added nextkey + firstkey methods - for traversal of DBs - -2001-01-17 Uwe Zdun - ! all packages: all internal distribution package names now - start with "xotcl::" to avoid name clashes with other - packages - -2001-01-16 Uwe Zdun - * XOTclGdbm: added XOTcl Gdbm wrapper - -2001-01-15 Uwe Zdun - * xotcl.c: alloc now handled as a Class instproc, like - create. Thanks to Kristoffer Lawson for the hint. - -2001-01-15 - * new Interface for persistent storage - - Class Storage - Storage abstract instproc open filename - Storage abstract instproc close {} - Storage abstract instproc exists key - Storage abstract instproc set {key ?value?} - Storage abstract instproc unset key - Storage abstract instproc names {} - -2001-01-12 Uwe Zdun - * Storage test suite added - -2001-01-09 Uwe Zdun - * Makefiles: generic makefile for expat, gdbm, ... in the - style of XOTcl's Makefile + fed by toplevel configure - * packages/store/XOTclSdbm: sdbm wrapper for XOTcl - -2001-01-08 - * The search for the XOTcl library is performed according to the - following rules: - - 1) If the environment variable XOTCL is set and points to a - directory, it is taken as the XOTCL directory. - - 2) If the auto_path (determined in part by the environment - variable TCLLIBPTH) contains a directory named "xotcl" - and it exists, it is taken. - - 3) If no xotcl library is determined yet, check - whether the current directory is in an xotcl source tree. If - yes take it. - - 4) If the auto_path contains a directory, that has a - sub-directory named xotcl, it is taken. - - 5) If the auto_path contains a directory that has a - directory named xotcl as a neighbor, it is taken. - - 6) Take the compiled-in path for the xotcl library. - - After the search for the XOTcl library the global Tcl - variable ::xotcl::lib is set to the determined directory. This - directory is added automatically to the ::auto_path if - necessary. - -2000-12-15 - * packages/make.xotcl: passing target to avoid grep - through Makefile - -2000-12-15 - * packages/make.xotcl: less verbose - * new environment variable XOTCL, points to directory - where the XOTcl library lives - -2000-12-13 - * packages...Httpd.xotcl: close connection after errors - * packages...Httpd.xotcl: elementary support for HTTP method - OPTIONS - -2000-12-04 - * xoXML: fix info vars - instvar method creates variable that is not accessible and - should not be listed in info vars - -2000-12-04 - * version changed to 0.84 - * xoXML: fix for multiple PCDATA calls after one element - ------------------------------------------------------------------------------ -2000-11-30 -2000-11-30 Uwe Zdun - * release of Version 0.83 - -2000-11-30 Uwe Zdun - * xoXML/xoRDF: added the ability to process mixed content PCDATA - (i.e. more than one pcdata in one element) - -2000-11-29 Uwe Zdun - * src/lib/soccerClub.xotcl: simple introductory example for - the tutorial - * xotcl.c: corrected assertion checking: built in commands that - affect assertions are not checked (check, info, proc, instproc, - invar, and instinvar). Otherwise we can not react on a broken - assertion in the error handler (& documented this stuff in the - tutorial). - -2000-11-29 - * tried to improve documentation tool - * work on xotcl homepage, manual section added - -2000-11-28 - * apps/actiweb-apps/univ/ added (example for RDF) - * packages/make.xotcl extended for test in apps directory - * HtmlPlace.xotcl: allowExit method added for HtmlPlace to allow an - actiweb place to terminate via URL (primarily for regression tests, - which require no kill anymore, now platform independent) - * Httpd.xotcl: logging of contains more detailed information - * HttpPlace.xotcl: added HTTP errors (invalid requests - for actiweb are correctly noted in log files) - -2000-11-28 Uwe Zdun - * xotcl.c: Removed theClasses/theObjecs hashtable, because they - caused some problems in exit handling (thanks to - Catherine Letondal for the hint), - * xotcl.c: fixed all remaining memory leaks in tests (thanks to Zoran - Vasiljevic for helping us out with purify) - * tutorial.html: added documentation for @ - -2000-11-27 - * src/Makefile.in: changed logic for building and - installing xowish - * xotcl.c: fixed bug in "info mixins" - -2000-11-24 - * Access.xotcl: overhaul, uses now exits method instead of - 'info exists' - * packages/xml/xml.xotcl: overhaul of the introductory XML-parser - example - * predefined.xotcl: new predefined method of Object: - vwait (Tcl semantics) - * some tuning to avoid speed penalties - * src/Makefile.in: added some dependencies - -2000-11-24 Uwe Zdun - * xotcl.c: removed internal mem leaks reported by dmalloc - * xotcl.c: corrected assertion checking for built-in commands, like set - * xotcl.c, xotclMetaData.c: put metadata into own file + - made them deprecated -> use @ instead - * testx.xotcl, testo.xotcl: used @ instead of metadata - * tutorial.html: reworked the tutorial, added instmixins - -2000-11-22 - * dmalloc defines added to Makefile.in - * xotcl.c: removed some mem leaks - -2000-11-22 - * documented various sample applications - * fixed problems with pipes for xocomm.test (should work now under - windows as well) - * polished output from xodoc - * extended sample webserver to return info about the current - request and provided means for stopping it remote. - -2000-11-22 Uwe Zdun - * configure.in: added ""'s around -z tests and added - --without-gdbm support - (thanks to Catherine Letondal for the hint) - * package/store/persistenceExample.xotcl added as a basic - persistence store example. - -2000-11-21 Uwe Zdun - * xotcl.c: corrected infinite loop in instvar assertions - (thanks to Zoran Vasiljevic for the hint) - -2000-11-20 Uwe Zdun - * xotcl.c/xotclInt.h: moved the global objects and a static - variable to interpreter structure (thanks to Zoran Vasiljevic for - the patches) - * xotcl.c correctes mem leak in "mixin" method - (thanks to Zoran Vasiljevic for the hint) - -2000-11-03 - * MimeTypes can be specified for certain filenames via - Mime set nameTable(ChangeLog$) text/plain - where the index is treated as a regular expression - * rpm target added to Makefile - * rpm files added to www.xotcl.org - * removed file installed to / from binary distribution - -2000-11-15 Uwe Zdun - * xotcl.c: corrected deletion order for aggregated children: - child destructor is called before parent's destructor - * Makefile.in: removed "-full-" from filename - -2000-11-03 - Various changes to HttpPlace.xotcl and Httpd.xotcl - * access control for HttpPlaces - * new instance variable "user" in Worker for authenticated requests - * access to ordinary files (and not only to WebObjects) from - HttpPlaces (if there is no object with the name of the file) - * worker added as a argument to credentialsNotOk - -2000-10-28 Uwe Zdun - * testx.xotcl: added tests for instmixins - -2000-10-26 Uwe Zdun - * xotcl.c: added instmixins - -2000-10-13 - * new global variable xotcl_version in analogy to tcl_version - * fixed parameter passing to init for multiple arguments - (not starting with a "-") - * added regression test - * fix bug for variable name aliasing in the instvar method - ------------------------------------------------------------------------------ -2000-10-09 Uwe Zdun - * prepared Version 0.82 - -2000-10-06 Uwe Zdun - * experimental tests for actiweb apps (invoke - with 'make test' at toplevel) - -2000-10-02 Uwe Zdun - * Documented xotcl.c + src/lib and src/scripts directories - -2000-09-29 Uwe Zdun - * xodoc.xotcl new XOTcl documentation package .. all docs - are now in file docs, with @ object - -2000-09-28 Uwe Zdun - !! xotcl.c removed aggregation short form due to incompatibilities - with unknown. I.e., - [self] Class x - does not function like - Class [self]::x - anymore, but triggers the unknown mechanism. - * removed bug: parameters have tried to call "-1" - default value as method - -2000-09-26 Uwe Zdun - !! src/xotcl.c: short form for creation of nested object and - classes removed. - * new documentation tool - -2000-09-22 - * new configure flags: - --with-gdbm=INCDIR,LIBDIR - --with-tk=INCDIR,LIBDIR - --with-tcl=INCDIR,LIBDIR - -2000-09-19 - * apps/actiweb-apps/FormsWithState.xotcl: - new example script for implementing a multi-page form - which keeps the state in a context object, which - is passed from form to form via hidden form fields - * new toplevel configure file - * toplevel "make install" copies demo apps as well - (should we set the path to xotclsh in first line?) - -2000-09-13 Uwe Zdun - * xotcl.c: added new format functionality to autoname. % - strings are now recognized as in the Tcl "format" - command. E.g.: autoname a%06d --> a000000, a000001, a000002, .. - - * rdf/xoRDF.test, rdf/RDFTriple.xotcl: used new autonames here - in order to make triples sort-able with lsort - -2000-09-12 - * Httpd.xotcl: Fixed a bug for IE5.5 with persistent connections: - (Server blocked); cause: the Tcl command "fcopy" alters the - blocking state of a socket when it finishes (bug in fcopy - of tcl 8.3.2) - -2000-09-12 Uwe Zdun - * xotcl/src: added xotclInt.h as XOTcl internal API - (still incomplete) - * xotcl.c: - - extracted xotclProfile.c, xotclReference.c, xotclTrace.c, - and xotclError.c from xotcl.c, - - started conversion to Tcl-like naming convention for - functions: XOTcl... for internal API, - XOTcl_... for external API - -2000-09-07 Uwe Zdun - * xoXML.xotcl: removed need for empty topNode - * xoRDF.xotcl/RDFTriple.xotcl: Uniform Parse Tree - - abbrev properties and parseType = resource are now parse - into descriptions - - class hierarchy uniformized to resources and properties - ... object names - are either prop.. or res.. - - resource types are stored in rdftypes variable - (as a list of types) - - Typed nodes are parsed into description + type - - namespace definition at RDF tag recognized - - hard coded "rdf:" removed (now rdfNSPrefix is stored on - each node, the parser has a rdfNamespace parameter) - -2000-09-06 - * packages/store/Persistence.xotcl: lazy open for - persistence database added (to avoid creation of not needed - files, when no persistent variables are used, and to reduce - permission problems for creation, opening, etc) - -2000-09-04 Uwe Zdun - * xotcl.c, Makefile.vc: INST_XOLIBPKG, XOTCLVERSION passed to - VC 6.0 preprocessor from Makefile.vc (thanks to David - LeBlanc for the fix) - -2000-09-04 - * xoRDF: trivial fix for make numbering of anonymous resources - easier to comprehend - * predefined.xotcl: methods "append" and "lappend" added - * xotcl/Makefile: keeps track of configure.in and reconfigures - if necessary (eg. version change) - * new -reset option for autoname (does currently not work with - -instance) - -2000-08-31 Uwe Zdun - * xoRDF: added subject ID to anonymous descriptions & fixed bugs - -2000-08-30 Uwe Zdun - * xotcl.c: fixed xotcltrace - * trace.xotcl: "deprecated messages" show* fixed - -2000-08-19 - * toplevel Makefile: target "make test" added - -2000-08-16 - * RDFTriple got a new method "prettyTriples" which uses - indentation to show connections between triples (used in xoRDF.test) - -2000-08-11 - * apps/xocomm/webserver.xotcl listens on port 9086 as well - to test basic access control - * packages/make.xotcl -test added - * Access.xotcl: fixes for credentials, timing for SimpleRequest now optional - (-timing 1, default is -timing 0) - * new files: packages/comm/xocomm.test, packages/rdf/xoRDF.test - * Ftp fixed for now Access methods - * "Class instproc newChild" and "Class instproc new" added - -2000-08-09 - * untested C-API placed between #ifdef - * dead code removed - * all internal calls to destroy handled by a single - function "callDestroyMethod" - * target "xref" added to xotc/src/Makefile - (needs free program xref to be installed) - -2000-08-08 - * new instcommand "exists" to check whether a variable - exists (no need to use namespaces or instvar to check - for the existence of variables) - * xotcl.c: using new macros - VarFrameDecls - VarFrameSwitchToObj(in,obj) - VarFrameRestore(in) - to change VariableFrames - (speedup mand making code more uniform) - * returning int objects instead of string objects - * using new features obove led to more than 20% speedup - on RDF benchmark. - * regression and speed test - xotcl/src/lib/speedtest.xotcl added - -2000-08-07 - * HTML Form interface changed, - form arguments are not longer appended to call - * new methods for WebObj: getWorker and getFormData - to access worker internals and form data - * some minor speed improvements - -2000-08-01 - !! more thorough checks for object names - (no ":", no "::", no ":[^:].+", no ".+:", no ".*NAME::[:]+NAME") - * copy and move methods create no invalid names that must be fixed - by Object creation - !! methods called via "-" syntax must start with an alphanum character - * Object creation 10% faster - * apps/actiweb-apps/MC.xotcl uses POST instead of GET - -2000-07-27 - !!! info children returns fully qualified object names - !!! info classchildren returns fully qualified object names - !!! info filter returns function names without class paths - * fixed composite attributes in RDF - * some speed improvements - * parameter passing from FORMs to WebObjects via parameter objects - * HtmlPlace has a default method that lists all exported objects - * Mime component added - * multipart-form data code added to Httpd - -2000-06-26 - * version number increased to 0.82 - * automated version number management - * test client and server for tls added - * minor changes for TLS - * minor fixes for Tcl 8.4a - * including certificates - -2000-06-20 Uwe Zdun - - * packages/mos/Agent.xotcl: - - migrate bug -- 'self' called after destroy of migrate -- - corrected - - support for synchronous invoke, clone, and migrate added in - addition to async methods - - * AgentClient/Receiver: example enhanced with class cloning and - sync invoke, clone, and migrate - - ------------------------------------------------------------------------------ -2000-06-05 XOTcl 0.81 Release -- Major Changes to Version 0.80 - - changelog started by Uwe Zdun - * xotcl.c: - - deep copy/move with all language features - - renamed "parameters" to "parameter" - - renamed "info filters" and "info mixins" to "info filter"/ - "info mixin" - - added deprecated error message - - added "xotcl_interp" command to start an XOTcl slave interp - - better "package" support and integration - - linearizing of per-object mixin hierarchy with ordinary - class hierarchy - - isobject, isclass, and ismetaclass with identical interface: - all have the obj/cls in question as argument - - reference tracing with "info reference", "info referencedby" added - - internal xotcl-lib now in predefined.xotcl -> make file - automatically creates predefined.h - * toplevel-configure added - * Actiweb: - - early alpha preview for code mobility, registry, web objects - added. be careful: the APIs will most likely change in the - future - - SSL Place - * HTTPserver/access: - - Open SSL support - * xoXML/xoRDF: - - RDF Typed Node support - - Parsing of several top nodes at once -> mixing of XML and RDF easier - - Tests integrated and several new tests - - XML/RDF recreation added - * xoStore: - - Support for tclgdbm added -- thanks to Stefan Vogel for - providing the Win version of gdbm Index: xotcl/Makefile =================================================================== diff -u -N --- xotcl/Makefile (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/Makefile (revision 0) @@ -1,676 +0,0 @@ -# Makefile.in -- -# -# This file is a Makefile for Sample TEA Extension. If it has the name -# "Makefile.in" then it is a template for a Makefile; to generate the -# actual Makefile, run "./configure", which is a configuration script -# generated by the "autoconf" program (constructs like "@foo@" will get -# replaced in the actual Makefile. -# -# Copyright (c) 1999 Scriptics Corporation. -# Copyright (c) 2002-2003 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,v 1.49 2007/10/12 19:53:32 neumann Exp $ - -#======================================================================== -# Add additional lines to handle any additional AC_SUBST cases that -# have been added in a customized configure script. -#======================================================================== - -#XOTCL_VERSION = 1.5.6 -XOTCL_VERSION = 1.5 - -src_lib_dir = ${srcdir}/library -src_doc_dir = ${srcdir}/doc -src_test_dir = ${srcdir}/tests -src_app_dir = ${srcdir}/apps -src_generic_dir = ${srcdir}/generic -TCL_LIB_SPEC = -L/usr/local/lib -ltcl8.5 -TK_LIB_SPEC = -subdirs = -aol_prefix = /usr/local/aolserver - -# Requires native paths -PLATFORM_DIR = `echo $(srcdir)/unix` -target_doc_dir = ./doc - -src_lib_dir_native = `echo ${src_lib_dir}` -src_doc_dir_native = `echo ${src_doc_dir}` -src_test_dir_native = `echo ${src_test_dir}` -src_app_dir_native = `echo ${src_app_dir}` -src_generic_dir_native = `echo ${src_generic_dir}` - -libdirs = comm lib serialize -libsrc = COPYRIGHT pkgIndex.tcl -appdirs = comm scripts utils -appsrc = COPYRIGHT - -DOC_SOURCE = \ - $(src_doc_dir)/langRef.xotcl \ - $(src_lib_dir)/lib/*.xotcl \ - $(src_lib_dir)/store/*.xotcl \ - $(src_lib_dir)/serialize/Serializer.xotcl \ - $(src_test_dir)/*.xotcl \ - $(src_app_dir)/scripts/*.xotcl \ - $(src_app_dir)/comm/[flsw]*.xotcl \ - $(src_app_dir)/actiweb/univ/UNIVERSAL.xotcl \ - $(src_app_dir)/utils/xo-*[a-z0-9] - -#export TCLLIBPATH=. ${srcdir} -mkinstalldirs= mkdir -p -#======================================================================== -# 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. -#======================================================================== - -#======================================================================== -# The names of the source files is defined in the configure script. -# The object files are used for linking into the final library. -# 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 = xotcl.c xotclError.c xotclMetaData.c xotclObjectData.c xotclProfile.c xotclTrace.c xotclUtil.c xotclShadow.c xotclCompile.c aolstub.c xotclStubInit.c -PKG_OBJECTS = xotcl.o xotclError.o xotclMetaData.o xotclObjectData.o xotclProfile.o xotclTrace.o xotclUtil.o xotclShadow.o xotclCompile.o aolstub.o xotclStubInit.o - -PKG_STUB_SOURCES = xotclStubLib.c -PKG_STUB_OBJECTS = xotclStubLib.o - -#======================================================================== -# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with -# this package that need to be installed, if any. -#======================================================================== - -PKG_TCL_SOURCES = - -#======================================================================== -# This is a list of public header files to be installed, if any. -#======================================================================== - -PKG_HEADERS = generic/xotcl.h generic/xotclInt.h generic/xotclDecls.h generic/xotclIntDecls.h - -#======================================================================== -# "PKG_LIB_FILE" refers to the library (dynamic or static as per -# configuration options) composed of the named objects. -#======================================================================== - -PKG_LIB_FILE = libxotcl1.5.6.dylib -PKG_STUB_LIB_FILE = libxotclstub1.5.6.a - -lib_BINARIES = $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE) -BINARIES = $(lib_BINARIES) - -SHELL = /bin/sh - -srcdir = . -prefix = /usr/local -exec_prefix = /usr/local - -bindir = ${exec_prefix}/bin -libdir = /usr/local/lib -datadir = /usr/local/share -mandir = ${prefix}/man -includedir = /usr/local/include - -DESTDIR = - -top_builddir = . - -INSTALL = /usr/bin/install -c -INSTALL_PROGRAM = ${INSTALL} -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_SCRIPT = ${INSTALL} - -PACKAGE_NAME = xotcl -PACKAGE_VERSION = 1.5.6 -CC = gcc -CFLAGS_DEFAULT = -Os -CFLAGS_WARNING = -Wall -Wno-implicit-int -CLEANFILES = *.o *.a *.so *~ core gmon.out -EXEEXT = -LDFLAGS_DEFAULT = -prebind -headerpad_max_install_names -Wl,-search_paths_first -MAKE_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} -MAKE_SHARED_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} -MAKE_STATIC_LIB = ${STLIB_LD} $@ $(PKG_OBJECTS) -MAKE_STUB_LIB = ${STLIB_LD} $@ $(PKG_STUB_OBJECTS) -OBJEXT = o -RANLIB = : -RANLIB_STUB = ranlib -SHLIB_CFLAGS = -fno-common -SHLIB_LD = ${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT} -Wl,-single_module -SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@ -SHLIB_LD_LIBS = ${LIBS} -L/usr/local/lib -ltclstub8.5 -STLIB_LD = ${AR} cr -TCL_DEFS = -DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.5\" -DPACKAGE_STRING=\"tcl\ 8.5\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_GET_STACKSIZE_NP=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DHAVE_COREFOUNDATION=1 -DMAC_OSX_TCL=1 -DTCL_SHLIB_EXT=\".dylib\" -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_MTSAFE_GETHOSTBYNAME=1 -DHAVE_MTSAFE_GETHOSTBYADDR=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STRUCT_TM_TM_ZONE=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_CHFLAGS=1 -DHAVE_GETATTRLIST=1 -DHAVE_COPYFILE=1 -DHAVE_LIBKERN_OSATOMIC_H=1 -DHAVE_OSSPINLOCKLOCK=1 -DHAVE_PTHREAD_ATFORK=1 -DUSE_VFORK=1 -DTCL_DEFAULT_ENCODING=\"utf-8\" -DTCL_LOAD_FROM_MEMORY=1 -DTCL_WIDE_CLICKS=1 -DHAVE_AVAILABILITYMACROS_H=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -DTCL_UNLOAD_DLLS=1 -TCL_BIN_DIR = /usr/local/lib -TCL_SRC_DIR = /Users/neumann/src/tcl/tcl -# This is necessary for packages that use private Tcl headers -#TCL_TOP_DIR_NATIVE = "/Users/neumann/src/tcl/tcl" -# Not used, but retained for reference of what libs Tcl required -TCL_LIBS = ${DL_LIBS} ${LIBS} ${MATH_LIBS} - -pkgdatadir = /usr/local/share/xotcl1.5.6 -pkglibdir = /usr/local/lib/xotcl1.5.6 -pkgincludedir = /usr/local/include/xotcl1.5.6 - -# XOTCLSH = xotclsh - -#======================================================================== -# 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). -#======================================================================== - -EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) -TCLSH_ENV = TCL_LIBRARY=`echo $(TCL_SRC_DIR)/library` \ - DYLD_LIBRARY_PATH="$(EXTRA_PATH):$(DYLD_LIBRARY_PATH)" \ - PATH="$(EXTRA_PATH):$(PATH)" \ - TCLLIBPATH="$(top_builddir) ${srcdir}" -TCLSH_PROG = /usr/local/bin/tclsh8.5 -TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) -SHARED_BUILD = 1 - -INCLUDES = -I"/Users/neumann/src/tcl/tcl/generic" -I"/Users/neumann/src/tcl/tcl/unix" -I./generic -EXTRA_CFLAGS = -DXOTCLVERSION=\"1.5\" -DXOTCLPATCHLEVEL=\".6\" -DHAVE_TCL_COMPILE_H=1 - -# TCL_DEFS is not strictly need here, but if you remove it, then you -# must make sure that configure.in 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) -DPACKAGE_NAME=\"xotcl\" -DPACKAGE_TARNAME=\"xotcl\" -DPACKAGE_VERSION=\"1.5.6\" -DPACKAGE_STRING=\"xotcl\ 1.5.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 -DCOMPILE_XOTCL_STUBS=1 $(EXTRA_CFLAGS) -DEFS = -DPACKAGE_NAME=\"xotcl\" -DPACKAGE_TARNAME=\"xotcl\" -DPACKAGE_VERSION=\"1.5.6\" -DPACKAGE_STRING=\"xotcl\ 1.5.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 -DCOMPILE_XOTCL_STUBS=1 $(EXTRA_CFLAGS) - -CONFIG_CLEAN_FILES = Makefile xotclConfig.sh apps/utils/xotclsh apps/utils/xowish unix/xotcl.spec unix/pkgIndex.unix autom4te.cache/ - -CPPFLAGS = -LIBS = -AR = ar -CFLAGS = -pipe ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - -#======================================================================== -# Start of user-definable TARGETS section -#======================================================================== - -#======================================================================== -# TEA TARGETS. Please note that the "libraries:" target refers to platform -# independent files, and the "binaries:" target inclues executable programs and -# platform-dependent libraries. Modify these targets so that they install -# the various pieces of your package. The make and install rules -# for the BINARIES that you specified above have already been done. -#======================================================================== - -all: binaries libraries doc end - -#======================================================================== -# The binaries target builds executable programs, Windows .dll's, unix -# shared/static libraries, and any other platform-dependent files. -# The list of targets to build for "binaries:" is specified at the top -# of the Makefile, in the "BINARIES" variable. -#======================================================================== - -binaries: $(BINARIES) xotclsh pkgIndex.tcl - @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ - for dir in $$dirs ; do \ - if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ - done; fi; - -libraries: - @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ - for dir in $$dirs ; do \ - if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ - done; fi; - -libraries-pkgindex: - @$(TCLSH) $(src_lib_dir_native)/lib/make.xotcl -dir $(src_lib_dir_native) -all - -fulldoc: doc pdf -# use language reference as sample file to trigger generation of documentation files -doc: $(target_doc_dir)/langRef-xotcl.html - -$(target_doc_dir)/langRef-xotcl.html: $(src_doc_dir)/langRef.xotcl $(DOC_SOURCE) - @docs=""; \ - for i in $(DOC_SOURCE); do docs="$$docs `echo $$i`"; done; \ - $(TCLSH) $(src_lib_dir_native)/lib/makeDoc.xotcl \ - $(target_doc_dir) $$docs - -pdf: - -(cd $(src_doc_dir); htmldoc --webpage --format pdf14 --title \ - -f tutorial.pdf tutorial.html ) - -(cd $(src_doc_dir); htmldoc --webpage --format pdf14 \ - -f langRef-xotcl.pdf langRef-xotcl.html ) - -install: install-binaries install-shells install-libraries install-doc - @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ - for dir in $$dirs ; do \ - if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ - done; fi; - -install-binaries: binaries install-lib-binaries install-bin-binaries install-pkgIndex - -install-aol: install-binaries install-libraries - $(INSTALL) $(src_generic_dir)/aol-xotcl.tcl \ - $(DESTDIR)/$(aol_prefix)/modules/tcl/xotcl.tcl - - -#======================================================================== -# This rule installs platform-independent files, such as header files. -#======================================================================== -install-libraries: libraries $(DESTDIR)$(includedir) $(DESTDIR)$(pkglibdir) - @echo "Installing header files in $(DESTDIR)$(includedir)" - @for i in $(PKG_HEADERS) ; do \ - echo " Installing $$i" ; \ - $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ - done; - @echo "Installing Libraries to $(DESTDIR)$(pkglibdir)/" - @for i in $(libdirs) ; do \ - echo " Installing $$i/" ; \ - rm -rf $(DESTDIR)$(pkglibdir)/$$i ; \ - mkdir -p $(DESTDIR)$(pkglibdir)/$$i; \ - chmod 755 $(DESTDIR)$(pkglibdir)/$$i; \ - for j in $(src_lib_dir)/$$i/*.*tcl ; do \ - $(INSTALL_DATA) $$j $(DESTDIR)$(pkglibdir)/$$i/; \ - done; \ - done; - @for i in $(libsrc) ; do \ - echo " Installing $$i" ; \ - rm -rf $(DESTDIR)$(pkglibdir)/$$i ; \ - $(INSTALL_DATA) $(src_lib_dir)/$$i $(DESTDIR)$(pkglibdir)/$$i ; \ - done; - cat unix/pkgIndex.unix >> $(DESTDIR)$(pkglibdir)/pkgIndex.tcl - $(INSTALL_DATA) xotclConfig.sh $(DESTDIR)$(libdir)/ - @echo "Installing Applications to $(DESTDIR)$(pkglibdir)/apps/" - @for i in $(appdirs) ; do \ - echo " Installing $$i/" ; \ - rm -rf $(DESTDIR)$(pkglibdir)/apps/$$i ; \ - mkdir -p $(DESTDIR)$(pkglibdir)/apps/$$i; \ - chmod 755 $(DESTDIR)$(pkglibdir)/apps/$$i; \ - for j in $(src_app_dir)/$$i/* ; do \ - if test -d $$j; then \ - mkdir -p $(DESTDIR)$(pkglibdir)/$$j; \ - chmod 755 $(DESTDIR)$(pkglibdir)/$$j; \ - for k in $$j/* ; do \ - $(INSTALL) $$k $(DESTDIR)$(pkglibdir)/$$j ; \ - done; \ - else \ - $(INSTALL) $$j $(DESTDIR)$(pkglibdir)/apps/$$i/; \ - fi; \ - done; \ - done; - @for i in $(appsrc) ; do \ - echo " Installing $$i" ; \ - rm -rf $(DESTDIR)$(pkglibdir)/apps/$$i ; \ - $(INSTALL_DATA) $(src_app_dir)/$$i $(DESTDIR)$(pkglibdir)/apps ; \ - done; - @rm -rf $(DESTDIR)$(pkglibdir)/store/XOTclGdbm - @rm -rf $(DESTDIR)$(pkglibdir)/store/XOTclSdbm - @rm -rf $(DESTDIR)$(pkglibdir)/xml/TclExpat-1.1 - -#======================================================================== -# Install documentation. Unix manpages should go in the $(DESTDIR)$(mandir) -# directory. -#======================================================================== - -install-doc: doc $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man3 $(DESTDIR)$(mandir)/mann - @if test ! "x$(XOTCLSH)" = "x" ; then \ - (cd $(src_man_dir)/ ; \ - for i in *.1; do \ - echo "Installing $$i"; \ - rm -f $(DESTDIR)$(mandir)/man1/$$i; \ - sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \ - $$i > $(DESTDIR)$(mandir)/man1/$$i; \ - chmod 444 $(DESTDIR)$(mandir)/man1/$$i; \ - done) ; \ - fi - -shell: binaries libraries - @$(TCLSH) $(SCRIPT) - -gdb: - $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) - -test: binaries libraries test-core test-http -test-nohttp: binaries libraries test-core - -#TESTFLAGS = -srcdir $(srcdir) -test-core: $(TCLSH_PROG) - $(TCLSH) $(src_test_dir_native)/testx.xotcl \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/testo.xotcl \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/speedtest.xotcl \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/forwardtest.xotcl \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/slottest.xotcl \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - -test-http: $(TCLSH_PROG) - $(TCLSH) $(src_test_dir_native)/xocomm.test \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - -test-actiweb: $(TCLSH_PROG) - $(TCLSH) $(src_test_dir_native)/actiweb.test \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/persistence.test \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/UNIVERSAL.test \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/xoRDF.test \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - @rm -rf receiver - -depend: - - -#======================================================================== -# $(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". -# -# 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. -#======================================================================== - -$(PKG_LIB_FILE): $(PKG_OBJECTS) - -rm -f $(PKG_LIB_FILE) - ${MAKE_LIB} - $(RANLIB) $(PKG_LIB_FILE) - -$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) - -rm -f $(PKG_STUB_LIB_FILE) - ${MAKE_STUB_LIB} - $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# -# 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 `echo $(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:.... -#======================================================================== - -VPATH = $(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win - -.c.o: - $(COMPILE) -c `echo $<` -o $@ - -#======================================================================== -# xotcl shells -#======================================================================== - -pkgIndex.tcl: $(PKG_LIB_FILE) - @echo package ifneeded XOTcl $(PACKAGE_VERSION) [list load [file join \$$dir . $(PKG_LIB_FILE)] XOTcl] > pkgIndex.tcl - -install-pkgIndex: -# @echo package ifneeded XOTcl $(PACKAGE_VERSION) [list load [file join \$$dir .. "$(PKG_LIB_FILE)"] XOTcl] > "$(pkglibdir)/pkgIndex.tcl" - -xotclsh: tclAppInit.o $(PKG_OBJECTS) $(CONDITIONAL_STUB_OBJECTS) - $(CC) -rdynamic -o $@ tclAppInit.o \ - $(PKG_OBJECTS) \ - $(CFLAGS) $(TCL_LIB_SPEC) \ - $(DMALLOC_LIB) $(CONDITIONAL_STUB_OBJECTS) - -xowish: tkAppInit.o $(PKG_OBJECTS) $(CONDITIONAL_STUB_OBJECTS) - $(CC) -rdynamic -o $@ tkAppInit.o \ - $(PKG_OBJECTS) \ - $(CFLAGS) $(TCL_LIB_SPEC) $(TK_LIB_SPEC) \ - $(DMALLOC_LIB) $(CONDITIONAL_STUB_OBJECTS) - -install-shells: - @if test -f xotclsh; then \ - $(INSTALL_PROGRAM) xotclsh $(DESTDIR)$(bindir); \ - fi - @if test -f xowish; then \ - $(INSTALL_PROGRAM) xowish $(DESTDIR)$(bindir); \ - fi - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# Unfortunately, there does not seem to be any other way to do this -# in a Makefile-independent way. We can't use VPATH because it picks up -# object files that may be located in the source directory. -# -# In the following lines, $(srcdir) refers to the toplevel directory -# containing your extension. If your sources are in a subdirectory, -# you will have to modify the paths to reflect this: -# -# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c -# $(COMPILE) -c `echo $(srcdir)/src/win/exampleA.c` -o $@ -#======================================================================== - -$(src_generic_dir)/predefined.h: $(src_generic_dir)/mk_predefined.xotcl $(src_generic_dir)/predefined.xotcl - (cd $(src_generic_dir); $(TCLSH) mk_predefined.xotcl > predefined.h) - -xotclStubInit.$(OBJEXT): $(PKG_HEADERS) -xotclStubLib.$(OBJEXT): $(src_generic_dir)/xotclStubLib.c $(PKG_HEADERS) -xotcl.$(OBJEXT): $(src_generic_dir)/xotcl.c $(src_generic_dir)/predefined.h $(PKG_HEADERS) -xotclError.$(OBJEXT): $(src_generic_dir)/xotclError.c $(PKG_HEADERS) -xotclMetaData.$(OBJEXT): $(src_generic_dir)/xotclMetaData.c $(PKG_HEADERS) -xotclObjectData.$(OBJEXT): $(src_generic_dir)/xotclObjectData.c $(PKG_HEADERS) -xotclProfile.$(OBJEXT): $(src_generic_dir)/xotclProfile.c $(PKG_HEADERS) -xotclTrace.$(OBJEXT): $(src_generic_dir)/xotclTrace.c $(PKG_HEADERS) -xotclUtil.$(OBJEXT): $(src_generic_dir)/xotclUtil.c $(PKG_HEADERS) -xotclShadow.$(OBJEXT): $(src_generic_dir)/xotclShadow.c $(PKG_HEADERS) -aolstub.$(OBJEXT): $(src_generic_dir)/aolstub.c $(PKG_HEADERS) - -# -# Target to regenerate header files and stub files from the *.decls tables. -# - -genstubs: - $(TCLSH) $(TCL_SRC_DIR)/tools/genStubs.tcl $(src_generic_dir) \ - $(src_generic_dir)/xotcl.decls $(src_generic_dir)/xotclInt.decls - -# -# Target to check that all exported functions have an entry in the stubs -# tables. -# - -checkstubs: - -@for i in `nm -p $(PKG_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \ - | sort -n`; do \ - match=0; \ - for j in $(TCL_DECLS); do \ - if [ `grep -c $$i $$j` -gt 0 ]; then \ - match=1; \ - fi; \ - done; \ - if [ $$match -eq 0 ]; then echo $$i; fi \ - done - -#======================================================================== -# End of user-definable section -#======================================================================== - -#======================================================================== -# Don't modify the file to clean here. Instead, set the "CLEANFILES" -# variable in configure.in -#======================================================================== - -clean: - -rm -rf $(BINARIES) $(CLEANFILES) xotclsh pkgIndex.tcl ./receiver \ - $(target_doc_dir)/*-xotcl.html - find ${srcdir} -type f -name \*~ -exec rm \{} \; - @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ - for dir in $$dirs ; do \ - if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ - done; fi - -distclean: clean - -rm -rf Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log config.status - @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ - for dir in $$dirs ; do \ - if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ - done; fi - -#======================================================================== -# 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) -# -# You should not have to modify this target. -#======================================================================== - -install-lib-binaries: - @mkdir -p $(DESTDIR)$(pkglibdir) - @list='$(lib_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ - stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ - if test "x$$stub" = "xstub"; then \ - echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ - else \ - echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ - ln -s $(DESTDIR)$(pkglibdir)/$$p $(DESTDIR)$(libdir)/$$p; \ - fi; \ - ext=`echo $$p|sed -e "s/.*\.//"`; \ - if test "x$$ext" = "xdll"; then \ - 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; \ - fi; \ - fi; \ - 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; \ - done - - -#======================================================================== -# 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. -# -# You should not have to modify this target, except to define bin_BINARIES -# above if necessary. -#======================================================================== - -install-bin-binaries: - @mkdir -p $(DESTDIR)$(bindir) - @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; \ - done - -.SUFFIXES: .c .$(OBJEXT) - -#Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -# cd $(top_builddir) \ -# && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -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; \ - done - -$(DESTDIR)$(includedir): - $(mkinstalldirs) $@ -$(DESTDIR)$(bindir): - $(mkinstalldirs) $@ -$(DESTDIR)$(libdir): - $(mkinstalldirs) $@ -$(DESTDIR)$(pkglibdir): - $(mkinstalldirs) $@ -$(DESTDIR)$(pkglibdir)/apps: $(DESTDIR)$(pkglibdir) - $(mkinstalldirs) $@ -$(DESTDIR)$(mandir)/man1: - $(mkinstalldirs) $@ -$(DESTDIR)$(mandir)/man3: - $(mkinstalldirs) $@ -$(DESTDIR)$(mandir)/mann: - $(mkinstalldirs) $@ - -end: - @echo "" - @echo "************************************************************" - @echo " Make completed. In order to test XOTcl, invoke:" - @echo " make test" - @echo "" - @echo " In order install XOTcl, invoke:" - @echo " make install" - @echo "" - @echo " In order to install XOTcl for AOLserver 4.x, invoke:" - @echo " make install-aol" - @echo "" - @echo " In order to invoke XOTcl interactively (before install), use:" - @echo " export TCLLIBPATH=\"$(TCLLIBPATH)\" or " - @echo " setenv TCLLIBPATH \"$(TCLLIBPATH)\"" - @echo " and" - @if test "x$(XOTCLSH)" = "x" ; then \ - echo " /usr/local/bin/tclsh8.5" ; \ - echo " package require XOTcl; namespace import -force xotcl::*" ; \ - echo " or" ; \ - echo " put the 'package require' line into your ~/.tclshrc" ; \ - else \ - echo " ./xotclsh" ; \ - fi - @echo "************************************************************" - -RPMSOURCES=/usr/src/redhat/SOURCES -RPMSPECS=/usr/src/redhat/SPECS - -rpm: - @if test ! -d $(RPMSOURCES); then mkdir -p $(RPMSOURCES); fi - @if test ! -d $(RPMSPECS); then mkdir -p $(RPMSPECS); fi - cp unix/xotcl.spec $(RPMSPECS)/xotcl-$(PACKAGE_VERSION).spec - make tar - cp ../xotcl-$(PACKAGE_VERSION).tar.gz $(RPMSOURCES) - rpmbuild -ba $(RPMSPECS)/xotcl-$(PACKAGE_VERSION).spec - -bin-tar: - (cd ..; tar zcvf xotcl-$(PACKAGE_VERSION)-bin-linux-i686-glibc.tar.gz \ - `find $(exec_prefix)/bin/xotclsh $(exec_prefix)/bin/xowish \ - $(prefix)/lib/xotcl$(PACKAGE_VERSION)* \ - $(prefix)/lib/libxotcl$(PACKAGE_VERSION)* \ - $(prefix)/include/xotcl*.h \ - $(DESTDIR)$(pkglibdir) $(prefix)/man/man1/xo* \ - -type f -o -type l | fgrep -v CVS | fgrep -v SCCS | fgrep -v .junk| fgrep -v .db | fgrep -v "~" | fgrep -v "#" | fgrep -v /receiver/` \ - ) - -tar: libraries-pkgindex - sh ./config/mktar.sh - - -.PHONY: all binaries clean depend distclean doc install libraries \ - test test-core test-actiweb - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Index: xotcl/Makefile.in =================================================================== diff -u -N --- xotcl/Makefile.in (revision e44f69435e8db4aa6ed2ffffe8caaa6586c2fc5f) +++ xotcl/Makefile.in (revision 0) @@ -1,676 +0,0 @@ -# Makefile.in -- -# -# This file is a Makefile for Sample TEA Extension. If it has the name -# "Makefile.in" then it is a template for a Makefile; to generate the -# actual Makefile, run "./configure", which is a configuration script -# generated by the "autoconf" program (constructs like "@foo@" will get -# replaced in the actual Makefile. -# -# Copyright (c) 1999 Scriptics Corporation. -# Copyright (c) 2002-2003 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.25 2007/09/18 19:27:32 neumann Exp $ - -#======================================================================== -# Add additional lines to handle any additional AC_SUBST cases that -# have been added in a customized configure script. -#======================================================================== - -#XOTCL_VERSION = @PACKAGE_VERSION@ -XOTCL_VERSION = @XOTCL_VERSION@ - -src_lib_dir = ${srcdir}/library -src_doc_dir = ${srcdir}/doc -src_test_dir = ${srcdir}/tests -src_app_dir = ${srcdir}/apps -src_generic_dir = ${srcdir}/generic -TCL_LIB_SPEC = @TCL_LIB_SPEC@ -TK_LIB_SPEC = @TK_LIB_SPEC@ -subdirs = @subdirs@ -aol_prefix = @aol_prefix@ - -# Requires native paths -PLATFORM_DIR = `@CYGPATH@ $(srcdir)/@TEA_PLATFORM@` -target_doc_dir = ./doc - -src_lib_dir_native = `@CYGPATH@ ${src_lib_dir}` -src_doc_dir_native = `@CYGPATH@ ${src_doc_dir}` -src_test_dir_native = `@CYGPATH@ ${src_test_dir}` -src_app_dir_native = `@CYGPATH@ ${src_app_dir}` -src_generic_dir_native = `@CYGPATH@ ${src_generic_dir}` - -libdirs = comm lib serialize @libdirs_actiweb@ -libsrc = COPYRIGHT pkgIndex.tcl -appdirs = comm scripts utils @apps_actiweb@ -appsrc = COPYRIGHT - -DOC_SOURCE = \ - $(src_doc_dir)/langRef.xotcl \ - $(src_lib_dir)/lib/*.xotcl \ - $(src_lib_dir)/store/*.xotcl \ - $(src_lib_dir)/serialize/Serializer.xotcl \ - $(src_test_dir)/*.xotcl \ - $(src_app_dir)/scripts/*.xotcl \ - $(src_app_dir)/comm/[flsw]*.xotcl \ - $(src_app_dir)/actiweb/univ/UNIVERSAL.xotcl \ - $(src_app_dir)/utils/xo-*[a-z0-9] - -#export TCLLIBPATH=. ${srcdir} -mkinstalldirs= mkdir -p -#======================================================================== -# 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. -#======================================================================== - -#======================================================================== -# The names of the source files is defined in the configure script. -# The object files are used for linking into the final library. -# 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@ - -PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ -PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ - -#======================================================================== -# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with -# this package that need to be installed, if any. -#======================================================================== - -PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ - -#======================================================================== -# This is a list of public header files to be installed, if any. -#======================================================================== - -PKG_HEADERS = @PKG_HEADERS@ - -#======================================================================== -# "PKG_LIB_FILE" refers to the library (dynamic or static as per -# configuration options) composed of the named objects. -#======================================================================== - -PKG_LIB_FILE = @PKG_LIB_FILE@ -PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ - -lib_BINARIES = $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE) -BINARIES = $(lib_BINARIES) - -SHELL = @SHELL@ - -srcdir = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -libdir = @libdir@ -datadir = @datadir@ -mandir = @mandir@ -includedir = @includedir@ - -DESTDIR = - -top_builddir = . - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ - -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -CC = @CC@ -CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ -CFLAGS_WARNING = @CFLAGS_WARNING@ -CLEANFILES = @CLEANFILES@ -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_FLAGS = @SHLIB_LD_FLAGS@ -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@ -# This is necessary for packages that use private Tcl headers -#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ -# Not used, but retained for reference of what libs Tcl required -TCL_LIBS = @TCL_LIBS@ - -pkgdatadir = @pkgdatadir@ -pkglibdir = @pkglibdir@ -pkgincludedir = @pkgincludedir@ - -# XOTCLSH = @XOTCLSH@ - -#======================================================================== -# 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). -#======================================================================== - -EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) -TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ - @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ - PATH="$(EXTRA_PATH):$(PATH)" \ - TCLLIBPATH="$(top_builddir) ${srcdir}" -TCLSH_PROG = @TCLSH_PROG@ -TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) -SHARED_BUILD = @SHARED_BUILD@ - -INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @XOTCL_BUILD_INCLUDE_SPEC@ -EXTRA_CFLAGS = @PKG_CFLAGS@ - -# TCL_DEFS is not strictly need here, but if you remove it, then you -# must make sure that configure.in 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@ $(EXTRA_CFLAGS) -DEFS = @DEFS@ $(EXTRA_CFLAGS) - -CONFIG_CLEAN_FILES = @CONFIG_CLEAN_FILES@ - -CPPFLAGS = @CPPFLAGS@ -LIBS = @PKG_LIBS@ @LIBS@ -AR = @AR@ -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - -#======================================================================== -# Start of user-definable TARGETS section -#======================================================================== - -#======================================================================== -# TEA TARGETS. Please note that the "libraries:" target refers to platform -# independent files, and the "binaries:" target inclues executable programs and -# platform-dependent libraries. Modify these targets so that they install -# the various pieces of your package. The make and install rules -# for the BINARIES that you specified above have already been done. -#======================================================================== - -all: binaries libraries doc end - -#======================================================================== -# The binaries target builds executable programs, Windows .dll's, unix -# shared/static libraries, and any other platform-dependent files. -# The list of targets to build for "binaries:" is specified at the top -# of the Makefile, in the "BINARIES" variable. -#======================================================================== - -binaries: $(BINARIES) @XOTCLSH@ @XOWISH@ pkgIndex.tcl - @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ - for dir in $$dirs ; do \ - if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ - done; fi; - -libraries: - @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ - for dir in $$dirs ; do \ - if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ - done; fi; - -libraries-pkgindex: - @$(TCLSH) $(src_lib_dir_native)/lib/make.xotcl -dir $(src_lib_dir_native) -all - -fulldoc: doc pdf -# use language reference as sample file to trigger generation of documentation files -doc: $(target_doc_dir)/langRef-xotcl.html - -$(target_doc_dir)/langRef-xotcl.html: $(src_doc_dir)/langRef.xotcl $(DOC_SOURCE) - @docs=""; \ - for i in $(DOC_SOURCE); do docs="$$docs `@CYGPATH@ $$i`"; done; \ - $(TCLSH) $(src_lib_dir_native)/lib/makeDoc.xotcl \ - $(target_doc_dir) $$docs - -pdf: - -(cd $(src_doc_dir); htmldoc --webpage --format pdf14 --title \ - -f tutorial.pdf tutorial.html ) - -(cd $(src_doc_dir); htmldoc --webpage --format pdf14 \ - -f langRef-xotcl.pdf langRef-xotcl.html ) - -install: install-binaries install-shells install-libraries install-doc - @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ - for dir in $$dirs ; do \ - if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ - done; fi; - -install-binaries: binaries install-lib-binaries install-bin-binaries install-pkgIndex - -install-aol: install-binaries install-libraries - $(INSTALL) $(src_generic_dir)/aol-xotcl.tcl \ - $(DESTDIR)/$(aol_prefix)/modules/tcl/xotcl.tcl - - -#======================================================================== -# This rule installs platform-independent files, such as header files. -#======================================================================== -install-libraries: libraries $(DESTDIR)$(includedir) $(DESTDIR)$(pkglibdir) - @echo "Installing header files in $(DESTDIR)$(includedir)" - @for i in $(PKG_HEADERS) ; do \ - echo " Installing $$i" ; \ - $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ - done; - @echo "Installing Libraries to $(DESTDIR)$(pkglibdir)/" - @for i in $(libdirs) ; do \ - echo " Installing $$i/" ; \ - rm -rf $(DESTDIR)$(pkglibdir)/$$i ; \ - mkdir -p $(DESTDIR)$(pkglibdir)/$$i; \ - chmod 755 $(DESTDIR)$(pkglibdir)/$$i; \ - for j in $(src_lib_dir)/$$i/*.*tcl ; do \ - $(INSTALL_DATA) $$j $(DESTDIR)$(pkglibdir)/$$i/; \ - done; \ - done; - @for i in $(libsrc) ; do \ - echo " Installing $$i" ; \ - rm -rf $(DESTDIR)$(pkglibdir)/$$i ; \ - $(INSTALL_DATA) $(src_lib_dir)/$$i $(DESTDIR)$(pkglibdir)/$$i ; \ - done; - cat unix/pkgIndex.unix >> $(DESTDIR)$(pkglibdir)/pkgIndex.tcl - $(INSTALL_DATA) xotclConfig.sh $(DESTDIR)$(libdir)/ - @echo "Installing Applications to $(DESTDIR)$(pkglibdir)/apps/" - @for i in $(appdirs) ; do \ - echo " Installing $$i/" ; \ - rm -rf $(DESTDIR)$(pkglibdir)/apps/$$i ; \ - mkdir -p $(DESTDIR)$(pkglibdir)/apps/$$i; \ - chmod 755 $(DESTDIR)$(pkglibdir)/apps/$$i; \ - for j in $(src_app_dir)/$$i/* ; do \ - if test -d $$j; then \ - mkdir -p $(DESTDIR)$(pkglibdir)/$$j; \ - chmod 755 $(DESTDIR)$(pkglibdir)/$$j; \ - for k in $$j/* ; do \ - $(INSTALL) $$k $(DESTDIR)$(pkglibdir)/$$j ; \ - done; \ - else \ - $(INSTALL) $$j $(DESTDIR)$(pkglibdir)/apps/$$i/; \ - fi; \ - done; \ - done; - @for i in $(appsrc) ; do \ - echo " Installing $$i" ; \ - rm -rf $(DESTDIR)$(pkglibdir)/apps/$$i ; \ - $(INSTALL_DATA) $(src_app_dir)/$$i $(DESTDIR)$(pkglibdir)/apps ; \ - done; - @rm -rf $(DESTDIR)$(pkglibdir)/store/XOTclGdbm - @rm -rf $(DESTDIR)$(pkglibdir)/store/XOTclSdbm - @rm -rf $(DESTDIR)$(pkglibdir)/xml/TclExpat-1.1 - -#======================================================================== -# Install documentation. Unix manpages should go in the $(DESTDIR)$(mandir) -# directory. -#======================================================================== - -install-doc: doc $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man3 $(DESTDIR)$(mandir)/mann - @if test ! "x$(XOTCLSH)" = "x" ; then \ - (cd $(src_man_dir)/ ; \ - for i in *.1; do \ - echo "Installing $$i"; \ - rm -f $(DESTDIR)$(mandir)/man1/$$i; \ - sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \ - $$i > $(DESTDIR)$(mandir)/man1/$$i; \ - chmod 444 $(DESTDIR)$(mandir)/man1/$$i; \ - done) ; \ - fi - -shell: binaries libraries - @$(TCLSH) $(SCRIPT) - -gdb: - $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) - -test: binaries libraries test-core test-http @test_actiweb@ -test-nohttp: binaries libraries test-core - -#TESTFLAGS = -srcdir $(srcdir) -test-core: $(TCLSH_PROG) - $(TCLSH) $(src_test_dir_native)/testx.xotcl \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/testo.xotcl \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/speedtest.xotcl \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/forwardtest.xotcl \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/slottest.xotcl \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - -test-http: $(TCLSH_PROG) - $(TCLSH) $(src_test_dir_native)/xocomm.test \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - -test-actiweb: $(TCLSH_PROG) - $(TCLSH) $(src_test_dir_native)/actiweb.test \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/persistence.test \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/UNIVERSAL.test \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - $(TCLSH) $(src_test_dir_native)/xoRDF.test \ - -libdir $(PLATFORM_DIR) $(TESTFLAGS) - @rm -rf receiver - -depend: - - -#======================================================================== -# $(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". -# -# 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. -#======================================================================== - -$(PKG_LIB_FILE): $(PKG_OBJECTS) - -rm -f $(PKG_LIB_FILE) - ${MAKE_LIB} - $(RANLIB) $(PKG_LIB_FILE) - -$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) - -rm -f $(PKG_STUB_LIB_FILE) - ${MAKE_STUB_LIB} - $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# -# 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:.... -#======================================================================== - -VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win - -.c.@OBJEXT@: - $(COMPILE) -c `@CYGPATH@ $<` -o $@ - -#======================================================================== -# xotcl shells -#======================================================================== - -pkgIndex.tcl: $(PKG_LIB_FILE) - @echo package ifneeded XOTcl $(PACKAGE_VERSION) [list load [file join \$$dir . $(PKG_LIB_FILE)] XOTcl] > pkgIndex.tcl - -install-pkgIndex: -# @echo package ifneeded XOTcl $(PACKAGE_VERSION) [list load [file join \$$dir .. "$(PKG_LIB_FILE)"] XOTcl] > "$(pkglibdir)/pkgIndex.tcl" - -xotclsh: tclAppInit.o $(PKG_OBJECTS) $(CONDITIONAL_STUB_OBJECTS) - $(CC) -rdynamic -o $@ tclAppInit.o \ - $(PKG_OBJECTS) \ - $(CFLAGS) $(TCL_LIB_SPEC) \ - $(DMALLOC_LIB) $(CONDITIONAL_STUB_OBJECTS) - -xowish: tkAppInit.o $(PKG_OBJECTS) $(CONDITIONAL_STUB_OBJECTS) - $(CC) -rdynamic -o $@ tkAppInit.o \ - $(PKG_OBJECTS) \ - $(CFLAGS) $(TCL_LIB_SPEC) $(TK_LIB_SPEC) \ - $(DMALLOC_LIB) $(CONDITIONAL_STUB_OBJECTS) - -install-shells: - @if test -f xotclsh; then \ - $(INSTALL_PROGRAM) xotclsh $(DESTDIR)$(bindir); \ - fi - @if test -f xowish; then \ - $(INSTALL_PROGRAM) xowish $(DESTDIR)$(bindir); \ - fi - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# Unfortunately, there does not seem to be any other way to do this -# in a Makefile-independent way. We can't use VPATH because it picks up -# object files that may be located in the source directory. -# -# In the following lines, $(srcdir) refers to the toplevel directory -# containing your extension. If your sources are in a subdirectory, -# you will have to modify the paths to reflect this: -# -# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c -# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@ -#======================================================================== - -$(src_generic_dir)/predefined.h: $(src_generic_dir)/mk_predefined.xotcl $(src_generic_dir)/predefined.xotcl - (cd $(src_generic_dir); $(TCLSH) mk_predefined.xotcl > predefined.h) - -xotclStubInit.$(OBJEXT): $(PKG_HEADERS) -xotclStubLib.$(OBJEXT): $(src_generic_dir)/xotclStubLib.c $(PKG_HEADERS) -xotcl.$(OBJEXT): $(src_generic_dir)/xotcl.c $(src_generic_dir)/predefined.h $(PKG_HEADERS) -xotclError.$(OBJEXT): $(src_generic_dir)/xotclError.c $(PKG_HEADERS) -xotclMetaData.$(OBJEXT): $(src_generic_dir)/xotclMetaData.c $(PKG_HEADERS) -xotclObjectData.$(OBJEXT): $(src_generic_dir)/xotclObjectData.c $(PKG_HEADERS) -xotclProfile.$(OBJEXT): $(src_generic_dir)/xotclProfile.c $(PKG_HEADERS) -xotclTrace.$(OBJEXT): $(src_generic_dir)/xotclTrace.c $(PKG_HEADERS) -xotclUtil.$(OBJEXT): $(src_generic_dir)/xotclUtil.c $(PKG_HEADERS) -xotclShadow.$(OBJEXT): $(src_generic_dir)/xotclShadow.c $(PKG_HEADERS) -aolstub.$(OBJEXT): $(src_generic_dir)/aolstub.c $(PKG_HEADERS) - -# -# Target to regenerate header files and stub files from the *.decls tables. -# - -genstubs: - $(TCLSH) $(TCL_SRC_DIR)/tools/genStubs.tcl $(src_generic_dir) \ - $(src_generic_dir)/xotcl.decls $(src_generic_dir)/xotclInt.decls - -# -# Target to check that all exported functions have an entry in the stubs -# tables. -# - -checkstubs: - -@for i in `nm -p $(PKG_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \ - | sort -n`; do \ - match=0; \ - for j in $(TCL_DECLS); do \ - if [ `grep -c $$i $$j` -gt 0 ]; then \ - match=1; \ - fi; \ - done; \ - if [ $$match -eq 0 ]; then echo $$i; fi \ - done - -#======================================================================== -# End of user-definable section -#======================================================================== - -#======================================================================== -# Don't modify the file to clean here. Instead, set the "CLEANFILES" -# variable in configure.in -#======================================================================== - -clean: - -rm -rf $(BINARIES) $(CLEANFILES) @XOTCLSH@ @XOWISH@ pkgIndex.tcl ./receiver \ - $(target_doc_dir)/*-xotcl.html - find ${srcdir} -type f -name \*~ -exec rm \{} \; - @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ - for dir in $$dirs ; do \ - if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ - done; fi - -distclean: clean - -rm -rf Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log config.status - @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ - for dir in $$dirs ; do \ - if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ - done; fi - -#======================================================================== -# 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) -# -# You should not have to modify this target. -#======================================================================== - -install-lib-binaries: - @mkdir -p $(DESTDIR)$(pkglibdir) - @list='$(lib_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ - stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ - if test "x$$stub" = "xstub"; then \ - echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ - else \ - echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ - ln -s $(DESTDIR)$(pkglibdir)/$$p $(DESTDIR)$(libdir)/$$p; \ - fi; \ - ext=`echo $$p|sed -e "s/.*\.//"`; \ - if test "x$$ext" = "xdll"; then \ - 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; \ - fi; \ - fi; \ - 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; \ - done - - -#======================================================================== -# 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. -# -# You should not have to modify this target, except to define bin_BINARIES -# above if necessary. -#======================================================================== - -install-bin-binaries: - @mkdir -p $(DESTDIR)$(bindir) - @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; \ - done - -.SUFFIXES: .c .$(OBJEXT) - -#Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -# cd $(top_builddir) \ -# && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -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; \ - done - -$(DESTDIR)$(includedir): - $(mkinstalldirs) $@ -$(DESTDIR)$(bindir): - $(mkinstalldirs) $@ -$(DESTDIR)$(libdir): - $(mkinstalldirs) $@ -$(DESTDIR)$(pkglibdir): - $(mkinstalldirs) $@ -$(DESTDIR)$(pkglibdir)/apps: $(DESTDIR)$(pkglibdir) - $(mkinstalldirs) $@ -$(DESTDIR)$(mandir)/man1: - $(mkinstalldirs) $@ -$(DESTDIR)$(mandir)/man3: - $(mkinstalldirs) $@ -$(DESTDIR)$(mandir)/mann: - $(mkinstalldirs) $@ - -end: - @echo "" - @echo "************************************************************" - @echo " Make completed. In order to test XOTcl, invoke:" - @echo " make test" - @echo "" - @echo " In order install XOTcl, invoke:" - @echo " make install" - @echo "" - @echo " In order to install XOTcl for AOLserver 4.x, invoke:" - @echo " make install-aol" - @echo "" - @echo " In order to invoke XOTcl interactively (before install), use:" - @echo " export TCLLIBPATH=\"$(TCLLIBPATH)\" or " - @echo " setenv TCLLIBPATH \"$(TCLLIBPATH)\"" - @echo " and" - @if test "x$(XOTCLSH)" = "x" ; then \ - echo " @TCLSH_PROG@" ; \ - echo " package require XOTcl; namespace import -force xotcl::*" ; \ - echo " or" ; \ - echo " put the 'package require' line into your ~/.tclshrc" ; \ - else \ - echo " ./xotclsh" ; \ - fi - @echo "************************************************************" - -RPMSOURCES=/usr/src/redhat/SOURCES -RPMSPECS=/usr/src/redhat/SPECS - -rpm: - @if test ! -d $(RPMSOURCES); then mkdir -p $(RPMSOURCES); fi - @if test ! -d $(RPMSPECS); then mkdir -p $(RPMSPECS); fi - cp unix/xotcl.spec $(RPMSPECS)/xotcl-$(PACKAGE_VERSION).spec - make tar - cp ../xotcl-$(PACKAGE_VERSION).tar.gz $(RPMSOURCES) - rpmbuild -ba $(RPMSPECS)/xotcl-$(PACKAGE_VERSION).spec - -bin-tar: - (cd ..; tar zcvf xotcl-$(PACKAGE_VERSION)-bin-linux-i686-glibc.tar.gz \ - `find $(exec_prefix)/bin/xotclsh $(exec_prefix)/bin/xowish \ - $(prefix)/lib/xotcl$(PACKAGE_VERSION)* \ - $(prefix)/lib/libxotcl$(PACKAGE_VERSION)* \ - $(prefix)/include/xotcl*.h \ - $(DESTDIR)$(pkglibdir) $(prefix)/man/man1/xo* \ - -type f -o -type l | fgrep -v CVS | fgrep -v SCCS | fgrep -v .junk| fgrep -v .db | fgrep -v "~" | fgrep -v "#" | fgrep -v /receiver/` \ - ) - -tar: libraries-pkgindex - sh ./config/mktar.sh - - -.PHONY: all binaries clean depend distclean doc install libraries \ - test test-core test-actiweb - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Index: xotcl/README =================================================================== diff -u -N --- xotcl/README (revision 6188c1a73f38a458ed2eac85c61e1ab5a9ca40bf) +++ xotcl/README (revision 0) @@ -1,147 +0,0 @@ -***************** $Id: README,v 1.2 2004/08/18 09:31:08 neumann Exp $ -XOTcl README File -***************** - -********************************** -Compilation of Source Distribution -********************************* -Read COMPILE for compilation guidance on UNIX or -COMPILE.win for Windows. - - -************************************ -Installation of Binary Distributions -************************************ - -For all binary distributions firstly Tcl and Tk must be installed -properly. Binary distributions require Tcl/Tk 8.3 (included in -most Linux distributions), which you can find from: - - http://www.tcl.tk - - -Working with a Shell --------------------- - -From version 1.1 on XOTcl does not - by default - build xotclsh and -xowish anymore. Instead you should use xotcl from tclsh or wish. The -typical way to do so is to load XOTcl as a packages and then import -the commands from the XOTcl namespace into the current namespace: - - /usr/local/bin/tclsh8.4 - package require XOTcl; namespace import -force xotcl::* - -That means, the XOTcl installed package library needs to be on Tcl's -search path for packages. - -If XOTcl is not installed in the standard Tcl location, you can either -set the environment variable TCLLIBPATH from outside of Tcl to this -location, or use the variable auto_path in Tcl. For instance, to use -the local, extracted tar ball, you can use something like (under -UNIX): - export TCLLIBPATH="./xotcl-1.3.0" or - setenv TCLLIBPATH "./xotcl-1.3.0" -Under Windows: - set TCLLIBPATH=".\xotcl-1.3.0" - - -Linux Binary Distribution -------------------------- - -Per default the Linux version install to usr/local and XOTcl -directories. If you want to install to these directions, just - cd / - tar xvfz xotcl-XXX.tar.gz -otherwise: - mkdir temp-xotcl - cd temp-xotcl - tar xvfz xotcl-XXX.tar.gz -and then copy the file in temp-xotcl/usr/local to your installation -destination and temp-dir/xotcl where you want to have the examples -and documentation. If the packages can not be found, try to -set the TCLLIBPATH. On Unix Systems: - -csh: setenv TCLLIBPATH "/usr/local/lib/xotcl-/ $(TCLLIBPATH)" -bash: export TCLLIBPATH="/usr/local/lib/xotcl-/ $(TCLLIBPATH)" - - -Windows Binary Release ----------------------- - -You need Tcl 8.3.* or 8.4.* installed properly. If necessary, get Tcl -8.4 for your system from - http://www.tcl.tk - -Now check where Tcl is installed and what the name of the tclsh*.exe -is. If you installed Tcl 8.3.5, the name is tclsh83.exe. On my system -Tcl installs tclsh in c:\Programme\Tcl\bin (in English versions this -is most likely under c:\Program Files\Tcl\bin). - -On my system the tcl installer adds this directory automatically -to the search PATH; if this is not the case on your system, add this -directory manually to your PATH (under NT or Win2K, use: Control -Panel/System/.../Environment; MSDOS-class system use autoexec.bat to -add this directory to the PATH variable by a line like - SET PATH=c:\Progra~1\Tcl\bin;%PATH% -) and reboot. - -Now you should be able now to start the Tcl shell by typing "tclsh83". You -will see the % prompt. To exit the shell, type "exit". - -The xotcl*.zip file contains the XOTcl distribution. Unzip the -contents of the XOTcl zip file on c: to a directory "xotcl*." Open a -DOS box window and change to the XOTcl win directory, like: - - c: - cd \xotcl-\win - -Next, you have to invoke the installer: - - tclsh83 installWin.tcl - -The installer tries to install xotcl in the default directory -"\Program~1\Tcl", which should at least work on English and German -platforms (in English Windows distributions the program directory is -called "Program Files", in German versions, it is called "Programme"). - -If you want to install XOTcl at a different you can specify the target -directory as an argument of the installer: - - tclsh83 installWin.tcl /Programme/Tcl - -Now you should be able to use XOTcl by starting Tclsh and using: - - package require XOTcl; namespace import -force xotcl::* - -If XOTcl is not found on your system, you can set the TCLLIBPATH enviornment -variable to the location of xotcl, e.g.: - - set TCLLIBPATH="C:/PROGRA~1/TCL/lib/xotcl" - -Please note the slashes, do not use backslashes here! - -You can test your installation with: - -XOTcl Tests: - tclsh xotcl-/tests/testx.xotcl - tclsh xotcl-/tests/testo.xotcl - tclsh xotcl-/tests/speedtest.xotcl - tclsh xotcl-/tests/xocomm.test - tclsh xotcl-/tests/persistence.test - tclsh xotcl-/tests/xoRDF.test - -More Infos ----------- - -More information can be found at: - - http://www.xotcl.org - -You can find a mailing list about XOTcl there as well. - -Please report bugs and problems to the authors under one of these -email addresses: - - uwe.zdun@wu-wien.ac.at, zdun@xotcl.org - gustaf.neumann@wu-wien.ac.at, neumann@xotcl.org - Index: xotcl/README.aol =================================================================== diff -u -N --- xotcl/README.aol (revision 2c98844f5e9a46a8ecb2c8aa8d714592a07b311d) +++ xotcl/README.aol (revision 0) @@ -1,21 +0,0 @@ - - Starting with Aolserver 4.* xotcl can be loaded via - package require. However, it is recommended to install - the binaries under the aolserver directory. The - recommended configuration is: - - ./configure --enable-threads --prefix=/usr/local/aolserver - - Then, you can do a - - make - make install - - We provide a small .tcl-file for providing xotcl as a module - (available in all connection threads) and easing the load of - .xotcl files (to be loaded after the xotcl extension). The - support file can be installed via: - - make install-aol - - Zoran, Gustaf Index: xotcl/aclocal.m4 =================================================================== diff -u -N --- xotcl/aclocal.m4 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/aclocal.m4 (revision 0) @@ -1 +0,0 @@ -builtin(include,tcl.m4) Index: xotcl/apps/COPYRIGHT =================================================================== diff -u -N --- xotcl/apps/COPYRIGHT (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/COPYRIGHT (revision 0) @@ -1,41 +0,0 @@ - * XOTcl - Extended OTcl - * - * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) - * - * (a) Vienna University of Economics and Business Administration - * Dept. of Information Systems / New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - Index: xotcl/apps/actiweb/AgentClient.xotcl =================================================================== diff -u -N --- xotcl/apps/actiweb/AgentClient.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/apps/actiweb/AgentClient.xotcl (revision 0) @@ -1,151 +0,0 @@ -#!/usr/bin/env tclsh -# $Id: AgentClient.xotcl,v 1.5 2006/09/27 08:12:39 neumann Exp $ -#if {![info exists ACTIWEB_HOME]} {source ~/actiweb/paths.xotcl} -package require XOTcl; namespace import -force xotcl::* -package require xotcl::package -package verbose 1 - -package require xotcl::actiweb::agent -package require xotcl::actiweb::httpPlace - -Place p -set receiverHost localhost:8087 - -# -# if we migrate an object, we cannot send the result to [self] -# in this example we just use a small result printer object to -# print the result to the stderr stream -# -Object resultPrinter -resultPrinter proc printResult {o m code result} { - if {$code eq "OK"} { - puts stderr "[self] -- Result -- $m:\n$result" - } else { - puts stderr "[self] -- Error -- $m: \n$result" - } -} - -Class CloneableClass -superclass {Agent Class} - -CloneableClass AgentExample -superclass Agent -parameter { - {invokeAgent hallo.txt} - {invokeMethod content} -} -AgentExample proc test-calls {} { - #showObj [self] - - set host [::set ::receiverHost] - my clone $host "" [list [self] class-cloned] -} -AgentExample proc class-cloned {args} { - my a1 - my a2 - my a3 - my a4 - a1 synchronousInvokeCall - a3 synchronousMigrateCall - a4 synchronousCloneCall - - #a1 asynchronousInvokeCall - #a1 asynchronousCloneCall - #a2 asynchronousMigrateCall - exit -} -AgentExample instproc computeXXX args { - return XXX--[my set var1]--XXXX -} -AgentExample instproc init args { - next - my set var1 xyz - my persistent var1 -} -AgentExample instproc synchronousInvokeCall args { - - set host [::set ::receiverHost] - my instvar invokeAgent invokeMethod - puts stderr "*******************[self]: [self proc]" - puts stderr "Result: [my syncInvoke $host $invokeAgent $invokeMethod]" -} -AgentExample instproc synchronousMigrateCall args { - set host [::set ::receiverHost] - puts stderr "*******************[self]: [self proc]" - set result [my syncMigrate $host computeXXX] - puts stderr "Result: '$result'" -} -AgentExample instproc synchronousCloneCall args { - set host [::set ::receiverHost] - puts stderr "*******************[self]: [self proc]" - set result [my syncClone $host computeXXX] - puts stderr "Result: '$result'" -} -AgentExample instproc asynchronousInvokeCall args { - set host [::set ::receiverHost] - my instvar invokeAgent invokeMethod - puts stderr "*******************[self]: [self proc]" - my invoke [list resultPrinter printResult my INVOKE] $host $invokeAgent $invokeMethod -} -AgentExample instproc asynchronousCloneCall args { - set host [::set ::receiverHost] - puts stderr "*******************[self]: [self proc]" - my clone $host computeXXX [list resultPrinter printResult my CLONE] -} -AgentExample instproc asynchronousMigrateCall args { - set host [::set ::receiverHost] - puts stderr "*******************[self]: [self proc]" - my migrate $host computeXXX [list resultPrinter printResult my MIGRATE] -} - - -#AgentExample instproc callSet args { -# set host localhost:8087 -# set agent welcome -# -# puts stderr INVOKE******************************* -# set r [my invoke $host welcome set+a+1] -# puts stderr result=$r -#} - -AgentExample instproc destroy args { - next -} - -Agent registryTest - -registryTest proc test args { - set host localhost:8087 - my createRequest "[self] testOnPlaceName $host" http://$host/ -} - -registryTest proc testOnPlaceName {host placeName} { - set place [Place getInstance] - set subject "http://[$place host]:[$place port]/[self]" - - RDFdb [self]::db - [self]::db add "http://nestroy.wi-inf.uni-essen.de/schema/service#name" \ - $subject registryTest - [self]::db add "http://nestroy.wi-inf.uni-essen.de/schema/xotcl#class" \ - $subject [my info class] - # - # place info als bag machen ... - # - [self]::db add "http://nestroy.wi-inf.uni-essen.de/schema/agent#place" \ - $subject $place - - set rdfText [${place}::rdfCreator createFromTriples [[self]::db getTriples]] - - [self]::db destroy - - my invoke $host ${placeName}::registry register $rdfText - - set r [my invoke $host ${placeName}::registry query registryTest] - puts "************************Query: $r\n" - set r [my invoke $host ${placeName}::registry queryProperty http://nestroy.wi-inf.uni-essen.de/schema/agent\#place ::p] - puts "************************QueryProperty: $r\n" -} - - -p exportedObjs client -#p startEventLoop "registryTest test" -#p startEventLoop "client callWelcome; registryTest test" -p startEventLoop "AgentExample test-calls" - Index: xotcl/apps/actiweb/Counter.README =================================================================== diff -u -N --- xotcl/apps/actiweb/Counter.README (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/actiweb/Counter.README (revision 0) @@ -1,61 +0,0 @@ -* $Id: Counter.README,v 1.1 2004/05/23 22:50:39 neumann Exp $ -* -* Variationen des Counter-Themas im ActiWeb: -* (Zeilenangaben ohne Kommentare und Leerzeilen) -* -* - -1) Counter.xotcl (22 Zeilen) - - Die Klasse Counter wird als Spezialisierung von HtmlDocument - definiert ("Ein Dokument mit weiteren Methoden") - - Aufruf: - http://localhost:8090/counter-1.html - http://localhost:8090/counter-2.html - - -2) Counter2.xotcl (32 Zeilen) - - Die Klasse Counter wird als Spezialisierung von WebAgent - definiert, der ein plain/text interface besitzt. Zus�tzlich - wird eine Web-Facade definiert, die fuer die HTML-spezifische - Pr�sentation des WebAgenten sorgt. - - Aufruf: - http://localhost:8091/htmlUI+invoke+c1 - http://localhost:8091/htmlUI+invoke+c2 - - -3) Counter3.xotcl (28 Zeilen) - - Die Klasse Counter wird v�llig unabh�ngig von jeder - Web-Nutzung definiert (Sachmodell). Als Spezialisierung - dieser Counter-Klasse wird die Klasse Web-Counter definiert, - die auch von HTML-Document erbt. Diese Klasse ist fuer - die HTML-Aufbereitung zust�ndig. Es werden Instanzen von - Web-Counter erzeugt. - - Aufruf: - http://localhost:8093/c1 - http://localhost:8093/c2 - - -4) Counter4.xotcl (33 Zeilen) - - Die Klasse Counter wird v�llig unabh�ngig von jeder - Web-Nutzung definiert (Sachmodell). Ebenso unabh�ngig - von der Web-Nutzung wird PersistentCounter als - spezialisierte Counter-Klasse definiert. Von diesen persistenten - Countern werden Instanzen gebildet (web-unabhaengig). - - Als weitere Instanzen werden Proxy-Objekte erzeugt, - die f�r die HTML-Aufbereitung zust�ndig sind, und die - hereinkommende Requests an die im "Hintergrund" existierenden - eigentlichen Objekte weitergeben, und deren Ergebnisse - entsprechend aufbereiten. Es werden nur die Proxy-Objekte - exportiert, nur diese sind ueber den Web-Server ansprechbar. - - Aufruf: - http://localhost:8094/wc1 - http://localhost:8094/wc2 Index: xotcl/apps/actiweb/Counter.xotcl =================================================================== diff -u -N --- xotcl/apps/actiweb/Counter.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/apps/actiweb/Counter.xotcl (revision 0) @@ -1,42 +0,0 @@ -#!../../src/xotclsh -# $Id: Counter.xotcl,v 1.4 2006/09/27 08:12:39 neumann Exp $ -#load /Users/neumann/src/xotcl-1.4.1/library/store/XOTclSdbm/libxotclsdbm1.2.dylib -array set opts {-pkgdir .}; array set opts $argv -lappend auto_path $opts(-pkgdir) - -package require XOTcl; namespace import -force xotcl::* -package require xotcl::actiweb::htmlPlace -package require xotcl::actiweb::webDocument - -### Instantiate an Html place with the name receive and port 8090 -HtmlPlace ::receiver -port 8090 -allowExit exit - -### Define a class Counter as a special Html Document -Class Counter -superclass HtmlDocument -parameter {{count 0}} - -Counter instproc init args { ;### Constructor - next - my persistent count ;### make count variable persistent - ::receiver exportObjs [self] ;### export the counter object - my exportProcs increment ;### export counter's increment method -} -Counter instproc default {} { ;### Method for updating HTML page - set objName [string trimleft [self] :] - return "The value in $objName is now: [my set count].

    - Increment Counter

    -


    Last Update: [clock format [clock seconds]] - \n" -} -Counter instproc increment {} { ;### exported increment method - my incr count - return [my default] -} - -### Create two counter instances with the names -### counter-1.html and counter-2.html -Counter counter-1.html -Counter counter-2.html - -### Start event loop and handle connections -receiver startEventLoop - Index: xotcl/apps/actiweb/Counter2.xotcl =================================================================== diff -u -N --- xotcl/apps/actiweb/Counter2.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/apps/actiweb/Counter2.xotcl (revision 0) @@ -1,65 +0,0 @@ -#!../../src/xotclsh -# $Id: Counter2.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ -array set opts {-pkgdir .}; array set opts $argv -lappend auto_path $opts(-pkgdir) - -package require XOTcl; namespace import -force xotcl::* - -package require xotcl::actiweb::htmlPlace -package require xotcl::actiweb::pageTemplate - -HtmlPlace ::receiver -port 8091 -allowExit exit - -### -### The counter class is an agent implementing the business logic -### -Class Counter -superclass Agent -parameter {{count 1}} - -Counter instproc init args { ;### Constructor - next ;### Call superclass constructor - my persistent count ;### make count variable persistent -} -Counter instproc increment {} { ;### increment method - my incr count -} -### Create two counter instances c1/c2 -Counter c1 -Counter c2 - -### -### Define a specialization of web object as a facade to the counters -### The Page Template Mixin defines the HTML appearance -### - -### Define an HTML Page Template -Class WebCounter -superclass WebObject \ - -instmixin PageTemplateHtml -parameter {counter} - -WebCounter instproc init args { - next - [my set place] exportObjs [self] ;### export the web counter object - my exportProcs increment ;### export counter's increment method -} -WebCounter instproc increment {} { ;### A method that decorates increment with HTML appearence - my instvar counter ;### import var that stores shielded web agent - $counter [self proc] ;### call the actual method on the web agent - my default ;### update HTML page -} -WebCounter instproc default {} { ;### Method for updating HTML page - my instvar count counter ;### importiere var that stores shielded web agent - $counter instvar count ;### importiere count var - # - # and create web-page with counter content - # - my simplePage [self] "Html-Facade for $counter using a page template" \ - "The value in $counter is $count.

    - Increment Counter

    " -} -# -# create two web-facade instances; one for each counter -# -WebCounter web-c1 -counter c1 -WebCounter web-c2 -counter c2 - -### Start event loop and handle connections -receiver startEventLoop Index: xotcl/apps/actiweb/Counter3.xotcl =================================================================== diff -u -N --- xotcl/apps/actiweb/Counter3.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/actiweb/Counter3.xotcl (revision 0) @@ -1,44 +0,0 @@ -#!../../src/xotclsh -# $Id: Counter3.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ -array set opts {-pkgdir .}; array set opts $argv -lappend auto_path $opts(-pkgdir) - -package require XOTcl; namespace import -force xotcl::* -package require xotcl::actiweb::htmlPlace -package require xotcl::actiweb::webDocument - -### Instantiate an Html place with the name receiver -HtmlPlace ::receiver -port 8093 -allowExit exit - -### Define a class solely for counting -Class Counter -parameter {{count 1}} -Counter instproc increment {} { ;### counter method - my incr count -} - -### Define a special WebCounter as a specialization of the Counter class -Class WebCounter -superclass {Counter HtmlDocument} -WebCounter instproc init args { ;### Constructor - next - my persistent count ;### make count variable persistent - ::receiver exportObjs [self] ;### export the counter object - my exportProcs increment ;### export increment method -} -WebCounter instproc default {} { ;### Method for updating HTML page - set objName [string trimleft [self] :] - return "The value in $objName is [my set count].

    - Increment Counter

    -


    Last Update: [clock format [clock seconds] -format %m/%d/%y-%H:%M] - \n" -} -WebCounter instproc increment {} { ;### exported increment method - next ;### call superclasses' increment - my default ;### display the result as HTML -} - -### Create two web counter instances with the names c1 and c2 -WebCounter c1 -WebCounter c2 - -### Start event loop and handle connections -receiver startEventLoop Index: xotcl/apps/actiweb/Counter4.xotcl =================================================================== diff -u -N --- xotcl/apps/actiweb/Counter4.xotcl (revision 09f6e8e5fc0163ad71fcf113a5b5dfc63da4a5db) +++ xotcl/apps/actiweb/Counter4.xotcl (revision 0) @@ -1,56 +0,0 @@ -#!../../src/xotclsh -# $Id: Counter4.xotcl,v 1.2 2004/07/27 21:39:46 neumann Exp $ -array set opts {-pkgdir .}; array set opts $argv -lappend auto_path $opts(-pkgdir) - -package require XOTcl; namespace import -force xotcl::* -package require xotcl::actiweb::htmlPlace -package require xotcl::actiweb::webDocument - -### Instantiate an Html place with the name receiver -HtmlPlace ::receiver -port 8094 -allowExit exit - -### Define a class solely for counting -Class Counter -parameter {{count 1}} -Counter instproc increment {} { ;### counter method - my incr count -} - -### Define a Counter subclass for persistent counting -Class PersistentCounter -superclass Counter -PersistentCounter instproc init args { ;### Constructor - next ;### call superclasses' init - my mixinStrategy Persistent=Eager - my persistenceMgr [Place getInstance]::agentPersistenceMgr - my persistent count ;### make count variable persistent -} - -### Create two persistent counter instances with the names c1 and c2 -PersistentCounter c1 -PersistentCounter c2 - - -### Define a proxy class, that handles HTML decoration -### HtmlProxy forwards all unknown calls to "realSubject" -Class HtmlProxyCounter -superclass HtmlProxy -HtmlProxyCounter instproc init args { ;### Constructor - next - my exportProcs increment ;### export increment method -} -HtmlProxyCounter instproc default {} { - my instvar realSubject - $realSubject instvar count - set objName [string trimleft [self] :] - return "The value in $realSubject is $count.

    - Increment Counter

    -


    Last Update: [clock format [clock seconds] -format %m/%d/%y-%H:%M] -] - \n" -} - -### Create two proxy instances wc1 und wc2 -HtmlProxyCounter wc1 -realSubject c1 -HtmlProxyCounter wc2 -realSubject c2 - -### Start event loop and handle connections -receiver startEventLoop Index: xotcl/apps/actiweb/FormsWithState.xotcl =================================================================== diff -u -N --- xotcl/apps/actiweb/FormsWithState.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/actiweb/FormsWithState.xotcl (revision 0) @@ -1,205 +0,0 @@ -#!../../src/xotclsh -# $Id: FormsWithState.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ -# -# Demo Program for Multi-Page Forms implemented via hidden -# Form Fields -gn -# -package require XOTcl; namespace import -force xotcl::* -package require xotcl::actiweb::htmlPlace -package require xotcl::actiweb::webDocument -HtmlPlace receiver -port 8086 - -# The following class is used to define HTML-pages -Class HTMLPage -superclass HtmlDocument -parameter { - {pageContent ""} - {pageTitle ""} - {pageHeader ""} - endCmd -} - -HTMLPage instproc init args { - receiver exportObjs [self] - next -} - -# instproc default is evoked whenever an HTMLDocument object -# is called without a specific method. -HTMLPage instproc default args { - my instvar content - # creates HTML page content - set content - append content \ - [my set pageTitle] \ - [my set pageHeader] \n \ - [my set pageContent] - # substitutes all embedded commands and variables in content - set content [subst $content] - - # An HTMLPage can provide a command, which is executed after - # the content is computed; this mechanism is used here for deleting - # the context object - if {[my exists endCmd]} { - eval [my set endCmd] - } - # next sends content to the client - next -} - -# The form state is kept in a context object. The method varname -# accesses variables from the context object or returns empty values. -HTMLPage instproc get varname { - my instvar context - if {[$context exists $varname]} { - return [$context set $varname] - } else { - return "" - } -} - -# The final page will contain a table with all the variables in -# the context object -HTMLPage instproc printAll {} { - my instvar context - set result "
    -
      - - - \n" - # creates a table row for each variable and - # it's value of the current context object - foreach var [$context info vars] { - append result \ - \n - } - return "$result
    - Submission
    - You submitted the following values: -
       
    $var:[$context set $var]
    \n
    " -} - -HTMLPage form1 -form1 proc default {} { - set values {} - # process the form data from post method - foreach a [my getFormData] { - set name [$a set name] - switch -glob $name { - *.html {set nextPage $name} - context {set context [$a set content]} - default {lappend values $name [$a set content]} - } - } - # save the form data in the context object - foreach {name value} $values { - $context set $name $value - } - if {![info exists nextPage]} { - # We assume, we are called the first time... - # Create a new context object and call the first page - set context [Object new] - set nextPage [self]/page1.html - } - $nextPage set context $context - # delegeate to the actual form page - $nextPage default -} - -HTMLPage form1/page1.html -pageTitle "First Page" -pageContent { -
    - - - - - -
      - - - - - - - - - -
    - - Primary Contact information
    - Please supply us with full details of - the person who will act as the - person we will contact about this paper. -
       
    - First Name:
    - -
    -
    - Second Name:
    - -

    -
    - -
    -
    -} - - -HTMLPage form1/page2.html -pageTitle "Second Page" -pageContent { - - - -
      - - - - - - - - - - - - - -
    - Title and Autors
    - Please supply full title of the paper and the contributing authors. -
      
    - Title:
    - -

    -
    - Authors:
    - -

    -
    - - - -
    -
    -} - -### submit.html ist the final page; the context object is destroyed here -HTMLPage form1/submit.html \ - -endCmd {[my set context] destroy} \ - -pageTitle "Third Page" -pageContent { - [my printAll] -

    Many thanks for your submission!

    - } - -### provide a default page for the receiver -receiver proc default args { - return { - -

    Welcome to the paper provision page

    - In order to fill out the form, press - here - - } -} - -receiver startEventLoop Index: xotcl/apps/actiweb/MC.xotcl =================================================================== diff -u -N --- xotcl/apps/actiweb/MC.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/actiweb/MC.xotcl (revision 0) @@ -1,212 +0,0 @@ -#!../../src/xotclsh -# $Id: MC.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ -# -# A simple multiple choice test application -# -array set opts {-pkgdir .}; array set opts $argv -lappend auto_path $opts(-pkgdir) - -package require XOTcl; namespace import -force xotcl::* -#package require xotcl::package; package verbose 1 -package require xotcl::actiweb::htmlPlace -package require xotcl::actiweb::pageTemplate - -HtmlPlace ::receiver -port 8092 -allowExit exit - -# Define a pool of questions: Question and their alternatives -# are defined as classes and all questions are stored in the pool -# -Class Pool -Class Pool::Question -parameter {text {altcounter 1}} -Class Pool::Question::Alternative -parameter {text correct} - -Pool::Question instproc alternatives {pairs} { - my instvar altcounter - foreach {alt correct} $pairs { - incr altcounter - [self class]::Alternative [self]::$altcounter \ - -text $alt -correct $correct - } -} - - -# -# An Exam has a name and is a selection of questions from a pool. -# "requiredCorrect" defines the minimal number of correct answers -# to pass the test. - -Class Exam -parameter {name requiredCorrect pool questions} - - -# -# For every candidate we create an individual exam. We scramble -# the questions and alternatives and use the studentID as a seed. -# - -Class IndividualExam -superclass Agent -parameter {ID exam} - -IndividualExam instproc random modulo { ;### random number generator - my instvar seed - set seed [expr {($seed*12731+34197) % 21473}] - return [expr {$seed % $modulo}] -} -IndividualExam instproc permute {list} { ;### permute random permutation - set permuted {} - for {set nr [llength $list]} {$nr>0} {incr nr -1} { - set select [my random $nr] - lappend permuted [lindex $list $select] - set list [lreplace $list $select $select] - } - return $permuted -} -IndividualExam instproc init args { - my instvar seed ID exam individualTest alternatives - set questions [$exam set questions] - set seed $ID - ### compute order of individual tests and alternatives - foreach index [my permute [$exam set questions]] { - set questionObj [$exam set pool]::$index - lappend individualTest $index - set alts [my permute [lsort [$questionObj info children]]] - lappend alternatives $alts - } - #puts stderr "Individual test [self] has $individualTest" -} - -# -# Define a web facade using a page template -# "testObject" is the individual test that is shielded by the web facade -# -Class WebExam -superclass WebObject \ - -instmixin PageTemplateHtml -parameter {testObject} -WebExam instproc default {} { ;### This method creates the HTML Test - my instvar testObject ;### import var that stores shielded test object - ### import vars from the test - $testObject instvar individualTest alternatives exam - set action [my selfAction result] - ### create Test page - set htmlText "\n
      \n" - ### iterate over the set of questions/alternatives - ### and add them to the HTML text - foreach question $individualTest alts $alternatives { - append htmlText "
    1. [[$exam pool]::$question text]\n
        \n" - foreach a $alts { - append htmlText "
      • \ - [$a text] ([$a correct])\n" - } - append htmlText "

      \n" - } - ### we have to add a hidden form field, otherwise we get no result, - ### if nothing is tagged - append htmlText "" - ### the submit button lets us send the result back - append htmlText "

    \n" - ### create simple HTML Page - my simplePage [$exam name] \ - "Exam [$exam name] for [string trimleft $testObject :] \ - (Exam: $exam)" $htmlText -} -WebExam instproc result {} { ;# This method analyses the results of the test - my instvar testObject ;### import var that stores shielded test - set exam [$testObject exam] - $testObject instvar individualTest alternatives - foreach question $individualTest alts $alternatives { - foreach a $alts {set ca($a) 0} - } - foreach a [my getFormData] {set ca([$a set content]) 1} - set htmlText "You have answered:
      " - array set answerText {0 " -- answered no\n" 1 " -- answered yes\n"} - array set correctText {0 "\n -- Wrong.
      \n" 1 "\n -- Correct.
      \n"} - set correctAnswers 0 - foreach q $individualTest { - set correct 1 - append htmlText "
    • [[$exam pool]::$q text]:
      \n" - foreach alternative [[$exam pool]::$q info children] { - set altCorrect [expr {$ca($alternative) == [$alternative correct]}] - append htmlText [$alternative text]\n \ - $answerText($ca($alternative)) \ - $correctText($altCorrect) - set correct [expr {$correct && $altCorrect}] - } - if {$correct} {incr correctAnswers} - } - append htmlText
    \n - if {$correctAnswers < [$exam requiredCorrect]} { - my simplePage [self] "Sorry" "$htmlText\ - Only $correctAnswers question were answered correctly. You have not succeeded :(" - } else { - my simplePage [self] "Congratulations" "$htmlText\ - $correctAnswers questions were answered correctly. You have succeeded :-)" - } -} -WebExam instproc init args { - next - [my place] exportObjs [self] ;# export object - my exportProcs result ;# export methods -} - - - - - -# Create a Pool P with 6 example questions with 3 alternatives for each. - -Pool p -Pool::Question p::1 \ - -text "When was the first XOTcl Version released?" -alternatives { - "1998" 0 - "1999" 1 - "2000" 0 - } -Pool::Question p::2 -text "Who is author of XOTcl?" -alternatives { - "Gustaf Neumann" 1 - "Mika Haekinnen" 0 - "Uwe Zdun" 1 -} -Pool::Question p::3 -text "Which of the systems are other OO extensions of Tcl?" \ - -alternatives { - "XTCL" 0 - "ITCL" 1 - "OTCL" 1 - } -Pool::Question p::4 \ - -text "Which methods are provided by the Object class?" -alternatives { - "set" 1 - "instvar" 0 - "filter" 1 - } -Pool::Question p::5 \ - -text "Which methods are provided by the Object class?" -alternatives { - "unset" 1 - "instproc" 0 - "mixin" 1 - } -Pool::Question p::6 \ - -text "Which methods are provided by the Class class?" -alternatives { - "proc" 0 - "instproc" 1 - "mixin" 0 - } - -### Define an exam - -Exam xotclTest \ - -pool p \ - -name "XOTcl Test" \ - -questions {1 2 3 4 5} \ - -requiredCorrect 4 - - -### Define two Student tests with the XOTcl Test - -foreach {Student ID} { - Uwe 7850247 - Gustaf 7850248 -} { - ## Define the individual exams - IndividualExam $Student -exam xotclTest -ID $ID - ### Define a web facade for each student - WebExam $Student.html -testObject $Student - -} -receiver startEventLoop Index: xotcl/apps/actiweb/Receiver.xotcl =================================================================== diff -u -N --- xotcl/apps/actiweb/Receiver.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/actiweb/Receiver.xotcl (revision 0) @@ -1,22 +0,0 @@ -#!/usr/bin/env tclsh -#if {![info exists ACTIWEB_HOME]} {source ~/actiweb/paths.xotcl} -package require XOTcl; namespace import -force xotcl::* - -package require xotcl::actiweb::htmlPlace -package require xotcl::actiweb::webDocument - -HtmlPlace receiver -port 8087 - -HtmlDocument hallo.txt -content "************ HALLO *************" -receiver exportObjs hallo.txt -hallo.txt exportProcs content -#hallo.txt attachFile ~/public_html/index.html -Class CloneableClass -superclass {Agent Class} - -FileObjectifier do -do objectifyTree receiver ~/public_html - -#GraphicDirectoryObjectifier gdo -#gdo objectifyTree receiver ~www/bilder/Einweihung/disk1/ - -receiver startEventLoop Index: xotcl/apps/actiweb/examples.README =================================================================== diff -u -N --- xotcl/apps/actiweb/examples.README (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/actiweb/examples.README (revision 0) @@ -1,71 +0,0 @@ -* $Id: examples.README,v 1.1 2004/05/23 22:50:39 neumann Exp $ -* -* This directory contains several simple ActiWeb introductory examples -* - -* -* 4 Variations of the counter theme: -* - -1) Counter.xotcl (22 lines) - - The class counter is a special HtmlDocument that is made active - by adding methods to the document. - - After starting the program, you can call it from your web browser: - http://localhost:8090/counter-1.html - http://localhost:8090/counter-2.html - - -2) Counter2.xotcl (32 lines) - - The Class Counter is a special WebAgent, with a plain/text - interface. Additionally it has an HTML Facade that shields - the sub-system and allows to access the web agent with an - HTML presentation. - - The plain/text interface is: - http://localhost:8091/c1 - http://localhost:8091/c2 - The web facades are: - http://localhost:8091/web-c1 - http://localhost:8091/web-c2 - - -3) Counter3.xotcl (28 lines) - - This example demonstrates how an existing business logic (here: - a small Counter class) can be enhanced with a web representation. - A class WebCounter inherits from Counter and from HtmlDocument. - The two web counter instances are accessible via: - http://localhost:8093/c1 - http://localhost:8093/c2 - - -4) Counter4.xotcl (33 lines) - - The Counter class and a derived persistent counter are - independent of any web usage. Two instances c1 and c2 -- that - are inpendent from the usage as web counters -- are created. - - Two proxy object w1 and w2 handle the HTML decoration and forward - the calls to the persistent counter instances c1/c2 as the real - subjects for handling the calls. Only the proxies are exported, because - c1/c2 can not be reached via the web server. - - Calls: - http://localhost:8094/wc1 - http://localhost:8094/wc2 - -* -* A simple Multiple Choice Test: MC.xotcl -* - - The multiple choice test implements a simple test and evaluation - and a web facade for the test. - - Calls: - http://localhost:8092/Gustaf.html - http://localhost:8092/Uwe.html - - Index: xotcl/apps/actiweb/securePlaceDemo.xotcl =================================================================== diff -u -N --- xotcl/apps/actiweb/securePlaceDemo.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/actiweb/securePlaceDemo.xotcl (revision 0) @@ -1,82 +0,0 @@ - - -package require XOTcl; namespace import -force xotcl::* - -# DEMO OF USE OF ACTIWEB AND SSL -# 03/09/01 klaus.kolowratnik@wu-wien.ac.at -# version 0.806 - -# USAGE: -# -# For secure http connections under Tcl or XOTcl we need the tls-package. -# The following code was tested with tls-version 1.4 successfully. -# Download the tls1.4-package from the TLS-Homepage -# (http://sourceforge.net/projects/tls/) and install the -# tarball (tls1.4.1-linux-x86.tar.gz) in your local filesystem. -# You have to append the path of the tls-package to the -# Tcl-variable "auto_path" as seen in the example below -# -# lappend auto_path $homeDir/tls1.4 $homeDir/projects/actiweb -# -# Don't forget to add the tls-package to your "pkgIndex.tlc"-file! -# -# package ifneeded tls 1.4 "[list load [file join $dir libtls1.4.so] ] ; \ -# [list source [file join $dir tls.tcl]]" -# -# For secure http connections ("http://...") we need at least the Actiweb/XOTcl- -# package "secureHtmlPlace": -# -# package require xotcl::actiweb::secureHtmlPlace -# package require xotcl::actiweb::webDocument -# -# We have to register the private server-keyfile and the certifcates -# of the local server and the certification authority. -# If you want to create own self-signed certificates, you can use the -# "SimpleCA"-Certification Authority (http://users.skynet.be/ballet/joris/SimpleCA). -# -# This example uses the following certificates and key-files: -# -# server.key private key of the local server which is run by this program -# server.pem certificate of the local server which is run by this program -# in PEM-format -# cacert.pem certificate of the certification authority -# -# -# SecureHtmlPlace ::receiver -port 8443 -keyfile server.key \ -# -certfile server.pem -cafile cacert.pem -# -# With this changes a https-server with XOTcl can be run. -# -# 2003/11/19 Klaus.Kolowratnik@wu-wien.ac.at - -set homeDir ~h9252717; # home-directory of Klaus -lappend auto_path $homeDir/packages - -package require xotcl::actiweb::htmlPlace -package require xotcl::actiweb::secureHtmlPlace -package require xotcl::actiweb::webDocument - -#HtmlPlace ::receiver -port 8445 -SecureHtmlPlace ::receiver -port 8445 -keyfile server.key -certfile server.pem -cafile cacert.pem - -HtmlDocument test-1.txt -content "************ TEST-1 *************" -::receiver exportObjs test-1.txt -test-1.txt exportProcs content -#test-1.txt attachFile ~/public_html/index.html - -HtmlDocument test-2.txt -content "************ TEST-2 *************" -::receiver exportObjs test-2.txt -test-2.txt exportProcs content - -set readme "This Web-Server uses XOTcl (www.xotcl.org) and Actiweb" -HtmlDocument readme.txt -content $readme -::receiver exportObjs readme.txt -readme.txt exportProcs content - -FileObjectifier do -do objectifyTree ::receiver ~/public_html - -#GraphicDirectoryObjectifier gdo -#gdo objectifyTree ::receiver ~www/bilder/Einweihung/disk1/ - -::receiver startEventLoop Index: xotcl/apps/actiweb/univ/UNIVERSAL.css =================================================================== diff -u -N --- xotcl/apps/actiweb/univ/UNIVERSAL.css (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/actiweb/univ/UNIVERSAL.css (revision 0) @@ -1,21 +0,0 @@ -A {color: yellow; } -A:selected {color: red; } -A:visited {color: #6699FF; } - -BODY {background-color: #000066; color: #FFFFFF; margin-left: 10; shading: no;} - -B.outer { background-color: #000066; color: #FFFFFF; } -B.inner,TD { background-color: #110088; color: #FFFFFF; } - -H1,H2 {font-family:Helvetica,sans-serif; text-align:center; } -H3 {font-family:Helvetica,sans-serif; color: #FFFFFF;} -HR {align:center; shading:no;} -LI,UL,OL {font-family:Helvetica,sans-serif; } - -TABLE {shading: no; border-style: solid; border-color: solid red; background-color: #110088;} - - -TH {font-family:Helvetica,sans-serif;} -DT {font-family:Helvetica,sans-serif; font-weight:bold;} - - Index: xotcl/apps/actiweb/univ/UNIVERSAL.jpg =================================================================== diff -u -N -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -rc72f9f638677608fab1502cd696c8f2d6b2952f9 Binary files differ Index: xotcl/apps/actiweb/univ/UNIVERSAL.rdf =================================================================== diff -u -N --- xotcl/apps/actiweb/univ/UNIVERSAL.rdf (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/actiweb/univ/UNIVERSAL.rdf (revision 0) @@ -1,204 +0,0 @@ - - - - Object Oriented Design and System Development - - Introduction to the concepts of object-oriented programing ... - - Course - WUW-WI-0012346 - - - object-oriented design - software architecture - - - de - application/pdf - 56000 - http://nm.wu-wien.ac.at/Lehre/oo1/01-handout.pdf - Student - 2 to 4 days - University Second Cycle - Lecture - - Author - Prof. Gustaf Neumann - 01.12.1999 - - 1.0 - -- - 2 - en - - Discipline - Information Systems - - - - - Introduction in the programming language object rexx - - This lecture offers an introduction of the programming language 'object rexx'. - - Course - WUW-WI-0011344 - - - rexx - UML - CORBA - - - de - text/html - 0 - http://wwwi.wu-wien.ac.at/Studium/Abschnitt_2/LVA_allgemein/rexx.html - Student - 3 weeks - University First Cycle - Lecture - - Author - Prof.H. Werthner - 01.11.1999 - - 1.0 - -- - 2 - en - - Discipline - Information Systems - - - - - Object Oriented Development of Web-Based Applications - - This lecture offers the basic knowledge about the Internet and - Internet Protocols from an applied point of view. Half of the - lectures present the theoretical background knowledge, and the other - half exercises this knowledge with practical examples.... - - Course - WUW-WI-0012345 - - - TCP/IP - Web Technolgy - Application Server - Agent Systems - XML - RDF - - - de - application/pdf - 14000 - http://nm.wu-wien.ac.at/Lehre/oo2/01-handout.pdf - Student - 2 to 4 days - University Second Cycle - Lecture - - Author - Prof. Gustaf Neumann - 01.01.2000 - - 1.0 - -- - 2 - en - - Discipline - Information Systems - - - - - Legal aspects of information processing - - Introduction of the occuring legal problems in context of the use of information systems - - Course - WUW-WI-0036589 - - - information systems - legal aspects - data processing - - - de - text/html - 0 - http://wwwi.wu-wien.ac.at/Studium/Abschnitt_2/Wahlfach/recht_vo.html - Student - 1 month - University Second Cycle - Lecture - - Author - Dr. Walter Blocher - 01.01.1999 - - 2.1 - -- - 2 - en - - Discipline - Information Systems - - - - - Electronic cash, payment systems and security - - Introduction to electronic cash systems - - Course - WUW-WI-00352228 - - - electronic cash - security - electronic market place - - - de - application/zip - 230000 - http://wwwi.wu-wien.ac.at/finanz/elekgeld.zip - Student - 6 weeks - University Second Cycle - Lecture - - Author - Prof. G. M�ller - 01.01.1998 - - 2.1 - -- - 2 - en - - Discipline - Information Systems - - - - - - Index: xotcl/apps/actiweb/univ/UNIVERSAL.xotcl =================================================================== diff -u -N --- xotcl/apps/actiweb/univ/UNIVERSAL.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/apps/actiweb/univ/UNIVERSAL.xotcl (revision 0) @@ -1,267 +0,0 @@ -#!/usr/bin/env tclsh -#$Id: UNIVERSAL.xotcl,v 1.8 2007/08/14 16:38:26 neumann Exp $ -package require XOTcl; namespace import -force xotcl::* -array set opts { - -ssl 0 -instanceFile UNIVERSAL.rdf -cssFile UNIVERSAL.css -root . -pkgdir .} -array set opts $argv - -@ @File { - description { - This is a demo of a Webserver that presents the contents of - an RDF source file in a friendly and easy readable manner. -

    - The RDF file is parsed first into triples which - are added to the resource database RDFdb. This RDFdb used in this - example replaces the standard triple database of xoRDF by an - application specific version, which is easier to process. The triple - database is the source of the Catalog, which displays a short, easy to read - summary of the entries. The database is used as well for the "detailed - view", which presents all the data of the triples through nested HTML tables. -

    - The demo program uses either HTTP or HTTPS (in which case you will require - the SSL/TLS extension of Tcl). - } -} - -lappend auto_path $opts(-pkgdir) -if {$opts(-ssl)} { - package require xotcl::actiweb::secureHtmlPlace - SecureHtmlPlace ::receiver -port 443 -root $opts(-root) -} else { - package require xotcl::actiweb::htmlPlace - HtmlPlace ::receiver -port 8095 -root $opts(-root) -allowExit exit -} -package require xotcl::actiweb::webDocument - -# load RDF processing components -package require xotcl::rdf::parser -package require xotcl::rdf::triple -package require xotcl::xml::printVisitor - -proc loadFile filename { - set F [open $filename r]; set c [read $F]; close $F - return $c -} -# -# instantiate parser and parser an example text into a node tree -# - -#puts stderr "parsing [loadFile $opts(-instanceFile)]" -RDFParser R -R parse [loadFile $opts(-instanceFile)] -puts stderr "parsing done" - -# -# load the nodetree from the parser into the triple database -# -#section Triples -TripleVisitor tv -parser R -tv proc interprete {} { - my instvar topNode parser - if {![my exists topNode]} {set topNode ${parser}::topNode1} - my reset - my interpretNodeTree $topNode -} - -#### Define a simple Resource Database -Class RDFdb -superclass RDFTripleDB -RDFdb instproc isContainer c { - regexp ^[self]::rdfdoc\# $c -} -RDFdb instproc add {predicate subject object} { - set s [self]::$subject - if {[my info children $s] eq ""} { - #puts stderr "create new resource $s" - Resource create $s - } - $s set $predicate $object - next ;# for passing to RDFTripleDB (which provides e.g. prettyTriples) -} -RDFdb instproc reset {} { - foreach c [my info children] { $c destroy } - next -} -RDFdb instproc resources {} { - set result "" - foreach c [my info children] { - if {![my isContainer $c] && - [$c istype Resource]} {lappend result $c} - } - return $result -} -RDFdb instproc querySubject {subject} { - set s [self]::$subject - set result "" - if {[my info children $s] ne ""} { - foreach att [lsort [$s info vars]] { - lappend result $att [$s set $att] - } - } - return $result -} - -# create an Instance of the Resource Database -RDFdb tv::db - - - -# define Resources with its methods -Class Resource -Resource instproc dump {} { - foreach att [lsort [my info vars]] { puts stderr "\t$att = [my set $att]" } -} -Resource instproc substitute {lines} { - set result "" - foreach line [split $lines \n] { - if {[regexp {^ *http:} $line]} { - set value "" - set o [self] - set line [string trim $line] - foreach step $line { - set value [$o set $step] - set o tv::db::$value - } - append result $value - } else { - append result $line - } - } - return $result -} - -Resource instproc pretty {} { - set q [univ selfAction "details [namespace tail [self]]"] - my substitute " - http://nm.wu-wien.ac.at/universal/rdf-lifecycle#Contribute \ - http://nm.wu-wien.ac.at/universal/rdf-lifecycle#Entity -: - http://nm.wu-wien.ac.at/universal/rdf-general#Title -, - http://nm.wu-wien.ac.at/universal/rdf-education#LearningResourceType -, - http://nm.wu-wien.ac.at/universal/rdf-education#TypicalLearningTime -, - http://nm.wu-wien.ac.at/universal/rdf-lifecycle#Contribute \ - http://nm.wu-wien.ac.at/universal/rdf-lifecycle#Date - ([my pretty-access])" -} -Resource instproc pretty-title {} { - my substitute "http://nm.wu-wien.ac.at/universal/rdf-general#Title" -} -Resource instproc pretty-access {} { - set tech http://nm.wu-wien.ac.at/universal/rdf-technical - set format [my substitute "$tech#Format"] - set location [my substitute "$tech#Location"] - if {$format eq "text/html"} { - set label "go" } else { - set label "Download [my substitute $tech#Size] bytes" - } - return "$label" -} - - - -### Definition of the Learning Resource Manager: -Class LrManager -superclass WebDocument -parameter { - {defaultUrl http://nm.wu-wien.ac.at/Lehre/oo2/} -} -LrManager instproc html-title {t} { - my contentType text/html - return "$t\n\n" -} -LrManager instproc html-head {t} { - return "

    $t

    \n" -} - -LrManager instproc details {subject} { - set result [my html-title "Details about a Learning Resource"] - append result [my html-head "Details about the Learning Resource
    '[::tv::db::$subject pretty-title]'"] - #append result "The subject: '$subject' has the following properties:

    \n" - append result [my attributeTable $subject outer] "" -} - -LrManager instproc attributeTable {subject cls} { - set result "" - set lastns "" - foreach {attr value} [tv::db querySubject $subject] { - if {[tv::db isContainer $value]} { - #set q [univ selfAction "details $value"]; set value "$value" - set value [my attributeTable $value inner] - } - regexp {^(.*)\#(.*)$} $attr _ ns property - if {$ns != $lastns} { - if {$lastns ne ""} { append result

    \n } - append result "Attributes from namespace $ns:\n\n" - set lastns $ns - } - append result \ - "" \ - "" \n - } - append result "
    $property$value
    \n" -} - - -LrManager instproc catalog {} { - set result [my html-title "Universal Resources"] - append result [my html-head "Local Learning Resources:"]

      \n - foreach r [lsort [tv::db resources]] { - append result "
    • [$r pretty]

    • \n" - } - return $result
    -} - -LrManager instproc source {file} { - my contentType text/plain - return [loadFile $file] -} - -LrManager instproc nav {} { - set right [my selfAction "catalog"] - set result [my html-title "Universal Navigation Bar"] - set rdfsrc [my selfAction "source $::opts(-instanceFile)"] - set csssrc [my selfAction "source $::opts(-root)/$::opts(-cssFile)"] - set src [my selfAction "source [info script]"] - append result \n \ - "UNIVERSAL HOME \n\ -

    All local Resources

    -

    Search for Title

    -

    Search for Authors

    -
    Internal Use only: -

    XML:RDF Source

    -

    CSS Source

    -

    Source of Meta-Data Application Server

    " -} - -LrManager instproc default {} { - set right [my selfAction "catalog"] - set nav [my selfAction "nav"] - set result [my html-title "Universal"] - append result " - - - - <body>\n\<h2>Query UNIVERSAL database for Resource:</h2>\n\ - -" -} - -LrManager instproc init args { - next - ::receiver exportObjs [self] ;# export object - my exportProcs details catalog nav source ;# export methods -} - - -# create an instance of the Learning Resource manager -LrManager univ -receiver proc default {} {univ default} ;# call it like index.html as default - -# Invoke Tiple Visitor to feed the database -tv interprete -#puts stderr [tv::db prettyTriples] - - -receiver startEventLoop ;# Start event loop - Index: xotcl/apps/actiweb/univ/server.key =================================================================== diff -u -N --- xotcl/apps/actiweb/univ/server.key (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/actiweb/univ/server.key (revision 0) @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDVg+HdA4RAKyYRaxKRSdAw7mQpephZslIf/ZR7Oe3RKZjxu7Sj -PYG56GSc8y6hiaKuGnDmJcEGXZCXWNtUuACVsNlFrlVbGSEfAbXbz6H4eaaX2d2P -KzrjOc//8+5emaFZRelVTYY4sWNLcCuWV2FIhwMJMblYieXM6iEQg4XzdQIDAQAB -AoGAVdY2OC8QvOdb34bHKSeejf1YwSArHWxF/dxpE/0e8YaimRQYM8QnYgDeagaN -yZ1WjF3O44dsCU4WMfIkAvQSL19RLSgT+jPb3Uu9Aotwmg4x+55BKctRphXKiIfu -+a0IfAFDIt8FMRS08AoSB6eBgOBlhTZM2Y0IuC6QTqaBcwUCQQD5XSiEzh44uMOl -N4FbO0MI2NC3pbPg5u1fEJtIawoYOYxbeGHrlOYO2ZN3ZP6+2g5V0kX5tMMeObhE -qQLlmNETAkEA2zJ/Tk3IE5ByEBcGjG26nJ1zLlY13NaiIg+AoSP+7rHg5TPhoQp1 -VVwcqd4ZWCyqgYDFl2TsiiZwKcEIFJBCVwJBANoLpZSLD04V8a2UXV5C8ZjYzZjo -IeP0yXco9D9cqZUJLTwGhckTiB9QDWyHOWH1FjfhCCMS9tKFMiWHi+rrt1UCQQDC -rlvxURX1gmI8NicjzEVk2la1fe5C4QKJW9lzxUOj/qpvB6BK5r4FfVUb7d32uV0K -vjNAXmvT24XdH8usb9/rAkBR1sqUkqwwm0CSe0Rz9IhSlkwWlmvEzSmEguqrd7Zb -rbYJ9NTnV1uFSAX9vcU7lDRp69il6XmyhOL06FYLRaNa ------END RSA PRIVATE KEY----- Index: xotcl/apps/actiweb/univ/server.pem =================================================================== diff -u -N --- xotcl/apps/actiweb/univ/server.pem (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/actiweb/univ/server.pem (revision 0) @@ -1,66 +0,0 @@ -issuer :/C=DE/ST=NRW/L=Essen/O=University of Essen/OU=SWT/CN=Fredj Dridi/Email=Fredj.Dridi@uni-essen.de -subject:/C=DE/ST=NRW/L=Essen/O=University of Essen/OU=SWT/CN=tp600e.wi-inf.uni-essen.de/Email=dridi@tp600e.wi-inf.uni-essen.de -serial :01 - -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=DE, ST=NRW, L=Essen, O=University of Essen, OU=SWT, CN=Fredj Dridi/Email=Fredj.Dridi@uni-essen.de - Validity - Not Before: Apr 28 08:21:19 2000 GMT - Not After : Apr 28 08:21:19 2001 GMT - Subject: C=DE, ST=NRW, L=Essen, O=University of Essen, OU=SWT, CN=tp600e.wi-inf.uni-essen.de/Email=dridi@tp600e.wi-inf.uni-essen.de - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:d5:83:e1:dd:03:84:40:2b:26:11:6b:12:91:49: - d0:30:ee:64:29:7a:98:59:b2:52:1f:fd:94:7b:39: - ed:d1:29:98:f1:bb:b4:a3:3d:81:b9:e8:64:9c:f3: - 2e:a1:89:a2:ae:1a:70:e6:25:c1:06:5d:90:97:58: - db:54:b8:00:95:b0:d9:45:ae:55:5b:19:21:1f:01: - b5:db:cf:a1:f8:79:a6:97:d9:dd:8f:2b:3a:e3:39: - cf:ff:f3:ee:5e:99:a1:59:45:e9:55:4d:86:38:b1: - 63:4b:70:2b:96:57:61:48:87:03:09:31:b9:58:89: - e5:cc:ea:21:10:83:85:f3:75 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Authority Key Identifier: - keyid:D2:B8:E3:2D:A2:5A:22:78:3A:38:F1:1F:F5:7C:AD:8D:A6:C4:41:0F - - X509v3 Extended Key Usage: - TLS Web Server Authentication, TLS Web Client Authentication, Microsoft Server Gated Crypto, Netscape Server Gated Crypto - X509v3 Basic Constraints: critical - CA:FALSE - Signature Algorithm: md5WithRSAEncryption - 38:b5:a1:1c:93:c4:aa:6e:3f:d6:ea:11:7f:7b:2b:11:db:7b: - 22:b3:d2:a8:b3:f3:20:64:6a:25:b4:fe:0d:ac:12:49:a0:6e: - 6d:ef:fb:99:a2:7c:bc:50:b0:eb:42:ef:0a:32:fa:a9:69:e0: - 11:10:9b:00:05:15:97:59:ac:dc:5f:f2:cd:81:28:3e:e6:96: - 86:f4:d7:99:71:52:c3:ca:0f:4a:48:d8:66:b0:da:e8:d1:45: - 84:c4:12:b2:43:ec:63:b6:25:e8:0a:5a:4c:fb:e2:ec:03:36: - 6f:cd:f9:2a:5c:52:ba:02:29:92:f5:bf:c4:96:ff:9e:ed:a3: - cf:02 - ------BEGIN CERTIFICATE----- -MIIDIjCCAougAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCREUx -DDAKBgNVBAgTA05SVzEOMAwGA1UEBxMFRXNzZW4xHDAaBgNVBAoTE1VuaXZlcnNp -dHkgb2YgRXNzZW4xDDAKBgNVBAsTA1NXVDEUMBIGA1UEAxMLRnJlZGogRHJpZGkx -JzAlBgkqhkiG9w0BCQEWGEZyZWRqLkRyaWRpQHVuaS1lc3Nlbi5kZTAeFw0wMDA0 -MjgwODIxMTlaFw0wMTA0MjgwODIxMTlaMIGtMQswCQYDVQQGEwJERTEMMAoGA1UE -CBMDTlJXMQ4wDAYDVQQHEwVFc3NlbjEcMBoGA1UEChMTVW5pdmVyc2l0eSBvZiBF -c3NlbjEMMAoGA1UECxMDU1dUMSMwIQYDVQQDExp0cDYwMGUud2ktaW5mLnVuaS1l -c3Nlbi5kZTEvMC0GCSqGSIb3DQEJARYgZHJpZGlAdHA2MDBlLndpLWluZi51bmkt -ZXNzZW4uZGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANWD4d0DhEArJhFr -EpFJ0DDuZCl6mFmyUh/9lHs57dEpmPG7tKM9gbnoZJzzLqGJoq4acOYlwQZdkJdY -21S4AJWw2UWuVVsZIR8BtdvPofh5ppfZ3Y8rOuM5z//z7l6ZoVlF6VVNhjixY0tw -K5ZXYUiHAwkxuViJ5czqIRCDhfN1AgMBAAGjZzBlMB8GA1UdIwQYMBaAFNK44y2i -WiJ4OjjxH/V8rY2mxEEPMDQGA1UdJQQtMCsGCCsGAQUFBwMBBggrBgEFBQcDAgYK -KwYBBAGCNwoDAwYJYIZIAYb4QgQBMAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQEE -BQADgYEAOLWhHJPEqm4/1uoRf3srEdt7IrPSqLPzIGRqJbT+DawSSaBube/7maJ8 -vFCw60LvCjL6qWngERCbAAUVl1ms3F/yzYEoPuaWhvTXmXFSw8oPSkjYZrDa6NFF -hMQSskPsY7Yl6ApaTPvi7AM2b835KlxSugIpkvW/xJb/nu2jzwI= ------END CERTIFICATE----- - Index: xotcl/apps/comm/client.pem =================================================================== diff -u -N --- xotcl/apps/comm/client.pem (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/comm/client.pem (revision 0) @@ -1,66 +0,0 @@ -issuer :/C=DE/ST=NRW/L=Essen/O=University of Essen/OU=SWT/CN=Fredj Dridi/Email=Fredj.Dridi@uni-essen.de -subject:/CN=Fredj Dridi/Email=fredj_dridi@yahoo.com -serial :02 - -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 2 (0x2) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=DE, ST=NRW, L=Essen, O=University of Essen, OU=SWT, CN=Fredj Dridi/Email=Fredj.Dridi@uni-essen.de - Validity - Not Before: Apr 28 08:24:43 2000 GMT - Not After : Apr 28 08:24:43 2001 GMT - Subject: CN=Fredj Dridi/Email=fredj_dridi@yahoo.com - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:e4:df:a7:f3:ed:61:df:30:ad:d9:6f:63:f2:d1: - 85:9b:72:b2:c6:e4:fd:50:11:c5:0a:29:59:02:60: - 29:f6:2c:6a:35:08:89:49:ad:d4:44:1d:7f:14:18: - 61:4d:e8:66:87:30:01:52:cd:7d:16:72:0e:24:38: - 19:a5:a7:dc:cf:7a:5d:79:ea:48:c6:c4:ae:52:a6: - 94:36:7f:f3:24:43:b0:21:5a:f2:d5:6d:66:38:4c: - b7:7a:0e:ce:12:01:b0:46:4b:ea:08:b4:e0:aa:b8: - 96:dc:3e:15:e0:24:92:84:1f:77:d0:8d:73:d2:f3: - ac:82:b0:61:60:1a:6a:fc:b9 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Alternative Name: - email:fredj_dridi@yahoo.com - X509v3 Basic Constraints: critical - CA:FALSE - X509v3 Authority Key Identifier: - keyid:D2:B8:E3:2D:A2:5A:22:78:3A:38:F1:1F:F5:7C:AD:8D:A6:C4:41:0F - - X509v3 Extended Key Usage: - TLS Web Client Authentication, E-mail Protection - Signature Algorithm: md5WithRSAEncryption - 01:88:26:35:b9:c7:c9:5a:90:ff:b8:9c:37:fa:48:0e:03:82: - b4:18:df:49:e7:5d:42:3a:48:e3:e4:84:c7:b6:ef:cc:91:4c: - 47:9d:34:f9:51:0b:63:d0:35:f9:ad:a5:a9:3d:ef:75:23:0c: - 14:77:59:79:59:58:c8:74:df:01:b8:de:f2:78:47:64:1a:7e: - 4b:09:31:5e:f5:34:e2:ad:5e:e8:81:00:f1:af:fe:48:31:0b: - a9:b1:4d:53:51:9a:15:1f:55:ba:30:e4:0e:02:05:20:4b:de: - 9c:d9:86:f1:e4:d9:18:c4:93:03:19:06:a5:f3:cb:2a:28:a0: - fd:de - ------BEGIN CERTIFICATE----- -MIICuzCCAiSgAwIBAgIBAjANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCREUx -DDAKBgNVBAgTA05SVzEOMAwGA1UEBxMFRXNzZW4xHDAaBgNVBAoTE1VuaXZlcnNp -dHkgb2YgRXNzZW4xDDAKBgNVBAsTA1NXVDEUMBIGA1UEAxMLRnJlZGogRHJpZGkx -JzAlBgkqhkiG9w0BCQEWGEZyZWRqLkRyaWRpQHVuaS1lc3Nlbi5kZTAeFw0wMDA0 -MjgwODI0NDNaFw0wMTA0MjgwODI0NDNaMDwxFDASBgNVBAMTC0ZyZWRqIERyaWRp -MSQwIgYJKoZIhvcNAQkBFhVmcmVkal9kcmlkaUB5YWhvby5jb20wgZ8wDQYJKoZI -hvcNAQEBBQADgY0AMIGJAoGBAOTfp/PtYd8wrdlvY/LRhZtyssbk/VARxQopWQJg -KfYsajUIiUmt1EQdfxQYYU3oZocwAVLNfRZyDiQ4GaWn3M96XXnqSMbErlKmlDZ/ -8yRDsCFa8tVtZjhMt3oOzhIBsEZL6gi04Kq4ltw+FeAkkoQfd9CNc9LzrIKwYWAa -avy5AgMBAAGjcjBwMCAGA1UdEQQZMBeBFWZyZWRqX2RyaWRpQHlhaG9vLmNvbTAM -BgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFNK44y2iWiJ4OjjxH/V8rY2mxEEPMB0G -A1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDANBgkqhkiG9w0BAQQFAAOBgQAB -iCY1ucfJWpD/uJw3+kgOA4K0GN9J511COkjj5ITHtu/MkUxHnTT5UQtj0DX5raWp -Pe91IwwUd1l5WVjIdN8BuN7yeEdkGn5LCTFe9TTirV7ogQDxr/5IMQupsU1TUZoV -H1W6MOQOAgUgS96c2Ybx5NkYxJMDGQal88sqKKD93g== ------END CERTIFICATE----- - Index: xotcl/apps/comm/filename.crt =================================================================== diff -u -N --- xotcl/apps/comm/filename.crt (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/comm/filename.crt (revision 0) @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDmDCCAwGgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBlTELMAkGA1UEBhMCYXQx -EDAOBgNVBAgTB0F1c3RyaWExDzANBgNVBAcTBlZpZW5uYTEQMA4GA1UEChMHV1Ut -V2llbjELMAkGA1UECxMCV0kxHjAcBgNVBAMTFW1vaGVnYW4ud3Utd2llbi5hYy5h -dDEkMCIGCSqGSIb3DQEJARYVbmV1bWFubkB3dS13aWVuLmFjLmF0MB4XDTAyMDQw -MjEwNDUwN1oXDTAyMDUwMjEwNDUwN1owgZUxCzAJBgNVBAYTAmF0MRAwDgYDVQQI -EwdBdXN0cmlhMQ8wDQYDVQQHEwZWaWVubmExEDAOBgNVBAoTB1dVLVdpZW4xCzAJ -BgNVBAsTAldJMR4wHAYDVQQDExVtb2hlZ2FuLnd1LXdpZW4uYWMuYXQxJDAiBgkq -hkiG9w0BCQEWFW5ldW1hbm5Ad3Utd2llbi5hYy5hdDCBnzANBgkqhkiG9w0BAQEF -AAOBjQAwgYkCgYEA5iT1aT1zU5mfqabGQWcdLyGVFlJBuiKnD2wCVDBIJFVYk6EJ -FrFadKgUXNa0Sxrav/5BJyG2ObOrS4BH6yAl8f90QbAokFp9HeW5wkkAhjkSe1Rw -vcts9F+R6OhcBxO+tQ6maR9wIGfWoK+vWDyfO7wnHjiL2YZFW73mDBUuHO8CAwEA -AaOB9TCB8jAdBgNVHQ4EFgQUbnmEzLNHBNqySdNmPzLSf+yjEc8wgcIGA1UdIwSB -ujCBt4AUbnmEzLNHBNqySdNmPzLSf+yjEc+hgZukgZgwgZUxCzAJBgNVBAYTAmF0 -MRAwDgYDVQQIEwdBdXN0cmlhMQ8wDQYDVQQHEwZWaWVubmExEDAOBgNVBAoTB1dV -LVdpZW4xCzAJBgNVBAsTAldJMR4wHAYDVQQDExVtb2hlZ2FuLnd1LXdpZW4uYWMu -YXQxJDAiBgkqhkiG9w0BCQEWFW5ldW1hbm5Ad3Utd2llbi5hYy5hdIIBADAMBgNV -HRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4GBANj6u54TmwEJg/Ldvfx+Qrax+66n -zh1EYzxrlYp6eNQVPEyOsF1DJh150Lci1Mm/i71D87yJRVjagTv5dAUdupy9Zf6c -AMMv6KvK5G7q6LC9ArwNiBObsmQUlN7+PzRmG9CerRJ6W8eEYnYB0EHhYVKc8cED -F4mixcF1HGQJI/qN ------END CERTIFICATE----- Index: xotcl/apps/comm/filename.key =================================================================== diff -u -N --- xotcl/apps/comm/filename.key (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/comm/filename.key (revision 0) @@ -1,18 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,075071A5AF5C1D8A - -qmihZRxmNNlGCx9lVC4QQPQS25e4aAg3oHjxDaZ0yyDSKsWz4J04lo2x63QT/88i -z9YUQqyC8ry53D5y3aQKiFuXlDDvX6PtPS+cQANA8g5qOIHsMF3yINfrVEmWkPjx -xOYF2qIGI0ISPTT5AkTN3KVmYE7rbFvqgQMklj/SlNBqeUmKvn1rhUCFAd0jYXa9 -imaKVMj08q4GItLAqPoJNY4K73IHZeaW8GEWAJ5E/KEzYFBnYUiPUN8UPCCQsC+b -ViRF226hCFSu8yDBah8R/u6W9rEa+Vs/T7Cyklnot2FDyCU0EW/lhKBKfEKTmXAe -sBzN7F1hrLFifUD7VzJ2K7zKh7pMy3X+D+0PUjVaIyZWDIH3nOiTzfK6kxksjoE5 -P+fp5IL4okEJgD6MoLJHGWTwfhH9K6QBX01My3s22q5zuiJ3SajRCFlLDn7jTTPV -2OQ9+2FksxJYa5Z5/n63Vslz0+yKv9AVTbrtfrbbRJtmpbElCPrvhzVsuWksRS3A -biZxD5PkWiYDvNm34eOAOARb7n0awTOZ1bqdccT+rhcvo7c+MypIY0/AfZKZK4hN -bWxHR3wZUv+wffx1CBxvsBBomV8XqcqJliVHgdvwDdzl3Z2HbYK3w92RXNY36FYw -C1iqALuxE9nhzyEv0ARfjcXTu0lUmFZOfi4oizzMVj7u2q4mGt0+ZuKBs/fTEEm1 -3L1nLnalGb5ko5OTZ4DMQlP1HCU3UZslImAcc3FFa/WNzhG07/YAlcTS18YUbJYF -19Yx6qrYfrZA2UZq0+8DFa8XgOHCFO0KqQHRfRB/7tGNGxX5md8+9w== ------END RSA PRIVATE KEY----- Index: xotcl/apps/comm/ftp.xotcl =================================================================== diff -u -N --- xotcl/apps/comm/ftp.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/comm/ftp.xotcl (revision 0) @@ -1,12 +0,0 @@ -#!/usr/bin/env tclsh -package require XOTcl; namespace import -force xotcl::* - -@ @File {description { A tiny FTP client }} - -package require xotcl::comm::ftp - -SimpleRequest r1 -url ftp://prep.ai.mit.edu/README -if {[r1 success]} { - puts "Got:" - puts [r1 getContent] -} Index: xotcl/apps/comm/get-regression-nb.xotcl =================================================================== diff -u -N --- xotcl/apps/comm/get-regression-nb.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/apps/comm/get-regression-nb.xotcl (revision 0) @@ -1,419 +0,0 @@ -#!/usr/bin/env tclsh -package require XOTcl; namespace import -force xotcl::* - -# ./get-regression-nb.xotcl -host swt -parallel 0 -# ./get-regression-nb.xotcl -host swt -sequential 0 -# -# mit ~/wafe/src/cineast/webserver.xotcl (benotigt ~/wafe/test/*) -# ./get-regression-nb.xotcl -port 8086 -# -# Vergleich webserver.xotcl mit Apache: -# 1) installation von Apache auf port 80 -# -# 2) installation vom webserver.xotcl auf port 8086 -# -# 3) von beiden server sollend die files in wafe/test/* unter -# http://SERVER+PORT/test/* -# erreichbar sein. -# -# 4) test der installation -# apache: -# cd wafe/src/cineast -# get-regression-nb.xotcl -sequential 0 -# die ausgabe sollte mit totalbytes=6536120 -# abgeschlossen werden -# -# webserver.xotcl: -# cd wafe/src/cineast -# get-regression-nb.xotcl -port 8086 -sequential 0 -# die ausgabe sollte mit totalbytes=6536120 -# abgeschlossen werden -# -# 5) grosser testlauf: -# rsh muss funktionieren: z.B.: rsh localhost date -# -# apache: -# cd wafe/src/cineast -# time get-regression-nb.xotcl -sequential 0 -clients 1 -# -# webserver.xotcl: -# cd wafe/src/cineast -# time get-regression-nb.xotcl -port 8086 -sequential 0 -clients 1 -# -# Ergebnisse auf meinem Rechner: -# -# der xotcl-webserver ist etwa 20% langsamer als apache. -# das logging (instproc log) aktivieren kostet ein paar weitere prozent.... -# -gn -# -# mohegan:~/wafe/src/cineast> time ./get-regression-nb.xotcl -port 8086 -sequential 0 -clients 1 -# Loading source file ~/wafe/src/cineast/Access.xotcl -# Loading source file ~/wafe/src/cineast/PCache.xotcl -# Loading source file ~/wafe/src/cineast/Connection.xotcl -# Loading source file ~/wafe/src/cineast/trace.xotcl -# 1 clients: 3.07 seconds (per client 3.07 seconds, 2127.31 KB/sec) server: 2127.31 KB/sec -# 2 clients: 6.36 seconds (per client 3.18 seconds, 1028.10 KB/sec) server: 2056.20 KB/sec -# 3 clients: 7.71 seconds (per client 2.57 seconds, 847.74 KB/sec) server: 2543.22 KB/sec -# 4 clients: 11.21 seconds (per client 2.80 seconds, 582.92 KB/sec) server: 2331.66 KB/sec -# 5 clients: 10.57 seconds (per client 2.11 seconds, 618.49 KB/sec) server: 3092.45 KB/sec -# 10 clients: 25.07 seconds (per client 2.51 seconds, 260.68 KB/sec) server: 2606.79 KB/sec -# 20 clients: 45.48 seconds (per client 2.27 seconds, 143.73 KB/sec) server: 2874.58 KB/sec -#0.420u 0.450s 1:49.65 0.7% 0+0k 0+0io 113263310pf+0w -# -# -# -# mohegan:~/wafe/src/cineast> time ./get-regression-nb.xotcl -port 80 -sequential 0 -clients 1 -# Loading source file ~/wafe/src/cineast/Access.xotcl -# Loading source file ~/wafe/src/cineast/PCache.xotcl -# Loading source file ~/wafe/src/cineast/Connection.xotcl -# Loading source file ~/wafe/src/cineast/trace.xotcl -# 1 clients: 1.85 seconds (per client 1.85 seconds, 3542.58 KB/sec) server: 3542.58 KB/sec -# 2 clients: 4.71 seconds (per client 2.36 seconds, 1387.02 KB/sec) server: 2774.03 KB/sec -# 3 clients: 4.09 seconds (per client 1.36 seconds, 1596.58 KB/sec) server: 4789.74 KB/sec -# 4 clients: 7.74 seconds (per client 1.94 seconds, 844.43 KB/sec) server: 3377.71 KB/sec -# 5 clients: 9.46 seconds (per client 1.89 seconds, 690.67 KB/sec) server: 3453.33 KB/sec -# 10 clients: 20.91 seconds (per client 2.09 seconds, 312.52 KB/sec) server: 3125.24 KB/sec -# 20 clients: 39.01 seconds (per client 1.95 seconds, 167.55 KB/sec) server: 3351.08 KB/sec -#0.410u 0.360s 1:27.95 0.8% 0+0k 0+0io 112251994pf+0w -# -# - -set CACHE_DIR [::xotcl::tmpdir] - -package require xotcl::comm::httpAccess -package require xotcl::trace - -set port "" -set host localhost -set cachingopts {0 1 2 2} -set parallel 1 -set sequential 0 -set clients 0 -set local 1 - -foreach {att val} $argv { - switch -exact -- $att { - -port {set port $val} - -host {set host $val} - -memory {set cachingopts 0} - -parallel {set parallel $val} - -sequential {set sequential $val} - -clients {set clients $val} - -local {set local $val} - } -} - -set hosts { - R2H2-11 R2H2-12 R2H2-13 R2H2-21 R2H2-22 R2H2-23 R2H2-31 R2H2-32 - R2H2-33 R2H2-41 R2H2-42 R2H2-43 R2H2-51 R2H2-52 R2H2-53 R2H2-61 - R2H2-62 R2H2-63 R2H2-73 - matush nashawag sagumumpsketuck wawog willimantic wonkituck mashipaug - watuppa -} -#set hosts { -# matush nashawag sagumumpsketuck wawog willimantic wonkituck mashipaug -# R2H2-11 R2H2-12 R2H2-13 R2H2-21 R2H2-22 R2H2-23 R2H2-31 R2H2-32 -# R2H2-33 R2H2-41 R2H2-42 R2H2-43 R2H2-51 R2H2-52 R2H2-53 R2H2-61 -# R2H2-62 R2H2-63 R2H2-73 -# watuppa -#} -set totalbytes 6536120 -set totalbytes 1293240;# ohne 5m request - - -if {$clients} { - proc readable {handle rhost} { - if {[eof $handle]} { - incr ::running -1 - if {[catch {close $handle} output]} { - if {![string match *$::totalbytes $output]} { - puts stderr "invalid output on client on host $rhost" - puts stderr "***********************************" - puts stderr $output - puts stderr "***********************************" - } - } - #puts stderr clients=$::running - if {$::running == 0} { - set ::xxx 1 - } - } else { - gets $handle - } - } - proc clients {clients} { - append cmd "[pwd]/$::argv0 -host $::host " \ - "-parallel $::parallel -sequential $::sequential" - if {$::port ne ""} {append cmd " -port $::port"} - set starttime [clock clicks] - set ::running $clients - for {set s 0} {$s < $clients} {incr s} { - if {$::local} { - set rhost localhost - } else { - set rhost [lindex $::hosts $s] - } - #puts stderr "rsh $rhost $cmd" - puts -nonewline stderr "$rhost " - set f($s) [open "| rsh $rhost $cmd"] - fconfigure $f($s) -blocking 0 - fileevent $f($s) readable "readable $f($s) $rhost" - } - puts stderr "" - vwait ::xxx - set secs [expr {([clock clicks] -$starttime)/1000000.0}] - puts stderr "[format %3d $clients] clients: [format %6.2f $secs] seconds \ - (per client [format %6.2f [expr {$secs/$clients}]] seconds,\ - [format %7.2f [expr {$::totalbytes/($secs*1000.0)}]] KB/sec)\ - server: [format %7.2f [expr {$::totalbytes*$clients/($secs*1000.0)}]] KB/sec" - } - clients 1 - clients 2 - clients 3 - clients 4 - clients 5 - clients 10 - clients 20 - exit -} - -persistentCache clear - -proc assert {f r} { - set got [eval $f] - if {$got ne $r } { - puts stderr "assertion failed: \[$f\] == $r (got $got)" - quit - } else { - puts stderr "OK $r = $f" - } -} -proc head msg { - puts stderr "" - puts stderr "---------------------------- $msg" -} - -proc test {msg cmd} { - set r [Object autoname r] - head $msg - if {[catch {eval $cmd} msg]} { - puts stderr "ERROR: $::errorInfo" - quit - } - $r destroy -} - -Object userPwd -userPwd proc user {u} { - my set user $u -} -userPwd proc show {realm userVar pwVar} { - upvar $userVar u $pwVar pw - set u [my set user] - set pw jogl - return 1 -} - - - - -# test "simple request" { -# SimpleRequest $r -caching 0 \ -# -url http://localhost/index.html -# assert "$r getContentLength" 81 -# } -# test "simple request" { -# SimpleRequest $r -caching 1 \ -# -url http://localhost/index.html -# assert "$r getContentLength" 81 -# } -# test "simple request" { -# SimpleRequest $r -caching 1 \ -# -url http://localhost/index.html -# assert "$r getContentLength" 81 -# } -# test "simple request" { -# persistentCache invalidate \ -# http://localhost/index.html -# SimpleRequest $r -caching 1 \ -# -url http://localhost/index.html -# assert "$r getContentLength" 81 -# } - -# test "simple request" { -# SimpleRequest $r -caching 0 \ -# -url http://localhost/muster-d1klausur.ps -# assert "$r getContentLength" 163840 -# } -set total 0 -proc parallelRequests-1.0 {urls} { - ParallelSink psink -httpVersion 1.0 -init -requests $urls - incr ::total [psink set totalbytes] - psink destroy -} -proc parallelRequests-1.1 {urls} { - ParallelSink psink -init -requests $urls - incr ::total [psink set totalbytes] - psink destroy -} -if {$port ne ""} {set port :$port} - - -if {$parallel} { - parallelRequests-1.0 [list \ - http://$host$port/test/file500.html \ - http://$host$port/test/file5k.html \ - http://$host$port/test/file50k.html \ - http://$host$port/test/file500k.html \ - http://$host$port/test/file5m.html \ - http://$host$port/test/file500.html \ - http://$host$port/test/file5k.html \ - http://$host$port/test/file5k.html \ - http://$host$port/test/file500.html \ - http://$host$port/test/file500.html \ - http://$host$port/test/file5k.html \ - http://$host$port/test/file5k.html \ - http://$host$port/test/file500.html \ - http://$host$port/test/file5k.html \ - http://$host$port/test/file5k.html \ - http://$host$port/test/file500.html \ - ] - for {set i 1} {$i<10} {incr i} { - parallelRequests-1.1 [list \ - http://$host$port/test/file50k.html \ - http://$host$port/test/file5k1.html \ - http://$host$port/test/file5k2.html \ - http://$host$port/test/file5k3.html \ - http://$host$port/test/file5k4.html \ - http://$host$port/test/file5k5.html - ] - } - puts stderr totalbytes=$::total -} - -if {$sequential} { - set doc http://$host$port/test/suexec.html - set size 20680 - foreach c $cachingopts { - test "caching $c $doc" { - SimpleRequest $r -caching $::c -url $::doc - assert "$r getContentLength" $::size - #puts stderr c=<[$r getContent]> - } - } - - set doc http://$host$port/test/xvdocs.ps - set size 3678303 - foreach c $cachingopts { - test "caching $c" { - SimpleRequest $r -caching $::c -url $::doc - assert "$r getContentLength" $::size - } - } - -} -exit - -test "simple request" { - SimpleRequest $r -caching 0 \ - -url http://nestroy.wi-inf.uni-essen.de/Raumplan.html - assert "$r getContentLength" 662 -} - - -test "simple request, larger file" { - SimpleRequest $r -caching 0 \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 -} - - -test "use cache" { - SimpleRequest $r -caching 1 \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 -} - - -test "specify filename, use cache and validate request" { - persistentCache invalidate \ - http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - exec rm -f test.ps - SimpleRequest $r -caching 1 -fileName test.ps \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 - assert "file size test.ps" 349970 - assert {lindex [exec md5sum test.ps] 0} c6029c987e841430f3ca9bab157da12f -} - - -test "specify filename, and use cache and a validated file" { - exec rm -f test.ps - SimpleRequest $r -caching 1 -fileName test.ps \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 - assert "file size test.ps" 349970 - assert {lindex [exec md5sum test.ps] 0} c6029c987e841430f3ca9bab157da12f -} - -test "specify filename, and do not use cache" { - exec rm -f test.ps - SimpleRequest $r -fileName test.ps -caching 0 \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 - assert "file size test.ps" 349970 - assert {lindex [exec md5sum test.ps] 0} c6029c987e841430f3ca9bab157da12f -} - -test "specify filesink and use cache; no copying neccesary" { - persistentCache invalidate \ - http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - SimpleRequest $r -useFileSink 1 -caching 1 \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 - assert "file size test.ps" 349970 -} - - - -test "load a large file to the cache" { - persistentCache clearEntry http://swt.wi-inf.uni-essen.de/lx2.1.55 - SimpleRequest $r -caching 1 \ - -url http://swt.wi-inf.uni-essen.de/lx2.1.55 - assert "$r getContentLength" 522411 -} - - - -test "load a validated large file" { - SimpleRequest $r -caching 1 \ - -url http://swt.wi-inf.uni-essen.de/lx2.1.55 - assert "$r getContentLength" 522411 -} - -test "pure loading test without cache" { - SimpleRequest $r -caching 0 \ - -url http://swt.wi-inf.uni-essen.de/lx2.1.55 - assert "$r getContentLength" 522411 -} - - -test "redirect" { - SimpleRequest $r -caching 1 \ - -url http://mohegan.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 -} - - -test "authentication" { - SimpleRequest $r -caching 1 \ - -url http://nestroy.wi-inf.uni-essen.de/cgi-bin/w3-msql/Forschung/Publikationen/protected/index.html - assert "$r getContentLength" 1164 -} - -puts stderr after -quit - - -### request joining -### load to file depending on content type Index: xotcl/apps/comm/get-regression.xotcl =================================================================== diff -u -N --- xotcl/apps/comm/get-regression.xotcl (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) +++ xotcl/apps/comm/get-regression.xotcl (revision 0) @@ -1,209 +0,0 @@ -#!/usr/bin/env tclsh -package require XOTcl; namespace import -force xotcl::* - -package require xotcl::comm::httpAccess -package require xotcl::trace - -persistentCache clear - -proc assert {f r} { - set got [eval $f] - if {$got ne $r } { - puts stderr "assertion failed: \[$f\] == $r (got $got)" - quit - } else { - puts stderr "OK $r = $f" - } -} -proc head msg { - puts stderr "" - puts stderr "---------------------------- $msg" -} - -proc test {msg cmd} { - set r [Object autoname r] - head $msg - if {[catch {eval $cmd} msg]} { - puts stderr "ERROR: $::errorInfo" - quit - } - $r destroy -} - -Object userPwd -userPwd proc user {u} { - my set user $u -} -userPwd proc show {realm userVar pwVar} { - upvar $userVar u $pwVar pw - set u [my set user] - set pw jogl - return 1 -} - - - - -# test "simple request" { -# SimpleRequest $r -caching 0 \ -# -url http://localhost/index.html -# assert "$r getContentLength" 81 -# } -# test "simple request" { -# SimpleRequest $r -caching 1 \ -# -url http://localhost/index.html -# assert "$r getContentLength" 81 -# } -# test "simple request" { -# SimpleRequest $r -caching 1 \ -# -url http://localhost/index.html -# assert "$r getContentLength" 81 -# } -# test "simple request" { -# persistentCache invalidate \ -# http://localhost/index.html -# SimpleRequest $r -caching 1 \ -# -url http://localhost/index.html -# assert "$r getContentLength" 81 -# } - -# test "simple request" { -# SimpleRequest $r -caching 0 \ -# -url http://localhost/muster-d1klausur.ps -# assert "$r getContentLength" 163840 -# } - -proc parallelRequests {urls} { - JoinSink joinsink -requests [llength $urls] - set i 0 - foreach url $urls { - TimedMemorySink sink$i - set t$i [Access [Access autoname a] -url $url \ - -informObject [list joinsink sink$i] \ - -caching 0] - incr i - } - set i 0 - foreach url $urls { sink$i reportTimes;incr i} - joinsink destroy -} - -# parallelRequests { -# http://localhost/muster-d1klausur.ps -# http://localhost/muster-d1klausur2.ps -# } -# quit - -foreach c {0 1 2 2} { - test "caching $c" { - SimpleRequest $r -caching $::c \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 - } -} - - - -test "simple request" { - SimpleRequest $r -caching 0 \ - -url http://nestroy.wi-inf.uni-essen.de/Raumplan.html - assert "$r getContentLength" 662 -} - - -test "simple request, larger file" { - SimpleRequest $r -caching 0 \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 -} - - -test "use cache" { - SimpleRequest $r -caching 1 \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 -} - - -test "specify filename, use cache and validate request" { - persistentCache invalidate \ - http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - exec rm -f test.ps - SimpleRequest $r -caching 1 -fileName test.ps \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 - assert "file size test.ps" 349970 - assert {lindex [exec md5sum test.ps] 0} c6029c987e841430f3ca9bab157da12f -} - - -test "specify filename, and use cache and a validated file" { - exec rm -f test.ps - SimpleRequest $r -caching 1 -fileName test.ps \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 - assert "file size test.ps" 349970 - assert {lindex [exec md5sum test.ps] 0} c6029c987e841430f3ca9bab157da12f -} - -test "specify filename, and do not use cache" { - exec rm -f test.ps - SimpleRequest $r -fileName test.ps -caching 0 \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 - assert "file size test.ps" 349970 - assert {lindex [exec md5sum test.ps] 0} c6029c987e841430f3ca9bab157da12f -} - -test "specify filesink and use cache; no copying neccesary" { - persistentCache invalidate \ - http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - SimpleRequest $r -useFileSink 1 -caching 1 \ - -url http://nestroy.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 - assert "file size test.ps" 349970 -} - - - -test "load a large file to the cache" { - persistentCache clearEntry http://swt.wi-inf.uni-essen.de/lx2.1.55 - SimpleRequest $r -caching 1 \ - -url http://swt.wi-inf.uni-essen.de/lx2.1.55 - assert "$r getContentLength" 522411 -} - - - -test "load a validated large file" { - SimpleRequest $r -caching 1 \ - -url http://swt.wi-inf.uni-essen.de/lx2.1.55 - assert "$r getContentLength" 522411 -} - -test "pure loading test without cache" { - SimpleRequest $r -caching 0 \ - -url http://swt.wi-inf.uni-essen.de/lx2.1.55 - assert "$r getContentLength" 522411 -} - - -test "redirect" { - SimpleRequest $r -caching 1 \ - -url http://mohegan.wi-inf.uni-essen.de/Lv/muster-d1klausur.ps - assert "$r getContentLength" 349970 -} - - -test "authentication" { - SimpleRequest $r -caching 1 \ - -url http://nestroy.wi-inf.uni-essen.de/cgi-bin/w3-msql/Forschung/Publikationen/protected/index.html - assert "$r getContentLength" 1164 -} - -puts stderr after -quit - - -### request joining -### load to file depending on content type Index: xotcl/apps/comm/link-checker.xotcl =================================================================== diff -u -N --- xotcl/apps/comm/link-checker.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/apps/comm/link-checker.xotcl (revision 0) @@ -1,147 +0,0 @@ -#!/usr/bin/env tclsh -# $Id: link-checker.xotcl,v 1.5 2006/09/27 08:12:39 neumann Exp $ -# -gn july 2000 -package require XOTcl; namespace import -force xotcl::* - -@ @File { - description { - A simple link checking program that checks in parallel - pages of a site. -

    - Options:

    - - - - - - -
    -url Start-URL
    -foreign 0 or 1, specifies, whether foreign links of - local pages should be checked (default 1)
    -local A string match pattern to decide - which url should be treated as local - e.g. -local *wu-wien.ac.at/* - Per default the locality filter ist set - to the name of the host followed by '/*'
    -restrict 0 or 1, sets the locality filter to the subtree - implied by the URL
    -verbose 0 or 1 or 2, verbosity level (default 0)
    - } -} - -if {$tcl_version<8.2} { - puts stderr "This script requires Tcl 8.2 or newer" - exit -1 -} - -set opt(-url) http://localhost:8000/ -set opt(-url) http://nm.wu-wien.ac.at/Lehre/ -set opt(-verbose) 0; # 0, 1 (show check), or 2 (show ignore) -set opt(-foreign) 1; # 0, 1 (check foreign links on local pages) -set opt(-restrict) 0; # 0, 1 - -## per default, lc checks the -array set opt $argv -if {$opt(-restrict)} { - regexp {://(.*)$} $opt(-url) _ opt(-local) - set opt(-local) [string trimright $opt(-local) /]* - puts stderr "locality filter set to '$opt(-local)'" -} -if {![info exists opt(-local)]} { - regexp {http://([^/:]+)} $opt(-url) _ opt(-local) - append opt(-local) /* - puts stderr "locality filter set to '$opt(-local)'" -} - -#package require xotcl::package; package verbose 1 -package require xotcl::comm::httpAccess -package require xotcl::trace - -proc printError {m} {} - -Class Checker -superclass ParallelSink \ - -parameter {verbose foreign local} -Checker array set ref {A HREF IMG SRC} -Checker set ref_re {[[:space:]]*=[[:space:]]*([[:graph:]]+)} -Checker instproc report {msg {level 1}} { - my instvar verbose - if {$verbose>$level} {puts stderr $msg} - return 0 -} -Checker instproc isLocal {url} { - my instvar local - string match *://$local $url -} -Checker instproc isToCheck {url request methodvar} { - my instvar foreign - upvar $methodvar method - if {![regexp -nocase {http://([^/:]+)} $url _ host]} { - return [my report "ignored, no http: $url"] - } - set method GET - if {![my isLocal $url]} { - if {$foreign} { - #puts stderr "parenturl: [$request set parentUrl] -> [my isLocal [$request set parentUrl]]" - if {[$request info vars parentUrl] ne "" && - ![my isLocal [$request set parentUrl]]} { - return [my report "ignored, nor local: $url"] - } else { - set method HEAD - } - } else { - return [my report "ignored, nor local: $url"] - } - } - if {[regexp -nocase {[.](gif|jpg|ps|pdf|gz)$} $url]} { - set method HEAD - #return [my report "ignored due to extension: $url"] - } - return 1 -} -Checker instproc checkLink {request link} { - set resolved [resolve $link [$request set url]] - if {[my isToCheck $resolved $request method]} { - my instvar checked - if {![info exists checked($resolved)]} { - my report "checking .......... $resolved" 0 - set checked($resolved) 1 - my scheduleRequest $method $resolved [$request set url] - } else { - #puts stderr "already checked $resolved" - } - } -} -Checker instproc checkText {request} { - if {![my isLocal [$request set url]]} return - [self class] instvar ref ref_re - set content [$request getContent] - set start 0 - while {[regexp -nocase -indices -start $start -- \ - {<(A|IMG)([^>]*?)} $content a b c]} { - set elem [string toupper \ - [string range $content [lindex $b 0] [lindex $b 1]]] - set attribs [string range $content [lindex $c 0] [lindex $c 1]] - #regsub -all {[\n ]+} $attribs " " attribs - if {[regexp -nocase $ref($elem)$ref_re $attribs _ i]} { - my checkLink $request [string trim $i '\"] - } - set start [lindex $c 1] - } -} -Checker instproc endCb r { - #showObj $r - switch [$r set contentType] { - text/html {my checkText $r} - } - next -} -Checker instproc cancelCb r { - #$r showVars - puts stderr "ERROR in page [$r set parentUrl]" - puts stderr " Link: [$r set url]" - puts stderr " cause [$r set errormsg]\n" - next -} - -Checker csink \ - -verbose $opt(-verbose) -foreign $opt(-foreign) -local $opt(-local) \ - -sinkClass MemorySink -httpVersion 1.0 -maxsimultaneous 30 -csink requests $opt(-url) -puts stderr "sumbytes: [csink set sumbytes] requests: [csink set numrequests]" -csink destroy Index: xotcl/apps/comm/secure-webclient.xotcl =================================================================== diff -u -N --- xotcl/apps/comm/secure-webclient.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/comm/secure-webclient.xotcl (revision 0) @@ -1,52 +0,0 @@ -#!/usr/bin/env tclsh -# $Id: secure-webclient.xotcl,v 1.2 2006/02/18 22:17:32 neumann Exp $ - -package require XOTcl; namespace import -force xotcl::* - -@ @File { - description { - A sample secure web client that queries an secure web-server. - It needs to be adopted with different https URLs for testing... - } -} - -# -package require xotcl::comm::httpAccess -package require xotcl::comm::ftp -package require xotcl::trace - -#set version 1.1 -set hostport localhost:8086 -set http_server http://localhost:8086/ -set https_server https://localhost:8443/ - -set slowURL "http://quote.yahoo.com/q?s=^DJI&d=1d" -set ftpURL "ftp://mohegan.wi-inf.uni-essen.de/welcome.msg" - -set secureURL "https://wawog.wi-inf.uni-essen.de/" -set secureURL "https://test17.wu-wien.ac.at:1234/" - -proc printError msg {puts stderr !!!$msg!!!} - -puts "\nTrying to get a secure page ..... <$https_server>" -SimpleRequest r0 -url $https_server -puts stderr "\n content = {[r0 getContent]}" - -puts -nonewline "\nTrying to load image logo-100.jpg ... (not secure)" -SimpleRequest r2 -url $http_server/logo-100.jpg -if {[r2::sink set contentLength] == 1706} { - puts "suceeded! Loaded 1706 bytes!" -} else { - puts "failed! Loaded [r2::sink set contentLength] (!= 1706) bytes" - exit -} - -puts -nonewline "\nTrying to load image logo-100.jpg secure ... " -SimpleRequest r1 -url $https_server/logo-100.jpg -if {[r1::sink set contentLength] == 1706} { - puts "suceeded! Loaded 1706 bytes!" -} else { - puts "failed! Loaded [r1::sink set contentLength] (!= 1706) bytes" - exit -} -exit Index: xotcl/apps/comm/secure-webserver.xotcl =================================================================== diff -u -N --- xotcl/apps/comm/secure-webserver.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/comm/secure-webserver.xotcl (revision 0) @@ -1,79 +0,0 @@ -#!/usr/bin/env tclsh -# $Id: secure-webserver.xotcl,v 1.2 2006/02/18 22:17:32 neumann Exp $ -package require XOTcl; namespace import -force xotcl::* - -@ @File { - description { - This small secure web server that provides its documents - via SSL (https, port 8443) and plain http (port 8086). -
    - This file requires TLS. If you experice problems with - versions obtained from the Web, contact gustaf.neumann@wu-wien.ac.at - for a patch. - } -} - -# -# We load the following packages: -# -package require xotcl::trace -package require xotcl::comm::httpd -# -# we set the default for document root to ../../src/doc and port to 8443 -# -set root ../../doc -set port 8443 -set class Httpsd -set cb callback ;# use this for triggering the callbacks -#set cb "" - -foreach {att value} $argv { - switch -- $att { - -root {set root $value} - -port {set port $value} - -class {set class $value} - -cb {set cb $value} - } -} -# -# now we can start the web-server instance with these settings -# -Httpd h0 -port 8086 -root $root -$class h1 -port $port -root $root -infoCb $cb \ - -requestCert 1 -requireValidCert 0 - - -# Start des HTTP-Servers mit port 8086 und dem angegebenen Verzeichnis -#Httpd h2 -port 9086 -root $root \ - -mixin {Responder BasicAccessControl} \ - -addRealmEntry test {test test} -protectDir test "" {} - -Object callback -callback proc error {chan msg} { - puts stderr "+++TLS/$chan: error: $msg" -} -callback proc verify {chan depth cert rc err} { - array set c $cert - if {$rc != "1"} { - puts stderr "+++TLS/$chan: verify/$depth: Bad Cert: $err (rc = $rc)" - } else { - puts stderr "+++TLS/$chan: verify/$depth: $c(subject)" - } - return $rc -} -callback proc info {chan state minor msg} { - # For tracing - #upvar #0 tls::$chan cb - #set cb($major) $minor - #puts stderr "+++TLS/$chan: $major/$minor: $state" - puts stderr "+++TLS/$chan $state $minor: $msg" - -} -callback proc unknown {option args} { - return -code error "bad option \"$option\": must be one of error, info, or verify" -} -# -# and finally call the event loop... -# -vwait forever - Index: xotcl/apps/comm/server.key =================================================================== diff -u -N --- xotcl/apps/comm/server.key (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/comm/server.key (revision 0) @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDVg+HdA4RAKyYRaxKRSdAw7mQpephZslIf/ZR7Oe3RKZjxu7Sj -PYG56GSc8y6hiaKuGnDmJcEGXZCXWNtUuACVsNlFrlVbGSEfAbXbz6H4eaaX2d2P -KzrjOc//8+5emaFZRelVTYY4sWNLcCuWV2FIhwMJMblYieXM6iEQg4XzdQIDAQAB -AoGAVdY2OC8QvOdb34bHKSeejf1YwSArHWxF/dxpE/0e8YaimRQYM8QnYgDeagaN -yZ1WjF3O44dsCU4WMfIkAvQSL19RLSgT+jPb3Uu9Aotwmg4x+55BKctRphXKiIfu -+a0IfAFDIt8FMRS08AoSB6eBgOBlhTZM2Y0IuC6QTqaBcwUCQQD5XSiEzh44uMOl -N4FbO0MI2NC3pbPg5u1fEJtIawoYOYxbeGHrlOYO2ZN3ZP6+2g5V0kX5tMMeObhE -qQLlmNETAkEA2zJ/Tk3IE5ByEBcGjG26nJ1zLlY13NaiIg+AoSP+7rHg5TPhoQp1 -VVwcqd4ZWCyqgYDFl2TsiiZwKcEIFJBCVwJBANoLpZSLD04V8a2UXV5C8ZjYzZjo -IeP0yXco9D9cqZUJLTwGhckTiB9QDWyHOWH1FjfhCCMS9tKFMiWHi+rrt1UCQQDC -rlvxURX1gmI8NicjzEVk2la1fe5C4QKJW9lzxUOj/qpvB6BK5r4FfVUb7d32uV0K -vjNAXmvT24XdH8usb9/rAkBR1sqUkqwwm0CSe0Rz9IhSlkwWlmvEzSmEguqrd7Zb -rbYJ9NTnV1uFSAX9vcU7lDRp69il6XmyhOL06FYLRaNa ------END RSA PRIVATE KEY----- Index: xotcl/apps/comm/server.pem =================================================================== diff -u -N --- xotcl/apps/comm/server.pem (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/comm/server.pem (revision 0) @@ -1,66 +0,0 @@ -issuer :/C=DE/ST=NRW/L=Essen/O=University of Essen/OU=SWT/CN=Fredj Dridi/Email=Fredj.Dridi@uni-essen.de -subject:/C=DE/ST=NRW/L=Essen/O=University of Essen/OU=SWT/CN=tp600e.wi-inf.uni-essen.de/Email=dridi@tp600e.wi-inf.uni-essen.de -serial :01 - -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=DE, ST=NRW, L=Essen, O=University of Essen, OU=SWT, CN=Fredj Dridi/Email=Fredj.Dridi@uni-essen.de - Validity - Not Before: Apr 28 08:21:19 2000 GMT - Not After : Apr 28 08:21:19 2001 GMT - Subject: C=DE, ST=NRW, L=Essen, O=University of Essen, OU=SWT, CN=tp600e.wi-inf.uni-essen.de/Email=dridi@tp600e.wi-inf.uni-essen.de - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:d5:83:e1:dd:03:84:40:2b:26:11:6b:12:91:49: - d0:30:ee:64:29:7a:98:59:b2:52:1f:fd:94:7b:39: - ed:d1:29:98:f1:bb:b4:a3:3d:81:b9:e8:64:9c:f3: - 2e:a1:89:a2:ae:1a:70:e6:25:c1:06:5d:90:97:58: - db:54:b8:00:95:b0:d9:45:ae:55:5b:19:21:1f:01: - b5:db:cf:a1:f8:79:a6:97:d9:dd:8f:2b:3a:e3:39: - cf:ff:f3:ee:5e:99:a1:59:45:e9:55:4d:86:38:b1: - 63:4b:70:2b:96:57:61:48:87:03:09:31:b9:58:89: - e5:cc:ea:21:10:83:85:f3:75 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Authority Key Identifier: - keyid:D2:B8:E3:2D:A2:5A:22:78:3A:38:F1:1F:F5:7C:AD:8D:A6:C4:41:0F - - X509v3 Extended Key Usage: - TLS Web Server Authentication, TLS Web Client Authentication, Microsoft Server Gated Crypto, Netscape Server Gated Crypto - X509v3 Basic Constraints: critical - CA:FALSE - Signature Algorithm: md5WithRSAEncryption - 38:b5:a1:1c:93:c4:aa:6e:3f:d6:ea:11:7f:7b:2b:11:db:7b: - 22:b3:d2:a8:b3:f3:20:64:6a:25:b4:fe:0d:ac:12:49:a0:6e: - 6d:ef:fb:99:a2:7c:bc:50:b0:eb:42:ef:0a:32:fa:a9:69:e0: - 11:10:9b:00:05:15:97:59:ac:dc:5f:f2:cd:81:28:3e:e6:96: - 86:f4:d7:99:71:52:c3:ca:0f:4a:48:d8:66:b0:da:e8:d1:45: - 84:c4:12:b2:43:ec:63:b6:25:e8:0a:5a:4c:fb:e2:ec:03:36: - 6f:cd:f9:2a:5c:52:ba:02:29:92:f5:bf:c4:96:ff:9e:ed:a3: - cf:02 - ------BEGIN CERTIFICATE----- -MIIDIjCCAougAwIBAgIBATANBgkqhkiG9w0BAQQFADCBljELMAkGA1UEBhMCREUx -DDAKBgNVBAgTA05SVzEOMAwGA1UEBxMFRXNzZW4xHDAaBgNVBAoTE1VuaXZlcnNp -dHkgb2YgRXNzZW4xDDAKBgNVBAsTA1NXVDEUMBIGA1UEAxMLRnJlZGogRHJpZGkx -JzAlBgkqhkiG9w0BCQEWGEZyZWRqLkRyaWRpQHVuaS1lc3Nlbi5kZTAeFw0wMDA0 -MjgwODIxMTlaFw0wMTA0MjgwODIxMTlaMIGtMQswCQYDVQQGEwJERTEMMAoGA1UE -CBMDTlJXMQ4wDAYDVQQHEwVFc3NlbjEcMBoGA1UEChMTVW5pdmVyc2l0eSBvZiBF -c3NlbjEMMAoGA1UECxMDU1dUMSMwIQYDVQQDExp0cDYwMGUud2ktaW5mLnVuaS1l -c3Nlbi5kZTEvMC0GCSqGSIb3DQEJARYgZHJpZGlAdHA2MDBlLndpLWluZi51bmkt -ZXNzZW4uZGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANWD4d0DhEArJhFr -EpFJ0DDuZCl6mFmyUh/9lHs57dEpmPG7tKM9gbnoZJzzLqGJoq4acOYlwQZdkJdY -21S4AJWw2UWuVVsZIR8BtdvPofh5ppfZ3Y8rOuM5z//z7l6ZoVlF6VVNhjixY0tw -K5ZXYUiHAwkxuViJ5czqIRCDhfN1AgMBAAGjZzBlMB8GA1UdIwQYMBaAFNK44y2i -WiJ4OjjxH/V8rY2mxEEPMDQGA1UdJQQtMCsGCCsGAQUFBwMBBggrBgEFBQcDAgYK -KwYBBAGCNwoDAwYJYIZIAYb4QgQBMAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQEE -BQADgYEAOLWhHJPEqm4/1uoRf3srEdt7IrPSqLPzIGRqJbT+DawSSaBube/7maJ8 -vFCw60LvCjL6qWngERCbAAUVl1ms3F/yzYEoPuaWhvTXmXFSw8oPSkjYZrDa6NFF -hMQSskPsY7Yl6ApaTPvi7AM2b835KlxSugIpkvW/xJb/nu2jzwI= ------END CERTIFICATE----- - Index: xotcl/apps/comm/test-tls-client.xotcl =================================================================== diff -u -N --- xotcl/apps/comm/test-tls-client.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/comm/test-tls-client.xotcl (revision 0) @@ -1,86 +0,0 @@ -#!../../src/xotclsh -# -# $Id: test-tls-client.xotcl,v 1.2 2006/02/18 22:17:32 neumann Exp $ - -package require tls - -proc bgerror {err} { - global errorInfo - puts stderr "BG Error: $errorInfo" -} - -array set opts { - -port 8443 - -host localhost -} -array set opts $argv - - - - -proc readCB {CHAN} { - #puts stderr "*** CALL: readCB $CHAN" - if {![eof $CHAN]} { - set rData [gets $CHAN] - puts stderr "\nREADING ..." - puts stderr "------------------------------------------------------" - puts stderr <$rData> - puts stderr "------------------------------------------------------" - - #fileevent $CHAN writable [list writeCB $CHAN] - } else { - catch {close $CHAN} - puts stderr "\nSocket ($CHAN) is closed." - exit - } -} -proc writeCB {CHAN} { - #puts stderr "*** CALL: writeCB $CHAN" - #puts stderr "fileevent $CHAN writable {}" - fileevent $CHAN writable {} - set wData "GET / HTTP/1.1\r\nHost: localhost\r\nAccept: */*\r\n\r\n" - #set wData "GET\n" - puts -nonewline $CHAN $wData - flush $CHAN - #puts stderr "\nfileevent $CHAN readable [list readCB $CHAN]" - fileevent $CHAN readable [list readCB $CHAN] -} - -puts stderr "\n\n\n~~~~~~~~~~~~ Trying $opts(-host):$opts(-port)" -# -# Create socket -# -set chan [socket -async $opts(-host) $opts(-port)] - -tls::import $chan -command callback -cafile cacert.pem -certfile client.pem -server 0 -keyfile client.key -request 1 -require 1 - -puts stderr "setting channel to auto binary" -fconfigure $chan -translation {auto binary} -puts stderr "fileevent $chan writable [list writeCB $chan]" -fileevent $chan writable [list writeCB $chan] - - -Object callback -callback proc error {chan msg} { - puts stderr "+++TLS/$chan: error: $msg" -} -callback proc verify {chan depth cert rc err} { - array set c $cert - if {$rc != "1"} { - puts stderr "+++TLS/$chan: verify/$depth: Bad Cert: $err (rc = $rc)" - } else { - puts stderr "+++TLS/$chan: verify/$depth: $c(subject)" - } - return $rc -} -callback proc info {chan state minor msg} { - puts stderr "+++TLS/$chan $state $minor: $msg" - -} -callback proc unknown {option args} { - my showCall - return -code error "bad option \"$option\": must be one of error, info, or verify" -} - - -vwait forever Index: xotcl/apps/comm/test-tls-server.xotcl =================================================================== diff -u -N --- xotcl/apps/comm/test-tls-server.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/apps/comm/test-tls-server.xotcl (revision 0) @@ -1,87 +0,0 @@ -#!../../src/xotclsh -# $Id: test-tls-server.xotcl,v 1.5 2006/09/27 08:12:39 neumann Exp $ -# -# sample secure server that reflect all incoming data to the client -# It uses tls1.3 package of Matt Newman -# Fredj Dridi - -package require tls - -proc bgerror {err} { - global errorInfo - puts stderr "BG Error: $errorInfo" -} - -# -# Sample callback - just reflect data back to client -# -proc reflectCB {chan {verbose 0}} { - puts stderr "\n*** reflectCB $chan $verbose" - - fconfigure $chan -translation {auto crlf} - - set data {} - if {[catch {set n [::gets $chan data]} msg]} { - set error $msg - puts stderr "\nEOF ($data)" - catch {close $chan} - return 0 - } - puts stderr n=<$n> - if {$verbose && $data ne ""} { - puts stderr "data=<$data>" - } - if {[eof $chan]} { ;# client gone or finished - puts stderr "\nEOF" - close $chan ;# release the servers client channel - return - } - #puts -nonewline $chan $data - #flush $chan -} -proc acceptCB { chan ip port } { - puts stderr "\n*** acceptCB $chan $ip $port" - - tls::import $chan -cafile cacert.pem -certfile server.pem \ - -server 1 -request 1 -require 1 -keyfile server.key -command callback - if {![tls::handshake $chan]} { - puts stderr "\nHandshake pending" - return - } - array set cert [tls::status $chan] - puts stderr "\n" - parray cert - - fileevent $chan readable [list reflectCB $chan 1] -} - - -set chan [socket -server acceptCB 8443] -puts stderr "Server waiting connection on $chan (8443)" - - -## Sample Callback that gives SSL information -Object callback -callback proc error {chan msg} { - puts stderr "+++TLS/$chan: error: $msg" -} -callback proc verify {chan depth cert rc err} { - array set c $cert - if {$rc != "1"} { - puts stderr "+++TLS/$chan: verify/$depth: ** Bad Cert **: $err (rc = $rc)" - } else { - puts stderr "+++TLS/$chan: verify/$depth: $c(subject)" - } - return $rc -} -callback proc info {chan state minor msg} { - puts stderr "+++TLS/$chan $state $minor: $msg" - -} -callback proc unknown {option args} { - my showCall - return -code error "bad option \"$option\": must be one of error, info, or verify" -} - -# Go into the eventloop -vwait forever Index: xotcl/apps/comm/webclient.xotcl =================================================================== diff -u -N --- xotcl/apps/comm/webclient.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/comm/webclient.xotcl (revision 0) @@ -1,7 +0,0 @@ -#!../../src/xotclsh -package require XOTcl; namespace import -force xotcl::* - -@ @File {description {For a sample webclient, see packages/comm/xocomm.test}} -package require xotcl::comm::httpAccess -set hostport localhost:8086 -SimpleRequest r0 -url http://$hostport/logo-100.jpg Index: xotcl/apps/comm/webserver.xotcl =================================================================== diff -u -N --- xotcl/apps/comm/webserver.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/apps/comm/webserver.xotcl (revision 0) @@ -1,118 +0,0 @@ -#!../../src/xotclsh -# $Id: webserver.xotcl,v 1.9 2007/08/14 16:38:26 neumann Exp $ -array set opts {-root ../../doc -port 8086 -protected-port 9096 -pkgdir .} -array set opts $argv -lappend auto_path $opts(-pkgdir) -#if {$::tcl_platform(platform) eq "windows"} {lappend auto_path .} -package require XOTcl; namespace import -force xotcl::* - -proc ! string { - set f [open [::xotcl::tmpdir]/log w+]; - puts $f "[clock format [clock seconds]] $string" - close $f -} - -@ @File { - description { - This small demo program starts two different webservers: -

      -
    • Firstly, it provides a sample web server that povides the documents in - ../../src/doc (or the files specified with -root) at port 8086 - (or at the port specified via the -port option) as unprotected resources. -

      -

    • Secondly, it starts a second webserver with basic access control - (it accepts test/test as user/password) on port 9096 (or on the - port specified via -protected-port). If it receives an request - for an resource named "exit", it terminates. For all other requests - it returns actual information about the user and the issued request. -
    - To see, how it works, contact it e.g. from netscape. - } -} - -! "#### webserver starting" -# We load the following packages: -# -#::xotcl::package import ::xotcl::comm::httpd -package require xotcl::comm::httpd - -! "#### httpd required" - -# now we can start the web-server instance with these settings -# -Httpd h1 -port $opts(-port) -root $opts(-root) -@ Httpd h1 {description "unprotected web server"} - -! "#### h1 started" - -# specialized worker, which executes tcl commands in web pages -@ Class SpecializedWorker { description { - Specialized worker that can be passed to any webserver -}} -Class SpecializedWorker -superclass Httpd::Wrk -@ SpecializedWorker instproc respond {} { description { - This method handles all responses from the webserver to the client. - We implent here "exit", and we return the information about the actual - request and user in HTML format for all other requests. -

    This method is an example, how to access on the server side - request specific infomation. -}} -SpecializedWorker instproc respond {} { - if {[my set resourceName] eq "exit"} { - set ::forever 1 - #my showVars - #my set version 1.0;### ???? - #puts stderr HERE - } - # return for all other requests the same response - foreach {a v} [my array get meta] { - append m $a$v\n - } - set content { - -

    Request Info

    - - - - - - - -
    method:[my set method]
    resource:[my set resourceName]
    user:[my set user]
    version:HTTP/[my set version]
    response port:[my set port]
    request comes from:[my set ipaddr]
    -

    Request Header Fields

    - $m
    - - } - set c [subst $content] - my replyCode 200 - my connection puts "Content-Type: text/html" - my connection puts "Content-Length: [string length $c]\n" - my connection puts-nonewline $c - my close -} - -@ Httpd h2 { - description "Web server with basic authentication using the specialied worker"} - -if {[info exists env(USER)]} { - set USER "$env(USER)" -} elseif {[info exists env(USERNAME)]} { - set USER "$env(USERNAME)" -} else { - set USER unknown -} -if {$::tcl_platform(platform) eq "windows"} { - set USER unknown -} - -Httpd h2 -port $opts(-protected-port) -root $opts(-root) \ - -httpdWrk SpecializedWorker \ - -mixin Httpd::BasicAccessControl \ - -addRealmEntry test "u1 test $USER test" -protectDir test "" {} - -! "#### h2 started" - -# -# and finally call the event loop... -# -vwait forever Index: xotcl/apps/persistence/persistenceTest.xotcl =================================================================== diff -u -N --- xotcl/apps/persistence/persistenceTest.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/persistence/persistenceTest.xotcl (revision 0) @@ -1,44 +0,0 @@ -#!../../src/xotclsh -package require XOTcl; namespace import -force xotcl::* - -package require xotcl::store::persistence -package require xotcl::mixinStrategy - -PersistenceMgr jufpMgr -PersistenceMgr tclpMgr -dbPackage TclGdbm -Class PersistenceTest -parameter {{countVar 0} {appendVar ""} pm} -PersistenceTest instproc init args { - my mixinStrategy Persistent=Eager - my persistenceMgr [my set pm] - my persistent {countVar appendVar} - next -} - -PersistenceTest instproc incrCount {} { - puts "in [self] countVar now is [my countVar]" - my incr countVar -} -PersistenceTest instproc appendV {x} { - my append appendVar $x - puts "append is: [my appendVar]" -} - -PersistenceTest instproc test {} { - # first we increment a counter: - my incrCount - # now we 5x append something to appendVar - for {set i 0} {$i<5} {incr i} { - my appendV a - } - # now we list all keys in the database - puts "Variables stored in [my persistenceMgr].db: [[my persistenceMgr] names]" - # now we delete append var - puts "Deleting append:[[my persistenceMgr] delete [self]::appendVar]" - # now we list the keys again - puts "Variables stored in [my persistenceMgr].db: [[my persistenceMgr] names]" -} - -PersistenceTest persistenceJufTest -pm jufpMgr -init -test -#PersistenceTest persistenceTclTest -pm tclpMgr -init -test - -#PersistenceTest instproc count \ No newline at end of file Index: xotcl/apps/scripts/adapter.xotcl =================================================================== diff -u -N --- xotcl/apps/scripts/adapter.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/scripts/adapter.xotcl (revision 0) @@ -1,30 +0,0 @@ -# $Id: adapter.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ -Class Adapter -superclass Class - -@ @File { - description { - Simple adapter pattern meta-class taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - } -} - -Adapter instproc adapterFilter args { - set r [self calledproc] - my instvar adaptee specificRequest - if {[info exists specificRequest($r)]} { - return [eval $adaptee $specificRequest($r) $args] - } - next -} - -Adapter instproc init args { - my instfilterappend adapterFilter - next - my instproc setRequest {r sr} { - my set specificRequest($r) $sr - } - my instproc setAdaptee {a} { - my set adaptee $a - } -} Index: xotcl/apps/scripts/adapterExample.xotcl =================================================================== diff -u -N --- xotcl/apps/scripts/adapterExample.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/scripts/adapterExample.xotcl (revision 0) @@ -1,36 +0,0 @@ -# $Id: adapterExample.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ -# include the adapter pattern -source adapter.xotcl - -@ @File { - description { - Simple adapter pattern example class (FTP requests) taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - } -} - -Class FTPLIB -FTPLIB instproc FTPLIB_connect args { - puts "in ftplib connect" -} - -Class Connection -Connection instproc connect args { - puts "in Connection connect" -} -Connection instproc discard args { - puts "in Connection discard" -} - -Adapter FTP -superclass Connection - -FTP instproc init args { - FTPLIB ftpAdaptee - my setRequest connect FTPLIB_connect - my setAdaptee ftpAdaptee -} -FTP f - -f connect -f discard Index: xotcl/apps/scripts/composite.xotcl =================================================================== diff -u -N --- xotcl/apps/scripts/composite.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/scripts/composite.xotcl (revision 0) @@ -1,53 +0,0 @@ -#$Id: composite.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ -Class Composite -superclass Class -Composite metadata add description -@ @File { - description { - Simple composite pattern meta-class taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - } -} - -Composite instproc addOperations args { - foreach op $args { - if {![my exists operations($op)]} { - my set operations($op) $op - } - } -} - -Composite instproc removeOperations args { - foreach op $args { - if {![my exists operations($op)]} { - my unset operations($op) - } - } -} - -Composite instproc compositeFilter args { - # get the operations class variable from the object's class - set registrationclass [lindex [self filterreg] 0] - $registrationclass instvar operations - # get the request - set r [self calledproc] - puts ***compositeFilter--${r}--[self] - - # check if the request is a registered operation - if {[info exists operations($r)]} { - foreach object [my info children] { - # forward request - eval $object $r $args - } - } - return [next] -} - - -Composite instproc init {args} { - my array set operations {} - next - my instfilterappend compositeFilter -} - - Index: xotcl/apps/scripts/compositeExample.xotcl =================================================================== diff -u -N --- xotcl/apps/scripts/compositeExample.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/scripts/compositeExample.xotcl (revision 0) @@ -1,40 +0,0 @@ -# $Id: compositeExample.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ -# include the pattern -source composite.xotcl - -Class Graphic -@ @File { - description { - Simple Graphics example of the composite pattern taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. They demonstrate instfilters, - filter chains and filter inheritance. - } -} - - -Graphic instproc draw {} { - puts "in--- draw SELF: [self] CLASS: [self class]" -} - -Composite Picture -superclass Graphic -Class Line -superclass Graphic -Class Rectangle -superclass Graphic - - -Picture addOperations draw -#Picture removeOperations draw - -Picture aPicture -Picture aPicture::bPicture -Line aPicture::aLine -Rectangle aPicture::aRect -Line aPicture::bPicture::aLine -Rectangle aPicture::bPicture::aRect -Picture aPicture::bPicture::cPicture -Picture aPicture::bPicture::dPicture -Line aPicture::bPicture::cPicture::cLine - -# draw eines Composites -puts "DRAW im Composite: aPicture" -aPicture draw Index: xotcl/apps/scripts/observer.xotcl =================================================================== diff -u -N --- xotcl/apps/scripts/observer.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/scripts/observer.xotcl (revision 0) @@ -1,87 +0,0 @@ -#$Id: observer.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ -Class Observer -superclass Class - -Observer metadata add description -@ @File { - description { - Simple observer pattern meta-class taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - } -} - -Class Observer::Subject -superclass Class - -Observer::Subject instproc notificationFilter {args} { - set procName [self calledproc] - my instvar preObservers postObservers - - if {[info exists preObservers($procName)]} { - foreach obj $preObservers($procName) { $obj update [self] $args } - } - - set result [next] - - if {[info exists postObservers($procName)]} { - foreach obj $postObservers($procName) { $obj update [self] $args } - } - return $result -} - -Class Observer::SubjectMgt -Observer::SubjectMgt instproc attach {hook objs} { - upvar $hook observers - foreach obj $objs { - if {![info exists observers] || [lsearch $observers $obj] == -1} { - lappend observers $obj - } - } -} -Observer::SubjectMgt instproc detach {hook objs} { - upvar $hook observers - if {[info exists observers]} { - foreach obj $objs { - set p [lsearch $observers $obj] - set observers [lreplace $observers $p $p] - } - } -} - -Observer::SubjectMgt instproc attachPre {procName args} { - my instvar preObservers - my attach preObservers($procName) $args -} -Observer::SubjectMgt instproc attachPost {procName args} { - my instvar postObservers - my attach postObservers($procName) $args -} -Observer::SubjectMgt instproc detachPre {procName args} { - my instvar preObservers - my detach preObservers($procName) $args -} -Observer::SubjectMgt instproc detachPost {procName args} { - my instvar postObservers - my detach postObservers($procName) $args -} - -Observer::Subject instproc init args { - next - my superclass [list Observer::SubjectMgt [my info superclass]] - my instfilter notificationFilter -} - -Observer instproc timeout t { - my set timeout $t -} - -Observer instproc update {subject args} { - #addTimeOut [my set timeout] "[self] update $subject $args" - #$subject getResponse - # do something with the response - puts [self]---update -} - -Observer instproc init args { - next -} - Index: xotcl/apps/scripts/parameter.xotcl =================================================================== diff -u -N --- xotcl/apps/scripts/parameter.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/scripts/parameter.xotcl (revision 0) @@ -1,150 +0,0 @@ -### Sample file for parameter testing.... -### For every class "-parameter" can be specified which accepts -### a list of parameter specifications. -### -### * If a parameter specification consists of a single word, -### the word is considered as the parameter name and -### a standard setter/getter method with this name is created. -### -### * If the parameter specification consists of two words, the -### second word is treated as the default value, which is stored -### in the class object. -### -### * If a default value exists in the class object, a -### corresponding instance variable with the name of the -### parameter is created automatically during initialization -### of the object. -### -### * If the parameter specification consists of more than two words, -### various parameter methods (starting with "-") with arguments -### can be specified. In the following example -### Class C -parameter {{a 1} {b -default 1}} -### C c1 -### both a and b receive 1 as default value. -### -### * In order to call the standard getter method use the method -### with the name of the parameter with one parameter. For example, -### in order to call the standard getter for parameter a, use -### puts [c1 a] -### In order to use the standard setter for b, use the method with -### two parameters. -### c1 b 123 -### -### * There are two ways to specify custom setter/getter methods for -### parameters: (a) the custom setter/getter can be defined within the -### class hierarchy of the object, or (b) the custom getter/setter can -### be specified on a different object. The custom setter/getter -### method are called, from the standard setter/getter methods -### automatically if specified. -### * In order to use approach (a) the parameter methods -getter -### and -setter can be used to specify the custom getter and -### and setter methods: -### Class D -parameter {{a -setter myset -getter myget}} -### The methods myset and myget are called like set with -### one or two arguments. They are responsible for setting and -### retrieving the appropiate values. It is possible to -### specify any one of these parameter methods. -### * In order to use approach (b) a parameter methods -access -### is use to specify an object responsible for setting/getting -### these values. This has the advantage that the custom getter and -### setter methods can be inherited from a separate class hierarchy, -### such they can used for any object without cluttering its -### interface. -### * In order to keep the parameter specification short the access -### object my contain instance variables setter or getter, naming the -### setter/getter methods. If these instance variables are not -### in the access object, "set" is used per default for getter and -### setter. These default values can be still overridden by the -### parameter methods -setter or -getter. -### * If the access object is specified, -### are passed to the setter method and are passed -### to the custom getter method (in approach (a) the object is -### is not needed). - -Object different -different set setter myset -different set getter myget -different proc myset {o var value} { $o set $var $value } -different proc myget {o var} { $o set $var } - - -Object print -print proc set {o args} { - ::set var [lindex $args 0] - if {[llength $args]==1} { - puts "*** $o get $var" - $o set $var - } else { - ::set value [lindex $args 1] - puts "*** $o set $var $value" - $o set $var $value - } -} -print proc myset {o var value} { - puts "*** $o myset $var $value" - $o set $var $value -} - -Class P -P instproc set {o args} { - puts stderr "instance [self] of parameter class P called for $o $args" - if {[llength $args] == 1} { - $o set [lindex $args 0] - } else { - $o set [lindex $args 0] [lindex $args 1] - } -} -P p - -Class M -M instproc mset args { - puts stderr "Mixin [self class] called for [self] $args" - if {[llength $args] == 1} { - my set [lindex $args 0] - } else { - my set [lindex $args 0] [lindex $args 1] - } -} - - -set x different - -Class C -parameter { - {c [self]} - d - {e ""} - {f -default 123 -setter setf -getter getf} - {g -default 1000 -access print} - {h -default 1001 -access print -setter myset} - {i -default 1002 -access different} - {j -default $x -access ::p} - {k {[self class]}} - {l -default {[self class]} } - } -C parameter [list [list z -access [P new -childof C] -default zzz]] - -C instmixin M -C parameter {{x -default 333 -setter mset -getter mset}} - -puts stderr +++[C info parameter] - -C instproc setf {var val} { - puts stderr "... setting $var to $val" - my set $var $val -} -C instproc getf var { - puts stderr "... getting value of $var" - my set $var -} - -#puts stderr "body of f: [C info instbody f]" -puts stderr "body of x: [C info instbody x]" -puts ======================create -C c1 -f 133 -g 101 -h 102 -i 103 -puts ======================readvars -foreach v [lsort [c1 info vars]] { - puts "$v = <[c1 $v]>" -} - -puts "instances of P: [P info instances]" -puts "instances of C: [C info instances]" Index: xotcl/apps/scripts/pinger.xotcl =================================================================== diff -u -N --- xotcl/apps/scripts/pinger.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/scripts/pinger.xotcl (revision 0) @@ -1,64 +0,0 @@ -#$Id: pinger.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ -# include the pattern -source observer.xotcl - -Class Pinger -@ @File { - description { - Pinger example for the observer pattern taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - It demonstrates how to observe a network connection. - } -} - -Observer::Subject Pinger::Collector -parameter {hostName {update 1}} -Observer Pinger::Diagram -Observer Pinger::TextOutput - -Pinger::Collector instproc init args { - my instvar update hostName - set f [open "| ping -i $update $hostName" r] - fconfigure $f -blocking false - fileevent $f readable "[self] ping \[gets $f\]" -} - -Pinger::Collector instproc getResponse {} { - puts "in--- [self] [format %-12s [self proc]] ([self class])" -} - -Pinger::Collector instproc ping {string} { - puts "in--- [self] [format %-12s [self proc]] ([self class])" - puts $string -} - -Pinger::Diagram instproc update {subject args} { - puts "in--- [self] [format %-12s [self proc]] ([self class]) -- SUBJECT: $subject" - $subject getResponse - # do something with the response -} - -Pinger::TextOutput instproc update {subject args} { - puts "in--- [self] [format %-12s [self proc]] ([self class]) -- SUBJECT: $subject" - $subject getResponse - # do something with the response -} - -namespace eval ::Pinger { - Collector ::c1 -hostName 132.252.180.231 - Collector ::c2 -hostName 137.208.7.48 - Diagram ::d1 - Diagram ::d2 - Diagram ::d3 - TextOutput ::t1 -} - -c1 attachPre ping d1 d2 -c1 attachPost ping d2 d3 -c1 attachPost ping t1 -c2 attachPost ping t1 d2 - -#c1 detachPre ping d1 -#c1 detachPost ping d2 d3 -vwait forever - Index: xotcl/apps/scripts/simpleFilters.xotcl =================================================================== diff -u -N --- xotcl/apps/scripts/simpleFilters.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/scripts/simpleFilters.xotcl (revision 0) @@ -1,57 +0,0 @@ -# $Id: simpleFilters.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ - -@ @File { - description { - Some simple examples of (inst)filters taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. They demonstrate filters, - filter chains and filter inheritance. - } -} - -Class A -A instproc Filter-1 args { - puts " pre-part of [self proc]" ;# pre part - next ;# next call - puts " post-part of [self proc]" ;# post part -} -A instproc printSomething args { - puts " actual called proc: [self proc]" -} -A a1 - -A instfilter Filter-1 -#a1 set x 1 - -puts "A call surrounded by pre/post messages:" -a1 printSomething - -A instfilter {} -A instproc Filter-2 args { - puts " only a pre-part in [self proc]" - next -} -A instproc Filter-3 args { - next - puts " only a post-part in [self proc]" -} -A instfilter {Filter-1 Filter-2 Filter-3} -puts "Now a filter chain:" -a1 printSomething -A instfilter {} - -Class B -superclass A -B instproc Filter-B args { - puts " entering method: [self proc]" - next -} -B b1; B b2 -A instfilter {Filter-1 Filter-2 Filter-3} -B instfilter Filter-B - -puts "And finally inheritance:" - -b1 printSomething - -B instfilter {} -A instfilter {} Index: xotcl/apps/scripts/soccerClub.xotcl =================================================================== diff -u -N --- xotcl/apps/scripts/soccerClub.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/apps/scripts/soccerClub.xotcl (revision 0) @@ -1,210 +0,0 @@ -# $Id: soccerClub.xotcl,v 1.7 2007/08/14 16:38:26 neumann Exp $ -# This is a simple introductory example for the language XOTcl. -# It demonstrates the basic language constructs on the example of -# a soccer club. - -package require XOTcl; namespace import -force xotcl::* - -# All the characters in this example are fictitious, and any -# resemblance to actual persons, living or deceased, is coincidental. - -# In XOTcl we do not have to provide the above file description -# as a comment, but we can use the @ object, which is used generally -# to provide any kind of information, metadata, and documentation on -# a running program. Here, we just give a file description. -# Now makeDoc.xotcl will automatically document this file for us. -@ @File { - description { - This is a simple introductory example for the language XOTcl. - It demonstrates the basic language constructs on the example of - a soccer club. - } -} - -# -# All things and entities in XOTcl are objects, a special kind of objects -# are classes. These define common properties for other objects. For a -# soccer club, we firstly require a common class for all kinds of members. -# -# Common to all members is that they have a name. Common properties defined -# across all instances of a class are called "Parameters" in XOTcl. -# -Class ClubMember -parameter {{name ""}} - -# A special club member is a Player. Derived classes can be build with -# inheritance (specified through 'superclass'). Players may have a -# playerRole (defaults to NONE): -Class Player -superclass ClubMember -parameter {{playerRole NONE}} - -# other club member types are trainers, player-trainers, and presidents -Class Trainer -superclass ClubMember -Class President -superclass ClubMember - -# the PlayerTrainer uses multiple inheritance by being both a player -# and a trainer -Class PlayerTrainer -superclass {Player Trainer} - -# -# Now we define the SoccerTeam class. -# -Class SoccerTeam -parameter {name location type} - -# We may add a player. This is done by a method. Instance methods are -# in XOTcl defined with 'instproc'. All club members are aggregated in -# the team (denoted by :: namespace syntax). -SoccerTeam instproc newPlayer args { - # we use a unique autoname for the object to prevent name - # collisions, like ::player01, ::player02, ... - eval Player [self]::[my autoname player%02d] $args -} - -# A player can be transfered to another team. The player object does -# not change internally (e.g. the playerRole stays the same). Therefore we -# 'move' it to the destination team. -SoccerTeam instproc transferPlayer {playername destinationTeam} { - # We use the aggregation introspection option 'children' in order - # to get all club members - foreach player [my info children] { - # But we only remove matching playernames of type "Player". We do - # not want to remove another club member type who has the same - # name. - if {[$player istype Player] && [$player name] == $playername} { - # We simply 'move' the player object to the destination team. - # Again we use a unique autoname in the new scope - $player move [set destinationTeam]::[$destinationTeam autoname player%02d] - } - } -} - -# Finally we define two convenience methods to print the members/players to -# stdout with puts. -SoccerTeam instproc printMembers {} { - puts "Members of [my name]:" - foreach m [my info children] {puts " [$m name]"} -} -SoccerTeam instproc printPlayers {} { - puts "Players of [my name]:" - foreach m [my info children] { - if {[$m istype Player]} {puts " [$m name]"} - } -} - -# Now let us build to example soccer team objects. -SoccerTeam lyon -name "Olympique Lyon" -location "Lyon" -SoccerTeam bayernMunich -name "F.C. Bayern München" -location "Munich" - -# With 'addPlayer' we can create new aggregated player objects -# -# Let us start some years in the past, when "Franz Beckenbauer" was -# still a player. -set fb [bayernMunich newPlayer -name "Franz Beckenbauer" \ - -playerRole PLAYER] - -# 'playerRole' may not take any value. It may either be NONE, PLAYER, -# or GOALY ... such rules may be given as assertions (here: an instinvar -# gives an invariant covering all instances of a class). In XOTcl -# the rules are syntactically identical to 'if' statements -Player instinvar { - {[my set playerRole] eq "NONE" || - [my set playerRole] eq "PLAYER" || - [my set playerRole] eq "GOALY"} -} - -# If we break the invariant and turn assertions checking on, we should -# get an error message: -$fb check all -if {[catch {$fb set playerRole SINGER} errMsg]} { - puts "CAUGHT EXCEPTION: playerRole has either to be NONE, PLAYER, or TRAINER" - # turn assertion checking off again and reset to PLAYER - $fb check {} - $fb set playerRole PLAYER -} - -# But soccer players may play quite different, orthogonal -# roles. E.g. Franz Beckenbauer was also a singer (a remarkably bad -# one). However, we can not simply add such orthogonal, extrinsic -# extensions with multiple inheritance or delegation. Otherwise we -# would have either to build a lot of unnecessary helper classes, like -# PlayerSinger, PlayerTrainerSinger, etc., or we would have to build -# such helper objects. This either leads to an unwanted combinatorial -# explosion of class or object number. -# -# Here we can use a per-object mixin, which is a language construct -# that expresses that a class is used as a role or as an extrinsic -# extension to an object. - -# First we just define the Singer class. -Class Singer -Singer instproc sing text { - puts "[my name] sings: $text, lala." -} - -# Now we register this class as a per-object mixin on the player object: -$fb mixin Singer - -# And now Franz Beckenbauer is able to sing: -$fb sing "lali" - -# But Franz Beckenbauer has already retired. When a player retires, we -# have an intrinsic change of the classification. He *is* not a player -# anymore. But still he has the same name, is club member, and -# is a singer (brrrrrr). - -# Before we perform the class change, we extend the Player class to -# support it. I.e. the playerRole is not valid after class change -# anymore (we unset the instance variable). -Player instproc class args { - my unset playerRole - next -} - -# Now we can re-class the player object to its new class (now Franz -# Beckenbauer is President of Bayern Munich. -$fb class President -# Check that the playerRole isn't there anymore. -if {[catch {$fb set playerRole} errMsg]} { - puts "CAUGHT EXCEPTION: The player role doesn't exist anymore (as it should be after the class change)" -} - -# But still Franz Beckenbauer can entertain us with what he believes -# is singing: -$fb sing "lali" - -# Now we define some new players for Bayern Munich: -bayernMunich newPlayer -name "Oliver Kahn" -playerRole GOALY -bayernMunich newPlayer -name "Giovanne Elber" -playerRole PLAYER - -# if we enlist the players of Munich Franz Beckenbauer is not enlisted -# anymore: -bayernMunich printPlayers - -# But as a president he still appears in the list of members: -bayernMunich printMembers - -# Now consider an orthonogal extension of a transfer list. Every -# transfer in the system should be notified. But since the transfer -# list is orthogonal to SoccerTeams we do not want to interfere with -# the existing implementation at all. Moreover, the targeted kind of -# extension has also to work on all subclasses of SoccerTeam. Firstly, we -# just create the extension as an ordinary class: -Class TransferObserver -TransferObserver instproc transferPlayer {pname destinationTeam} { - puts "Player '$pname' is transfered to Team '[$destinationTeam name]'" - next -} - -# Now we can apply the class as a per-class mixin, which functions -# exactly like a per-object mixin, but on all instances of a class and -# its subclasses. The 'next' primitive ensures that the original -# method on 'SoccerTeam' is called after notifying the transfer (with -# puts to stdout) -SoccerTeam instmixin TransferObserver - -# If we perform a transfer of one of the players, he is moved to the new -# club and the transfer is reported to the stdout: - -bayernMunich transferPlayer "Giovanne Elber" lyon - -# Finally we verify the transfer by printing the players: -lyon printPlayers -bayernMunich printPlayers Index: xotcl/apps/utils/xo-daemon =================================================================== diff -u -N --- xotcl/apps/utils/xo-daemon (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/utils/xo-daemon (revision 0) @@ -1,171 +0,0 @@ -#!/usr/bin/env tclsh -package require XOTcl; namespace import -force xotcl::* - -@ @File { - description { - This script can be used to start/stop/restart xotcl daemons - and maintains the process IDs, log files and means for easy - restart. - <@p> - It receives as first parameter the name of the xotcl script - to be executed followed by the desired action and optional - parameters. The specified action can be - <@UL> - <@LI> <@EM>start: the specified script is started in - the background, an entry to restart is generated in - the run-directory as well as the process id of the started - script. In addition a logfile is created in the log directory. - If the start of the script fails, the error messages are - shown. - <@LI> <@EM>startall: all scripts that were started before - via this script, are started - <@LI> <@EM>stop terminates te specified script. - <@LI> <@EM>stopall terminates all scripts started via this - command - <@LI> <@EM>restart tries to restart the specified script. - - The optional parameters are: - <@UL> - <@LI> <@EM>-logir specifies the directory for logging. - The default is ~/.xotcl/log. - <@LI> <@EM>-rundir specifies the directory where - the information about the running processes is kept. - The default is ~/.xotcl/run. - - } - authors { - Gustaf Neumann, Gustaf.Neumann@wu-wien.ac.at - } - date "[::xotcl::rcs date {$Date: 2006/02/18 22:17:32 $}]" -} - -array set opt [list \ - -rundir $::xotcl::confdir/run \ - -logdir $::xotcl::confdir/log \ -] -if {$argc < 2} { - puts "Usage:\n\t$argv0 \ - ?options?\nOptions:\n\ - \t-logdir dirname (default: $::opt(-logdir))\n\ - \t-rundir dirname (default: $::opt(-rundir))\n" - exit -1 -} -foreach {daemon action} $argv break -array set opt [lreplace $argv 0 1] - -# The daemon scripts should be -# - location independent (if the script assumes to be started from -# a certain directory, it should cd to it) -# - parameter less (required for restart, startall, etc.) -# - -# configuration -set ::kill /bin/kill -set ::ps /bin/ps -set ::ln /bin/ln -set ::sleep /bin/sleep -set ::xotclsh /usr/bin/xotclsh - -Class Daemon -parameter progname -Daemon instproc readfile {n} { - set f [open $n r] - set c [read $f] - close $f - return [string trim $c \n] -} -Daemon instproc init {} { - if {![file isdirectory $::opt(-rundir)]} {file mkdir $::opt(-rundir)} - if {![file isdirectory $::opt(-logdir)]} {file mkdir $::opt(-logdir)} -} -Daemon instproc progname name { - set n [file tail $name] - set n [file rootname $n] - [self] set pidfile $::opt(-rundir)/$n.pid - [self] set logfile $::opt(-logdir)/$n.log - [self] set shortname $n - [self] set progname $name -} -Daemon instproc report string { - puts stderr "[[self] set shortname]: $string" -} -Daemon instproc running pid { - set r [catch {exec $::ps -h $pid} msg] - #if {$r} { [self] report "msg=$msg" } - #[self] report "running returns $r" - return [expr {!$r}] -} -Daemon instproc kill {sig pid} { - #[self] report "kill $sig $pid" - exec $::kill $sig $pid -} -Daemon instproc start {} { - [self] instvar pidfile logfile progname - if {[file exists $pidfile]} { - set pid [[self] readfile $pidfile] - [self] report "seems already running $pid" - if {[[self] running $pid]} { - [self] report "... no need to restart" - return - } else { - [self] report "... but disappeared $pid" - } - } - set linkname $::opt(-rundir)/[file tail $progname] - if {[string match *~* $linkname]} { - # file dirname ~ -> requires env(HOME) - regsub ^~ $linkname [file dirname ~]/$::env(USER) linkname - } - if {$progname != $linkname} { - #puts stderr "exec $::ln -sf $progname $linkname" - exec $::ln -sf $progname $linkname - } - set pid [exec $::xotclsh $progname >>& $logfile &] - set F [open $pidfile w] - puts $F $pid - close $F - exec sleep 1 - if {![[self] running $pid]} { - [self] report "start of $pid failed" - set size [file size $logfile] - set F [open $logfile] - if {$size > 500} {seek $F [expr {$size-500}]} - puts [read $F] - close $F - } else { - [self] report "started $pid" - } -} -Daemon instproc stop {} { - [self] instvar pidfile logfile - if {[file exists $pidfile]} { - set pid [[self] readfile $pidfile] - #[self] report "Got PID $pid" - if {[[self] running $pid]} { - [self] report "stopping $pid" - [self] kill -KILL $pid - #if {[running $pid]} {kill -KILL $pid} - } else { - [self] report "not running $pid" - } - file delete $pidfile - } else { - [self] report "was not started before" - } -} -Daemon instproc restart {} { - [self] stop - [self] start -} -Daemon instproc stopall {} { - foreach pidfile [glob -nocomplain $::opt(-rundir)/*.PID] { - set n [file rootname [file tail $pidfile]] - [self] configure -progname $n -stop - } -} -Daemon instproc startall {} { - foreach file [glob -nocomplain $::opt(-rundir)/*] { - if {[string match *.PID $file]} continue - [self] configure -progname $file -start - } -} -Daemon d -init -progname $daemon -$action Index: xotcl/apps/utils/xo-whichPkg =================================================================== diff -u -N --- xotcl/apps/utils/xo-whichPkg (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/apps/utils/xo-whichPkg (revision 0) @@ -1,24 +0,0 @@ -#!/usr/bin/env tclsh -# $Id: xo-whichPkg,v 1.2 2006/02/18 22:17:32 neumann Exp $ -package require XOTcl; namespace import -force xotcl::* - -@ @File { - description { - A small sample script to show which package is loaded from where - when a target package is loaded. <@p> - Usage: "xo-whichPkg -pkg PACKAGENAME" - } - authors { - Fredj Dridi dridi@nestroy.wi-inf.uni-essen.de - } - date "[::xotcl::rcs date {$Date: 2006/02/18 22:17:32 $}]" -} - -array set opts { - -pkg xotcl::comm::httpd -} -array set opts $argv - -package require xotcl::package -package verbose 1 -puts stderr [package require $opts(-pkg)] Index: xotcl/apps/utils/xotclsh =================================================================== diff -u -N --- xotcl/apps/utils/xotclsh (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/apps/utils/xotclsh (revision 0) @@ -1,13 +0,0 @@ -#!/usr/local/bin/tclsh8.5 -if {$argc == 0} { - puts "Don't use [info script] as interactive shell! Use instead:" - puts " /usr/local/bin/tclsh8.5" - puts " package require XOTcl; namespace import ::xotcl::*" -} else { - package require XOTcl - namespace import ::xotcl::* - set argv0 [lindex $argv 0] - set argv [lreplace $argv 0 0] - incr argc -1 - source $argv0 -} Index: xotcl/apps/utils/xotclsh.in =================================================================== diff -u -N --- xotcl/apps/utils/xotclsh.in (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/utils/xotclsh.in (revision 0) @@ -1,13 +0,0 @@ -#!@TCLSH_PROG@ -if {$argc == 0} { - puts "Don't use [info script] as interactive shell! Use instead:" - puts " @TCLSH_PROG@" - puts " package require XOTcl; namespace import ::xotcl::*" -} else { - package require XOTcl - namespace import ::xotcl::* - set argv0 [lindex $argv 0] - set argv [lreplace $argv 0 0] - incr argc -1 - source $argv0 -} Index: xotcl/apps/utils/xowish =================================================================== diff -u -N --- xotcl/apps/utils/xowish (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/apps/utils/xowish (revision 0) @@ -1,17 +0,0 @@ -#!@WISH_PROG@ -###!/usr/local/bin/tclsh8.5 -###package require Tk -if {$argc == 0} { - puts "Don't use [info script] as interactive shell! Use instead:" - puts " @WISH_PROG@" - puts " package require XOTcl; namespace import ::xotcl::*" - exit -} else { - package require XOTcl - namespace import ::xotcl::* - set argv0 [lindex $argv 0] - set argv [lreplace $argv 0 0] - incr argc -1 - source $argv0 -} -###catch {vwait forever} Index: xotcl/apps/utils/xowish.in =================================================================== diff -u -N --- xotcl/apps/utils/xowish.in (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/apps/utils/xowish.in (revision 0) @@ -1,17 +0,0 @@ -#!@WISH_PROG@ -###!@TCLSH_PROG@ -###package require Tk -if {$argc == 0} { - puts "Don't use [info script] as interactive shell! Use instead:" - puts " @WISH_PROG@" - puts " package require XOTcl; namespace import ::xotcl::*" - exit -} else { - package require XOTcl - namespace import ::xotcl::* - set argv0 [lindex $argv 0] - set argv [lreplace $argv 0 0] - incr argc -1 - source $argv0 -} -###catch {vwait forever} \ No newline at end of file Index: xotcl/autoclean.sh =================================================================== diff -u -N --- xotcl/autoclean.sh (revision f13b9000e83d3896683de0ecf438216be88832fe) +++ xotcl/autoclean.sh (revision 0) @@ -1,8 +0,0 @@ -#!/bin/sh - -make distclean - -for configscript in `find . -name configure` -do - rm -f $configscript -done \ No newline at end of file Index: xotcl/autogen.sh =================================================================== diff -u -N --- xotcl/autogen.sh (revision f13b9000e83d3896683de0ecf438216be88832fe) +++ xotcl/autogen.sh (revision 0) @@ -1,6 +0,0 @@ -#!/bin/sh - -for pdir in `find . -name configure.in` -do - (cd `dirname $pdir`; autoconf) -done Index: xotcl/config/config.guess =================================================================== diff -u -N --- xotcl/config/config.guess (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/config/config.guess (revision 0) @@ -1,1415 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - -timestamp='2003-10-07' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha*:OpenVMS:*:*) - echo alpha-hp-vms - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit 0;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit 0 ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - # GNU/KFreeBSD systems have a "k" prefix to indicate we are using - # FreeBSD's kernel, but not the complete OS. - case ${LIBC} in gnu) kernel_only='k' ;; esac - echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit 0 ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit 0 ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit 0 ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit 0 ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit 0 ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i*86:*:5:[78]*) - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit 0 ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - case `uname -p` in - *86) UNAME_PROCESSOR=i686 ;; - powerpc) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit 0 ;; - NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit 0 ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit 0 ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit 0 ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit 0 ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit 0 ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit 0 ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit 0 ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit 0 ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: Index: xotcl/config/config.sub =================================================================== diff -u -N --- xotcl/config/config.sub (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/config/config.sub (revision 0) @@ -1,1510 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - -timestamp='2003-10-07' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit 0;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32r | m68000 | m68k | m88k | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | msp430 \ - | ns16k | ns32k \ - | openrisc | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32r-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | msp430-* \ - | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nv1) - basic_machine=nv1-cray - os=-unicosmp - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - or32 | or32-*) - basic_machine=or32-unknown - os=-coff - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: Index: xotcl/config/install-sh =================================================================== diff -u -N --- xotcl/config/install-sh (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/config/install-sh (revision 0) @@ -1,119 +0,0 @@ -#!/bin/sh - -# -# install - install a program, script, or datafile -# This comes from X11R5; it is not part of GNU. -# -# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" - -instcmd="$mvprog" -chmodcmd="" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -fi - -if [ x"$dst" = x ] -then - echo "install: no destination specified" - exit 1 -fi - - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - -if [ -d $dst ] -then - dst="$dst"/`basename $src` -fi - -# Make a temp file name in the proper directory. - -dstdir=`dirname $dst` -dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - -$doit $instcmd $src $dsttmp - -# and set any options; do chmod last to preserve setuid bits - -if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi -if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi -if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi -if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi - -# Now rename the file to the real destination. - -$doit $rmcmd $dst -$doit $mvcmd $dsttmp $dst - - -exit 0 Index: xotcl/config/mktar.sh =================================================================== diff -u -N --- xotcl/config/mktar.sh (revision 20e421dc641dc39b53106b1296ac7e09d0b206f2) +++ xotcl/config/mktar.sh (revision 0) @@ -1,14 +0,0 @@ -#!/bin/sh - -pwd=`pwd` -name=`basename $(pwd)` -echo "name=$name" - -make distclean -cd .. -tar zcvf ./$name.tar.gz \ - `find ./$name -type f -o -type l| fgrep -v CVS | fgrep -v SCCS | \ - fgrep -v Attic | fgrep -v "autom4te"| fgrep -v "~"|fgrep -v .db | \ - fgrep -v .junk | fgrep -v "#" |fgrep -v .DS_Store| fgrep -v config. | \ - fgrep -v .gdb` - Index: xotcl/configure =================================================================== diff -u -N --- xotcl/configure (revision caee4f272cfc744a06a7df61e2f3c73da1b6be64) +++ xotcl/configure (revision 0) @@ -1,11483 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for xotcl 1.5.6. -# -# Copyright (C) 2003 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_config_libobj_dir=. -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -# Identity of this package. -PACKAGE_NAME='xotcl' -PACKAGE_TARNAME='xotcl' -PACKAGE_VERSION='1.5.6' -PACKAGE_STRING='xotcl 1.5.6' -PACKAGE_BUGREPORT='' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_STAT_H -# include -#endif -#if STDC_HEADERS -# include -# include -#else -# if HAVE_STDLIB_H -# include -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif -# include -#endif -#if HAVE_STRINGS_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif -#if HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS subdirs XOTCL_VERSION XOTCL_MAJOR_VERSION XOTCL_MINOR_VERSION XOTCL_RELEASE_LEVEL TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_LIBS TK_XINCLUDES CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS aol_prefix PKG_SOURCES PKG_OBJECTS TCL_TOP_DIR_NATIVE TCL_GENERIC_DIR_NATIVE TCL_UNIX_DIR_NATIVE TCL_WIN_DIR_NATIVE TCL_BMAP_DIR_NATIVE TCL_TOOL_DIR_NATIVE TCL_PLATFORM_DIR_NATIVE TCL_INCLUDES CLEANFILES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG XOTCL_COMPATIBLE_TCLSH PKG_DIR pkgdatadir pkglibdir pkgincludedir SHARED_LIB_SUFFIX UNSHARED_LIB_SUFFIX XOTCL_BUILD_LIB_SPEC XOTCL_LIB_SPEC XOTCL_BUILD_STUB_LIB_SPEC XOTCL_STUB_LIB_SPEC XOTCL_BUILD_STUB_LIB_PATH XOTCL_STUB_LIB_PATH XOTCL_SRC_DIR XOTCLSH XOWISH XOTCL_BUILD_INCLUDE_DIR XOTCL_BUILD_INCLUDE_SPEC test_actiweb libdirs_actiweb apps_actiweb TEA_PLATFORM CONFIG_CLEAN_FILES LTLIBOBJS' -ac_subst_files='' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures xotcl 1.5.6 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -_ACEOF - - cat <<_ACEOF -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] -_ACEOF - - cat <<\_ACEOF -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of xotcl 1.5.6:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-threads build with threads - --enable-shared build and link with shared libraries (default: on) - --enable-64bit enable 64bit support (default: off) - --enable-64bit-vis enable 64bit Sparc VIS support (default: off) - --enable-wince enable Win/CE support (where applicable) - --enable-load allow dynamic loading and "load" command (default: - on) - --enable-symbols build with debugging symbols (default: off) - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gdbm=GDBM_INCLUDE_DIR,GDBM_LIB_DIR - absolute path to gdbm.h and optionally the path to the library, - --without-gdbm disables build of Tcl Gdbm - --with-aolserver3=AOL_SERVER_DIR, (containing include ,...) - --without-aolserver3 disables build of AOLserver 3 module - --with-actiweb=yes|no, - --without-actiweb disables actiweb components - --with-xotclsh=yes|no, - --without-xotclsh disables built of xotclsh - --with-xowish=yes|no, - --without-xowish disables built of xowish - --with-all=yes|no, - --without-all disables built of all - --with-tclinclude directory containing the public Tcl header files. - --with-tcl directory containing tcl configuration - (tclConfig.sh) - --with-tk directory containing tk configuration (tkConfig.sh) - --with-celib=DIR use Windows/CE support library from DIR - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\_ACEOF -xotcl configure 1.5.6 -generated by GNU Autoconf 2.59 - -Copyright (C) 2003 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit 0 -fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by xotcl $as_me 1.5.6, which was -generated by GNU Autoconf 2.59. Invocation command line was - - $ $0 $@ - -_ACEOF -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_sep= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - sed "/^$/d" confdefs.h | sort - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#-------------------------------------------------------------------- -# Call TEA_INIT as the first TEA_ macro to set up initial vars. -# This will define a ${TEA_PLATFORM} variable == "unix" or "windows". -#-------------------------------------------------------------------- - - - # TEA extensions pass this us the version of TEA they think they - # are compatible with. - TEA_VERSION="3.6" - - echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 -echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 - if test x"${PACKAGE_NAME}" = x ; then - { { echo "$as_me:$LINENO: error: -The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 -echo "$as_me: error: -The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} - { (exit 1); exit 1; }; } - fi - if test x"3.6" = x ; then - { { echo "$as_me:$LINENO: error: -TEA version not specified." >&5 -echo "$as_me: error: -TEA version not specified." >&2;} - { (exit 1); exit 1; }; } - elif test "3.6" != "${TEA_VERSION}" ; then - echo "$as_me:$LINENO: result: warning: requested TEA version \"3.6\", have \"${TEA_VERSION}\"" >&5 -echo "${ECHO_T}warning: requested TEA version \"3.6\", have \"${TEA_VERSION}\"" >&6 - else - echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 -echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 - fi - case "`uname -s`" in - *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) - # Extract the first word of "cygpath", so it can be a program name with args. -set dummy cygpath; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CYGPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CYGPATH"; then - ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CYGPATH="cygpath -w" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" -fi -fi -CYGPATH=$ac_cv_prog_CYGPATH -if test -n "$CYGPATH"; then - echo "$as_me:$LINENO: result: $CYGPATH" >&5 -echo "${ECHO_T}$CYGPATH" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - EXEEXT=".exe" - TEA_PLATFORM="windows" - ;; - *) - CYGPATH=echo - EXEEXT="" - TEA_PLATFORM="unix" - ;; - esac - - # Check if exec_prefix is set. If not use fall back to prefix. - # Note when adjusted, so that TEA_PREFIX can correct for this. - # This is needed for recursive configures, since autoconf propagates - # $prefix, but not $exec_prefix (doh!). - if test x$exec_prefix = xNONE ; then - exec_prefix_default=yes - exec_prefix=$prefix - fi - - - - - # This package name must be replaced statically for AC_SUBST to work - - # Substitute STUB_LIB_FILE in case package creates a stub library too. - - - # We AC_SUBST these here to ensure they are subst'ed, - # in case the user doesn't call TEA_ADD_... - - - - - - - - -ac_aux_dir= -for ac_dir in config $srcdir/config; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config $srcdir/config" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - - -#-------------------------------------------------------------------- -# specify some extra flags -#-------------------------------------------------------------------- - - -# Check whether --with-gdbm or --without-gdbm was given. -if test "${with_gdbm+set}" = set; then - withval="$with_gdbm" - with_gdbm=$withval -else - with_gdbm=no -fi; - -# Check whether --with-aolserver3 or --without-aolserver3 was given. -if test "${with_aolserver3+set}" = set; then - withval="$with_aolserver3" - with_aol3=$withval -else - with_aol3=no -fi; - -# Check whether --with-actiweb or --without-actiweb was given. -if test "${with_actiweb+set}" = set; then - withval="$with_actiweb" - with_actiweb=$withval -else - with_actiweb=no -fi; - -# Check whether --with-xotclsh or --without-xotclsh was given. -if test "${with_xotclsh+set}" = set; then - withval="$with_xotclsh" - with_xotclsh=$withval -else - with_xotclsh=no -fi; - -# Check whether --with-xowish or --without-xowish was given. -if test "${with_xowish+set}" = set; then - withval="$with_xowish" - with_xowish=$withval -else - with_xowish=no -fi; - -# Check whether --with-all or --without-all was given. -if test "${with_all+set}" = set; then - withval="$with_all" - with_all=$withval -else - with_all=no -fi; - -# Check whether --with-all or --without-all was given. -if test "${with_all+set}" = set; then - withval="$with_all" - with_all=$withval -else - with_all=no -fi; - -# Check whether --with-tclinclude or --without-tclinclude was given. -if test "${with_tclinclude+set}" = set; then - withval="$with_tclinclude" - with_tclinclude=${withval} -fi; - -subdirs="" - -if test "$with_all" = yes; then - with_actiweb=yes - with_xotclsh=yes - with_xowish=yes - with_gdbm=yes -fi - -if test "$with_actiweb" = yes; then - test_actiweb="test-actiweb" - libdirs_actiweb="actiweb rdf registry store xml patterns" - apps_actiweb="actiweb persistence" - subdirs="$subdirs library/store/XOTclSdbm/" - if ! test "$with_gdbm" = no; then - subdirs="$subdirs library/store/XOTclGdbm/" - fi - subdirs="$subdirs library/xml/TclExpat-1.1/" -else - test_actiweb="" - libdirs_actiweb="" - apps_actiweb="" -fi - - - -if test "$with_tk" = no; then with_xowish="" ; fi -if test "$with_xotclsh" = yes; then XOTCLSH="xotclsh" ; else XOTCLSH=""; fi -if test "$with_xowish" = yes; then XOWISH="xowish" ; else XOWISH=""; fi - - -#-------------------------------------------------------------------- -# __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. -#-------------------------------------------------------------------- - -# do not modify the following lines manually, they are generated with changeXOTclVersion -XOTCL_MAJOR_VERSION=1 -XOTCL_MINOR_VERSION=5 -XOTCL_RELEASE_LEVEL=.6 - -XOTCL_VERSION=${XOTCL_MAJOR_VERSION}.${XOTCL_MINOR_VERSION} -NODOT_VERSION=${XOTCL_MAJOR_VERSION}${XOTCL_MINOR_VERSION} - - - - - - -echo "Configuring XOTcl Version $PACKAGE_VERSION" - -#-------------------------------------------------------------------- -# Load the tclConfig.sh file -#-------------------------------------------------------------------- - - - - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - - if test x"${no_tcl}" = x ; then - # we reset no_tcl in case something fails here - no_tcl=true - -# Check whether --with-tcl or --without-tcl was given. -if test "${with_tcl+set}" = set; then - withval="$with_tcl" - with_tclconfig=${withval} -fi; - echo "$as_me:$LINENO: checking for Tcl configuration" >&5 -echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 - if test "${ac_cv_c_tclconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - case ${with_tclconfig} in - */tclConfig.sh ) - if test -f ${with_tclconfig}; then - { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 -echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} - with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 -echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} - { (exit 1); exit 1; }; } - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tcl.framework/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - -fi - - - if test x"${ac_cv_c_tclconfig}" = x ; then - TCL_BIN_DIR="# no Tcl configs found" - { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 -echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} - exit 0 - else - no_tcl= - TCL_BIN_DIR=${ac_cv_c_tclconfig} - echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 - fi - fi - - - echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 - - if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - echo "$as_me:$LINENO: result: loading" >&5 -echo "${ECHO_T}loading" >&6 - . "${TCL_BIN_DIR}/tclConfig.sh" - else - echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tcl.framework installed in an arbitary location. - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then - for i in "`cd ${TCL_BIN_DIR}; pwd`" \ - "`cd ${TCL_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then - TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" - break - fi - done - fi - if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then - TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" - TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - - - - - - - - - - - - - - - - - - - -#-------------------------------------------------------------------- -# check for TK -#-------------------------------------------------------------------- - -if test "$with_xowish" = yes; then - - # - # Ok, lets find the tk configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tk - # - - if test x"${no_tk}" = x ; then - # we reset no_tk in case something fails here - no_tk=true - -# Check whether --with-tk or --without-tk was given. -if test "${with_tk+set}" = set; then - withval="$with_tk" - with_tkconfig=${withval} -fi; - echo "$as_me:$LINENO: checking for Tk configuration" >&5 -echo $ECHO_N "checking for Tk configuration... $ECHO_C" >&6 - if test "${ac_cv_c_tkconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - - # First check to see if --with-tkconfig was specified. - if test x"${with_tkconfig}" != x ; then - case ${with_tkconfig} in - */tkConfig.sh ) - if test -f ${with_tkconfig}; then - { echo "$as_me:$LINENO: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5 -echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;} - with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tkconfig}/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` - else - { { echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5 -echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;} - { (exit 1); exit 1; }; } - fi - fi - - # then check for a private Tk library - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in \ - ../tk \ - `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \ - ../../tk \ - `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \ - ../../../tk \ - `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do - if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tk.framework/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in \ - ${srcdir}/../tk \ - `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \ - `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do - if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - -fi - - - if test x"${ac_cv_c_tkconfig}" = x ; then - TK_BIN_DIR="# no Tk configs found" - { echo "$as_me:$LINENO: WARNING: Can't find Tk configuration definitions" >&5 -echo "$as_me: WARNING: Can't find Tk configuration definitions" >&2;} - exit 0 - else - no_tk= - TK_BIN_DIR=${ac_cv_c_tkconfig} - echo "$as_me:$LINENO: result: found ${TK_BIN_DIR}/tkConfig.sh" >&5 -echo "${ECHO_T}found ${TK_BIN_DIR}/tkConfig.sh" >&6 - fi - fi - - - echo "$as_me:$LINENO: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5 -echo $ECHO_N "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... $ECHO_C" >&6 - - if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then - echo "$as_me:$LINENO: result: loading" >&5 -echo "${ECHO_T}loading" >&6 - . "${TK_BIN_DIR}/tkConfig.sh" - else - echo "$as_me:$LINENO: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5 -echo "${ECHO_T}could not find ${TK_BIN_DIR}/tkConfig.sh" >&6 - fi - - # eval is required to do the TK_DBGX substitution - eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" - eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" - - # If the TK_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TK_LIB_SPEC will be set to the value - # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC - # instead of TK_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TK_BIN_DIR}/Makefile" ; then - TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} - TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} - TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tk.framework installed in an arbitary location. - case ${TK_DEFS} in - *TK_FRAMEWORK*) - if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then - for i in "`cd ${TK_BIN_DIR}; pwd`" \ - "`cd ${TK_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then - TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" - break - fi - done - fi - if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then - TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" - TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TK_DBGX substitution - eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" - eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" - eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" - eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" - - # Ensure windowingsystem is defined - if test "${TEA_PLATFORM}" = "unix" ; then - case ${TK_DEFS} in - *MAC_OSX_TK*) - -cat >>confdefs.h <<\_ACEOF -#define MAC_OSX_TK 1 -_ACEOF - - TEA_WINDOWINGSYSTEM="aqua" - ;; - *) - TEA_WINDOWINGSYSTEM="x11" - ;; - esac - elif test "${TEA_PLATFORM}" = "windows" ; then - TEA_WINDOWINGSYSTEM="win32" - fi - - - - - - - - - - - - - - - - -# TEA_PUBLIC_TK_HEADERS -# TEA_PATH_X -fi - -#-------------------------------------------------------------------- -# Handle the --prefix=... option by defaulting to what Tcl gave. -# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. -#----------------------------------------------------------------------- - - - if test "${prefix}" = "NONE"; then - prefix_default=yes - if test x"${TCL_PREFIX}" != x; then - { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 -echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} - prefix=${TCL_PREFIX} - else - { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 -echo "$as_me: --prefix defaulting to /usr/local" >&6;} - prefix=/usr/local - fi - fi - if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ - -o x"${exec_prefix_default}" = x"yes" ; then - if test x"${TCL_EXEC_PREFIX}" != x; then - { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 -echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} - exec_prefix=${TCL_EXEC_PREFIX} - else - { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 -echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} - exec_prefix=$prefix - fi - fi - - -#----------------------------------------------------------------------- -# Standard compiler checks. -# This sets up CC by using the CC env var, or looks for gcc otherwise. -# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create -# the basic setup necessary to compile executables. -#----------------------------------------------------------------------- - - - # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) - # in this macro, they need to go into TEA_SETUP_COMPILER instead. - - # If the user did not set CFLAGS, set it now to keep - # the AC_PROG_CC macro from adding "-g -O2". - if test "${CFLAGS+set}" != "set" ; then - CFLAGS="" - fi - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - # Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - - #-------------------------------------------------------------------- - # Checks to see if the make program sets the $MAKE variable. - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\_ACEOF -all: - @echo 'ac_maketemp="$(MAKE)"' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftest.make -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SET_MAKE= -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - - #-------------------------------------------------------------------- - # Find ranlib - #-------------------------------------------------------------------- - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - - - #-------------------------------------------------------------------- - # Determines the correct binary file extension (.o, .obj, .exe etc.) - #-------------------------------------------------------------------- - - - - - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. - - - #------------------------------------------------------------------------ - # If we're using GCC, see if the compiler understands -pipe. If so, use it. - # It makes compiling go faster. (This is only a performance feature.) - #------------------------------------------------------------------------ - - if test -z "$no_pipe" -a -n "$GCC"; then - echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 -echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 -if test "${tcl_cv_cc_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_pipe=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_pipe=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 -echo "${ECHO_T}$tcl_cv_cc_pipe" >&6 - if test $tcl_cv_cc_pipe = yes; then - CFLAGS="$CFLAGS -pipe" - fi - fi - - #-------------------------------------------------------------------- - # Common compiler flag setup - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_bigendian=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -# It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - - if test "${TEA_PLATFORM}" = "unix" ; then - - #-------------------------------------------------------------------- - # On a few very rare systems, all of the libm.a stuff is - # already in libc.a. Set compiler flags accordingly. - # Also, Linux requires the "ieee" library for math to work - # right (and it must appear before "-lm"). - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking for sin" >&5 -echo $ECHO_N "checking for sin... $ECHO_C" >&6 -if test "${ac_cv_func_sin+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define sin to an innocuous variant, in case declares sin. - For example, HP-UX 11i declares gettimeofday. */ -#define sin innocuous_sin - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char sin (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef sin - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char sin (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_sin) || defined (__stub___sin) -choke me -#else -char (*f) () = sin; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != sin; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_sin=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_sin=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 -echo "${ECHO_T}$ac_cv_func_sin" >&6 -if test $ac_cv_func_sin = yes; then - MATH_LIBS="" -else - MATH_LIBS="-lm" -fi - - echo "$as_me:$LINENO: checking for main in -lieee" >&5 -echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 -if test "${ac_cv_lib_ieee_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lieee $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_ieee_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_ieee_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 -echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 -if test $ac_cv_lib_ieee_main = yes; then - MATH_LIBS="-lieee $MATH_LIBS" -fi - - - #-------------------------------------------------------------------- - # Interactive UNIX requires -linet instead of -lsocket, plus it - # needs net/errno.h to define the socket-related error codes. - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking for main in -linet" >&5 -echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 -if test "${ac_cv_lib_inet_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-linet $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_inet_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_inet_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 -echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 -if test $ac_cv_lib_inet_main = yes; then - LIBS="$LIBS -linet" -fi - - if test "${ac_cv_header_net_errno_h+set}" = set; then - echo "$as_me:$LINENO: checking for net/errno.h" >&5 -echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_net_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking net/errno.h usability" >&5 -echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking net/errno.h presence" >&5 -echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## -------------------------------- ## -## Report this to the xotcl lists. ## -## -------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for net/errno.h" >&5 -echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_net_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_net_errno_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 - -fi -if test $ac_cv_header_net_errno_h = yes; then - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_NET_ERRNO_H 1 -_ACEOF - -fi - - - - #-------------------------------------------------------------------- - # Check for the existence of the -lsocket and -lnsl libraries. - # The order here is important, so that they end up in the right - # order in the command line generated by make. Here are some - # special considerations: - # 1. Use "connect" and "accept" to check for -lsocket, and - # "gethostbyname" to check for -lnsl. - # 2. Use each function name only once: can't redo a check because - # autoconf caches the results of the last check and won't redo it. - # 3. Use -lnsl and -lsocket only if they supply procedures that - # aren't already present in the normal libraries. This is because - # IRIX 5.2 has libraries, but they aren't needed and they're - # bogus: they goof up name resolution if used. - # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. - # To get around this problem, check for both libraries together - # if -lsocket doesn't work by itself. - #-------------------------------------------------------------------- - - tcl_checkBoth=0 - echo "$as_me:$LINENO: checking for connect" >&5 -echo $ECHO_N "checking for connect... $ECHO_C" >&6 -if test "${ac_cv_func_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define connect to an innocuous variant, in case declares connect. - For example, HP-UX 11i declares gettimeofday. */ -#define connect innocuous_connect - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef connect - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_connect) || defined (__stub___connect) -choke me -#else -char (*f) () = connect; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != connect; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_connect=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_connect=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 -echo "${ECHO_T}$ac_cv_func_connect" >&6 -if test $ac_cv_func_connect = yes; then - tcl_checkSocket=0 -else - tcl_checkSocket=1 -fi - - if test "$tcl_checkSocket" = 1; then - echo "$as_me:$LINENO: checking for setsockopt" >&5 -echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 -if test "${ac_cv_func_setsockopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define setsockopt to an innocuous variant, in case declares setsockopt. - For example, HP-UX 11i declares gettimeofday. */ -#define setsockopt innocuous_setsockopt - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char setsockopt (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef setsockopt - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setsockopt (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_setsockopt) || defined (__stub___setsockopt) -choke me -#else -char (*f) () = setsockopt; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != setsockopt; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_setsockopt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_setsockopt=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 -if test $ac_cv_func_setsockopt = yes; then - : -else - echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 -echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 -if test "${ac_cv_lib_socket_setsockopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setsockopt (); -int -main () -{ -setsockopt (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_socket_setsockopt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_socket_setsockopt=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 -if test $ac_cv_lib_socket_setsockopt = yes; then - LIBS="$LIBS -lsocket" -else - tcl_checkBoth=1 -fi - -fi - - fi - if test "$tcl_checkBoth" = 1; then - tk_oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - echo "$as_me:$LINENO: checking for accept" >&5 -echo $ECHO_N "checking for accept... $ECHO_C" >&6 -if test "${ac_cv_func_accept+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define accept to an innocuous variant, in case declares accept. - For example, HP-UX 11i declares gettimeofday. */ -#define accept innocuous_accept - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char accept (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef accept - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char accept (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_accept) || defined (__stub___accept) -choke me -#else -char (*f) () = accept; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != accept; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_accept=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_accept=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 -echo "${ECHO_T}$ac_cv_func_accept" >&6 -if test $ac_cv_func_accept = yes; then - tcl_checkNsl=0 -else - LIBS=$tk_oldLibs -fi - - fi - echo "$as_me:$LINENO: checking for gethostbyname" >&5 -echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 -if test "${ac_cv_func_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. - For example, HP-UX 11i declares gettimeofday. */ -#define gethostbyname innocuous_gethostbyname - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef gethostbyname - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -char (*f) () = gethostbyname; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != gethostbyname; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_gethostbyname=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 -if test $ac_cv_func_gethostbyname = yes; then - : -else - echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 -echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 -if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -int -main () -{ -gethostbyname (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_nsl_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_nsl_gethostbyname=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 -if test $ac_cv_lib_nsl_gethostbyname = yes; then - LIBS="$LIBS -lnsl" -fi - -fi - - - # Don't perform the eval of the libraries here because DL_LIBS - # won't be set until we call TEA_CONFIG_CFLAGS - - TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' - - - - - echo "$as_me:$LINENO: checking dirent.h" >&5 -echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 -if test "${tcl_cv_dirent_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ - -#ifndef _POSIX_SOURCE -# ifdef __Lynx__ - /* - * Generate compilation error to make the test fail: Lynx headers - * are only valid if really in the POSIX environment. - */ - - missing_procedure(); -# endif -#endif -DIR *d; -struct dirent *entryPtr; -char *p; -d = opendir("foobar"); -entryPtr = readdir(d); -p = entryPtr->d_name; -closedir(d); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_dirent_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_dirent_h=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 -echo "${ECHO_T}$tcl_cv_dirent_h" >&6 - - if test $tcl_cv_dirent_h = no; then - -cat >>confdefs.h <<\_ACEOF -#define NO_DIRENT_H 1 -_ACEOF - - fi - - if test "${ac_cv_header_errno_h+set}" = set; then - echo "$as_me:$LINENO: checking for errno.h" >&5 -echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_errno_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking errno.h usability" >&5 -echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking errno.h presence" >&5 -echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## -------------------------------- ## -## Report this to the xotcl lists. ## -## -------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for errno.h" >&5 -echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_errno_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_errno_h" >&6 - -fi -if test $ac_cv_header_errno_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_ERRNO_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_float_h+set}" = set; then - echo "$as_me:$LINENO: checking for float.h" >&5 -echo $ECHO_N "checking for float.h... $ECHO_C" >&6 -if test "${ac_cv_header_float_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 -echo "${ECHO_T}$ac_cv_header_float_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking float.h usability" >&5 -echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking float.h presence" >&5 -echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## -------------------------------- ## -## Report this to the xotcl lists. ## -## -------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for float.h" >&5 -echo $ECHO_N "checking for float.h... $ECHO_C" >&6 -if test "${ac_cv_header_float_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_float_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 -echo "${ECHO_T}$ac_cv_header_float_h" >&6 - -fi -if test $ac_cv_header_float_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_FLOAT_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_values_h+set}" = set; then - echo "$as_me:$LINENO: checking for values.h" >&5 -echo $ECHO_N "checking for values.h... $ECHO_C" >&6 -if test "${ac_cv_header_values_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 -echo "${ECHO_T}$ac_cv_header_values_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking values.h usability" >&5 -echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking values.h presence" >&5 -echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## -------------------------------- ## -## Report this to the xotcl lists. ## -## -------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for values.h" >&5 -echo $ECHO_N "checking for values.h... $ECHO_C" >&6 -if test "${ac_cv_header_values_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_values_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 -echo "${ECHO_T}$ac_cv_header_values_h" >&6 - -fi -if test $ac_cv_header_values_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_VALUES_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_limits_h+set}" = set; then - echo "$as_me:$LINENO: checking for limits.h" >&5 -echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 -if test "${ac_cv_header_limits_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 -echo "${ECHO_T}$ac_cv_header_limits_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking limits.h usability" >&5 -echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking limits.h presence" >&5 -echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## -------------------------------- ## -## Report this to the xotcl lists. ## -## -------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for limits.h" >&5 -echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 -if test "${ac_cv_header_limits_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_limits_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 -echo "${ECHO_T}$ac_cv_header_limits_h" >&6 - -fi -if test $ac_cv_header_limits_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIMITS_H 1 -_ACEOF - -else - -cat >>confdefs.h <<\_ACEOF -#define NO_LIMITS_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_stdlib_h+set}" = set; then - echo "$as_me:$LINENO: checking for stdlib.h" >&5 -echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking stdlib.h usability" >&5 -echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking stdlib.h presence" >&5 -echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## -------------------------------- ## -## Report this to the xotcl lists. ## -## -------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for stdlib.h" >&5 -echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_stdlib_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 - -fi -if test $ac_cv_header_stdlib_h = yes; then - tcl_ok=1 -else - tcl_ok=0 -fi - - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtol" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtoul" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtod" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - if test $tcl_ok = 0; then - -cat >>confdefs.h <<\_ACEOF -#define NO_STDLIB_H 1 -_ACEOF - - fi - if test "${ac_cv_header_string_h+set}" = set; then - echo "$as_me:$LINENO: checking for string.h" >&5 -echo $ECHO_N "checking for string.h... $ECHO_C" >&6 -if test "${ac_cv_header_string_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 -echo "${ECHO_T}$ac_cv_header_string_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking string.h usability" >&5 -echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking string.h presence" >&5 -echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## -------------------------------- ## -## Report this to the xotcl lists. ## -## -------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for string.h" >&5 -echo $ECHO_N "checking for string.h... $ECHO_C" >&6 -if test "${ac_cv_header_string_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_string_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 -echo "${ECHO_T}$ac_cv_header_string_h" >&6 - -fi -if test $ac_cv_header_string_h = yes; then - tcl_ok=1 -else - tcl_ok=0 -fi - - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strstr" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strerror" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - - # See also memmove check below for a place where NO_STRING_H can be - # set and why. - - if test $tcl_ok = 0; then - -cat >>confdefs.h <<\_ACEOF -#define NO_STRING_H 1 -_ACEOF - - fi - - if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo "$as_me:$LINENO: checking for sys/wait.h" >&5 -echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 -if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 -echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 -echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## -------------------------------- ## -## Report this to the xotcl lists. ## -## -------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for sys/wait.h" >&5 -echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 -if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_sys_wait_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 - -fi -if test $ac_cv_header_sys_wait_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_SYS_WAIT_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_dlfcn_h+set}" = set; then - echo "$as_me:$LINENO: checking for dlfcn.h" >&5 -echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 -if test "${ac_cv_header_dlfcn_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 -echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 -echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 -echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## -------------------------------- ## -## Report this to the xotcl lists. ## -## -------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for dlfcn.h" >&5 -echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 -if test "${ac_cv_header_dlfcn_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_dlfcn_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 -echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 - -fi -if test $ac_cv_header_dlfcn_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_DLFCN_H 1 -_ACEOF - -fi - - - - # OS/390 lacks sys/param.h (and doesn't need it, by chance). - -for ac_header in sys/param.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## -------------------------------- ## -## Report this to the xotcl lists. ## -## -------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - # Let the user call this, because if it triggers, they will - # need a compat/strtod.c that is correct. Users can also - # use Tcl_GetDouble(FromObj) instead. - #TEA_BUGGY_STRTOD - fi - - -#-------------------------------------------------------------------- -# check for extra flags -# -# FORCE_NO_STUBS is deactivated for now -if ! test "$with_aol3" = "no"; then - echo "Pre-configuring AOL-Server (xotcl)" - AOL_DEFINES="-DAOL_SERVER -DUSE_TCL8X -I$with_aol3/include -I$TCL_SRC_DIR/generic" - FORCE_NO_STUBS=1 -else - AOL_DEFINES="" - FORCE_NO_STUBS=0 -fi - -aol_prefix="/usr/local/aolserver" -if test -d "${prefix}/modules/tcl" ; then aol_prefix="${prefix}" ; fi - - -#-------------------------------------------------------------------- -# check for tclCompile.h (needed, when compiled without full source) -if test -f "$TCL_SRC_DIR/generic/tclCompile.h"; then - HAVE_TCL_COMPILE_H="-DHAVE_TCL_COMPILE_H=1" -else - HAVE_TCL_COMPILE_H="" -fi - -#----------------------------------------------------------------------- -# __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. -#----------------------------------------------------------------------- - - - - vars="xotcl.c xotclError.c xotclMetaData.c xotclObjectData.c xotclProfile.c \ - xotclTrace.c xotclUtil.c xotclShadow.c xotclCompile.c aolstub.c xotclStubInit.c" - for i in $vars; do - case $i in - \$*) - # allow $-var names - PKG_SOURCES="$PKG_SOURCES $i" - PKG_OBJECTS="$PKG_OBJECTS $i" - ;; - *) - # check for existence - allows for generic/win/unix VPATH - # To add more dirs here (like 'src'), you have to update VPATH - # in Makefile.in as well - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 -echo "$as_me: error: could not find source file '$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_SOURCES="$PKG_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" - fi - PKG_OBJECTS="$PKG_OBJECTS $j" - ;; - esac - done - - - - - vars="generic/xotcl.h generic/xotclInt.h generic/xotclDecls.h generic/xotclIntDecls.h" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 -echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_HEADERS="$PKG_HEADERS $i" - done - - - - vars="" - for i in $vars; do - PKG_INCLUDES="$PKG_INCLUDES $i" - done - - - - vars="" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - - - - PKG_CFLAGS="$PKG_CFLAGS -DXOTCLVERSION=\\\"$XOTCL_VERSION\\\" -DXOTCLPATCHLEVEL=\\\"$XOTCL_RELEASE_LEVEL\\\" \ - $AOL_DEFINES $HAVE_TCL_COMPILE_H" - - - - vars="xotclStubLib.c" - for i in $vars; do - # check for existence - allows for generic/win/unix VPATH - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 -echo "$as_me: error: could not find stub source file '$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" - fi - PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" - done - - - - - vars="" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 -echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" - done - - - - -#-------------------------------------------------------------------- - -#-------------------------------------------------------------------- -# __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 TEa_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG -# so that we can extract TCL_SRC_DIR from the config file (in the case -# of private headers -#-------------------------------------------------------------------- - -#TEA_PUBLIC_TCL_HEADERS - - echo "$as_me:$LINENO: checking for Tcl private include files" >&5 -echo $ECHO_N "checking for Tcl private include files... $ECHO_C" >&6 - - TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` - TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" - TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" - TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" - TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" - TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" - TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" - TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" - - if test "${TEA_PLATFORM}" = "windows"; then - TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} - else - TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} - fi - # We want to ensure these are substituted so as not to require - # any *_NATIVE vars be defined in the Makefile - TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers and PrivateHeaders directories - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then - TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else - TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi - ;; - esac - else - if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then - { { echo "$as_me:$LINENO: error: Cannot find private header tclInt.h in ${TCL_SRC_DIR}" >&5 -echo "$as_me: error: Cannot find private header tclInt.h in ${TCL_SRC_DIR}" >&2;} - { (exit 1); exit 1; }; } - fi - fi - - - - - - - - - - - - echo "$as_me:$LINENO: result: Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" >&5 -echo "${ECHO_T}Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" >&6 - - -if test x"${with_tclinclude}" != x ; then - if test -f "${with_tclinclude}/tcl.h" ; then - TCL_INCLUDES="-I${with_tclinclude} ${TCL_INCLUDES}" - else - { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain Tcl header file tcl.h" >&5 -echo "$as_me: error: ${with_tclinclude} directory does not contain Tcl header file tcl.h" >&2;} - { (exit 1); exit 1; }; } - fi -fi - -#-------------------------------------------------------------------- -# __CHANGE__ -# A few miscellaneous platform-specific items: -# -# Define a special symbol for Windows (BUILD_xotcl 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. -#-------------------------------------------------------------------- - -if test "${TEA_PLATFORM}" = "windows" ; then - cat >>confdefs.h <<\_ACEOF -#define BUILD_xotcl 1 -_ACEOF - - if test "$GCC" != "yes" ; then - cat >>confdefs.h <<\_ACEOF -#define VISUAL_CC 1 -_ACEOF - - fi - CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch vc60.pch" - #TEA_ADD_SOURCES([win/winFile.c]) - #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/w -else - CLEANFILES="*.o *.a *.so *~ core gmon.out" - #TEA_ADD_SOURCES([unix/unixFile.c]) - #TEA_ADD_LIBS([-lsuperfly]) -fi - - - - -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -#-------------------------------------------------------------------- - - - # Check whether --enable-threads or --disable-threads was given. -if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval -else - tcl_ok=yes -fi; - - if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then - TCL_THREADS=1 - - if test "${TEA_PLATFORM}" != "windows" ; then - # We are always OK on Windows, so check what this platform wants: - - # USE_THREAD_ALLOC tells us to try the special thread-based - # allocator that significantly reduces lock contention - -cat >>confdefs.h <<\_ACEOF -#define USE_THREAD_ALLOC 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - if test "`uname -s`" = "SunOS" ; then - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - fi - -cat >>confdefs.h <<\_ACEOF -#define _THREAD_SAFE 1 -_ACEOF - - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 -if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthread_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthread_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 -if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "no"; then - # Check a little harder for __pthread_mutex_init in the same - # library, as some systems hide it there until pthread.h is - # defined. We could alternatively do an AC_TRY_COMPILE with - # pthread.h, but that will work with libpthread really doesn't - # exist, like AIX 4.2. [Bug: 4359] - echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 -echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 -if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char __pthread_mutex_init (); -int -main () -{ -__pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthread___pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthread___pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 -if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthread" - else - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 -if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthreads $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthreads_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthreads_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 -if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthreads" - else - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 -if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_c_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_c_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 -if test $ac_cv_lib_c_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "no"; then - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 -if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc_r $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_c_r_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_c_r_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 -if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -pthread" - else - TCL_THREADS=0 - { echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 -echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} - fi - fi - fi - fi - fi - else - TCL_THREADS=0 - fi - # Do checking message here to not mess up interleaved configure output - echo "$as_me:$LINENO: checking for building with threads" >&5 -echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 - if test "${TCL_THREADS}" = 1; then - -cat >>confdefs.h <<\_ACEOF -#define TCL_THREADS 1 -_ACEOF - - echo "$as_me:$LINENO: result: yes (default)" >&5 -echo "${ECHO_T}yes (default)" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - # TCL_THREADS sanity checking. See if our request for building with - # threads is the same as the way Tcl was built. If not, warn the user. - case ${TCL_DEFS} in - *THREADS=1*) - if test "${TCL_THREADS}" = "0"; then - { echo "$as_me:$LINENO: WARNING: - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads." >&5 -echo "$as_me: WARNING: - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads." >&2;} - fi - ;; - *) - if test "${TCL_THREADS}" = "1"; then - { echo "$as_me:$LINENO: WARNING: - --enable-threads requested, but building against a Tcl that is NOT - thread-enabled. This is an OK configuration that will also run in - a thread-enabled core." >&5 -echo "$as_me: WARNING: - --enable-threads requested, but building against a Tcl that is NOT - thread-enabled. This is an OK configuration that will also run in - a thread-enabled core." >&2;} - fi - ;; - esac - - - -#-------------------------------------------------------------------- -# The statement below defines a collection of symbols related to -# building as a shared library instead of a static library. -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking how to build libraries" >&5 -echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 - # Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval -else - tcl_ok=yes -fi; - - if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" ; then - echo "$as_me:$LINENO: result: shared" >&5 -echo "${ECHO_T}shared" >&6 - SHARED_BUILD=1 - else - echo "$as_me:$LINENO: result: static" >&5 -echo "${ECHO_T}static" >&6 - SHARED_BUILD=0 - -cat >>confdefs.h <<\_ACEOF -#define STATIC_BUILD 1 -_ACEOF - - fi - - - -#-------------------------------------------------------------------- -# 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. -#-------------------------------------------------------------------- - - - - - # Step 0.a: Enable 64 bit support? - - echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 -echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 - # Check whether --enable-64bit or --disable-64bit was given. -if test "${enable_64bit+set}" = set; then - enableval="$enable_64bit" - do64bit=$enableval -else - do64bit=no -fi; - echo "$as_me:$LINENO: result: $do64bit" >&5 -echo "${ECHO_T}$do64bit" >&6 - - # Step 0.b: Enable Solaris 64 bit VIS support? - - echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 -echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 - # Check whether --enable-64bit-vis or --disable-64bit-vis was given. -if test "${enable_64bit_vis+set}" = set; then - enableval="$enable_64bit_vis" - do64bitVIS=$enableval -else - do64bitVIS=no -fi; - echo "$as_me:$LINENO: result: $do64bitVIS" >&5 -echo "${ECHO_T}$do64bitVIS" >&6 - - if test "$do64bitVIS" = "yes"; then - # Force 64bit on with VIS - do64bit=yes - fi - - # Step 0.c: Cross-compiling options for Windows/CE builds? - - if test "${TEA_PLATFORM}" = "windows" ; then - echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 -echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 - # Check whether --enable-wince or --disable-wince was given. -if test "${enable_wince+set}" = set; then - enableval="$enable_wince" - doWince=$enableval -else - doWince=no -fi; - echo "$as_me:$LINENO: result: $doWince" >&5 -echo "${ECHO_T}$doWince" >&6 - fi - - # Step 1: set the variable "system" to hold the name and version number - # for the system. - - - echo "$as_me:$LINENO: checking system version" >&5 -echo $ECHO_N "checking system version... $ECHO_C" >&6 -if test "${tcl_cv_sys_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - if test "${TEA_PLATFORM}" = "windows" ; then - tcl_cv_sys_version=windows - elif test -f /usr/lib/NextStep/software_version; then - tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` - else - tcl_cv_sys_version=`uname -s`-`uname -r` - if test "$?" -ne 0 ; then - { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 -echo "$as_me: WARNING: can't find uname command" >&2;} - tcl_cv_sys_version=unknown - else - # Special check for weird MP-RAS system (uname returns weird - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` - fi - if test "`uname -s`" = "AIX" ; then - tcl_cv_sys_version=AIX-`uname -v`.`uname -r` - fi - fi - fi - -fi -echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 -echo "${ECHO_T}$tcl_cv_sys_version" >&6 - system=$tcl_cv_sys_version - - - # Step 2: check for existence of -ldl library. This is needed because - # Linux can use either -ldl or -ldld for dynamic loading. - - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - have_dl=yes -else - have_dl=no -fi - - - # Require ranlib early so we can override it in special cases below. - - - - # Step 3: set configuration options based on system name and version. - # This is similar to Tcl's unix/tcl.m4 except that we've added a - # "windows" case. - - do64bit_ok=no - LDFLAGS_ORIG="$LDFLAGS" - # When ld needs options to work in 64-bit mode, put them in - # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] - # is disabled by the user. [Bug 1016796] - LDFLAGS_ARCH="" - TCL_EXPORT_FILE_SUFFIX="" - UNSHARED_LIB_SUFFIX="" - TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' - ECHO_VERSION='`echo ${PACKAGE_VERSION}`' - TCL_LIB_VERSIONS_OK=ok - CFLAGS_DEBUG=-g - CFLAGS_OPTIMIZE=-O - if test "$GCC" = "yes" ; then - CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wno-implicit-int" - else - CFLAGS_WARNING="" - fi - TCL_NEEDS_EXP_FILE=0 - TCL_BUILD_EXP_FILE="" - TCL_EXP_FILE="" - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - STLIB_LD='${AR} cr' - LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" - case $system in - windows) - # This is a 2-stage check to make sure we have the 64-bit SDK - # We have to know where the SDK is installed. - # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs - # MACHINE is IX86 for LINK, but this is used by the manifest, - # which requires x86|amd64|ia64. - MACHINE="X86" - if test "$do64bit" != "no" ; then - if test "x${MSSDK}x" = "xx" ; then - MSSDK="C:/Progra~1/Microsoft Platform SDK" - fi - MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` - PATH64="" - case "$do64bit" in - amd64|x64|yes) - MACHINE="AMD64" ; # default to AMD64 64-bit build - PATH64="${MSSDK}/Bin/Win64/x86/AMD64" - ;; - ia64) - MACHINE="IA64" - PATH64="${MSSDK}/Bin/Win64" - ;; - esac - if test ! -d "${PATH64}" ; then - { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 -echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} - { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 -echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} - do64bit="no" - else - echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 -echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 - do64bit_ok="yes" - fi - fi - - if test "$doWince" != "no" ; then - if test "$do64bit" != "no" ; then - { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 -echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} - { (exit 1); exit 1; }; } - fi - if test "$GCC" = "yes" ; then - { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 -echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} - { (exit 1); exit 1; }; } - fi - - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-celib - - if test x"${no_celib}" = x ; then - # we reset no_celib in case something fails here - no_celib=true - -# Check whether --with-celib or --without-celib was given. -if test "${with_celib+set}" = set; then - withval="$with_celib" - with_celibconfig=${withval} -fi; - echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 -echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 - if test "${ac_cv_c_celibconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - # First check to see if --with-celibconfig was specified. - if test x"${with_celibconfig}" != x ; then - if test -d "${with_celibconfig}/inc" ; then - ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` - else - { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 -echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} - { (exit 1); exit 1; }; } - fi - fi - - # then check for a celib library - if test x"${ac_cv_c_celibconfig}" = x ; then - for i in \ - ../celib-palm-3.0 \ - ../celib \ - ../../celib-palm-3.0 \ - ../../celib \ - `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ - ${srcdir}/../celib-palm-3.0 \ - ${srcdir}/../celib \ - `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ - ; do - if test -d "$i/inc" ; then - ac_cv_c_celibconfig=`(cd $i; pwd)` - break - fi - done - fi - -fi - - if test x"${ac_cv_c_celibconfig}" = x ; then - { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 -echo "$as_me: error: Cannot find celib support library directory" >&2;} - { (exit 1); exit 1; }; } - else - no_celib= - CELIB_DIR=${ac_cv_c_celibconfig} - CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` - echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 -echo "${ECHO_T}found $CELIB_DIR" >&6 - fi - fi - - # Set defaults for common evc4/PPC2003 setup - # Currently Tcl requires 300+, possibly 420+ for sockets - CEVERSION=420; # could be 211 300 301 400 420 ... - TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... - ARCH=ARM; # could be ARM MIPS X86EM ... - PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" - if test "$doWince" != "yes"; then - # If !yes then the user specified something - # Reset ARCH to allow user to skip specifying it - ARCH= - eval `echo $doWince | awk -F, '{ \ - if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ - if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ - if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ - if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ - if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ - }'` - if test "x${ARCH}" = "x" ; then - ARCH=$TARGETCPU; - fi - fi - OSVERSION=WCE$CEVERSION; - if test "x${WCEROOT}" = "x" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" - if test ! -d "${WCEROOT}" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded Tools" - fi - fi - if test "x${SDKROOT}" = "x" ; then - SDKROOT="C:/Program Files/Windows CE Tools" - if test ! -d "${SDKROOT}" ; then - SDKROOT="C:/Windows CE Tools" - fi - fi - WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` - SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` - if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ - -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then - { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 -echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} - { (exit 1); exit 1; }; } - doWince="no" - else - # We could PATH_NOSPACE these, but that's not important, - # as long as we quote them when used. - CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" - if test -d "${CEINCLUDE}/${TARGETCPU}" ; then - CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" - fi - CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" - fi - fi - - if test "$GCC" != "yes" ; then - if test "${SHARED_BUILD}" = "0" ; then - runtime=-MT - else - runtime=-MD - fi - - if test "$do64bit" != "no" ; then - # All this magic is necessary for the Win64 SDK RC1 - hobbs - CC="\"${PATH64}/cl.exe\"" - CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" - RC="\"${MSSDK}/bin/rc.exe\"" - lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" - LINKBIN="\"${PATH64}/link.exe\"" - CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - # Avoid 'unresolved external symbol __security_cookie' - # errors, c.f. http://support.microsoft.com/?id=894573 - - vars="bufferoverflowU.lib" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - - - elif test "$doWince" != "no" ; then - CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" - if test "${TARGETCPU}" = "X86"; then - CC="\"${CEBINROOT}/cl.exe\"" - else - CC="\"${CEBINROOT}/cl${ARCH}.exe\"" - fi - CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" - RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" - arch=`echo ${ARCH} | awk '{print tolower($0)}'` - defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" - if test "${SHARED_BUILD}" = "1" ; then - # Static CE builds require static celib as well - defs="${defs} _DLL" - fi - for i in $defs ; do - -cat >>confdefs.h <<_ACEOF -#define $i 1 -_ACEOF - - done - -cat >>confdefs.h <<_ACEOF -#define _WIN32_WCE $CEVERSION -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define UNDER_CE $CEVERSION -_ACEOF - - CFLAGS_DEBUG="-nologo -Zi -Od" - CFLAGS_OPTIMIZE="-nologo -Ox" - lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` - lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" - LINKBIN="\"${CEBINROOT}/link.exe\"" - - else - RC="rc" - lflags="-nologo" - LINKBIN="link" - CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - fi - fi - - if test "$GCC" = "yes"; then - # mingw gcc mode - RC="windres" - CFLAGS_DEBUG="-g" - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - SHLIB_LD="$CC -shared" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" - LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" - else - SHLIB_LD="${LINKBIN} -dll ${lflags}" - # link -lib only works when -lib is the first arg - STLIB_LD="${LINKBIN} -lib ${lflags}" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' - PATHTYPE=-w - # For information on what debugtype is most useful, see: - # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp - # This essentially turns it all on. - LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" - LDFLAGS_OPTIMIZE="-release" - if test "$doWince" != "no" ; then - LDFLAGS_CONSOLE="-link ${lflags}" - LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} - else - LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" - LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" - fi - fi - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dll" - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' - - TCL_LIB_VERSIONS_OK=nodots - # Bogus to avoid getting this turned off - DL_OBJS="tclLoadNone.obj" - ;; - AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then - # AIX requires the _r compiler when gcc isn't being used - case "${CC}" in - *_r) - # ok ... - ;; - *) - CC=${CC}_r - ;; - esac - echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 -echo "${ECHO_T}Using $CC for compiling with threads" >&6 - fi - LIBS="$LIBS -lc" - SHLIB_CFLAGS="" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - DL_OBJS="tclLoadDl.o" - LD_LIBRARY_PATH_VAR="LIBPATH" - - # Check to enable 64-bit flags for compiler/linker on AIX 4+ - if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then - if test "$GCC" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} - else - do64bit_ok=yes - CFLAGS="$CFLAGS -q64" - LDFLAGS_ARCH="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi - - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - else - SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - fi - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' - fi - - # AIX v<=4.1 has some different flags than 4.2+ - if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then - case $LIBOBJS in - "tclLoadAix.$ac_objext" | \ - *" tclLoadAix.$ac_objext" | \ - "tclLoadAix.$ac_objext "* | \ - *" tclLoadAix.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; -esac - - DL_LIBS="-lld" - fi - - # On AIX <=v4 systems, libbsd.a has to be linked in to support - # non-blocking file IO. This library has to be linked in after - # the MATH_LIBS or it breaks the pow() function. The way to - # insure proper sequencing, is to add it to the tail of MATH_LIBS. - # This library also supplies gettimeofday. - # - # AIX does not have a timezone field in struct tm. When the AIX - # bsd library is used, the timezone global and the gettimeofday - # methods are to be avoided for timezone deduction instead, we - # deduce the timezone by comparing the localtime result on a - # known GMT value. - - echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 -echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 -if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbsd $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gettimeofday (); -int -main () -{ -gettimeofday (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_bsd_gettimeofday=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_bsd_gettimeofday=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 -if test $ac_cv_lib_bsd_gettimeofday = yes; then - libbsd=yes -else - libbsd=no -fi - - if test $libbsd = yes; then - MATH_LIBS="$MATH_LIBS -lbsd" - -cat >>confdefs.h <<\_ACEOF -#define USE_DELTA_FOR_TZ 1 -_ACEOF - - fi - ;; - BeOS*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC} -nostart" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - - #----------------------------------------------------------- - # Check for inet_ntoa in -lbind, for BeOS (which also needs - # -lsocket, even if the network functions are in -lnet which - # is always linked to, for compatibility. - #----------------------------------------------------------- - echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 -echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 -if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbind $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char inet_ntoa (); -int -main () -{ -inet_ntoa (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_bind_inet_ntoa=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_bind_inet_ntoa=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 -if test $ac_cv_lib_bind_inet_ntoa = yes; then - LIBS="$LIBS -lbind -lsocket" -fi - - ;; - BSD/OS-2.1*|BSD/OS-3*) - SHLIB_CFLAGS="" - SHLIB_LD="shlicc -r" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - BSD/OS-4.*) - SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="cc -shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - dgux*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - HP-UX-*.11.*) - # Use updated header definitions where possible - -cat >>confdefs.h <<\_ACEOF -#define _XOPEN_SOURCE_EXTENDED 1 -_ACEOF - - # Needed by Tcl, but not most extensions - #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) - #LIBS="$LIBS -lxnet" # Use the XOPEN network library - - if test "`uname -m`" = "ia64" ; then - SHLIB_SUFFIX=".so" - # Use newer C++ library for C++ extensions - #if test "$GCC" != "yes" ; then - # CPPFLAGS="-AA" - #fi - else - SHLIB_SUFFIX=".sl" - fi - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS='${LIBS}' - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - SHLIB_LD_LIBS='${LIBS}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - - # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc - #CFLAGS="$CFLAGS +DAportable" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - hpux_arch=`${CC} -dumpmachine` - case $hpux_arch in - hppa64*) - # 64-bit gcc in use. Fix flags for GNU ld. - do64bit_ok=yes - SHLIB_LD="${CC} -shared" - SHLIB_LD_LIBS='${LIBS}' - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ;; - *) - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} - ;; - esac - else - do64bit_ok=yes - CFLAGS="$CFLAGS +DD64" - LDFLAGS_ARCH="+DD64" - fi - fi - ;; - HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) - SHLIB_SUFFIX=".sl" - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS="" - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - ;; - IRIX-5.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - ;; - IRIX-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mabi=n32" - LDFLAGS="$LDFLAGS -mabi=n32" - else - case $system in - IRIX-6.3) - # Use to build 6.2 compatible binaries on 6.3. - CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" - ;; - *) - CFLAGS="$CFLAGS -n32" - ;; - esac - LDFLAGS="$LDFLAGS -n32" - fi - ;; - IRIX64-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - - # Check to enable 64-bit flags for compiler/linker - - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 -echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} - else - do64bit_ok=yes - SHLIB_LD="ld -64 -shared -rdata_shared" - CFLAGS="$CFLAGS -64" - LDFLAGS_ARCH="-64" - fi - fi - ;; - Linux*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings - # when you inline the string and math operations. Turn this off to - # get rid of the warnings. - #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" - - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - if test $do64bit = yes; then - echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_m64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -m64" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_m64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_m64=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 -echo "${ECHO_T}$tcl_cv_cc_m64" >&6 - if test $tcl_cv_cc_m64 = yes; then - CFLAGS="$CFLAGS -m64" - do64bit_ok=yes - fi - fi - - # The combo of gcc + glibc has a bug related - # to inlining of functions like strtod(). The - # -fno-builtin flag should address this problem - # but it does not work. The -fno-inline flag - # is kind of overkill but it works. - # Disable inlining only when one of the - # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x ; then - CFLAGS="$CFLAGS -fno-inline" - fi - - ;; - GNU*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - SHLIB_LD="${CC} -shared" - DL_OBJS="" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - ;; - Lynx*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - CFLAGS_OPTIMIZE=-02 - SHLIB_LD="${CC} -shared " - DL_OBJS="tclLoadDl.o" - DL_LIBS="-mshared -ldl" - LD_FLAGS="-Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - ;; - MP-RAS-02*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - MP-RAS-*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,-Bexport" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - NetBSD-*|FreeBSD-[1-2].*) - # NetBSD/SPARC needs -fPIC, -fpic will not do. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - echo "$as_me:$LINENO: checking for ELF" >&5 -echo $ECHO_N "checking for ELF... $ECHO_C" >&6 -if test "${tcl_cv_ld_elf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef __ELF__ - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - tcl_cv_ld_elf=yes -else - tcl_cv_ld_elf=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 -echo "${ECHO_T}$tcl_cv_ld_elf" >&6 - if test $tcl_cv_ld_elf = yes; then - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - else - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - fi - - # Ancient FreeBSD doesn't handle version numbers with dots. - - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - OpenBSD-*) - # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. - case `machine` in - sparc|sparc64) - SHLIB_CFLAGS="-fPIC";; - *) - SHLIB_CFLAGS="-fpic";; - esac - SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - echo "$as_me:$LINENO: checking for ELF" >&5 -echo $ECHO_N "checking for ELF... $ECHO_C" >&6 -if test "${tcl_cv_ld_elf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef __ELF__ - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - tcl_cv_ld_elf=yes -else - tcl_cv_ld_elf=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 -echo "${ECHO_T}$tcl_cv_ld_elf" >&6 - if test $tcl_cv_ld_elf = yes; then - LDFLAGS=-Wl,-export-dynamic - else - LDFLAGS="" - fi - - # OpenBSD doesn't do version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - FreeBSD-*) - # FreeBSD 3.* and greater have ELF. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "${TCL_THREADS}" = "1" ; then - # The -pthread needs to go in the CFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - case $system in - FreeBSD-3.*) - # FreeBSD-3 doesn't handle version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - TCL_LIB_VERSIONS_OK=nodots - ;; - esac - ;; - Darwin-*) - CFLAGS_OPTIMIZE="-Os" - SHLIB_CFLAGS="-fno-common" - # To avoid discrepancies between what headers configure sees during - # preprocessing tests and compiling tests, move any -isysroot and - # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: - CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" - CFLAGS="`echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" - if test $do64bit = yes; then - case `arch` in - ppc) - echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_arch_ppc64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_arch_ppc64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_arch_ppc64=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 -echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 - if test $tcl_cv_cc_arch_ppc64 = yes; then - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - do64bit_ok=yes - fi;; - i386) - echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_arch_x86_64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch x86_64" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_arch_x86_64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_arch_x86_64=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 -echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 - if test $tcl_cv_cc_arch_x86_64 = yes; then - CFLAGS="$CFLAGS -arch x86_64" - do64bit_ok=yes - fi;; - *) - { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 -echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; - esac - else - # Check for combined 32-bit and 64-bit fat build - echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ - echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ - fat_32_64=yes - fi - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' - echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 -echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_single_module+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_single_module=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_single_module=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 -echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 - if test $tcl_cv_ld_single_module = yes; then - SHLIB_LD="${SHLIB_LD} -Wl,-single_module" - fi - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dylib" - DL_OBJS="tclLoadDyld.o" - DL_LIBS="" - # Don't use -prebind when building for Mac OS X 10.4 or later only: - test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ - "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \ - LDFLAGS="$LDFLAGS -prebind" - LDFLAGS="$LDFLAGS -headerpad_max_install_names" - echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 -echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_search_paths_first+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_search_paths_first=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_search_paths_first=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 -echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 - if test $tcl_cv_ld_search_paths_first = yes; then - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" - - # TEA specific: for Tk extensions, remove 64-bit arch flags from - # CFLAGS et al. for combined 32 & 64 bit fat builds as neither - # TkAqua nor TkX11 can be built for 64-bit at present. - test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done - ;; - NEXTSTEP-*) - SHLIB_CFLAGS="" - SHLIB_LD="cc -nostdlib -r" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadNext.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OS/390-*) - CFLAGS_OPTIMIZE="" # Optimizer is buggy - -cat >>confdefs.h <<\_ACEOF -#define _OE_SOCKETS 1 -_ACEOF - - ;; - OSF1-1.0|OSF1-1.1|OSF1-1.2) - # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 - SHLIB_CFLAGS="" - # Hack: make package name same as library name - SHLIB_LD='ld -R -export :' - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadOSF.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-1.*) - # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - SHLIB_CFLAGS="-fPIC" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD="ld -shared" - else - SHLIB_LD="ld -non_shared" - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-V*) - # Digital OSF/1 - SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD='ld -shared -expect_unresolved "*"' - else - SHLIB_LD='ld -non_shared -expect_unresolved "*"' - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mieee" - else - CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" - fi - # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = "1" ; then - CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" - CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" - LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = "yes" ; then - LIBS="$LIBS -lpthread -lmach -lexc" - else - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - fi - - ;; - QNX-6*) - # QNX RTP - # This may work for all QNX, but it was only reported for v6. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - # dlopen is in -lc on QNX - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SCO_SV-3.2*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, - # this test works, since "uname -s" was non-standard in 3.2.4 and - # below. - if test "$GCC" = "yes" ; then - SHLIB_CFLAGS="-fPIC -melf" - LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" - else - SHLIB_CFLAGS="-Kpic -belf" - LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" - fi - SHLIB_LD="ld -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SINIX*5.4*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SunOS-4*) - SHLIB_CFLAGS="-PIC" - SHLIB_LD="ld" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - - # SunOS can't handle version numbers with dots in them in library - # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it - # requires an extra version number at the end of .so file names. - # So, the library has to have a name like libtcl75.so.1.0 - - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - SunOS-5.[0-6]) - # Careful to not let 5.10+ fall into this case - - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - - SHLIB_CFLAGS="-KPIC" - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - ;; - SunOS-5*) - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - - SHLIB_CFLAGS="-KPIC" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - arch=`isainfo` - if test "$arch" = "sparcv9 sparc" ; then - if test "$GCC" = "yes" ; then - if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} - else - do64bit_ok=yes - CFLAGS="$CFLAGS -m64 -mcpu=v9" - LDFLAGS="$LDFLAGS -m64 -mcpu=v9" - SHLIB_CFLAGS="-fPIC" - fi - else - do64bit_ok=yes - if test "$do64bitVIS" = "yes" ; then - CFLAGS="$CFLAGS -xarch=v9a" - LDFLAGS_ARCH="-xarch=v9a" - else - CFLAGS="$CFLAGS -xarch=v9" - LDFLAGS_ARCH="-xarch=v9" - fi - # Solaris 64 uses this as well - #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" - fi - elif test "$arch" = "amd64 i386" ; then - if test "$GCC" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} - else - do64bit_ok=yes - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64" - fi - else - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 -echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} - fi - fi - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = "yes" ; then - # We need to specify -static-libgcc or we need to - # add the path to the sparv9 libgcc. - # JH: static-libgcc is necessary for core Tcl, but may - # not be necessary for extensions. - SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" - # for finding sparcv9 libgcc, get the regular libgcc - # path, remove so name and append 'sparcv9' - #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." - #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" - fi - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - fi - ;; - UNIX_SV* | UnixWare-5*) - SHLIB_CFLAGS="-KPIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers - # that don't grok the -Bexport option. Test that it does. - echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 -echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_Bexport+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-Bexport" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_Bexport=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_Bexport=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 -echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 - if test $tcl_cv_ld_Bexport = yes; then - LDFLAGS="$LDFLAGS -Wl,-Bexport" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - esac - - if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then - { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 -echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} - fi - - - - # Step 4: disable dynamic loading if requested via a command-line switch. - - # Check whether --enable-load or --disable-load was given. -if test "${enable_load+set}" = set; then - enableval="$enable_load" - tcl_ok=$enableval -else - tcl_ok=yes -fi; - if test "$tcl_ok" = "no"; then - DL_OBJS="" - fi - - if test "x$DL_OBJS" != "x" ; then - BUILD_DLTEST="\$(DLTEST_TARGETS)" - else - echo "Can't figure out how to do dynamic loading or shared libraries" - echo "on this system." - SHLIB_CFLAGS="" - SHLIB_LD="" - SHLIB_SUFFIX="" - DL_OBJS="tclLoadNone.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS_ORIG" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - BUILD_DLTEST="" - fi - LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" - - # If we're running gcc, then change the C flags for compiling shared - # libraries to the right flags for gcc, instead of those for the - # standard manufacturer compiler. - - if test "$DL_OBJS" != "tclLoadNone.o" ; then - if test "$GCC" = "yes" ; then - case $system in - AIX-*) - ;; - BSD/OS*) - ;; - IRIX*) - ;; - NetBSD-*|FreeBSD-*) - ;; - Darwin-*) - ;; - SCO_SV-3.2*) - ;; - windows) - ;; - *) - SHLIB_CFLAGS="-fPIC" - ;; - esac - fi - fi - - if test "$SHARED_LIB_SUFFIX" = "" ; then - SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' - fi - if test "$UNSHARED_LIB_SUFFIX" = "" ; then - UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' - fi - - - - - - - - - - - - - - - - # These must be called after we do the basic CFLAGS checks and - # verify any possible 64-bit or similar switches are necessary - - echo "$as_me:$LINENO: checking for required early compiler flags" >&5 -echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 - tcl_flags="" - - if test "${tcl_cv_flag__isoc99_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *)strtoll; char *q = (char *)strtoull; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__isoc99_source=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _ISOC99_SOURCE 1 -#include -int -main () -{ -char *p = (char *)strtoll; char *q = (char *)strtoull; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__isoc99_source=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__isoc99_source=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define _ISOC99_SOURCE 1 -_ACEOF - - tcl_flags="$tcl_flags _ISOC99_SOURCE" - fi - - - if test "${tcl_cv_flag__largefile64_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -struct stat64 buf; int i = stat64("/", &buf); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile64_source=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGEFILE64_SOURCE 1 -#include -int -main () -{ -struct stat64 buf; int i = stat64("/", &buf); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile64_source=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__largefile64_source=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define _LARGEFILE64_SOURCE 1 -_ACEOF - - tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" - fi - - - if test "${tcl_cv_flag__largefile_source64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *)open64; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile_source64=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGEFILE_SOURCE64 1 -#include -int -main () -{ -char *p = (char *)open64; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile_source64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__largefile_source64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define _LARGEFILE_SOURCE64 1 -_ACEOF - - tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" - fi - - if test "x${tcl_flags}" = "x" ; then - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 - else - echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 -echo "${ECHO_T}${tcl_flags}" >&6 - fi - - - echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 -echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 - if test "${tcl_cv_type_64bit+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - tcl_cv_type_64bit=none - # See if the compiler knows natively about __int64 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -__int64 value = (__int64) 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_type_64bit=__int64 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_type_64bit="long long" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - # See if we should use long anyway Note that we substitute in the - # type that is our current guess for a 64-bit type inside this check - # program, so it should be modified only carefully... - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -switch (0) { - case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; - } - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_type_64bit=${tcl_type_64bit} -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "${tcl_cv_type_64bit}" = none ; then - -cat >>confdefs.h <<\_ACEOF -#define TCL_WIDE_INT_IS_LONG 1 -_ACEOF - - echo "$as_me:$LINENO: result: using long" >&5 -echo "${ECHO_T}using long" >&6 - elif test "${tcl_cv_type_64bit}" = "__int64" \ - -a "${TEA_PLATFORM}" = "windows" ; then - # We actually want to use the default tcl.h checks in this - # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* - echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 -echo "${ECHO_T}using Tcl header defaults" >&6 - else - -cat >>confdefs.h <<_ACEOF -#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} -_ACEOF - - echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 -echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 - - # Now check for auxiliary declarations - echo "$as_me:$LINENO: checking for struct dirent64" >&5 -echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 -if test "${tcl_cv_struct_dirent64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ -struct dirent64 p; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_struct_dirent64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_struct_dirent64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 -echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 - if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_DIRENT64 1 -_ACEOF - - fi - - echo "$as_me:$LINENO: checking for struct stat64" >&5 -echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 -if test "${tcl_cv_struct_stat64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -struct stat64 p; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_struct_stat64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_struct_stat64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 -echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 - if test "x${tcl_cv_struct_stat64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_STAT64 1 -_ACEOF - - fi - - - -for ac_func in open64 lseek64 -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - echo "$as_me:$LINENO: checking for off64_t" >&5 -echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 - if test "${tcl_cv_type_off64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -off64_t offset; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_type_off64_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_type_off64_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_type_off64_t}" = "xyes" && \ - test "x${ac_cv_func_lseek64}" = "xyes" && \ - test "x${ac_cv_func_open64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_TYPE_OFF64_T 1 -_ACEOF - - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - fi - - - -# Without the following two eval statements, XOTCL_SHARED_LIB_SUFFIX -# in xotclConfig.sh has $PACKAGE_VERSION unresolved. When another -# app links against xotcl, the PACKAGE_VERSIONs are confused. -# -# Without the first eval, we get -# XOTCL_SHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}${SHLIB_SUFFIX} -# XOTCL_UNSHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}.a -# -# after the first eval, we get -# XOTCL_SHARED_LIB_SUFFIX=1.2.1${DBGX}.so -# XOTCL_UNSHARED_LIB_SUFFIX=1.2.1${DBGX}.a -# after the second eval, all variables are resolved. - - -eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" -eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" - -#eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" -#eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" - -#-------------------------------------------------------------------- -# Set the default compiler switches based on the --enable-symbols -# option. -#-------------------------------------------------------------------- - - - - echo "$as_me:$LINENO: checking for build with symbols" >&5 -echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 - # Check whether --enable-symbols or --disable-symbols was given. -if test "${enable_symbols+set}" = set; then - enableval="$enable_symbols" - tcl_ok=$enableval -else - tcl_ok=no -fi; - DBGX="" - if test "$tcl_ok" = "no"; then - CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" - LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - else - CFLAGS_DEFAULT="${CFLAGS_DEBUG}" - LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" - if test "$tcl_ok" = "yes"; then - echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 -echo "${ECHO_T}yes (standard debugging)" >&6 - fi - fi - if test "${TEA_PLATFORM}" != "windows" ; then - LDFLAGS_DEFAULT="${LDFLAGS}" - fi - - - - - - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - -cat >>confdefs.h <<\_ACEOF -#define TCL_MEM_DEBUG 1 -_ACEOF - - fi - - if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then - if test "$tcl_ok" = "all"; then - echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 -echo "${ECHO_T}enabled symbols mem debugging" >&6 - else - echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 -echo "${ECHO_T}enabled $tcl_ok debugging" >&6 - fi - fi - - -#-------------------------------------------------------------------- -# Everyone should be linking against the Tcl stub library. If you -# can't for some reason, remove this definition. If you aren't using -# stubs, you also need to modify the SHLIB_LD_LIBS setting below to -# link against the non-stubbed Tcl library. -#-------------------------------------------------------------------- - - -#if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then -# FORCE_NO_STUBS=1 -#fi - -if test "${FORCE_NO_STUBS}" = "0" ; then - cat >>confdefs.h <<\_ACEOF -#define USE_TCL_STUBS 1 -_ACEOF - -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. -#-------------------------------------------------------------------- - - - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then - MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" - MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" - else - MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" - MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" - fi - - if test "${SHARED_BUILD}" = "1" ; then - MAKE_LIB="${MAKE_SHARED_LIB} " - else - MAKE_LIB="${MAKE_STATIC_LIB} " - fi - - #-------------------------------------------------------------------- - # Shared libraries and static libraries have different names. - # Use the double eval to make sure any variables in the suffix is - # substituted. (@@@ Might not be necessary anymore) - #-------------------------------------------------------------------- - - if test "${TEA_PLATFORM}" = "windows" ; then - if test "${SHARED_BUILD}" = "1" ; then - # We force the unresolved linking of symbols that are really in - # the private libraries of Tcl and Tk. - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" - fi - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - else - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - if test "$GCC" = "yes"; then - PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} - fi - # These aren't needed on Windows (either MSVC or gcc) - RANLIB=: - RANLIB_STUB=: - else - RANLIB_STUB="${RANLIB}" - if test "${SHARED_BUILD}" = "1" ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" - fi - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - fi - - # These are escaped so that only CFLAGS is picked up at configure time. - # The other values will be substituted at make time. - CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" - if test "${SHARED_BUILD}" = "1" ; then - CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" - fi - - - - - - - - -#-------------------------------------------------------------------- -# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl -# file during the install process. Don't run the TCLSH_PROG through -# ${CYGPATH} because it's being used directly by make. -# Require that we use a tclsh shell version 8.2 or later since earlier -# versions have bugs in the pkg_mkIndex routine. -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking for tclsh" >&5 -echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 - if test -f "${TCL_BIN_DIR}/Makefile" ; then - # tclConfig.sh is in Tcl build directory - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="${TCL_BIN_DIR}/tclsh" - fi - else - # tclConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" - fi - list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${TCLSH_PROG}" ; then - REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" - fi - echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 -echo "${ECHO_T}${TCLSH_PROG}" >&6 - - - -# make this available, for such as xotclConfig.sh -XOTCL_COMPATIBLE_TCLSH=${TCLSH_PROG} - - -# resolve the variables -eval "libdir=${libdir}" -eval "datadir=${datadir}" -eval "includedir=${includedir}" - -PKG_DIR="${PACKAGE_NAME}${PACKAGE_VERSION}" -pkgdatadir="${datadir}/${PKG_DIR}" -pkglibdir="${libdir}/${PKG_DIR}" -# make sure this is right (then remove this comment) -pkgincludedir="${includedir}/${PKG_DIR}" - - - - - - -# -# XOTcl specific configs -# - -if test "${TEA_PLATFORM}" != "windows" ; then - -XOTCL_BUILD_LIB_SPEC="-L`pwd` -lxotcl${PACKAGE_VERSION}" -XOTCL_LIB_SPEC="-L${pkglibdir} -lxotcl${PACKAGE_VERSION}" - -# stub libs are not build for 8.0 -if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then - XOTCL_BUILD_STUB_LIB_PATH="" - XOTCL_STUB_LIB_PATH="" - XOTCL_BUILD_STUB_LIB_SPEC="" - XOTCL_STUB_LIB_SPEC="" -else - XOTCL_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}" - XOTCL_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}" - XOTCL_BUILD_STUB_LIB_SPEC="-L`pwd` -lxotclstub${PACKAGE_VERSION}" - XOTCL_STUB_LIB_SPEC="-L${pkglibdir} -lxotclstub${PACKAGE_VERSION}" - cat >>confdefs.h <<\_ACEOF -#define COMPILE_XOTCL_STUBS 1 -_ACEOF - -fi - -else - -XOTCL_BUILD_LIB_SPEC="`pwd`/${PKG_LIB_FILE}" -XOTCL_LIB_SPEC="${pkglibdir}/${PKG_LIB_FILE}" -XOTCL_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}" -XOTCL_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}" -XOTCL_BUILD_STUB_LIB_SPEC="`pwd`/${PKG_STUB_LIB_FILE}" -XOTCL_STUB_LIB_SPEC="${pkglibdir}/${PKG_STUB_LIB_FILE}" - -fi - - - - - - - - - -XOTCL_SRC_DIR=$srcdir - - - - -# include dir of xotcl during build process (i.e., does not assume installed) -XOTCL_BUILD_INCLUDE_DIR="${XOTCL_SRC_DIR}/generic" -XOTCL_BUILD_INCLUDE_SPEC="-I${XOTCL_BUILD_INCLUDE_DIR}" - - - - - - - - - - - - -#-------------------------------------------------------------------- -# the value of this variable is set to the files which are to be -# removed when the user invokes 'make distclean' (i.e., those -# files generated by ./configure) and is used in the make distclean -# target, defined in Makefile.in -#-------------------------------------------------------------------- - -CONFIG_CLEAN_FILES="Makefile xotclConfig.sh apps/utils/xotclsh apps/utils/xowish unix/xotcl.spec unix/pkgIndex.unix autom4te.cache/" - - ac_config_files="$ac_config_files Makefile xotclConfig.sh apps/utils/xotclsh apps/utils/xowish unix/xotcl.spec unix/pkgIndex.unix" - - -#-------------------------------------------------------------------- -# Finally, substitute all of the various values into the Makefile, -# and generate the other output files. (this is done by invoking -# config.status) -# -# NOTE the lack of parameters! AC_OUTPUT with params is deprecated; -# use macros such as AC_CONFIG_FILES, AC_HEADER_FILES, etc to add -# to the files output by ./configure. -#-------------------------------------------------------------------- - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g -t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g -t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by xotcl $as_me 1.5.6, which was -generated by GNU Autoconf 2.59. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to ." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -xotcl config.status 1.5.6 -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2003 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - - - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "xotclConfig.sh" ) CONFIG_FILES="$CONFIG_FILES xotclConfig.sh" ;; - "apps/utils/xotclsh" ) CONFIG_FILES="$CONFIG_FILES apps/utils/xotclsh" ;; - "apps/utils/xowish" ) CONFIG_FILES="$CONFIG_FILES apps/utils/xowish" ;; - "unix/xotcl.spec" ) CONFIG_FILES="$CONFIG_FILES unix/xotcl.spec" ;; - "unix/pkgIndex.unix" ) CONFIG_FILES="$CONFIG_FILES unix/pkgIndex.unix" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CYGPATH@,$CYGPATH,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t -s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t -s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t -s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t -s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t -s,@PKG_HEADERS@,$PKG_HEADERS,;t t -s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t -s,@PKG_LIBS@,$PKG_LIBS,;t t -s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t -s,@subdirs@,$subdirs,;t t -s,@XOTCL_VERSION@,$XOTCL_VERSION,;t t -s,@XOTCL_MAJOR_VERSION@,$XOTCL_MAJOR_VERSION,;t t -s,@XOTCL_MINOR_VERSION@,$XOTCL_MINOR_VERSION,;t t -s,@XOTCL_RELEASE_LEVEL@,$XOTCL_RELEASE_LEVEL,;t t -s,@TCL_VERSION@,$TCL_VERSION,;t t -s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t -s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t -s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t -s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t -s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t -s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t -s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t -s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t -s,@TCL_LIBS@,$TCL_LIBS,;t t -s,@TCL_DEFS@,$TCL_DEFS,;t t -s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t -s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t -s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t -s,@TK_VERSION@,$TK_VERSION,;t t -s,@TK_BIN_DIR@,$TK_BIN_DIR,;t t -s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t -s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t -s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t -s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t -s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t -s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t -s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t -s,@TK_LIBS@,$TK_LIBS,;t t -s,@TK_XINCLUDES@,$TK_XINCLUDES,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@EGREP@,$EGREP,;t t -s,@MATH_LIBS@,$MATH_LIBS,;t t -s,@aol_prefix@,$aol_prefix,;t t -s,@PKG_SOURCES@,$PKG_SOURCES,;t t -s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t -s,@TCL_TOP_DIR_NATIVE@,$TCL_TOP_DIR_NATIVE,;t t -s,@TCL_GENERIC_DIR_NATIVE@,$TCL_GENERIC_DIR_NATIVE,;t t -s,@TCL_UNIX_DIR_NATIVE@,$TCL_UNIX_DIR_NATIVE,;t t -s,@TCL_WIN_DIR_NATIVE@,$TCL_WIN_DIR_NATIVE,;t t -s,@TCL_BMAP_DIR_NATIVE@,$TCL_BMAP_DIR_NATIVE,;t t -s,@TCL_TOOL_DIR_NATIVE@,$TCL_TOOL_DIR_NATIVE,;t t -s,@TCL_PLATFORM_DIR_NATIVE@,$TCL_PLATFORM_DIR_NATIVE,;t t -s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t -s,@CLEANFILES@,$CLEANFILES,;t t -s,@TCL_THREADS@,$TCL_THREADS,;t t -s,@SHARED_BUILD@,$SHARED_BUILD,;t t -s,@AR@,$AR,;t t -s,@CELIB_DIR@,$CELIB_DIR,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@DL_LIBS@,$DL_LIBS,;t t -s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t -s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t -s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t -s,@STLIB_LD@,$STLIB_LD,;t t -s,@SHLIB_LD@,$SHLIB_LD,;t t -s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t -s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t -s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t -s,@TCL_DBGX@,$TCL_DBGX,;t t -s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t -s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t -s,@MAKE_LIB@,$MAKE_LIB,;t t -s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t -s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t -s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t -s,@RANLIB_STUB@,$RANLIB_STUB,;t t -s,@TCLSH_PROG@,$TCLSH_PROG,;t t -s,@XOTCL_COMPATIBLE_TCLSH@,$XOTCL_COMPATIBLE_TCLSH,;t t -s,@PKG_DIR@,$PKG_DIR,;t t -s,@pkgdatadir@,$pkgdatadir,;t t -s,@pkglibdir@,$pkglibdir,;t t -s,@pkgincludedir@,$pkgincludedir,;t t -s,@SHARED_LIB_SUFFIX@,$SHARED_LIB_SUFFIX,;t t -s,@UNSHARED_LIB_SUFFIX@,$UNSHARED_LIB_SUFFIX,;t t -s,@XOTCL_BUILD_LIB_SPEC@,$XOTCL_BUILD_LIB_SPEC,;t t -s,@XOTCL_LIB_SPEC@,$XOTCL_LIB_SPEC,;t t -s,@XOTCL_BUILD_STUB_LIB_SPEC@,$XOTCL_BUILD_STUB_LIB_SPEC,;t t -s,@XOTCL_STUB_LIB_SPEC@,$XOTCL_STUB_LIB_SPEC,;t t -s,@XOTCL_BUILD_STUB_LIB_PATH@,$XOTCL_BUILD_STUB_LIB_PATH,;t t -s,@XOTCL_STUB_LIB_PATH@,$XOTCL_STUB_LIB_PATH,;t t -s,@XOTCL_SRC_DIR@,$XOTCL_SRC_DIR,;t t -s,@XOTCLSH@,$XOTCLSH,;t t -s,@XOWISH@,$XOWISH,;t t -s,@XOTCL_BUILD_INCLUDE_DIR@,$XOTCL_BUILD_INCLUDE_DIR,;t t -s,@XOTCL_BUILD_INCLUDE_SPEC@,$XOTCL_BUILD_INCLUDE_SPEC,;t t -s,@test_actiweb@,$test_actiweb,;t t -s,@libdirs_actiweb@,$libdirs_actiweb,;t t -s,@apps_actiweb@,$apps_actiweb,;t t -s,@TEA_PLATFORM@,$TEA_PLATFORM,;t t -s,@CONFIG_CLEAN_FILES@,$CONFIG_CLEAN_FILES,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - - -here=${PWD} - -for subdir in ${subdirs} -do - echo "==================== configure $subdir =====================" - if test x"${srcdir}" = x. ; then - confdir=. - else - mkdir -p $subdir - confdir=${srcdir}/$subdir - fi - (cd $subdir; echo $SHELL ${confdir}/configure ${ac_configure_args} --with-xotcl=${here}; eval $SHELL ${confdir}/configure ${ac_configure_args} --with-xotcl=${here}) -done - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: xotcl/configure.in =================================================================== diff -u -N --- xotcl/configure.in (revision caee4f272cfc744a06a7df61e2f3c73da1b6be64) +++ xotcl/configure.in (revision 0) @@ -1,495 +0,0 @@ - -#-------------------------------------------------------------------- -# 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: -# -#-------------------------------------------------------------------- -define(XOTclVersion, 1.5.6) -AC_INIT([xotcl], [XOTclVersion]) - -#-------------------------------------------------------------------- -# Call TEA_INIT as the first TEA_ macro to set up initial vars. -# This will define a ${TEA_PLATFORM} variable == "unix" or "windows". -#-------------------------------------------------------------------- - -TEA_INIT([3.6]) -AC_CONFIG_AUX_DIR(config) - -#-------------------------------------------------------------------- -# specify some extra flags -#-------------------------------------------------------------------- - -AC_ARG_WITH(gdbm, - [ --with-gdbm=GDBM_INCLUDE_DIR[,GDBM_LIB_DIR] - absolute path to gdbm.h and optionally the path to the library, - --without-gdbm disables build of Tcl Gdbm], - [with_gdbm=$withval], [with_gdbm=no]) -AC_ARG_WITH(aolserver3, - [ --with-aolserver3=AOL_SERVER_DIR, (containing include ,...) - --without-aolserver3 disables build of AOLserver 3 module], - [with_aol3=$withval], [with_aol3=no]) -AC_ARG_WITH(actiweb, - [ --with-actiweb=yes|no, - --without-actiweb disables actiweb components], - [with_actiweb=$withval], [with_actiweb=no]) -AC_ARG_WITH(xotclsh, - [ --with-xotclsh=yes|no, - --without-xotclsh disables built of xotclsh], - [with_xotclsh=$withval], [with_xotclsh=no]) -AC_ARG_WITH(xowish, - [ --with-xowish=yes|no, - --without-xowish disables built of xowish], - [with_xowish=$withval], [with_xowish=no]) -AC_ARG_WITH(all, - [ --with-all=yes|no, - --without-all disables built of all], - [with_all=$withval], [with_all=no]) -AC_ARG_WITH(all, - [ --with-all=yes|no, - --without-all disables built of all], - [with_all=$withval], [with_all=no]) -AC_ARG_WITH(tclinclude, - [ --with-tclinclude directory containing the public Tcl header files.], - with_tclinclude=${withval}) - -subdirs="" - -if test "$with_all" = yes; then - with_actiweb=yes - with_xotclsh=yes - with_xowish=yes - with_gdbm=yes -fi - -if test "$with_actiweb" = yes; then - test_actiweb="test-actiweb" - libdirs_actiweb="actiweb rdf registry store xml patterns" - apps_actiweb="actiweb persistence" - subdirs="$subdirs library/store/XOTclSdbm/" -dnl AC_CONFIG_SUBDIRS(library/store/XOTclSdbm/) - if ! test "$with_gdbm" = no; then - subdirs="$subdirs library/store/XOTclGdbm/" -dnl AC_CONFIG_SUBDIRS(library/store/XOTclGdbm/) - fi - subdirs="$subdirs library/xml/TclExpat-1.1/" -dnl AC_CONFIG_SUBDIRS(library/xml/TclExpat-1.1/) -else - test_actiweb="" - libdirs_actiweb="" - apps_actiweb="" -fi - -AC_SUBST(subdirs) - -if test "$with_tk" = no; then with_xowish="" ; fi -if test "$with_xotclsh" = yes; then XOTCLSH="xotclsh" ; else XOTCLSH=""; fi -if test "$with_xowish" = yes; then XOWISH="xowish" ; else XOWISH=""; fi - - -#-------------------------------------------------------------------- -# __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. -#-------------------------------------------------------------------- - -# do not modify the following lines manually, they are generated with changeXOTclVersion -XOTCL_MAJOR_VERSION=1 -XOTCL_MINOR_VERSION=5 -XOTCL_RELEASE_LEVEL=.6 - -XOTCL_VERSION=${XOTCL_MAJOR_VERSION}.${XOTCL_MINOR_VERSION} -NODOT_VERSION=${XOTCL_MAJOR_VERSION}${XOTCL_MINOR_VERSION} - -AC_SUBST(XOTCL_VERSION) -AC_SUBST(XOTCL_MAJOR_VERSION) -AC_SUBST(XOTCL_MINOR_VERSION) -AC_SUBST(XOTCL_RELEASE_LEVEL) - -echo "Configuring XOTcl Version $PACKAGE_VERSION" - -#-------------------------------------------------------------------- -# Load the tclConfig.sh file -#-------------------------------------------------------------------- - -TEA_PATH_TCLCONFIG -TEA_LOAD_TCLCONFIG - -#-------------------------------------------------------------------- -# check for TK -#-------------------------------------------------------------------- - -if test "$with_xowish" = yes; then - TEA_PATH_TKCONFIG - TEA_LOAD_TKCONFIG -# TEA_PUBLIC_TK_HEADERS -# TEA_PATH_X -fi - -#-------------------------------------------------------------------- -# 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, AC_PROG_INSTALL and a few others to create -# the basic setup necessary to compile executables. -#----------------------------------------------------------------------- - -TEA_SETUP_COMPILER - -#-------------------------------------------------------------------- -# check for extra flags -# -# FORCE_NO_STUBS is deactivated for now -if ! test "$with_aol3" = "no"; then - echo "Pre-configuring AOL-Server (xotcl)" - AOL_DEFINES="-DAOL_SERVER -DUSE_TCL8X -I$with_aol3/include -I$TCL_SRC_DIR/generic" - FORCE_NO_STUBS=1 -else - AOL_DEFINES="" - FORCE_NO_STUBS=0 -fi - -aol_prefix="/usr/local/aolserver" -if test -d "${prefix}/modules/tcl" ; then aol_prefix="${prefix}" ; fi -AC_SUBST(aol_prefix) - -#-------------------------------------------------------------------- -# check for tclCompile.h (needed, when compiled without full source) -if test -f "$TCL_SRC_DIR/generic/tclCompile.h"; then - HAVE_TCL_COMPILE_H="-DHAVE_TCL_COMPILE_H=1" -else - HAVE_TCL_COMPILE_H="" -fi - -#----------------------------------------------------------------------- -# __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([xotcl.c xotclError.c xotclMetaData.c xotclObjectData.c xotclProfile.c \ - xotclTrace.c xotclUtil.c xotclShadow.c xotclCompile.c aolstub.c xotclStubInit.c]) -TEA_ADD_HEADERS([generic/xotcl.h generic/xotclInt.h generic/xotclDecls.h generic/xotclIntDecls.h]) -TEA_ADD_INCLUDES([]) -TEA_ADD_LIBS([]) -TEA_ADD_CFLAGS([-DXOTCLVERSION=\\\"$XOTCL_VERSION\\\" -DXOTCLPATCHLEVEL=\\\"$XOTCL_RELEASE_LEVEL\\\" \ - $AOL_DEFINES $HAVE_TCL_COMPILE_H]) -TEA_ADD_STUB_SOURCES([xotclStubLib.c]) -TEA_ADD_TCL_SOURCES([]) - - -#-------------------------------------------------------------------- - -#-------------------------------------------------------------------- -# __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 TEa_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG -# so that we can extract TCL_SRC_DIR from the config file (in the case -# of private headers -#-------------------------------------------------------------------- - -#TEA_PUBLIC_TCL_HEADERS -TEA_PRIVATE_TCL_HEADERS - -if test x"${with_tclinclude}" != x ; then - if test -f "${with_tclinclude}/tcl.h" ; then - TCL_INCLUDES="-I${with_tclinclude} ${TCL_INCLUDES}" - else - AC_MSG_ERROR([${with_tclinclude} directory does not contain Tcl header file tcl.h]) - fi -fi - -#-------------------------------------------------------------------- -# __CHANGE__ -# A few miscellaneous platform-specific items: -# -# Define a special symbol for Windows (BUILD_xotcl 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. -#-------------------------------------------------------------------- - -if test "${TEA_PLATFORM}" = "windows" ; then - AC_DEFINE(BUILD_xotcl) - if test "$GCC" != "yes" ; then - AC_DEFINE(VISUAL_CC) - fi - CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch vc60.pch" - #TEA_ADD_SOURCES([win/winFile.c]) - #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/w -else - CLEANFILES="*.o *.a *.so *~ core gmon.out" - #TEA_ADD_SOURCES([unix/unixFile.c]) - #TEA_ADD_LIBS([-lsuperfly]) -fi - - -AC_SUBST(CLEANFILES) - -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -#-------------------------------------------------------------------- - -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 - -# Without the following two eval statements, XOTCL_SHARED_LIB_SUFFIX -# in xotclConfig.sh has $PACKAGE_VERSION unresolved. When another -# app links against xotcl, the PACKAGE_VERSIONs are confused. -# -# Without the first eval, we get -# XOTCL_SHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}${SHLIB_SUFFIX} -# XOTCL_UNSHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}.a -# -# after the first eval, we get -# XOTCL_SHARED_LIB_SUFFIX=1.2.1${DBGX}.so -# XOTCL_UNSHARED_LIB_SUFFIX=1.2.1${DBGX}.a -# after the second eval, all variables are resolved. - - -eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" -eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" - -#eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" -#eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" - -#-------------------------------------------------------------------- -# Set the default compiler switches based on the --enable-symbols -# option. -#-------------------------------------------------------------------- - -TEA_ENABLE_SYMBOLS - -#-------------------------------------------------------------------- -# Everyone should be linking against the Tcl stub library. If you -# can't for some reason, remove this definition. If you aren't using -# stubs, you also need to modify the SHLIB_LD_LIBS setting below to -# link against the non-stubbed Tcl library. -#-------------------------------------------------------------------- - - -#if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then -# FORCE_NO_STUBS=1 -#fi - -if test "${FORCE_NO_STUBS}" = "0" ; then - AC_DEFINE(USE_TCL_STUBS) -fi - -#-------------------------------------------------------------------- -# This macro generates a line to use when building a library. It -# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, -# and TEA_LOAD_TCLCONFIG macros above. -#-------------------------------------------------------------------- - -TEA_MAKE_LIB - -#-------------------------------------------------------------------- -# 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. -#-------------------------------------------------------------------- - -TEA_PROG_TCLSH - -# make this available, for such as xotclConfig.sh -XOTCL_COMPATIBLE_TCLSH=${TCLSH_PROG} -AC_SUBST(XOTCL_COMPATIBLE_TCLSH) - -# resolve the variables -eval "libdir=${libdir}" -eval "datadir=${datadir}" -eval "includedir=${includedir}" - -PKG_DIR="${PACKAGE_NAME}${PACKAGE_VERSION}" -pkgdatadir="${datadir}/${PKG_DIR}" -pkglibdir="${libdir}/${PKG_DIR}" -# make sure this is right (then remove this comment) -pkgincludedir="${includedir}/${PKG_DIR}" - -AC_SUBST(PKG_DIR) -AC_SUBST(pkgdatadir) -AC_SUBST(pkglibdir) -AC_SUBST(pkgincludedir) - -# -# XOTcl specific configs -# - -if test "${TEA_PLATFORM}" != "windows" ; then - -XOTCL_BUILD_LIB_SPEC="-L`pwd` -lxotcl${PACKAGE_VERSION}" -XOTCL_LIB_SPEC="-L${pkglibdir} -lxotcl${PACKAGE_VERSION}" - -# stub libs are not build for 8.0 -if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then - XOTCL_BUILD_STUB_LIB_PATH="" - XOTCL_STUB_LIB_PATH="" - XOTCL_BUILD_STUB_LIB_SPEC="" - XOTCL_STUB_LIB_SPEC="" -else - XOTCL_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}" - XOTCL_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}" - XOTCL_BUILD_STUB_LIB_SPEC="-L`pwd` -lxotclstub${PACKAGE_VERSION}" - XOTCL_STUB_LIB_SPEC="-L${pkglibdir} -lxotclstub${PACKAGE_VERSION}" - AC_DEFINE(COMPILE_XOTCL_STUBS) -fi - -else - -XOTCL_BUILD_LIB_SPEC="`pwd`/${PKG_LIB_FILE}" -XOTCL_LIB_SPEC="${pkglibdir}/${PKG_LIB_FILE}" -XOTCL_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}" -XOTCL_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}" -XOTCL_BUILD_STUB_LIB_SPEC="`pwd`/${PKG_STUB_LIB_FILE}" -XOTCL_STUB_LIB_SPEC="${pkglibdir}/${PKG_STUB_LIB_FILE}" - -fi - -AC_SUBST(SHARED_LIB_SUFFIX) -AC_SUBST(UNSHARED_LIB_SUFFIX) -AC_SUBST(XOTCL_BUILD_LIB_SPEC) -AC_SUBST(XOTCL_LIB_SPEC) -AC_SUBST(XOTCL_BUILD_STUB_LIB_SPEC) -AC_SUBST(XOTCL_STUB_LIB_SPEC) -AC_SUBST(XOTCL_BUILD_STUB_LIB_PATH) -AC_SUBST(XOTCL_STUB_LIB_PATH) -XOTCL_SRC_DIR=$srcdir -AC_SUBST(XOTCL_SRC_DIR) -AC_SUBST(XOTCLSH) -AC_SUBST(XOWISH) - -# include dir of xotcl during build process (i.e., does not assume installed) -XOTCL_BUILD_INCLUDE_DIR="${XOTCL_SRC_DIR}/generic" -XOTCL_BUILD_INCLUDE_SPEC="-I${XOTCL_BUILD_INCLUDE_DIR}" -AC_SUBST(XOTCL_BUILD_INCLUDE_DIR) -AC_SUBST(XOTCL_BUILD_INCLUDE_SPEC) - -AC_SUBST(test_actiweb) -AC_SUBST(libdirs_actiweb) -AC_SUBST(apps_actiweb) - -AC_SUBST(TEA_PLATFORM) - -dnl macro expanding to the names of files ./configure is to generate. -dnl reasoning: this is a factoring; I use this value elsewhere. -dnl -dnl Change the value of -this- macro if you want to add or remove -dnl such files. - -AC_DEFUN(CONFIG_OUTPUT_FILES, [[Makefile xotclConfig.sh apps/utils/xotclsh apps/utils/xowish unix/xotcl.spec unix/pkgIndex.unix]]) - -#-------------------------------------------------------------------- -# the value of this variable is set to the files which are to be -# removed when the user invokes 'make distclean' (i.e., those -# files generated by ./configure) and is used in the make distclean -# target, defined in Makefile.in -#-------------------------------------------------------------------- - -CONFIG_CLEAN_FILES="CONFIG_OUTPUT_FILES autom4te.cache/" -AC_SUBST(CONFIG_CLEAN_FILES) -AC_CONFIG_FILES(CONFIG_OUTPUT_FILES) - -#-------------------------------------------------------------------- -# Finally, substitute all of the various values into the Makefile, -# and generate the other output files. (this is done by invoking -# config.status) -# -# NOTE the lack of parameters! AC_OUTPUT with params is deprecated; -# use macros such as AC_CONFIG_FILES, AC_HEADER_FILES, etc to add -# to the files output by ./configure. -#-------------------------------------------------------------------- - -AC_OUTPUT - -here=${PWD} - -for subdir in ${subdirs} -do - echo "==================== configure $subdir =====================" - if test x"${srcdir}" = x. ; then - confdir=. - else - mkdir -p $subdir - confdir=${srcdir}/$subdir - fi - (cd $subdir; echo $SHELL ${confdir}/configure ${ac_configure_args} --with-xotcl=${here}; eval $SHELL ${confdir}/configure ${ac_configure_args} --with-xotcl=${here}) -done - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: xotcl/doc/Announce-0.9.3 =================================================================== diff -u -N --- xotcl/doc/Announce-0.9.3 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/Announce-0.9.3 (revision 0) @@ -1,57 +0,0 @@ -Announcing XOTcl 0.9.3 -********************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -RECENT CHANGES relative to 0.9 are: - - - A "more or less" TEA compliant build process and its - directory structure (aligend it as far as possible to Tcl, sample - extension and other extensions) - - * We started building an XOTcl stub lib. - - * We separated xotcl from its library/applications - (there is an xotcl- directory in the full distribution - that just builds, installs, etc. the XOTcl libraries ... this - can for instance be used in other distributions using and - shipping XOTcl, but not using the shells). - - * The full distribution still builds shells, but they are using - "package require" to load the XOTcl libraries now. - - * For building xowish (the XOTcl Tk shell) you do only require - an installed Tk version on Unix now. - - - On Windows we still use nmake due to problems with VCC 6.0 in - all TEA compliant extensions we have checked, but we use a - completely new build process (more or less one-to-one the - Unix build process). - - - A few minor bugfixes. - - - We have tested this release on platforms we have access to - (Linux, Win NT, Solaris). Please inform us, if there are some - problems on your platform so that we can eliminate them in future - releases. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - Index: xotcl/doc/Announce-0.9.4 =================================================================== diff -u -N --- xotcl/doc/Announce-0.9.4 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/Announce-0.9.4 (revision 0) @@ -1,100 +0,0 @@ -Announcing XOTcl 0.9.4 -********************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -CHANGES relative to 0.9.3 are: - - - fixes: - - * separate reference counting for XOTcl objects and classes - to avoid references from tcl_obj's internal representation - to freed memory - - * fixes for AOL-Server (many thanks to Zoran Vasiljevic for - that and for his great help during fixing the problems above) - - * improved portability: horrible macro substitution - bug, when USE_ALLOCA or USE_MALLOC was specified; these - are used for some platforms such as AIX - - * fixing path search for XOTcl library (bug was introduced in - 0.9.3 in connection with TEA compliance) - - * fixed a bug in copy/move (many thanks for Artur Trzewik - for reporting this) in connection with constructors - (constructors are not called automatically in copy/move - operations anymore) - - * various small fixes in libraries (e.g. HTTP support, - generation of pkgIndex-files, using "my", ...) - - - enhancements: - - * new global command "my": - one can use now: - - Class Counter -parameter {{n 0}} - Counter instproc ++ {} { my incr n } - Counter instproc print {} { puts "actual value: [my n]"} - - Counter c1 - c1 ++ - c1 print - - In earlier versions it was neccessary to use "[self]" - instead of "my". This change reduces the number of - special characters in XOTcl programs. - "[self]" will continue to be supported by XOTcl. - - * extended semantics of "new" - - a) Object new ... - b) Object new -childof ... - c) Object new -volatile ... - d) Object new -volatile -childof ... - - where (a) creates now "global" objects not in the global - namespace anymore, but in the ::xotcl namespace, (b) can - be used to create objects as child of other objects - (e.g. as children of the actual object [self]; the objects - are deleted, when the specified object is deleted). (c) - creates are "global" objects as in (a), but they are - deleted, when the scope of the current - tcl-proc/object-proc/instproc is left and (d) is a - combination of (b) and (c). - - - optimizations: - - * XOTcl is trying to keep Tcl_Objs of type tclCmdNameType - instead of converting it to XOTclObjectType agressively. - - * A patch for Tcl 8.4a3 is available from the XOTcl web site - for performance hungry applications to provide special - byte-code-support for xotcl, that yields for classical - benchmark programs up to 40%. This patch is not likely to - be integrated into the general Tcl core in the new or - distant future. - - For more details, please consult the ChangeLog - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - Index: xotcl/doc/Announce-1.0 =================================================================== diff -u -N --- xotcl/doc/Announce-1.0 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/Announce-1.0 (revision 0) @@ -1,51 +0,0 @@ -Announcing XOTcl 1.0 -******************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -CHANGES relative to 0.9.4 are: - - - fixes: - - * various small fixes for compilation with tcl8.4.* - - * fixed some more memory-leaks that showed up in connection - with multi-threading (many thanks to Zoran Vasiljevic for - his great help) - - * removed a few panics() by tcl errors (important for servers) - - * various small fixes in Httpd-code - - * fixes in filter-search mechanism - - * the general cleanup method __exitHandler (called on - interpreter exits and on thread exits) defined now - as a proc of Object - - - optimizations: - - * speedup during recreation of objects - - For more details, please consult the ChangeLog - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - Index: xotcl/doc/Announce-1.0.1 =================================================================== diff -u -N --- xotcl/doc/Announce-1.0.1 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/Announce-1.0.1 (revision 0) @@ -1,57 +0,0 @@ -Announcing XOTcl 1.0.1 -********************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -CHANGES relative to 1.0 are: - - - fixes: - - * fixed installation bug on windows (when installed on - drives different to c:) - - * fixes for aolserver 3.5.* - - * fix for "object info default arg var" in connection - with filters - - * Serializer handles filter guards now - - - new functionality and improvements: - - * improved recreate semantics, makes it easier to - overload recreation logic. - - * new method "noinit" to create objects without - calling the constructor - - - optimizations: - - * general speedup (10 to 15%) by using client data of - namespace instead of Tcl_AssocData for interpreter state - - * faster and more flexible Serializer - - - For more details, please consult the ChangeLog - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - Index: xotcl/doc/Announce-1.0.2 =================================================================== diff -u -N --- xotcl/doc/Announce-1.0.2 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/Announce-1.0.2 (revision 0) @@ -1,76 +0,0 @@ -Announcing XOTcl 1.0.2 -********************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -CHANGES relative to 1.0.1 are: - - - fixes: - - * fixes for copying/moving objects to same name - - * works out of the box with AOL-server 4.0 - (no patch for AOL-server needed) - - * various small fixes and code cleanup - - * new directory structure (no nested version numbers) - - * improved object and class serializer - - - new functionality and improvements: - - * new method "ismixin": Test whether the argument is a - mixin or instmixin of the object. - - * new method "hasclass": Test whether the argument is either - a mixin or instmixin of the object or if it is on the class - hierarchy of the object. This method combines the - functionalities of istype and ismixin. - - * arguments of configure methods can start now - with a leading "-" without ambiguity. In previous versions - - Class C -parameter {name counter} - C c1 -name -x -counter 123 - - the configuration of c1 was interpreted as follows - - method argc - name 0 - x 0 - counter 1 - - Starting with XOTcl 1.0.2 arguments can be protected - by putting it into a list: - - C c1 [list -name -x] -counter 123 - - which is interpreted as follows: - - method argc - name 1 - counter 1 - - For more details, please consult the ChangeLog - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - Index: xotcl/doc/Announce-1.1.0 =================================================================== diff -u -N --- xotcl/doc/Announce-1.1.0 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/Announce-1.1.0 (revision 0) @@ -1,87 +0,0 @@ -Announcing XOTcl 1.1.0 -********************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -CHANGES relative to 1.0.2 are: - - - New functionality and improvements: - - * Transitive instmixins (thanks to a suggestion of Neophytos Demetriou): - The new version supports a tree of mixins (mixins of mixins); - when a mixin-class X has instmixins Y registered, and X is - registered as instmixin for a class C, the mixin classes Y are - applied to C as well. - - * Conditional mixins (thanks to a suggestion of Neophytos Demetriou): - mixins and instmixins can have now guards similar to filters - that define when they should be applied - - * New composition strategy for (filter- and mixin-)guards: - when a guard is defined more than once for the same interceptor - the most specific guard is used, the others are overridden. - - * Creation of sub-objects via parameter: - XOTcl's parameter method supports now a switch named "-Class" - which can be used to create and configure sub-objects (see - tutorial for details) - - * New predefined method: __unknown - This method is called, whenever XOTcl references a class, - which is not defined yet (e.g.: Class C -superclass UNKNOWNCLASS) - This method is used for Zoran's wonderful ttrace package - (for aolserver and tcl-Threads) - - * Improved documentation: - - extended tutorial (Meta-Classes, Tk, ...) - - beautified tutorial (style files, distinction between - literals and placeholders, ...) - - fixed hundreds of typos - - * some speed improvements - - - - fixes: - - * New build system: - - per default no shells are built - - new configure switches eg. --with-xotclsh, -with-actiweb - --with-all - - * Fixes for https in connection with some versions of IE - - * Fixed a few issues with purify and mt (many thanks to Zoran!) - - * Fixes for proc-scoped variable in connections with mixins - - * Fixed passing of error codes from constructors - - * various small fixes and code cleanup - - with newer versions of autoconf - - various fixes for stubs - - improved build under windows - - starkit compliance (many thanks to MichaelL@frogware.com) - - - For more details, please consult the ChangeLog - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - Index: xotcl/doc/Announce-1.1.1 =================================================================== diff -u -N --- xotcl/doc/Announce-1.1.1 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/Announce-1.1.1 (revision 0) @@ -1,52 +0,0 @@ -Announcing XOTcl 1.1.1 -********************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -CHANGES relative to 1.1.0 are: - - - Improved portability - * for Mac OS X (many thanks to Daniel Steffen) - * freebsd 4.9 (many thanks to Marc Spitzer) - - - configure can run outside of xotcl-tree and - can install to a different directory. Example: - - % mkdir -p /tmp/xotcl/unix - % cd /tmp/xotcl/unix - % ~/xotcl-1.1.1/unix/configure --with-all - % make - % make test - % make install DESTDIR=/tmp - - - several fixes and improvements such as - * added option --with-tkinclude for configure - (only needed, when built with optional --with-xowish) - * made gdbm work when compiled with threads enabled - * fix for initialization of stubtables in gdbm - * fixes for HTTP support (return format of values in - HTTP OPTION command made windows explorer hang) - * easy provision for redirects in HTTP server - - For more details, please consult the ChangeLog - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - Index: xotcl/doc/Announce-1.2.0 =================================================================== diff -u -N --- xotcl/doc/Announce-1.2.0 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/Announce-1.2.0 (revision 0) @@ -1,199 +0,0 @@ -Announcing XOTcl 1.2.0 -********************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -CHANGES relative to 1.1.1 are: - - - Qualitative Improvements - * improved performance (up to more than 30% faster) - * reduced dependency on Tcl internals (stack rewritings removed) - * less C-code (code reduction of about 500 lines c code) - * defined macros to access Tcl's internal structures - Due to the speedup, an emulation of an itcl like language - in XOTcl can be faster than itcl itself (see below). - - - Functional Improvements - * new subcommands of self: - self callinglevel: returns the scope of the proc/instproc - calling the current method (ignoring filters and next) - self activelevel: returns the scope of the proc/instproc - preceding the current method (might be a next call, - ignoring filters) - the returned level can be used in uplevel/upvar as first argument - - * new methods upvar/uplevel - "my uplevel set x 1" is a short form of "uplevel [self callinglevel] set x 1" - - * sub-objects can be called like methods (potential incompatibility) - If an object named o has a sub-object q (i.e. o::q) it is now - possible to invoke the sub-object via "o q ?method args?". This change - makes it possible to - - - to redefine tcl sub-commands via procs/instprocs by defining - the command with subcommands as an object (instead of defining - a command as a proc and its subcommands via a large - and hard-to-refine switch statement) - - - to use the same approach for defining subcommands of subcommands - (and so on) in the same way; it would be possible to define e.g. - the xotcl info methods via an object), - - - to use interceptors (filters/mixins) for some or all subcommands (maybe you - are only interested in "file delete") - - - to extend a tcl command on the fly by defining new subcommands - (by defining new procs/instprocs) - - - to use the unknown mechanism to produce dynamic error messages - about valid subcommands (via introspection commands). - - As a simple example, one define the a specialized version of Tcl's - file-command (say ns::file) like the following: - - namespace eval ns { - Object file - file proc tail name { - set tail [file tail $name] - regexp {[^/\\]+$} $tail tail - return $tail - } - file proc unknown {subcmd args} { - return eval ::file $subcmd $args - } - } - - For more details, please consult the ChangeLog - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - -#======================================================================= -# extract from the logfile of oobench (in oo-bench.tar.gz, -# see http://media.wu-wien.ac.at/download.html) - -XOTcl - methcall: 0.470u 0.000s 0:00.41 114.6% 0+0k 0+0io 347pf+0w -ITcl emulation in XOTcl - methcall: 0.590u 0.000s 0:00.62 95.1% 0+0k 0+0io 351pf+0w -itcl - methcall: 0.870u 0.020s 0:00.92 96.7% 0+0k 0+0io 347pf+0w - - -#======================================================================= -package require XOTcl; namespace import -force xotcl::* - -########################################################### -## Small example to emulate a itcl-like language in XOTcl -## -gustaf neumann Jan. 2004 -########################################################### -namespace eval itcl { - Class create class -superclass Class - class instproc instvars {} { - set vars [list]; set c [self] - for {} {[string compare ::xotcl::Object $c]} {set c [$c info superclass]} { - eval lappend vars [$c set __autovars] - } - return "\n\tmy instvar [lsort -unique $vars]" - } - class proc constructor {args} { - if {[llength $args]==2} { - foreach {arglist body} $args break - } else { - foreach {arglist construct body} $args break - set body $construct\n$body - } - my parameter [list {this [self]}] - my proc constructor args {uplevel next $args} - my instproc init $arglist [my instvars]\n$body - } - class proc method {name arglist body} { - my proc $name args {uplevel next $args} - my instproc $name $arglist [my instvars]\n$body - } - class proc inherit {class} { - my superclass $class - } - class proc variable {arglist} { - foreach v $arglist {my lappend __autovars $v} - } - class instproc init {classdef} { - my set __autovars this - namespace eval [self class] $classdef - my class Class - } -} - -########################################################### -# Two Demo classes from oo-bench -########################################################### -itcl::class Toggle { - variable state - constructor {start_state} { - set state $start_state - } - method value {} { - return $state - } - - method activate {} { - set state [expr {!$state}] - return $this - } -} - -itcl::class NthToggle { - inherit Toggle - variable count_max - variable counter - constructor {start_state max_counter} { - Toggle::constructor $start_state - } { - set count_max $max_counter - set counter 0 - } - method activate {} { - if {[incr counter] >= $count_max} { - Toggle::activate - set counter 0 - } - return $this - } -} - - -proc main {} { - set n [lindex $::argv 0] - set val 1 - set toggle [Toggle t1 $val] - for {set i 0} {$i < $n} {incr i} { - set val [[$toggle activate] value] - } - if {$val} {puts "true"} else {puts "false"} - - set val 1 - set ntoggle [NthToggle t2 1 3] - for {set i 0} {$i < $n} {incr i} { - set val [[$ntoggle activate] value] - } - if {$val} {puts "true"} else {puts "false"} -} - -main Index: xotcl/doc/Announce-1.3.0 =================================================================== diff -u -N --- xotcl/doc/Announce-1.3.0 (revision f13b9000e83d3896683de0ecf438216be88832fe) +++ xotcl/doc/Announce-1.3.0 (revision 0) @@ -1,76 +0,0 @@ -Announcing XOTcl 1.3.0 -********************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -Major changes relative to 1.2.0 are: - - - Qualitative Improvements - * Improved portability: - + TEA3 compatible build - + Much more polished configure+makefile (many thanks to - Jim Lynch for his help) - - * Improved code quality: - + fixed 2 possible segmentation violations (error handling) - + fixed free memory reads (many thanks to Zoran Vasiljevic - for his help with purify) - - * Less intrusive usage of XOTcl components: - + XOTcl procs and instprocs use now the namespace in which - they were defined. One can use XOTcl packages without having - the need to import xotcl globally or to use the xotcl-prefix - in all xotcl procs/instprocs. - - - Functional Improvements - * New forwarding mechanisms for fast delegation: - new methods 'forward' and 'instforward' (many thanks - to Bryan Schofield for fruitful discussions and suggestions). - This method is a superset of tclcmd/insttclcmd, which has - been marked as deprecated. See the tutorial for more details. - - * Nonpositional arguments for xotcl procs/instprocs; this is - a flexible way to check arguments, to provide defaults etc - for every xotcl proc/instproc. It uses a similar syntax as - ad_proc and ad_page_contract in OACS. See the tutorial for - more details. - - * Extended methods filter, mixin, instfilter, instmixin as - discussed in the XOTcl mailing list. These commands can be - used more flexibly as follows - - obj mixin same as: obj info mixin - obj mixin {C1 C2} same as: obj mixin set {C1 C2} - obj mixin set {C1 C2} sets the mixins for obj - obj mixin get same as: obj info mixin - obj mixin add C3 adds a mixin on front of the mixin list - obj mixin add C3 end adds a mixin at the end the mixin list - obj mixin add C3 3 adds a mixin at the 3rd position - obj mixin delete ::C3 removes the mixin from the mixin list - - The same semantics are available as well for filter, instmixin - and instfilter. This change is fully backward compatible. - {filter,instfilter,mixin,instmixin}append are deprecated now. - - - For more details about the changes, please consult the ChangeLog and documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun Index: xotcl/doc/Announce-1.3.1 =================================================================== diff -u -N --- xotcl/doc/Announce-1.3.1 (revision 2c98844f5e9a46a8ecb2c8aa8d714592a07b311d) +++ xotcl/doc/Announce-1.3.1 (revision 0) @@ -1,13 +0,0 @@ -Announcing XOTcl 1.3.1 -********************** - -This is a minor fix release relative to 1.3.0. This fixes a few -problems introduced in 1.3.0 (invocation of checking procs in -nonpositional argument) and has a better build support for building -XOTcl outside of the source tree, the tar files are now dist-cleaned. - - -Best regards, - -Gustaf Neumann -Uwe Zdun Index: xotcl/doc/Announce-1.3.3 =================================================================== diff -u -N --- xotcl/doc/Announce-1.3.3 (revision 2c98844f5e9a46a8ecb2c8aa8d714592a07b311d) +++ xotcl/doc/Announce-1.3.3 (revision 0) @@ -1,54 +0,0 @@ -Announcing XOTcl 1.3.3 -********************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -Major changes relative to 1.3.1 are: - - - Qualitative Improvements - - * Improved code quality: - + fixed possible segmentation violations in free memory reads - (many thanks to Zoran Vasiljevic for his help with purify) - + fixed "self callinglevel" when uplevel was called from uplevel - + fixed nonposargs - + fixed configure in connection with enable-symbols and - for aolserver configuration - + extended regression test - - * Improved Functionality - + Producing error message when a non-existing proc/instproc - is tried to be deleted - + fixed exists method for objects with namespaces by using - a namespace resolver - + fixed return code for unknown handling in next - + reduced memory consumption for objects and classes with procs/instprocs - of about 14% - - * Improved Documentation - - - - For more details about the changes, please consult the ChangeLog and documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.3.4 =================================================================== diff -u -N --- xotcl/doc/Announce-1.3.4 (revision 2c98844f5e9a46a8ecb2c8aa8d714592a07b311d) +++ xotcl/doc/Announce-1.3.4 (revision 0) @@ -1,55 +0,0 @@ -Announcing XOTcl 1.3.4 -********************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -Major changes relative to 1.3.3 are: - - - Qualitative Improvements - - * Improved code quality: - + fixed possible segmentation violations in free memory reads - (many thanks to Zoran Vasiljevic for his help with purify) - + fixed "self callinglevel" when uplevel was called from uplevel - + Improved portability (many thanks to Jeffrey Hobbs) - + fixed nonposargs - + fixed configure in connection with enable-symbols and - for aolserver configuration - + extended regression test - - * Improved Functionality - + Producing error message when a non-existing proc/instproc - is tried to be deleted - + fixed exists method for objects with namespaces by using - a namespace resolver - + fixed return code for unknown handling in next - + reduced memory consumption for objects and classes with procs/instprocs - of about 14% - - * Improved Documentation - - - - For more details about the changes, please consult the ChangeLog and documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.3.5 =================================================================== diff -u -N --- xotcl/doc/Announce-1.3.5 (revision 2c98844f5e9a46a8ecb2c8aa8d714592a07b311d) +++ xotcl/doc/Announce-1.3.5 (revision 0) @@ -1,62 +0,0 @@ -Announcing XOTcl 1.3.5 -********************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -Major changes relative to 1.3.4 are: - - - Qualitative Improvements - - * Improved code quality: - + fixed possible segmentation violations in non positional - argument handling - + moved the Serializer into a namespace such that - % package req XOTcl - % package req xotcl::serializer - Serialize .... - works without namespace imports (the Serializer is - still auto-exported, but this will change in the future) - + - - * Improved Functionality - + Non-positional arguments can be used in the same argument - list as positional ones (more compliant with OpenACS). - One can write now - % Object o - % o proc foo {-x:boolean -y a b} { ...} - instead of - % ... - % o proc foo {-x:boolean -y} {a b} { ...} - All introspection commands will work like before. - The old syntax (with the additional argument) is deprecated - and will be dropped in the future. - - + Serializer: support for objects with parent namespaces, which are - not xotcl objects - - + additional instproc for ::xotcl::Class allinstances - to return all instances for the actual class - - For more details about the changes, please consult the ChangeLog and documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.3.6 =================================================================== diff -u -N --- xotcl/doc/Announce-1.3.6 (revision 2c98844f5e9a46a8ecb2c8aa8d714592a07b311d) +++ xotcl/doc/Announce-1.3.6 (revision 0) @@ -1,61 +0,0 @@ -Announcing XOTcl 1.3.6 -********************** - -WHAT IS XOTCL? - - XOTcl is an object-oriented extension of Tcl that was derived from - OTcl. In short, XOTcl tries to provide a highly flexible, - reflective, component-based, and object-oriented environment. It - integrates language support for high level concepts which are not - found in other languages, with reasonable performance. It prevails - the Tcl programming style and the dynamic/introspective nature of - the language, rather than introducing other language's styles and - rigidness (such as C++) into Tcl. - - -Major changes relative to 1.3.5 are: - - * Improved Functionality - + new info subcommand: info precedence - - + simplified meta class definitions: every class can be - changed into a metaclass by adding an instmixin of Class (or - one of its subclasses) to it. In order to define that every - class should be a metaclass, one can use now - Object instmixin Class - instead of the rather complicated solution i posted on - the xotcl mailing list not long ago. - - * Improved code quality: - + fixed possible crashes when - - objects are called with class methods (e.g. due to instmixins) - - when instmixins are defined recursively - (e.g. Class instmixin Class) - - objects are turned into classes by changing the - class relationship - + improved namespace resolution when mixin classes are defined - in namespaces (::xotcl:: namespace is skipped, since a - helper method that calles the primitive setting command - is defined there) - + fixed passing of error code from init methods - (thanks to Fabrice Pardo for noting it) - + returning PACKAGE_VERSION after a package require - (e.g. 'package req XOTcl' returns now 1.3.6) - + some code refactoring, fixed erroneous documentation of c code - + improved documentation - - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.3.7 =================================================================== diff -u -N --- xotcl/doc/Announce-1.3.7 (revision 2c98844f5e9a46a8ecb2c8aa8d714592a07b311d) +++ xotcl/doc/Announce-1.3.7 (revision 0) @@ -1,65 +0,0 @@ -Announcing XOTcl 1.3.7 -************************* - -I am pleased to annouce XOTcl 1.3.7. -Major changes relative to 1.3.6 are: - - * Improved Functionality - + new option "switch" for non positional arguments to be used - to toggle the default value. A switch is a non positional argument - without extra argument. - + new option "isnextcall" for self - + new command "::xotcl::configure filter on|off" to turn off filters. - needed for serializing objects/classes with active filters - + several improvements for serializer to handle e.g. application - methods on Object/Class (needed for ad_instproc in oacs) - + improving namespace resolving in for object/class references - + moving all library packages into namespaces - + preventing "new" from overwriting objects - + allow xotcl to be used in slave interpreters - - - * Improved code quality: - + fixed namespace confusion in forward to expression calling - xotcl methods - + fixed possible crash in instvar when empty variable names are used - + some code cleanup - + improved documentation - - * new method "method" for defining methods (experimental): - Instead of using e.g. - - Object o1 - Class C - - o proc m1 {} {....} - C instproc m2 {} {....} - C proc m3 {} {....} - - one can use now - - o method m1 {} {....} - C method m2 {} {....} - C method -per-object m3 {} {....} - - in general, we can support options for method definitions, which - can be used as well for mixins, filters or info (instead of the - "inst" prefix). This way the problem of finding appropriate names for - distinguishing between object or class matters can be solved, - in rather rare cases (when referring the to class object) "-per-object" - can be used. The according name changes will happen in xotcl 2.0. - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.3.8 =================================================================== diff -u -N --- xotcl/doc/Announce-1.3.8 (revision 2c98844f5e9a46a8ecb2c8aa8d714592a07b311d) +++ xotcl/doc/Announce-1.3.8 (revision 0) @@ -1,67 +0,0 @@ -Announcing XOTcl 1.3.8 -************************* - -I am pleased to annouce XOTcl 1.3.8 -Major changes relative to 1.3.6 are: - - * Improved Functionality - + new option "switch" for non positional arguments to be used - to toggle the default value. A switch is a non positional argument - without extra argument. - + new option "isnextcall" for self - + new command "::xotcl::configure filter on|off" to turn off filters. - needed for serializing objects/classes with active filters - + several improvements for serializer to handle e.g. application - methods on Object/Class (needed for ad_instproc in oacs) - + improving namespace resolving in for object/class references - + moving all library packages into namespaces - + preventing "new" from overwriting objects - + allow xotcl to be used in slave interpreters - - - * Improved code quality: - + fixed namespace confusion in forward to expression calling - xotcl methods - + fixed possible memory leak with instmixins - + fixed possible crash in instvar when empty variable names are used - + fixed namespace related bug in __unknown resolver hook - + some code cleanup - + improved documentation - - * new method "method" for defining methods (experimental): - Instead of using e.g. - - Object o1 - Class C - - o proc m1 {} {....} - C instproc m2 {} {....} - C proc m3 {} {....} - - one can use now - - o method m1 {} {....} - C method m2 {} {....} - C method -per-object m3 {} {....} - - in general, we can support options for method definitions, which - can be used as well for mixins, filters or info (instead of the - "inst" prefix). This way the problem of finding appropriate names for - distinguishing between object or class matters can be solved, - in rather rare cases (when referring the to class object) "-per-object" - can be used. The according name changes will happen in xotcl 2.0. - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.3.9 =================================================================== diff -u -N --- xotcl/doc/Announce-1.3.9 (revision 2c98844f5e9a46a8ecb2c8aa8d714592a07b311d) +++ xotcl/doc/Announce-1.3.9 (revision 0) @@ -1,41 +0,0 @@ -Announcing XOTcl 1.3.9 -************************* - -Hi everybody. I am pleased to annouce the availability of XOTcl 1.3.9. -Major changes relative to 1.3.8 are: - - * Improved Functionality - + new subcommand for self: [self args] return the full argument list - of the current call - + " info vars" does not trigger read traces on each variable anymore - + Serializer: exportMethods accepts forwards/instforwards now - as well - + new switch -nocomplain for "mixin|instmixin|filter|instfilter delete" - to avoid error messages when deleting entries not there (similar unset) - + require automatically a namespace when a childobject is added - + new command ::xotcl::__qualify: convert an relative name - into an command name (exactly as create does it, ignoring - namespaces from transparent interceptors) - - * Improved code quality: - + fixing version numbers for package require - + Upgraded TEA to 3.4 - + updated rpm build (many thanks to Ildiko Schmidt and Alexander Bergolth) - + fixed bug with error propagation when getter/setter methods are - used for parameters (many thanks to Manfred Stelzhammer for - pointing this out) - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.4.0 =================================================================== diff -u -N --- xotcl/doc/Announce-1.4.0 (revision 2c98844f5e9a46a8ecb2c8aa8d714592a07b311d) +++ xotcl/doc/Announce-1.4.0 (revision 0) @@ -1,42 +0,0 @@ -Announcing XOTcl 1.4.0 -************************* - -Hi everybody. I am pleased to annouce the availability of XOTcl 1.4.0. -Major changes relative to 1.3.9 are: - - * Improved Functionality - * new option: ::xotcl::configure softrecreate on|off - if softrecreate is set, class relations (superclass, subclass, class, instances) - are not affected by a recreate; this allows files with class definitions - more easily to reload - + easier syntax for providing commands for initializing default values - + setting and querying options for ::xotcl::configure simiar to set - - * Improved code quality: - + fixed a bug in connection with nonpositional arguments and "args" - + fixed a bug with adding on the fly transitive mixin classes - + fixed a bug with filter states after next - + fixed omitted error message after calling self with unknown subcommands - + fixed a bug with variable traces on thread exit (triggered by volatile) - + fixed incorrect rpm dependencies - + cleaner compile for xotcl for gcc 4.* under linux - + don't destroy namespace imported child objects - + info children returns true children, not namespace imported objects/classes - + unsetting the global variable "cmd" from predefined.xotcl - + Upgraded TEA to 3.5 - + more regression tests addeed - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.4.1 =================================================================== diff -u -N --- xotcl/doc/Announce-1.4.1 (revision 2c98844f5e9a46a8ecb2c8aa8d714592a07b311d) +++ xotcl/doc/Announce-1.4.1 (revision 0) @@ -1,207 +0,0 @@ -Announcing XOTcl 1.5.0 -************************* - -Hi everybody. I am pleased to announce the availability of XOTcl 1.5.0. -Major changes relative to 1.4.0 are: - - * Improved Functionality - - + The C-level implementation of XOTcl create now the basic - classes ::xotcl::Object and ::xotcl::Class completely without - any methods. All predefined methods are now registered - from the initialization script-code (predefined.xotcl) - via the new command - - ::xotcl::alias | \ - ?-objscope? ?-per-object? - - which is used for registering predefined Tcl commands - as methods. These aliases are like zero cost forwarders, - since they lookup the function pointer from the commands - and used these in the methods. - - This change makes it possible to register the same command - on different classes (with maybe different names), such that - for example the predefined set method of ::xotcl::Object - can be replaced with a different method and the set method - can be registered on some other classes (maybe some - application classes). This change makes it as well quite - easy to use the XOTcl framework to develop some other - object oriented frameworks. - - + slots - TODO documentation of slots - TODO remove - TODO optimize via parametercmd - TODO parametercmd with 3+ args - TODO info parameter deprecated - - A slot is a meta-object that manages property-changes of - objects. A property is either an attribute or a role of an relation. - In a nutshell, a slot has among other attributes - - a name (which it used to access it), - - a domain (object or class on which it can be used) , and - - can be multivalued or not - We distinguish between system slots (predefined slots like - class, superclass, mixin, instmixin, filter, instfilter) and - application slots (e.g. attributes of classes). - - System Slots - ======== - - System slots are predefined slots defining e.g. some relations - between classes, or between objects and classes. - - The predefined system slots are: - - superclass: every class in XOTcl has one or more superclasses. - The name of this slot is "superclass", the domain is "::xotcl::Class", - the slot is multivalued. One object might have multiple superclasses. - - class: every object has a class; therefore, the domain of the slot - is "::xotcl::Class", the property is not multivalued. - - mixin: every object in XOTcl can have one or more mixin classes. - The name of this slot is "mixin", the domain is "::xotcl::Object", the slot is - multivalued. - - instmixin: same as above, but the domain is "::xotcl::Class" - - filter, instfilter: similar to "mixin" and "instmixin" - - Every slot can be used set and query the property from its domain. - The syntax for setting values is - newValue - replace newValue - and for getting its values is - set x [ ] -TODO "mixin set" -> "mixin assign" -TODO "mixin set" -> "mixin replace" -TODO "mixin set" -> "mixin reset" -TODO "mixin delete" -> "mixin remove" - where the first form is in both cases the short form of the second one. - Every multivalued slot has as well a method "add" and "remove" - - Examples for using the system slot "mixin" - - Object o; Class M; class N - o mixin ::M ;# replacing the per-object mixins of o with M - o mixin reset ::M ;# same as before - o mixin add ::N ;# add N to the front of the mixin list - o mixin delete ::M ;# delete M from the mixin list - puts [o mixin] ;# query the current mixin list - - Every system slot (e.g. superclass) has the exact same interface. - - - Attribute Slots - ========= - - Attribute slots are used to manage the setting and querying - of instance variables. We define now a person with three - attributes,"name", "salary" and "projects". - - Class Person -slots { - Attribute name - Attribute salary -default 0 - Attribute projects -default {} -multivalued true - } - - These attributes might have a default value or they might be - multivalued. When an instance of class Person is created, the - slot names can be used for specifying values for the slots. - - Person p1 -name "Joe" - - Object p1 has three instance variables, namely "name", - "salary" and "projects". Since slot "projects" is multivalued, - we can add values the "add" subcommand. - - Project project1 -name XOTcl \ - -description "A highly flexible OO scripting language" - - p1 projects add ::project1 - p1 projects add some-other-value - - The value of the instance variable "project" of Person p1 - is now the list "some-other-value ::project1" - - - Type Checking - ========= - - Attribute slots can have types assigned which are tested - whenever the instance variable is altered. The slot "salary" - is defined as integer whereas "projects" is defined to - be a list of instances of the class Project (a list, since - "projects" is defined as multivalued). - - Class Person -slots { - Attribute name - Attribute salary -default 0 -type integer - Attribute projects -default {} -multivalued true -type ::Project - } - - Person p2 -name "Sue" -salary 1000 - - The slot types are checked via Tcl variable traces. This means - that the values are enforced now matter how the variables - are accessed. The checks are performed in the following - two commands, and they will throw an error in the second - command, since "1100x" is not an integer. - - p2 incr salary 100 - p2 append salary x - - similarly the second command below will through - an error, since some-other-value is not an instance - of ::Project. - - p2 projects add ::project1 - p2 projects add some-other-value - - When a check throws an error, the instance variables - are reset to the previous value. To restore the original - value, an associative array "__oldvalue()" is kept as - instance variable in the object. - - In general, checking of variables can be turned off globally - by "::xotcl::Slot instmixin add ::xotcl::Slot::Nocheck". - It can be turned off selectively for each slot via - a per-object-mixin; if attributes are subclassed, - it is possible to register the "Nocheck" mixin on a - subclass of Attribute. - - procsearch returns for forwarders now "forward" or "instforward", - for parametercmds now "parametercmd" or "instparametercmd" - and for other commands "cmd" and "instcmd" - -info slots -TODO slow -superclass -TODO king of the bongo - - + improved forwarding ... expr earlybinding - %argclindex - - + improved serializer - - handling of slot dependencies - - - - - - * Improved code quality: - + fixed a bug with nonpositional arguments, some - positional arguments and "args" - + fixed a bug in nonpositional arguments when called without - arguments - + improved error messages in connection with nonpositional arguments - + more regression tests added - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.5.0 =================================================================== diff -u -N --- xotcl/doc/Announce-1.5.0 (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/doc/Announce-1.5.0 (revision 0) @@ -1,232 +0,0 @@ -Announcing XOTcl 1.5.0 -************************* - -Hi everybody. We are pleased to announce the availability of XOTcl 1.5.0. -Major changes relative to 1.4.0 are: - - * Improved Functionality - - + The C-level implementation of XOTcl creates now the basic - classes ::xotcl::Object and ::xotcl::Class completely without - any methods. All predefined methods are now registered from - the initialization script-code (predefined.xotcl) via the new - command - - ::xotcl::alias | \ - ?-objscope? ?-per-object? - - which is used for registering predefined Tcl commands as - methods. These aliases are like zero cost forwarders, since - they lookup the function pointer from the commands and used - these in the methods. - - This change makes it possible to register the same command - on different classes (with maybe different names), such that - for example the predefined set method of ::xotcl::Object can - be replaced with a different method and the set method can - be registered on some other classes (maybe some application - classes). - - This change makes it as well quite easy to develop some - other object oriented languages based on the XOTcl - framework, since all methods can be rearrange from the Tcl - layer . - - - + Slots - - A slot is a meta-object that manages property-changes of - objects. A property is either an attribute or a role of an - relation. - - In a nutshell, a slot has among other attributes - - a name (which it used to access it), - - a domain (object or class on which it can be used) , and - - can be multivalued or not - - Every slot defines a uniform interface to access its - content. So has for example, every multivalued slot a - method "add" to add a value to the list of values and a - method "remove" to remove it again. - - We distinguish between system slots (predefined slots like - class, superclass, mixin, instmixin, filter, instfilter) and - application slots (e.g. attributes of classes). - - System Slots - ======== - - System slots are predefined slots defining e.g. some relations - between classes, or between objects and classes. - - The predefined system slots are: - - superclass: every class in XOTcl has one or more superclasses. - The name of this slot is "superclass", the domain is "::xotcl::Class", - the slot is multivalued. One object might have multiple superclasses. - - class: every object has a class; therefore, the domain of the slot - is "::xotcl::Class", the property is not multivalued. - - mixin: every object in XOTcl can have one or more mixin classes. - The name of this slot is "mixin", the domain is "::xotcl::Object", the slot is - multivalued. - - instmixin: same as above, but the domain is "::xotcl::Class" - - filter, instfilter: similar to "mixin" and "instmixin" - - Every slot can be used set and query the property from its domain. - The syntax for setting values is - newValue - and for getting its values is - set x [ ] - - Every multivalued slot has as well a method "add" and "remove" - - Examples for using the system slot "mixin" - - Object o; Class M; class N - o mixin ::M ;# replacing the per-object mixins of o with M - o mixin add ::N ;# add N to the front of the mixin list - o mixin delete ::M ;# delete M from the mixin list - puts [o mixin] ;# query the current mixin list - - - Attribute Slots - ========= - - Attribute slots are used to manage the setting and querying - of instance variables. We define now a person with three - attributes,"name", "salary" and "projects". - - Class Person -slots { - Attribute name - Attribute salary -default 0 - Attribute projects -default {} -multivalued true - } - - Examples for using the slots are - - Person p1 -name "Joe" - p1 projects add project1 - - Some additional features of the slots are: - - - Support for value checking for - * primitive types (all types from "string is", like integer, - boolean, ...) - * instances of Classes (e.g. value must be an instance - of Person) - * custom value checkers - * uniform interface for single and multi-valued slots - - - Support for lazy initialization (e.g. when costly - commands (like SQL) are used to initialize instance - variables, not all variables are used for each object) - - - more experimental low level functionality, like - * initcmd (executed, whenever the variable is read the first time) - * valuecmd (executed, whenever the variable is read) - * valuechangedcmd (executed, whenever the variable is altered) - - For more details, see http://media.wu-wien.ac.at/doc/tutorial.html#slots - - - + Re-implementation of the method "parameter" based on slots. - All forms except - ... -parameter {name1 {name2 default2}} ... - (I.e. pure accessor parameters and parameters with - defaults) are deprecated, since slots are the much more - powerful and orthogonal construct. - - The old c-based parameter support based on "parameterclass" - is deprecated. It is still in the C-code (the method "parameter" - is redefined in predefined.xotcl). If someone urgently needs - it, please remove the parameter instproc from predefined - for the time being, and write an email to me, in case - you really need it). The C code for parameter will be removed - in the next release. - - + Improved introspection though the procsearch method. This - method reports now in its second argument not only - [inst]proc but as well [inst]forward, [inst]parametercmd - and [inst]cmd (the latter for methods implemented in C. - - * Improved introspection through "info" - - new subcommand "info slots" - - implemented backwards bug-compatible "info parameter", - deprecated - - + Improved serializer - - better handling of cyclical dependencies, when mixins are involved - - fix for namespace handling to make the XOTcl communication - library classes working with the aolserver (thanks for Stefan Sobernig - for pointing this out) - - Now other ::xotcl::* objects can be included in the aolserver blueprint - (e.g. non positional argument handlers) - - handling of slot dependencies - - more convenient calling of the serializer: - Method "serialize" for Object is defined when the package xotcl::serializer - is loaded. - - + Improved forwarding commands - - New option for the argument substitution. When the argument - list of the forward command contains "%argclindex {a b c}", then - depending of the number of arguments at invocation "a", "b" - or "c" is substituted. If more arguments are used at the invocation - of the forwarder than values are contained in the list after %argclindex, - an error is generated. - - New options for forwarder: - * The option -earlybinding can be used to look - up the function pointer of the called Tcl command at - definition time of the forwarder instead of invocation time. - This option should only be used for calling C-implemented Tcl commands) - * The option -verbose prints the substituted command in the forwarder - prior to invocation. - - + New snit-like utility functions: - - ::xotcl::myvar varName: return the fully qualified variable name - of the specified variable. - - ::xotcl::myproc methodName ?args?: call an xotcl method without the need - of using "[list [self] methodName ...]" - Both commands are namespace exported - - + added "subst" to the set of Tcl imported methods (like e.g. incr, append, ...) - On can do now: - % Object o - ::o - % o subst {I am [self]} - I am ::o - - + added new method for ::xotcl::Object named "contains": - This method is essentially a value added back-port - of the OpenACS version. It allows to create a nested - object structure with little syntactic overhead. See tutorial - or language reference for more details. - - * Improved code quality: - + fixed a bug with nonpositional arguments, some - positional arguments and "args" - + fixed a bug in nonpositional arguments when called without - arguments - + tested with Tcl 8.4.13 and 8.5a4 - + improved error messages in connection with nonpositional arguments - + fixed a bug in the xotcl trace module (many thanks to jima for reporting) - + fixed a namespace bug in ::xotcl::package require in connection with xotclide - (many thanks to Bill Paulsen and Artur Trzewik for identifying the problem and - suggesting a fix) - + improved documentation (e.g. new sections added, - some sections deleted, spelling improved, in total 8 pages longer) - + fixed documentation bugs (many thanks for Kristoffer for reporting) - + more regression tests added - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.5.1 =================================================================== diff -u -N --- xotcl/doc/Announce-1.5.1 (revision 9620bd8d134f2f6c30fc0d32c769c8a84c6c597b) +++ xotcl/doc/Announce-1.5.1 (revision 0) @@ -1,67 +0,0 @@ -Announcing XOTcl 1.5.1 -************************* - -Hi everybody. We are pleased to announce the availability of XOTcl 1.5.1. -Major changes relative to 1.5.0 are: - - * Improved Functionality - - + Improved interface to develop XOTcl methods in C - (Many thanks to Scott Gargash for the constructive discussions - and suggestions). - - New functions imported through the XOTcl's stub interface: - - XOTclNextCmd() - - XOTclCallMethodWithArgs - - New constant XOTCL_NONLEAF_METHOD to allow C-implemented - methods to call next. This constant can be passed as 5th - argument to XOTclAddIMethod (or ...AddPMethod). The - following is a short example for defining and registering - a C-implemented constructor "init" to a class. - - static int MyClassInit( ClientData cdata, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[] ) { - int rc; - /*** before next ***/ - rc = XOTclNextObjCmd(cdata, interp, objc,objv); - /*** after next ***/ - return rc; - } - ... - MyClass = XOTclGetClass(interp, "MyClass" ); - XOTclAddIMethod(interp, MyClass, "init", MyClassInit, - XOTCL_NONLEAF_METHOD, 0 ); - - - * Improved code quality: - + fixed a bug with the backward-compatible and deprecated - "setter" interface (many thanks to Manfred Stelzhammer for - reporting the bug) - + fixed a bug in parsing nonpositional arguments, when - e.g. square brackets are used in type declarations for - parameters (Many thanks to Stefan Sobernig for reporting) - + fixed autoname crash under Windows NT (Many thanks to Mark - Janssen for reporting and providing a patch) - + fixed serializer to handle deeper stratification layers - + simplification and speedup of dispatcher - + Makefile.in improvements for genstubs - + Changed "test -e" to "test -f" in Makefile.in, since the - standard test command in Solaris does not understand - "test -e" (Many thanks to Andreas Kupries for reporting) - + improved 64-bit compatibility on POWER5+ - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.5.2 =================================================================== diff -u -N --- xotcl/doc/Announce-1.5.2 (revision 9620bd8d134f2f6c30fc0d32c769c8a84c6c597b) +++ xotcl/doc/Announce-1.5.2 (revision 0) @@ -1,37 +0,0 @@ -Announcing XOTcl 1.5.2 -************************* - -Hi everybody. We are pleased to announce the availability of XOTcl 1.5.2. -Major changes relative to 1.5.2 are: - - * Improved Functionality - - + allowing to trace objects as well as classes via the - package xotcl::trace (many thanks to jima for suggesting this) - - * Improved code quality: - + terminating all vararg lists in C by ..., (char *) NULL - There was a problem with this on 64bit AMD on FreeBSD, - as some lists were terminated previously by an integer typed - zero-value. - + better handling of Tcl result objects. Make sure that - no changes happen on shared objects. Removed all - occurrences of Tcl_AppendResult() from xotcl.c - + Fixed memory corruption (accessing feed memory) in - the invalidation of transitive mixins (many thanks to - Don Porter for reporting) - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.5.3 =================================================================== diff -u -N --- xotcl/doc/Announce-1.5.3 (revision 9620bd8d134f2f6c30fc0d32c769c8a84c6c597b) +++ xotcl/doc/Announce-1.5.3 (revision 0) @@ -1,38 +0,0 @@ -Announcing XOTcl 1.5.3 -************************* - -Hi everybody. We are pleased to announce the availability of XOTcl 1.5.3. -Major changes relative to 1.5.2 are: - - * Improved code quality: - - + provided compatibility with Tcl 8.5 - - + provided compatibility with Tcl 8.4.14 - - (fixed a nasty bug caused by a change in tcl 8.4.14, could - led to a crash due to freed Tcl_Objs in OpenACS, allthough - the xotcl regression test passed correctly) - - + reduced calling overhead of methods with nonpositional - arguments by about 10 percent by avoiding shimmering. - - + fixed handling of "return -code break" from xotcl methods - (thanks to Artur Trzewik for the bug report) - - + library/comm/Access.xotcl: fixed handling of chunked encoding - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.5.4 =================================================================== diff -u -N --- xotcl/doc/Announce-1.5.4 (revision 9620bd8d134f2f6c30fc0d32c769c8a84c6c597b) +++ xotcl/doc/Announce-1.5.4 (revision 0) @@ -1,46 +0,0 @@ -Announcing XOTcl 1.5.4 -************************* - -Hi everybody. We are pleased to announce the availability of XOTcl 1.5.4. -Originally, this release was planned as a small bug fix release. However, -the total size of the (unified) diff between 1.5.3 and 1.5.4 is more -than 5000 lines, mostly due to the varRefom changes (see first -item below). - -Major changes relative to 1.5.4 are: - - * Improved code quality: - - + provided compatibility with Tcl 8.5 - (currently, this requires the verison of Tcl 8.5 - from CVS head, including the changes for VarReform - (For details, see http://groups.google.at/group/comp.lang.tcl/browse_frm/thread/bff391a7f1bd8f6c/3f214d088a28ed13?hl=de#3f214d088a28ed13) - - + improved serializer - (handling var traces for instances variables) - - + several small bug-fixes - (e.g. fixing empty variable names, error message - propagation for configure, fixing potential crashes, - when namespaces are added to objects during - eval, etc.) - - + improved portablility for more platforms - (more portable shell tests for e.g. FreeBSD) - - + extended regression test - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - - -Best regards, - -Gustaf Neumann -Uwe Zdun - - Index: xotcl/doc/Announce-1.5.5 =================================================================== diff -u -N --- xotcl/doc/Announce-1.5.5 (revision 9620bd8d134f2f6c30fc0d32c769c8a84c6c597b) +++ xotcl/doc/Announce-1.5.5 (revision 0) @@ -1,44 +0,0 @@ -Dear XOTcl Community, - -XOTcl 1.5.5 is available. The main change is to achieve binary compatibility -between Tcl 8.5 and XOTcl compiled with Tcl 8.4. This is essential achieved -through a small emulation layer based on C-structures that will be available -in Tcl 8.5. - -best regards --gustaf neumann - -Announcing XOTcl 1.5.5 -************************* - -We are pleased to announce the availability of XOTcl 1.5.5. - -Major changes relative to 1.5.4 are: - - * Improved binary compatibility: - - It is now possible to load XOTcl compiled for Tcl 8.4 - into a tclsh8.5 (again, substantial change). - - One can now test now 4 versions: - a) a native version for Tcl 8.4 (without compatibility layer) - b) a native version for Tcl 8.5 - c) a version compiled for Tcl 8.4 with compatibility layer in tclsh8.4 - d) a version compiled for Tcl 8.4 with compatibility layer in tclsh8.5 - - Tests showed that the overhead is for the compatibility - layer is between 1.1% and 2.3%, the difference between - tcl8.5 and tcl8.4 is much larger. - - The forward compatibility behavior behavior can be turned off by setting - FORWARD_COMPATIBLE to 0 during compilation (xotcl.h) to get - a small performance improvement. - - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - Index: xotcl/doc/Announce-1.5.6 =================================================================== diff -u -N --- xotcl/doc/Announce-1.5.6 (revision 9620bd8d134f2f6c30fc0d32c769c8a84c6c597b) +++ xotcl/doc/Announce-1.5.6 (revision 0) @@ -1,51 +0,0 @@ -Dear XOTcl Community, - -XOTcl 1.5.6 is available. This version is mostly a fix release for -some problems that were apparently quite long in the code and could -cause crashes for threaded applications. - -best regards --gustaf neumann - -Announcing XOTcl 1.5.6 -************************* - -We are pleased to announce the availability of XOTcl 1.5.6. - -Major changes relative to 1.5.4 are: - - * Fixes for treating global volatile objects (many thanks to Zoran - for his concise reports). The problem was that XOTcl uses - C-level var traces containing object pointers to objects. - If for some reason, these objects are destroyed earlier, this - results in dangling references. This problem caused especially - problems in the automatic cleanup of variables at the end - of a thread. - - * Fix for Tcl 8.4.* for situations, where Tcl variables - contained references to deleted XOTcl objects. The problem - was introduced by the VarReform changes between 1.5.3 and - 1.5.4 by a bad side effect of a Tcl_Obj based command - to look up Tcl command structurs. The problem did not - exist for xotcl compiled against Tcl 8.5 and is as well - fixed on the Tcl side in CVS (might become available, - when one more Tcl 8.4 release is eventually released) - - * Serializer: - - Added dependency rule in serializer to ensure slots of - super-classes are listed before subclasses. (Thanks to Stefan - Sobernig for reporting the problem) - - - Moved deactivation of traces into "Serializer all" - to get simpler results on "o serialize". - - * Extended regression tests - - - For more details about the changes, please consult the ChangeLog and - documentation. - -MORE INFO - General and more detailed information about XOTcl and its components - can be found at http://www.xotcl.org - Index: xotcl/doc/JufGdbmStorage-xotcl.html =================================================================== diff -u -N --- xotcl/doc/JufGdbmStorage-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/JufGdbmStorage-xotcl.html (revision 0) @@ -1,45 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/store/JufGdbmStorage.xotcl - - - -

    - ./library/store/JufGdbmStorage.xotcl - ./library/store/JufGdbmStorage.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::store::jufgdbm 0.81 -
    - Package required: xotcl::store::juf_gdbm -
    - Package required: xotcl::store -
    -
    - Filename: - - ./library/store/JufGdbmStorage.xotcl - -
    -
    - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/MemStorage-xotcl.html =================================================================== diff -u -N --- xotcl/doc/MemStorage-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/MemStorage-xotcl.html (revision 0) @@ -1,43 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/store/MemStorage.xotcl - - - -

    - ./library/store/MemStorage.xotcl - ./library/store/MemStorage.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::store::mem 0.84 -
    - Package required: xotcl::store 0.84 -
    -
    - Filename: - - ./library/store/MemStorage.xotcl - -
    -
    - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/MultiStorage-xotcl.html =================================================================== diff -u -N --- xotcl/doc/MultiStorage-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/MultiStorage-xotcl.html (revision 0) @@ -1,43 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/store/MultiStorage.xotcl - - - -

    - ./library/store/MultiStorage.xotcl - ./library/store/MultiStorage.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::store::multi 0.9 -
    - Package required: xotcl::store 0.84 -
    -
    - Filename: - - ./library/store/MultiStorage.xotcl - -
    -
    - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/Persistence-xotcl.html =================================================================== diff -u -N --- xotcl/doc/Persistence-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/Persistence-xotcl.html (revision 0) @@ -1,365 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/store/Persistence.xotcl - - - -

    - ./library/store/Persistence.xotcl - ./library/store/Persistence.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::store::persistence 0.8 -
    - Package required: xotcl::trace -
    - Package required: xotcl::package -
    - Package required: xotcl::mixinStrategy -
    - Package required: xotcl::store -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./library/store/Persistence.xotcl - -
    -
    - - - - - -
    - Description: - - - Persistent store for XOTcl objects with Eager and Lazy persistence. - Take a look at "persistenceExample.xotcl" for exmaple of usage. - -
    -
    -
    -

    - - - -

    Class: PersistenceMgr

    - Class: Class -
    - - - - - - - -
    - Description: - - - A persistent store requires a persistent manager. The persistent - manager implements the Storage interface via storage mixin. With - the parameter "dbPackage" we can specify which storage will be used. - The persistent manager than tries to load the package - "xotcl::${dbPackage}Storage". Default is Sdbm. - - Example: -
    -    PersistenceMgr pmgr -persistenceDir . -persistenceFile example-db
    -    
    - - -
    -

    -
    -

    - - - -

    Class: Persistent

    - Class: Class -
    - Procs/Instprocs: - makeVarScript, persistenceMgr, persistent, persistent+init, persistentVars, unPersistent. - - - - - -
    - Description: - - - Superclass or mixin class for all persistent objects. Normally - subclasses are used as mixins or instmixins on object, like: -
    -      o mixin Persistent=Eager
    -      p mixin Persistent=Lazy
    -    
    - -
    -

    Instprocs

    -
      -
    • - - - - persistenceMgr - args - - - - - - - - - - -
      - Arguments: - - args: persistent manager name -
      - Description: - - - Specify which persistence manager to use for [self] object, like: -
      -      o persistenceMgr pmgr
      -    
      - Each persistent object must have a persistence manager specified, - before vars can be made persistent. - -
      -
    • -
    • - - - - persistentVars - - - - - - -
      - Description: - - - Returns list of persistent vars. - -
      -
    • -
    • - - - - persistent - list - - - - - - - - - - -
      - Arguments: - - list: persistent variables -
      - Description: - - - Make a list of object variables persistent. If a persistent - DB exists, the values are read from this DB, overwriting the current value. - E.g.: -
      -     o persistent {x y}
      -    
      - - -
      -
    • -
    • - - - - persistent+init - list - - - - - - - - - - -
      - Arguments: - - list: persistent variables -
      - Description: - - - Initialize all data in the list as empty strings, - if they do not exist yet, and then make them persistent - using the 'persistent' method - -
      -
    • -
    • - - - - unPersistent - list - - - - - - - - - - -
      - Arguments: - - list: persistent variables -
      - Description: - - - Make a list of object variables not persistent. - -
      -
    • -
    • - - - - makeVarScript - - - - - - -
      - Description: - - - Build a Tcl script of "set ..." statements reflecting the current situation in the database. - -
      -
    • -
    -

    -
    -

    - - - -

    Class: Persistent=Eager

    - Class: Class -
    - - - - - - - -
    - Description: - - - Eager persistence strategy. Store everything at the same moment to the database - -
    -

    -
    -

    - - - -

    Class: Persistent=Lazy

    - Class: Class -
    - - - - - - - -
    - Description: - - - Lazy persistence strategy. Store everything on object destroy (or program termination. - -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/Script-xotcl.html =================================================================== diff -u -N --- xotcl/doc/Script-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/Script-xotcl.html (revision 0) @@ -1,92 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/Script.xotcl - - - -

    - ./library/lib/Script.xotcl - ./library/lib/Script.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::script 0.9 -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./library/lib/Script.xotcl - -
    -
    - - - - - -
    - Description: - - - A small package to instantiate an object, that - represents a script. - -
    -
    -
    -

    - - - -

    Class: Script

    - Class: Class -
    - - - - - - - -
    - Description: - - - An object of type Script becomes automatically the command - line arguments evaluated as "-" method calls during creation, e.g. -
    -      Script s -set r 5
    -    
    - and a call with cmd-line "-set v 6" of the script, results in an - object s with two vars set: r to 5, and v to 6. - -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/Serializer-xotcl.html =================================================================== diff -u -N --- xotcl/doc/Serializer-xotcl.html (revision 9722a51911e1502444c173306c8c88f7f3888989) +++ xotcl/doc/Serializer-xotcl.html (revision 0) @@ -1,278 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/serialize/Serializer.xotcl - - - -

    - ./library/serialize/Serializer.xotcl - ./library/serialize/Serializer.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl 1.0 -
    - Package provided: xotcl::serializer 0.4 -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./library/serialize/Serializer.xotcl - -
    -
    - - - - - - - - - - - - - -
    - Description: - - - This package provides the class Serializer, which can be used to - generate a snapshot of the current state of the workspace - in the form of XOTcl source code. - -
    - Authors: - - - Gustaf Neumann, Gustaf.Neumann@wu-wien.ac.at - -
    - Date: - - $Date: 2004/07/02 11:22:31 $ -
    -
    -
    -

    - - - -

    Class: Serializer

    - Procs/Instprocs: - all, deepSerialize, serialize. - -
    -

    Instprocs

    -
      -
    • - - - - serialize - entity - - - - - - - - - - - - - - -
      - Arguments: - - entity: Object or Class -
      - Description: - - - Serialize the specified object or class. - -
      - Return: - - Object or Class with all currently defined methods, - variables, invariants, filters and mixins -
      -
    • -
    -

    Procs

    -
      -
    • - - - - all - ?-ignoreVarsRE RE? - ?-ignore obj1 obj2 ...? - - - - - - - - - - - - - - - - - - -
      - Arguments: - - ?-ignoreVarsRE RE?: provide regular expression; matching vars are ignored -
      - - - ?-ignore obj1 obj2 ...?: provide a list of objects to be omitted -
      - Description: - - - Serialize all objects and classes that are currently - defined (except the specified omissions and the current - Serializer object). -

      Examples:
      - Serializer all -ignoreVarsRE {::b$}
      - do not serialize any instance variable named b (of any object)

      - Serializer all -ignoreVarsRE {^::o1::.*text.*$|^::o2::x$}
      - do not serialize any variable of c1 whose name contains - the string "text" and do not serialze the variable x of o2

      - Serializer all - ignore obj1 obj2 ...
      - do not serizalze the specified objects - -

      - Return: - - script -
      -
    • -
    • - - - - deepSerialize - objs - ?-ignoreVarsRE RE? - ?-ignore obj1 obj2 ...? - ?-map list? - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - Arguments: - - objs: Objects to be serialized -
      - - - ?-ignoreVarsRE RE?: provide regular expression; matching vars are ignored -
      - - - ?-ignore obj1 obj2 ...?: provide a list of objects to be omitted -
      - - - ?-map list?: translate object names in serialized code -
      - Description: - - - Serialize object with all child objects (deep operation) - except the specified omissions. For the description of - ignore and igonoreVarsRE see - Serizalizer all. map can be used - in addition to provide pairs of old-string and new-string - (like in the tcl command string map). This option - can be used to regenerate the serialized object under a different - object or under an different name, or to translate relative - object names in the serialized code.

      - - Examples: - Serializer deepSerialize ::a::b::c -map {::a::b ::x::y}
      - Serialize the object c which is a child of a::b; - the object will be reinitialized as object ::x::y::c, - all references ::a::b will be replaced by ::x::y.

      - - Serializer deepSerialize ::a::b::c -map {::a::b [self]}
      - The serizalized object can be reinstantiated under some current object, - under which the script is evaluated.

      - - Serializer deepSerialize ::a::b::c -map {::a::b::c ${var}}
      - The serizalized object will be reinstantiated under a name specified - by the variable var in the recreation context. - -

      - Return: - - script -
      -
    • -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/Storage-xotcl.html =================================================================== diff -u -N --- xotcl/doc/Storage-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/Storage-xotcl.html (revision 0) @@ -1,397 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/store/Storage.xotcl - - - -

    - ./library/store/Storage.xotcl - ./library/store/Storage.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::store 0.84 -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./library/store/Storage.xotcl - -
    -
    - - - - - - - - - -
    - Description: - - - Simple generic storage interface for hashtable-like (persistent) - storages. There are several different existing stores, including - a memory storage, a GDBM storage, a SDBM storage, and a - TextFile storage. - -
    - Date: - - $Date: 2004/05/23 22:50:39 $ -
    -
    -
    -

    - - - -

    Class: Storage

    - Class: Class -
    - Procs/Instprocs: - close, exists, firstkey, names, nextkey, open, set, someNewChildStore, unset. - - - - - -
    - Description: - - - Abstract storage interface class (superclass of all storages). - -
    -

    Instprocs

    -
      -
    • - - - - open - filename - - - - - - - - - - - - - - -
      - Arguments: - - filename: database filename (or filename base, if more - than one file has to be created) -
      - Description: - - - Each storage object represents exactly one database table. The db - has to be opened, before it can it used. If it is not opened all - other methods return errors. - -
      - Return: - - empty string -
      -
    • -
    • - - - - close - - - - - - - - - - -
      - Description: - - - Close associated database. - -
      - Return: - - empty string -
      -
    • -
    • - - - - exists - key - - - - - - - - - - - - - - -
      - Arguments: - - key: Key to be searched for. -
      - Description: - - - Search for a key whether it exists or not. - -
      - Return: - - 1, if key exists in the database, otherwise 0 -
      -
    • -
    • - - - - set - key - ?value? - - - - - - - - - - - - - - - - - - -
      - Arguments: - - key: Key to be set. -
      - - - ?value?: Optional value that might be set -
      - Description: - - - Set or query a database key in the same way as Tcl's set functions. - -
      - Return: - - Key value. -
      -
    • -
    • - - - - unset - key - - - - - - - - - - - - - - -
      - Arguments: - - key: Key to be unset. -
      - Description: - - - Unset a database key in the same way as Tcl's unset functions. - -
      - Return: - - empty string -
      -
    • -
    • - - - - names - - - - - - - - - - -
      - Description: - - - Return a list of keys in the database (functions in the same - way as Tcl's array names) - -
      - Return: - - List of keys in the db. -
      -
    • -
    • - - - - firstkey - - - - - - - - - - -
      - Description: - - - Start a traversal of the database, starting with any key. - -
      - Return: - - Name of first key. -
      -
    • -
    • - - - - nextkey - - - - - - - - - - -
      - Description: - - - Proceed with the db traversal. Requires a firstkey before - first usage, otherwise it returns an error. - -
      - Return: - - Name of next key, if one exists. Otherwise an empty string is returned. -
      -
    • -
    -

    Procs

    -
      -
    • - - - - someNewChildStore - - - - - - - - - - -
      - Description: - - - Create a childStore according to a preference list depending on - which storages are available. Currently the preference list has - the following order: Gdbm, Sdbm and TextFile. - -
      - Return: - - name of the created storage object. -
      -
    • -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/TclGdbmStorage-xotcl.html =================================================================== diff -u -N --- xotcl/doc/TclGdbmStorage-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/TclGdbmStorage-xotcl.html (revision 0) @@ -1,45 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/store/TclGdbmStorage.xotcl - - - -

    - ./library/store/TclGdbmStorage.xotcl - ./library/store/TclGdbmStorage.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::store::tclgdbm 0.84 -
    - Package required: xotcl::store::gdbm -
    - Package required: xotcl::store -
    -
    - Filename: - - ./library/store/TclGdbmStorage.xotcl - -
    -
    - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/TextFileStorage-xotcl.html =================================================================== diff -u -N --- xotcl/doc/TextFileStorage-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/TextFileStorage-xotcl.html (revision 0) @@ -1,43 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/store/TextFileStorage.xotcl - - - -

    - ./library/store/TextFileStorage.xotcl - ./library/store/TextFileStorage.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::store::textfile 0.84 -
    - Package required: xotcl::store -
    -
    - Filename: - - ./library/store/TextFileStorage.xotcl - -
    -
    - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/UNIVERSAL-xotcl.html =================================================================== diff -u -N --- xotcl/doc/UNIVERSAL-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/UNIVERSAL-xotcl.html (revision 0) @@ -1,71 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/actiweb/univ/UNIVERSAL.xotcl - - - -

    - ./apps/actiweb/univ/UNIVERSAL.xotcl - ./apps/actiweb/univ/UNIVERSAL.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    - Package required: xotcl::actiweb::webDocument -
    - Package required: xotcl::rdf::parser -
    - Package required: xotcl::rdf::triple -
    - Package required: xotcl::xml::printVisitor -
    -
    - Filename: - - ./apps/actiweb/univ/UNIVERSAL.xotcl - -
    -
    - - - - - -
    - Description: - - - This is a demo of a Webserver that presents the contents of - an RDF source file in a friendly and easy readable manner. -

    - The RDF file is parsed first into triples which - are added to the resource database RDFdb. This RDFdb used in this - example replaces the standard triple database of xoRDF by an - application specific version, which is easier to process. The triple - database is the source of the Catalog, which displays a short, easy to read - summary of the entries. The database is used as well for the "detailed - view", which presents all the data of the triples through nested HTML tables. -

    - The demo program uses either HTTP or HTTPS (in which case you will require - the SSL/TLS extension of Tcl). - -

    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/adapter-xotcl.html =================================================================== diff -u -N --- xotcl/doc/adapter-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/adapter-xotcl.html (revision 0) @@ -1,53 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/scripts/adapter.xotcl - - - -

    - ./apps/scripts/adapter.xotcl - ./apps/scripts/adapter.xotcl

    -
    -

    -

    Package/File Information

    - No package provided/required -
    -
    - Filename: - - ./apps/scripts/adapter.xotcl - -
    -
    - - - - - -
    - Description: - - - Simple adapter pattern meta-class taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/adapterExample-xotcl.html =================================================================== diff -u -N --- xotcl/doc/adapterExample-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/adapterExample-xotcl.html (revision 0) @@ -1,53 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/scripts/adapterExample.xotcl - - - -

    - ./apps/scripts/adapterExample.xotcl - ./apps/scripts/adapterExample.xotcl

    -
    -

    -

    Package/File Information

    - No package provided/required -
    -
    - Filename: - - ./apps/scripts/adapterExample.xotcl - -
    -
    - - - - - -
    - Description: - - - Simple adapter pattern example class (FTP requests) taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/cascaded-message-filter.gif =================================================================== diff -u -N -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -rc72f9f638677608fab1502cd696c8f2d6b2952f9 Binary files differ Index: xotcl/doc/changeXOTclVersion-xotcl.html =================================================================== diff -u -N --- xotcl/doc/changeXOTclVersion-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/changeXOTclVersion-xotcl.html (revision 0) @@ -1,41 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/changeXOTclVersion.xotcl - - - -

    - ./library/lib/changeXOTclVersion.xotcl - ./library/lib/changeXOTclVersion.xotcl

    -
    -

    -

    Package/File Information

    - No package provided/required -
    -
    - Filename: - - ./library/lib/changeXOTclVersion.xotcl - -
    -
    - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/composite-xotcl.html =================================================================== diff -u -N --- xotcl/doc/composite-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/composite-xotcl.html (revision 0) @@ -1,53 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/scripts/composite.xotcl - - - -

    - ./apps/scripts/composite.xotcl - ./apps/scripts/composite.xotcl

    -
    -

    -

    Package/File Information

    - No package provided/required -
    -
    - Filename: - - ./apps/scripts/composite.xotcl - -
    -
    - - - - - -
    - Description: - - - Simple composite pattern meta-class taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/compositeExample-xotcl.html =================================================================== diff -u -N --- xotcl/doc/compositeExample-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/compositeExample-xotcl.html (revision 0) @@ -1,54 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/scripts/compositeExample.xotcl - - - -

    - ./apps/scripts/compositeExample.xotcl - ./apps/scripts/compositeExample.xotcl

    -
    -

    -

    Package/File Information

    - No package provided/required -
    -
    - Filename: - - ./apps/scripts/compositeExample.xotcl - -
    -
    - - - - - -
    - Description: - - - Simple Graphics example of the composite pattern taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. They demonstrate instfilters, - filter chains and filter inheritance. - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/features.gif =================================================================== diff -u -N -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -rc72f9f638677608fab1502cd696c8f2d6b2952f9 Binary files differ Index: xotcl/doc/filter-inheritance.gif =================================================================== diff -u -N -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -rc72f9f638677608fab1502cd696c8f2d6b2952f9 Binary files differ Index: xotcl/doc/ftp-xotcl.html =================================================================== diff -u -N --- xotcl/doc/ftp-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/ftp-xotcl.html (revision 0) @@ -1,51 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/comm/ftp.xotcl - - - -

    - ./apps/comm/ftp.xotcl - ./apps/comm/ftp.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    - Package required: xotcl::comm::ftp -
    -
    - Filename: - - ./apps/comm/ftp.xotcl - -
    -
    - - - - - -
    - Description: - - A tiny FTP client -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/htmllib-xotcl.html =================================================================== diff -u -N --- xotcl/doc/htmllib-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/htmllib-xotcl.html (revision 0) @@ -1,74 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/htmllib.xotcl - - - -

    - ./library/lib/htmllib.xotcl - ./library/lib/htmllib.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::htmllib 0.1 -
    - Package required: XOTcl -
    -
    - Filename: - - ./library/lib/htmllib.xotcl - -
    -
    - - - - - - - - - - - - - -
    - Description: - - - This package provides the class HtmlBuilder, which can be used to - generate HTML documents, or a part of a document. - -
    - Authors: - - - Antti Salonen, as@fishpool.fi - -
    - Date: - - - $Date: 2004/05/23 22:50:39 $ - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/index.html =================================================================== diff -u -N --- xotcl/doc/index.html (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/doc/index.html (revision 0) @@ -1,35 +0,0 @@ - - -The Extended Object Tcl (XOTcl) Documentation contains the -following parts: - -

    XOTcl Language Documentation

    - - -

    Package and Script Documentation

    -
    - This section of the documentation is under work... -
    - - -

    - -

    Tcl Online Information

    - - - Index: xotcl/doc/langRef-xotcl.html =================================================================== diff -u -N --- xotcl/doc/langRef-xotcl.html (revision 9722a51911e1502444c173306c8c88f7f3888989) +++ xotcl/doc/langRef-xotcl.html (revision 0) @@ -1,3231 +0,0 @@ - - - - - XOTcl - Documentation -- ./doc/langRef.xotcl - - - -

    - ./doc/langRef.xotcl - ./doc/langRef.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: XOTcl-langRef 1.2 -
    - Package required: Tcl -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./doc/langRef.xotcl - -
    -
    - - - - - - - - - - - - - -
    - Description: - - - XOTcl language reference. Describes predefined objects and classes. - -
    - Predefined primitives: - - - XOTcl contains three predefined primitives: -

    - self computes callstack related information. - It can be used in the following ways: -

      -
    • self - returns the name - of the object, which is currently in execution. If it is - called from outside of a proc, it returns the - error message ``Can't find self''. -
    • self class - the self - command with a given argument class returns the name of the - class, which holds the currently executing instproc. Note, that this - may be different to the class of the current object. If it is called - from a proc it returns an empty string. -
    • self proc - the self command with a given argument - proc returns the name of the currently executing proc or - instproc. -
    • self callingclass: Returns class name of the - class that has called the executing method. -
    • self callingobject: Returns object name of - the object that has called the executing method. -
    • self callingproc: Returns proc name of - the method that has called the executing method. -
    • self calledclass: Returns class name of the - class that holds the target proc (in mixins and filters). -
    • self calledproc: Returns method - name of the target proc (only applicable - in a filter). -
    • self next: Return the - "next" method on the path as a string. -
    • self filterreg: In a filter: returns the name - of the object/class on which the filter is registered. Returns either - 'objName filter filterName' or 'className instfilter filterName'. - -
    • self callinglevel: Returns the calling level, from where - the actual proc was called from. Intermediary next calls are ignored - in this computation. The level is returned in a form - it can be used as first argument in uplevel or upvar. - -
    • self activelevel: Returns the level, from where - the actual proc was invoked from. This might be the calling level or a next - call, whatsever is higher in the stack. The level is returned in a form - it can be used as first argument in uplevel or upvar. - - -
    -

    - my someMethod is a short form for [self] someMethod and can only be - called in a context of an instproc or an method specific proc. It allows certain - optimizations and shorter to write. -

    - next executes the "next" method on the precedence - order and return with the result. -

    - - -
    - Date: - - $Date: 2004/07/02 11:22:31 $ -
    -
    -
    -

    - - - -

    Class: Class

    - Class: Class -
    - Heritage: Object -
    - Procs/Instprocs: - __unknown, alloc, create, info, instdestroy, instfilter, instfilterappend, instfilterguard, instinvar, instmixin, instmixinappend, instparametercmd, instproc, insttclcmd, new, parameter, parameterclass, recreate, superclass, unknown, volatile. - - - - - -
    - Description: - - - This meta-class holds the pre-defined methods available for all XOTcl - classes. - -
    -

    Instprocs

    -
      -
    • - - - - alloc - obj - ?args? - - - - - - - - - - - - - - - - - - -
      - Arguments: - - obj: new obj/class name -
      - - - ?args?: arguments passed to the new class after creation -
      - Description: - - - Allocate memory for a new XOTcl object or class. create uses - alloc to allocate memory. But create also - calls init and evaluates '-' arguments as method calls. - In seldom cases the programmer may want to suppress the - create - mechanism and just allocate memory. Then alloc can - be used. - -
      - Return: - - new class name -
      -
    • -
    • - - - - create - objName - ?args? - - - - - - - - - - - - - - - - - - -
      - Arguments: - - objName: name of a new class or object -
      - - - ?args?: arguments passed to the constructor -
      - Description: - - - Create user-defined classes or objects. If the class is a meta-class, - a class is created, otherwise an object. - - Create firstly calls alloc in order to allocate memory for the - new object. Then default values for parameters are searched on - superclasses (an set if found). Then args is searched for args - starting with '-' followed by an alpha character. These arguments - are called as methods. '-' followed by a numerical is interpreted - as a negative number (and not as a method). If a value of a method - called this way starts with a "a", the call can be placed safely - into a list (e.g. "Class c [-strangearg -a-] -simplearg 2"). - - Finally the constructor init is called on the object - with all arguments up to the first '-' arg.

      - - The create method is called implicitly through the - unknown - mechanism when a class (meta-class) is called with an unknown - method. E.g. the following two commands are equivalent - -

       Car herby -color red 
      -           Car create herby -color red 
      - - When a users may want to call the constructor init - before other '-' methods, one can specify '-init' - explicitly in the left to - right order of the '-' method. Init is called always only once. - e.g.:
       Class Car -init -superclass Vehicle 
      - -
      - Return: - - name of the created instance (result of alloc) -
      -
    • -
    • - - - - info - args - - - - - - - - - - - - - - -
      - Arguments: - - args: info options -
      - Description: - - - Introspection of classes. All options available for objects - (see info object) is also available - for classes. - The following options can be specified: -
        -
      • ClassName info classchildren ?pattern?: - Returns the list of nested classes with fully qualified names - if pattern was not specified, - otherwise it returns all class children where the class name - matches the pattern. - -
      • ClassName info classparent: - Returns the class ClassName is nesting to. - -
      • ClassName info instdefault method arg var: - Returns 1 if the argument arg of the instance method - method has a default value, otherwise 0. If it exists - the default value is stored in var. - -
      • ClassName info instfilter: - Returns the list of registered filters. With -guard modifier - all instfilterguards are integrated - ( ClassName info instfilter -guards). - -
      • objName info instfilterguard name: Returns the guards - for instfilter identified by name. - -
      • ClassName info heritage ?pattern?: - Returns a list of all classes in the precedence order - of the class hierarchy. - If pattern is specified, only matching values are returned. - -
      • ClassName info instances ?pattern?: - Returns a list of the instances of the class. - If pattern is specified, only matching values are returned. - -
      • ClassName info instargs method: - Returns the arguments of the specified method. - -
      • ClassName info instbody method: - Returns the body of the specified method. - -
      • ClassName info instcommands ?pattern?: - Returns all commands defined for the class. If pattern - is specified it returns all commands that match the pattern. - -
      • ClassName info instinvar: - Returns class invariants. - -
      • ClassName info instmixin: - Returns the list of instmixins of this class. - -
      • ClassName info instpost methodName: - Returns post assertions of methodName. - -
      • ClassName info instpre methodName: - Returns pre assertions of methodName. - -
      • ClassName info instprocs ?pattern?: - Returns all instprocs defined for the class. If pattern - is specified it returns all instprocs that match the pattern. - -
      • ClassName info parameter: - Returns parameter list. - -
      • ClassName info subclass ?subclassname?: - Returns a list of all subclasses of the class, if subclassname - was not specified, otherwise it returns 1 if subclassname is a - subclass and 0 if not. - -
      • ClassName info superclass ?superclassname?: - Returns a list of all super-classes of the class, - if superclassname was not specified, otherwise it returns - 1 if superclassname is a superclass and 0 if not. -
      - -
      - Return: - - Value of introspected option as a string. -
      -
    • -
    • - - - - instdestroy - obj - ?args? - - - - - - - - - - - - - - - - - - -
      - Arguments: - - obj: obj/class name -
      - - - ?args?: arguments passed to the destructor -
      - Description: - - - Standard destructor. Destroys XOTcl object physically from the memory. - Can be overloaded for customized destruction process. -

      - In XOTcl objects are not directly destroyed, when a destroy is - encountered in a method. Beforehand, the interpreter looks up whether - the object is still referenced on the method callstack or not. If not, - the object is directly destroyed. Otherwise every occurrence of the - object on the callstack is marked as destroyed. During popping of the - callstack, for each object marked as destroyed, the reference count is - decremented by one. When no more references to the object are on the - callstack the object is physically destroyed. This way we can assure - that objects are not accessed with [self] in running methods after - they are physically destroyed. - -

      - Return: - - empty string -
      -
    • -
    • - - - - instfilter - filterList - - - - - - - - - - - - - - -
      - Arguments: - - filterList: list of methods that should be registered as filters -
      - Description: - - - Specifies the list of filters registered for the class. - instfilter overwrites all previous setting. - Filters must be available on the class or its heritage - order. Filters may also reside on the meta-class of the class. - - Filter list may contain filter guards. Then the - filter is composed of two list elements: {filtername filterguard}. - -
      - Return: - - empty string -
      -
    • -
    • - - - - instfilterappend - filterList - - - - - - - - - - - - - - -
      - Arguments: - - filterList: name of the new instfilter -
      - Description: - - - Convenience method that appends an instfilter to the existing filters of the class. - -
      - Return: - - empty string -
      -
    • -
    • - - - - instfilterguard - filtername - guard - - - - - - - - - - - - - - - - - - -
      - Arguments: - - filtername: filter name of a registered filter -
      - - - guard: set of conditions to execute the filter -
      - Description: - - - Add conditions to guard a filter registration point. The filter - is only executed, if the guards are true. Otherwise we ignore the - filter. If no guards are given, we always execute the filter. - -
      - Return: - - empty string -
      -
    • -
    • - - - - instinvar - invariantList - - - - - - - - - - - - - - -
      - Arguments: - - invariantList: Body of invariants for the class -
      - Description: - - - Specify invariants for the class. These are inherited by - sub-classes. The invariants must hold for all instances. - All assertions are a list of ordinary Tcl conditions. - -
      - Return: - - empty string -
      -
    • -
    • - - - - instmixin - instmixinList - - - - - - - - - - - - - - -
      - Arguments: - - instmixinList: list of classes that should be registered as instmixins -
      - Description: - - - Specifies the list of instmixins (per-class mixins) for the class. - Note that the registration of a per-mixin-class does not invoke - automatically the constructors of the registered class. - The method instmixin overwrites any previous settings. - -
      - Return: - - empty string -
      -
    • -
    • - - - - instmixinappend - mixinList - - - - - - - - - - - - - - -
      - Arguments: - - mixinList: name of the new instmixin -
      - Description: - - - Convenience method that appends an instmixin to the existing mixins of the class. - -
      - Return: - - empty string -
      -
    • -
    • - - - - instparametercmd - name - - - - - - - - - - - - - - -
      - Arguments: - - name: variable to be provided with getter/setter method -
      - Description: - - - Add a getter/setter command for an instance variable with the - specified name. This method is used for example by the - parameter method. - Example:
      - Class C
      - C instparametercmd x
      - C c1 -x 100
      - puts [c1 x]
      - -
      - Return: - - empty string -
      -
    • -
    • - - - - instproc - name - args - body - ?preAssertion? - ?postAssertion? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - Arguments: - - name: instance method name -
      - - - args: instance method arguments -
      - - - body: instance method body -
      - - - ?preAssertion?: optional assertions that must hold before the proc executes -
      - - - ?postAssertion?: optional assertions that must hold after the proc executes -
      - Description: - - - Specify an instance method in the same style as Tcl specifies procs. - - Optionally assertions may be given. The number of args is either 3 or 5. - Therefore, to specify only post-assertions an empty pre-assertion list - must be given. All assertions are a list - of ordinary Tcl conditions. - -
      - Return: - - empty string -
      -
    • -
    • - - - - insttclcmd - name - - - - - - - - - - - - - - -
      - Arguments: - - name: cmd to be execute in obj scope -
      - Description: - - - Create a method 'name' that is evaluated as a tcl command in the - scope of the object. E.g. 'Object insttclcmd vwait' creates - an instproc vwait on Object that executes Tcl's vwait in the - scope of the object. That is local vars of the object are accessible - to that vwait. (Used to circumvent, for instance, the TCL_GLOBAL_ONLY - flag of vwait in Tcl.) - -
      - Return: - - empty string -
      -
    • -
    • - - - - new - ?-childof obj? ?args? - - - - - - - - - - - - - - -
      - Arguments: - - ?-childof obj? ?args?: args passed to create -
      - Description: - - - Convenience method to create an autonamed object. E.g.: -
       Http new 
      - creates ::xotcl::__#0, a subsequent call creates ::xotcl::__#1, ...
      - If -childof obj is specified, the new object is - created as a child of the specified object. - -
      - Return: - - new object name -
      -
    • -
    • - - - - parameter - parameterList - - - - - - - - - - - - - - -
      - Arguments: - - parameterList: list of parameter definitions -
      - Description: - - - Specify parameters automatically created for each instance. - Parameters denote instance variables which are available on each class instance - and that have a getter/setter method with their own name. - Parameters are specified in a parameter list of the form - {p1 p2 ... pn}. - p1 ... pn may either be parameter names or definitions of the form - {parameterName defaultValue}. - If a default value is given, that parameter - is created during creation process of the instance object, otherwise - only the getter/setter method is created (and the parameter does not - exist). The getter/setter method has the same name as the - parameter. It gets and returns the parameter, if no - argument is specified. With one argument, the parameter is set - to the argument value. - - Example: -
      -    Class Car -parameter {{doors 4} color}
      -    Car herby -doors 2 -color green
      -    
      - -
      - Return: - - empty string -
      -
    • -
    • - - - - parameterclass - class - - - - - - - - - - - - - - -
      - Arguments: - - class: parameter class name -
      - Description: - - - Set the parameter class. - The parameter class specifies how parameters are stored and - maintained internally. Per default, a method "default" is called, - to set the parameter with a default value. - - I.e., -
      -    Class Car -parameter {
      -      {doors 4}
      -    }
      -    
      - - is a short form for -
      -    Class Car -parameter {
      -      {doors -default 4}
      -    }
      -    
      - - For specialized parameter classes other methods can be called, e.g.
      -
       
      -    {doors -default 3 -updateWidget car}
      -    
      - -
      - Return: - - empty string -
      -
    • -
    • - - - - recreate - obj - ?args? - - - - - - - - - - - - - - - - - - -
      - Arguments: - - obj: obj to be recreated -
      - - - ?args?: arbitrary arguments -
      - Description: - - - Hook called upon recreation of an object. Performs standard object - initialization, per default. May be overloaded/-written. It calls - another method cleanup which handles actual cleanup of the object - during next. That means, if you overload recreate, in the pre-part - the object still contains its old state, after next it is cleaned up. - -
      - Return: - - obj name -
      -
    • -
    • - - - - superclass - classList - - - - - - - - - - - - - - -
      - Arguments: - - classList: list of classes -
      - Description: - - - Specify super-classes for a class. "superclass" changes the list - of superclasses dynamically to classList. - -
      - Return: - - empty string -
      -
    • -
    • - - - - unknown - ?args? - - - - - - - - - - - - - - -
      - Arguments: - - ?args?: arbitrary arguments -
      - Description: - - - Standard unknown mechanism. This mechanism is always triggered when - XOTcl does not know a method called on an object. Supposed that - there is no method with the called name, XOTcl looks up the method - "unknown" (which is found on the Class Object) and executes it. - The standard unknown-mechanism of XOTcl calls create with all - arguments stepping one step to the right; in the general case: - -
      ClassName create ClassName ?args?
      - - Unknown can be overloaded in user-defined subclasses of class. - -
      - Return: - - Standard unknown mechanism returns result of create -
      -
    • -
    • - - - - volatile - - - - - - - - - - - - - - - -
      - Arguments: - - : -
      - Description: - - - This method is used to specify that the object - should be deleted automatically, when the current - tcl-proc/object-proc/instproc is left. Example - set x [Object new -volatile] - -
      - Return: - - empty string -
      -
    • -
    -

    Procs

    -
      -
    • - - - - __unknown - name - - - - - - - - - - - - - - -
      - Arguments: - - name: name of class to be created -
      - Description: - - - This method is called, whenever XOTcl references a class, - which is not defined yet. In the following example: - Class C -superclass D - D is not defined. Therefore Class __unknown D - is called. This callback can be used to perform auto-loading - of classes. After this call, XOTcl tries again to - resolve D. If it succeeds, XOTcl will continue; otherwise, - an error is generated. - -
      - Return: - - empty string -
      -
    • -
    -

    -
    -

    - - - -

    Class: Object

    - Class: Class -
    - Procs/Instprocs: - abstract, append, array, autoname, check, class, cleanup, configure, copy, destroy, eval, exists, extractConfigureArg, filter, filterappend, filterguard, filtersearch, getExitHandler, hasclass, incr, info, instvar, invar, isclass, ismetaclass, ismixin, isobject, istype, lappend, mixin, mixinappend, move, noinit, parametercmd, proc, procsearch, requireNamespace, set, setExitHandler, trace, unset, uplevel, upvar, vwait. - - - - - -
    - Description: - - - This class holds the pre-defined methods available for all XOTcl - objects. All these methods are also available on classes. - -
    -

    Instprocs

    -
      -
    • - - - - abstract - methtype - methname - arglist - - - - - - - - - - - - - - - - - - - - - - -
      - Arguments: - - methtype: instproc or proc -
      - - - methname: name of abstract method -
      - - - arglist: arguments -
      - Description: - - - Specify an abstract method for class/object with arguments. - - An abstract method specifies an interface and - returns an error, if it is invoked directly. - Sub-classes or mixins have to override it. - -
      - Return: - - error -
      -
    • -
    • - - - - append - varName - args - - - - - - - - - - - - - - - - - - -
      - Arguments: - - varName: name of variable -
      - - - args: arguments to append -
      - Description: - - - Append all of the value arguments to the current value of variable - varName. Wrapper to the same named Tcl command - (see documentation of Tcl command with the same name for details). - -
      - Return: - - empty string -
      -
    • -
    • - - - - array - opt - array - ?args? - - - - - - - - - - - - - - - - - - - - - - -
      - Arguments: - - opt: array option -
      - - - array: array name -
      - - - ?args?: args of the option -
      - Description: - - - This method performs one of several operations on the variable - given by arrayName. It is a wrapper to the same named Tcl command - (see documentation of Tcl command with the same name for details). - -
      - Return: - - diverse results -
      -
    • -
    • - - - - autoname - ?<-instance>|<-reset>? - name - - - - - - - - - - - - - - - - - - -
      - Arguments: - - ?<-instance>|<-reset>?: Optional modifiers:
      - '-instance' makes the autoname start with a small letter.
      - '-reset' resets the autoname index to 0. -
      - - - name: base name of the autoname -
      - Description: - - - autoname creates an automatically assigned name. It is - constructed from the base name plus an index, that is - incremented for each usage. E.g.: -
      $obj autoname a
      - produces a0, a1, a2, ... - Autonames may have format strings - as in the Tcl 'format' command. - E.g.: -
      $obj autoname a%06d
      - produces a000000, a000001, a000002, ... - -
      - Return: - - newly constructed autoname value -
      -
    • -
    • - - - - check - options - - - - - - - - - - - - - - -
      - Arguments: - - options: none, one or more of: (?all? ?pre? ?post? ?invar? ?instinvar?) -
      - Description: - - - Turn on/off assertion checking. Options argument is the list - of assertions, that should be checked on the object automatically. - Per default assertion checking is turned - off. Examples: -
      -      o check {}; # turn off assertion checking on object o  
      -      o check all; # turn on all assertion checks on object o 
      -      o check {pre post}; # only check pre/post assertions 
      -      
      - info check introspects check options. - -
      - Return: - - empty string -
      -
    • -
    • - - - - class - newClass - - - - - - - - - - - - - - -
      - Arguments: - - newClass: new class name -
      - Description: - - - Changes the class of an object dynamically to newClass. - -
      - Return: - - empty string -
      -
    • -
    • - - - - cleanup - ?args? - - - - - - - - - - - - - - -
      - Arguments: - - ?args?: Arbitrary arguments passed to cleanup -
      - Description: - - - Resets an object or class into an initial state, as after construction. - Called during recreation process by the method 'recreate' - -
      - Return: - - empty string -
      -
    • -
    • - - - - configure - ?args? - - - - - - - - - - - - - - -
      - Arguments: - - ?args?: '-' method calls -
      - Description: - - - Calls the '-' methods. I.e. evaluates arguments and calls - everything starting with '-' (and not having a digit a - second char) as a method. Every list element until the next '-' - is interpreted as a method argument. configure is called - before the constructor during initialization and recreation. - E.g.
      Object o -set x 4
      - here: -
      o configure -set x 4
      - is executed. - - -
      - Return: - - number of the skipped first arguments -
      -
    • -
    • - - - - copy - newName - - - - - - - - - - - - - - -
      - Arguments: - - newName: destination of copy operation -
      - Description: - - - Perform a deep copy of the object/class (with all information, like - class, parameter, filter, ...) - to "newName". - -
      - Return: - - empty string -
      -
    • -
    • - - - - destroy - ?args? - - - - - - - - - - - - - - -
      - Arguments: - - ?args?: Arbitrary arguments passed to the destructor -
      - Description: - - - Standard destructor. - Can be overloaded for customized destruction process. Actual destruction - is done by instdestroy. "destroy" in principal does: -
      -      Object instproc destroy args {
      -        [my info class] instdestroy [self]
      -      }
      -      
      - -
      - Return: - - empty string -
      -
    • -
    • - - - - eval - args - - - - - - - - - - - - - - -
      - Arguments: - - args: cmds to eval -
      - Description: - - - Eval args in the scope of the object. That is local variables - are directly accessible as Tcl vars. - -
      - Return: - - result of cmds evaled -
      -
    • -
    • - - - - extractConfigureArg - al - name - ?cutTheArg? - - - - - - - - - - - - - - - - - - - - - - -
      - Arguments: - - al: Argument List Name -
      - - - name: Name of the Configure Argument to be extracted (should start with '-') -
      - - - ?cutTheArg?: if cutTheArg not 0, it cut from upvar argsList, default is 0 -
      - Description: - - - Check an argument list separated with '-' args, as for instance - configure - arguments, and extract the argument's values. Optionally, cut the - whole argument. - -
      - Return: - - value list of the argument -
      -
    • -
    • - - - - exists - var - - - - - - - - - - - - - - -
      - Arguments: - - var: variable name -
      - Description: - - - Check for existence of the named instance variable on the object. - -
      - Return: - - 1 if variable exists, 0 if not -
      -
    • -
    • - - - - filter - filterList - - - - - - - - - - - - - - -
      - Arguments: - - filterList: list of methods that should be registered as filters -
      - Description: - - - Specifies the list of filters registered for the class. - filter overwrites all previous setting. - Filters must be available on the class or its heritage - order. Filters may also reside on the meta-class of the class. - - Filter list may contain filter guards. Then the - filter is composed of two list elements: {filtername filterguard}. - -
      - Return: - - empty string -
      -
    • -
    • - - - - filterappend - filterList - - - - - - - - - - - - - - -
      - Arguments: - - filterList: name of the new filter -
      - Description: - - - Convenience method that appends a filter to the existing filters of the object. - -
      - Return: - - empty string -
      -
    • -
    • - - - - filterguard - filtername - guard - - - - - - - - - - - - - - - - - - -
      - Arguments: - - filtername: filter name of a registered filter -
      - - - guard: set of conditions to execute the filter -
      - Description: - - - Add conditions to guard a filter registration point. The filter - is only executed, if the guards are true. Otherwise we ignore the - filter. If no guards are given, we always execute the filter. - -
      - Return: - - an empty string -
      -
    • -
    • - - - - filtersearch - methodName - - - - - - - - - - - - - - -
      - Arguments: - - methodName: filter method name -
      - Description: - - - Search a full qualified method name that - is currently registered as a filter. Return a list of the - proc qualifier format: - 'objName|classname proc|instproc methodName'. - -
      - Return: - - full qualified name, if filter is found, otherwise an empty string -
      -
    • -
    • - - - - hasclass - ?className? - - - - - - - - - - - - - - -
      - Arguments: - - ?className?: name of a class to be tested -
      - Description: - - - Test whether the argument is either - a mixin or instmixin of the object or - if it is on the class hierarchy of the object. - This method combines the functionalities of - istype and ismixin. - -
      - Return: - - 1 or 0 -
      -
    • -
    • - - - - incr - varName - ?increment? - - - - - - - - - - - - - - - - - - -
      - Arguments: - - varName: variable name -
      - - - ?increment?: value to increment -
      - Description: - - - Increments the value stored in the variable whose name is varName. - The new value is stored as a decimal string in variable varName and also - returned as result. Wrapper to the same named Tcl command - (see documentation of Tcl command with the same name for details). - -
      - Return: - - new value of varName -
      -
    • -
    • - - - - info - args - - - - - - - - - - - - - - -
      - Arguments: - - args: info options -
      - Description: - - - Introspection of objects. The following options can be specified: -
        -
      • objName info args method: - Returns the arguments of the specified method. - -
      • objName info body method: - Returns the body of the specified method. - -
      • objName info class ?classname?: - Returns the name of the class of the current object, if classname was - not specified, otherwise it returns 1 if classname matches the - object's class and 0 if not. - -
      • objName info children ?pattern?: Returns the list of aggregated - objects with fully qualified names if pattern was not specified, - otherwise it returns all children where the object name matches the pattern. - -
      • objName info commands ?pattern: Returns all commands - defined for the object if pattern was not specified, otherwise - it returns all commands that match the pattern. - -
      • objName info default method arg var: Returns 1 if the - argument arg of the method method has a default - value, otherwise 0. If it exists the default value is stored in var. - -
      • objName info filter: Returns a list of filters. - With -guard modifier all filterguards are integrated - ( objName info filter -guards). With -order - modifier the order of filters (whole hierarchy) is printed. - -
      • objName info filterguard name: Returns the guards - for filter identified by name. - -
      • objName info hasNamespace: From XOTcl version 0.9 on, - namespaces - of objects are allocated on demand. hasNamespace returns 1, if the - object currently has a namespace, otherwise 0. The method - requireNamespace can - be used to ensure that the object has a namespace. - -
      • objName info info: Returns a list of all available info - options on the object. - -
      • objName info invar: Returns object invariants. - -
      • objName info metadata ?pattern?: - Returns available metadata options. - -
      • objName info methods: Returns the list of all method - currently reachable for objName. Includes procs, instprocs, cmds, - instcommands on object, class hierarchy and mixins. - Modifier -noprocs only returns instcommands, - -nocmds only returns procs. - Modifier -nomixins excludes search on mixins. - -
      • objName info mixin: Returns the list of mixins - of the object. With -order modifier the order of mixins - (whole hierarchy) is printed. - -
      • objName info parent: - Returns parent object name (or "::" for no parent), - in fully qualified form. - -
      • objName info post methodName: - Returns post assertions of methodName. - -
      • objName info pre methodName: - Returns pre assertions of methodName. - -
      • objName info procs ?pattern?: Returns all procs defined - for the object if pattern was not specified, - otherwise it returns all procs that match the pattern. - -
      • objName info vars ?pattern?: Returns all variables defined - for the object if pattern was not specified, otherwise it - returns all variables that match the pattern. -
      - -
      - Return: - - Value of introspected option as a string. -
      -
    • -
    • - - - - instvar - v1 - ?v2...vn? - - - - - - - - - - - - - - - - - - -
      - Arguments: - - v1: instvar variable -
      - - - ?v2...vn?: optional other instvar variables -
      - Description: - - - Binds an variable of the object to the current method's scope. - Example: -
      -      kitchen proc enter {name} {
      -        my instvar persons
      -        set persons($name) [clock seconds]
      -      }
      -      
      - Now persons can be accessed as a local variable of the method.
      - - A special syntax is: {varName aliasName} . - This gives the variable with the name - varName the alias aliasName. - This way the variables can be linked to the methods scope, - even if a variable with that name already exists in the scope. - -
      - Return: - - empty string -
      -
    • -
    • - - - - invar - invariantList - - - - - - - - - - - - - - -
      - Arguments: - - invariantList: Body of invariants for the object -
      - Description: - - - Specify invariants for the objects. All assertions are a list - of ordinary Tcl conditions. - -
      - Return: - - empty string -
      -
    • -
    • - - - - isclass - ?className? - - - - - - - - - - - - - - -
      - Arguments: - - ?className?: name of a class to be tested -
      - Description: - - - Test whether the argument (or the Object, if no argument is specified) - is an existing class or not. - -
      - Return: - - 1 or 0 -
      -
    • -
    • - - - - ismetaclass - ?metaClassName? - - - - - - - - - - - - - - -
      - Arguments: - - ?metaClassName?: name of a metaclass to be tested -
      - Description: - - - Test whether the argument (or the Object, if no argument is specified) - is an existing metaclass or not. - -
      - Return: - - 1 or 0 -
      -
    • -
    • - - - - ismixin - ?className? - - - - - - - - - - - - - - -
      - Arguments: - - ?className?: name of a class to be tested -
      - Description: - - - Test whether the argument is a mixin or instmixin of the object. - -
      - Return: - - 1 or 0 -
      -
    • -
    • - - - - isobject - objName - - - - - - - - - - - - - - -
      - Arguments: - - objName: string that should be tested, whether it is a name of an object or not -
      - Description: - - - Test whether the argument is an existing object or not. Every XOTcl object - has the capability to check the object system. - -
      - Return: - - 1 or 0 -
      -
    • -
    • - - - - istype - className - - - - - - - - - - - - - - -
      - Arguments: - - className: type name -
      - Description: - - - Test whether the argument is a type of the object. I.e., 1 is returned - if className is either the class of the object or one of its - superclasses. - -
      - Return: - - 1 or 0 -
      -
    • -
    • - - - - lappend - varName - args - - - - - - - - - - - - - - - - - - -
      - Arguments: - - varName: name of variable -
      - - - args: elements to append -
      - Description: - - - Append all the specified arguments to the list specified - by varName as separated elements (typically separated by blanks). - If varName doesn't exist, it creates a list with the specified - values - (see documentation of Tcl command with the same name for details). - -
      - Return: - - empty string -
      -
    • -
    • - - - - mixin - mixinList - - - - - - - - - - - - - - -
      - Arguments: - - mixinList: list of classes that should be registered as mixins -
      - Description: - - - Specifies the list of mixins registered for the object. - The method mixin overwrites all previous settings. - -
      - Return: - - empty string -
      -
    • -
    • - - - - mixinappend - mixinList - - - - - - - - - - - - - - -
      - Arguments: - - mixinList: name of the new mixin -
      - Description: - - - Convenience method that appends a mixin to the existing mixins of the object. - -
      - Return: - - empty string -
      -
    • -
    • - - - - move - newName - - - - - - - - - - - - - - -
      - Arguments: - - newName: destination of move operation -
      - Description: - - - Perform a deep move of the object/class (with all information, like - class, parameter, filter, ...) - to "newName". - -
      - Return: - - empty string -
      -
    • -
    • - - - - parametercmd - name - - - - - - - - - - - - - - -
      - Arguments: - - name: variable to be provided with getter/setter method -
      - Description: - - - Add a getter/setter for an instance variable with the - specified name as a command for the obj. - Example:
      - Object o
      - o parametercmd x
      - o x 100
      - puts [o x]
      - -
      - Return: - - empty string -
      -
    • -
    • - - - - noinit - - - - - - - - - - -
      - Description: - - - flag that constructor (method init) should - not be called. - Example:
      - Class C
      - C instproc init {} {puts hu}
      - C c1 -noinit
      - The object c1 will be created without calling - the constructor. This can be used to draw a snapshot of - an existing object (using the serializer) and to recreate - it in some other context in its last state. - -
      - Return: - - empty string -
      -
    • -
    • - - - - proc - name - args - body - ?preAssertion? - ?postAssertion? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - Arguments: - - name: method name -
      - - - args: method arguments -
      - - - body: method body -
      - - - ?preAssertion?: optional assertions that must hold before the proc executes -
      - - - ?postAssertion?: optional assertions that must hold after the proc executes -
      - Description: - - - Specify a method in the same style as Tcl specifies procs. - - Optionally assertions may be given. The number of args is either - 3 or 5. - Therefore, to specify only post-assertions an empty pre-assertion - list must be given. All assertions are a list - of ordinary Tcl conditions. - -
      - Return: - - empty string -
      -
    • -
    • - - - - procsearch - procname - - - - - - - - - - - - - - -
      - Arguments: - - procname: simple proc name -
      - Description: - - - Search for a proc or instproc on an object and return the fully - qualified name of the method as a list in - proc qualifier format: - 'objName|classname proc|instproc methodName'. E.g., -
       o procsearch set 
      - returns
      ::xotcl::Object instproc set
      . - -
      - Return: - - fully qualified name of the searched method or empty string if not found -
      -
    • -
    • - - - - requireNamespace - - - - - - - - - - -
      - Description: - - - The method requireNamespace can - be used to ensure that the object has a namespace. - Namespaces are created automatically by XOTcl, when e.g. an object has - child objects (aggregated objects) or procs. The namespace - will be used to keep instance variables, procs and child objects. - To check, whether an object currently has a namespace, - info hasNamespace can be used. - - Hint: In versions prior to XOTcl 0.9 all XOTcl objects - had their own namespaces; it was made on demand to save memory when - e.g. huge numbers of objects are created. - requireNamespace is often needed when e.g. using Tk widgets - when variables are to be referenced via the namespace - (with ... -variable [self]::varname ...). - -
      - Return: - - empty string -
      -
    • -
    • - - - - set - varname - ?value? - - - - - - - - - - - - - - - - - - -
      - Arguments: - - varname: name of the instance variable -
      - - - ?value?: optional new value -
      - Description: - - - Set an instance variable in the same style as Tcl sets a variable. - - With one argument, we retrieve the current value, - with two arguments, we set the instance variable to the new value. - -
      - Return: - - Value of the instance variable -
      -
    • -
    • - - - - trace - varName - - - - - - - - - - - - - - -
      - Arguments: - - varName: name of variable -
      - Description: - - - Trace an object variable - (see documentation of Tcl command with the same name for details). - -
      - Return: - - empty string -
      -
    • -
    • - - - - unset - v1 - ?v2...vn? - - - - - - - - - - - - - - - - - - -
      - Arguments: - - v1: Variable to unset -
      - - - ?v2...vn?: Optional more vars to unset -
      - Description: - - - The unset operation deletes one or optionally a set of variables from an object. - -
      - Return: - - empty string -
      -
    • -
    • - - - - uplevel - ?level? - command ?args? - - - - - - - - - - - - - - - - - - -
      - Arguments: - - ?level?: Level -
      - - - command ?args?: command and arguments to be called -
      - Description: - - - When this method is used without the optional level, it is a short form - of the Tcl command
      - upevel [self callinglevel] command ?args?. - When it is called with the level, it is compatible with the original tcl command. - -
      - Return: - - result of the command -
      -
    • -
    • - - - - upvar - ?level? - othervar localvar - ?othervar localvar? - - - - - - - - - - - - - - - - - - - - - - -
      - Arguments: - - ?level?: Level -
      - - - othervar localvar: referenced variable and variale in the local scope -
      - - - ?othervar localvar?: optional pairs of referenced and local variable names -
      - Description: - - - When this method is used without the optional level, it is a short form - of the Tcl command
      - upvar [self callinglevel] othervar localvar ?...?. - When it is called with the level, it is compatible with the original tcl command. - -
      - Return: - - result of the command -
      -
    • -
    • - - - - vwait - varName - - - - - - - - - - - - - - -
      - Arguments: - - varName: name of variable -
      - Description: - - - Enter event loop until the specified variable is set - (see documentation of Tcl command with the same name for details). - -
      - Return: - - empty string -
      -
    • -
    -

    Procs

    -
      -
    • - - - - getExitHandler - - - - - - - - - - -
      - Description: - - Retrieve the current exit handler procedure body as a string. -
      - Return: - - exit handler proc body -
      -
    • -
    • - - - - setExitHandler - body - - - - - - - - - - - - - - -
      - Arguments: - - body: procedure body -
      - Description: - - - Set body for the exit handler procedure. The exit handler - is executed when XOTcl is existed or aborted. Can be used to call - cleanups that are not associated with objects (otherwise use - destructor). - On exit the object destructors are called after the - user-defined exit-handler. - -
      - Return: - - exit handler proc body -
      -
    • -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/langRef-xotcl.pdf =================================================================== diff -u -N -re44f69435e8db4aa6ed2ffffe8caaa6586c2fc5f -rc72f9f638677608fab1502cd696c8f2d6b2952f9 Binary files differ Index: xotcl/doc/langRef.xotcl =================================================================== diff -u -N --- xotcl/doc/langRef.xotcl (revision 57972e5a2972b1eb5dd63f6e3d483670117feebf) +++ xotcl/doc/langRef.xotcl (revision 0) @@ -1,1450 +0,0 @@ -# $Id: langRef.xotcl,v 1.18 2007/09/05 19:09:22 neumann Exp $ -package provide XOTcl-langRef 1.5.5 -package require XOTcl - -@ @File { - description { - XOTcl language reference. Describes predefined objects and classes. - } - "predefined primitives" { - XOTcl contains the following predefined primitives (Tcl commands): -
    -
    <@tt>self<@/tt>
    -
    computes callstack related information. - It can be used in the following ways: - <@UL> - <@LI><@TT>self - returns the name - of the object, which is currently in execution. If it is - called from outside of a proc, it returns the - error message ``<@TT>Can't find self''. - <@LI><@TT>self class - the self - command with a given argument <@TT>class returns the name of the - class, which holds the currently executing instproc. Note, that this - may be different to the class of the current object. If it is called - from a proc it returns an empty string. - <@LI><@TT>self proc - the self command with a given argument - <@TT>proc returns the name of the currently executing proc or - instproc. - <@li><@TT>self callingclass: Returns class name of the - class that has called the executing method. - <@li><@TT>self callingobject: Returns object name of - the object that has called the executing method. - <@li><@TT>self callingproc: Returns proc name of - the method that has called the executing method. - <@li><@TT>self calledclass: Returns class name of the - class that holds the target proc (in mixins and filters). - <@li><@TT>self calledproc: Returns method - name of the target proc (only applicable - in a filter). - <@li><@TT>self isnextcall: Return 1 if this method - was invoked via next, otherwise 0 - <@li><@TT>self next: Return the - "next" method on the precedence path as a string. - <@li><@TT>self filterreg: In a filter: returns the name - of the object/class on which the filter is registered. Returns either - 'objName filter filterName' or 'className instfilter filterName'. - - <@li><@TT>self callinglevel: Returns the calling level, from where - the actual proc was called from. Intermediary next calls are ignored - in this computation. The level is returned in a form - it can be used as first argument in <@TT>uplevel or <@TT>upvar. - - <@li><@TT>self activelevel: Returns the level, from where - the actual proc was invoked from. This might be the calling level or a next - call, whatever is higher in the stack. The level is returned in a form - it can be used as first argument in <@TT>uplevel or <@TT>upvar. - - <@/UL> - <@/p> -
    - -
    <@tt>my methodName<@/tt>
    -
    is a short form for <@tt>[self] methodName and can only be - called in a context of an instproc or an method specific proc. It allows certain - optimizations and shorter to write. - <@/p><@p> - <@tt>next <@/tt>
    invokes the next shadowed (same-named) method on the - precedence path and returns its result. If <@tt>next is - called without arguments, the arguments of the current method - are passed through the called method. If <@tt>next is - invoked with the flag <@tt>--noArgs, the shadowed method - is called without arguments. If other arguments are specified - for next, these will be used for the call. - <@/dd> -
    <@tt>myvar varName
    -
    returns the fully qualified variable name of the specified - variable.

    -

    - -
    <@tt>myproc methodName ?args?
    -
    calls the specified XOTcl method without the need - of using "<@tt>[list [self] methodName ...]".

    -

    - -
    <@tt>::xotcl::alias class|obj methodName ?-objscope? ?-per-object? cmdName
    -
    can be used to register a predefined C-implemented Tcl command as - method <@tt>methodName. - The option <@tt>-objscope has the same meaning as for forwarder - (instance variables of the calling object appear in the local scope of - the Tcl command), <@tt>-per-object has the same meaning as for - the method <@tt>method (when used on a class, the method is registered for the - class object only, but not for the instances). This command - can be used to bootstrap xotcl (when e.g. no methods are available).

    -

    - -
    ::xotcl::configure filter ?on|off?<@/tt>
    -
    allows to - turn on or off filters globally for the current interpreter. - By default, the filter state is turned off. - This function returns the old filter state. - This function is needed for the serializer that is intended - to serialize the objects classes independent of filter settings.

    -

    - - -
    <@tt>::xotcl::configure softrecreate ?on|off?<@/tt>
    -
    allows to control - what should happen, when an object / a class is recreated. Per - default it is set off, which means that the object/class is destroyed - and all relations (e.g. subclass/superclass) to other - objects/classes are destroyed as well. If <@tt>softrecreate is - set, the object is reseted, but not destroyed, the relations - are kept. This is important, when e.g. reloading a file - with class definitions (e.g. when used in OpenACS with file watching and - reloading). With <@tt>softrecreate set, - it is not necessary to recreate dependent subclasses etc. -
    - Example: e.g. there is a class hierarchy A <- B <- C - Without <@tt>softrecreate set, a reload of B means - first a destroy of B, leading to A <- C, and instances - of B are re-classed to ::xotcl::Object. When <@tt>softrecreate is - set, the structure remains unchanged. -
    - -
    - - } - date { $Date: 2007/09/05 19:09:22 $ } -} - -## -## Object methods -## -@ Class Object { - description { - This class holds the pre-defined methods available for all XOTcl - objects. All these methods are also available on classes. - } -} - -@ Object instproc abstract { - methtype "instproc or proc" - methodName "name of abstract method" - arglist "arguments" -} { - Description { - Specify an abstract method for class/object with arguments. - - An abstract method specifies an interface and - returns an error, if it is invoked directly. - Sub-classes or mixins have to override it. - } - return "error" -} - -@ Object instproc append { - varName "name of variable" - args "arguments to append" -} { - Description { - Append all of the value arguments to the current value of variable - varName. Wrapper to the same named Tcl command - (see documentation of Tcl command with the same name for details). - } - return "empty string" -} - -@ Object instproc array { - opt "array option" - array "array name" - ?args? "args of the option" -} { - Description { - This method performs one of several operations on the variable - given by arrayName. It is a wrapper to the same named Tcl command - (see documentation of Tcl command with the same name for details). - } - return "diverse results" -} - -@ Object instproc autoname { - ?<-instance>|<-reset>? "Optional modifiers: <@br> - '-instance' makes the autoname start with a small letter.<@br> - '-reset' resets the autoname index to 0." - name "base name of the autoname"} { - Description { - autoname creates an automatically assigned name. It is - constructed from the base name plus an index, that is - incremented for each usage. E.g.: - <@pre class='code'> $obj autoname a - produces a0, a1, a2, ... - Autonames may have format strings - as in the Tcl 'format' command. - E.g.: - <@pre class='code'> $obj autoname a%06d - produces a000000, a000001, a000002, ... - } - return "newly constructed autoname value" -} - -@ Object instproc check { - options "none, one or more of: (?all? ?pre? ?post? ?invar? ?instinvar?)" -} { - Description { - Turn on/off assertion checking. Options argument is the list - of assertions, that should be checked on the object automatically. - Per default assertion checking is turned - off. Examples: - <@pre class='code'> - o check {}; <@it># turn off assertion checking on object o - o check all; <@it># turn on all assertion checks on object o - o check {pre post}; <@it># only check pre/post assertions - <@a href="#Object-info">info check introspects check options. - } - return "empty string" -} - -@ Object instproc class { - newClass "?new class?" -} { - Description { - Changes the class of an object dynamically to <@tt>newClass. - The method returns the current value of class, - when it is called without arguments. - } - return "if <@tt>newClass is not specified return class, otherwise empty" -} - -@ Object instproc cleanup { - ?args? "Arbitrary arguments passed to cleanup" -} { - Description { - Resets an object or class into an initial state, as after construction. - Called during recreation process by the method 'recreate' - } - return "empty string" -} - -@ Object instproc configure { - ?args? "'-' method calls" -} { - Description { - Calls the '-' (dash) methods. I.e. evaluates arguments and calls - everything starting with '-' (and not having a digit a - second char) as a method. Every list element until the next '-' - is interpreted as a method argument. configure/tt> is called - before the constructor during initialization and recreation. - In the following example, the variable set is called via - configure before init: - <@pre class='code'> Object o -set x 4 - The method configure can be called with the - dash-notation at arbitrary times: - <@pre class='code'> o configure -set x 4 - } - return "number of the skipped first arguments" -} - -@ Object instproc contains { - "?-withnew?" "Option to overload new to create new objects within - the specified object. Per default, this option is turned on." - "?-object?" "object, in which the new objects should be created. - The default is the object, for which contains>/tt> was called." - "?-class?" "In combination with option -object: If the specified - object does not exist, create it from the specified class. The default - is ::xotcl::Object" - cmd "Tcl command to create multiple objects" -} { - Description { - This method can be used to create nested object structures - with little syntactic overhead. The method changes the namespace - to the specified object and creates objects there. - Optionally, a different object scope can be specified and - creating new objects in the specified scope can be turned off. - The following command creates a three rectangles, containing some - points. -
    -  Class Point -parameter {{x 100} {y 300}}
    -  Class Rectangle -parameter {color}
    -
    -  Rectangle r0 -color pink -contains {
    -    Rectangle r1 -color red -contains {
    -      Point x1 -x 1 -y 2
    -      Point x2 -x 1 -y 2
    -    }
    -    Rectangle r2 -color green -contains {
    -      Point x1
    -      Point x2
    -    }
    -  }
    -
    - The resulting object structure looks like in the folloing - example (simplified). -
    -   ::r0
    -   ::r0::r1
    -   ::r0::r1::x1
    -   ::r0::r1::x2
    -   ::r0::r2
    -   ::r0::r2::x1
    -   ::r0::r2::x2
    -
    - } - return "number of the skipped first arguments" -} - - - -@ Object instproc copy { - newName "destination of copy operation" -} { - Description { - Perform a deep copy of the object/class (with all information, like - class, parameter, filter, ...) - to "newName". - } - return "empty string" -} - -@ Object instproc destroy { - ?args? "Arbitrary arguments passed to the destructor" -} { - Description { - Standard destructor. - Can be overloaded for customized destruction process. Actual destruction - is done by instdestroy. "destroy" in principal does: - <@pre class='code'> - Object instproc destroy args { - [my info class] instdestroy [self] - } - } - return "empty string" -} - -@ Object instproc eval { - args "cmds to eval" -} { - Description { - Eval args in the scope of the object. That is local variables - are directly accessible as Tcl vars. - } - return "result of cmds evaled" -} - -@ Object instproc extractConfigureArg { - al "Argument List Name" - name "Name of the configure argument to be extracted (should start with '-')" - ?cutTheArg? "if cutTheArg not 0, it cut from upvar argsList, default is 0" -} { - Description { - Check an argument list separated with '-' args, as for instance - configure - arguments, and extract the argument's values. Optionally, cut the - whole argument. - } - return "value list of the argument" -} - -@ Object instproc exists { - var "variable name" -} { - Description { - Check for existence of the named instance variable on the object. - } - return "1 if variable exists, 0 if not" -} - -@ Object instproc filter { - ?args? "filter specification" -} { - Description { - If <@tt>$args is one argument, it specifies a list of filters to - be set. Every filter must be an XOTcl proc/instproc within - the object scope. - If <@tt>$args it has more argument, the first one specifies the - action. Possible values are <@tt>assign, <@tt>get, - <@tt>add or <@tt>delete, it modifies the current - settings as indicated. For more details, check the - tutorial. - } - return "if <@tt>$args return empty current filters, otherwise empty" -} - -@ Object instproc filterguard { - filterName "filter name of a registered filter" - guard "set of conditions to execute the filter" -} { - description { - Add conditions to guard a filter registration point. The filter - is only executed, if the guards are true. Otherwise we ignore the - filter. If no guards are given, we always execute the filter. - } - return "an empty string" -} - -@ Object instproc filtersearch { - methodName "filter method name" -} { - description { - Search a full qualified method name that - is currently registered as a filter. Return a list of the - proc qualifier format: - 'objName|className proc|instproc methodName'. - } - return "full qualified name, if filter is found, otherwise an empty string" -} - - -@ Object instproc forward { - methodName "name of forwarder method" - ?options? "-objscope, -methodprefix string, -default names, -earlybinding, -verbose" - ?callee? "named of the called command or object" - ?args? "arguments" - -} { - Description { - Register an object specific method (similar to a proc) for forwarding calls to - a callee (target Tcl command, other object). - When the forwarder method is called, the actual arguments - of the invocation are appended to the specified arguments. In callee an - arguments certain substitutions can take place: -
    • %proc: substituted by name of the forwarder method
    • -
    • %self: substitute by name of the object
    • -
    • %1: substitute by first argument of the invocation
    • -
    • {%@POS value}: substitute the specified value in the argument list - on position POS, where POS can be a positive or negative integer - or end. Positive integers specify the position from the begin - of the list, while negative integer specify the position from the end. -
    • {%argclindex LIST}: take the nth argument of the specified list as - substitution value, where n is the number of arguments from the - invocation. -
    • %%: a single percent.
    • -
    • %Tcl-command: command to be executed; substituted by result.
    • -
    - Additionally each argument can be prefixed by the positional prefix %@POS - (note the delimiting space at the end) that can be used to specify an - explicit position. POS can be a positive or negative integer or the word - end. The positional arguments are evaluated from left to - right and should be used in ascending order. valid Options are: -
    • -objscope causes the target to be evaluated in the scope - of the object,
    • -
    • -methodprefix string inserts the specified prefix - in front of the second argument of the invocation,
    • -
    • -default is used for default method names (only - in connection with %1)
    • -
    • -earlybinding: look up the function - pointer of the called Tcl command at - definition time of the forwarder instead of invocation time. - This option should only be used - for calling C-implemented Tcl commands, no procs etc.);
    • -
    • -verbose
    • : print the substituted command to stderr - before executing -
    - See - tutorial - for detailed examples. - } - return "empty" -} - - -@ Object instproc hasclass { - ?className? "name of a class to be tested" -} { - Description { - Test whether the argument is either - a mixin or instmixin of the object or - if it is on the class hierarchy of the object. - This method combines the functionalities of - istype and ismixin. - } - return "1 or 0" -} - - -@ Object instproc incr { - varName "variable name" - ?increment? "value to increment" -} { - Description { - Increments the value stored in the variable whose name is varName. - The new value is stored as a decimal string in variable varName and also - returned as result. Wrapper to the same named Tcl command - (see documentation of Tcl command with the same name for details). - } - return "new value of varName" -} - -@ Object instproc info { - args "info options" -} { - Description { - Introspection of objects. The following options can be specified: - <@l> - <@li><@TT>objName info args method: - Returns the arguments of the specified proc (object specific method). - - <@li><@TT>objName info body method: - Returns the body of the specified proc (object specific method). - - <@li><@TT>objName info class ?classname?: - Returns the name of the class of the current object, if className was - not specified, otherwise it returns 1 if className matches the - object's class and 0 if not. - - <@li><@TT>objName info children ?pattern?: Returns the - list of aggregated objects with fully qualified names if - <@TT>pattern was not specified, otherwise it returns all - children where the object name matches the pattern. - - <@li><@TT>objName info commands ?pattern: Returns all - commands defined for the object if <@TT>pattern was not - specified, otherwise it returns all commands that match the - pattern. - - <@li><@TT>objName info default method arg var: Returns 1 - if the argument <@TT>arg of the proc (object specific - method) <@TT>method has a default value, otherwise 0. If - it exists the default value is stored in <@TT>var. - - <@li><@TT>objName info filter: Returns a list of filters. - With -guard modifier all filterguards are integrated - (<@TT> objName info filter -guards). With <@TT>-order - modifier the order of filters (whole hierarchy) is printed. - - <@li><@TT>objName info filterguard name: Returns the guards - for filter identified by name. - - <@li><@TT>objName info hasNamespace: From XOTcl version 0.9 on, - namespaces - of objects are allocated on demand. hasNamespace returns 1, if the - object currently has a namespace, otherwise 0. The method - <@TT>requireNamespace can - be used to ensure that the object has a namespace. - - <@li><@TT>objName info info: Returns a list of all available info - options on the object. - - <@li><@TT>objName info invar: Returns object invariants. - - <@li><@TT>objName info methods: Returns the list of all methods - currently reachable for objName. Includes procs, instprocs, cmds, - instcommands on object, class hierarchy and mixins. - Modifier <@TT>-noprocs only returns instcommands, - <@TT>-nocmds only returns procs. - Modifier <@TT>-nomixins excludes search on mixins. - - <@li><@TT>objName info mixin: Returns the list of mixins - of the object. With <@TT>-order modifier the order of mixins - (whole hierarchy) is printed. - - <@li><@TT>objName info nonposargs methodName: Returns - non-positional arg list of methodName - - <@li><@TT>objName info parent: - Returns parent object name (or "::" for no parent), - in fully qualified form. - - <@li><@TT>objName info post methodName: - Returns post assertions of methodName. - - <@li><@TT>objName info pre methodName: - Returns pre assertions of methodName. - - <@li><@TT>objName info procs ?pattern?: Returns all procs - defined for the object if <@TT>pattern was not specified, - otherwise it returns all procs that match the pattern. - - <@li><@TT>objName info precedence ?pattern?: Returns all - classes in the precedence order from which the specified - object inherits methods. The returned list of classes contains - the mixin and instmixin classes as well as the classes of the - superclass chain in linearized order (i.e., duplicate classes - are removed). If the pattern is specified, only matching classes - are returned. - - <@li><@TT>objName info vars ?pattern?: Returns all - variables defined for the object if <@TT>pattern was not - specified, otherwise it returns all variables that match the - pattern. <@/ul> - } - return "Value of introspected option as a string." -} - -@ Object instproc instvar { - v1 "name of instance variable" - "?v2...vn?" "optional other names for instance variables" -} { - Description { - Binds an variable of the object to the current method's scope. - Example: - <@pre class='code'> - kitchen proc enter {name} { - my instvar persons - set persons($name) [clock seconds] - } - Now persons can be accessed as a local variable of the method.<@br> - - A special syntax is: <@tt> {varName aliasName} . - This gives the variable with the name - <@TT>varName the alias <@TT>aliasName. - This way the variables can be linked to the methods scope, - even if a variable with that name already exists in the scope. - } - return "empty string" -} - -@ Object instproc invar { - invariantList "Body of invariants for the object" -} { - Description { - Specify invariants for the objects. All assertions are a list - of ordinary Tcl conditions. - } - return "empty string" -} - -@ Object instproc isclass { - ?className? "name of a class to be tested" -} { - Description { - Test whether the argument (or the Object, if no argument is specified) - is an existing class or not. - } - return "1 or 0" -} - -@ Object instproc ismetaclass { - ?metaClassName? "name of a metaclass to be tested" -} { - Description { - Test whether the argument (or the Object, if no argument is specified) - is an existing metaclass or not. - } - return "1 or 0" -} - -@ Object instproc ismixin { - ?className? "name of a class to be tested" -} { - Description { - Test whether the argument is a mixin or instmixin of the object. - } - return "1 or 0" -} - -@ Object instproc isobject { - objName "string that should be tested, whether it is a name of an object or not" -} { - Description { - Test whether the argument is an existing object or not. Every XOTcl object - has the capability to check the object system. - } - return "1 or 0" -} - -@ Object instproc istype { - className "type name" -} { - Description { - Test whether the argument is a type of the object. I.e., 1 is returned - if className is either the class of the object or one of its - superclasses. - } - return "1 or 0" -} - -@ Object instproc lappend { - varName "name of variable" - args "elements to append" -} { - Description { - Append all the specified arguments to the list specified - by varName as separated elements (typically separated by blanks). - If varName doesn't exist, it creates a list with the specified - values - (see documentation of Tcl command with the same name for details). - } - return "empty string" -} - - - -@ Object instproc mixin { - ?args? "mixin specification" -} { - Description { - If <@tt>$args is one argument, it specifies a list of mixins to - be set. Every mixin must be a defined class. - If <@tt>$args has more argument, the first one specifies the - action. Possible values are <@tt>assign, <@tt>get, - <@tt>add or <@tt>delete, it modifies the current - settings as indicated. For more details, check the - tutorial. - } - return "if <@tt>$args empty return current mixins, otherwise empty" -} - -@ Object instproc move { - newName "destination of move operation" -} { - Description { - Perform a deep move of the object/class (with all information, like - class, parameter, filter, ...) - to "newName". - Note that move is currently implemented as a copy plus - subsequent destroy operation. - } - return "empty string" -} - -@ Object instproc parametercmd { - name "variable to be provided with getter/setter method" -} { - description { - Add a getter/setter for an instance variable with the - specified name as a command for the obj. - Example: - <@pre class='code'> - Object o - o parametercmd x - o x 100 - puts [o x] - } - return "empty string" -} - -@ Object instproc noinit { -} { - description { - flag that constructor (method <@tt>init
    ) should - not be called. - Example: - <@pre class='code'> - Class C - C instproc init {} {puts hu} - C c1 -noinit - The object <@tt>c1 will be created without calling - the constructor. This can be used to draw a snapshot of - an existing object (using the serializer) and to recreate - it in some other context in its last state. - } - return "empty string" -} - - -@ Object instproc proc { - name "method name" - ?non-pos-args? "optional non-positional arguments" - args "method arguments" - body "method body" - "?preAssertion?" "optional assertions that must hold before the proc executes" - "?postAssertion?" "optional assertions that must hold after the proc executes" -} { - Description { - Specify a method in the same style as Tcl specifies procs. - <@br> - Optionally assertions may be specified by two additional arguments. - Therefore, to specify only post-assertions an empty pre-assertion - list must be given. All assertions are a list - of ordinary Tcl conditions. - <@br> - When instproc is called with an empty argument list and an empty - body, the specified instproc is deleted. - - } - return "empty string" -} - -@ Object instproc procsearch { - procName "simple proc name" -} { - Description { - Search which method should be invoked for an object and return the fully - qualified name of the method as a list in - proc qualifier format: - 'objName|className proc|instproc|forward|instforward|parametercmd|instparametercmd|cmd|instcmd methodName'. - The proc qualifier format reports the command used to create the method. The - only exception is instcmd and cmd, which refer to commands implemented in C. - E.g., - <@pre class='code'> o procsearch set - returns <@pre>::xotcl::Object instcmd set. - } - return "fully qualified name of the searched method or empty string if not found" -} - -@ Object instproc requireNamespace { -} { - Description { - The method <@TT>requireNamespace can - be used to ensure that the object has a namespace. - Namespaces are created automatically by XOTcl, when e.g. an object has - child objects (aggregated objects) or procs. The namespace - will be used to keep instance variables, procs and child objects. - To check, whether an object currently has a namespace, - <@TT>info hasNamespace can be used. - - Hint: In versions prior to XOTcl 0.9 all XOTcl objects - had their own namespaces; it was made on demand to save memory when - e.g. huge numbers of objects are created. - <@TT>requireNamespace is often needed when e.g. using Tk widgets - when variables are to be referenced via the namespace - (with <@TT>... -variable [self]::varName ...). - } - return "empty string" -} - -@ Object instproc set { - varName "name of the instance variable" - ?value? "optional new value" -} { - Description { - Set an instance variable in the same style as Tcl sets a variable. - - With one argument, we retrieve the current value, - with two arguments, we set the instance variable to the new value. - } - return "Value of the instance variable" -} - -@ Object instproc subst { - options "?-nobackslashes? ?-nocommands? ?-novariables?" - string "string to be substituted" -} { - Description { - Perform backslash, command, and variable substitutions - in the scope of the given object - (see documentation of Tcl command with the same name for details). - } - return "substituted string" -} - -@ Object instproc trace { - varName "name of variable" -} { - Description { - Trace an object variable - (see documentation of Tcl command with the same name for details). - } - return "empty string" -} - -@ Object instproc unset { - "?-nocomplain?" "possible error messages are suppressed" - v1 "Variable to unset" - "?v2...vn?" "Optional more vars to unset" -} { - Description { - The unset operation deletes one or optionally a set of variables from an object. - } - return "empty string" -} - -@ Object instproc uplevel { - ?level? "Level" - command ?args? "command and arguments to be called" -} { - Description { - When this method is used without the optional level, it is a short form - of the Tcl command - <@pre class='code'> uplevel [self callinglevel] command ?args?<@/pre> - When it is called with the level, it is compatible with the original Tcl command. - } - return "result of the command" -} -@ Object instproc upvar { - ?level? "Level" - otherVar localVar "referenced variable and variable in the local scope" - ?otherVar localVar? "optional pairs of referenced and local variable names" -} { - Description { - When this method is used without the optional level, it is a short form - of the Tcl command - <@pre class='code'> upvar [self callinglevel] otherVar localVar ?...?<@/pre>. - When it is called with the level, it is compatible with the original Tcl command. - } - return "result of the command" -} - -@ Object instproc vwait { - varName "name of variable" -} { - Description { - Enter event loop until the specified variable is set - (see documentation of Tcl command with the same name for details). - } - return "empty string" -} - -# procs of Object -@ Object proc getExitHandler {} { - Description "Retrieve the current exit handler procedure body as a string." - return "exit handler proc body" -} - -@ Object proc setExitHandler {body "procedure body"} { - Description { - Set body for the exit handler procedure. The exit handler - is executed when XOTcl is existed or aborted. Can be used to call - cleanups that are not associated with objects (otherwise use - destructor). - On exit the object destructors are called after the - user-defined exit-handler. - } - return "exit handler proc body" -} - -# class -@ Class Class -superclass Object { - description { - This meta-class holds the pre-defined methods available for all XOTcl - classes. - } -} -@ Class instproc alloc { - obj "new obj/class name" - ?args? "arguments passed to the new class after creation" -} { - description { - Allocate memory for a new XOTcl object or class. <@tt>create<@/tt> uses - <@tt>alloc to allocate memory. But <@tt>create<@/tt> also - calls init and evaluates '-' arguments as method calls. - In seldom cases the programmer may want to suppress the - <@tt>create<@/tt> - mechanism and just allocate memory. Then <@tt>alloc can - be used. - } - return "new class name" -} - -@ Class instproc allinstances { -} { - description { - Compute all immediate and indirect instances of a class - } - return "fully qualified list of instances" -} - -@ Class instproc create { - objName "name of a new class or object" - ?args? "arguments passed to the constructor" -} { - description { - Create user-defined classes or objects. If the class is a meta-class, - a class is created, otherwise an object. - - Create firstly calls <@tt>alloc in order to allocate memory for the - new object. Then default values for parameters are searched on - superclasses (an set if found). Then <@tt>args is searched for args - starting with '-' followed by an alpha character. These arguments - are called as methods. '-' followed by a numerical is interpreted - as a negative number (and not as a method). If a value of a method - called this way starts with a "a", the call can be placed safely - into a list (e.g. "Class c [-strangearg -a-] -simplearg 2"). - - Finally the constructor <@tt>init is called on the object - with all arguments up to the first '-' arg.<@p> - - The <@tt>create method is called implicitly through the - <@tt>unknown - mechanism when a class (meta-class) is called with an unknown - method. E.g. the following two commands are equivalent - - <@pre class='code'> - Car herby -color red - Car create herby -color red <@/pre> - - When a users may want to call the constructor <@tt>init - before other '-' methods, one can specify '-init' - explicitly in the left to - right order of the '-' method. Init is called always only once. - e.g.: - - <@pre class='code'> Class Car -init -superclass Vehicle <@/pre> - - } - return "name of the created instance (result of alloc)" -} - -@ Class instproc info { - args "info options" -} { - Description { - Introspection of classes. All options available for objects - (see <@a href="#Object-info">info object) is also available - for classes. - The following options can be specified: - <@ul> - - <@li><@TT>ClassName info classchildren ?pattern?: - Returns the list of nested classes with fully qualified names - if <@TT>pattern was not specified, - otherwise it returns all class children where the class name - matches the pattern. - - <@li><@TT>ClassName info classparent: - Returns the class ClassName is nesting to. - - <@li><@TT>ClassName info heritage ?pattern?: - Returns a list of all classes in the precedence order - of the class hierarchy. - If pattern is specified, only matching values are returned. - - <@li><@TT>ClassName info instances ?pattern?: - Returns a list of the instances of the class. - If pattern is specified, only matching values are returned. - - <@li><@TT>ClassName info instargs method: - Returns the arguments of the specified instproc (instance method). - - <@li><@TT>ClassName info instbody method: - Returns the body of the specified instproc (instance method). - - <@li><@TT>ClassName info instcommands ?pattern?: - Returns all commands defined for the class. If pattern - is specified it returns all commands that match the pattern. - - <@li><@TT>ClassName info instdefault method arg var: - Returns 1 if the argument <@TT>arg of the instproc (instance method) - <@TT>method has a default value, otherwise 0. If it exists - the default value is stored in <@TT>var. - - <@li><@TT>ClassName info instfilter: - Returns the list of registered filters. With -guard modifier - all instfilterguards are integrated - (<@TT> ClassName info instfilter -guards). - - <@li><@TT>objName info instfilterguard name: Returns the guards - for instfilter identified by name. - - <@li><@TT>ClassName info instinvar: - Returns class invariants. - - <@li><@TT>ClassName info instmixin: - Returns the list of instmixins of this class. - - <@li><@TT>ClassName info instnonposargs methodName: returns list of - non-positional args of methodName - - <@li><@TT>ClassName info instpost methodName: - Returns post assertions of methodName. - - <@li><@TT>ClassName info instpre methodName: - Returns pre assertions of methodName. - - <@li><@TT>ClassName info instprocs ?pattern?: - Returns all instprocs defined for the class. If pattern - is specified it returns all instprocs that match the pattern. - - <@li><@TT>ClassName info parameter: - Returns parameter list. - - <@li><@TT>ClassName info subclass ?subclassname?: - Returns a list of all subclasses of the class, if subclassname - was not specified, otherwise it returns 1 if subclassname is a - subclass and 0 if not. - - <@li><@TT> ClassName info superclass ?superclassname?: - Returns a list of all super-classes of the class, - if superclassname was not specified, otherwise it returns - 1 if superclassname is a superclass and 0 if not. - <@/ul> - } - return "Value of introspected option as a string." -} - -@ Class instproc instdestroy { - obj "obj/class name" - ?args? "arguments passed to the destructor" -} { - Description { - Standard destructor. Destroys XOTcl object physically from the memory. - Can be overloaded for customized destruction process. - <@p> - In XOTcl objects are not directly destroyed, when a destroy is - encountered in a method. Beforehand, the interpreter looks up whether - the object is still referenced on the method callstack or not. If not, - the object is directly destroyed. Otherwise every occurrence of the - object on the callstack is marked as destroyed. During popping of the - callstack, for each object marked as destroyed, the reference count is - decremented by one. When no more references to the object are on the - callstack the object is physically destroyed. This way we can assure - that objects are not accessed with [self] in running methods after - they are physically destroyed. - } - return "empty string" -} - -@ Class instproc instfilter { - ?args? "instfilter specification" -} { - Description { - If <@tt>$args is one argument, it specifies a list of - instfilters to - be set. Every filter must be an XOTcl proc/instproc within - the object scope. - If <@tt>$args it has more argument, the first one specifies the - action. Possible values are <@tt>assign, <@tt>get, - <@tt>add or <@tt>delete, it modifies the current - settings as indicated. For more details, check the - tutorial. - } - return "if <@tt>$args return empty current instfilters, otherwise empty" -} - - - -@ Class instproc instfilterguard { - filterName "filter name of a registered filter" - guard "set of conditions to execute the filter" -} { - description { - Add conditions to guard a filter registration point. The filter - is only executed, if the guards are true. Otherwise we ignore the - filter. If no guards are given, we always execute the filter. - } - return "empty string" -} - - -@ Class instproc instforward { - methodName "name of forwarder method" - ?options? "-objscope, -methodprefix string, -default names, -earlybinding, -verbose" - ?callee? "named of the called command or object" - ?args? "arguments" - -} { - Description { - Register a method for the instances of a class (similar to an instproc) - for forwarding calls to a callee (target Tcl command, - other object). - When the forwarder method is called, the actual arguments - of the invocation are appended to the specified arguments. In callee an - arguments certain substitutions can take place: -
    • %proc: substituted by name of the forwarder method
    • -
    • %self: substitute by name of the object
    • -
    • %1: substitute by first argument of the invocation
    • -
    • {%@POS value}: substitute the specified value in the argument list - on position POS, where POS can be a positive or negative integer - or end. Positive integers specify the position from the begin - of the list, while negative integer specify the position from the end. -
    • {%argclindex LIST}: take the nth argument of the specified list as - substitution value, where n is the number of arguments from the - invocation. -
    • %%: a single percent.
    • -
    • %Tcl-command: command to be executed; substituted by result.
    • -
    - Additionally each argument can be prefixed by the positional prefix %@POS - (note the delimiting space at the end) that can be used to specify an - explicit position. POS can be a positive or negative integer or the word - end. The positional arguments are evaluated from left to - right and should be used in ascending order. valid Options are: -
    • -objscope causes the target to be evaluated in the scope - of the object,
    • -
    • -methodprefix string inserts the specified prefix - in front of the second argument of the invocation,
    • -
    • -default is used for default method names (only - in connection with %1)
    • -
    • -earlybinding: look up the function - pointer of the called Tcl command at - definition time of the forwarder instead of invocation time. - This option should only be used - for calling C-implemented Tcl commands, no procs etc.);
    • -
    • -verbose
    • : print the substituted command to stderr - before executing -
    - See tutorial - for detailed examples. - - } - return "empty" -} - - -@ Class instproc instinvar { - invariantList "Body of invariants for the class" -} { - Description { - Specify invariants for the class. These are inherited by - sub-classes. The invariants must hold for all instances. - All assertions are a list of ordinary Tcl conditions. - } - return "empty string" -} - -@ Class instproc instmixin { - ?args? "instmixin specification" -} { - Description { - If <@tt>$args is one argument, it specifies a list of instmixins to - be set. Every instmixin must be a defined class. - If <@tt>$args has more argument, the first one specifies the - action. Possible values are <@tt>assign, <@tt>get, - <@tt>add or <@tt>delete, it modifies the current - settings as indicated. For more details, check the - tutorial. - } - return "if <@tt>$args empty return current instmixins, otherwise empty" -} - - -@ Class instproc instparametercmd { - name "variable to be provided with getter/setter method" -} { - description { - Add a getter/setter command for an instance variable with the - specified name. This method is used for example by the - <@A href="#Class-parameter">parameter method. - Example: <@br> - <@pre class='code'> - Class C - C instparametercmd x - C c1 -x 100 - puts [c1 x] - } - return "empty string" -} - -@ Class instproc instproc { - name "instance method name" - ?non-pos-args?" "optional non-positional arguments" - args "instance method arguments" - body "instance method body" - "?preAssertion?" "optional assertions that must hold before the proc executes" - "?postAssertion?" "optional assertions that must hold after the proc executes" -} { - Description { - Specify an instance method in the same style as Tcl specifies procs. - <@br> - Optionally assertions may be given by two additional arguments. - Therefore, to specify only post-assertions an empty pre-assertion list - must be given. All assertions are a list - of ordinary Tcl conditions. - <@br> - When instproc is called with an empty argument list and an empty - body, the specified instproc is deleted. - } - return "empty string" -} - - -@ Class instproc new { - "?-childof obj? ?args?" "args passed to create" -} { - description { - Convenience method to create an autonamed object. E.g.: - <@pre class='code'> - HTTP new - creates ::xotcl::__#0, a subsequent call creates ::xotcl::__#1, ...<@br> - If <@tt>-childof obj is specified, the new object is - created as a child of the specified object. - } - return "new object name" -} - -@ Class instproc parameter { - parameterList "list of parameter definitions" -} { - description { - Specify parameters automatically created for each instance. - Parameters denote instance variables which are available on each class instance - and that have a getter/setter method with their own name. - Parameters are specified in a parameter list of the form - {p1 p2 ... pn}. - p1 ... pn may either be parameter names or definitions of the form - {parameterName defaultValue}. - If a default value is given, that parameter - is created during creation process of the instance object, otherwise - only the getter/setter method is created (and the parameter does not - exist). The getter/setter method has the same name as the - parameter. It gets and returns the parameter, if no - argument is specified. With one argument, the parameter is set - to the argument value. - <@br> - Example: - <@pre class='code'> - Class Car -parameter {{doors 4} color} - Car herby -doors 2 -color green <@/pre> - } - return "empty string" -} -@ Class instproc parameterclass { - class "parameter class name" -} { - description { - Set the parameter class. - The parameter class specifies how parameters are stored and - maintained internally. Per default, a method "default" is called, - to set the parameter with a default value. I.e., - <@pre class='code'> - Class Car -parameter { - {doors 4} - }<@/pre> - - is a short form for - <@pre class='code'> - Class Car -parameter { - {doors -default 4} - }<@/pre> - - For specialized parameter classes other methods can be called, e.g.<@br> - <@pre class='code'> {doors -default 3 -updateWidget car}<@/pre> - } - return "empty string" -} - -@ Class instproc recreate { - obj "obj to be recreated" - ?args? "arbitrary arguments" -} { - description { - Hook called upon recreation of an object. Performs standard object - initialization, per default. May be overloaded/-written. It calls - another method cleanup which handles actual cleanup of the object - during next. That means, if you overload recreate, in the pre-part - the object still contains its old state, after next it is cleaned up. - } - return "obj name" -} - -@ Class instproc superclass { - classList "?list of classes?" -} { - description { - Specify super-classes for a class. "superclass" changes the list - of superclasses dynamically to <@tt>classList. - The method returns the current value of superclass, - when it is called without arguments. - } - return "if <@tt>classList is not specified return superclass(es), otherwise empty" -} - -@ Class instproc unknown { - ?args? "arbitrary arguments" -} { - description { - Standard unknown mechanism. This mechanism is always triggered when - XOTcl does not know a method called on an object. Supposed that - there is no method with the called name, XOTcl looks up the method - "unknown" (which is found on the Class Object) and executes it. - The standard unknown-mechanism of XOTcl calls create with all - arguments stepping one step to the right; in the general case: - <@pre class='code'> - ClassName create ClassName ?args?<@/pre> - - Unknown can be overloaded in user-defined subclasses of class. - } - return "Standard unknown mechanism returns result of create" -} - -@ Object instproc volatile { - "" "" -} { - description { - This method is used to specify that the object - should be deleted automatically, when the current - Tcl-proc/object-proc/instproc is left. Example: - <@pre class='code'> set x [Object new -volatile] - } - return "empty string" -} - -@ Class proc __unknown { - "name" "name of class to be created" -} { - description { - This method is called, whenever XOTcl references a class, - which is not defined yet. In the following example: - <@tt>Class C -superclass D - D is not defined. Therefore <@tt>Class __unknown D - is called. This callback can be used to perform auto-loading - of classes. After this call, XOTcl tries again to - resolve D. If it succeeds, XOTcl will continue; otherwise, - an error is generated. - <@p> - This method is called on mixin/instmixin definition calls, - istype, ismixin, class, superclass and parameterclass - } - return "empty string" -} - -@ Class ::xotcl::Slot -superclass Object { - description { - A slot is a meta-object that manages property-changes of - objects. A property is either an attribute or a role of an - relation (e.g. in system slots). - The predefined system slots are class, - superclass, mixin, instmixin, - filter, instfilter. These slots appear - as methods of Object or Class. - -

    The slots provide a common query and setting interface. - Every multivalued slot provides e.g. a method add - to add a value to the list of values, and a method delete - which removes it. See for example the documentation of the slot - mixin.

    - - Parameters:

    - - - - - - - -
    -name Name of the slot to access from an object the slot
    -domain domain (object or class) of a slot on which it can be used
    -multivalued boolean value for specifying single or multiple values (lists)
    -defaultmethods list of two elements for specifying which methods are called - per default, when no slot method is explicitly specified
    -manager the manager object of the slot (per default [self])
    -per-object specify whether a slot should be used per class or per object; note that there is a restricted usage if applied per class, since defaults etc, work per initialization
    - -

    For more details, consult the - tutorial.

    - } -} -@ Class Attribute -superclass ::xotcl::Slot { - description { - Attribute slots are used to manage the setting and querying - of instance variables. - - Parameters:

    - - - - - - -
    -default specify a default value
    -type specify the type of a slot
    -initcmd specify a Tcl command to be executed when the value of the - associated variable is read the first time; allows lazy initialization
    -valuecmd specify a Tcl command to be executed whenever the variable is read
    -valuechangedcmd specify a Tcl command to be executed whenever the variable is changed
    - -

    Example of a class definition with three attribute slots:

    -
    -  <@tt>Class Person -slots {
    -    Attribute name
    -    Attribute salary -default 0
    -    Attribute projects -default {} -multivalued true
    -  }
    -  Person p1 -name "John Doe"
    -
    -
    -   

    The slot parameters default, initcmd and - valuecmd have to be used mutually exclusively. - For more details, consult the - tutorial. -

    - } -} - - - - -#Class::Parameter instproc values {param args} - -#proc xotcl_mkindex -#proc xotcl_load Index: xotcl/doc/link-checker-xotcl.html =================================================================== diff -u -N --- xotcl/doc/link-checker-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/link-checker-xotcl.html (revision 0) @@ -1,71 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/comm/link-checker.xotcl - - - -

    - ./apps/comm/link-checker.xotcl - ./apps/comm/link-checker.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    - Package required: xotcl::comm::httpAccess -
    - Package required: xotcl::trace -
    -
    - Filename: - - ./apps/comm/link-checker.xotcl - -
    -
    - - - - - -
    - Description: - - - A simple link checking program that checks in parallel - pages of a site. -

    - Options:

    - - - - - - -
    -url Start-URL
    -foreign 0 or 1, specifies, whether foreign links of - local pages should be checked (default 1)
    -local A string match pattern to decide - which url should be treated as local - e.g. -local *wu-wien.ac.at/* - Per default the locality filter ist set - to the name of the host followed by '/*'
    -restrict 0 or 1, sets the locality filter to the subtree - implied by the URL
    -verbose 0 or 1 or 2, verbosity level (default 0)
    - -

    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/logo-100.jpg =================================================================== diff -u -N -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -rc72f9f638677608fab1502cd696c8f2d6b2952f9 Binary files differ Index: xotcl/doc/make-xotcl.html =================================================================== diff -u -N --- xotcl/doc/make-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/make-xotcl.html (revision 0) @@ -1,41 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/make.xotcl - - - -

    - ./library/lib/make.xotcl - ./library/lib/make.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    -
    - Filename: - - ./library/lib/make.xotcl - -
    -
    - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/makeDoc-xotcl.html =================================================================== diff -u -N --- xotcl/doc/makeDoc-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/makeDoc-xotcl.html (revision 0) @@ -1,57 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/makeDoc.xotcl - - - -

    - ./library/lib/makeDoc.xotcl - ./library/lib/makeDoc.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    - Package required: xotcl::package -
    - Package required: xotcl::xodoc -
    -
    - Filename: - - ./library/lib/makeDoc.xotcl - -
    -
    - - - - - -
    - Description: - - - Documentation tool for the XOTcl distribution.
    - Usage: 'makeDoc docdir filename ?filename ...?'
    - Called by Makefile. - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/metadataAnalyzer-xotcl.html =================================================================== diff -u -N --- xotcl/doc/metadataAnalyzer-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/metadataAnalyzer-xotcl.html (revision 0) @@ -1,599 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/metadataAnalyzer.xotcl - - - -

    - ./library/lib/metadataAnalyzer.xotcl - ./library/lib/metadataAnalyzer.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::metadataAnalyzer 0.84 -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./library/lib/metadataAnalyzer.xotcl - -
    -
    - - - - - -
    - Description: - - - XOTcl file analyzer for @ metadata. E.g.\ used for - doumentation with xoDoc (but in the static variant - StaticMetadataAnalyzer which uses the dynamic - variant in this file). -

    - Sample sample usage: -

    -    package require xotcl::metadataAnalyzer
    -
    -    # instantiate metadata analyzer object
    -    MetadataAnalyzer @::m
    -    # make this object be known to @ and turn @ metadata processing on
    -    @ analyzerObj @::m
    -    @ onOff 1
    -
    -    # read in some metadata tags (in sample file) & execute the file
    -    source lib/testx.xotcl
    -
    -    # turn @ metadata processing off again
    -    @ onOff 0
    -
    -    # print out all collected metadata
    -    puts [@::m print]
    -    
    - -
    -
    -
    -

    - - - -

    Object: @

    - Class: AnalyzerCmd -
    - - - - - - - -
    - Description: - - Recreate @ with metadata analyis funtionality. -
    -

    -
    -

    - - - -

    Class: AnalyzerCmd

    - Class: Class -
    - - - - - - - -
    - Description: - - Class that overload the unknown mechanism of @ to provide metadata analysis. -
    -

    -
    -

    - - - -

    Class: ClassToken

    - Class: Class -
    - Heritage: ObjToken -
    - - - - - - - -
    - Description: - - - Token for Class metadata. Contains additional parameters: - "instprocList" = list of all instproc token. - -
    -

    -
    -

    - - - -

    Class: ConstraintToken

    - Class: Class -
    - Heritage: MetadataToken -
    - - - - - - - -
    - Description: - - - Token for @Constraint Metadata. - -
    -

    -
    -

    - - - -

    Class: FileToken

    - Class: Class -
    - Heritage: MetadataToken -
    - - - - - - - -
    - Description: - - - Token for @File Metadata. - -
    -

    -
    -

    - - - -

    Class: InstprocToken

    - Class: Class -
    - Heritage: MethodToken -
    - - - - - - - -
    - Description: - - - Token for Instproc metadata. - -
    -

    -
    -

    - - - -

    Class: MetaClassToken

    - Class: Class -
    - Heritage: ClassToken -
    - - - - - - - -
    - Description: - - - Token for Meta-Class metadata. - -
    -

    -
    -

    - - - -

    Class: MetadataAnalyzer

    - Class: Class -
    - Procs/Instprocs: - print. - - - - - -
    - Description: - - Handler class for building a metadata runtime structure -
    -

    Instprocs

    -
      -
    • - - - - print - - - - - - -
      - Description: - - Print all collected token information to stdout. - This method is also an exmaple how the tokens can be used. -
      -
    • -
    -

    -
    -

    - - - -

    Class: MetadataToken

    - Class: Class -
    - Procs/Instprocs: - print, printProperties, sortTokenList. - - - - - -
    - Description: - - - Each collected metadata element is stored in a token object. - MetadataToken is superclass of token object classes. Each metadata token - has two interesting parameters: -

    - "properties" contains list of all described metadata properties. E.g. can - be printed with -

    -    foreach p [my set properties] { 
    -      if {[my exists $p]} {
    -        append c "    $p=[my set $p]\n"
    -      }
    -    }
    -    
    - "name" contains the method, object, ... name of the metadata element. -

    - All metadata token are aggregated by @. Therefore, -

    -    foreach mdt [@ info children] { 
    -      if {[$mdt istype MetadataToken]} {$mdt print}
    -    }
    -    
    - prints all token. - - -
    -

    Instprocs

    -
      -
    • - - - - printProperties - - - - - - -
      - Description: - - Print metadata properties to stdout. -
      -
    • -
    • - - - - abstract - print - - - - - - -
      - Description: - - - Abstract method for printing a token to stdout. - -
      -
    • -
    -

    Procs

    -
      -
    • - - - - sortTokenList - l - - - - - - - - - - -
      - Arguments: - - l: token list -
      - Description: - - Sort a token list with names. Since names are autonames, - this means order of appearance in the program. -
      -
    • -
    -

    -
    -

    - - - -

    Class: MethodToken

    - Class: Class -
    - Heritage: MetadataToken -
    - - - - - - - -
    - Description: - - - Token for Method metadata. Contains additional parameters: - "arguments" of the method, "returnValue" of the method, - "obj" name, "abstract" = 0 or 1 (whether its an abstract method or not). - -
    -

    -
    -

    - - - -

    Class: ObjToken

    - Class: Class -
    - Heritage: MetadataToken -
    - - - - - - - -
    - Description: - - - Token for Object metadata. Contains additional parameters: - "procList" = list of all proc token and "cl"= class name. - -
    -

    -
    -

    - - - -

    Class: PackageToken

    - Class: Class -
    - Heritage: MetadataToken -
    - - - - - - - -
    - Description: - - - Token for Package metadata. Contains additional parameters: - "version" of the package and "type"= either "require" or "provide". - - -
    -

    -
    -

    - - - -

    Class: ProcToken

    - Class: Class -
    - Heritage: MethodToken -
    - - - - - - - -
    - Description: - - - Token for Proc metadata - -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/mixinStrategy-xotcl.html =================================================================== diff -u -N --- xotcl/doc/mixinStrategy-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/mixinStrategy-xotcl.html (revision 0) @@ -1,245 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/mixinStrategy.xotcl - - - -

    - ./library/lib/mixinStrategy.xotcl - ./library/lib/mixinStrategy.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::mixinStrategy 0.8 -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./library/lib/mixinStrategy.xotcl - -
    -
    - - - - - -
    - Description: - - - These methods provide support for managing "strategies", i.e. - mixin-classes, where only one kind of a family of conformant - mixins should be registered. -

    - Naming convertions for strategies: - All strategies must follow the naming convention 'kind=implementation'. - Examples are the persistency strategy 'eager' specfied as - 'persistent=eager' or the persistency strategy 'lazy' (specified as - 'persistent=lazy') - -

    -
    -
    -

    - - - -

    Class: Object

    - Procs/Instprocs: - add, mixinQueryStrategy, mixinStrategy, remove. - -
    -

    Instprocs

    -
      -
    • - - - - mixinStrategy - strategy - - - - - - - - - - - - - - -
      - Arguments: - - strategy: Strategy to be added -
      - Description: - - - This method adds or replaces a new strategy from the mixin - list. Strategies are named following the converntion mentioned - above. - -
      - Return: - - old strategy -
      -
    • -
    • - - - - mixinQueryStrategy - kind - - - - - - - - - - - - - - -
      - Arguments: - - kind: strategy kind -
      - Description: - - - This method searches the mixin list for a mixin of this - kind (starting with $kind=) - -
      - Return: - - returns the maching strategy -
      -
    • -
    • - - - - add - construct - args - - - - - - - - - - - - - - - - - - -
      - Arguments: - - construct: (inst) 'filter' or 'mixin' -
      - - - args: to be added -
      - Description: - - add the specified (inst) 'filters' or 'mixins' -
      - Return: - - empty -
      -
    • -
    • - - - - remove - construct - args - - - - - - - - - - - - - - - - - - -
      - Arguments: - - construct: (inst) 'filter' or 'mixin' -
      - - - args: to be removed -
      - Description: - - remove the specified (inst) 'filters' or 'mixins' -
      - Return: - - empty -
      -
    • -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/next-path-mixin-movement.gif =================================================================== diff -u -N -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -rc72f9f638677608fab1502cd696c8f2d6b2952f9 Binary files differ Index: xotcl/doc/next-path.gif =================================================================== diff -u -N -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -rc72f9f638677608fab1502cd696c8f2d6b2952f9 Binary files differ Index: xotcl/doc/obj_class_system.gif =================================================================== diff -u -N -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -rc72f9f638677608fab1502cd696c8f2d6b2952f9 Binary files differ Index: xotcl/doc/observer-xotcl.html =================================================================== diff -u -N --- xotcl/doc/observer-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/observer-xotcl.html (revision 0) @@ -1,53 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/scripts/observer.xotcl - - - -

    - ./apps/scripts/observer.xotcl - ./apps/scripts/observer.xotcl

    -
    -

    -

    Package/File Information

    - No package provided/required -
    -
    - Filename: - - ./apps/scripts/observer.xotcl - -
    -
    - - - - - -
    - Description: - - - Simple observer pattern meta-class taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/openacs-4/readme.txt =================================================================== diff -u -N --- xotcl/doc/openacs-4/readme.txt (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/openacs-4/readme.txt (revision 0) @@ -1,51 +0,0 @@ -This is the OpenACS Community System. - -OpenACS (Open ArsDigita Community System) is an advanced toolkit for -building scalable, community-oriented web applications. - -The original ACS, which formed the foundation of OpenACS is described -in http://photo.net/wtr/thebook/community.html - -The original ACS was Copyright (C) 1995-2000 ArsDigita Corporation -and, in some cases, individual authors. - -OpenACS is a community created and supported software system, visit -http://openacs.org for more information. - -The major change in OpenACS 4.x is its database-independence; it can -use either PostgreSQL (7.1 or later) or Oracle (8.1.6 or later). - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - --------------- - -Documentation for this system is at viewable via your favorite browser -at http://openacs.org/doc - -For installation instructions, please see -http://openacs.org/4/ - -Once your service is up and running, this same documenation is -available at - -http://yourservicename/www/doc/ - -The release notes for this release are available at -packages/acs-core-docs/www/release-notes/. - -This is an early development version of OpenACS 4.x. Production use -is NOT recommended. Please report bugs via http://openacs.org/sdm - - Index: xotcl/doc/package-xotcl.html =================================================================== diff -u -N --- xotcl/doc/package-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/package-xotcl.html (revision 0) @@ -1,150 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/package.xotcl - - - -

    - ./library/lib/package.xotcl - ./library/lib/package.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::package 0.91 -
    - Package required: xotcl::mixinStrategy -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./library/lib/package.xotcl - -
    -
    - - - - - -
    - Description: - - - Represent Tcl package loading command by an XOTcl - object. Enables tracking, tracing, and verbose output - of package loading - -
    -
    -
    -

    - - - -

    Object: package

    - Class: Object -
    - Procs - present, verbose. - - - - - -
    - Description: - - - Supports all Tcl package options plus present and verbose. - -
    -

    Procs

    -
      -
    • - - - - present - args - - - - - - - - - - -
      - Arguments: - - args: packageName or -exact packageName -
      - Description: - - - Check whether a package is present or not. Similar to Tcl's - package present, but works with Tcl < 8.3 - -
      -
    • -
    • - - - - verbose - v - - - - - - - - - - -
      - Arguments: - - v: 1 or 0 -
      - Description: - - - Toggle verbose output on/off. If on, package prints the locations - from where packages are loaded to the screen. Default is off. - -
      -
    • -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/parameter-xotcl.html =================================================================== diff -u -N --- xotcl/doc/parameter-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/parameter-xotcl.html (revision 0) @@ -1,41 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/scripts/parameter.xotcl - - - -

    - ./apps/scripts/parameter.xotcl - ./apps/scripts/parameter.xotcl

    -
    -

    -

    Package/File Information

    - No package provided/required -
    -
    - Filename: - - ./apps/scripts/parameter.xotcl - -
    -
    - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/persistenceExample-xotcl.html =================================================================== diff -u -N --- xotcl/doc/persistenceExample-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/persistenceExample-xotcl.html (revision 0) @@ -1,41 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/store/persistenceExample.xotcl - - - -

    - ./library/store/persistenceExample.xotcl - ./library/store/persistenceExample.xotcl

    -
    -

    -

    Package/File Information

    - Package required: xotcl::store::persistence -
    -
    - Filename: - - ./library/store/persistenceExample.xotcl - -
    -
    - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/pinger-xotcl.html =================================================================== diff -u -N --- xotcl/doc/pinger-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/pinger-xotcl.html (revision 0) @@ -1,54 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/scripts/pinger.xotcl - - - -

    - ./apps/scripts/pinger.xotcl - ./apps/scripts/pinger.xotcl

    -
    -

    -

    Package/File Information

    - No package provided/required -
    -
    - Filename: - - ./apps/scripts/pinger.xotcl - -
    -
    - - - - - -
    - Description: - - - Pinger example for the observer pattern taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - It demonstrates how to observe a network connection. - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/pkgIndex.tcl =================================================================== diff -u -N --- xotcl/doc/pkgIndex.tcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/pkgIndex.tcl (revision 0) @@ -1,11 +0,0 @@ -# Tcl package index file, version 1.1 -# This file is generated by the "pkg_mkIndex -direct" command -# and sourced either when an application starts up or -# by a "package unknown" script. It invokes the -# "package ifneeded" command to set up package-related -# information so that packages will be loaded automatically -# in response to "package require" commands. When this -# script is sourced, the variable $dir must contain the -# full path name of this file's directory. - -package ifneeded XOTcl-langRef 1.0 [list source [file join $dir langRef.xotcl]] Index: xotcl/doc/secure-webclient-xotcl.html =================================================================== diff -u -N --- xotcl/doc/secure-webclient-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/secure-webclient-xotcl.html (revision 0) @@ -1,58 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/comm/secure-webclient.xotcl - - - -

    - ./apps/comm/secure-webclient.xotcl - ./apps/comm/secure-webclient.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    - Package required: xotcl::comm::httpAccess -
    - Package required: xotcl::comm::ftp -
    - Package required: xotcl::trace -
    -
    - Filename: - - ./apps/comm/secure-webclient.xotcl - -
    -
    - - - - - -
    - Description: - - - A sample secure web client that queries an secure web-server. - It needs to be adopted with different https URLs for testing... - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/secure-webserver-xotcl.html =================================================================== diff -u -N --- xotcl/doc/secure-webserver-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/secure-webserver-xotcl.html (revision 0) @@ -1,60 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/comm/secure-webserver.xotcl - - - -

    - ./apps/comm/secure-webserver.xotcl - ./apps/comm/secure-webserver.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    - Package required: xotcl::trace -
    - Package required: xotcl::comm::httpd -
    -
    - Filename: - - ./apps/comm/secure-webserver.xotcl - -
    -
    - - - - - -
    - Description: - - - This small secure web server that provides its documents - via SSL (https, port 8443) and plain http (port 8086). -
    - This file requires TLS. If you experice problems with - versions obtained from the Web, contact gustaf.neumann@wu-wien.ac.at - for a patch. - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/simpleFilters-xotcl.html =================================================================== diff -u -N --- xotcl/doc/simpleFilters-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/simpleFilters-xotcl.html (revision 0) @@ -1,54 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/scripts/simpleFilters.xotcl - - - -

    - ./apps/scripts/simpleFilters.xotcl - ./apps/scripts/simpleFilters.xotcl

    -
    -

    -

    Package/File Information

    - No package provided/required -
    -
    - Filename: - - ./apps/scripts/simpleFilters.xotcl - -
    -
    - - - - - -
    - Description: - - - Some simple examples of (inst)filters taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. They demonstrate filters, - filter chains and filter inheritance. - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/soccerClub-xotcl.html =================================================================== diff -u -N --- xotcl/doc/soccerClub-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/soccerClub-xotcl.html (revision 0) @@ -1,53 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/scripts/soccerClub.xotcl - - - -

    - ./apps/scripts/soccerClub.xotcl - ./apps/scripts/soccerClub.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    -
    - Filename: - - ./apps/scripts/soccerClub.xotcl - -
    -
    - - - - - -
    - Description: - - - This is a simple introductory example for the language XOTcl. - It demonstrates the basic language constructs on the example of - a soccer club. - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/speedtest-xotcl.html =================================================================== diff -u -N --- xotcl/doc/speedtest-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/speedtest-xotcl.html (revision 0) @@ -1,54 +0,0 @@ - - - - - XOTcl - Documentation -- ./tests/speedtest.xotcl - - - -

    - ./tests/speedtest.xotcl - ./tests/speedtest.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    - Package required: xotcl::test -
    -
    - Filename: - - ./tests/speedtest.xotcl - -
    -
    - - - - - -
    - Description: - - - Regression and speed test for various ways to achieve a similar - behaviour. - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/staticMetadata-xotcl.html =================================================================== diff -u -N --- xotcl/doc/staticMetadata-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/staticMetadata-xotcl.html (revision 0) @@ -1,121 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/staticMetadata.xotcl - - - -

    - ./library/lib/staticMetadata.xotcl - ./library/lib/staticMetadata.xotcl

    -
    -

    -

    Package/File Information

    - Package required: xotcl::metadataAnalyzer -
    - Package provided: xotcl::staticMetadataAnalyzer 0.84 -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./library/lib/staticMetadata.xotcl - -
    -
    - - - - - -
    - Description: - - - XOTcl file static analyzer for @ metadata. E.g. used for - doumentation with xoDoc. I.e. allows for reading in a - file and evaluating the metadata-related info only. - -
    -
    -
    -

    - - - -

    Class: StaticMetadataAnalyzer

    - Class: Class -
    - Heritage: MetadataAnalyzer -
    - Procs/Instprocs: - analyzeFile. - - - - - -
    - Description: - - - Metadata analyzer class that allows for reading in files - and evaluation of the metadata content in the file. - -
    -

    Instprocs

    -
      -
    • - - - - analyzeFile - name - - - - - - - - - - -
      - Arguments: - - name: File name -
      - Description: - - Analyze a file and build up a token structure for each metadata token in the file. -
      -
    • -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/test-xotcl.html =================================================================== diff -u -N --- xotcl/doc/test-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/test-xotcl.html (revision 0) @@ -1,94 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/test.xotcl - - - -

    - ./library/lib/test.xotcl - ./library/lib/test.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::test 1.03 -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./library/lib/test.xotcl - -
    -
    - - - - - -
    - Description: - - - Simple regression test support. - -
    -
    -
    -

    - - - -

    Class: Test

    - Class: Class -
    - - - - - - - -
    - Description: - - - Class Test is used to configure test instances, which can - be configured by the following parameters: -
      -
    • cmd: the command to be executed
    • -
    • expected: the expected result
    • -
    • count: number of executions of cmd
    • -
    • pre: a command to be executed at the begin of the test (before cmd)
    • -
    • post: a command to be executed after the test (after all cmds)
    • -
    - The defined tests can be executed by Test run - -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/testo-xotcl.html =================================================================== diff -u -N --- xotcl/doc/testo-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/testo-xotcl.html (revision 0) @@ -1,108 +0,0 @@ - - - - - XOTcl - Documentation -- ./tests/testo.xotcl - - - -

    - ./tests/testo.xotcl - ./tests/testo.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./tests/testo.xotcl - -
    -
    - - - - - -
    - Description: - - - This is a class which provides regression test objects - for the OTcl derived features of the XOTcl - Language. - This script is based upon the test.tcl script of the OTcl distribution - and adopted for XOTcl. - -
    -
    -
    -

    - - - -

    Class: TestClass

    - Class: Class -
    - - - - - - - -
    - Description: - - - A meta-class for test objects. - -
    -

    -
    -

    - - - -

    Class: TestSuite

    - Class: Class -
    - - - -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/testx-xotcl.html =================================================================== diff -u -N --- xotcl/doc/testx-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/testx-xotcl.html (revision 0) @@ -1,692 +0,0 @@ - - - - - XOTcl - Documentation -- ./tests/testx.xotcl - - - -

    - ./tests/testx.xotcl - ./tests/testx.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./tests/testx.xotcl - -
    -
    - - - - - -
    - Description: - - - This is a file which provides a regression test - for the features of the XOTcl - Language. - -
    -
    -
    -

    - - - -

    Class: TestX

    - Class: Class -
    - - - -
    -

    -
    -

    - - - -

    Object: assertions

    - Class: TestX -
    - - - - - - - -
    - Description: - - Regression test object testing the assertions. -
    -

    -
    -

    - - - -

    Object: condMixins

    - Class: TestX -
    - - - - - - - -
    - Description: - - - Regression test for conditional mixins - -
    -

    -
    -

    - - - -

    Object: copymove

    - Class: TestX -
    - - - - - - - -
    - Description: - - - Regression test for copy/move methods - -
    -

    -
    -

    - - - -

    Object: filterAddRemove

    - Class: TestX -
    - - - - - - - -
    - Description: - - Regression test object testing adding/removing of filters. -
    -

    -
    -

    - - - -

    Object: filterClassChange

    - Class: TestX -
    - - - - - - - -
    - Description: - - Regression test object testing class changes of filters. -
    -

    -
    -

    - - - -

    Object: filterGuards

    - Class: TestX -
    - - - - - - - -
    - Description: - - Regression test object testing filter guards. -
    -

    -
    -

    - - - -

    Object: filterInfo

    - Class: TestX -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - Description{: - - Regression -
    - Test: - - object -
    - Testing: - - introspection -
    - Of: - - filters. -
    - }: - - -
    -

    -
    -

    - - - -

    Object: filterSimpleObserver

    - Class: TestX -
    - - - - - - - -
    - Description: - - Regression test object testing a simple observer using filters. -
    -

    -
    -

    - - - -

    Object: init_params

    - Class: TestX -
    - - - - - - - -
    - Description: - - - Regression test object testing the parameter instance method, - the init dash '-' and constructor calling. - -
    -

    -
    -

    - - - -

    Object: mixinGuards

    - Class: TestX -
    - - - - - - - -
    - Description: - - Regression test object testing mixin guards. -
    -

    -
    -

    - - - -

    Object: mixinInheritanceTest

    - Class: TestX -
    - - - - - - - -
    - Description: - - - Regression test object testing per-object mixin inheritance. - -
    -

    -
    -

    - - - -

    Object: mixinTest

    - Class: TestX -
    - - - - - - - -
    - Description: - - - Regression test object testing per-object mixins. - -
    -

    -
    -

    - - - -

    Object: nestingClasses

    - Class: TestX -
    - - - - - - - -
    - Description: - - Regression test object testing the class nesting feature. -
    -

    -
    -

    - - - -

    Object: nestingObjects

    - Class: TestX -
    - - - - - - - -
    - Description: - - Regression test object testing the object nesting feature. -
    -

    -
    -

    - - - -

    Object: nextTest

    - Class: TestX -
    - - - - - - - -
    - Description: - - - Regression test object testing the next primitive. - -
    -

    -
    -

    - - - -

    Object: objectReferences

    - Class: TestX -
    - - - - - - - -
    - Description: - - - Regression test for object and class references in tcl_objs - -
    -

    -
    -

    - - - -

    Object: recreation

    - Class: TestX -
    - - - - - - - -
    - Description: - - - Regression test for object recreation/cleanup. - -
    -

    -
    -

    - - - -

    Object: smallScripts

    - Class: TestX -
    - - - - - - - -
    - Description: - - - Regression test object testing arbitrary features. - -
    -

    -
    -

    - - - -

    Object: stdargs

    - Class: TestX -
    - - - - - - - -
    - Description: - - - Regression test object testing the ability of the next primitive to pass - arguments without naming them. - -
    -

    -
    -

    - - - -

    Object: volatileObjects

    - Class: TestX -
    - - - - - - - -
    - Description: - - - Regression test for volatile objects - -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/trace-xotcl.html =================================================================== diff -u -N --- xotcl/doc/trace-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/trace-xotcl.html (revision 0) @@ -1,431 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/trace.xotcl - - - -

    - ./library/lib/trace.xotcl - ./library/lib/trace.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::trace 0.91 -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./library/lib/trace.xotcl - -
    -
    - - - - - -
    - Description: - - - Various tracing tools for the XOTcl language. - -
    -
    -
    -

    - - - -

    Class: Object

    - Procs/Instprocs: - lintFilter, showCall, showClass, showMsg, showStack, showTimeEnd, showTimeStart, showVars, statFilter, traceFilter. - -
    -

    Instprocs

    -
      -
    • - - - - traceFilter - args - - - - - - - - - - - - - - -
      - Arguments: - - args: arbitrary args -
      - Description: - - - Filter to trace every method call on an object or class hierarchy. - Outputs a message befora and after each call of the traced object. - -
      - Return: - - empty string -
      -
    • -
    • - - - - lintFilter - - - - - - -
      - Description: - - Experimental lint filter -
      -
    • -
    • - - - - statFilter - - - - - - -
      - Description: - - Experimental statistics filter -
      -
    • -
    • - - - - showVars - args - - - - - - - - - - -
      - Arguments: - - args: ist of variables -
      - Description: - - Show the values of the specified variables (or of all variables) - of an object on stderr. -
      -
    • -
    • - - - - showMsg - msg - - - - - - - - - - -
      - Arguments: - - msg: optional output -
      - Description: - - Show a message msg with the form "[self] $cls->$method $msg" on stderr. -
      -
    • -
    • - - - - showClass - - - - - - -
      - Description: - - Show classes and mixins of the object -
      -
    • -
    • - - - - showStack - maxDepth - - - - - - - - - - -
      - Arguments: - - maxDepth: max stack depth, default=100 -
      - Description: - - Show callstack up to the specified calldepth. -
      -
    • -
    • - - - - showCall - - - - - - -
      - Description: - - Show the current call with the form "[self] $cls->$method $args" on stderr. -
      -
    • -
    • - - - - showTimeStart - ?handle? - - - - - - - - - - -
      - Arguments: - - ?handle?: Handle object name, optional -
      - Description: - - start a timer -
      -
    • -
    • - - - - showTimeEnd - ?handle? - - - - - - - - - - -
      - Arguments: - - ?handle?: Handle object name, optional -
      - Description: - - end a timer and show result -
      -
    • -
    -

    -
    -

    - - - -

    Object: Trace

    - Class: Object -
    - Procs - closeTraceFile, openTraceFile, puts. - - - - - -
    - Description: - - - Write trace outputs and produce statistics. Variable traceStream - defines where to write trace output (default: stderr). - -
    -

    Procs

    -
      -
    • - - - - puts - line - - - - - - - - - - -
      - Arguments: - - line: output line -
      - Description: - - - Define how traceFilter writes to the output stream. Default: - write to trace stream. - -
      -
    • -
    • - - - - openTraceFile - name - - - - - - - - - - -
      - Arguments: - - name: file name -
      - Description: - - - Redirect trace output to file. - -
      -
    • -
    • - - - - closeTraceFile - name - - - - - - - - - - -
      - Arguments: - - name: file name -
      - Description: - - - Close trace file and redirect output to stderr. - -
      -
    • -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/tutorial.html =================================================================== diff -u -N --- xotcl/doc/tutorial.html (revision 57972e5a2972b1eb5dd63f6e3d483670117feebf) +++ xotcl/doc/tutorial.html (revision 0) @@ -1,4782 +0,0 @@ - - - - - XOTcl - Tutorial - - - - - - - - - - - -
    -

    XOTcl - - Tutorial - Index -

    -
    -
    -

    Version: 1.5.5

    - - - - - - - - - - -
    -

    Introduction - -

    -
    -
    - - -

     
    Language Overview -

    - -

    XOTcl [Neumann and Zdun 2000a] is an extension -to the object-oriented scripting language OTcl [Wetherall and Lindblad 1995] which itself extends -Tcl [Ousterhout 1990] (Tool Command Language) with -object-orientation. XOTcl is a value-added replacement for OTcl and -does not require OTcl to compile.

    - -

    XOTcl runs in the tclsh and provides a few extension -commands. These are offered in a Tcl namespace ::xotcl, and -can be imported into the current namespace to reduce typing and -improve readability. All Tcl commands remain available (and are also -applicable on the extension constructs).

    - -

    A central property of Tcl is, that it uses strings solely for the -representation of data. Internally it uses an dynamic type system with -automatic conversion (which enables efficient type handling). For -that reason all components (e.g. written in C) once integrated in Tcl -automatically fit together and the components can be reused in -unpredicted situations without change. The evolving component -frameworks provide a high degree of code reuse, rapid -application development, and ease of use. The application developer -may concentrate on the application task solely, rather than investing -efforts in fitting components together. Therefore, in certain -applications scripting languages like Tcl are very useful for a fast -and high-quality development of software (see [Ousterhout 1998] for more details). -

    -

    Tcl is equipped with appropriate functionalities for the easy -gluing of components, like dynamic typing, dynamic extensibility, and -read/write introspection. OTcl is an object-oriented extension to Tcl, -which encourages a Tcl-like programming style and is composed of -language constructs with properties similar to Tcl. It offers an -object-orientation with encapsulation of data and operation without -protection mechanisms and single and multiple inheritance. -Furthermore it enables to change the relationships dynamically, offers -read/write introspection, has a three level class system based on -meta-classes and offers method chaining. These abilities are -integrated in XOTcl with only slight changes to OTcl visible to the -programmer. -

    -

    The XOTcl extension aims at complexity and adaptability issues that -may occur in context of large (object-oriented) software structures -and in the context of component glueing. In particular we added the -following support: -

    -
      -
    • Filters as a means of - abstractions over method invocations to implement large program - structures, like design patterns. -

      -
    • Mixin Classes, as a - means to give an object or a classes' instances access to several different supplemental - classes, which may be changed dynamically. -

      -
    • Dynamic Object Aggregations, - to provide dynamic aggregations through nested namespaces. -

      -
    • Nested Classes, to reduce - the interference of independently developed program structures. -

      -
    • Assertions, to reduce the - interface and the reliability problems caused by dynamic typing and, - therefore, to ease the combination of components. -

      -
    • Forwarders, to delegate - calls efficiently to other objects or classes. -

      -
    • Slots, to manage values - of instance variables with a common interface. -

      -
    • Meta-data and Automatic Documentation, to enhance self-documentation of objects - and classes. -

      -
    - - - -


    -

    -

    -   -

    -

    Figure 1: -Language Extensions of XOTcl -

    -
    - - - - - -
    -

    -
    -
    - - -

     
    Introductory Overview Example: Soccer Club -

    -

    -To give you an impression of the language before we go into the -details of the language construct, we present in this section a -simple, introductory example. It shall demonstrate the basic -language constructs on the example of a soccer club (the full code can -be found in the xotcl/src/scripts/soccerClub.xotcl file. All -the characters in this example are fictitious, and any resemblance to -actual persons, living or deceased, is coincidental. -

    -

    -In XOTcl we do not have to provide a file description as a comment, -but we can use the @ object, which is used generally to -provide any kind of information, meta-data, and documentation on a -running program. Here, we just give a file description. Then the -makeDoc.xotcl tool can automatically document the program file for -us. -

    -
    -  @ @File {
    -    description {
    -      This is a simple introductory example for the language XOTcl. 
    -      It demonstrates the basic language constructs on the example of
    -      a soccer club.
    -    }
    -  }
    -
    -

    - -All things and entities in XOTcl are objects, a special kind of objects -are classes. These define common properties for other objects. For a -soccer club, we firstly require a common class for all kinds of members. -

    -

    -Common to all members is that they have a name. Common properties -defined across all instances of a class are called 'parameter' in -XOTcl. In this example the instance variable name will be -initialized by default with an empty string. -

    -
    -  Class ClubMember -parameter {{name ""}}
    -
    -

    -A special club member is a Player. Derived classes can be -build with inheritance (specified through -superclass). Players may have a playerRole (defaults -to NONE). -

    -
    -  Class Player -superclass ClubMember -parameter {{playerRole NONE}}
    -
    -

    -Other club member types are trainers, player-trainers, and presidents: -

    -
    -  Class Trainer -superclass ClubMember
    -  Class President -superclass ClubMember
    -
    -

    -The PlayerTrainer uses multiple inheritances by being both a player -and a trainer: -

    -
    -  Class PlayerTrainer -superclass {Player Trainer}
    -
    -

    -Now we define the SoccerTeam class: -

    -
    -  Class SoccerTeam -parameter {name location type}
    -
    -

    -We may add a player. This is done by a method. Instance methods are -in XOTcl defined with instproc. All club members are aggregated in -the team (denoted by :: namespace syntax). -

    -
    -  SoccerTeam instproc newPlayer args {
    -    # we create a new player who is part of the soccer team
    -    # "eval" is needed to pass the provided arguments to the call of new
    -    eval Player new -childof [self] $args
    -  }
    -
    -

    -A player can be transfered to another team. The player object does -not change internally (e.g. the playerRole stays the same). Therefore we -move it to the destination team. -

    -
    -  SoccerTeam instproc transferPlayer {playername destinationTeam} {
    -    # We use the aggregation introspection option children in order
    -    # to get all club members
    -    foreach player [my info children] {
    -      # But we only remove matching playernames of type "Player". We do
    -      # not want to remove another club member type who has the same
    -      # name.
    -      if {[$player istype Player] && [$player name] == $playername} {
    -        # We simply 'move' the player object to the destination team.
    -        # Again we use a unique autoname in the new scope
    -        $player move [set destinationTeam]::[$destinationTeam autoname player%02d]
    -      }
    -    }
    -  }
    -
    -

    -Finally we define two convenience to print the members/players to -the stdout with puts. -

    -
    -  SoccerTeam instproc printMembers {} {
    -    puts "Members of [my name]:"
    -    foreach m [my info children] {puts "  [$m name]"}
    -  }
    -  SoccerTeam instproc printPlayers {} {
    -    puts "Players of [my name]:"
    -    foreach m [my info children] {
    -      if {[$m istype Player]} {puts "  [$m name]"}
    -    }
    -  }
    -
    -

    -Now let us build to example soccer team objects. -

    -
    -  SoccerTeam chelsea -name "Chelsea FC" -location "Chelsea"
    -  SoccerTeam bayernMunich -name "F.C. Bayern M�nchen" -location "Munich"
    -
    -

    - -With addPlayer we can create new aggregated player objects -

    -Let us start some years in the past, when "Franz Beckenbauer" was -still a player. -

    -
    -  set fb [bayernMunich newPlayer -name "Franz Beckenbauer" \
    -    -playerRole PLAYER]
    -
    -

    -playerRole may not take any value. It may either be NONE, PLAYER, -or GOALY ... such rules may be given as assertions (here: an instinvar -gives an invariant covering all instances of a class). In XOTcl -the rules are syntactically identical to if statements: -

    -
    -  Player instinvar {
    -      {[my playerRole] == "NONE" ||  
    -       [my playerRole] == "PLAYER" || 
    -       [my playerRole] == "GOALY"}
    -  }
    -
    -

    -If we break the invariant and turn assertions checking on, we should -get an error message: -

    -
    -  $fb check all
    -  if {[catch {$fb set playerRole SINGER} errMsg]} {
    -    puts "CAUGHT EXCEPTION: playerRole has either to be NONE, PLAYER, or TRAINER"
    -    # turn assertion checking off again and reset to PLAYER
    -    $fb check {}
    -    $fb set playerRole PLAYER
    -  }
    -
    -

    -But soccer players may play quite different, orthogonal -roles. E.g. Franz Beckenbauer was also a singer (a remarkably bad -one). However, we can not simply add such orthogonal, extrinsic -extensions with multiple inheritance or delegation. Otherwise we -would have either to build a lot of unnecessary helper classes, like -PlayerSinger, PlayerTrainerSinger, etc., or we would have to build -such helper objects. This either leads to an unwanted combinatorial -explosion of class or object number -

    -Here we can use a per-object mixin, which is a language construct -that expresses that a class is used as a role or as an extrinsic -extension to an object. -

    -First we just define the Singer class. -

    -
    -  Class Singer
    -  Singer instproc sing text {
    -    puts "[my name] sings: $text, lala."
    -  }
    -
    -

    -Now we register this class as a per-object mixin on the player object: -

    -
    -  $fb mixin Singer
    -
    -

    -And now Franz Beckenbauer is able to sing: -

    -
    -  $fb sing "lali"
    -
    -

    -But Franz Beckenbauer has already retired. When a player retires, we -have an intrinsic change of the classification. He *is* not a player -anymore. But still he has the same name, is club member, and -is a singer (brrrrrr). -

    -Before we perform the class change, we extend the Player class to -support it. I.e. the playerRole is not valid after class change -anymore (we unset the instance variable). -

    -
    -  Player instproc class args {
    -    my unset playerRole
    -    next
    -  }
    -
    -

    -Now we can re-class the player object to its new class (now Franz -Beckenbauer is President of Bayern Munich. -

    -
    -  $fb class President
    -  # Check that the playerRole isn't there anymore.
    -  if {[catch {$fb set playerRole} errMsg]} {
    -    puts "CAUGHT EXCEPTION: The player role doesn't exist anymore \
    -         (as it should be after the class change)"
    -  }
    -
    -

    -But still Franz Beckenbauer can entertain us with what he believes -is singing: -

    -
    -  $fb sing "lali"
    -
    -

    -Now we define some new players for Bayern Munich: -

    -
    -  bayernMunich newPlayer -name "Oliver Kahn" -playerRole GOALY
    -  bayernMunich newPlayer -name "Giovanne Elber" -playerRole PLAYER
    -
    -

    -If we enlist the players of Munich Franz Beckenbauer is not enlisted -anymore: -

    -
    -  bayernMunich printPlayers
    -
    -

    -But as a president he still appears in the list of members: -

    -
    -  bayernMunich printMembers
    -
    -

    -Now consider an orthonogal extension of a transfer list. Every -transfer in the system should be notified. But since the transfer -list is orthogonal to SoccerTeams we do not want to interfere with -the existing implementation at all. Moreover, the targeted kind of -extension has also to work on all subclasses of SoccerTeam. Firstly, we -just create the extension as an ordinary class: -

    -
    -  Class TransferObserver
    -  TransferObserver instproc transferPlayer {pname destinationTeam} {
    -    puts "Player '$pname' is transfered to Team '[$destinationTeam name]'"
    -    next
    -  }
    -
    -

    -Now we can apply the class as a per-class mixin, which functions -exactly like a per-object mixin, but on all instances of a class and -its subclasses. The next primitive ensures that the original -method on SoccerTeam is called after notifying the transfer (with -puts to stdout): -

    -
    -  SoccerTeam instmixin TransferObserver
    -
    -

    -If we perform a transfer of one of the players, he is moved to the new -club and the transfer is reported to the stdout: -

    -
    -  bayernMunich transferPlayer "Giovanne Elber" chelsea
    -
    -

    -Finally we verify the transfer by printing the players: -

    -
    -  chelsea printPlayers
    -  bayernMunich printPlayers
    -
    -

    - -



    -

    - - - - - -
    -

    Object - and Class System -

    -
    -
    -

    In XOTcl every object is associated with a class over the class -relationship. Classes are special objects with the purpose of -managing other objects. ``Managing'' means that a class controls the -creation and destruction of its instances and that it contains a -repository of methods (``instprocs'') accessible for the instances. -Object-specific methods are called ``procs'', instance methods are -called ``instprocs''. -

    -

    The instance methods common to all objects are defined in the root -class Object (predefined or user-defined). Since a class is a -special (managing) kind of object it is managed itself by a special -class called ``meta-class'' (which manages itself). Meta-Classes are -used to define classes and to provides methods for these. Most -classes are defined by the predefined meta-class Class. One -interesting aspect of meta-classes is that by providing a constructor -pre-configured classes can be derived. Meta-classes can be used to -instantiate large program structures, like some design patterns (see -[Neumann and Zdun 1999a] for more -details), where the meta-class may holds the generic parts of the -structures. Since a meta-class is an entity of the program, it is -possible to collect these entities in pattern libraries for later -reuse easily (more details about meta-classes are given in a later section). -

    -

    XOTcl supports single and multiple inheritance. Classes are ordered -by the relationship superclass in a directed acyclic -graph. The root of the class hierarchy is the class Object. -A single object can be instantiated directly from this class. An -inherent problem of multiple inheritance is the problem of name -resolution, when for example two super-classes contain an instance -method with the same name. XOTcl provides an intuitive and unambiguous -approach for name resolution by defining the precedence order along a -linear ``next-path'' incorporating the class and mixin -hierarchies, which is modeled after CLOS. A method can invoke -explicitly the shadowed methods by the predefined command -next. When this command is executed a shadowed method is -``mixed into'' the execution of the current method. Method chaining -without explicit naming of the targeted method is very important for -languages supporting a dynamic class system, because one cannot always -predict which classes are currently participating in the inheritance -hierarchy at design time (often necessary in inheritance models, like -C++). -

    -

    An important feature of all XOTcl -objects is the read/write introspection. The reading introspection -abilities of XOTcl are packed compactly into the info -instance method which is available for objects and classes. All -obtained information can be changed at run-time dynamically with -immediate effect. Unlike languages with a static class concept, XOTcl -supports dynamic class/superclass relationships. At any time the class -graph may be changed entirely using the superclass method, or -an object may change its class through the class method. This -feature can be used for an implementation of a life-cycle or other -intrinsic changes of object properties (in contrast to extrinsic -properties e.g. modeled through roles and implemented through -per-object and per-class mixins [Neumann and -Zdun 1999c] ) . These changes can be achieved without loosing the -object's identity, its inner state, and its per-object behavior (procs -and per-object mixins). -

    -

    -   -

    -

    Figure 2: -Object and Class System -

    -
    - - - - - -
    -

    -
    -
    - - - - - -
    -

    Basic - Functionalities -

    -
    -
    -

     
    Objects -

    -

    Initially XOTcl offers two new commands: Object and -Class. They represent hooks to the features of the language. -This section discusses both of them in detail and shows how they -function in the context of XOTcl. Note, that even if most of this is -compatible to OTcl, a few changes occur. For this reason, this -section is no introduction to plain OTcl. The Object command -provides access to the Object class, which holds the common -features of all objects, and allows us to define new objects. Objects -are always instances of classes, therefore, objects defined with the -Object command are (initially) instances of the Object -class. But since they have no user-defined type, they may be referred -to as singular objects. As all other objects they may be -specialized by object-operations and -data. -

    -

    The object command has the following syntax: -

    -
    -  Object objName ?args?
    -

    -A command of this form is a short-cut for a message to the create -instance method (forwarded automatically by the unknown -mechanism, which is invoked every time the message dispatch system -discovers an unknown message): -

    -
    -  Object create objName ?args?
    -

    -It creates a new object of type Object with the name objName -(in fact it invokes a create call on the Object class). -objName becomes a new command, which allows us to access the -created object. Similar to the Object command it may be -used like a normal Tcl-command (using sub-commands to access the -object's methods). Therefore, this form of access is called -object-command approach. A simple example is an object which -holds the information of a kitchen. It is created by: -

    -
    -  Object kitchen
    -
    -

    -An object creation calls the constructor init of the -object's class. The destruction of an object is handled by the -destroy instance method. The general syntax of destroy -is: -

    -
    -  objName destroy
    -

    -E.g. the kitchen object is destroyed by: -

    -
    -  kitchen destroy
    -

    -To invoke a user-defined destruction process, it is possible to -overload this instance method in every class derived from object. -

    -

    -Note that the destruction of an object is performed by the -method destroy of Object (since every object is an instance -of Object, every object can call destroy). When an application class -overloads destroy, this method should contain a next in order -to reach the base class and to actually destroy the object. -

    -

    Data on Objects -

    -

    The Object class provides a range of operations to manage -objects, including those to manipulate data-structures on the -objects. They are similar to the same-named Tcl-commands: -

    -
    -  objName set varname ?value?
    -  objName unset v1 ?v2 ... vn?
    -
    -

    -The set instance method with given value option -allows us to manipulate an object-variable's value or to create a new -one, if the variable varname does not exist on the object so -far. Without value option the set operation queries -the variable and returns it's value, if the variable exists, -otherwise it produces an error message. The unset operation -deletes one or optionally a set of variables from an object. For -example the kitchen object can store information on the -color of the wall-paper by: -

    -
    -  kitchen set wallPaperColor white
    -

    -Similar to Tcl-variables the object variables are dynamical; they -may be set at run-time when they are needed and unset when they -become obsolete. E.g. the persons in the kitchen may be stored in an -array. If there are no persons in the kitchen the array is deleted: -

    -
    -  # Peter enters the kitchen to cook
    -  kitchen set persons(cook) Peter
    -  ...
    -  # Marion enters the kitchen to take one of the seats
    -  kitchen set persons(seat1) Marion 
    -  ...
    -  # Both Peter and Marion leave the kitchen
    -  # the array is deleted by unset
    -  kitchen unset persons
    -

    -Since XOTcl variables are internally realized through Tcl-variables -they may be treated like all Tcl-variables. For that reason they have -all Tcl-variable abilities, including the possibility to handle them -as lists or arrays (as seen in the last example). The array -command of Tcl is mapped to an XOTcl-command directly. An -object-oriented call to an object of the form -

    -
    -  objName array option arrayName args
    -

    -forwards its arguments to an array Tcl-command for the -object´s instance variable arrayName. It could be used like -the same-named Tcl-command, e.g. the command -

    -
    -  kitchen array names persons
    -

    -returns all indexes currently stored in the persons array. -

    -

    Similarly Tcl´s incr command is mapped to the -object system. A call with the syntax: -

    -
    -  objName incr varName ?value?
    -

    -increments varName with the given value (or without given -value with 1). -

    -

    Methods for Objects -

    -

    Methods in XOTcl resemble Tcl-procedures. On objects one can define -object-specific methods, called procs. Instance methods which are -defined on classes are called instprocs. A new proc is defined using -the proc instance method of the class Object: -

    -
    -  objName proc name args body
    -

    -The arguments of the proc instance method specify the name, -the arguments as a Tcl-list, and the body of the new proc. All of them -must be given, only one of args and body may be -empty. An example proc would be a method to let persons enter the -kitchen: -

    -
    -  kitchen proc enter {name} {
    -    [self] set persons($name) [clock seconds]
    -  }
    -

    -Here the predefined self command is used in one of three -possible ways, which allow us to access useful information when working -with XOTcl-methods, these are in particular: -

    -
      -
    • self: returns the - name of the object, which is currently in execution. This - command is similar to this in C++. It is - automatically generated on each object. If it is called from - outside of an XOTcl method, it produces the error message - "Can't find self". -

      -
    • self class: the self - command with the argument class returns the name of the - class, which holds the currently executing instproc. Note, that this - may be different to the class of the current object. If it is called - from a proc it returns an empty string. -

      -
    • self proc: the self command with the argument - proc returns the name of the currently executing - method (proc or instproc). -

      -
    -

    The method enter can be written in XOTcl as well with -less syntactic overhead by using the predefined primitive my -instead of [self]:

    -
    -  kitchen proc enter {name} {
    -    my set persons($name) [clock seconds]
    -  }
    -

    -

    Note, that there is a difference to the realization of these -object informations to OTcl. XOTcl uses commands in order to make -XOTcl-methods compatible to Tcl-procedures and accessible via -namespace-paths. OTcl uses the three variables self, class -and proc, which are filled automatically with proper values -by the interpreter each time a method is called. To gain backwards -compatibility XOTcl can be compiled with -DAUTOVARS to -provide these variables additionally. By default this option is turned off. -

    -

    Each XOTcl-method has its own scope for definition of local -variables for the executing method. In most cases when a method uses -object-variables, it is likely that the programmer wants to make one -or more of these variables part of the method's scope. Then the -Tcl-command for variable handling, like set, lindex, -array, ... work also on these variables. The -instvar instance method links a variable to the scope of -an executing method. It has the syntax: -

    -
    -  objName instvar v1 ?v2 ... vn?
    -
    -

    -It makes the variables v1 ... vn, which must -be variables of the object, part of the current method's scope. A -special syntax is: -

    -
    -  objName instvar {varName aliasName} ...
    -
    -

    -for one of the variables. This gives the variable with the name -varName the alias aliasName. This way the variables -can be linked to the methods scope, even if a variable with that name -already exists in the scope. Now the enter method can be -adapted slightly and a leave method can be added, which uses -Tcl's info command to check -whether the named person is in the object's persons array. To -demonstrate the alias-syntax this is done with the persons -array and the alias p. -

    -
    -  kitchen proc enter {name} {
    -    my instvar persons
    -    set persons($name) [clock seconds]
    -  }
    -
    -  kitchen proc leave {name} {
    -    my instvar {persons p}
    -    if {[info exists p($name)]} {
    -      puts "$name leaves after [expr {[clock seconds]-$p($name)}] seconds" 
    -      unset p($name) 
    -    } else {
    -      puts "$name is not in the room"
    -    }
    -  }
    -
    -A method defined via proc can be deleted by proc using -an empty argument list and an empty body. The following example deletes the method -enter: -
    -  Room proc enter {} {}
    -
    - -

    -Information about Objects -

    -

    XOTcl offers reading and writing -introspection. The reading introspection abilities are packed -compactly into the info instance method which is available -for objects and classes (there are special info options for object -aggregations, nested classes, mixins, filters, meta-data and -assertions, which are explained separately in the following -sections). The info instance method's options, from the view -of an object, are summarized in the following table. They are -identically to the OTcl info options on objects. -

    -
    -

    - Options for the info method on objects

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - objName info args methodName - -

    Returns the arguments of the specified proc (object specific method).

    -
    - objName info body methodName - -

    Returns the body of the specified proc.

    -
    objName info class ?className? - -

    Returns the name of the class of the current - object, if className was not specified. Otherwise it - returns 1 if className matches the object's class and 0 if - not. -

    -
    objName info commands ?pattern? - -

    Returns all commands defined on the object - if pattern was not specified. Otherwise it - returns all commands that match the pattern.

    -
    objName info default methodName arg var

    -
    -

    Returns 1 if the argument arg of - the specified proc has a default value, otherwise 0. If - the default value exists it is stored in var.

    -
    objName info precedence ?pattern? - -

    Returns all classes in the precedence order - from which the specified object inherits methods. The - returned list of classes contains the mixin and instmixin - classes as well as the classes of the superclass chain in - linearized order (i.e., duplicate classes are removed). If - the pattern is specified, only matching classes are - returned.

    -
    objName info vars ?pattern? - -

    Returns all variables defined on the object - if pattern was not specified, otherwise it returns - all variables that match the pattern.

    -
    - -
    -


    -

    For example on the kitchen object -

    -
    -  kitchen info procs
    -

    -returns enter and leave as a Tcl-list since these -are the procs defined on the object. -

    -

    Classes -

    -

    Creating Classes and deriving -Instances -

    -

    There are different ways to create a class in XOTcl. They have in -common that they derive the new class from a meta-class. Initially the -Class command provides access to the meta-class -Class, which holds the features common to all classes. It -also allows one to derive new meta-classes. The common way to create a -new class is: -

    -
    -  Class className ?args?
    -
    - -

    -Similar to the object short form, this is a short form of a call to -the create instance method of the meta-class Class, -which is also executed by the standard unknown mechanism. -This mechanism is always triggered when XOTcl does not know a method -called on an object. Supposed that there is no method with the name -className, defined on the class-object of Class, -XOTcl looks up the method unknown (which is found on the -Class Object) and executes it. The standard unknown-mechanism -of XOTcl calls create with all arguments stepping one step -to the right; in the general case: -

    -
    -  Class create className ?args?
    -

    -This may also be called directly. Besides the indirection when using -unknown, in most cases there is no difference in the action -performed: Firstly the memory is allocated, using the alloc -instance method; as the next step the constructor init is called -on the creating object, which is in this case the class-object of the -meta-class Class. In seldom cases the programmer may want to -suppress the init call. To do so the alloc instance -method may also be called directly: -

    -
    -  Class alloc className ?args?
    -
    -

    -As seen in the preceding section objects are created in the same way. -The difference was, that the command Object, which accesses -a class, instead of the command Class, which accesses a -meta-class, was used. The user-defined classes may also be used in -the same way to create new objects: -

    -
    -  className objName ?args?
    -
    -

    -Resembling the creation of classes this creates an object objName -of type className using the unknown mechanism. That -means the create instance method of the class is called. If -there is no other instance method defined on the class-path so far -(which would mean, an user defined creation process is invoked), the -create instance method of the class Object is -invoked. This method is similar to the create method of the -meta-class Class. It firstly calls the alloc -instance method on its (of the Class class) which allocates -memory for the object, and makes it an instance of it's class. -Afterwards a call to the constructor init is invoked. -

    -

    Now we can specify the object for the kitchen by the class to -which it belongs. In this case a kitchen is an instance of a room. -

    -
    -  Class Room
    -  Room kitchen
    -

    -A set call on a class creates an instance variable on the -class-object. This variable is unique for all instances, therefore, -it may be referred to as a class variable. -

    -

    Methods Defined in Classes -

    -

    Methods which are defined in classes and which are provided to the -instances of these classes are called "instprocs". -The syntax for defining an instproc is: -

    -
    -  className instproc procname args body
    -
    -

    -It is similar to the definition of procs on objects, but uses the -keyword instproc to distinguish between the methods defined -on the class-object and those defined on the class. Since all rooms -(in the modeled world) have ceilings, we may want to define a simple -convenience instproc, which is able to set the color: -

    -
    -  Room instproc setCeilingColor color {
    -    my set ceilingColor $color
    -  }
    -

    -A special instproc, the constructor init, was mentioned -already. Now we are able to define such an instproc. Defined on a -class it is responsible for all initialization tasks, which needed to -be performed, when constructing a new instance object of the class. -The constructor of the Room can initialize a variable for -the color, in which the ceiling is painted, to white as default, -since this is the color of ceilings without painting. -

    -
    -  Room instproc init args {
    -    my setCeilingColor white
    -    next
    -  }
    -
    -

    -After this definition, all instances derived from the Room -class have an instance variable ceilingColor with the value -white. The args argument used here is a special -argument in Tcl which allows us to use a list of arguments which may -change its length from call to call. -

    -An instproc can be deleted by the method instproc as well. -If instproc is called with an empty argument list and an -empty body, the specified method is deleted, as the following example shows: -

    -  Room instproc setCeilingColor {} {}
    -
    - -

    -

    Information about Classes -

    -

    Resembling to objects, information on -classes may be gained through the info instance method of the -meta-class Class. Note that this instance method does not -only support the class info options, but also the object info options, -since the accessing command refers to the class-object, which itself -is an object and, therefore, offers its informations. The following -table summarizes the additional info options available on classes. -

    -
    -

    Options for the info method on classes

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    className info heritage ?pattern? -

    Returns a list of all classes in the - precedence order of the class hierarchy matching - pattern or a list of all classes, if - pattern was not specified.

    -
    className info instances ?pattern? -

    Returns a list of the instances of the - class matching pattern or of all instances, if - pattern was not specified. -

    -
    className info instargs methodName -

    Returns the arguments of the specified instproc - (method provided to objects).

    -
    className info instbody methodName -

    Returns the body of the specified instproc.

    -
    className info instcommands ?pattern? -

    Returns all commands defined on the class, if - pattern was not specified, otherwise it returns all - commands provided to objects that match the pattern.

    -
    className info instdefault methodName arg var

    -
    -

    Returns 1 if the argument arg of - the specified instproc has a default value, otherwise 0. If - the default value exists it is stored in var.

    -
    className info subclass ?className2? -

    Returns a list of all subclasses of the class, if - className2 was not specified, otherwise it returns 1 if - className2 is a subclass and 0 if not.

    -
    className info superclass ?className2? -

    Returns a list of all super-classes of the class, - if className2 was not specified, otherwise it returns 1 - if className2 is a superclass and 0 if not.

    -
    -
    -


    -

    Inheritance -

    -

    Besides encapsulation of operations and state in objects, a second -central ability of object-orientation is inheritance. XOTcl supports -single and multiple inheritance with a directed acyclic class -graph. Automatically each new class created by the instance methods -create and alloc of Class inherits from -Object. Therefore, it is ensured that all instances of the -new class have access to the common features of objects stored in the -class Object. -

    -

    To specify further inheritance relationships the instance methods -superclass of Class is used: -

    -
    -  className -superclass classList
    -

    -E.g. in the example a kitchen may be seen as a -special room: -

    -
    -  Class Room
    -  Class Kitchen -superclass Room
    -

    -Now all instances of Kitchen are able to access the -operations stored in the Room and in the Kitchen class. -Note the transition the kitchen was going through: firstly it was a -singular object, then it was an object with a user-defined class, -and now it is a class. This is possible (and not senseless) because -of the per-object specialization ability and the dual shape of a -class, which is at the same time object and class. Both lead to a -seamless connection of the run-time properties (the object features) -and their descriptive properties (the class features). It is possible -to avoid the strict distinction between them, known from static typed -languages, like C++, Java, etc. -

    -

    Moreover, since the syntaxes of constructs expressing the same -concern are nearly identical, we can re-factor a solution with very few -changes to the alternative. We will see similar "ease of refactoring" -throughout the XOTcl language. E.g., we can also easily re-factor the -class hierarchies or exchange class hierarchies against mixin -solutions with only slight changes in the code. -

    -

    Besides single inheritance, as seen, XOTcl provides also multiple -inheritance. This is syntactically solved by giving the superclass -instance method a list of classes instead of a single class as -argument. -

    -
    -  Class Room
    -  Class 4WallsRoom -superclass Room
    -  Class CookingPlace
    -  Class Kitchen -superclass {4WallsRoom CookingPlace}
    -

    -Now the kitchen class is specialized a bit more. It is a special room -which has four walls and it is a cooking place. Multiple -inheritance, as seen here, is as simple to apply as single -inheritance. -

    - -Most often when the disadvantages of multiple inheritance are -discussed, the name resolution along the class graph is considered as -the biggest problem. The question is, which method is to be chosen and -which path through class graph is to be taken, if more then one method -of the specified name exist on the class graph. - -

    -

    In the example such questions -would arise for an object of the Kitchen class, if two -same-named methods are defined on CookingPlace and -4WallsRoom or if a method of the class Object is -called, which is reachable through two paths (along -CookingPlace or Room). -

    - -

    Often - e.g. in the -inheritance model of C++ - the path through the graph is not clearly -determined and/or the rules are too complicated to be understood on -the first glance. The programmer often can only determine by trial -which method is found firstly. Than an explicit naming of the class is -necessary, which means storage of non-local information in -sub-classes. Often different compilers of one language behave -differently. All these issues make code reuse difficult. Moreover -understandability and portability are reduced. -

    -


    -

    -

    Figure 3: -The example classes and the following next-path

    -
    - - - - - -
    -
    -
    -

    XOTcl goes an intuitive and unambiguous way to solve this problem. -It resolutes the precedence order along a ``next-path''. -Firstly the class of the object is searched, which is Kitchen -in example. Then the super-classes are searched in definition order, -which means at first 4WallsRoom, then CookingPlace. -Each branch is searched completely, before changing to the next -branch. That means, Room is searched, before the -CookingPlace branch is visited. At last the top of the -hierarchy, the class Object, is searched. -

    - -

    The usage of next in XOTcl is different to OTcl: In OTcl, - next is defined as a method, in XOTcl it is a - primitive command. Furthermore, in OTcl, -it is always necessary to provide the full argument list for every -invocation explicitly. In XOTcl, a call of next without -arguments can be used to call the shadowed methods with the same -arguments (which is the most common case). When arguments should be -changed for the shadowed methods, they must be provided explicitly in -XOTcl as well. In the rare case that the shadowed method should -receive no argument, the flag --noArgs must be used. -

    - -

    Destruction of Classes -

    -

    Classes are destroyed by the destruction of the class-object using -the destroy method of the Object class. The -destruction of super-classes does not destroy the sub-classes. The -super-class is simply removed from the sub-classes' super-class -lists. All classes have the super-class Object, if no -super-class is specified. Therefore, if all super-classes are -destroyed or removed, the new super-class is Object, not: no -super-class. The destruction of the class of an object does neither -delete the object nor leave it without class. In XOTcl a deleted class -leaves it's instances with the class Object. -

    -

    So all empty class- and superclass-relationships are automatically -reseted to Object. Note, that this are differences to OTcl, -where the destruction of an class destroys all instances and an empty -super-class list remains empty. -

    -

    Method Chaining -

    -

    A special feature of XOTcl is the method chaining without explicit -naming of the ``mix-in''-method. It allows one to mix the same-named -superclass methods into the current method (modeled after CLOS). The -previously described next-path is the basis for this functionality. -At the point marked by a call to the next primitive of XOTcl -the next shadowed method on the next path is searched and, when it is -found, it is mixed into the execution of the current method. When no -method is found, the call of next returns an empty string, -otherwise it returns the result of the called method. -The syntax is: -

    -
    -  next ?arguments|--noArgs?
    -

    -As stated earlier the usage of next in XOTcl differs from -OTcl, since the next call without arguments in OTcl means -per default that no arguments are passed. But most often all -arguments are passed through to the shadowed methods (since these will -most likely have the same signatures). When all -variables should be passed through, in OTcl it is necessary for -correct variable substitution to use: -

    -
    -  eval $self next $args
    -

    -To avoid such difficulties, we made the passing of all arguments the -default case; a simple -

    -
    -  next
    -

    -performs the task of passing all arguments to the shadowed methods. -These arguments are called the standard arguments. If the -standard argument feature should not be used, optionally arguments -can be given or the flag --noArgs could be set as sole -argument, which means that the shadowed method is called with no -arguments. -

    -

    -E.g. the following next call ignores the standard arguments -and sends the arguments 1 and 2 instead: -

    -
    -  next 1 2
    -

    - -

    As an example all classes involved in the previous example should -get a constructor instance method, which simply sets an instance -variable on the object: -

    -
    -  Room instproc init args {
    -    my set roomNumber 0
    -    next
    -  }    
    -  4WallsRoom instproc init args {
    -    my set doorPosition 0
    -    next
    -  }
    -  CookingPlace instproc init args {
    -    my set stoveType electric
    -    next
    -  }
    -  Kitchen instproc init args {
    -    my set cookName -
    -    next
    -  }
    -

    -After creation an object of class Kitchen gets automatically -four instance variables cookName, roomNumber, -doorPosition and stoveType set up with default -values in this order (since this is the order of the classes in the -next-path). Note, that the order is important, because one missing -next call, in one of the init methods, means that succeeding -init methods will not be executed. This mechanism functions -equally on all kinds of instprocs, not only on constructors. -

    -

    The constructors use the args argument, which allows us to -give a list of variable length as arguments. To ensure reusability of -our classes the constructors should use args in most cases, -since they may pass through arguments for constructors further up the -class hierarchy. -

    -

    If a proc with the searched name exists on the object it -shadows all instprocs. A next call in a proc leads to -the normal next-paths search, starting with the object's class. -

    -

    By the way, an observant reader might notice that the example -above can be rewritten without explicit constructors, just by -using parameters with default values. -

    -
    -  Class Room -parameter {{roomNumber 0}}
    -  Class 4WallsRoom -superclass Room -parameter {{doorPosition 0}}
    -  Class CookingPlace -parameter {{stoveType electric}}
    -  Class Kitchen -superclass {4WallsRoom CookingPlace} -parameter {{cookName -}}
    -

    -If an instance of a Kitchen is created it will contain instance -variables for doorPosition, cookName, -roomNumber, and stoveType, as the following -statements will show.

    -
    -  Kitchen k
    -  puts [k info vars]
    -
    - - -

    Dynamic Class and Superclass -Relationships -

    -

    Another property of XOTcl that distinguishes it from statically typed -languages are dynamics of class relationships. The realization of the -definition of super-classes as seen above with the superclass -method suggests already, that it is not only available at the class -definition time. In the above example its appended to the class -definition with "-superclass" as a short syntax -for method invocation at definition time (all other available methods -can also be called with a preceding dash ("-") appended -to definitions). -

    -

    At any time the class graph may be changed entirely using the -superclass method. Suppose the rooms and kitchens created in -modeling of a house should be displayed to a screen, but it is not -determined, whether the user of the system has the possibilities for -graphical outputs. Two classes TextOutput and -GraphicalOutput may be defined, which handle the output. Both -have an instproc paint which does the painting of the virtual -world on the chosen display type. The common output requirements are -handled by a derived class VirtualWorldOutput which calls the -paint method of the superclass using next. In -statically typed languages it would need more sophisticated constructs -to change the output class at run-time. E.g. a delegation to another -object handling the intrinsic task of the output object would be -introduced solely for the purpose of configuring the output -form. With a dynamic class system we can use the superclass -method to do so easily: -

    -
    -  Class TextOutput
    -  TextOutput instproc paint args {
    -    # do the painting ...
    -  }
    -  Class GraphicalOutput
    -  GraphicalOutput instproc paint args {
    -    # do the painting ...
    -  }
    -
    -  # initially we use textual output
    -  Class VirtualWorldOutput -superclass TextOutput
    -  VirtualWorldOutput instproc paint args {
    -    # do the common computations for painting ...
    -    next; # and call the actual output
    -  }
    -
    -  # user decides to change to graphical output
    -  VirtualWorldOutput superclass GraphicalOutput
    -
    -

    -Sometimes, such a change to new intrinsic properties should not happen -for all instances of a class (or the class hierarchy), but only for -one specific object. Then the usage of a dynamic super-class -relationship is a too coarse-grained means. A second form of such -dynamics is the changing of the relationship between object and -class. This means, objects can also change their class dynamically at -run-time. This feature may be used to model a life-cycle of an object, -without loosing the object's identity, inner state or -per-object-specializations through procs. The class instance -method enables this functionality. -

    -

    An example would be an agent for the virtual world. Agents may be -placeholders for persons, who interactively travel the world, or -programs, which act automatically. When a person decides at run-time -to give a task it has performed formerly by hand to an automatic -agent, the agents nature changes from interactive agent to automatic -agent, but the identity and the local state (that means the parts of -the task, that are already fulfilled by the person) stay the same. -This is a scenario for changing class relationships, e.g.: -

    -
    -  Class Agent
    -  Class AutomaticAgent -superclass Agent
    -  Class InteractiveAgent -superclass Agent
    -
    -  # create a new agent for a person
    -  InteractiveAgent agent1
    -
    -  # the person does something ...
    -  # and decides the change to an automatic agent
    -  agent1 class AutomaticAgent
    -
    - -

    -Meta-Classes -

    -

    Meta-classes are a special kind of classes. Similar as classes are -managing objects (where managing means: control the creation and -destruction of instances, know what instances exist, provide methods), -meta-classes are managing classes. So, meta-classes are used to define -classes. In other words, every Class in XOTcl is created by a -meta-class, in most cases by the meta-class named Class. New -user-defined meta-classes can be defined as subclasses of the -predefined meta-class Class, or by adding an instmixin class -(see below) containing Class -to the precedence chain of the class. By defining Object -instmixin Class one can even change the object system of XOTcl in -in a way such that every created Object is a meta-class. -

    -

    Since the concept of a meta-class are sometimes -confusing to people of a background of some other programming -languages, we explain meta-classes slowly with the analogy of classes -and objects. -

    -

    -When a class Foo is created via the command -

    -   Class Foo
    -
    - it has no private variables and no special methods. This is - somewhat similar as creating an object via Object: -
    -   Object foo
    -
    - This plain object foo can be configured directly, or - one can create a class that configures the object. - Instead of writing -
    -   Object foo 
    -   foo set x 1
    -   foo proc hi {} {puts "hello"}
    -
    - one can use -
    -   Class C -superclass Object
    -   C instproc init {} {my set x 1}
    -   C instproc hi {} {puts "hello"}
    -
    - and create an instance and call the method. -
    -   C c1
    -   c1 hi
    -
    - The same holds for meta-classes and classes as well: Instead of writing -
    -   Class Foo
    -   Foo set x 1
    -   Foo proc hi {} {puts "hello"}
    -
    - the following can be used: -
    -   Class MC -superclass Class
    -   MC instproc init {} {my set x 1}
    -   MC instproc hi {} {puts "hello"}
    -
    - The instances of meta-classes are classes which can be - defined the usual way: -
    -   MC Bar
    -   Bar hi
    -   Bar b1
    -
    - Now we have a class names Bar which has a class-scoped - variable named x with the value of 1 (set via the - constructor); the class Bar has as well a class-method named - hi which prints, when called, the string "hello". The class - Bar can be used to create instances of the class like - b1, b2 and so on. -

    -

    Note that the command Class is a predefined definition -of the most general meta-class in XOTcl. Each time we are creating -a class, we use this meta-class. -In order to define a specialized meta-class, we can do this the -traditional object-oriented way: we subclass. Therefore, in to define -a specialized meta-class, we can use: -

    -
    -  Class myMetaClass -superclass Class
    -
    -

    This defines a new meta-class myMetaClass, which has all the -abilities of meta-classes. That means that the programmer is able to -specify new class features or override old ones. Later she/he may -instantiate these into new classes. -

    -

    This is a very powerful language feature, since it allows one to give -some classes further abilities than the others (or to restrict -classes). This way large program structures, like certain design -pattern parts, may be instantiated. Meta-classes hold the common -abstract parts of the structures. They allow one to form libraries of -such structures very easily. -

    -

    Example 1: Overloading the info method of classes -

    -

    -As a simple example we can derive a new meta-class -NoClassInfo from Class. Later we override the -info method of Class. Thus the classes created with -NoClassInfo, have an info option that only produces -an error message. All classes created with NoClassInfo, like -Agent in the example below, are not capable of accessing the class -info method anymore: -

    -
    -  Class NoClassInfo -superclass Class
    -  # redefine info ability
    -  NoClassInfo instproc info args {
    -    error "No class info available"
    -  }
    -  # derive agent class from meta-class, which
    -  # can not access class info
    -  NoClassInfo Agent
    -
    -Now a call like: -
    -  Agent info superclass
    -

    -triggers the error message. -

    - -

    Example 2: Defining Classes that Count Their Instances -

    -

    Meta-classes are frequently used to define some bookkeeping -about the number of instances on the class level. In the following -example we define a meta-class named CountedClass which -defines classes that count their instances: -

    -  Class CountedClass -superclass Class -parameter {{counter 0}}
    -  CountedClass instproc create args {
    -    my incr counter
    -    next
    -  }
    -  CountedClass instproc instdestroy args {
    -    my incr counter -1
    -    next
    -  }
    -  CountedClass Dog
    -
    -  Dog piffie
    -  Dog idefix
    -  puts "nr of dogs: [Dog counter]"
    -
    -  piffie destroy
    -  puts "nr of dogs: [Dog counter]"
    -
    -Note that the behavior introduced by meta-classes -can be orthogonal to the behavior of the classes. One can -define Dog as a specialization of Animal -or defines a special kind of dog such as Poodle using -the method superclass as usual. -

    - -

    Example 3: The Singleton Meta-Class -

    -

    Finally, a small example, which is more practical. Some -applications have the requirement that only one instance of a class -might be defined at a certain time. Such a behavior is frequently -called a "Singleton". In XOTcl we can define a class singleton by -overloading the create method of Class: when -create is called and there exists already an instance of the -singleton it is returned instead of a new instance. -

    -  Class Singleton -superclass Class
    -  Singleton instproc create args {
    -    expr {[my exists instance] ? [my set instance] : [my set instance [next]]}
    -  }
    -
    - If someone wants to have a class e.g. Manager to be a - singleton, you can create it by e.g. -
    -  Singleton Manager -superclass FOO
    -
    -

    - - -

    -Create, Destroy, and Recreate Methods -

    -

    -

    -XOTcl allows since version 0.84 for a flexible destroy and recreate scheme. -create and alloc are both Class instprocs -handling creation for their instances. I.e.: -

    -
    - className alloc [self]
    -
    -and -
    - className create [self]
    -
    -

    -are used for creating an instance. A similar method instdestroy -exists on Class that handles physical destruction of an object. The -method destroy on Object which lets an object destroy itself in fact -has the following behavior: -

    -
    -  Object instproc destroy args {
    -   [my info class] instdestroy [self]
    -  }
    -
    -

    -However, this behavior is not implemented in XOTcl, but in C. -create distinguishes between the following situations: -

    -
      -
    • Create a new object: - create calls alloc and then - doInitializations. -
    • Recreate an existing object: - When the specified object exists, it is recreated through the - recreate method: -
      -  givenClass recreate [self]
      -
      -

      - recreate can be customized e.g. by overloading or interception. - By default it calls cleanup followed by doInitializations. -

    -

    -In both cases, the method doInitializations -is called automatically from C and has the following default behavior: -

    -
      -
    • Search for parameter default values, -
    • Call parameter initialization methods, -
    • Call the constructor init. -
    -

    -Each step has a method call that can be changed, intercepted, etc. Of -course, cleanup, recreate, instdestroy, -etc. can also be overloaded or intercepted. -

    -

    -Consider a typical case for overloading recreate: a structure -preserving recreate that cleans up the class but -preserves the existing class hierarchy (subclass and instance relationships): -

    -
    -  Class StructurePreservingRecreate
    -  StructurePreservingRecreate instproc recreate {cl args} {
    -    if {[my isclass $cl]} {
    -      set subclass [$cl info subclass]
    -      set instances [$cl info instances]
    -    }
    -    next
    -    if {[my isclass $cl]} {
    -      foreach sc $subclass {
    -        $sc superclass $cl
    -      }
    -      foreach i $instances {
    -        $i class $cl
    -      }
    -    }
    -  }
    -  Object instmixin add StructurePreservingRecreate
    -
    -

    -Now the following code does not change the superclass or instance -relationships of C: -

    -
    -  Class A
    -  Class B
    -  Class C -superclass {A B}
    -  Class D
    -  Class E -superclass {C D}
    -  C c1
    -  C c2
    -
    -  # recreate -> is structure preserving
    -  Class C -superclass {A B}
    -  C c2
    -
    -  # test
    -  puts superclass=[C info superclass]
    -  puts subclass=[C info subclass]
    -  puts instances=[C info instances]
    -  puts class=[c1 info class]
    -  puts class=[c2 info class]
    -
    - -

    -Methods with Non-Positional Arguments -

    -

    -

    -So far we have introduced methods only with positional arguments: that -is, the position of an argument in the argument list determines to -which local variable the argument is bound, when the method is -invoked. Sometimes non-positional arguments -- arguments that carry -both a name and a value when the method is invoked -- are -useful. Before a non-positional argument can be used, it must be -defined in the method definition using the following syntax: -

    -
    - className instproc methodName ?non-pos-args? args body ?assertions
    - objName proc methodName ?non-pos-args? args body ?assertions
    -
    -

    -The non-positional arguments are defined with the following syntax: -

    -
    - {-name?:checkoption1, checkoption2, ...? default value} \
    -     {-name?:checkoption1, checkoption2, ...? ?default value?} ...
    -
    -

    -Only the name of the non-positional argument is really required, all -other parts of this syntax are optional. -

    -

    -Let's consider a simple example, where a method with two -non-positional args is defined; one has only a name ("a"), and one has -a name and a default value (b): -

    -
    - Object o
    - o proc someproc {-a {-b {1 2 3}} x y} {
    -     puts "$a $b $x $y"
    - }
    -

    -We can invoke this method as follows: -

    -
    - o someproc -b {4 5} -a 1 3 4
    -

    - -Here, the order of a and b can be changed; hence the name -non-positional arguments. As b has a default value, we do not need -to provide a value for it. In the following invocation b has the -value "1 2 3": -

    -
    - o someproc -a 1 3 4
    -

    -The ordinary arguments start after the last non-positional argument -(here: "3 4"). We can explicitly end the non-positional arguments by -using "--". This is useful if we want to provide arguments that contain -dashes ("-"), e.g.: -

    -
    - o someproc -a 1 -- -b -c
    -

    - -Sometimes we want to check or control the non-positional -arguments. For instance, in the above invocation, we might want to -check that a is not forgotten, because otherwise the method cannot -execute properly. This is the role of the checkoptions. There are three -predefined checkoptions: required, boolean and -switch. required checks -whether a non-positional argument is given, boolean checks that a -non-positional argument is of boolean type. For instance: -

    -
    - Class P
    - P instproc someproc {-a:required {-b:boolean true}} {
    -     puts "$a $b"
    - }
    - P p
    -

    - -This method requires a, and b needs to be -of type boolean (is has -the default value true). This invocation is valid: -

    -
    - p someproc -a 1 -b 0
    -

    - -This invocation is invalid, because a is missing, -and b is not a Tcl boolean type: -

    -
    - p someproc -b " a b v"
    -

    -The checkoption switch is similar to boolean except -it does not require an additional argument. If the default value is -false, the switch can be turned on, if the default is true -it can be switched off. -

    -The checkoptions are extensible. In fact, they are defined in an -object ::xotcl::nonposArgs. We can extend this object with new -methods. - -A check option method has the following syntax: -

    -
    - someobject|someclass proc|instproc methodName {?optional nonpositional arguments? argName arg} {
    -  ...
    - }
    -
    -

    - -argName is here used to denote the name of the argument, -and arg is the provided value. -

    - - - - -Of course, the non-positional arguments can also be introspected. The -following info options return the non-positional arguments of a -method: - -

    -
    - objName info nonposargs methodName
    - className info instnonposargs methodName
    -

    - - - - - - - - -
    -

    Message -Interception Techniques - -

    -
    -
    - -

    Even though object-orientation orders program structures around -data, objects are characterized primarily by their behavior. -Object-oriented programming style encourages the access of -encapsulated data only through the methods of an object, since this -enables data abstractions. A method invocation can be interpreted as a -message exchange between the calling and the called object. -Therefore, objects are at runtime only traceable through their message -exchanges. At this point the message interceptors can be applied to -catch and manipulate all incoming and outgoing messages of an -object. -

    -

    Generally interceptors can be applied to attach additional or -extrinsic concerns to an object or a class or a class hierarchy. For -instance roles or aspects can be implemented this way on various -levels of scale. -

    - -

    We have already discussed some interception techniques -implicitly. E.g., the unknown mechanism intercepts messages -that have not be found on the object. It can be used as a very useful -programming technique, e.g., the define a default behavior for an -object. The interceptors presented in this section have a different -character: They are applied before/after the original method even -if the method is defined for the target object. Thus these -interception techniques may be applied -

    - -

    We will discuss the message interceptors in this section in -detail. The table below gives an impression, when which interceptor -may be applied. - -

    Message - Interceptors Overview

    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Applied When

    Primary Target Structure

    Coverage

    Per-Object Filter

    before/after a call

    object hierarchies

    all methods

    Per-Class Filter

    before/after a call

    class and class hierarchies

    all methods

    Per-Object Mixin

    before/after a call

    object

    specific methods

    Per-Class Mixin

    before/after a call

    class and class hierarchies

    specific methods

    Unknown Mechanism

    after method was not found

    object

    all unknown calls

    -
    - -
    - -

    Filter -

    - -

    The filter (see [Neumann and Zdun -1999a] for more details) is a language construct to implement -broader extensional concerns either for a single object or for several -classes or class hierarchies. This way large program structures at the -scale of several classes or class hierarchies can be managed. It is a -very general interception mechanism which can be used in various -application areas. E.g. a very powerful programming language support -for certain design patterns is easily achievable, but there are also -several other domains which are covered, like tracing of program -structures, self-documentation at run-time, re-interpretation of the -running program, etc. -

    -

    A per-class filter is a special instance method that is -registered for a class C. A per-object filter is a -special instance method that is registered for a object -o. Every time an object of class, C or the object -o respectively, receives a message, -the filter method is invoked automatically. -

    -

    Usage of Filters -

    -

    All messages to a filtered object must go through the filter before -they reach their destination object. A simple example would be a sole -filter on the class of the object. To define such a filter two steps -are necessary. Firstly an filter method has to be defined, then the -filter has to be registered. The filter method consists of three parts -which are all optional. A filter method has the following form: -

    -
    -  className instproc FilterName args {
    -    pre-part
    -    next
    -    post-part
    -  }
    -
    -

    -When a filter comes to execution at first the actions in the pre-part -are processed. The filter is free in what it does with the -message. Especially it can (a) pass the message, which was perhaps -modified in the pre-part, to other filters and finally to -the object. It can (b) redirect it to another destination. Or it can -(c) decide to handle the message on its own. The forward passing of -messages is implemented through the next primitive of XOTcl. -After the filter has passed its pre-part, the actual called method is -invoked through next. -

    -

    After the call of next is processed, the execution returns -to the point in the filter, where the next call is located -and resumes execution with the actions of the post-part. -These may contain arbitrary statements, but especially may take the -result of the actual called method (which is returned by the -next-call) and modify it. The caller then receives the result of the -filter, instead of the result of the actual called method. -

    -

    The pre- and post-part may be filled with any ordinary -XOTcl-statements. The distinction between the three parts is just a -naming convention for explanation purposes. -

    -

    The filter uses the args argument which lets us use a list of -variable length as arguments, since it must filter a lot of different -calls, which may have different argument lists. Furthermore, it may -pass through arguments to other filters and the preceding filters may -change the argument list. -

    -

    Since any proc/instproc may be a filter, a registration of the -filter is necessary, in order to tell XOTcl, which instprocs are -filters on which classes. The filter and instfilter -instance methods are able to handle this task for per-object filters -and per-class filters respectively. Similar to the XOTcl language -introduced so far, the filter registration is dynamic at run-time. By -supplying a new list of filters to -filter/instfilter, the programmer can change the -filters registered on a class at arbitrary times. The filter instance -method has the syntax: -

    -
    -  className instfilter filterList
    -
    -for per-class filters and: -
    -  objName filter filterList
    -
    -for per-object filters. - -

    -Now a simple example should show the filter's usage. In the preceding -examples we have defined several rooms. Every time a room action -occurs it is likely that the graphical sub-system has to change -something on the output of that particular room. Therefore, at first -we need a facility to be informed every time an action on a room -happens. This is quite easily done using filters: -

    -
    -  Class Room
    -  Room r1; Room r2;       # just two test objects
    -
    -  Room instproc roomObservationFilter args {
    -    puts "now a room action begins"
    -    set result [next]
    -    puts "now a room action ends - Result: $result"
    -    return $result
    -  }
    -
    -  Room instfilter roomObservationFilter
    -

    -Now every action performed on room objects is notified with a pre- -and a post-message to the standard output stream. We return the -result of the actual called method, since we don't want to change the -program behavior at all. E.g. we can set an instance variable on both -of the two room objects: -

    -
    -  r1 set name "room 1"
    -  r2 set name "room 2"
    -

    -The output would be: -

    -
    -  now a room action begins
    -  now a room action ends - Result: room 1
    -  now a room action begins
    -  now a room action ends - Result: room 2
    -

    -
    -

    -

    -   -

    -

    Figure 4: -Cascaded Message Filtering

    -
    - - - - - -
    -

    -
    -
    -



    -

    -

    All classes may have more than one filter. In fact they may have a -whole filter chain, where the filters are cascaded through next. -The next method is responsible for the forwarding of -messages to the remaining filters in the chain one by one till all -pre-parts are executed. Then the actual method is executed and -then the post-parts come to turn. If one next-call is omitted the -chain ends in this filter method. As an example for an additional -filter we may register a filter that just counts the calls to -rooms. -

    -
    -  Room set callCounter 0;  # set class variable
    -  Room instproc counterFilter args {
    -    [self class] instvar callCounter
    -    incr callCounter
    -    puts "the call number callCounter to a room object"
    -    next
    -  }
    -  Room instfilter {roomObservationFilter counterFilter}
    -

    -Filters are invoked in registration order. The order may be changed -by removing them and adding them in new order. Filters are inherited -by sub-classes. E.g. in the preceding example for the next path, an -OvalOffice was derived from the Room class. Without -a change to the program each OvalOffice object automatically -produces the same filter output as rooms. -

    -


    -

    -

    -   -

    -

    Figure 5: -Filter Inheritance

    -
    - - - - - -
    -

    -
    -
    -


    Filter chains can also be combined through (multiple) -inheritance using the next method. When the filter chain of -the object's class is passed, the filter chains of the superclasses -are invoked using the same precedence order as for inheritance. Since -on the subclass there may also be a another filter chain, without -sophisticated computing in the pre- and post-parts one can produce -easily a powerful tracing facility. E.g. if we want to distinguish an -OvalOffice from other rooms we may want to add a filter -solely for rooms of the type OvalOffice: -

    -
    -  Class OvalOffice -superclass Room
    -  OvalOffice o1;  # test object
    -  OvalOffice instproc ovalOfficeObservationFilter args {
    -    puts "actions in an oval office"
    -    next
    -  }
    -  OvalOffice instfilter ovalOfficeObservationFilter
    -

    -A simple call to the o1 object, like: -

    -
    -  o1 set location "Washington"
    -

    -produces the following output: -

    -
    -  actions in an oval office
    -  now a room action begins
    -  the call number 3 to a room object
    -  now a room action ends - Result: Washington
    -

    -As seen already, filter registrations can be added dynamically at -runtime. But they may also be removed. Perhaps the counting on rooms -should stop after a while, then a simple call of the instfilter -method is sufficient: -

    -
    -  Room instfilter roomObservationFilter
    -
    -

    Filters can be removed completely by giving an empty list to the -registration method:

    -
    -  Room instfilter {}
    -
    - - -

    Per-object filters operate on a single object. E.g. if we only -want to observe a single Room object room1, we can use the filter -method to register the roomObservationFilter only for this particular -instance:

    -
    -  room1 filter roomObservationFilter
    -
    -

    As a filter we can register any method in the precedence order of -the class or object. Thus we can also register procs as per-object -filters. Additionally, meta-class methods may be registered as -per-class filters. Filters are linearized so that each filter is only -executed once, even if it is registered multiple times. -

    -



    -

    -

    Introspection on Filters -

    -In order to gain information about the currently registered filters on -a certain object/class, the object info option filters and -the class info option instfilters may be -queried. It returns a list of the currently registered filters: -

    -
    -  className info instfilter
    -  objName info filter
    -
    -

    - -A special call-stack info option for filters is self -filterreg. It returns the name of the object or class on which -the filter is registered. Since the filter may be registered on other -objects/classes than the one on which it is defined, this may vary from -self class in the filter. - -The command returns a list of the form: -

    -  objName filter filterName
    -
    -or: -
    -  className instfilter filterName
    -
    -respectively. -

    - -



    -

    -

    Example: A Simple Trace Filter -

    -

    The trace example primarily demonstrates the inheritance of filter -chains. Since all classes inherit from Object, a filter on -this class is applied on all messages to objects. The Trace -object encapsulates methods for managing the tracing: -

    -
    -  Object Trace
    -  Trace set traceStream stdout
    -
    -  Trace proc openTraceFile name {
    -    my set traceStream [open $name w]
    -  }
    -
    -  Trace proc closeTraceFile {} {
    -    close $Trace::traceStream
    -    my set traceStream stdout
    -  }
    -
    -  Trace proc puts line {
    -    puts $Trace::traceStream $line
    -  }
    -
    -  Trace proc add className {
    -    $className instfilter [concat [$className info filter] traceFilter]
    -  }
    -

    -First we define the object and set a variable for the stream to which -we send the trace outputs (here: stdout). With a method for opening -and a method for closing a file we can redirect the trace stream to a -file. puts is helper method for the filter to print an -output to the selected output stream. In add the traceFilter -is appended to the existing filters of a specified class. The actual -filter method (see below) displays the calls and exits of methods -with an according message. The calls are supplied with the arguments, -the exit traces contain the result values. We have to avoid the -tracing of the trace methods explicitly. -

    -
    -  Object instproc traceFilter args {
    -    # don't trace the Trace object
    -    if {[string equal [self] ::Trace]} {return [next]}
    -    set context "[self class]->[self callingproc]"
    -    set method [self calledproc]
    -    switch -- $method {
    -      proc -
    -      instproc {::set dargs [list [lindex $args 0] [lindex $args 1] ...] }
    -      default  {::set dargs $args }
    -    }
    -    Trace::puts "CALL $context>  [self]->$method $dargs"
    -    set result [next]
    -    Trace::puts "EXIT $context>  [self]->$method ($result)"
    -    return $result
    -  }
    -

    -As trace message we write the callee´s context (class and -proc), the invoked method (using calledproc), and the given -arguments. In the switch statement we avoid to print whole method -bodies. -

    -

    With -

    -
    -  Trace add Room
    -

    -messages to all rooms, including all instances of Room´s -sub-classes, are surrounded with a CALL and an EXIT output. With -

    -
    -  Trace add Object
    -

    -messages to all objects in an XOTcl environment are surrounded with a -CALL and an EXIT output. In general, it is possible to restrict the -trace to instances of certain classes, or to produce trace output for -only certain methods. This requires registration methods and a more -sophisticated implementation of the filter method. -

    -



    -

    - -

    Mixin Classes -

    - -

    Per-object and per-class mixins (see [Neumann and Zdun 1999c] for more details) are -another interception technique of XOTcl to handle complex -data-structures dynamically. Here, we use mixin as a short form for -mixin class. All methods which are mixed into the execution of the -current method, by method chaining or through a mixin class, are -called mixin methods. Mixin classes resembles the filter -presented in the preceding section. While the filters work on all -calls to all methods of an object/class hierarchy, the mixin classes -are applied on specific methods. The filter is defined in a single -method, while the mixin is composes several method in a class. - -

    -

    Supplemental Classes -

    -

    Mixin classes cover a problem which is not solvable elegantly just -by the method chaining, introduced so far. To bring in an addition to -a class, the normal XOTcl way is to define a mixin method and chain -the methods through next, e.g.: -

    -
    -  Class Basic
    -  Basic instproc someProc  {
    -    # do the basic computations
    -  }
    -  Class Addition
    -  Addition instproc someProc {
    -    # do the additional computations
    -    next
    -  }
    -

    -In order to mix-in the additional functionality of the supplemental -class Addition a new helper class (sometimes called -intersection class) has to be defined, like: -

    -
    -  Basic+Addition -superclass Addition Basic
    -

    -This is even applicable in a dynamical manner, every object of the -class Basic may be changed to class Basic+Addition -at arbitrary times, e.g.: -

    -
    -  Basic+Addition basicObj
    -  ...
    -  basicObj class Basic+Addition
    -

    -Now consider a situation with two addition classes. Then following -set of classes has to be defined to cover all possible combinations: -

    -
    -  Class Basic
    -  Class Addition1
    -  Class Addition2
    -  Class Basic+Addition1 -superclass Addition1 Basic
    -  Class Basic+Addition2 -superclass Addition2 Basic
    -  Class Basic+Addition1+Addition2 -superclass Addition2 Addition1 Basic
    -

    -The number of necessary helper classes rises exponential. For n -additions, 2n-1(or their permutations if order -matters) artificially constructed helper-classes are needed to -provide all combinations of additional mix-in functionality. -Furthermore it is possible that the number of additions is unlimited, -since the additions may produce other additions as side-effects. This -demonstrates clearly that the sub-class mechanism provides only a -poor mechanism for mix-in of orthogonal functionality. Therefore we -provide an extension in the form of object mixin classes, which are -added in front of the search precedence of classes. -

    -

    Per-Object Mixins -

    -

    The mix-ins methods extend the next-path of shadowed methods. -Therefore, per-object mix-in methods use the next primitive -to access the next shadowed method. Consider the following example: -

    -
    -  Class Agent
    -  Agent instproc move {x y} { 
    -    # do the movement
    -  }
    -  Class InteractiveAgent -superclass Agent
    -  # Addition-Classes
    -  Class MovementLog
    -  MovementLog instproc move {x y} { 
    -    # movement logging
    -    next
    -  }
    -  Class MovementTest
    -  MovementTest instproc move {x y} {
    -    # movement testing
    -    next
    -  }
    -

    -An agent class is defined, which allows agents to move around. Some -of the agents may need logging of the movements, some need a testing -of the movements, and some both (perhaps only for a while). These -functionalities are achieved through the additional classes, which we -will apply through per-object mixins. -

    -

    Before we can use the per-object mix-ins on a particular object, -we must register the mixins on it with the mixin instance -method. It has the syntax: -

    -
    -  objName mixin mixinList
    -

    -For example we may create two interactive agents, where one is logged -and one is tested: -

    -
    -  InteractiveAgent i1; InteractiveAgent i2
    -  i1 mixin MovementLog
    -  i2 mixin MovementTest
    -

    -At arbitrary times the mixins can be changed dynamically. For example -i2's movements can also be logged: -

    -
    -  i2 mixin MovementTest MovementLog
    -

    -
    -

    -

    -   -

    -

    Figure 6: -Per-Object Mix-ins: Next-Path for the Example

    -
    - - - - - -
    -

    -
    -
    -



    -

    -

    The mixin option of the info instance method -allows us to introspect the per-object mix-ins. It has the syntax: -

    -
    -  objName info mixin ?className?
    -
    -

    -It returns the list of all mix-ins of the object, if className -is not specified, otherwise it returns 1, if className -is a mixin of the object, or 0 if not. -

    - -

    Note, that the constructors (init methods) of per-object mixins (and per-class mixins) -are only called, if the mixin is registered already during object -initialization (when init is called). For per-object mixins, one can -achieve the initialization of a mixin via an idiom like -

    -  Object o -mixin M -init
    -
    -that registers the mixin before init is called. When a mixin is registered -after object creation and it needs initializations, it is necessary to -define special methods for this. Note, that the behavior described -here is introduced in version 0.84 to ensure consistent behavior of -intrinsic classes, per-object and per-class mixins, and to achieve -predictable behavior for dynamic registration for all kind of mixins, -and as well during recreations of objects having mixins -registered. Older versions used heuristics for the initialization of -per-object mixins. -

    - -

    Per-Class Mixins -

    - -

    Per-class mixins are exactly identical in their behavior to -per-object mixins, but they operate on classes. Thus they are the -class-specific variant of the per-object mixins, like instprocs are a -class-specific variant of procs. Therefore, in the language the -per-class mixins are called instmixins. -

    - -

    -In general a per-class mixin is a class which is mixed into the -precedence order of all instances of the class and all its subclasses -it is registered for. It is also searched before the object's class -itself is searched, but after per-object mixins. -

    -

    -Per-class mixins are linearized according to the -precedence order -like classes on the superclass hierarchy. I.e. from the full -list of per-object mixins, per-class mixins, and intrinsic classes -(and all the superclasses of all these classes) always the last -occurrence is used. -

    - -

    -From the point of view of language expressibility instmixins are not -required, because they cannot express anything that per-object mixins -cannot express already (like procs can express any instproc -feature). As alternative to instmixins, we could simply register the -per-object mixins in the constructor of the class. -

    - -

    -But there at least the following reasons for instmixins as an -additional language construct: -

      -
    1. we can at runtime determine with info mixin -and info instmixin whether it is a class- or object-specific -mixin. Thus we get a better structuring at runtime. -
    2. We have not to 'pollute' the constructors with per-class mixin -registrations. Therefore, the constructors get more understandable. -
    3. If it is required to add (and remove) dynamically interceptors -to a set of objects, which are instances of a certain type, per-class -mixins are much easier to handle (e.g. add an instmixin to Object -to intercept e.g. all calls to certain predefined methods). -
    4. The language is more 'symmetrical', since any object-specific -feature in XOTcl has a class-specific variant. -
    -

    - -

    The mix-ins methods of per-class mixins extend the next-path of -shadowed methods in the same way as per-object mixin methods. Before -we can use a per-class mix-in on a particular class, we must -register the mixin on it with the instmixin instance method. It -has the syntax: -

    -
    -  className instmixin mixinList
    -
    -

    -Now consider that in the given per-object mixin example all -interactive agents should be tested. We could either build a subclass -TestedInteractiveAgent or register the per-object mixin in -the constructor of the interactive agent class. The subclass solution -leads to the same combinatorial explosion of intersection classes as -discussed in the previous section, if more supplemental classes are -added. The per-object mixin solution pollutes the constructor and does -not prevail the structural semantics that the 'tested' property -belongs to the interactive agent class at runtime -

    -

    -Here, we can use a per-class mixin: -

    -
    -  Class Agent
    -  Agent instproc move {x y} {# do the movement}
    -  Class InteractiveAgent -superclass Agent
    -  Class MovementTest
    -  MovementTest instproc move {x y} {
    -    # movement testing
    -    next
    -  }
    -
    -  # now register the instmixin
    -  InteractiveAgent instmixin MovementTest
    -
    -
    - -

    The per-class mixin now operates on all interactive agent -including the instances of subclasses. E.g. for interactive agents -i1 and i2 we automatically have movement -testing. i2 is also logged, since it has the logging class -as object-specific mixin: -

    -
    -  InteractiveAgent i1
    -  InteractiveAgent i2 -mixin MovementLog
    -
    -  i1 move 3 4
    -  i2 move 1 2 
    -
    - -

    -At arbitrary times the instmixins can be changed dynamically. -

    -

    The instmixin option of the class info instance -method allows us to introspect the per-class mixins. It has the -syntax: -

    -
    -  className info instmixin ?className2?
    -
    -

    -It returns the list of all instmixins of the the class, if className2 -is not specified, otherwise it returns 1, if className2 -is a mixin of the object, or 0 if not. -

    - -

    Per-class mixins are applied transitively. That means the per-class -mixin A of a per-class mixin B is also applied for an object in in B's -scope. This is exactly the same as how superclasses are applied for -instances. Consider the following example

    - -
    -  Class X11 \
    -     -instproc test args {
    -	puts [self class]
    -	next
    -     }
    -  Class X12 \
    -    -instproc test args {
    -	puts [self class]
    -	next
    -    }
    -  Class X \
    -    -instmixin {X11 X12} \
    -    -instproc test args {
    -	puts [self class]
    -	next
    -    }
    -
    -  Class Y \
    -    -instmixin X
    -
    -  Y create y -test
    -  X create x -test
    -
    -

    Here the application as a superclass (for x) yields the same -result as the application as an instmixin (for y): -

    -  ::X11 
    -  ::X12 
    -  ::X
    -
    -

    Precedence Order -

    - -

    The precedence order is composed by the precedence order of the -superclass hierarchy (as explained earlier) and the message -interceptors. In general, filters precede mixins and the superclass -hierarchy. They are applied in the order of the next path of the -object. Thus per-object filters are ordered before per-class -filters.

    - -

    Mixins are processed after the filters. Again, they are applied in -the order of the next path of the object. Thus per-object mixins are -ordered before per-class mixins.

    - -

    Finally, the object's own heritage order comes in the order: object, -class, superclasses.

    - -

    The three precedence order lists (filters, mixins, and classes) are -pre-calculated and cached.

    - -

    Filters as well as classes (mixins and ordinary classes) are -linearized. That means, each filter and each class can be only once on -a precedence order list. If a filter or class can be reached more than -once, than the last occurrence is used.

    - -

    For instance, consider a class A is superclass, per-class mixin, -and per-object mixin. On the precedence order lists only the last -occurrence as a superclass is used after linearization.

    - - -

    Guards for Filters and Mixins -

    - -Message interceptors, such as filters and mixins, are applied for -potentially huge number of messages. In many cases it is possible to -reduce the effective number of cases in which interceptors are -applied. Interceptor guards offer this functionality: they are boolean -conditions with which you can specify in which cases a registered -interceptor should be applied. - -

    Filter Guards

    -

    -A filter guard is a set of conditions that determine whether a filter -is to be executed upon a certain invocation or not. Syntactically we can -append a filter guard to the filter registration, or it can be -registered using the methods filterguard for filters and -instfilterguard for instfilters. - -

    Each filter guard is an ordinary condition. A filter guard is -executed in the call frame of the filter to be executed, if the filter -guard returns 1. Thus, the call-stack information are already set to -the values of the targeted filter - and these values can be used in -the filter guard. - -

    -Let us consider a simple program: -

    -
    -Class Room
    -Room instproc enter {name} {puts [self proc]}
    -Room instproc leave {name} {puts [self proc]}
    -Room instproc loggingFilter args {
    -    puts [self calledproc]
    -    next
    -}
    -Room instfilter loggingFilter
    -
    - -

    -Now consider we only want to apply the logging filter for enter and -leave, not for any other message sent to Room instances. In the -following example, for instance, we do not want to log the set -message: -

    - -
    -Room r 
    -r enter Uwe
    -r leave Uwe
    -r set roomName "Office"
    -
    - -

    -In this example a filterguard can be applied to restrict the -application of the filter to those two methods: -

    - -
    -Room instfilterguard loggingFilter {
    -  [self calledproc] == "enter" || 
    -  [self calledproc] == "leave"}
    -
    - -

    -Here we limit the filter application of the logging filter on rooms to -calls to enter and leave. All other calls are not filtered at -all. Note that the same syntax can also be applied for -filterguard. Also, there is a short form to register filter -guards directly during filter registration. The following code has the -same semantics as the filter and filter guard definitions above: -

    - -
    -Room instfilter {{loggingFilter -guard {
    -    [self calledproc] == "enter" || 
    -    [self calledproc] == "leave"}}}
    -

    - -The filter guard language construct is registration centric. It only -applies for the class or object on which a filter is registered, not -for all applications of the filter method. That is, if we use -loggingFilter on another class we may give no or completely -different filter guards. -

    -If no filter guard is given for a filter, we assume that it is to be -applied on all methods (equivalent to the filter guard '1' which is -always true). -

    - -

    -There are introspection options for filter guards. In particular, we -can use info filterguard and info instfilterguard -for getting the filter guards for a particular filter or instfilter -respectively. For instance: -

    -
    -puts [Room info instfilterguard loggingFilter]
    -

    -This prints out the content of the above guard definition. -We can also append -guard to info filter or -info instfilter to obtain a filter definition with guards: -

    -
    -puts [Room info instfilter -guards]
    -

    - -

    -If we call a method from within a filter guard, as for instance -callsMethod, we might require some parameters from the guard's -context, such as calledproc. These parameters can be passed -as references, as in the following example: -

    - -
    -  Room instfilter loggingFilter
    -  Room instfilterguard loggingFilter {[my callsMethod openURL [self calledproc]]}
    -

    -This example works because the filterguard is already set to the scope of the guard. Now we can use this dynamic calledproc context in the called method: -

    -
    -  Room instproc callsMethod {method calledproc} {
    -    return[string match $calledproc $method]
    -  }
    -

    -We simply check whether the called method -matches the given method name or not. - -

    Mixin Guards

    -

    -Similar to filters, there are mixin guards, defined with -mixinguard and instmixinguard, or with --guard during mixin registration. Consider a simple example: -there are a number of birds who have two mixins: Fly and Sing. For Fly -there are limitations: a bird can only fly if it is at least two years -old and is not a Penguin. Such problems are be solved with -mixin guards: -

    - -
    -  Class Fly
    -  Fly instproc fly {} {puts "[my signature]: yippee, fly like an eagle!"}
    -
    -  Class Sing
    -  Sing instproc sing {} {puts "[my signature]: what a difference a day makes"}
    -
    -  Class Animal -parameter age
    -  Animal instproc unknown args { puts "[my signature]: how should I $args?"}
    -  Animal instproc signature {} {
    -    return "[self] [my info class] ([my age] years)"
    -  }
    -
    -  Class Bird -superclass Animal
    -  Class Penguine -superclass Bird
    -  Class Parrot -superclass Bird
    -  Class Duck -superclass Bird
    -
    -  Parrot tweedy -age 1
    -  Penguine pingo -age 5
    -  Duck donald -age 4
    -  Parrot lora -age 6
    -
    -  Bird instmixin {{Fly -guard {[my age] > 2 && ![my istype Penguine]}} Sing}
    -

    -An invocation like: -

    - -
    -foreach bird {tweedy pingo donald lora} { $bird fly }
    -

    -yields the following result: -

    -
    -::tweedy ::Parrot (1 years): how should I fly?
    -::pingo ::Penguine (5 years): how should I fly?
    -::donald ::Duck (4 years): yippee, fly like an eagle!
    -::lora ::Parrot (6 years): yippee, fly like an eagle!
    -
    - -

    -There are similar introspection options for mixin guards as those for -filter guards. In particular, we can use info mixinguard and -info instmixinguard for getting the mixin guards for a -particular mixin or instmixin respectively. -

    - -

    Querying, Setting, Altering Filter and Mixin Lists -

    - -The methods mixin, instmixin, filter and -instfilter are system slots -having the same query and update interface. -
      -
    • If one of those methods is called without argument, it returns the current -setting.
    • -
    • If it is called with one argument, the argument is used to -set the specified list as indicated in the above examples.
    • -
    • If these methods are called with more than one argument, the first argument -is used to specify the action. Possible values for the action are -set, get, add and delete. See below for -commonly used examples. -
    -

    -

    - - - - - - - - -
    obj mixin same as: obj info mixin
    obj mixin {C1 C2} same as: obj mixin assign {C1 C2}
    obj mixin assign {C1 C2}sets the mixins for obj
    obj mixin add C3 adds the mixin C3 on front of the mixin list
    obj mixin add C3 end adds the mixin C3 at the end the mixin list
    obj mixin add C3 3 adds the mixin C3 at the 3rd position
    obj mixin delete ::C3removes the mixin C3 from the mixin list. -Use absolute class names. delete supports an optional flag -nocomplain that does not produce an error, when the specified class is not in the list. -
    -
    -

    -

    -Note, that the list of possible actions can be -extended by extending the class ::xotcl::Relations. -

    - -

    -Querying Call-stack Information -

    -

    Since the presented interceptors are -normal XOTcl instprocs they can access all XOTcl introspection -abilities introduced so far. In instprocs all recent information is -accessible within their scope. But the interceptors are mechanisms, -which cover more then their sole scope. The meaningful usage of the -meta-programming abilities often requires to go further and to get -information from the caller's and the callee's scope (e.g for -delegation decisions). Therefore, we introduced rich call-stack -informations for the interceptors. Note, that these are also available -for ordinary methods, but the "called..." info options return empty -strings. -

    -

    All call-stack information are packed compactly into the -self primitive as additional options. Note, before XOTcl -version 0.84 these were implemented as a part of the info -method. They are part of the self command for conceptual -integrity: introspection options in info can be expected to -produce the same result, when they are not explicitly changed. In -contrast, all information provided by self are -call-stack dependent. -

    - -
    -

    Querying Call-stack Information via self

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    self activelevel - -

    Returns the stack level from where the - current command was invoked from, or where the last next - was called (whatever is closer to the invocation). - If the current command was invoked from - an XOTcl method the absolute level is returned (e.g. #4) - which can be used in the uplevel or - upvar Tcl command or XOTcl method. If the current - command was not invoked from an XOTcl method, the value 1 - is returned. -

    self calledproc - -

    Returns the name of the method which was invoked in - the original call. -

    self calledclass - -

    Returns the name - of the class which presumably (if no dynamic class change occurs - afterwards) is invoked in - the original call. -

    self callingclass - -

    Returns the name of the class from which the - call was invoked (if one exists, otherwise an empty - string). -

    self callinglevel - -

    Returns the stack level from where the - current command was invoked from. In contrary to - activelevel next-calls are ignored in the - computation. If the current command was invoked from an - XOTcl method the absolute level is returned (e.g. #4) - which can be used in the uplevel or - upvar Tcl command or XOTcl method. If the current - command was not invoked from an XOTcl method, the value 1 is - returned. -

    self callingproc - -

    Returns the name of the method from which the - call was invoked (if one exists, otherwise an empty - string). -

    self callingobject - -

    Returns the name of the object from which the - call was invoked (if one exists, otherwise an empty - string). -

    self filterreg - -

    In a filter: returns the name - of the object/class on which the filter is registered. Returns either - 'objName filter filterName' or - 'className instfilter filterName'. -

    self isnextcall - -

    Return 1 if this method - was invoked via next, otherwise 0 -

    self next - -

    Return the - "next" method on the path as a string, i.e. the method which will be - called by [next]. -

    -
    -

    -


    -

    Note, that three options with the prefix calling -represent the values of self, self proc, and self -class in the scope where the original call was invoked. In the -following section we will show a simple program in which all of the -info options have different values. - -


    Filter Call-stack Information Example -

    -

    Now we discuss a simple example that shows that all filter -introspection options may have different values: -

    -
    -  Class InfoTrace
    -  InfoTrace instproc infoTraceFilter args { 
    -    puts "SELF:                [self]"
    -    puts "SELF PROC:           [self proc]"
    -    puts "SELF CLASS:          [self class]"
    -    puts "INFO CLASS:          [my info class]"
    -    puts "CALLED PROC:         [self calledproc]"
    -    puts "CALLING PROC:        [self callingproc]"
    -    puts "CALLING OBJECT:      [self callingobject]"
    -    puts "CALLING CLASS:       [self callingclass]"
    -    puts "REGISTRATION CLASS:  [self filterreg]"
    -    puts "CALLING LEVEL:       [self callinglevel]"
    -    puts "ACTIVE LEVEL:        [self activelevel]"
    -    next
    -  }
    -
    -  Class CallingObjectsClass
    -  CallingObjectsClass callingObject
    -
    -  Class FilterRegClass -superclass InfoTrace
    -  Class FilteredObjectsClass -superclass FilterRegClass 
    -  FilteredObjectsClass  filteredObject 
    -
    -  CallingObjectsClass instproc callingProc args {
    -     filteredObject set someVar 0
    -  }    
    -  FilterRegClass instfilter infoTraceFilter

    -The invocation of callingObject callingProc produces the -following output: -

    -
    -  SELF:                ::filteredObject
    -  SELF PROC:           infoTraceFilter
    -  SELF CLASS:          ::InfoTrace
    -  INFO CLASS:          ::FilteredObjectsClass
    -  CALLED PROC:         set
    -  CALLING PROC:        callingProc
    -  CALLING OBJECT:      ::callingObject
    -  CALLING CLASS:       ::CallingObjectsClass
    -  REGISTRATION CLASS:  ::FilterRegClass instfilter infoTraceFilter
    -  CALLING LEVEL:       #1
    -  ACTIVE LEVEL:        #1

    -The filter reports for self the value filteredObject, -since this is the object on which the set call is invoked; -infoTraceFilter is the method of the filter, and therefore, -the actual proc, while the actual class is InfoTrace, the -filter's class. The class of the actual object is -FilteredObjectsClass. -

    -

    The called procedure is set. While the program stays in a -XOTcl-instproc all calling-info-options are set, the calling -procedure is callingProc, the calling class is the class, -where the method is defined (namely CallingObjectsClass), -and the object from which the call invoked is callingObject. -

    -

    In this example, the calling level is equal to the active level, both -are #1. -

    - - - - - - - - -
    -

    Slots -

    -
    -
    - -

    A slot is a meta-object that manages property-changes of objects. A -property is either an attribute or a role in an relation. In a -nutshell, a slot has among other attributes:

    - -
      -
    • a name (which it used to access it), -
    • a domain (object or class on which it can be used) , and -
    • can be multivalued or not. -
    - -

    We distinguish between system slots (predefined slots - like class, superclass, mixin, - instmixin, filter, instfilter) and - attribute slots (e.g. attributes of classes).

    - -

    System Slots

    -

    -System slots are predefined slots defining e.g. some relations -between classes, or between objects and classes. The predefined system slots -are: -

      - -
    • superclass: every class in XOTcl has one or more - superclasses. The name of this slot is superclass, the - domain is ::xotcl::Class, the slot is multivalued, since - one object might have multiple superclasses.

      - -

    • class: every object has a class; therefore, the domain - of the slot is ::xotcl::Class, the property is not multivalued.

      - -

    • mixin: every object in XOTcl can have one or more - mixin classes. The name of this slot is mixin, the domain - is ::xotcl::Object , the slot is multivalued.

      - -

    • instmixin: same as above, but the domain is - ::xotcl::Class.

      - -

    • filter, instfilter: similar to mixin - and instmixin. - -

    The system slots were introduced earlier with their -semantics. Here we just point out, that they have all the same -interfaces for querying, setting, adding and removing of slot -values.

    - -

    Every slot can be used set and query the property from its domain. -The syntax for setting values is -

    -  object property newValue
    -
    - and for getting its values is -
    -   set x [object property]
    -
    -where property denotes the slot name. -Every multivalued slot provides the methods add and -delete. - -Here are a few examples for using the system slot mixin which we have introduced already in the section of the mixins -
    -  Object o; Class M; Class N
    -  o mixin ::M      ;# replacing the per-object mixins of o with M
    -  o mixin reset ::M  ;# same as before
    -  o mixin add ::N   ;# add N to the front of the mixin list
    -  o mixin delete ::M ;# delete M from the mixin list
    -  puts [o mixin]   ;# query the current mixin list
    -
    - -Every system slot (e.g. superclass) has the exact same interface. - -

    Attribute Slots

    - -

    Attribute slots are used to manage the setting and querying of -instance variables. We define now a person with three attributes -name, salary and projects.

    - -
    -  Class Person -slots {
    -    Attribute name
    -    Attribute salary -default 0
    -    Attribute projects -default {} -multivalued true
    -  }
    -
    - -

    These attributes might have a default value or they might be - multivalued. When an instance of class Person is created, the - slot names can be used for specifying values for the slots.

    - -
    -  Person p1 -name "Joe"	
    -
    - -

    Object p1 has three instance variables, namely name, -salary and projects. Since slot projects is -multivalued, we can add a value to the list of values the add -subcommand.

    - -
    -  Project project1 -name XOTcl \
    -     -description "A highly flexible OO scripting language"
    -
    -  p1 projects add ::project1
    -  p1 projects add some-other-value
    -
    - -

    The value of the instance variable project of Person -p1 is now the list {some-other-value ::project1}. -

    - -

    Attribute slots are implemented via dynamic object aggregations -(see below), where the Class objects contain -the slot objects with the information like default etc. In order to -prevent name clashes between the slot objects and the methods of a -class (like e.g. create), an intermediary object named -slot is used as a container of the slot objects. In the example above -we create an object structure of the following form:

    -
    -  Person
    -  Person slot name
    -  Person slot salary
    -  Person slot projects
    -
    - -

    This object structure can be used to to query and modify the slot -properties or to add additional methods to the slot objects. One -application is for example to used slot-specific methods for checking -slot values, as shown in the next section. - -

    -  Person info vars  ;# results in the list of variables of ::Person
    -  Person slot name info vars ;# list of variables of the slot object ::Person::slot::name
    -
    -Since slot objects are ordinary XOTcl objects, they can have their own slots as well (such as default, name etc.). - -The following example -sets and queries the default of the slot name of Person: -

    - -
    -  Person slot name default "gustaf"
    -  ? {Person slot name default} gustaf
    -
    - -

    However, due to the current implementation, it is necessary to -re-init the slot object when the slot properties (such as -e.g. default) are changed. This can be achieved by calling -the method init of the slot object. -

    - -

    Note that a statement for creating a slot object like

    -
    -  ... {
    -    Attribute name
    -    ...
    -  }
    -
    -

    is a short hand notation for

    -
    -  ... {
    -    Attribute create name
    -    ...
    -  }
    -
    -

    This is exactly the same situation like every where else in XOTcl, -when an object/class is created. One has to use create explicitly, -when a name of a slot object conflicts with a method of the class -(e.g. one has to use "Attribute create class" if a slot named -class is created).

    - -

    One cannot define on a meta-class an attribute named slot -or slots and use then "... MetaClass Foo -slots { -::xotcl::Attribute x}... to create the slot objects. To handle -this naming conflict, one has to create the slot objects outside of the -aggregation and to provide the values for the properties of Attribute -(domain, manager, .... ) by hand.

    - - -

    Setter and Getter Methods for Slots

    - -

    When a slot is called via its name, the call is delegated to the -slot object. Per default, the slot value is read via the get -method of the slot and it is set the assign method. By -redefining these methods, it is possible to provide custom setter and -getter methods. The following example redefines the setter methods -assign to check, whether an attribute value is within the -range between 1 and 99.

    - -
    -  Class create A -slots {
    -    Attribute foo -default 1 -proc assign {domain var value} {
    -      if {$value < 0 || $value > 99} {
    -        error "$value is not in the range of 0 .. 99"
    -      }  
    -      $domain set $var $value
    -    }
    -  }
    -
    -  A create a1
    -  ? {a1 foo 10} 10
    -  ? {a1 foo} 10
    -  ? {catch {a1 foo -1}} 1
    -
    - -

    For the most common simple cases with single valued attributes, -where neither setter or getter are redefined, XOTcl optimizes the slot -access function and replaces the delegation to the slot object by the -the C-level implementation of instparametercmd. - -

    Note that it is possible to subclass Attribute (e.g. in -order to store more properties for attributes, like when attributes -are stored in a relational database) or to register mixin-classes or -filters.

    - - -

    Backward-compatible Short-Hand Notation -for Attribute Slots

    - -

    XOTcl provides a short-hand notation for creating attribute slots, -which is backward compatible for the most important options of XOTcl -verison prior to 1.5.0. Instead of writing

    - -
    -  Class Car -slots {
    -    Attribute owner
    -    Attribute doors -default 4
    -  }
    -
    -

    one can use as well

    -
    -  Class Car -parameter {
    -    owner
    -    {doors 4}
    -  }
    -
    -

    The various features of the prior implementation of parameter are -deprecated and will be removed in future versions. -

    - -

    Experimental Slot Features

    -

    Value Checking

    - -

    Attribute slots can have types assigned which are tested whenever -the instance variable is altered. The slot salary is defined -as integer whereas projects is defined to be a list of -instances of the class ::Project (a list of instances, since -projects is defined as multivalued).

    - -
    -  Class Person -slots {
    -    Attribute name
    -    Attribute salary -default 0 -type integer
    -    Attribute projects -default {} -multivalued true -type ::Project
    -    ...
    -  }
    -
    -  Person p2 -name "Sue"	-salary 1000
    -
    - -

    It is as well possible to define custom value checkers and to -normalize the input values. We extend the previous example and define -"my sex" as value for type. If the value checker -consists of multiple words, the type check compiler assumes that the -value is a Tcl command, to which the actual value is appended as -additional argument before invocation. my refers to the -slot object. In the example below, we define for the slot object an -object specific method that returns 1 or 0 depending on the success of the -check. This method (a) checks the values via switch -and (b) normalizes and resets the value via uplevel. -

    - -
    -  Class Person -slots {
    -    ...
    -    Attribute sex -type "my sex" -proc sex {value} {
    -      switch -glob $value {
    -        m* {my uplevel {$obj set $var m}; return 1}
    -        f* {my uplevel {$obj set $var f}; return 1}
    -        default {return 0}
    -      }
    -    }
    -  }
    -
    - - -

    The slot values are actually checked via Tcl variable traces whenever the -associated variable gets a new value assigned. This means that the values are -enforced now matter how the variables are set. Therefore, the -checks are performed in the following two commands as well, although -the slot values are not accessed via the slot names. The checks will -throw an error in the second command, since 1100x is not an -integer.

    - -
    -  p2 incr salary 100
    -  p2 append salary x
    -
    - -

    Similarly the second command below will throw an error, since -some-other-value is not an instance of ::Project. - -

    -  p2 projects add ::project1
    -  p2 projects add some-other-value     
    -
    - -

    When a check throws an error, the instance variables - are reset to the previous value. To restore the original - value, an associative array __oldvalue() is kept as - instance variable in the object. -

    - -

    In general, checking of variables can be turned off globally - by -

    -  ::xotcl::Slot instmixin add ::xotcl::Slot::Nocheck
    -
    -

    - This mixin replaces the methods check and - checkall as well as mk_type_checker by - no-ops. When the mixin is active and the Attribute definitions - are loaded, the specified type has no effect. -

    -

    - Value checking can be turned off also selectively for each slot via - using ::xotcl::Slot::Nocheck as per-object-mixin; if - attributes are subclassed, - it is possible to register the Nocheck mixin on a - subclass of Attribute. -

    - -

    Init Commands and Value Commands for Slot Values

    - -

    An init command (initcmd) of a slot is similar to a -default and is a command to be executed when the value of the -associated variable is read the first time. That means that when an -object is created the associated variable has no value. On the -contrary, when a default is used, the variable is set to the default -value, when the object is created.

    - -The primary advantage of slot init commands is Lacy -initialization: When an object has many slots and the -initialization of all slots is costly (e.g. the value of each slot is -fetched from a relational database), and not all of the values are -needed for each instance, only the relevant variables of the object -are initialized on demand. - -
    -  Class C -slots {
    -    Attribute x -initcmd {puts {init}; set _ 101}
    -  }
    -
    -  C c1
    -  c1 info vars  ;# ==> returns ""
    -  c1 set  x     ;# ==> puts init, returns 101
    -  c1 info vars  ;# ==> returns "x"
    -

    -
    - -

    The initcmd is executed only once, when the variable is read the first -time. For later reads of the variable contents, the values are returned. - -

    A value command (valuecmd) of a slot is similar to a a -init command, except that it is executed whenever the value of the -variable is read. A value command can be used e.g. to implement live -updates for variables or for abstracting from sql sequences or the -like.

    - -

    Finally the value changed command (valuechangedcmd) can be -used to specify the behavior, whenever the value of the variable is -altered. This option is used to implement the value checking described -in the last section.

    - -

    The slot parameters default, initcmd and -valuecmd have to be used mutually exclusively. -

    - - - - - - - - - - -
    -

    Nested Classes - and Dynamic Object Aggregations -

    -
    -
    -

    Most object-oriented analysis and design methods are based on the -concepts of generalization and aggregation. Generalization is -achieved through class hierarchies and inheritance, while static -aggregation is provided through embedding. Since version 8.0 Tcl -offers a namespace concept which can be used as a mechanism to -provide dynamic aggregations. -

    -

    A namespace provides an encapsulation of variable and -procedure names in order to prevent unwanted name collisions with -other system components. Each namespace has a unique identifier which -becomes part of the fully qualified variable and procedure names. -Namespaces are therefore already object-based in the terminology of -Wegner. OTcl is object-oriented since it offers classes and class -inheritance. Its objects are also namespaces, but an object is more -than only a namespace. Therefore, two incompatible namespace concepts -have existed in OTcl in parallel. -

    -

    In XOTcl every object and every class is -logically implemented as a separate Tcl namespace. The biggest benefit of this -design decision aside from performance advantages is the ability to -aggregate objects and nest classes. Contrary in OTcl every object has -a global identifier. Through the introspection abilities of -namespaces nested classes are also traceable at runtime and can be -changed dynamically. In XOTcl objects are allowed to contain nested -objects, which are dynamically changeable aggregates of the -containing object. -

    - - -

    Nested Classes

    - -

    The notation for nested classes follows the syntax of Tcl -namespaces by using ``::'' as a delimiter. For example the -description of a oval carpet and a desk can nest inside of the -OvalOffice class: -

    -
    -  Class OvalOffice
    -  # general carpet
    -  Class Carpet
    -  Class OvalOffice::Desk
    -  # special oval carpet - no name collision
    -  Class OvalOffice::Carpet -superclass ::Carpet
    -

    -Nested classes can be used exactly like ordinary classes, a user can -sub-class it, derive instances, etc. The information about the -nesting structure of classes is available through the info -instance method: -

    -
    -  className info classchildren ?pattern?
    -  className info classparent
    -

    -The classchildren option returns a list of children, if one -or more exist, otherwise it returns an empty string. classparent -results in the name of the parent class, if the class is nested. -Since nested classes are realized through namespaces, all -functionality offered by Tcl's namespace command is usable -from XOTcl as well. -

    -

    Dynamic Object Aggregations

    - -

    The nested classes only provide an aggregation of the descriptive -not of the runtime properties of an object. We have pointed out the -difference of object and class in XOTcl. Because of the splitting of a -class into class and class-object it is possible to give each object -its own namespace. The internal implementation of objects enable them -to contain nested objects, which are aggregates of the containing -object. In XOTcl these can be changed dynamically and introspected -through the language support of dynamic object aggregations [Neumann and Zdun 2000b]. Suppose an -object of the class Agent should aggregate some property -objects of an agent, such as head and body: -

    -
    -  ClassAgent
    -  Agent myAgent
    -
    -  Class Agent::Head
    -  Class Agent::Body
    -
    -  Agent::Head ::myAgent::myHead
    -  Agent::Body ::myAgent::myBody
    -

    -Now the objects myHead and myBody are part of the -myAgent object and they are accessible through a -qualification using ``::'' (or through Tcl's namespace command). But -in the common case they will be accessed, as introduced so far: the -explicit full qualification is not necessary when such variables are -being accessed from within XOTcl methods, since the object changes to -its namespace. -

    -

    The information about the part-of relationship of objects can be -obtained exactly the same way as for classes through the -info interface: -

    -
    -  objName info children ?pattern?
    -  objName info parent
    -
    - -

    Relationship between Class Nesting and Object Aggregation

    - -

    The classes Head and Body are children of the -Agent class. It is likely that all agents, interactive or -not, have properties for head and body. This implies a static or -predetermined relationship between class nesting and object -aggregation. Such predetermination do not exist in XOTcl, but are -simply build, when specifying the relationship in the constructor, -e.g.: -

    -
    -  Agent instproc init args {
    -    ::Agent::Head [self]::myHead
    -    ::Agent::Body [self]::myBody
    -  }
    -

    -Now all agents derived from the class have the two property objects -aggregated after creation. But still they are changeable in a -dynamical manner, e.g. with: -

    -
    -  Agent myAgent
    -  myAgent::myHead destroy
    -

    -The agent turns into a headless agent. In companion of the -introspection mechanisms such constructions could be very useful. -Suppose, that in the virtual world the agents heads may be slashed -from their bodies. The graphical system simply needs to ask with info -children on the agent's object, whether it has a head or not and -can choose the appropriate graphical representation. -

    - -

    Simplified Syntax for Creating Nested Object Structures

    - -To ease the generation of nested structures, one can use the -predefined method contains. In essence, contains -changes the namespace, where objects are created to the object, -on which it is executed. In the example below, we create three -nested rectangles, where two of these contain two more points. -The outer rectangle is r0 containing rectangle r1 -and r2. - -
    -  Class Point -parameter {{x 100} {y 300}}
    -  Class Rectangle -parameter {color}
    -
    -  Rectangle r0 -color pink -contains {
    -    Rectangle r1 -color red -contains {
    -      Point x1 -x 1 -y 2
    -      Point x2 -x 1 -y 2
    -    }
    -    Rectangle r2 -color green -contains {
    -      Point x1
    -      Point x2
    -    }
    -  }
    -
    -  ? {r0 color} pink
    -  ? {r0 r1 color} red
    -  ? {r0 r1 x1 x} 1
    -  ? {r0 r1 x2 y} 2
    -  ? {r0 r2 color} green
    -
    - -

    Every object in XOTcl is realized as a Tcl command. If nested -objects are created, these commands are available as object specific -methods. So, instead of calling the contained rectangle r1 via the -fully qualfied name ::r0::r1, one can use r0 -r1. This is exactly the same situation as it arises, when e.g. a -global Tcl proc proc o1 {} {...} and an XOTcl object o1 -(created via Object o1) is created. Both commands cannot -coexist in the same namespace. - -

    - -

    Copy/Move

    - -Often an object has to be copied/moved. This is a very useful -functionality when XOTcl should be used as a prototyping language. -The XOTcl method move provides this functionality. Another -common behavior is implemented by the copy method which -clones the actual object to a destination object via a deep copy operation. -The two methods have the syntax: - -
    -  objName move destination
    -  objName copy destination
    -

    - -Copy and move operations work with all object/class information, i.e., -information on filters, mixins, parameters, etc. are -automatically copied. Copy and move are integrated with class nesting -and object aggregations. All copy/move operations are deep copy -operations: all nested objects/classes are automatically copied/moved, -too. - -E.g. if we want to reuse an imperial march object of star wars for -star wars 2, we can just copy the object: -

    -  starWars::imperialMarch copy starWars2::imperialMarch
    -
    - -Note that move is implemented in current versions of xotcl -as a copy plus subsequent destroy operation. -

    - - - - - - - - - - - - - -
    -

    Method Forwarding -

    -
    -
    -

    As you have seen from many previous examples, XOTcl's primary command for -method forwarding is the next primitive. next calls -the same-named method of the current object, usually with the same -argument list. However, frequently method forwarding is required -between different objects as well, commonly referred to as -delegation.

    - -

    In general, delegation can be achieved in XOTcl without any special construct -using simple methods containing a few lines. However, In -several situations, forwarding is as well needed to plain -Tcl commands, for example, if object oriented stubs are implemented on -base of non-oo function calls. These functions might access instance -variables of the objects. XOTcl uses this functionality in various -situations, such as for instance in the implementation of the -set, unset, append, array methods among others.

    - -

    The fowarding functionality is suppored by XOTcl be the methods -forward and instforward that address these requirements -and provide an efficient implementation for these tasks.

    - -

    The forwarding command specifies that whenever methodName is called, -this invocation is delegated to callee, where the actual argument list -(from the invocation) is appended to the argument list specified in the forwarding command. -Like for procs and instprocs, we can distinguish between forward and -instforward, depending on we want to the method available for a single object -of for the instances of a class.

    - -

    The general form of the forwarding commands is: -

    -  obj  forward methodName ?options? callee ?arglist? 
    -  cls  instforward methodName ?options? callee ?arglist? 
    -
    - -where valid options are -objscope, -methodprefix, --earlybinding and -default. The option --objscope is used to specify that the command should be -executed in the scope of the calling object (i.e. instance variables apprear -as local varibales), -methodprefix means that the called -method should be prefixed with the specified string (to avoid name -clashes), -earlybinding means that the function pointer of -the specified command (callee) is take at invocation time (should only -be done for (builtin) commands inplemented in C), and --default provides a means for providing default methods when -none are specifed.

    - -

    Each of the arguments after the method name (including -callee) can be be substituted an invocation time, or they are -taken literally. The arguments to be substituted are starting always -with a percent sign. These arguemnts can be %self, -%proc, %1, %argclindex, or % -followed by a Tcl command, and it can be prefixed with a positional -prefix %@. We will introduce the usage of these options and -argument substitutions based on examples.

    - -

    In our first example we define an object dog and an object -tail. If the dog receives the call wag it -delegates this call to the tail and returns its result. In -this introductory example, the method tail simply returns its -arguments.

    - -

    In this example, forwarding is achieved through the method -forward that creates a forwarder command. This method -receives as first argument the name, under which the forwarder is -registered, followed by the object that receives the delegation (the -"callee"), followed my the (optional) method name and optional -arguments. More about this later. Here we register the forwarder under -the name wag, the callee is tail, and the method is -defined to have the name of the forwarder. We could have written here -dog forward wag tail wag as well, be we use %proc -which refers to the name of the forwarder. Using %proc is -slightly more general in cases the forwarder is renamed. -

    - -
    -  ###########################################
    -  # trivial object delegation
    -  ###########################################
    -  Object dog
    -  Object tail
    -  tail proc wag args { return $args }
    -  dog forward wag tail %proc
    -
    - -

    With these definitions a call to "dog wag 100" calls -actually "tail wag 100" which returns the result of -100.

    - -

    The following command shows the delegation to a Tcl command -(instead of delegation to an object). We define a simple forwarder -that forwards a call to the Tcl command expr with some -arguments.

    - -
    -  ###########################################
    -  # adding 
    -  ###########################################
    -  Object obj
    -  obj forward addOne expr 1 +
    -
    -The invocation obj addOne 5 returns 6 as value.

    - - -

    In our next example we want additionally that the Tcl command -should to be evaluated in the context of the current object. This -means that the method can easily access instance variables of the -delegating object. We define a forwarder for the class X with -the name Incr (to avoid confusion with the already defined -method incr), we use the -objscope option and -specify incr as the callee. Since the forwarder is defined -via instforward the forwarder is available to all instances -of the class. -

    -  ###########################################
    -  # evaluating in scope 
    -  ###########################################
    -  Class X -parameter {{x 1}}
    -  X instforward Incr -objscope incr
    -  
    -  X x1 -x 100
    -  x1 Incr x
    -  x1 Incr x
    -  x1 Incr x
    -
    -After the three calls to Incr the call x1 x -returns the value 103.

    - -

    In our next example, we show the usage of the -%-substitution more advanced argument handling. This example -sketches the implementation of the mixin add, mixin -set methods as shown above. In order to obtain extensible -subcommands (such as mixin add, mixin delete, etc.), we -define an object for which the subcommands are defined as methods. We -will use this object as callee for the appropriate methods. So, we -define an object named mixin and define a forwarder with the -name Mixin (again we capitalize Mixin to avoid name clashes -with the already defined methodmixin ). -

    -  ###########################################
    -  # mixin example
    -  ###########################################
    -  Object create mixin
    -  mixin proc unknown {m args} {return [concat [self] $m $args]}
    -  obj forward Mixin mixin %1 %self
    -
    -We define here the method unknown to see what arguments are -passed. The following invocation will lead to the call in noted in the comment. -
    -  obj Mixin add M1       ;# calls ::mixin add ::obj M1
    -
    -You see that %1 was substituted by the first argument of the -invocation (here add) and %self was substituted by -the name of the current object (here ::obj). The second -argument of the invocation (here M1) was appended as -usual. However, in calls like -
    -  obj Mixin
    -
    -we have to deal with cases, where the used argument (%1) is -not given at the invocation. In this case we get either an -error message, or we can specify a default argument via the -option -default: -
    -  obj forward Mixin -default {getter setter} mixin %1 %self
    -
    -This definition means that if no argument is specified in the -invocation we call the method getter, if one argument is -given the method setter, in other cases we use the specified -arguments. Therefore the following three invocations are delegated as -indicated in the comments. -
    -  obj Mixin              ;# calls ::mixin getter ::obj
    -  obj Mixin M1           ;# calls ::mixin setter ::obj M1
    -  obj Mixin add M1       ;# calls ::mixin add ::obj M1
    -
    - -

    When we implement subcommands by delegating to other commands -(as shown in the last example), there can be situations where naming -conflicts might arise. For example, if we want to implement a -subcommand method class we might not want to implement a new -method class on the callee, since this would overwrite the -standard definition of class. To overcome such difficulties, -we provide the option -methodprefix. The following example -shows how to prefix every called method with the prefix @. -

    -
    -  ###########################################
    -  # sketching extensible info
    -  ###########################################
    -  Object Info
    -  Info proc @mixin {o} {
    -    $o info mixin
    -  }
    -  Info proc @class {o} { ;# without prefix, doing here a [Info class] would be wrong
    -    $o info class
    -  }
    -  Info proc @help {o} { ;# define a new subcommand for info
    -    foreach c [my info procs] {lappend result [string range $c 1 end]}
    -    return $result
    -  }
    -  Object instforward Info -methodprefix @ Info %1 %self 
    -
    -With this definitions, the following call is rewritten as indicated in the comment. -
    -  x1 Info class          ;# ::Info @class ::x1
    -
    - -

    When a forwarder is defined, the callee (the target command) can be -omitted. When the callee is not specified, the method-name is used -instead. When the method-name has a namespace prefix, the method name -is the tail and the callee is the fully qualified name. -

    -
    -  ###########################################
    -  # optional callee
    -  ###########################################
    -  obj set x 2
    -  obj forward append -objscope
    -  Object n; Object n::x
    -  obj forward ::n::x
    -
    -With this definitions of the forwarder append and x, -the following calls are rewritten as indicated in the comment. -
    -  obj append x y z        ;# ::append x y z ... returning  2yz
    -  obj x self              ;# ::n::x self    ... returning  ::n::x
    -
    -

    The forwarder append forwards the call to the Tcl command -append, which accesses the instance variable x and -appends the specified values.

    - -

    The list of tokens executed by the forwarder might -contain Tcl commands executed during every invocations. This makes it -for instance possible to pass instances variables to the callee. In -the next example the object has the instvar named x which is -multiplied by a factor of 10 when the method x* is invoked. -

    -  ###########################################
    -  # command substitution
    -  ###########################################
    -  obj set x 10
    -  obj forward x* expr {%my set x} *
    -
    -With this definitions, the following call is rewritten as indicated in the comment. -
    -  obj x* 10               ;# expr 10 * 10 ... returning  100
    -
    - -

    In certain situations it is necessary to insert arguments always at -the same position (e.g. at the second to last position). The -positional addressing can be achieved by prefixing the arguments of -the forward specification by %@POS , where POS is -either a positive (argument positing from the beginning) or negative -integer (argument counting from the end) or the constant end -(denoting the last position). After POS a single space is -used as a delimiter for the rest of the argument, which might be -some other %-substitution or a constant. The positional arguments -are evaluated from left to right and should be used in ascending order. -

    - -

    The following examples show a few usages of the positional arguments -in the forwarder. The forwarders f1 to f5 are created, followed by -one or more usages. The first argument of the usage is the call to -to forewarder, the second argument is the result. -

    -
    -  ###########################################
    -  # forwarding with positional arguments
    -  ###########################################
    -  Object obj
    -  obj forward f1 list {%@end 13}
    -  ? {obj f1 1 2 3 } [list 1 2 3 13]
    -
    -  obj forward f2 list {%@-1 13}
    -  ? {obj f2 1 2 3 } [list 1 2 13 3]
    -
    -  obj forward f3 list {%@1 13}
    -  ? {obj f3 1 2 3 } [list 13 1 2 3]
    -  ? {obj f3} [list 13]
    -
    -  obj forward f4 list {%@2 13}
    -  ? {obj f4 1 2 3 } [list 1 13 2 3]
    -
    -  obj forward f5 {%@end 99} {%@0 list} 10
    -  ? {obj f5} [list 10 99]
    -  ? {obj f5 a b c} [list 10 a b c 99]
    -
    - -

    The construct %argclindex LIST can be used to substitute an argument -depending on the number of arguments when the forwarder is -invoked. For example, it is possible to call forward to a different -method depending on how many arguments are specified. The number of arguments -is used as an index in the specified list. When the number of arguments is larger -than the number of elements in the specified list, an error is generated.

    - -
    -  ###############################################
    -  # substitution depending on number of arguments
    -  ###############################################
    -  obj forward f %self [list %argclindex [list a b c]]
    -  obj proc a args {return [list [self proc] $args]}
    -  obj proc b args {return [list [self proc] $args]}
    -  obj proc c args {return [list [self proc] $args]}
    -  ? {obj f} [list a {}]
    -  ? {obj f 1 } [list b 1]
    -  ? {obj f 1 2} [list c {1 2}]
    -  ? {catch {obj f 1 2 3}} 1
    -
    - -

    Finally, the concluding example defines a class chan to use the -I/O-commands in an OO-manner. The proc open is used to create a -chan instance. For the channel object we provide the method -close (to close a channel and to destroy the channel object), -puts (to write on a stream), blocked (to check -whether last command exhausted all input), and fconfigure (to -configure the stream). Note that for puts we specified that -the actual stream should be inserted as the second to last argument. -

    -
    -  Class chan -parameter stream
    -  # create stream and object
    -  chan proc open args { 
    -    set stream [eval open $args]
    -    my create $stream -stream $stream  ;# make an object
    -  }
    -  # close stream and destroy object
    -  chan instproc close {} {
    -    close [my stream]
    -    [self] destroy
    -  }
    -  # handle other subcommands (methods) via unknown
    -  chan instproc unknown {m args} {
    -    set valid [lsort [chan info instcommands]]
    -    stderr puts "unknown chan method '$m' $args called; 
    -      	defined methods: $valid"
    -  }
    -  chan create stdout -stream stdout   ;# define standard stream
    -  chan create stderr -stream stderr   ;# define standard stream
    -
    -  chan instforward puts puts {%@-1 %my stream}
    -  chan instforward blocked fblocked {%my stream}
    -  chan instforward fconfigure fconfigure {%my stream} 
    -
    -  set c [chan open /tmp/junk w]
    -  $c puts -nonewline "hello"
    -  $c puts -nonewline " world"
    -  $c puts ""
    -  $c xxx                                       ;# trigger unknown
    -  # The stream instances denote the currently open streams
    -  stderr puts "currently open streams: [chan info instances]" 
    -  $c close
    -  stderr puts "currently open streams: [chan info instances]"
    -
    - - - - - - - - - -
    -

    Assertions - -

    -
    -
    -

    In order to improve reliability and self documentation we added -assertions to XOTcl. The implemented assertions are modeled after the -``design by contract'' concept of Bertrand Meyer. In XOTcl assertions -can be specified in form of formal and informal pre- and -post-conditions for each method. The conditions are defined as a list -of and-combined constraints. The formal conditions have the form of -normal Tcl conditions, while the informal conditions are defined as -comments (specified with a starting ``#''). The lists -containing the pre- and post-conditions are appended to the method -definition (see example below). -

    -

    Since XOTcl offers per-object specialization it is desirable to -specify conditions within objects as well (this is different to the -concept of Meyer). Furthermore there may be conditions which must be -valid for the whole class or object at any visible state (that means -in every pre- and post-condition). These are called invariants and -may be defined with following syntax for class invariants: -

    -
    -  className instinvar invariantList
    -

    -or for objects invariants: -

    -
    -  objName invar invariantList
    -

    -Logically all invariants are appended to the pre- and post-conditions -with a logical ``and''. All assertions can be introspected. -

    -

    Since assertions are contracts they need not to be tested if one -can be sure that the contracts are fulfilled by the partners. But for -example when a component has changed or a new one is developed the -assertions could be checked on demand. For this purpose the check -method can be used either to test the pre- or the post-conditions. -The syntax is: -

    -
    -  objName check ?all? ?instinvar? ?invar? ?pre? ?post?
    -

    -Per default all options are turned off. check all turns all -assertion options for an object on, an arbitrary list (maybe empty) -can be used for the selection of certain options. Assertion options -are introspected by the info check option. The following -class is equipped with assertions: -

    -
    -  Class Sensor -parameter {{value 1}}
    -  Sensor instinvar {
    -    {[regexp {^[0-9]$} [my value]] == 1}
    -  }
    -  Sensor instproc incrValue {} {
    -    my incr value
    -  } {
    -    {# pre-condition:} 
    -    {[my value] > 0}
    -  } {
    -    {# post-condition:} 
    -    {[my value] > 1}
    -  }
    -

    -The parameter instance method defines an instance variable -value with value 1. The invariant expresses the -condition (using the Tcl command regexp), that the value -must be a single decimal digit. The method definition expresses the -formal contract between the class and its clients that the method -incrValue only gets input-states in which the value of the -variable value is positive. If this contract is fulfilled by -the client, the class commits itself to supply a post-condition where -the variable's value is larger than 1. The formal conditions are -ordinary Tcl conditions. If checking is turned on for sensor s: -

    -
    -  s check all
    -

    -the pre-conditions and invariants are tested at the beginning and the -post-condition and invariants are tested at the end of the method -execution automatically. A broken assertion, like calling incrValue -9 times (would break the invariant of being a single digit) results -in an error message. -

    -

    -In assertions we do not check methods that modify or introspect -assertions. These are -check,info,proc,instproc,invar, -and instinvar. The reason for this is that we want to be able -to recover a malicious action in a catch error handler, like: -

    -
    -  ...
    -  if {[catch {my assertionBreakingAction} errMsg]} {
    -    puts "CAUGHT ERROR: $errMsg"
    -    # remember checking options, for turning them on later again
    -    set check [my info check]
    -    my check {}
    -    # recover from broken assertion
    -    ...
    -    # turning checking on again 
    -    $fb check $check
    -  }
    -
    - - - - - - - - -
    -

    Meta-Data -and Automatic Documentation - -

    -
    -
    -

    To enhance the understandability and the consistency between -documentation and program it is useful to have a facility to make the -documentation a part of the program. There are several kinds of -meta-data which are interesting for a class, e.g. the author, a -description, the version, etc. -

    -

    -Older versions of XOTcl have contained a special meta-data command -metadata. This command is now (from version 0.83) deprecated -and replaced by an integrated solution with XOTcl's API documentation -functionality. The object @ is used for documentation and -metadata issues. Per default it is not evaluated at all. Everything -that is send to @ is simply ignored. That way we do not waste -memory/performance at runtime, if we do not require to parse the -metadata/documentation. -

    -

    -If we have to know the meta-data/documentation, as for instance in the -xoDoc component and the makeDoc tool, that handle -XOTcl's internal documentation, we have to re-define the documentation -object. Alternatively, we can partially parse the source code for -@ commands. -

    -

    -With @ the meta-data/documentation is handled by first class -XOTcl objects. By defining alternate @ implementations - as in -xoDoc/makeDoc - we can evaluate the -meta-data/documentation arbitrarily. xoDoc/makeDoc -are only an HTML back-end, but the basic idea is to provide support for -several other usages as well (e.g. XML, RDF, on-line help, -documentation of dynamic structures, etc). -

    -

    -The object@ handles comments via its unknown -method. xoDoc adds the appropriate instprocs to t@ to produce HTML -output. The appropriate command is: -

    -
    -  tclsh src/lib/makeDoc.xotcl DOCDIR DOCFILES
    -

    - -The source of a documentation is structurally very similar to the -XOTcl constructs being commented. E.g. one can copy an instproc and -add comments at the right places, like: -

    -
    -    Class C
    -    C instproc m {a1 a2} {
    -       return [expr {$a1+$a2}]
    -    }
    -

    - - can be commented as follows -

    -
    -    @ Class C { description { "my sample class"} }
    -    @ C instproc m {a1 "first number" a2 "second number"} {
    -       description "add two numbers"
    -       return "sum of a1 and a2"
    -    }
    -

    -

    - One can do essentially a copy+paste of the source and add the - comments via attribute value pairs. Every basic language construct - can have a "description". If you want to include other properties to - the description, you can add them like: -

    -
    -    @ C instproc m {a1 "first number" a2 "second number"} {
    -       author "GN+UZ"
    -       date "Feb 31"
    -       description "add two numbers"
    -       return "sum of a1 and a2"
    -    }
    -

    - - This way, author and date are added automatically to the generated - HTML file. - - In addition, there is a @File hook for a per file -description, like: -

    -
    -@ @File {
    -  description {
    -    This is a file which provides a regression test
    -    for the features of the XOTcl - Language. 
    -  }
    -}
    -

    - - - - - - -
    -

    Additional - Functionalities -

    -
    -
    -

    Abstract Classes -

    -

    In XOTcl a class is defined abstract if at least one method of -this class is abstract. The instance method abstract defines -an abstract method and specifies its interface. Direct calls to -abstract methods produce an error message. E.g. a Storage class -provides an abstract interface for access to different storage forms: -

    -
    -  Class Storage
    -  Storage abstract instproc open  {name}       
    -  Storage abstract instproc store {key value}
    -  Storage abstract instproc list  {}         
    -  Storage abstract instproc fetch key        
    -  Storage abstract instproc close {}         
    -  Storage abstract instproc delete {k} 
    -

    -All kinds of storage have to implement every method from the -interface. E.g. a GNU Database Access, a relational database access, -and several other storage forms may be derived by sub-classing -(therefore, all conform to the same storage access interface). -

    - -

    Checking Commands for being Objects, -Classes, or Meta-Classes -

    -

    Since XOTcl is a hybrid language containing several Tcl commands, -sometimes its necessary for applications to distinguish between Tcl -commands and object commands for XOTcl. method of the -Object class looks up an objName and returns 1 if it -is an object and 0 if not: - -

    -  objName1 isobject objName2
    -

    - -If one can be sure that a command represents an -object, it might be unsure if the command is only an object or also -class or even meta-class. The two instance methods isclass -and ismetaclass check in the same manner, whether a class or -meta-class is given (since ever XOTcl class is an object, they also -return 0, when objName is not an XOTcl object). - -

    -  objName1 isclass objName2
    -  objName1 ismetaclass objName2
    -
    - -

    -Exit Handler -

    -

    A task for a programming language, sometimes of similar importance -as object creation, is the object destruction. XOTcl ensures that all -objects are destroyed and their destructors are invoked when XOTcl -applications terminate. For that reason objects and classes are -destroyed in the order objects, classes, meta-classes. Sometimes -further destruction order is of importance. For these cases, the XOTcl -language provides an exit handler, which is a user-defined proc, which -invokes user-defined exit handling just before the destruction of -objects, classes, meta-classes is invoked. For instance, the exit -handler lets the user specify objects which have to be destroyed -before all other objects. -

    -

    The exit handler is defined as a proc of Object, which is per default empty: -

    -  ::xotcl::Object proc __exitHandler {} {
    -    # clients should append exit handlers to this proc body
    -    ;
    -  }
    -
    - -

    There are some procs of the Object class pre-defined, -which let us specify an exit handler conveniently: -

    -
    -   Object setExitHandler body
    -   Object getExitHandler
    -   Object unsetExitHandler
    -

    -setExitHandler lets us specify -a proc body that actually contains the user-defined exit handling: -

    -   Object setExitHandler {
    -     aObj destroy
    -     puts "exiting"
    -   }
    -

    -destroys the object aObj before -all other objects and prints the message existing to the screen. With -getExitHandler the exit -handler can be introspected. E.g. if we just want to append the -destruction of object bObj to -an existing exit handler, we use getExitHandler: -

    -
    -   Object setExitHandler "[Object getExitHandler]; bObj destroy"
    -
    -

    -unsetExitHandler deletes the exit handler. -

    -
    -
    -

    Automatic Name Creation -

    -The XOTcl autoname -instance method provides an simple way to take the task of -automatically creating names out of the responsibility of the -programmer. The example below shows how to create on each invocation -of method new an agent with a fresh name -(prefixed with agent): -

    -
    -  Agent proc new args {
    -    eval my [my autoname agent] $args
    -  }
    -
    -

    -Autonames may have format strings as in the Tcl 'format' command. -E.g.: -

    -
    -  objName autoname a%06d
    -
    -

    -produces -

    -  a000000, a000001, a000002, ...
    -
    -

    - - - - - - - - -
    -

    Integrating XOTcl Programs with C Extensions (such as TK) - -

    -
    -
    - -

    Because all XOTcl commands are in the ::xotcl namespace, it is -usually no problem to integrate XOTcl with other Tcl extensions. Most -often it works to import the XOTcl commands (like Object, Class) into -the current namespace because there are no name-clashes with the -commands defined by other extensions.

    - -

    Consider you want to perform a deeper integration of an other -extension and XOTcl because you want to benefit from XOTcl's object -system. For instance, you might want to introduce composite TK widgets -(sometimes called mega-widgets) as classes and inherit from these -classes. Here, you have two options: you can change or extend the C -code of that other extension to provide XOTcl classes or objects, or -you can write an XOTcl wrapper in Tcl. For the first alternative, -there are some examples provided in the XOTcl distribution. XOTclGdbm -provides an OO Tcl interface to the GDBM database, for -instance. XOTclSdbm does the same for SDBM, and the TclExpat wrapper -provides a class-based interface to the TclExpat XML parser.

    - -

    Consider you do not want to change the C code of a Tcl -extension. Then you can write an OO wrapper in XOTcl for the commands -of the other extension. For stateless commands, you can simply write -forwarder methods. If the extension maintains some state, you -typically associate the state handle with an XOTcl parameter, acquire -the state in the XOTcl constructor, and align the XOTcl destructor -with the stateful instance.

    - -

    Consider you want to wrap the Tk button widget. You can acquire the -widget in the constructor, and maintain the widget ID in a -parameter. You now can forward invocations to this widget ID -(e.g. when using "pack"), or register command callbacks (like -buttonPressed). Note that we let the "self" command be replaced in the -scope of the current method so that TK receives the correct object ID -for the callback. In the destructor we destroy the widget as well (we -use "catch" because sometimes widgets can destroyed by other means as -well (e.g. by their parent widget, when a widget/object hierarchy is -destroyed at once).

    - -
    -  Class MyButton -parameter {button}
    -  MyButton instproc buttonPressed args {
    -    puts "pressed [my button]"
    -  }
    -  MyButton instproc init args {
    -    set ID [namespace tail [self]]
    -    my instvar button
    -    set button [button .$ID \
    -      -text "My Button $ID" \
    -      -command [list [self] buttonPressed]] 
    -    pack $button
    -    next
    -  }
    -  MyButton instproc destroy args {
    -     catch {destroy [my button]}
    -     next
    -  }
    -
    -  # a test -> 3 buttons, destroy one of them
    -  foreach b {a b c} {
    -    MyButton $b
    -  }
    -  b destroy
    -
    - -

    The "trick" to substitute "self" within the current method scope -works for all kinds of command callbacks. Extensions such as TK, -however, often work with bindings to (global) variables as well. Using -global variables is frowned upon in the OO community. Instead you -should use instance variables of objects. As Tcl can only bind to -existing namespace variables (and XOTcl acquires the namespace of an -object on demand), you have to make sure that the namespace of an -object exists before binding a variable. That can be done with -"requireNamespace":

    -
    -  GUIClass instproc buildEntry win {
    -    my requireNamespace
    -    entry $win -textvariable [self]::entryValue
    -    my set entryValue {Init Value}
    -  }
    -
    - -

    Note that in the above example we have used to tail of the object ID -as ID for the widget. Usually, it is a good idea to the object name, -if possible, for TK (and other extensions) IDs as well. Another option -is to use a autoname to get a unique name for the ID.

    - -

    Sometimes you want to simply send all invocations, not implemented by -XOTcl, to the wrapped command. Here, it is tedious to write a wrapper -for each of these methods. Instead you can use "unknown" to handle -automatic forwarding. Consider you want to wrap TK commands like pack -and replace XOTcl object names with their TK widget ID, so that you can -use both IDs synonymously. You can rename the respective TK commands in -the following way: - -

    -  foreach tkCommand {bell bind bindtags clipboard event 
    -    focus font grid image lower option pack place raise 
    -    selection send tk tkwait winfo wm} { 
    -    rename ::$tkCommand __tk_$tkCommand
    -    TkCommand ::$tkCommand
    -    ::$tkCommand set wrapped __tk_$tkCommand
    -  }
    -
    - -

    The XOTcl class handling the ID substitution for the TK command -might look as follows:

    - -
    -  Class TkCommand -parameter wrapped
    -  TkCommand instproc unknown args {
    -      my instvar wrapped
    -      set args [Widget replaceWithWidgetIDs $args]
    -      # now call the command
    -      eval $wrapped $args
    -  }
    -
    - -

    - - - - - - - - -
    -

    References - -

    -
    -
    - -

    [Neumann and Zdun 1999a] -G. Neumann and U. Zdun. -Filters as a language support for design patterns in object-oriented - scripting languages. -In Proceedings of COOTS'99, 5th Conference on Object-Oriented - Technologies and Systems, San Diego, May 1999. - -

    [Neumann and Zdun 1999b] -G. Neumann and U. Zdun. -Implementing object-specific design patterns using per-object mixins. -In Proc. of NOSA`99, Second Nordic Workshop on Software - Architecture, Ronneby, Sweden, August 1999. - -

    [Neumann and Zdun 1999c] -G. Neumann and U. Zdun. -Enhancing object-based system composition through per-object mixins. -In Proceedings of Asia-Pacific Software Engineering Conference - (APSEC), Takamatsu, Japan, December 1999. - -

    [Neumann and Zdun 2000a] -G. Neumann and U. Zdun. - XOTCL, an object-oriented scripting language. -In Proceedings of Tcl2k: The 7th USENIX Tcl/Tk Conference, - Austin, Texas, February 2000. - -

    [Neumann and Zdun 2000b] -G. Neumann and U. Zdun. Towards the Usage of Dynamic Object - Aggregations as a Form of Composition -In: Proceedings of Symposium of Applied Computing (SAC'00), Como, Italy, Mar 19-21, 2000. - - -

    [Ousterhout 1990] -J. K. Ousterhout. -Tcl: An embeddable command language. -In Proc. of the 1990 Winter USENIX Conference, January 1990. - -

    [Ousterhout 1998] -J. K. Ousterhout. -Scripting: Higher Level Programming for the 21st Century, IEEE Computer 31(3), March 1998. - -

    [Wetherall and Lindblad 1995] -D. Wetherall and C. J. Lindblad. Extending Tcl for Dynamic - Object-Oriented Programming. Proc. of the Tcl/Tk Workshop '95, July 1995. - - - - - - - - Index: xotcl/doc/tutorial.pdf =================================================================== diff -u -N -re44f69435e8db4aa6ed2ffffe8caaa6586c2fc5f -rc72f9f638677608fab1502cd696c8f2d6b2952f9 Binary files differ Index: xotcl/doc/upvarcompat-xotcl.html =================================================================== diff -u -N --- xotcl/doc/upvarcompat-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/upvarcompat-xotcl.html (revision 0) @@ -1,56 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/upvarcompat.xotcl - - - -

    - ./library/lib/upvarcompat.xotcl - ./library/lib/upvarcompat.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::upvar-compat 1.0 -
    -
    - Filename: - - ./library/lib/upvarcompat.xotcl - -
    -
    - - - - - -
    - Description: - - - Provide a version of upvar and uplevel that provide - backward compatibility such that these commands - ignore inactive filter and mixin frames (upvar behaves - the same whether or not a filter is installed). Newer - scripts should use upvar/uplevel [self callinglevel] var/command - instead. - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/webclient-xotcl.html =================================================================== diff -u -N --- xotcl/doc/webclient-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/webclient-xotcl.html (revision 0) @@ -1,51 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/comm/webclient.xotcl - - - -

    - ./apps/comm/webclient.xotcl - ./apps/comm/webclient.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    - Package required: xotcl::comm::httpAccess -
    -
    - Filename: - - ./apps/comm/webclient.xotcl - -
    -
    - - - - - -
    - Description: - - For a sample webclient, see packages/comm/xocomm.test -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/webserver-xotcl.html =================================================================== diff -u -N --- xotcl/doc/webserver-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/webserver-xotcl.html (revision 0) @@ -1,181 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/comm/webserver.xotcl - - - -

    - ./apps/comm/webserver.xotcl - ./apps/comm/webserver.xotcl

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    - Package required: xotcl::comm::httpd -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./apps/comm/webserver.xotcl - -
    -
    - - - - - -
    - Description: - - - This small demo program starts two different webservers: -
      -
    • Firstly, it provides a sample web server that povides the documents in - ../../src/doc (or the files specified with -root) at port 8086 - (or at the port specified via the -port option) as unprotected resources. -

      -

    • Secondly, it starts a second webserver with basic access control - (it accepts test/test as user/password) on port 9096 (or on the - port specified via -protected-port). If it receives an request - for an resource named "exit", it terminates. For all other requests - it returns actual information about the user and the issued request. -
    - To see, how it works, contact it e.g. from netscape. - -
    -
    -
    -

    - - - -

    Class: SpecializedWorker

    - Class: Class -
    - Procs/Instprocs: - respond. - - - - - -
    - Description: - - - Specialized worker that can be passed to any webserver - -
    -

    Instprocs

    -
      -
    • - - - - respond - - - - - - -
      - Description: - - - This method handles all responses from the webserver to the client. - We implent here "exit", and we return the information about the actual - request and user in HTML format for all other requests. -

      This method is an example, how to access on the server side - request specific infomation. - -

      -
    • -
    -

    -
    -

    - - - -

    Object: h1

    - Class: Httpd -
    - - - - - - - -
    - Description: - - unprotected web server -
    -

    -
    -

    - - - -

    Object: h2

    - Class: Httpd -
    - - - - - - - -
    - Description: - - Web server with basic authentication using the specialied worker -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/xo-daemon.html =================================================================== diff -u -N --- xotcl/doc/xo-daemon.html (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/doc/xo-daemon.html (revision 0) @@ -1,98 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/utils/xo-daemon - - - - -

    - ./apps/utils/xo-daemon - ./apps/utils/xo-daemon

    -
    -

    -

    Package/File Information

    - No package provided/required -
    -
    - Filename: - - ./apps/utils/xo-daemon - -
    -
    - - - - - - - - - - - - - -
    - Description: - - - This script can be used to start/stop/restart xotcl daemons - and maintains the process IDs, log files and means for easy - restart. -

    - It receives as first parameter the name of the xotcl script - to be executed followed by the desired action and optional - parameters. The specified action can be -

      -
    • start: the specified script is started in - the background, an entry to restart is generated in - the run-directory as well as the process id of the started - script. In addition a logfile is created in the log directory. - If the start of the script fails, the error messages are - shown. -
    • startall: all scripts that were started before - via this script, are started -
    • stop terminates te specified script. -
    • stopall terminates all scripts started via this - command -
    • restart tries to restart the specified script. -
    - The optional parameters are: -
      -
    • -logir specifies the directory for logging. - The default is ~/.xotcl/log. -
    • -rundir specifies the directory where - the information about the running processes is kept. - The default is ~/.xotcl/run. -
    - -
    - Authors: - - - Gustaf Neumann, Gustaf.Neumann@wu-wien.ac.at - -
    - Date: - - [::xotcl::rcs date {$Date: 2007/10/12 19:53:32 $}] -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/xo-whichPkg.html =================================================================== diff -u -N --- xotcl/doc/xo-whichPkg.html (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/doc/xo-whichPkg.html (revision 0) @@ -1,72 +0,0 @@ - - - - - XOTcl - Documentation -- ./apps/utils/xo-whichPkg - - - - -

    - ./apps/utils/xo-whichPkg - ./apps/utils/xo-whichPkg

    -
    -

    -

    Package/File Information

    - No package provided/required -
    -
    - Filename: - - ./apps/utils/xo-whichPkg - -
    -
    - - - - - - - - - - - - - -
    - Description: - - - A small sample script to show which package is loaded from where - when a target package is loaded.

    - Usage: "xo-whichPkg -pkg PACKAGENAME" - -

    - Authors: - - - Fredj Dridi dridi@nestroy.wi-inf.uni-essen.de - -
    - Date: - - [::xotcl::rcs date {$Date: 2007/10/12 19:53:32 $}] -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/xocomm-test.html =================================================================== diff -u -N --- xotcl/doc/xocomm-test.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/xocomm-test.html (revision 0) @@ -1,63 +0,0 @@ - - - - - XOTcl - Documentation -- ../library/comm/xocomm.test - - - -

    - ../library/comm/xocomm.test - ../library/comm/xocomm.test

    -
    -

    -

    Package/File Information

    - Package required: XOTcl -
    - Package required: xotcl::comm::httpAccess -
    - Package required: xotcl::comm::ftp -
    - Package required: xotcl::trace -
    -
    - Filename: - - ../library/comm/xocomm.test - -
    -
    - - - - - -
    - Description: - - - This is a webclient used as a regression test. - When it is started it launches an xotcl-Web server as partner process. - It tests currently the basic functionality of: -
      -
    • GET and PUT requests -
    • Basic Access Control -
    - -
    -
    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/xodoc-xotcl.html =================================================================== diff -u -N --- xotcl/doc/xodoc-xotcl.html (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/doc/xodoc-xotcl.html (revision 0) @@ -1,358 +0,0 @@ - - - - - XOTcl - Documentation -- ./library/lib/xodoc.xotcl - - - -

    - ./library/lib/xodoc.xotcl - ./library/lib/xodoc.xotcl

    -
    -

    -

    Package/File Information

    - Package provided: xotcl::xodoc 0.84 -
    - Package required: xotcl::staticMetadataAnalyzer -
    - Package required: xotcl::htmllib -
    -
    - Defined Objects/Classes: - -
    - Filename: - - ./library/lib/xodoc.xotcl - -
    -
    - - - - - -
    - Description: - - - XOTcl documentation tool. Overloads the command @, which is used - as a documentation token. - -
    -
    -
    -

    - - - -

    Class: ConstraintTokenHTML

    - Class: Class -
    - Heritage: MetadataTokenHTML -
    - - - -
    -

    -
    -

    - - - -

    Class: FileTokenHTML

    - Class: Class -
    - Heritage: MetadataTokenHTML -
    - - - -
    -

    -
    -

    - - - -

    Class: MetadataTokenHTML

    - Class: Class -
    - Procs/Instprocs: - getDocPropertiesHTML, printHTML. - - - - - -
    - Description: - - Instmixin to provide HTML printing. Such instmixins - are registered for all token types. - -
    -

    Instprocs

    -
      -
    • - - - - abstract - printHTML - - - - - - -
      - Description: - - Print token to HTML document object -
      -
    • -
    • - - - - getDocPropertiesHTML - - - - - - -
      - Description: - - - Returns list of properties as HTML. - -
      -
    • -
    -

    -
    -

    - - - -

    Class: MethodTokenHTML

    - Class: Class -
    - Heritage: MetadataTokenHTML -
    - - - -
    -

    -
    -

    - - - -

    Class: ObjTokenHTML

    - Class: Class -
    - Heritage: MetadataTokenHTML -
    - - - -
    -

    -
    -

    - - - -

    Class: XODoc

    - Class: Class -
    - Procs/Instprocs: - documentFileAsHTML, printHTML, writeFile. - - - - - -
    - Description: - - Handler class for building a documentation database -
    -

    Instprocs

    -
      -
    • - - - - printHTML - name - - - - - - - - - - -
      - Arguments: - - name: name of the html document -
      - Description: - - Create HTML documentation object from metadata token -
      -
    • -
    • - - - - writeFile - filename - name - - - - - - - - - - - - - - -
      - Arguments: - - filename: file name destination -
      - - - name: name of the html document -
      - Description: - - Create HTML docuemntation from metadata token and write to file -
      -
    • -
    -

    Procs

    -
      -
    • - - - - documentFileAsHTML - file - docdir - - - - - - - - - - - - - - - - - - -
      - Arguments: - - file: filename of the xotcl file to be documented -
      - - - docdir: directory to which the html file is written -
      - Description: - - Uses the xoDoc package to produce an HTML documentation of - a specified file ***.xotcl. The file is written to ***.html - in docdir -
      - Return: - - file basename without suffix -
      -
    • -
    -

    -
    -

    -
    -

    -

    - - Back to index page. - -
    -
    -

    -

    - - - Index: xotcl/doc/xotcl-doc.css =================================================================== diff -u -N --- xotcl/doc/xotcl-doc.css (revision 2c98844f5e9a46a8ecb2c8aa8d714592a07b311d) +++ xotcl/doc/xotcl-doc.css (revision 0) @@ -1,48 +0,0 @@ -BODY { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-weight: normal; - background-color : white; - color: black; -} -tt { - font-family: courier, monospace; -} -A { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-weight: 100; - background-color : white; -} -A em { - font-weight: 900; -} - -pre.code { - font-size: 90%; - font-family: courier, monospace; - PADDING-RIGHT: 10px; - PADDING-LEFT: 10px; - PADDING-BOTTOM: 10px; - PADDING-TOP: 10px; - BORDER: #cccccc 1px solid; - BACKGROUND-COLOR: #eeeeee; - MARGIN-BOTTOM: 15px; -} -pre em { - font-family: cursive; - color: #888888; -} -pre tt { - font-family: helvetica; - font-weight: 900; -} -pre it { - font-style: italic; - color: green; -} -tt em { - font-family: cursive; - color: #888888; -} -table { - font-size: 80%; -} Index: xotcl/generic/aol-xotcl.tcl =================================================================== diff -u -N --- xotcl/generic/aol-xotcl.tcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/generic/aol-xotcl.tcl (revision 0) @@ -1,81 +0,0 @@ -# $Id: aol-xotcl.tcl,v 1.15 2007/08/14 16:38:26 neumann Exp $ - -# -# Load XOTcl library and some related packages. -# We expect to find them somewhere in standard -# Tcl package search path (the auto_path var) -# The simplest location is to put them under -# the "lib" directory within the AOLserver tree. -# - -package require XOTcl; namespace import ::xotcl::* -package require xotcl::serializer -ns_log notice "XOTcl version $::xotcl::version$::xotcl::patchlevel loaded" - -# -# Overload procedure defined in bin/init.tcl. -# It is now XOTcl-savvy in how it treats some -# special namespaces. -# - -proc _ns_savenamespaces {} { - set script [_ns_getpackages] - set import "" - set nslist "" - _ns_getnamespaces namespaces - foreach n $namespaces { - if {[string match "::xotcl*" $n] == 0 - && ([catch {::xotcl::Object isobject $n} ret] || $ret == 0)} { - lappend nslist $n - } - } - foreach n $nslist { - foreach {ns_script ns_import} [_ns_getscript $n] { - append script [list namespace eval $n $ns_script] \n - if {$ns_import ne ""} { - append import [list namespace eval $n $ns_import] \n - } - } - } - if {[catch {::Serializer all} objects]} { - ns_log notice "XOTcl extension not loaded; will not copy objects\ - (error: $objects; $::errorInfo)." - set objects "" - } - ns_ictl save [append script \n \ - "namespace import -force ::xotcl::*" \n \ - $objects \n $import] - # just for debugging purposes - if {0} { - set f [open [::xotcl::tmpdir]/__aolserver-blueprint.tcl w] - puts $f $script - close $f - } -} - -# -# Source XOTcl files from shared/private library -# the way AOLserver does for plain Tcl files. -# - -proc _my_sourcefiles {shared private} { - set files "" - foreach file [lsort [glob -nocomplain -directory $shared *.xotcl]] { - if {[file exists [file join $private [file tail $file]]] == 0} { - lappend files $file - } - } - foreach file [lsort [glob -nocomplain -directory $private *.xotcl]] { - lappend files $file - } - foreach file $files { - _ns_sourcefile $file - } -} - -ns_eval { - _my_sourcefiles [ns_library shared] [ns_library private] -} - -# EOF $RCSfile: aol-xotcl.tcl,v $ - Index: xotcl/generic/aolstub.c =================================================================== diff -u -N --- xotcl/generic/aolstub.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/generic/aolstub.c (revision 0) @@ -1,175 +0,0 @@ -/* $Id: aolstub.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ - - This file provides the stubs needed for the AOL_SERVER, - Please note, that you have to have to apply a small patch - to the AOL server as well (available from www.xotcl.org) - in order to get it working. - - Authore: - Zoran Vasiljevic - Archiware Inc. - -*/ -#ifdef AOL_SERVER - - -#include "xotcl.h" -#include - -int Ns_ModuleVersion = 1; - -#if NS_MAJOR_VERSION>=4 -# define AOL4 -#endif - -/* - *---------------------------------------------------------------------------- - * - * NsXotcl_Init -- - * - * Loads the package for the first time, i.e. in the startup thread. - * - * Results: - * Standard Tcl result - * - * Side effects: - * Package initialized. Tcl commands created. - * - *---------------------------------------------------------------------------- - */ - - -static int -NsXotcl_Init (Tcl_Interp *interp, void *context) -{ - static int firsttime = 1; - int ret; - - ret = Xotcl_Init(interp); - - if (firsttime) { - if (ret != TCL_OK) { - Ns_Log(Warning, "can't load module %s: %s", (char *)context, - Tcl_GetStringResult(interp)); - } else { - Ns_Log(Notice, "%s module version %s%s", (char*)context, - XOTCLVERSION,XOTCLPATCHLEVEL); - /* - * Import the XOTcl namespace only for the shell after - * predefined is through - */ - Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), - "xotcl::*", 0); - } - firsttime = 0; - } - - return ret; -} - -/* - *---------------------------------------------------------------------------- - * - * NsXotcl_Init1 -- - * - * Loads the package in each thread-interpreter. - * This is needed since XOTcl Class/Object commands are not copied - * from the startup thread to the connection (or any other) thread. - * during AOLserver initialization and/or thread creation times. - * - * Why ? - * - * Simply because these two commands declare a delete callback which is - * unsafe to call in any other thread but in the one which created them. - * - * To understand this, you may need to get yourself acquainted with the - * mechanics of the AOLserver, more precisely, with the way Tcl interps - * are initialized (dive into nsd/tclinit.c in AOLserver distro). - * - * So, we made sure (by patching the AOLserver code) that no commands with - * delete callbacks declared, are ever copied from the startup thread. - * Additionaly, we also made sure that AOLserver properly invokes any - * AtCreate callbacks. So, instead of activating those callbacks *after* - * running the Tcl-initialization script (which is the standard behaviour) - * we activate them *before*. So we may get a chance to configure the - * interpreter correctly for any commands within the init script. - * - * Proper XOTcl usage would be to declare all resources (classes, objects) - * at server initialization time and let AOLserver machinery to copy them - * (or re-create them, better yet) in each new thread. - * Resources created within a thread are automatically garbage-collected - * on thread-exit time, so don't create any XOTcl resources there. - * Create them in the startup thread and they will automatically be copied - * for you. - * Look in /modules/tcl/xotcl for a simple example. - * - * Results: - * Standard Tcl result. - * - * Side effects: - * Tcl commands created. - * - *---------------------------------------------------------------------------- - */ - -static int -NsXotcl_Init1 (Tcl_Interp *interp, void *notUsed) -{ - int result; - -#ifndef AOL4 - result = Xotcl_Init(interp); -#else - result = TCL_OK; -#endif - - /* - * Import the XOTcl namespace only for the shell after - * predefined is through - */ - Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), "xotcl::*", 1); - - return result; -} - -/* - *---------------------------------------------------------------------------- - * - * Ns_ModuleInit -- - * - * Called by the AOLserver when loading shared object file. - * - * Results: - * Standard AOLserver result - * - * Side effects: - * Many. Depends on the package. - * - *---------------------------------------------------------------------------- - */ - -int -Ns_ModuleInit(char *hServer, char *hModule) -{ - int ret; - - /*Ns_Log(Notice, "+++ ModuleInit","INIT");*/ - ret = Ns_TclInitInterps(hServer, NsXotcl_Init, (void*)hModule); - - if (ret == TCL_OK) { - /* - * See discussion for NsXotcl_Init1 procedure. - * Note that you need to patch AOLserver for this to work! - * The patch basically forbids copying of C-level commands with - * declared delete callbacks. It also runs all AtCreate callbacks - * BEFORE AOLserver runs the Tcl script for initializing new interps. - * These callbacks are then responsible for setting up the stage - * for correct (XOTcl) extension startup (including copying any - * XOTcl resources (classes, objects) created in the startup thread. - */ - Ns_TclRegisterAtCreate((Ns_TclInterpInitProc *)NsXotcl_Init1, NULL); - } - - return ret == TCL_OK ? NS_OK : NS_ERROR; -} -#endif Index: xotcl/generic/mk_predefined.xotcl =================================================================== diff -u -N --- xotcl/generic/mk_predefined.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/generic/mk_predefined.xotcl (revision 0) @@ -1,25 +0,0 @@ -#!./xotclsh -# $Id: mk_predefined.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ -# A small script file that creates a static array from a tcl- -# script for inclusion in c programs -gn -set f [open predefined.xotcl] -set content [read $f] -close $f - -regsub -all {\\} $content && content -regsub -all {"} $content {\"} content ;#" -regsub -all "\[ \]+\n" $content \n content ;# remove trailing space -regsub -all "\n\[ \t\]+" $content \n content ;# remove leading space -regsub -all "\n#\[^\n\]*\n" $content \n content ;# remove comment lines -regsub -all "\n#\[^\n\]*\n" $content \n content ;# remove comment lines -regsub -all "\n#\[^\n\]*\n" $content \n content ;# remove comment lines -regsub -all "\n#\[^\n\]*\n" $content \n content ;# remove comment lines -regsub -all "\[\n\]+" $content \n content ;# remove empty lines -regsub -all "\n}" $content "}" content ;# newlines btwn braces -regsub -all "\n" $content "\\n\"\n\"" content - -puts "static char cmd\[\] = " -puts "\"$content\";" -puts "" - - Index: xotcl/generic/predefined.h =================================================================== diff -u -N --- xotcl/generic/predefined.h (revision 57972e5a2972b1eb5dd63f6e3d483670117feebf) +++ xotcl/generic/predefined.h (revision 0) @@ -1,540 +0,0 @@ -static char cmd[] = -"# $Id: predefined.h,v 1.17 2007/09/05 19:09:22 neumann Exp $\n" -"foreach cmd [info command ::xotcl::Object::instcmd::*] {\n" -"::xotcl::alias ::xotcl::Object [namespace tail $cmd] $cmd}\n" -"foreach cmd {array append eval incr lappend trace subst unset} {\n" -"::xotcl::alias ::xotcl::Object $cmd -objscope ::$cmd}\n" -"foreach cmd [info command ::xotcl::Class::instcmd::*] {\n" -"::xotcl::alias ::xotcl::Class [namespace tail $cmd] $cmd}\n" -"unset cmd\n" -"::xotcl::Object instproc init args {}\n" -"::xotcl::Object create ::xotcl::@\n" -"::xotcl::@ proc unknown args {}\n" -"proc ::xotcl::myproc {args} {linsert $args 0 [::xotcl::self]}\n" -"proc ::xotcl::myvar {var} {::xotcl::my requireNamespace; return [::xotcl::self]::$var}\n" -"namespace eval ::xotcl { namespace export @ myproc myvar Attribute}\n" -"::xotcl::setrelation ::xotcl::Class::Parameter superclass ::xotcl::Class\n" -"::xotcl::Class::Parameter instproc mkParameter {obj name args} {\n" -"if {[$obj exists $name]} {\n" -"eval [$obj set $name] configure $args} else {\n" -"$obj set $name [eval ::xotcl::my new -childof $obj $args]}}\n" -"::xotcl::Class::Parameter instproc getParameter {obj name args} {\n" -"[$obj set $name]}\n" -"::xotcl::Class::Parameter proc Class {param args} {\n" -"::xotcl::my set access [lindex $param 0]\n" -"::xotcl::my set setter mkParameter\n" -"::xotcl::my set getter getParameter\n" -"::xotcl::my set extra {[::xotcl::self]}\n" -"::xotcl::my set defaultParam [lrange $param 1 end]}\n" -"::xotcl::Class::Parameter proc default {val} {\n" -"[::xotcl::my set cl] set __defaults([::xotcl::my set name]) $val}\n" -"::xotcl::Class::Parameter proc setter x {\n" -"::xotcl::my set setter $x}\n" -"::xotcl::Class::Parameter proc getter x {\n" -"::xotcl::my set getter $x}\n" -"::xotcl::Class::Parameter proc access obj {\n" -"::xotcl::my set access $obj\n" -"::xotcl::my set extra \\[::xotcl::self\\]\n" -"foreach v [$obj info vars] {::xotcl::my set $v [$obj set $v]}}\n" -"::xotcl::Class::Parameter proc values {param args} {\n" -"set cl [::xotcl::my set cl]\n" -"set ci [$cl info instinvar]\n" -"set valueTest {}\n" -"foreach a $args {\n" -"::lappend valueTest \"\\[\\$cl set $param\\] == [list $a]\"}\n" -"::lappend ci [join $valueTest \" || \"]\n" -"$cl instinvar $ci}\n" -"::xotcl::Class create ::xotcl::MetaSlot\n" -"::xotcl::setrelation ::xotcl::MetaSlot superclass ::xotcl::Class\n" -"::xotcl::MetaSlot instproc new args {\n" -"set slotobject [self callingobject]::slot\n" -"if {![my isobject $slotobject]} {Object create $slotobject}\n" -"eval next -childof $slotobject $args}\n" -"::xotcl::MetaSlot create ::xotcl::Slot -array set __defaults {\n" -"name \"[namespace tail [::xotcl::self]]\"\n" -"domain \"[lindex [regexp -inline {^(.*)::slot::[^:]+$} [::xotcl::self]] 1]\"\n" -"defaultmethods {get assign}\n" -"manager \"[::xotcl::self]\"\n" -"multivalued false\n" -"per-object false}\n" -"foreach p {name domain defaultmethods manager default multivalued type\n" -"per-object initcmd valuecmd valuechangedcmd} {\n" -"::xotcl::Slot instparametercmd $p}\n" -"unset p\n" -"::xotcl::alias ::xotcl::Slot get ::xotcl::setinstvar\n" -"::xotcl::alias ::xotcl::Slot assign ::xotcl::setinstvar\n" -"::xotcl::Slot instproc add {obj prop value {pos 0}} {\n" -"if {![my multivalued]} {\n" -"error \"Property $prop of [my domain]->$obj ist not multivalued\"}\n" -"if {[$obj exists $prop]} {\n" -"$obj set $prop [linsert [$obj set $prop] $pos $value]} else {\n" -"$obj set $prop [list $value]}}\n" -"::xotcl::Slot instproc delete {-nocomplain:switch obj prop value} {\n" -"set old [$obj set $prop]\n" -"set p [lsearch -glob $old $value]\n" -"if {$p>-1} {$obj set $prop [lreplace $old $p $p]} else {\n" -"error \"$value is not a $prop of $obj (valid are: $old)\"}}\n" -"::xotcl::Slot instproc unknown {method args} {\n" -"set methods [list]\n" -"foreach m [my info methods] {\n" -"if {[::xotcl::Object info methods $m] ne \"\"} continue\n" -"if {[string match __* $m]} continue\n" -"lappend methods $m}\n" -"error \"Method '$method' unknown for slot [self]; valid are: {[lsort $methods]]}\"}\n" -"::xotcl::Slot instproc init {} {\n" -"my instvar name domain manager\n" -"set forwarder [expr {[my per-object] ? \"forward\" : \"instforward\"}]\n" -"if {$domain eq \"\"} {\n" -"set domain [self callingobject]}\n" -"$domain $forwarder $name -default [$manager defaultmethods] $manager %1 %self %proc}\n" -"::xotcl::MetaSlot create ::xotcl::InfoSlot -array set __defaults {\n" -"multivalued true}\n" -"::xotcl::setrelation ::xotcl::InfoSlot superclass ::xotcl::Slot\n" -"::xotcl::InfoSlot instproc get {obj prop} {$obj info $prop}\n" -"::xotcl::InfoSlot instproc add {obj prop value {pos 0}} {\n" -"if {![my multivalued]} {\n" -"error \"Property $prop of [my domain]->$obj ist not multivalued\"}\n" -"$obj $prop [linsert [$obj info $prop] $pos $value]}\n" -"::xotcl::InfoSlot instproc delete {-nocomplain:switch obj prop value} {\n" -"set old [$obj info $prop]\n" -"set p [lsearch -glob $old $value]\n" -"if {$p>-1} {$obj $prop [lreplace $old $p $p]} else {\n" -"error \"$value is not a $prop of $obj (valid are: $old)\"}}\n" -"::xotcl::MetaSlot create ::xotcl::InterceptorSlot\n" -"::xotcl::setrelation ::xotcl::InterceptorSlot superclass ::xotcl::InfoSlot\n" -"::xotcl::alias ::xotcl::InterceptorSlot set ::xotcl::setrelation ;# for backwards compatibility\n" -"::xotcl::alias ::xotcl::InterceptorSlot assign ::xotcl::setrelation\n" -"::xotcl::InterceptorSlot instproc add {obj prop value {pos 0}} {\n" -"if {![my multivalued]} {\n" -"error \"Property $prop of [my domain]->$obj ist not multivalued\"}\n" -"$obj $prop [linsert [$obj info $prop -guards] $pos $value]}\n" -"namespace eval ::xotcl::Class::slot {}\n" -"namespace eval ::xotcl::Object::slot {}\n" -"::xotcl::InfoSlot create ::xotcl::Class::slot::superclass\n" -"::xotcl::alias ::xotcl::Class::slot::superclass assign ::xotcl::setrelation\n" -"::xotcl::InfoSlot create ::xotcl::Object::slot::class\n" -"::xotcl::alias ::xotcl::Object::slot::class assign ::xotcl::setrelation\n" -"::xotcl::InterceptorSlot create ::xotcl::Object::slot::mixin\n" -"::xotcl::InterceptorSlot create ::xotcl::Object::slot::filter\n" -"::xotcl::InterceptorSlot create ::xotcl::Class::slot::instmixin\n" -"::xotcl::InterceptorSlot create ::xotcl::Class::slot::instfilter\n" -"::xotcl::MetaSlot create ::xotcl::Attribute -superclass ::xotcl::Slot\n" -"foreach p {default value_check initcmd valuecmd valuechangedcmd} {\n" -"::xotcl::Attribute instparametercmd $p}\n" -"unset p\n" -"::xotcl::Attribute array set __defaults {\n" -"value_check once}\n" -"::xotcl::Attribute instproc __default_from_cmd {obj cmd var sub op} {\n" -"$obj trace remove variable $var $op [list [self] [self proc] $obj $cmd]\n" -"$obj set $var [$obj eval $cmd]}\n" -"::xotcl::Attribute instproc __value_from_cmd {obj cmd var sub op} {\n" -"$obj set $var [$obj eval $cmd]}\n" -"::xotcl::Attribute instproc __value_changed_cmd {obj cmd var sub op} {\n" -"eval $cmd}\n" -"::xotcl::Attribute instproc destroy {} {\n" -"next}\n" -"::xotcl::Attribute instproc check_single_value {\n" -"{-keep_old_value:boolean true}\n" -"value predicate type obj var} {\n" -"if {![expr $predicate]} {\n" -"if {[$obj exists __oldvalue($var)]} {\n" -"$obj set $var [$obj set __oldvalue($var)]} else {\n" -"$obj unset -nocomplain $var}\n" -"error \"$value is not of type $type\"}\n" -"if {$keep_old_value} {$obj set __oldvalue($var) $value}}\n" -"::xotcl::Attribute instproc check_multiple_values {values predicate type obj var} {\n" -"foreach value $values {\n" -"my check_single_value -keep_old_value false $value $predicate $type $obj $var}\n" -"$obj set __oldvalue($var) $value}\n" -"::xotcl::Attribute instproc mk_type_checker {} {\n" -"set __initcmd \"\"\n" -"if {[my exists type]} {\n" -"my instvar type name\n" -"if {[::xotcl::Object isclass $type]} {\n" -"set predicate [subst -nocommands {[::xotcl::Object isobject \\$value]\n" -"&& [\\$value istype $type]}]} elseif {[llength $type]>1} {\n" -"set predicate \"\\[$type \\$value\\]\"} else {\n" -"set predicate \"\\[string is $type \\$value\\]\"}\n" -"my append valuechangedcmd [subst {\n" -"my [expr {[my multivalued] ? \"check_multiple_values\" : \"check_single_value\"}] \\[\\$obj set $name\\] \\\n" -"{$predicate} [list $type] \\$obj $name}]\n" -"append __initcmd [subst -nocommands {\n" -"if {[my exists $name]} {my set __oldvalue($name) [my set $name]}\\n}]}\n" -"return $__initcmd}\n" -"::xotcl::Attribute instproc init {} {\n" -"my instvar domain name\n" -"next ;# do first ordinary slot initialization\n" -"$domain unset -nocomplain __defaults($name)\n" -"set __initcmd \"\"\n" -"if {[my exists default]} {\n" -"$domain set __defaults($name) [my default]} elseif [my exists initcmd] {\n" -"append __initcmd \"my trace add variable [list $name] read \\\n" -"\\[list [self] __default_from_cmd \\[self\\] [list [my initcmd]]\\]\\n\"} elseif [my exists valuecmd] {\n" -"append __initcmd \"my trace add variable [list $name] read \\\n" -"\\[list [self] __value_from_cmd \\[self\\] [list [my valuecmd]]\\]\"}\n" -"append __initcmd [my mk_type_checker]\n" -"if {[my exists valuechangedcmd]} {\n" -"append __initcmd \"my trace add variable [list $name] write \\\n" -"\\[list [self] __value_changed_cmd \\[self\\] [list [my valuechangedcmd]]\\]\"}\n" -"if {$__initcmd ne \"\"} {\n" -"$domain set __initcmds($name) $__initcmd}}\n" -"::xotcl::Class create ::xotcl::Slot::Nocheck \\\n" -"-instproc check_single_value args {;} -instproc check_multiple_values args {;} \\\n" -"-instproc mk_type_checker args {return \"\"}\n" -"::xotcl::Class create ::xotcl::Slot::Optimizer \\\n" -"-instproc proc args {::xotcl::next; ::xotcl::my optimize} \\\n" -"-instproc forward args {::xotcl::next; ::xotcl::my optimize} \\\n" -"-instproc init args {::xotcl::next; ::xotcl::my optimize} \\\n" -"-instproc optimize {} {\n" -"if {[::xotcl::my multivalued]} return\n" -"if {[::xotcl::my defaultmethods] ne {get assign}} return\n" -"if {[::xotcl::my procsearch assign] ne \"::xotcl::Slot instcmd assign\"} return\n" -"if {[::xotcl::my procsearch get] ne \"::xotcl::Slot instcmd get\"} return\n" -"set forwarder [expr {[::xotcl::my per-object] ? \"parametercmd\":\"instparametercmd\"}]\n" -"[::xotcl::my domain] $forwarder [::xotcl::my name]}\n" -"::xotcl::Slot instmixin add ::xotcl::Slot::Optimizer\n" -"::xotcl::Class create ::xotcl::ScopedNew -superclass ::xotcl::Class \\\n" -"-array set __defaults {withclass ::xotcl::Object}\n" -"::xotcl::ScopedNew instparametercmd withclass\n" -"::xotcl::ScopedNew instparametercmd inobject\n" -"::xotcl::ScopedNew instproc init {} {\n" -"::xotcl::my instproc new {-childof args} {\n" -"[::xotcl::self class] instvar {inobject object} withclass\n" -"if {![::xotcl::my isobject $object]} {\n" -"$withclass create $object}\n" -"eval ::xotcl::next -childof $object $args}}\n" -"::xotcl::Object instproc contains {\n" -"{-withnew:boolean true}\n" -"-object\n" -"{-class ::xotcl::Object}\n" -"cmds} {\n" -"if {![info exists object]} {set object [::xotcl::self]}\n" -"if {![::xotcl::my isobject $object]} {$class create $object}\n" -"$object requireNamespace\n" -"if {$withnew} {\n" -"set m [::xotcl::ScopedNew new \\\n" -"-inobject $object -withclass $class -volatile]\n" -"::xotcl::Class instmixin add $m end\n" -"namespace eval $object $cmds\n" -"::xotcl::Class instmixin delete $m} else {\n" -"namespace eval $object $cmds}}\n" -"::xotcl::Class instforward slots %self contains \\\n" -"-object {%::xotcl::my subst [::xotcl::self]::slot}\n" -"::xotcl::Class instproc parameter arglist {\n" -"if {![::xotcl::my isobject [self]::slot]} {::xotcl::Object create [self]::slot}\n" -"foreach arg $arglist {\n" -"set l [llength $arg]\n" -"set name [lindex $arg 0]\n" -"if {$l == 1} {\n" -"::xotcl::Attribute create [::xotcl::self]::slot::$name} elseif {$l == 2} {\n" -"::xotcl::Attribute create [::xotcl::self]::slot::$name [list -default [lindex $arg 1]]} elseif {$l == 3 && [lindex $arg 1] eq \"-default\"} {\n" -"::xotcl::Attribute create [::xotcl::self]::slot::$name [list -default [lindex $arg 2]]} else {\n" -"set paramstring [string range $arg [expr {[string length $name]+1}] end]\n" -"if {[string match {[$\\[]*} $paramstring]} {\n" -"::xotcl::Attribute create [::xotcl::self]::slot::$name [list -default $paramstring]\n" -"continue}\n" -"set po ::xotcl::Class::Parameter\n" -"puts stderr \"deprecated parameter usage '$arg'; use '-slots {Attribute ...}' instead\"\n" -"set cl [self]\n" -"$po set name $name\n" -"$po set cl [self]\n" -"::eval $po configure [lrange $arg 1 end]\n" -"if {[$po exists extra] || [$po exists setter] ||\n" -"[$po exists getter] || [$po exists access]} {\n" -"$po instvar extra setter getter access defaultParam\n" -"if {![info exists extra]} {set extra \"\"}\n" -"if {![info exists defaultParam]} {set defaultParam \"\"}\n" -"if {![info exists setter]} {set setter set}\n" -"if {![info exists getter]} {set getter set}\n" -"if {![info exists access]} {set access ::xotcl::my}\n" -"$cl instproc $name args \"\n" -"if {\\[llength \\$args] == 0} {\n" -"return \\[$access $getter $extra $name\\]} else {\n" -"return \\[eval $access $setter $extra $name \\$args $defaultParam \\]}\"\n" -"foreach instvar {extra defaultParam setter getter access} {\n" -"$po unset -nocomplain $instvar}} else {\n" -"::xotcl::my instparametercmd $name}}}\n" -"[self]::slot set __parameter $arglist}\n" -"::xotcl::Object instproc self {} {::xotcl::self}\n" -"::xotcl::Object instproc defaultmethod {} {\n" -"return [::xotcl::self]}\n" -"::xotcl::Object instproc hasclass cl {\n" -"if {[::xotcl::my ismixin $cl]} {return 1}\n" -"::xotcl::my istype $cl}\n" -"::xotcl::Class instproc allinstances {} {\n" -"set set [::xotcl::my info instances]\n" -"foreach sc [::xotcl::my info subclass] {\n" -"eval lappend set [$sc allinstances]}\n" -"return $set}\n" -"::xotcl::Object proc unsetExitHandler {} {\n" -"::xotcl::Object proc __exitHandler {} {\n" -";}}\n" -"::xotcl::Object unsetExitHandler\n" -"::xotcl::Object proc setExitHandler {newbody} {\n" -"::xotcl::Object proc __exitHandler {} $newbody}\n" -"::xotcl::Object proc getExitHandler {} {\n" -"::xotcl::Object info body __exitHandler}\n" -"::xotcl::Object instproc abstract {methtype methname arglist} {\n" -"if {$methtype ne \"proc\" && $methtype ne \"instproc\"} {\n" -"error \"invalid method type '$methtype', \\\n" -"must be either 'proc' or 'instproc'.\"}\n" -"::xotcl::my $methtype $methname $arglist \"\n" -"if {!\\[::xotcl::self isnextcall\\]} {\n" -"error \\\"Abstract method $methname $arglist called\\\"} else {::xotcl::next}\n" -"\"}\n" -"::xotcl::Class create ::xotcl::Object::CopyHandler -parameter {\n" -"{targetList \"\"}\n" -"{dest \"\"}\n" -"objLength}\n" -"::xotcl::Object::CopyHandler instproc makeTargetList t {\n" -"::xotcl::my lappend targetList $t\n" -"if {[::xotcl::my isobject $t]} {\n" -"if {[$t info hasNamespace]} {\n" -"set children [$t info children]} else {\n" -"return}}\n" -"foreach c [namespace children $t] {\n" -"if {![::xotcl::my isobject $c]} {\n" -"lappend children [namespace children $t]}}\n" -"foreach c $children {\n" -"::xotcl::my makeTargetList $c}}\n" -"::xotcl::Object::CopyHandler instproc copyNSVarsAndCmds {orig dest} {\n" -"::xotcl::namespace_copyvars $orig $dest\n" -"::xotcl::namespace_copycmds $orig $dest}\n" -"::xotcl::Object::CopyHandler instproc getDest origin {\n" -"set tail [string range $origin [::xotcl::my set objLength] end]\n" -"return ::[string trimleft [::xotcl::my set dest]$tail :]}\n" -"::xotcl::Object::CopyHandler instproc copyTargets {} {\n" -"foreach origin [::xotcl::my set targetList] {\n" -"set dest [::xotcl::my getDest $origin]\n" -"if {[::xotcl::my isobject $origin]} {\n" -"if {[::xotcl::my isclass $origin]} {\n" -"set cl [[$origin info class] create $dest -noinit]\n" -"set obj $cl\n" -"$cl superclass [$origin info superclass]\n" -"$cl parameterclass [$origin info parameterclass]\n" -"$cl instinvar [$origin info instinvar]\n" -"$cl instfilter [$origin info instfilter -guards]\n" -"$cl instmixin [$origin info instmixin]\n" -"my copyNSVarsAndCmds ::xotcl::classes::$origin ::xotcl::classes::$dest} else {\n" -"set obj [[$origin info class] create $dest -noinit]}\n" -"$obj invar [$origin info invar]\n" -"$obj check [$origin info check]\n" -"$obj mixin [$origin info mixin]\n" -"$obj filter [$origin info filter -guards]\n" -"if {[$origin info hasNamespace]} {\n" -"$obj requireNamespace}} else {\n" -"namespace eval $dest {}}\n" -"::xotcl::my copyNSVarsAndCmds $origin $dest\n" -"foreach i [$origin info forward] {\n" -"eval [concat $dest forward $i [$origin info forward -definition $i]]}\n" -"if {[::xotcl::my isclass $origin]} {\n" -"foreach i [$origin info instforward] {\n" -"eval [concat $dest instforward $i [$origin info instforward -definition $i]]}}\n" -"set traces [list]\n" -"foreach var [$origin info vars] {\n" -"set cmds [$origin trace info variable $var]\n" -"if {$cmds ne \"\"} {\n" -"foreach cmd $cmds {\n" -"foreach {op def} $cmd break\n" -"$origin trace remove variable $var $op $def\n" -"if {[lindex $def 0] eq $origin} {\n" -"set def [concat $dest [lrange $def 1 end]]}\n" -"$dest trace add variable $var $op $def}}}}\n" -"set origin [lindex [::xotcl::my set targetList] 0]\n" -"if {[::xotcl::my isclass $origin]} {\n" -"foreach oldslot [$origin info slots] {\n" -"set newslot ${cl}::slot::[namespace tail $oldslot]\n" -"if {[$oldslot domain] eq $origin} {$newslot domain $cl}\n" -"if {[$oldslot manager] eq $oldslot} {$newslot manager $newslot}}}}\n" -"::xotcl::Object::CopyHandler instproc copy {obj dest} {\n" -"::xotcl::my set objLength [string length $obj]\n" -"::xotcl::my set dest $dest\n" -"::xotcl::my makeTargetList $obj\n" -"::xotcl::my copyTargets}\n" -"::xotcl::Object instproc copy newName {\n" -"if {[string compare [string trimleft $newName :] [string trimleft [::xotcl::self] :]]} {\n" -"[[::xotcl::self class]::CopyHandler new -volatile] copy [::xotcl::self] $newName}}\n" -"::xotcl::Object instproc move newName {\n" -"if {[string trimleft $newName :] ne [string trimleft [::xotcl::self] :]} {\n" -"if {$newName ne \"\"} {\n" -"::xotcl::my copy $newName}\n" -"if {[::xotcl::my isclass [::xotcl::self]] && $newName ne \"\"} {\n" -"foreach subclass [::xotcl::my info subclass] {\n" -"set scl [$subclass info superclass]\n" -"if {[set index [lsearch -exact $scl [::xotcl::self]]] != -1} {\n" -"set scl [lreplace $scl $index $index $newName]\n" -"$subclass superclass $scl}} }\n" -"::xotcl::my destroy}}\n" -"::xotcl::Object create ::xotcl::config\n" -"::xotcl::config proc load {obj file} {\n" -"source $file\n" -"foreach i [array names ::auto_index [list $obj *proc *]] {\n" -"set type [lindex $i 1]\n" -"set meth [lindex $i 2]\n" -"if {[$obj info ${type}s $meth] == {}} {\n" -"$obj $type $meth auto $::auto_index($i)}}}\n" -"::xotcl::config proc mkindex {meta dir args} {\n" -"set sp {[ ]+}\n" -"set st {^[ ]*}\n" -"set wd {([^ ;]+)}\n" -"foreach creator $meta {\n" -"::lappend cp $st$creator${sp}create$sp$wd\n" -"::lappend ap $st$creator$sp$wd}\n" -"foreach method {proc instproc} {\n" -"::lappend mp $st$wd${sp}($method)$sp$wd}\n" -"foreach cl [concat ::xotcl::Class [::xotcl::Class info heritage]] {\n" -"eval ::lappend meths [$cl info instcommands]}\n" -"set old [pwd]\n" -"cd $dir\n" -"::append idx \"# Tcl autoload index file, version 2.0\\n\"\n" -"::append idx \"# xotcl additions generated with \"\n" -"::append idx \"\\\"::xotcl::config::mkindex [list $meta] [list $dir] $args\\\"\\n\"\n" -"set oc 0\n" -"set mc 0\n" -"foreach file [eval glob -nocomplain -- $args] {\n" -"if {[catch {set f [open $file]} msg]} then {\n" -"catch {close $f}\n" -"cd $old\n" -"error $msg}\n" -"while {[gets $f line] >= 0} {\n" -"foreach c $cp {\n" -"if {[regexp $c $line x obj]==1 &&\n" -"[string index $obj 0]!={$}} then {\n" -"::incr oc\n" -"::append idx \"set auto_index($obj) \"\n" -"::append idx \"\\\"::xotcl::config::load $obj \\$dir/$file\\\"\\n\"}}\n" -"foreach a $ap {\n" -"if {[regexp $a $line x obj]==1 &&\n" -"[string index $obj 0]!={$} &&\n" -"[lsearch -exact $meths $obj]==-1} {\n" -"::incr oc\n" -"::append idx \"set auto_index($obj) \"\n" -"::append idx \"\\\"::xotcl::config::load $obj \\$dir/$file\\\"\\n\"}}\n" -"foreach m $mp {\n" -"if {[regexp $m $line x obj ty pr]==1 &&\n" -"[string index $obj 0]!={$} &&\n" -"[string index $pr 0]!={$}} then {\n" -"::incr mc\n" -"::append idx \"set \\{auto_index($obj \"\n" -"::append idx \"$ty $pr)\\} \\\"source \\$dir/$file\\\"\\n\"}}}\n" -"close $f}\n" -"set t [open tclIndex a+]\n" -"puts $t $idx nonewline\n" -"close $t\n" -"cd $old\n" -"return \"$oc objects, $mc methods\"}\n" -"::xotcl::Object instproc extractConfigureArg {al name {cutTheArg 0}} {\n" -"set value \"\"\n" -"upvar $al argList\n" -"set largs [llength $argList]\n" -"for {set i 0} {$i < $largs} {incr i} {\n" -"if {[lindex $argList $i] == $name && $i + 1 < $largs} {\n" -"set startIndex $i\n" -"set endIndex [expr {$i + 1}]\n" -"while {$endIndex < $largs &&\n" -"[string first - [lindex $argList $endIndex]] != 0} {\n" -"lappend value [lindex $argList $endIndex]\n" -"incr endIndex}}}\n" -"if {[info exists startIndex] && $cutTheArg != 0} {\n" -"set argList [lreplace $argList $startIndex [expr {$endIndex - 1}]]}\n" -"return $value}\n" -"::xotcl::Object create ::xotcl::rcs\n" -"::xotcl::rcs proc date string {\n" -"lreplace [lreplace $string 0 0] end end}\n" -"::xotcl::rcs proc version string {\n" -"lindex $string 2}\n" -"if {![info exists ::env(HOME)]} {set ::env(HOME) /root}\n" -"set ::xotcl::confdir ~/.xotcl\n" -"set ::xotcl::logdir $::xotcl::confdir/log\n" -"::xotcl::Class proc __unknown name {}\n" -"::xotcl::Class instproc uses list {\n" -"foreach package $list {\n" -"::xotcl::package import -into [self] $package\n" -"puts stderr \"*** using ${package}::* in [self]\"}}\n" -"::xotcl::Class create ::xotcl::package -superclass ::xotcl::Class -parameter {\n" -"provide\n" -"{version 1.0}\n" -"{autoexport {}}\n" -"{export {}}}\n" -"::xotcl::package proc create {name args} {\n" -"set nq [namespace qualifiers $name]\n" -"if {$nq ne \"\" && ![namespace exists $nq]} {Object create $nq}\n" -"next}\n" -"::xotcl::package proc extend {name args} {\n" -"my require $name\n" -"eval $name configure $args}\n" -"::xotcl::package instproc contains script {\n" -"if {[my exists provide]} {\n" -"package provide [my provide] [my version]} else {\n" -"package provide [self] [my version]}\n" -"namespace eval [self] {namespace import ::xotcl::*}\n" -"namespace eval [self] $script\n" -"foreach e [my export] {\n" -"set nq [namespace qualifiers $e]\n" -"if {$nq ne \"\"} {\n" -"namespace eval [self]::$nq [list namespace export [namespace tail $e]]} else {\n" -"namespace eval [self] [list namespace export $e]}}\n" -"foreach e [my autoexport] {\n" -"namespace eval :: [list namespace import [self]::$e]}}\n" -"::xotcl::package configure \\\n" -"-set component . \\\n" -"-set verbose 0 \\\n" -"-set packagecmd ::package\n" -"::xotcl::package proc unknown args {\n" -"eval [my set packagecmd] $args}\n" -"::xotcl::package proc verbose value {\n" -"my set verbose $value}\n" -"::xotcl::package proc present args {\n" -"if {$::tcl_version<8.3} {\n" -"my instvar loaded\n" -"switch -exact -- [lindex $args 0] {\n" -"-exact {set pkg [lindex $args 1]}\n" -"default {set pkg [lindex $args 0]}}\n" -"if {[info exists loaded($pkg)]} {\n" -"return $loaded($pkg)} else {\n" -"error \"not found\"}} else {\n" -"eval [my set packagecmd] present $args}}\n" -"::xotcl::package proc import {{-into ::} pkg} {\n" -"my require $pkg\n" -"namespace eval $into [subst -nocommands {\n" -"namespace import ${pkg}::*}]\n" -"foreach e [$pkg export] {\n" -"set nq [namespace qualifiers $e]\n" -"if {$nq ne \"\"} {\n" -"namespace eval $into$nq [list namespace import ${pkg}::$e]}}}\n" -"::xotcl::package proc require args {\n" -"::xotcl::my instvar component verbose uses loaded\n" -"set prevComponent $component\n" -"if {[catch {set v [eval package present $args]} msg]} {\n" -"switch -exact -- [lindex $args 0] {\n" -"-exact {set pkg [lindex $args 1]}\n" -"default {set pkg [lindex $args 0]}}\n" -"set component $pkg\n" -"lappend uses($prevComponent) $component\n" -"set v [uplevel \\#1 [my set packagecmd] require $args]\n" -"if {$v ne \"\" && $verbose} {\n" -"set path [lindex [::package ifneeded $pkg $v] 1]\n" -"puts \"... $pkg $v loaded from '$path'\"\n" -"set loaded($pkg) $v ;# loaded stuff needed for Tcl 8.0}}\n" -"set component $prevComponent\n" -"return $v}\n" -"::xotcl::Object instproc method {name arguments body} {\n" -"my proc name $arguments $body }\n" -"::xotcl::Class instproc method {\n" -"-per-object:switch name arguments body} {\n" -"if {${per-object}} {\n" -"my proc $name $arguments $body} else {\n" -"my instproc $name $arguments $body}}\n" -"proc ::xotcl::tmpdir {} {\n" -"foreach e [list TMPDIR TEMP TMP] {\n" -"if {[info exists ::env($e)] \\\n" -"&& [file isdirectory $::env($e)] \\\n" -"&& [file writable $::env($e)]} {\n" -"return $::env($e)}}\n" -"if {$::tcl_platform(platform) eq \"windows\"} {\n" -"foreach d [list \"C:\\\\TEMP\" \"C:\\\\TMP\" \"\\\\TEMP\" \"\\\\TMP\"] {\n" -"if {[file isdirectory $d] && [file writable $d]} {\n" -"return $d}}}\n" -"return /tmp}\n" -""; - Index: xotcl/generic/predefined.xotcl =================================================================== diff -u -N --- xotcl/generic/predefined.xotcl (revision 57972e5a2972b1eb5dd63f6e3d483670117feebf) +++ xotcl/generic/predefined.xotcl (revision 0) @@ -1,880 +0,0 @@ -# $Id: predefined.xotcl,v 1.16 2007/09/05 19:09:22 neumann Exp $ -# provide the standard command set for ::xotcl::Object -foreach cmd [info command ::xotcl::Object::instcmd::*] { - ::xotcl::alias ::xotcl::Object [namespace tail $cmd] $cmd -} -# provide some Tcl-commands as methods for Objects -foreach cmd {array append eval incr lappend trace subst unset} { - ::xotcl::alias ::xotcl::Object $cmd -objscope ::$cmd -} -# provide the standard command set for ::xotcl::Class -foreach cmd [info command ::xotcl::Class::instcmd::*] { - ::xotcl::alias ::xotcl::Class [namespace tail $cmd] $cmd -} -unset cmd - -# init must exist on Object. per default it is empty. -::xotcl::Object instproc init args {} - -# documentation stub object -> just ignore -# all documentations if xoDoc is not loaded -::xotcl::Object create ::xotcl::@ -::xotcl::@ proc unknown args {} -proc ::xotcl::myproc {args} {linsert $args 0 [::xotcl::self]} -proc ::xotcl::myvar {var} {::xotcl::my requireNamespace; return [::xotcl::self]::$var} -namespace eval ::xotcl { namespace export @ myproc myvar Attribute} -######################## -# Parameter definitions -######################## -::xotcl::setrelation ::xotcl::Class::Parameter superclass ::xotcl::Class -::xotcl::Class::Parameter instproc mkParameter {obj name args} { - #puts "[::xotcl::self proc] $obj $name <$args>" - if {[$obj exists $name]} { - eval [$obj set $name] configure $args - } else { - $obj set $name [eval ::xotcl::my new -childof $obj $args] - } -} -::xotcl::Class::Parameter instproc getParameter {obj name args} { - #puts "[::xotcl::self proc] $obj $name <$args>" - [$obj set $name] -} -::xotcl::Class::Parameter proc Class {param args} { - #puts "*** [::xotcl::self] parameter: [::xotcl::self proc] '$param' <$args>" - ::xotcl::my set access [lindex $param 0] - ::xotcl::my set setter mkParameter - ::xotcl::my set getter getParameter - ::xotcl::my set extra {[::xotcl::self]} - ::xotcl::my set defaultParam [lrange $param 1 end] -} -::xotcl::Class::Parameter proc default {val} { - [::xotcl::my set cl] set __defaults([::xotcl::my set name]) $val -} -::xotcl::Class::Parameter proc setter x { - ::xotcl::my set setter $x -} -::xotcl::Class::Parameter proc getter x { - ::xotcl::my set getter $x -} -::xotcl::Class::Parameter proc access obj { - ::xotcl::my set access $obj - ::xotcl::my set extra \[::xotcl::self\] - foreach v [$obj info vars] {::xotcl::my set $v [$obj set $v]} -} -::xotcl::Class::Parameter proc values {param args} { - set cl [::xotcl::my set cl] - set ci [$cl info instinvar] - set valueTest {} - foreach a $args { - ::lappend valueTest "\[\$cl set $param\] == [list $a]" - } - ::lappend ci [join $valueTest " || "] - $cl instinvar $ci -} - -################## -# Slot definitions -################## -# bootstrap code; we cannot use -parameter yet -::xotcl::Class create ::xotcl::MetaSlot -::xotcl::setrelation ::xotcl::MetaSlot superclass ::xotcl::Class -::xotcl::MetaSlot instproc new args { - set slotobject [self callingobject]::slot - if {![my isobject $slotobject]} {Object create $slotobject} - #namespace eval [self]::slot $cmds - #puts "metaslot $args // [namespace current] // [self callingobject]" - eval next -childof $slotobject $args -} -::xotcl::MetaSlot create ::xotcl::Slot -array set __defaults { - name "[namespace tail [::xotcl::self]]" - domain "[lindex [regexp -inline {^(.*)::slot::[^:]+$} [::xotcl::self]] 1]" - defaultmethods {get assign} - manager "[::xotcl::self]" - multivalued false - per-object false -} -foreach p {name domain defaultmethods manager default multivalued type - per-object initcmd valuecmd valuechangedcmd} { - ::xotcl::Slot instparametercmd $p -} -unset p - -::xotcl::alias ::xotcl::Slot get ::xotcl::setinstvar -::xotcl::alias ::xotcl::Slot assign ::xotcl::setinstvar -::xotcl::Slot instproc add {obj prop value {pos 0}} { - if {![my multivalued]} { - error "Property $prop of [my domain]->$obj ist not multivalued" - } - if {[$obj exists $prop]} { - $obj set $prop [linsert [$obj set $prop] $pos $value] - } else { - $obj set $prop [list $value] - } -} -::xotcl::Slot instproc delete {-nocomplain:switch obj prop value} { - set old [$obj set $prop] - set p [lsearch -glob $old $value] - if {$p>-1} {$obj set $prop [lreplace $old $p $p]} else { - error "$value is not a $prop of $obj (valid are: $old)" - } -} - -::xotcl::Slot instproc unknown {method args} { - set methods [list] - foreach m [my info methods] { - if {[::xotcl::Object info methods $m] ne ""} continue - if {[string match __* $m]} continue - lappend methods $m - } - error "Method '$method' unknown for slot [self]; valid are: {[lsort $methods]]}" -} -::xotcl::Slot instproc init {} { - my instvar name domain manager - set forwarder [expr {[my per-object] ? "forward" : "instforward"}] - #puts "domain=$domain /[self callingobject]/[my info parent]" - if {$domain eq ""} { - set domain [self callingobject] - } - $domain $forwarder $name -default [$manager defaultmethods] $manager %1 %self %proc -} -# -# InfoSlot -# -::xotcl::MetaSlot create ::xotcl::InfoSlot -array set __defaults { - multivalued true -} -::xotcl::setrelation ::xotcl::InfoSlot superclass ::xotcl::Slot -::xotcl::InfoSlot instproc get {obj prop} {$obj info $prop} -::xotcl::InfoSlot instproc add {obj prop value {pos 0}} { - if {![my multivalued]} { - error "Property $prop of [my domain]->$obj ist not multivalued" - } - $obj $prop [linsert [$obj info $prop] $pos $value] -} -::xotcl::InfoSlot instproc delete {-nocomplain:switch obj prop value} { - set old [$obj info $prop] - set p [lsearch -glob $old $value] - if {$p>-1} {$obj $prop [lreplace $old $p $p]} else { - error "$value is not a $prop of $obj (valid are: $old)" - } -} -# -# InterceptorSlot -# -::xotcl::MetaSlot create ::xotcl::InterceptorSlot -::xotcl::setrelation ::xotcl::InterceptorSlot superclass ::xotcl::InfoSlot -::xotcl::alias ::xotcl::InterceptorSlot set ::xotcl::setrelation ;# for backwards compatibility -::xotcl::alias ::xotcl::InterceptorSlot assign ::xotcl::setrelation - -::xotcl::InterceptorSlot instproc add {obj prop value {pos 0}} { - if {![my multivalued]} { - error "Property $prop of [my domain]->$obj ist not multivalued" - } - $obj $prop [linsert [$obj info $prop -guards] $pos $value] -} - -###################### -# system slots -###################### -namespace eval ::xotcl::Class::slot {} -namespace eval ::xotcl::Object::slot {} - -::xotcl::InfoSlot create ::xotcl::Class::slot::superclass -::xotcl::alias ::xotcl::Class::slot::superclass assign ::xotcl::setrelation - -::xotcl::InfoSlot create ::xotcl::Object::slot::class -::xotcl::alias ::xotcl::Object::slot::class assign ::xotcl::setrelation - -::xotcl::InterceptorSlot create ::xotcl::Object::slot::mixin -::xotcl::InterceptorSlot create ::xotcl::Object::slot::filter -::xotcl::InterceptorSlot create ::xotcl::Class::slot::instmixin -::xotcl::InterceptorSlot create ::xotcl::Class::slot::instfilter - -# -# Attribute -# -::xotcl::MetaSlot create ::xotcl::Attribute -superclass ::xotcl::Slot -foreach p {default value_check initcmd valuecmd valuechangedcmd} { - ::xotcl::Attribute instparametercmd $p -} -unset p -::xotcl::Attribute array set __defaults { - value_check once -} -::xotcl::Attribute instproc __default_from_cmd {obj cmd var sub op} { - #puts "GETVAR [self proc] obj=$obj cmd=$cmd, var=$var, op=$op" - $obj trace remove variable $var $op [list [self] [self proc] $obj $cmd] - $obj set $var [$obj eval $cmd] -} -::xotcl::Attribute instproc __value_from_cmd {obj cmd var sub op} { - #puts "GETVAR [self proc] obj=$obj cmd=$cmd, var=$var, op=$op" - $obj set $var [$obj eval $cmd] -} -::xotcl::Attribute instproc __value_changed_cmd {obj cmd var sub op} { - #puts stderr "**************************" - #puts "valuechanged obj=$obj cmd=$cmd, var=$var, op=$op, ... - #$obj exists $var -> [$obj set $var]" - eval $cmd -} -::xotcl::Attribute instproc destroy {} { - #puts stderr "++++ [my domain] unset __defaults([my name]) [my default]" - #[my domain] unset -nocomplain __defaults([my name]) - next -} -::xotcl::Attribute instproc check_single_value { - {-keep_old_value:boolean true} - value predicate type obj var -} { - #puts "+++ checking $value with $predicate ==> [expr $predicate]" - if {![expr $predicate]} { - if {[$obj exists __oldvalue($var)]} { - $obj set $var [$obj set __oldvalue($var)] - } else { - $obj unset -nocomplain $var - } - error "$value is not of type $type" - } - if {$keep_old_value} {$obj set __oldvalue($var) $value} -} - -::xotcl::Attribute instproc check_multiple_values {values predicate type obj var} { - foreach value $values { - my check_single_value -keep_old_value false $value $predicate $type $obj $var - } - $obj set __oldvalue($var) $value -} -::xotcl::Attribute instproc mk_type_checker {} { - set __initcmd "" - if {[my exists type]} { - my instvar type name - if {[::xotcl::Object isclass $type]} { - set predicate [subst -nocommands {[::xotcl::Object isobject \$value] - && [\$value istype $type]}] - } elseif {[llength $type]>1} { - set predicate "\[$type \$value\]" - } else { - set predicate "\[string is $type \$value\]" - } - my append valuechangedcmd [subst { - my [expr {[my multivalued] ? "check_multiple_values" : "check_single_value"}] \[\$obj set $name\] \ - {$predicate} [list $type] \$obj $name - }] - append __initcmd [subst -nocommands { - if {[my exists $name]} {my set __oldvalue($name) [my set $name]}\n - }] - } - return $__initcmd -} -::xotcl::Attribute instproc init {} { - my instvar domain name - next ;# do first ordinary slot initialization - # there might be already default values registered on the class - $domain unset -nocomplain __defaults($name) - set __initcmd "" - if {[my exists default]} { - $domain set __defaults($name) [my default] - } elseif [my exists initcmd] { - append __initcmd "my trace add variable [list $name] read \ - \[list [self] __default_from_cmd \[self\] [list [my initcmd]]\]\n" - } elseif [my exists valuecmd] { - append __initcmd "my trace add variable [list $name] read \ - \[list [self] __value_from_cmd \[self\] [list [my valuecmd]]\]" - } - append __initcmd [my mk_type_checker] - if {[my exists valuechangedcmd]} { - append __initcmd "my trace add variable [list $name] write \ - \[list [self] __value_changed_cmd \[self\] [list [my valuechangedcmd]]\]" - } - if {$__initcmd ne ""} { - $domain set __initcmds($name) $__initcmd - #puts stderr "$domain set __initcmds($name) $__initcmd" - } -} -# mixin class for decativating all checks -::xotcl::Class create ::xotcl::Slot::Nocheck \ - -instproc check_single_value args {;} -instproc check_multiple_values args {;} \ - -instproc mk_type_checker args {return ""} -::xotcl::Class create ::xotcl::Slot::Optimizer \ - -instproc proc args {::xotcl::next; ::xotcl::my optimize} \ - -instproc forward args {::xotcl::next; ::xotcl::my optimize} \ - -instproc init args {::xotcl::next; ::xotcl::my optimize} \ - -instproc optimize {} { - if {[::xotcl::my multivalued]} return - if {[::xotcl::my defaultmethods] ne {get assign}} return - if {[::xotcl::my procsearch assign] ne "::xotcl::Slot instcmd assign"} return - if {[::xotcl::my procsearch get] ne "::xotcl::Slot instcmd get"} return - set forwarder [expr {[::xotcl::my per-object] ? "parametercmd":"instparametercmd"}] - #puts stderr "**** optimizing [::xotcl::my domain] $forwarder [::xotcl::my name]" - [::xotcl::my domain] $forwarder [::xotcl::my name] - } -# register the optimizer per default -::xotcl::Slot instmixin add ::xotcl::Slot::Optimizer - -# -# Create a mixin class to overload method "new", such it does not allocate -# new objects in ::xotcl::*, but in the specified object (without -# syntactic overhead). -# -::xotcl::Class create ::xotcl::ScopedNew -superclass ::xotcl::Class \ - -array set __defaults {withclass ::xotcl::Object} -::xotcl::ScopedNew instparametercmd withclass -::xotcl::ScopedNew instparametercmd inobject -::xotcl::ScopedNew instproc init {} { - ::xotcl::my instproc new {-childof args} { - [::xotcl::self class] instvar {inobject object} withclass - if {![::xotcl::my isobject $object]} { - $withclass create $object - } - eval ::xotcl::next -childof $object $args - } -} -# -# change the namespace to the specified object and create -# objects there. This is a friendly notation for creating -# nested object structures. Optionally, creating new objects -# in the specified scope can be turned off. -# -::xotcl::Object instproc contains { - {-withnew:boolean true} - -object - {-class ::xotcl::Object} - cmds} { - if {![info exists object]} {set object [::xotcl::self]} - if {![::xotcl::my isobject $object]} {$class create $object} - $object requireNamespace - if {$withnew} { - set m [::xotcl::ScopedNew new \ - -inobject $object -withclass $class -volatile] - ::xotcl::Class instmixin add $m end - namespace eval $object $cmds - ::xotcl::Class instmixin delete $m - } else { - namespace eval $object $cmds - } - } -::xotcl::Class instforward slots %self contains \ - -object {%::xotcl::my subst [::xotcl::self]::slot} - -# -# utilities -# -::xotcl::Class instproc parameter arglist { - if {![::xotcl::my isobject [self]::slot]} {::xotcl::Object create [self]::slot} - foreach arg $arglist { - #puts "arg=$arg" - set l [llength $arg] - set name [lindex $arg 0] - if {$l == 1} { - ::xotcl::Attribute create [::xotcl::self]::slot::$name - - } elseif {$l == 2} { - #puts stderr "parameter $name has default '[lindex $arg 1]'" - ::xotcl::Attribute create [::xotcl::self]::slot::$name [list -default [lindex $arg 1]] - } elseif {$l == 3 && [lindex $arg 1] eq "-default"} { - ::xotcl::Attribute create [::xotcl::self]::slot::$name [list -default [lindex $arg 2]] - } else { - set paramstring [string range $arg [expr {[string length $name]+1}] end] - #puts stderr "remaining arg = '$paramstring'" - if {[string match {[$\[]*} $paramstring]} { - #puts stderr "match, $cl set __defaults($name) $paramstring" - ::xotcl::Attribute create [::xotcl::self]::slot::$name [list -default $paramstring] - continue - } - - set po ::xotcl::Class::Parameter - puts stderr "deprecated parameter usage '$arg'; use '-slots {Attribute ...}' instead" - - set cl [self] - $po set name $name - $po set cl [self] - ::eval $po configure [lrange $arg 1 end] - - if {[$po exists extra] || [$po exists setter] || - [$po exists getter] || [$po exists access]} { - $po instvar extra setter getter access defaultParam - if {![info exists extra]} {set extra ""} - if {![info exists defaultParam]} {set defaultParam ""} - if {![info exists setter]} {set setter set} - if {![info exists getter]} {set getter set} - if {![info exists access]} {set access ::xotcl::my} - $cl instproc $name args " - if {\[llength \$args] == 0} { - return \[$access $getter $extra $name\] - } else { - return \[eval $access $setter $extra $name \$args $defaultParam \] - }" - foreach instvar {extra defaultParam setter getter access} { - $po unset -nocomplain $instvar - } - } else { - ::xotcl::my instparametercmd $name - } - } - } - [self]::slot set __parameter $arglist -} -# -# utilities -# -::xotcl::Object instproc self {} {::xotcl::self} -::xotcl::Object instproc defaultmethod {} { - #if {"::" ne [::xotcl::my info parent] } { - # [::xotcl::my info parent] __next - #} - return [::xotcl::self] -} - -# support for XOTcl specifics -::xotcl::Object instproc hasclass cl { - if {[::xotcl::my ismixin $cl]} {return 1} - ::xotcl::my istype $cl -} -::xotcl::Class instproc allinstances {} { - set set [::xotcl::my info instances] - foreach sc [::xotcl::my info subclass] { - eval lappend set [$sc allinstances] - } - return $set -} - - -# Exit Handler -::xotcl::Object proc unsetExitHandler {} { - ::xotcl::Object proc __exitHandler {} { - # clients should append exit handlers to this proc body - ; - } -} -# pre-defined as empty method -::xotcl::Object unsetExitHandler -::xotcl::Object proc setExitHandler {newbody} { - ::xotcl::Object proc __exitHandler {} $newbody -} -::xotcl::Object proc getExitHandler {} { - ::xotcl::Object info body __exitHandler -} - -::xotcl::Object instproc abstract {methtype methname arglist} { - if {$methtype ne "proc" && $methtype ne "instproc"} { - error "invalid method type '$methtype', \ - must be either 'proc' or 'instproc'." - } - ::xotcl::my $methtype $methname $arglist " - if {!\[::xotcl::self isnextcall\]} { - error \"Abstract method $methname $arglist called\" - } else {::xotcl::next} - " -} - -# -# copy/move implementation -# -::xotcl::Class create ::xotcl::Object::CopyHandler -parameter { - {targetList ""} - {dest ""} - objLength -} - -# targets are all namspaces and objs part-of the copied obj -::xotcl::Object::CopyHandler instproc makeTargetList t { - ::xotcl::my lappend targetList $t - # if it is an object without namespace, it is a leaf - if {[::xotcl::my isobject $t]} { - if {[$t info hasNamespace]} { - # make target list from all children - set children [$t info children] - } else { - # ok, no namespace -> no more children - return - } - } - # now append all namespaces that are in the obj, but that - # are not objects - foreach c [namespace children $t] { - if {![::xotcl::my isobject $c]} { - lappend children [namespace children $t] - } - } - - # a namespace or an obj with namespace may have children - # itself - foreach c $children { - ::xotcl::my makeTargetList $c - } -} - -::xotcl::Object::CopyHandler instproc copyNSVarsAndCmds {orig dest} { - ::xotcl::namespace_copyvars $orig $dest - ::xotcl::namespace_copycmds $orig $dest -} - -# construct destination obj name from old qualified ns name -::xotcl::Object::CopyHandler instproc getDest origin { - set tail [string range $origin [::xotcl::my set objLength] end] - return ::[string trimleft [::xotcl::my set dest]$tail :] -} - -::xotcl::Object::CopyHandler instproc copyTargets {} { - #puts stderr "copy targetList = [::xotcl::my set targetList]" - foreach origin [::xotcl::my set targetList] { - set dest [::xotcl::my getDest $origin] - if {[::xotcl::my isobject $origin]} { - # copy class information - if {[::xotcl::my isclass $origin]} { - set cl [[$origin info class] create $dest -noinit] - # class object - set obj $cl - $cl superclass [$origin info superclass] - $cl parameterclass [$origin info parameterclass] - $cl instinvar [$origin info instinvar] - $cl instfilter [$origin info instfilter -guards] - $cl instmixin [$origin info instmixin] - my copyNSVarsAndCmds ::xotcl::classes::$origin ::xotcl::classes::$dest - #$cl parameter [$origin info parameter] - } else { - # create obj - set obj [[$origin info class] create $dest -noinit] - } - # copy object -> may be a class obj - $obj invar [$origin info invar] - $obj check [$origin info check] - $obj mixin [$origin info mixin] - $obj filter [$origin info filter -guards] - # set md [$origin info metadata] - # $obj metadata add $md - # foreach m $md { $obj metadata $m [$origin metadata $m] } - if {[$origin info hasNamespace]} { - $obj requireNamespace - } - } else { - namespace eval $dest {} - } - ::xotcl::my copyNSVarsAndCmds $origin $dest - foreach i [$origin info forward] { - eval [concat $dest forward $i [$origin info forward -definition $i]] - } - if {[::xotcl::my isclass $origin]} { - foreach i [$origin info instforward] { - eval [concat $dest instforward $i [$origin info instforward -definition $i]] - } - } - set traces [list] - foreach var [$origin info vars] { - set cmds [$origin trace info variable $var] - if {$cmds ne ""} { - foreach cmd $cmds { - foreach {op def} $cmd break - $origin trace remove variable $var $op $def - if {[lindex $def 0] eq $origin} { - set def [concat $dest [lrange $def 1 end]] - } - $dest trace add variable $var $op $def - } - } - } - } - # alter 'domain' and 'manager' in slot objects - set origin [lindex [::xotcl::my set targetList] 0] - if {[::xotcl::my isclass $origin]} { - foreach oldslot [$origin info slots] { - set newslot ${cl}::slot::[namespace tail $oldslot] - if {[$oldslot domain] eq $origin} {$newslot domain $cl} - if {[$oldslot manager] eq $oldslot} {$newslot manager $newslot} - } - } -} - -::xotcl::Object::CopyHandler instproc copy {obj dest} { - #puts stderr "[::xotcl::self] copy <$obj> <$dest>" - ::xotcl::my set objLength [string length $obj] - ::xotcl::my set dest $dest - ::xotcl::my makeTargetList $obj - ::xotcl::my copyTargets -} - -#Class create ::xotcl::NoInit -#::xotcl::NoInit instproc init args {;} - - -::xotcl::Object instproc copy newName { - if {[string compare [string trimleft $newName :] [string trimleft [::xotcl::self] :]]} { - [[::xotcl::self class]::CopyHandler new -volatile] copy [::xotcl::self] $newName - } -} - -::xotcl::Object instproc move newName { - if {[string trimleft $newName :] ne [string trimleft [::xotcl::self] :]} { - if {$newName ne ""} { - ::xotcl::my copy $newName - } - ### let all subclasses get the copied class as superclass - if {[::xotcl::my isclass [::xotcl::self]] && $newName ne ""} { - foreach subclass [::xotcl::my info subclass] { - set scl [$subclass info superclass] - if {[set index [lsearch -exact $scl [::xotcl::self]]] != -1} { - set scl [lreplace $scl $index $index $newName] - $subclass superclass $scl - } - } - } - ::xotcl::my destroy - } -} - -::xotcl::Object create ::xotcl::config -::xotcl::config proc load {obj file} { - source $file - foreach i [array names ::auto_index [list $obj *proc *]] { - set type [lindex $i 1] - set meth [lindex $i 2] - if {[$obj info ${type}s $meth] == {}} { - $obj $type $meth auto $::auto_index($i) - } - } -} - -::xotcl::config proc mkindex {meta dir args} { - set sp {[ ]+} - set st {^[ ]*} - set wd {([^ ;]+)} - foreach creator $meta { - ::lappend cp $st$creator${sp}create$sp$wd - ::lappend ap $st$creator$sp$wd - } - foreach method {proc instproc} { - ::lappend mp $st$wd${sp}($method)$sp$wd - } - foreach cl [concat ::xotcl::Class [::xotcl::Class info heritage]] { - eval ::lappend meths [$cl info instcommands] - } - set old [pwd] - cd $dir - ::append idx "# Tcl autoload index file, version 2.0\n" - ::append idx "# xotcl additions generated with " - ::append idx "\"::xotcl::config::mkindex [list $meta] [list $dir] $args\"\n" - set oc 0 - set mc 0 - foreach file [eval glob -nocomplain -- $args] { - if {[catch {set f [open $file]} msg]} then { - catch {close $f} - cd $old - error $msg - } - while {[gets $f line] >= 0} { - foreach c $cp { - if {[regexp $c $line x obj]==1 && - [string index $obj 0]!={$}} then { - ::incr oc - ::append idx "set auto_index($obj) " - ::append idx "\"::xotcl::config::load $obj \$dir/$file\"\n" - } - } - foreach a $ap { - if {[regexp $a $line x obj]==1 && - [string index $obj 0]!={$} && - [lsearch -exact $meths $obj]==-1} { - ::incr oc - ::append idx "set auto_index($obj) " - ::append idx "\"::xotcl::config::load $obj \$dir/$file\"\n" - } - } - foreach m $mp { - if {[regexp $m $line x obj ty pr]==1 && - [string index $obj 0]!={$} && - [string index $pr 0]!={$}} then { - ::incr mc - ::append idx "set \{auto_index($obj " - ::append idx "$ty $pr)\} \"source \$dir/$file\"\n" - } - } - } - close $f - } - set t [open tclIndex a+] - puts $t $idx nonewline - close $t - cd $old - return "$oc objects, $mc methods" -} - -# -# if cutTheArg not 0, it cut from upvar argsList -# -::xotcl::Object instproc extractConfigureArg {al name {cutTheArg 0}} { - set value "" - upvar $al argList - set largs [llength $argList] - for {set i 0} {$i < $largs} {incr i} { - if {[lindex $argList $i] == $name && $i + 1 < $largs} { - set startIndex $i - set endIndex [expr {$i + 1}] - while {$endIndex < $largs && - [string first - [lindex $argList $endIndex]] != 0} { - lappend value [lindex $argList $endIndex] - incr endIndex - } - } - } - if {[info exists startIndex] && $cutTheArg != 0} { - set argList [lreplace $argList $startIndex [expr {$endIndex - 1}]] - } - return $value -} - -::xotcl::Object create ::xotcl::rcs -::xotcl::rcs proc date string { - lreplace [lreplace $string 0 0] end end -} -::xotcl::rcs proc version string { - lindex $string 2 -} - -# if HOME is not set, and ~ is resolved, Tcl chokes on that -if {![info exists ::env(HOME)]} {set ::env(HOME) /root} -set ::xotcl::confdir ~/.xotcl -set ::xotcl::logdir $::xotcl::confdir/log - -::xotcl::Class proc __unknown name { - #unknown $name -} - -# -# package support -# -::xotcl::Class instproc uses list { - foreach package $list { - ::xotcl::package import -into [self] $package - puts stderr "*** using ${package}::* in [self]" - } -} -::xotcl::Class create ::xotcl::package -superclass ::xotcl::Class -parameter { - provide - {version 1.0} - {autoexport {}} - {export {}} -} -::xotcl::package proc create {name args} { - set nq [namespace qualifiers $name] - if {$nq ne "" && ![namespace exists $nq]} {Object create $nq} - next -} -::xotcl::package proc extend {name args} { - my require $name - eval $name configure $args -} -::xotcl::package instproc contains script { - if {[my exists provide]} { - package provide [my provide] [my version] - } else { - package provide [self] [my version] - } - namespace eval [self] {namespace import ::xotcl::*} - namespace eval [self] $script - foreach e [my export] { - set nq [namespace qualifiers $e] - if {$nq ne ""} { - namespace eval [self]::$nq [list namespace export [namespace tail $e]] - } else { - namespace eval [self] [list namespace export $e] - } - } - foreach e [my autoexport] { - namespace eval :: [list namespace import [self]::$e] - } -} -::xotcl::package configure \ - -set component . \ - -set verbose 0 \ - -set packagecmd ::package - -::xotcl::package proc unknown args { - #puts stderr "unknown: package $args" - eval [my set packagecmd] $args -} -::xotcl::package proc verbose value { - my set verbose $value -} -::xotcl::package proc present args { - if {$::tcl_version<8.3} { - my instvar loaded - switch -exact -- [lindex $args 0] { - -exact {set pkg [lindex $args 1]} - default {set pkg [lindex $args 0]} - } - if {[info exists loaded($pkg)]} { - return $loaded($pkg) - } else { - error "not found" - } - } else { - eval [my set packagecmd] present $args - } -} -::xotcl::package proc import {{-into ::} pkg} { - my require $pkg - namespace eval $into [subst -nocommands { - #puts stderr "*** package import ${pkg}::* into [namespace current]" - namespace import ${pkg}::* - }] - # import subclasses if any - foreach e [$pkg export] { - set nq [namespace qualifiers $e] - if {$nq ne ""} { - namespace eval $into$nq [list namespace import ${pkg}::$e] - } - } -} -::xotcl::package proc require args { - #puts "XOTCL package require $args, current=[namespace current]" - ::xotcl::my instvar component verbose uses loaded - set prevComponent $component - if {[catch {set v [eval package present $args]} msg]} { - #puts stderr "we have to load $msg" - switch -exact -- [lindex $args 0] { - -exact {set pkg [lindex $args 1]} - default {set pkg [lindex $args 0]} - } - set component $pkg - lappend uses($prevComponent) $component - set v [uplevel \#1 [my set packagecmd] require $args] - if {$v ne "" && $verbose} { - set path [lindex [::package ifneeded $pkg $v] 1] - puts "... $pkg $v loaded from '$path'" - set loaded($pkg) $v ;# loaded stuff needed for Tcl 8.0 - } - } - set component $prevComponent - return $v -} - -::xotcl::Object instproc method {name arguments body} { - my proc name $arguments $body -} -::xotcl::Class instproc method { - -per-object:switch name arguments body} { - - if {${per-object}} { - my proc $name $arguments $body - } else { - my instproc $name $arguments $body - } -} - -# setup a temp directory -proc ::xotcl::tmpdir {} { - foreach e [list TMPDIR TEMP TMP] { - if {[info exists ::env($e)] \ - && [file isdirectory $::env($e)] \ - && [file writable $::env($e)]} { - return $::env($e) - } - } - if {$::tcl_platform(platform) eq "windows"} { - foreach d [list "C:\\TEMP" "C:\\TMP" "\\TEMP" "\\TMP"] { - if {[file isdirectory $d] && [file writable $d]} { - return $d - } - } - } - return /tmp -} Index: xotcl/generic/xotcl.c =================================================================== diff -u -N --- xotcl/generic/xotcl.c (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/generic/xotcl.c (revision 0) @@ -1,12430 +0,0 @@ -/* $Id: xotcl.c,v 1.51 2007/10/12 19:53:32 neumann Exp $ - * - * XOTcl - Extended Object Tcl - * - * Copyright (C) 1999-2007 Gustaf Neumann (a), Uwe Zdun (a) - * - * (a) Vienna University of Economics and Business Administration - * Institute. of Information Systems and New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - * */ - -#define XOTCL_C 1 -#include "xotclInt.h" -#include "xotclAccessInt.h" - -#ifdef KEEP_TCL_CMD_TYPE -/*# include "tclCompile.h"*/ -#endif - -#ifdef COMPILE_XOTCL_STUBS -extern XotclStubs xotclStubs; -#endif - -#ifdef XOTCL_MEM_COUNT -int xotclMemCountInterpCounter = 0; -#endif - - -/* - * Tcl_Obj Types for XOTcl Objects - */ - -#ifdef USE_TCL_STUBS -# define XOTcl_ExprObjCmd(cd,in,objc,objv) \ - XOTclCallCommand(in, XOTE_EXPR, objc, objv) -# define XOTcl_SubstObjCmd(cd,in,objc,objv) \ - XOTclCallCommand(in, XOTE_SUBST, objc, objv) -#else -# define XOTcl_ExprObjCmd(cd,in,objc,objv) \ - Tcl_ExprObjCmd(cd, in, objc, objv) -# define XOTcl_SubstObjCmd(cd,in,objc,objv) \ - Tcl_SubstObjCmd(cd, in, objc, objv) -#endif - - -static int SetXOTclObjectFromAny(Tcl_Interp *in, Tcl_Obj *objPtr); -static void UpdateStringOfXOTclObject(Tcl_Obj *objPtr); -static void FreeXOTclObjectInternalRep(Tcl_Obj *objPtr); -static void DupXOTclObjectInternalRep(Tcl_Obj *src, Tcl_Obj *cpy); - -static Tcl_Obj*NameInNamespaceObj(Tcl_Interp *in, char *name, Tcl_Namespace *ns); -static Tcl_Namespace *callingNameSpace(Tcl_Interp *in); -XOTCLINLINE static Tcl_Command NSFindCommand(Tcl_Interp *in, char *name, Tcl_Namespace *ns); - -XOTCLINLINE static void GuardAdd(Tcl_Interp *in, XOTclCmdList* filterCL, Tcl_Obj *guard); -static int GuardCheck(Tcl_Interp *in, ClientData guards); -static int GuardCall(XOTclObject *obj, XOTclClass* cl, Tcl_Command cmd, Tcl_Interp *in, ClientData clientData, int push); -static void GuardDel(XOTclCmdList* filterCL); -static int IsMetaClass(Tcl_Interp *in, XOTclClass *cl); -static int hasMixin(Tcl_Interp *in, XOTclObject *obj, XOTclClass *cl); -static int isSubType(XOTclClass *subcl, XOTclClass *cl); - -static Tcl_ObjType XOTclObjectType = { - "XOTclObject", - FreeXOTclObjectInternalRep, - DupXOTclObjectInternalRep, - UpdateStringOfXOTclObject, - SetXOTclObjectFromAny -}; - -typedef enum { CALLING_LEVEL, ACTIVE_LEVEL } CallStackLevel; - -typedef struct callFrameContext { - int framesSaved; - Tcl_CallFrame *framePtr; - Tcl_CallFrame *varFramePtr; -} callFrameContext; -typedef struct tclCmdClientData { - XOTclObject *obj; - Tcl_Obj *cmdName; -} tclCmdClientData; -typedef struct forwardCmdClientData { - XOTclObject *obj; - Tcl_Obj *cmdName; - Tcl_ObjCmdProc *objProc; - int passthrough; - int needobjmap; - int verbose; - ClientData cd; - int nr_args; - Tcl_Obj *args; - int objscope; - Tcl_Obj *prefix; - int nr_subcommands; - Tcl_Obj *subcommands; -} forwardCmdClientData; -typedef struct aliasCmdClientData { - XOTclObject *obj; - Tcl_Obj *cmdName; - Tcl_ObjCmdProc *objProc; - ClientData cd; -} aliasCmdClientData; - -static int ObjDispatch(ClientData cd, Tcl_Interp *in, int objc, - Tcl_Obj *CONST objv[], int flags); -XOTCLINLINE static int DoDispatch(ClientData cd, Tcl_Interp *in, int objc, - Tcl_Obj *CONST objv[], int flags); -static int XOTclNextMethod(XOTclObject *obj, Tcl_Interp *in, XOTclClass *givenCl, - char *givenMethod, int objc, Tcl_Obj *CONST objv[], - int useCSObjs); - -static int XOTclForwardMethod(ClientData cd, Tcl_Interp *in, int objc, - Tcl_Obj *CONST objv[]); -static int XOTclObjscopedMethod(ClientData cd, Tcl_Interp *in, int objc, - Tcl_Obj *CONST objv[]); -static int XOTclSetterMethod(ClientData cd, Tcl_Interp *in, int objc, - Tcl_Obj *CONST objv[]); - -static int callDestroyMethod(ClientData cd, Tcl_Interp *in, XOTclObject *obj, int flags); - -static int XOTclObjConvertObject(Tcl_Interp *in, register Tcl_Obj *objPtr, XOTclObject **obj); -static XOTclObject *XOTclpGetObject(Tcl_Interp *in, char *name); -static XOTclClass *XOTclpGetClass(Tcl_Interp *in, char *name); -static XOTclCallStackContent* CallStackGetFrame(Tcl_Interp *in); -#if !defined(NDEBUG) -static void checkAllInstances(Tcl_Interp *in, XOTclClass *startCl, int lvl); -#endif - - - - - - -#ifdef PRE81 -/* for backward compatibility only -*/ -static int -Tcl_EvalObjv(Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[], int flags) { - int i, result; - Tcl_DString ds, *dsp = &ds; - - assert(flags == 0); - DSTRING_INIT(dsp); - for (i = 0; i < objc; i++) { - Tcl_DStringAppendElement(dsp, ObjStr(objv[i])); - } - result = Tcl_Eval(in, Tcl_DStringValue(dsp)); - DSTRING_FREE(dsp); - return result; -} -static int -Tcl_EvalEx(Tcl_Interp *in, char *cmd, int len, int flags) { - return Tcl_Eval(in, cmd); -} -static int -Tcl_SubstObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - char *ov[20]; - int i; - assert(objc<19); - for (i=0; ifield)) -#endif -#endif - -#if defined(PRE85) && FORWARD_COMPATIBLE -/* - * Define the types missing for the forward compatible mode - */ -typedef Var * (Tcl_VarHashCreateVarFunction) _ANSI_ARGS_( - (TclVarHashTable *tablePtr, Tcl_Obj *key, int *newPtr) -); -typedef void (Tcl_InitVarHashTableFunction) _ANSI_ARGS_( - (TclVarHashTable *tablePtr, Namespace *nsPtr) -); -typedef void (Tcl_CleanupVarFunction) _ANSI_ARGS_ ( - (Var * varPtr, Var *arrayPtr) -); -typedef Var * (Tcl_DeleteVarFunction) _ANSI_ARGS_ ( - (Interp *iPtr, TclVarHashTable *tablePtr) -); -typedef Var * (lookupVarFromTableFunction) _ANSI_ARGS_ ( - (TclVarHashTable *varTable, CONST char *simpleName, XOTclObject *obj) -); - - -typedef struct TclVarHashTable85 { - Tcl_HashTable table; - struct Namespace *nsPtr; -} TclVarHashTable85; - -typedef struct Var85 { - int flags; - union { - Tcl_Obj *objPtr; - TclVarHashTable85 *tablePtr; - struct Var85 *linkPtr; - } value; -} Var85; - -typedef struct VarInHash { - Var85 var; - int refCount; - Tcl_HashEntry entry; -} VarInHash; - - -typedef struct Tcl_CallFrame85 { - Tcl_Namespace *nsPtr; - int dummy1; - int dummy2; - char *dummy3; - char *dummy4; - char *dummy5; - int dummy6; - char *dummy7; - char *dummy8; - int dummy9; - char *dummy10; - char *dummy11; - char *dummy12; -} Tcl_CallFrame85; - -typedef struct CallFrame85 { - Namespace *nsPtr; - int isProcCallFrame; - int objc; - Tcl_Obj *CONST *objv; - struct CallFrame *callerPtr; - struct CallFrame *callerVarPtr; - int level; - Proc *procPtr; - TclVarHashTable *varTablePtr; - int numCompiledLocals; - Var85 *compiledLocals; - ClientData clientData; - void *localCachePtr; -} CallFrame85; - -/* - * These are global variables, but thread-safe, since they - * are only set during initialzation and they are never changed, - * and the variables are single words. - */ -static int forwardCompatibleMode; - -static Tcl_VarHashCreateVarFunction *tclVarHashCreateVar; -static Tcl_InitVarHashTableFunction *tclInitVarHashTable; -static Tcl_CleanupVarFunction *tclCleanupVar; -static lookupVarFromTableFunction *lookupVarFromTable; - -static int varRefCountOffset; -static int varHashTableSize; - -# define VarHashRefCount(varPtr) \ - (*((int *) (((char *)(varPtr))+varRefCountOffset))) - -# define VarHashGetValue(hPtr) \ - (forwardCompatibleMode ? \ - (Var *) ((char *)hPtr - TclOffset(VarInHash, entry)) : \ - (Var *) Tcl_GetHashValue(hPtr) \ - ) - -#define VarHashGetKey(varPtr) \ - (((VarInHash *)(varPtr))->entry.key.objPtr) - -#define VAR_TRACED_READ85 0x10 /* TCL_TRACE_READS */ -#define VAR_TRACED_WRITE85 0x20 /* TCL_TRACE_WRITES */ -#define VAR_TRACED_UNSET85 0x40 /* TCL_TRACE_UNSETS */ -#define VAR_TRACED_ARRAY85 0x800 /* TCL_TRACE_ARRAY */ -#define VAR_TRACE_ACTIVE85 0x2000 -#define VAR_SEARCH_ACTIVE85 0x4000 -#define VAR_ALL_TRACES85 \ - (VAR_TRACED_READ85|VAR_TRACED_WRITE85|VAR_TRACED_ARRAY85|VAR_TRACED_UNSET85) - -#define VAR_ARRAY85 0x1 -#define VAR_LINK85 0x2 - -#define varFlags(varPtr) \ - (forwardCompatibleMode ? \ - ((Var85 *)varPtr)->flags : \ - (varPtr)->flags \ - ) -#undef TclIsVarScalar -#define TclIsVarScalar(varPtr) \ - (forwardCompatibleMode ? \ - !(((Var85 *)varPtr)->flags & (VAR_ARRAY85|VAR_LINK85)) : \ - ((varPtr)->flags & VAR_SCALAR) \ - ) -#undef TclIsVarArray -#define TclIsVarArray(varPtr) \ - (forwardCompatibleMode ? \ - (((Var85 *)varPtr)->flags & VAR_ARRAY85) : \ - ((varPtr)->flags & VAR_ARRAY) \ - ) -#define TclIsVarNamespaceVar(varPtr) \ - (forwardCompatibleMode ? \ - (((Var85 *)varPtr)->flags & VAR_NAMESPACE_VAR) : \ - ((varPtr)->flags & VAR_NAMESPACE_VAR) \ - ) - -#define TclIsVarTraced(varPtr) \ - (forwardCompatibleMode ? \ - (((Var85 *)varPtr)->flags & VAR_ALL_TRACES85) : \ - (varPtr->tracePtr != NULL) \ - ) -#undef TclIsVarLink -#define TclIsVarLink(varPtr) \ - (forwardCompatibleMode ? \ - (((Var85 *)varPtr)->flags & VAR_LINK85) : \ - (varPtr->flags & VAR_LINK) \ - ) -#undef TclIsVarUndefined -#define TclIsVarUndefined(varPtr) \ - (forwardCompatibleMode ? \ - (((Var85 *)varPtr)->value.objPtr == NULL) : \ - (varPtr->flags & VAR_UNDEFINED) \ - ) -#undef TclSetVarLink -#define TclSetVarLink(varPtr) \ - if (forwardCompatibleMode) \ - ((Var85 *)varPtr)->flags = (((Var85 *)varPtr)->flags & ~VAR_ARRAY85) | VAR_LINK85; \ - else \ - (varPtr)->flags = ((varPtr)->flags & ~(VAR_SCALAR|VAR_ARRAY)) | VAR_LINK - -#undef TclClearVarUndefined -#define TclClearVarUndefined(varPtr) \ - if (!forwardCompatibleMode) \ - (varPtr)->flags &= ~VAR_UNDEFINED - -#undef Tcl_CallFrame_compiledLocals -#define Tcl_CallFrame_compiledLocals(cf) \ - (forwardCompatibleMode ? \ - (Var *)(((CallFrame85 *)cf)->compiledLocals) : \ - (((CallFrame*)cf)->compiledLocals) \ - ) - -#define getNthVar(varPtr,i) \ - (forwardCompatibleMode ? \ - (Var *)(((Var85 *)varPtr)+(i)) : \ - (((Var *)varPtr)+(i)) \ - ) - -#define valueOfVar(type,varPtr,field) \ - (forwardCompatibleMode ? \ - (type *)(((Var85 *)varPtr)->value.field) : \ - (type *)(((Var *)varPtr)->value.field) \ - ) -#endif - - -#if !FORWARD_COMPATIBLE -# define getNthVar(varPtr,i) (((Var *)varPtr)+(i)) -#endif - - -#define TclIsCompiledLocalArgument(compiledLocalPtr) \ - ((compiledLocalPtr)->flags & VAR_ARGUMENT) -#define TclIsCompiledLocalTemporary(compiledLocalPtr) \ - ((compiledLocalPtr)->flags & VAR_TEMPORARY) - -#if defined(PRE85) && !FORWARD_COMPATIBLE -# define VarHashGetValue(hPtr) (Var *)Tcl_GetHashValue(hPtr) -# define VarHashRefCount(varPtr) (varPtr)->refCount -# define TclIsVarTraced(varPtr) (varPtr->tracePtr != NULL) -# define TclIsVarNamespaceVar(varPtr) ((varPtr)->flags & VAR_NAMESPACE_VAR) -# define varHashTableSize sizeof(TclVarHashTable) -# define valueOfVar(type,varPtr,field) (type *)(varPtr)->value.field -#endif - - -#if defined(PRE85) -/* - * We need NewVar from tclVar.c ... but its not exported - */ -static Var *NewVar84() { - register Var *varPtr; - - varPtr = (Var *) ckalloc(sizeof(Var)); - varPtr->value.objPtr = NULL; - varPtr->name = NULL; - varPtr->nsPtr = NULL; - varPtr->hPtr = NULL; - varPtr->refCount = 0; - varPtr->tracePtr = NULL; - varPtr->searchPtr = NULL; - varPtr->flags = (VAR_SCALAR | VAR_UNDEFINED | VAR_IN_HASHTABLE); - return varPtr; -} - -static Var * -VarHashCreateVar84(TclVarHashTable *tablePtr, Tcl_Obj *key, int *newPtr) { - char *newName = ObjStr(key); - Tcl_HashEntry *hPtr = Tcl_CreateHashEntry(tablePtr, newName, newPtr); - Var *varPtr; - - if (newPtr && *newPtr) { - varPtr = NewVar84(); - Tcl_SetHashValue(hPtr, varPtr); - varPtr->hPtr = hPtr; - varPtr->nsPtr = NULL; /* a local variable */ - } else { - varPtr = (Var *) Tcl_GetHashValue(hPtr); - } - - return varPtr; -} - -static void -InitVarHashTable84(TclVarHashTable *tablePtr, Namespace *nsPtr) { - /* fprintf(stderr,"InitVarHashTable84\n"); */ - Tcl_InitHashTable((tablePtr), TCL_STRING_KEYS); -} - -static void -TclCleanupVar84(Var * varPtr, Var *arrayPtr) { - if (TclIsVarUndefined(varPtr) && (varPtr->refCount == 0) - && (varPtr->tracePtr == NULL) - && (varPtr->flags & VAR_IN_HASHTABLE)) { - if (varPtr->hPtr != NULL) { - Tcl_DeleteHashEntry(varPtr->hPtr); - } - ckfree((char *) varPtr); - } - if (arrayPtr != NULL) { - if (TclIsVarUndefined(arrayPtr) && (arrayPtr->refCount == 0) - && (arrayPtr->tracePtr == NULL) - && (arrayPtr->flags & VAR_IN_HASHTABLE)) { - if (arrayPtr->hPtr != NULL) { - Tcl_DeleteHashEntry(arrayPtr->hPtr); - } - ckfree((char *) arrayPtr); - } - } -} -static Var * -LookupVarFromTable84(TclVarHashTable *varTable, CONST char *simpleName, - XOTclObject *obj) { - Var *varPtr = NULL; - Tcl_HashEntry *entryPtr; - - if (varTable) { - entryPtr = Tcl_FindHashEntry(varTable, simpleName); - if (entryPtr) { - varPtr = VarHashGetValue(entryPtr); - } - } - return varPtr; -} -#endif - - -#if defined(PRE85) -# if FORWARD_COMPATIBLE -# define VarHashCreateVar (*tclVarHashCreateVar) -# define InitVarHashTable (*tclInitVarHashTable) -# define CleanupVar (*tclCleanupVar) -# define LookupVarFromTable (*lookupVarFromTable) -# define TclCallFrame Tcl_CallFrame85 -# else -# define VarHashCreateVar VarHashCreateVar84 -# define InitVarHashTable InitVarHashTable84 -# define CleanupVar TclCleanupVar84 -# define LookupVarFromTable LookupVarFromTable84 -# define TclCallFrame Tcl_CallFrame -# endif -#else -# define VarHashCreateVar VarHashCreateVar85 -# define InitVarHashTable TclInitVarHashTable -# define CleanupVar TclCleanupVar -# define LookupVarFromTable LookupVarFromTable85 -# define TclCallFrame Tcl_CallFrame -#endif - - -#if defined(PRE85) -/* - * for backward compatibility - */ - -#define VarHashTable(t) t -#define TclVarHashTable Tcl_HashTable - -static Var * -XOTclObjLookupVar(Tcl_Interp *interp, Tcl_Obj *part1Ptr, CONST char *part2, - int flags, const char *msg, int createPart1, int createPart2, - Var **arrayPtrPtr) { - - return TclLookupVar(interp, ObjStr(part1Ptr), part2, flags, msg, - createPart1, createPart2, arrayPtrPtr); -} - -#define ObjFindNamespace(interp, objPtr) \ - Tcl_FindNamespace((interp), ObjStr(objPtr), NULL, 0); - -#else - -/* - * definitions for tcl 8.5 - */ - -#define VarHashGetValue(hPtr) \ - ((Var *) ((char *)hPtr - TclOffset(VarInHash, entry))) -#define VarHashGetKey(varPtr) \ - (((VarInHash *)(varPtr))->entry.key.objPtr) -#define VarHashTable(varTable) \ - &(varTable)->table -#define XOTclObjLookupVar TclObjLookupVar -#define varHashTableSize sizeof(TclVarHashTable) -#define valueOfVar(type,varPtr,field) (type *)(varPtr)->value.field - -XOTCLINLINE static Tcl_Namespace * -ObjFindNamespace(Tcl_Interp *interp, Tcl_Obj *objPtr) { - Tcl_Namespace *nsPtr; - - if (TclGetNamespaceFromObj(interp, objPtr, &nsPtr) == TCL_OK) { - return nsPtr; - } else { - return NULL; - } -} -#endif - -#if !defined(PRE85) || FORWARD_COMPATIBLE -static XOTCLINLINE Var * -VarHashCreateVar85(TclVarHashTable *tablePtr, Tcl_Obj *key, int *newPtr) -{ - Var *varPtr = NULL; - Tcl_HashEntry *hPtr; - hPtr = Tcl_CreateHashEntry((Tcl_HashTable *) tablePtr, - (char *) key, newPtr); - if (hPtr) { - varPtr = VarHashGetValue(hPtr); - } - return varPtr; -} - -static XOTCLINLINE Var * -LookupVarFromTable85(TclVarHashTable *tablePtr, CONST char *simpleName, - XOTclObject *obj) { - Var *varPtr = NULL; - if (tablePtr) { - Tcl_Obj *keyPtr = Tcl_NewStringObj(simpleName, -1); - Tcl_IncrRefCount(keyPtr); - varPtr = VarHashCreateVar85(tablePtr, keyPtr, NULL); - Tcl_DecrRefCount(keyPtr); - } - return varPtr; -} -#endif - - - - - -/* - * call an XOTcl method - */ -static int -callMethod(ClientData cd, Tcl_Interp *in, Tcl_Obj *method, - int objc, Tcl_Obj *CONST objv[], int flags) { - XOTclObject *obj = (XOTclObject*) cd; - int result; - ALLOC_ON_STACK(Tcl_Obj*,objc, tov); - - tov[0] = obj->cmdName; - tov[1] = method; - - if (objc>2) - memcpy(tov+2, objv, sizeof(Tcl_Obj *)*(objc-2)); - - /*fprintf(stderr, "%%%% callMethod cmdname=%s, method=%s, objc=%d\n", - ObjStr(tov[0]),ObjStr(tov[1]),objc);*/ - result = DoDispatch(cd, in, objc, tov, flags); - /*fprintf(stderr, " callMethod returns %d\n", result);*/ - FREE_ON_STACK(tov); - return result; -} - -int -XOTclCallMethodWithArgs(ClientData cd, Tcl_Interp *in, Tcl_Obj *method, Tcl_Obj *arg, - int givenobjc, Tcl_Obj *CONST objv[], int flags) { - XOTclObject *obj = (XOTclObject*) cd; - int objc = givenobjc + 2; - int result; - ALLOC_ON_STACK(Tcl_Obj*,objc, tov); - - assert(objc>1); - tov[0] = obj->cmdName; - tov[1] = method; - if (objc>2) { - tov[2] = arg; - } - if (objc>3) - memcpy(tov+3, objv, sizeof(Tcl_Obj *)*(objc-3)); - - result = DoDispatch(cd, in, objc, tov, flags); - - FREE_ON_STACK(tov); - return result; -} - -/* - * realize self, class, proc through the [self] command - */ - -XOTCLINLINE static CONST84 char * -GetSelfProc(Tcl_Interp *in) { - /*return Tcl_GetCommandName(in, RUNTIME_STATE(in)->cs.top->cmdPtr);*/ - return Tcl_GetCommandName(in, CallStackGetFrame(in)->cmdPtr); - -} - -XOTCLINLINE static XOTclClass* -GetSelfClass(Tcl_Interp *in) { - /*return RUNTIME_STATE(in)->cs.top->cl;*/ - return CallStackGetFrame(in)->cl; -} - -XOTCLINLINE static XOTclObject* -GetSelfObj(Tcl_Interp *in) { - return CallStackGetFrame(in)->self; -} - -/* extern callable GetSelfObj */ -XOTcl_Object* -XOTclGetSelfObj(Tcl_Interp *in) { - return (XOTcl_Object*)GetSelfObj(in); -} - -XOTCLINLINE static Tcl_Command -GetSelfProcCmdPtr(Tcl_Interp *in) { - /*return RUNTIME_STATE(in)->cs.top->cmdPtr;*/ - return CallStackGetFrame(in)->cmdPtr; -} - -/* - * prints a msg to the screen that oldCmd is deprecated - * optinal: give a new cmd - */ -extern void -XOTclDeprecatedMsg(char *oldCmd, char *newCmd) { - fprintf(stderr, "**\n**\n** The command/method <%s> is deprecated.\n", oldCmd); - if (newCmd) - fprintf(stderr, "** Use <%s> instead.\n", newCmd); - fprintf(stderr, "**\n"); -} - -static int -XOTcl_DeprecatedCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - char *new; - if (objc == 2) - new = 0; - else if (objc == 3) - new = ObjStr(objv[2]); - else - return XOTclObjErrArgCnt(in, NULL, "deprecated oldcmd ?newcmd?"); - XOTclDeprecatedMsg(ObjStr(objv[1]), new); - return TCL_OK; -} -#ifdef DISPATCH_TRACE -static void printObjv(int objc, Tcl_Obj *CONST objv[]) { - int i, j; - if (objc <= 3) j = objc; else j = 3; - for (i=0;i 3) fprintf(stderr," ..."); - fprintf(stderr," (objc=%d)",objc); -} - -static void printCall(Tcl_Interp *in, char *string, int objc, Tcl_Obj *CONST objv[]) { - fprintf(stderr, " (%d) >%s: ", Tcl_Interp_numLevels(in), string); - printObjv(objc, objv); - fprintf(stderr, "\n"); -} -static void printExit(Tcl_Interp *in, char *string, - int objc, Tcl_Obj *CONST objv[], int result) { - fprintf(stderr, " (%d) <%s: ", Tcl_Interp_numLevels(in), string); - /*printObjv(objc, objv);*/ - fprintf(stderr, " result=%d\n", result); -} -#endif - - -/* - * XOTclObject Reference Accounting - */ -#if defined(XOTCLOBJ_TRACE) -# define XOTclObjectRefCountIncr(obj) \ - obj->refCount++; \ - fprintf(stderr, "RefCountIncr %p count=%d %s\n", obj, obj->refCount,obj->cmdName?ObjStr(obj->cmdName):"no name"); \ - MEM_COUNT_ALLOC("XOTclObject RefCount",obj) -# define XOTclObjectRefCountDecr(obj) \ - obj->refCount--; \ - fprintf(stderr, "RefCountDecr %p count=%d\n", obj, obj->refCount); \ - MEM_COUNT_FREE("XOTclObject RefCount", obj) -#else -# define XOTclObjectRefCountIncr(obj) \ - obj->refCount++; \ - MEM_COUNT_ALLOC("XOTclObject RefCount",obj) -# define XOTclObjectRefCountDecr(obj) \ - obj->refCount--; \ - MEM_COUNT_FREE("XOTclObject RefCount",obj) -#endif - -#if defined(XOTCLOBJ_TRACE) -void objTrace(char *string, XOTclObject *obj) { - if (obj) - fprintf(stderr,"--- %s tcl %p %s (%d %p) xotcl %p (%d) %s \n", string, - obj->cmdName, obj->cmdName->typePtr ? obj->cmdName->typePtr->name : "NULL", - obj->cmdName->refCount, obj->cmdName->internalRep.twoPtrValue.ptr1, - obj, obj->refCount, ObjStr(obj->cmdName)); - else - fprintf(stderr,"--- No object: %s\n",string); -} -#else -# define objTrace(a,b) -#endif - - -/* search for tail of name */ -static char * -NSTail(char *string) { - register char *p = string+strlen(string); - while (p > string) { - if (*p == ':' && *(p-1) == ':') return p+1; - p--; - } - return string; -} - -XOTCLINLINE static int -isClassName(char *string) { - return (strncmp((string), "::xotcl::classes", 16) == 0); -} - -/* removes preceding ::xotcl::classes from a string */ -XOTCLINLINE static char * -NSCutXOTclClasses(char *string) { - assert(strncmp((string), "::xotcl::classes", 16) == 0); - return string+16; -} - -XOTCLINLINE static char * -NSCmdFullName(Tcl_Command cmd) { - Tcl_Namespace *nsPtr = Tcl_Command_nsPtr(cmd); - return nsPtr ? nsPtr->fullName : ""; -} - -static void -XOTclCleanupObject(XOTclObject *obj) { - XOTclObjectRefCountDecr(obj); -#if REFCOUNT_TRACE - fprintf(stderr,"###CLNO %p refcount = %d\n", obj, obj->refCount); -#endif - if (obj->refCount <= 0) { - assert(obj->refCount == 0); - assert(obj->flags & XOTCL_DESTROYED); -#if REFCOUNT_TRACE - fprintf(stderr,"###CLNO %p flags %x rc %d destr %d dc %d\n", - obj, obj->flags, - (obj->flags & XOTCL_REFCOUNTED) != 0, - (obj->flags & XOTCL_DESTROYED) != 0, - (obj->flags & XOTCL_DESTROY_CALLED) != 0 - ); -#endif - - MEM_COUNT_FREE("XOTclObject/XOTclClass",obj); -#if defined(XOTCLOBJ_TRACE) || defined(REFCOUNT_TRACE) - fprintf(stderr, "CKFREE Object %p refcount=%d\n", obj, obj->refCount); -#endif -#if !defined(NDEBUG) - memset(obj, 0, sizeof(XOTclObject)); -#endif - /* fprintf(stderr,"CKFREE obj %p\n",obj);*/ - ckfree((char *) obj); - } -} - - - -/* - * Tcl_Obj functions for objects - */ -static void -RegisterObjTypes() { - Tcl_RegisterObjType(&XOTclObjectType); -} - -static void -FreeXOTclObjectInternalRep(register Tcl_Obj *objPtr) { - XOTclObject *obj = (XOTclObject*) objPtr->internalRep.otherValuePtr; - - /* fprintf(stderr,"FIP objPtr %p obj %p obj->cmd %p '%s', bytes='%s'\n", - objPtr,obj, obj->cmdName, ObjStr(obj->cmdName), objPtr->bytes); - */ -#if defined(XOTCLOBJ_TRACE) - if (obj) - fprintf(stderr,"FIP --- tcl %p (%d)\n",objPtr,objPtr->refCount); -#endif - -#if !defined(REFCOUNTED) - if (obj != NULL) { - XOTclCleanupObject(obj); - } -#else - if (obj != NULL) { -#if REFCOUNT_TRACE - fprintf(stderr, "FIP in %p\n", obj->teardown); - fprintf(stderr, "FIP call is destroy %d\n", RUNTIME_STATE(obj->teardown)->callIsDestroy); - fprintf(stderr,"FIP %p flags %x rc %d destr %d dc %d refcount = %d\n", - obj, obj->flags, - (obj->flags & XOTCL_REFCOUNTED) != 0, - (obj->flags & XOTCL_DESTROYED) != 0, - (obj->flags & XOTCL_DESTROY_CALLED) != 0, - obj->refCount - ); -#endif - if (obj->flags & XOTCL_REFCOUNTED && - !(obj->flags & XOTCL_DESTROY_CALLED)) { - Tcl_Interp *in = obj->teardown; - INCR_REF_COUNT(obj->cmdName); - callDestroyMethod((ClientData)obj, in, obj, 0); - /* the call to cleanup is the counterpart of the - INCR_REF_COUNT(obj->cmdName) above */ - XOTclCleanupObject(obj); - } else { - fprintf(stderr, "BEFORE CLEANUPOBJ %x\n", (obj->flags & XOTCL_REFCOUNTED)); - XOTclCleanupObject(obj); - fprintf(stderr, "AFTER CLEANUPOBJ\n"); - } - } -#endif - objPtr->internalRep.otherValuePtr = NULL; - objPtr->typePtr = NULL; -} - -static void -DupXOTclObjectInternalRep(Tcl_Obj *src, Tcl_Obj *cpy) { - XOTclObject *obj = (XOTclObject*)src->internalRep.otherValuePtr; -#if defined(XOTCLOBJ_TRACE) - if (obj) fprintf(stderr,"DIP --- tcl %p (%d)\n", src, src->refCount); -#endif - XOTclObjectRefCountIncr(obj); - cpy->internalRep.otherValuePtr = src->internalRep.otherValuePtr; - cpy->typePtr = src->typePtr; -} - -static int -SetXOTclObjectFromAny(Tcl_Interp *in, register Tcl_Obj *objPtr) { - Tcl_ObjType *oldTypePtr = objPtr->typePtr; - char *string = ObjStr(objPtr); - XOTclObject *obj; - Tcl_Obj *tmpName = NULL; - int result = TCL_OK; - -#ifdef XOTCLOBJ_TRACE - fprintf(stderr,"SetXOTclObjectFromAny %p '%s' %p\n", - objPtr,string,objPtr->typePtr); - if (oldTypePtr) - fprintf(stderr," convert %s to XOTclObject\n", oldTypePtr->name); -#endif - - if (!isAbsolutePath(string)) { - char *nsString; - tmpName = NameInNamespaceObj(in,string,callingNameSpace(in)); - - nsString = ObjStr(tmpName); - INCR_REF_COUNT(tmpName); - obj = XOTclpGetObject(in, nsString); - DECR_REF_COUNT(tmpName); - if (!obj) { - /* retry with global namespace */ - tmpName = Tcl_NewStringObj("::",2); - Tcl_AppendToObj(tmpName,string,-1); - INCR_REF_COUNT(tmpName); - obj = XOTclpGetObject(in, ObjStr(tmpName)); - DECR_REF_COUNT(tmpName); - } - } else { - obj = XOTclpGetObject(in, string); - } - -#if 0 - obj = XOTclpGetObject(in, string); -#endif - - if (obj) { - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { -#ifdef XOTCLOBJ_TRACE - fprintf(stderr," freeing type=%p, type=%s\n", - objPtr->typePtr, objPtr->typePtr ? objPtr->typePtr->name : ""); -#endif - oldTypePtr->freeIntRepProc(objPtr); - } - XOTclObjectRefCountIncr(obj); -#if defined(XOTCLOBJ_TRACE) - fprintf(stderr, "SetXOTclObjectFromAny tcl %p (%d) xotcl %p (%d)\n", - objPtr, objPtr->refCount, obj, obj->refCount); -#endif - objPtr->internalRep.otherValuePtr = (XOTclObject*) obj; - objPtr->typePtr = &XOTclObjectType; - } else - result = TCL_ERROR; - - return result; -} - -static void -UpdateStringOfXOTclObject(register Tcl_Obj *objPtr) { - XOTclObject *obj = (XOTclObject *)objPtr->internalRep.otherValuePtr; - char *nsFullName = NULL; - -#ifdef XOTCLOBJ_TRACE - fprintf(stderr,"UpdateStringOfXOTclObject %p refCount %d\n", - objPtr,objPtr->refCount); - fprintf(stderr," teardown %p id %p destroyCalled %d\n", - obj->teardown, obj->id, (obj->flags & XOTCL_DESTROY_CALLED)); -#endif - - /* Here we use GetCommandName, because it doesnt need - Interp*, but Tcl_GetCommandFullName(in,obj->id,ObjName); does*/ - if (obj && !(obj->flags & XOTCL_DESTROY_CALLED)) { - Tcl_DString ds, *dsp = &ds; - unsigned l; - DSTRING_INIT(dsp); - nsFullName = NSCmdFullName(obj->id); - if (!(*nsFullName==':' && *(nsFullName+1)==':' && - *(nsFullName+2)=='\0')) { - Tcl_DStringAppend(dsp, nsFullName, -1); - } - Tcl_DStringAppend(dsp, "::", 2); - Tcl_DStringAppend(dsp, Tcl_GetCommandName(NULL, obj->id), -1); - - l = (unsigned) Tcl_DStringLength(dsp)+1; - objPtr->bytes = (char *) ckalloc(l); - memcpy(objPtr->bytes, Tcl_DStringValue(dsp), l); - objPtr->length = Tcl_DStringLength(dsp); - DSTRING_FREE(dsp); - } else if (obj) { - fprintf(stderr,"try to read string of deleted command\n"); - FreeXOTclObjectInternalRep(objPtr); - objPtr->bytes = NULL; - objPtr->length = 0; - } else { - objPtr->bytes = NULL; - objPtr->length = 0; - } - /* - fprintf(stderr, "+++UpdateStringOfXOTclObject bytes='%s',length=%d\n", - objPtr->bytes,objPtr->length); - */ -} - -#ifdef NOTUSED -static Tcl_Obj * -NewXOTclObjectObj(register XOTclObject *obj) { - register Tcl_Obj *objPtr = 0; - XOTclNewObj(objPtr); - objPtr->bytes = NULL; - objPtr->internalRep.otherValuePtr = obj; - objPtr->typePtr = &XOTclObjectType; -#ifdef XOTCLOBJ_TRACE - fprintf(stderr,"NewXOTclObjectObj %p\n",objPtr); -#endif - return objPtr; -} -#endif - -static Tcl_Obj * -NewXOTclObjectObjName(register XOTclObject *obj, char *name, unsigned l) -{ - register Tcl_Obj *objPtr = 0; - - XOTclNewObj(objPtr); - - objPtr->length = l; - objPtr->bytes = ckalloc(l+1); - memcpy(objPtr->bytes, name, l); - *(objPtr->bytes+l) = 0; - objPtr->internalRep.otherValuePtr = obj; - objPtr->typePtr = &XOTclObjectType; - -#ifdef XOTCLOBJ_TRACE - fprintf(stderr,"NewXOTclObjectObjName tcl %p (%d) xotcl %p (%d) %s\n", - objPtr, objPtr->refCount, obj, obj->refCount, objPtr->bytes); -#endif - XOTclObjectRefCountIncr(obj); - - return objPtr; -} - -#ifdef KEEP_TCL_CMD_TYPE -XOTCLINLINE static Tcl_ObjType * -GetCmdNameType(Tcl_ObjType *cmdType) { - static Tcl_ObjType *tclCmdNameType = NULL; - - if (tclCmdNameType == NULL) { -# if defined(PRE82) - if (cmdType - && cmdType != &XOTclObjectType - && !strcmp(cmdType->name,"cmdName")) { - tclCmdNameType = cmdType; - } -# else - static XOTclMutex initMutex = 0; - XOTclMutexLock(&initMutex); - if (tclCmdNameType == NULL) - tclCmdNameType = Tcl_GetObjType("cmdName"); - XOTclMutexUnlock(&initMutex); -# endif - } - return tclCmdNameType; -} -#endif - -#if NOTUSED -static int -XOTclObjGetObject(Tcl_Interp *in, register Tcl_Obj *objPtr, XOTclObject **obj) { - int result; - register Tcl_ObjType *cmdType = objPtr->typePtr; - XOTclObject *o; - - if (cmdType == &XOTclObjectType) { - o = (XOTclObject*) objPtr->internalRep.otherValuePtr; - if (!(o->flags & XOTCL_DESTROYED)) { - *obj = o; - return TCL_OK; - } - } - - if (cmdType == GetCmdNameType(cmdType)) { - Tcl_Command cmd = Tcl_GetCommandFromObj(in, objPtr); - /*fprintf(stderr,"obj is of type tclCmd\n");*/ - if (cmd) { - o = XOTclGetObjectFromCmdPtr(cmd); - if (o) { - *obj = o; - return TCL_OK; - } - } - } - - o = XOTclpGetObject(in, ObjStr(objPtr)); - if (o) { - *obj = o; - return TCL_OK; - } - return TCL_ERROR; -} -#endif - -static int -XOTclObjConvertObject(Tcl_Interp *in, Tcl_Obj *objPtr, XOTclObject **obj) { - int result; - register Tcl_ObjType *cmdType = objPtr->typePtr; - - /* - * Only really share the "::x" Tcl_Objs but not "x" because we so not have - * references upon object kills and then will get dangling - * internalRep references to killed XOTclObjects - */ - if (cmdType == &XOTclObjectType) { - /*fprintf(stderr,"obj is of type XOTclObjectType\n");*/ - if (obj) { - XOTclObject *o = (XOTclObject*) objPtr->internalRep.otherValuePtr; - int refetch = 0; - if (o->flags & XOTCL_DESTROYED) { - /* fprintf(stderr,"????? calling free by hand\n"); */ - FreeXOTclObjectInternalRep(objPtr); - refetch = 1; - result = SetXOTclObjectFromAny(in, objPtr); - if (result == TCL_OK) { - o = (XOTclObject*) objPtr->internalRep.otherValuePtr; - assert(o && !(o->flags & XOTCL_DESTROYED)); - } - } else { - result = TCL_OK; - } - - *obj = o; - -#ifdef XOTCLOBJ_TRACE - if (result == TCL_OK) - fprintf(stderr,"XOTclObjConvertObject tcl %p (%d) xotcl %p (%d) r=%d %s\n", - objPtr, objPtr->refCount, o, o->refCount, refetch, objPtr->bytes); - else - fprintf(stderr,"XOTclObjConvertObject tcl %p (%d) **** rc=%d r=%d %s\n", - objPtr, objPtr->refCount, result, refetch, objPtr->bytes); -#endif - } else { - result = TCL_OK; - } -#ifdef KEEP_TCL_CMD_TYPE - } else if (cmdType == GetCmdNameType(cmdType)) { - Tcl_Command cmd = Tcl_GetCommandFromObj(in, objPtr); - /*fprintf(stderr,"obj %s is of type tclCmd, cmd=%p\n",ObjStr(objPtr),cmd);*/ - if (cmd) { - XOTclObject *o = XOTclGetObjectFromCmdPtr(cmd); - /* - fprintf(stderr,"Got Object from '%s' %p\n",objPtr->bytes,o); - fprintf(stderr,"cmd->objProc %p == %p, proc=%p\n", - Tcl_Command_objProc(cmd), XOTclObjDispatch, - Tcl_Command_proc(cmd) ); - */ - if (o) { - if (obj) *obj = o; - result = TCL_OK; - } else { - goto convert_to_xotcl_object; - } - } else goto convert_to_xotcl_object; -#endif - } else { -#ifdef KEEP_TCL_CMD_TYPE - convert_to_xotcl_object: -#endif - result = SetXOTclObjectFromAny(in, objPtr); - if (result == TCL_OK && obj) { - *obj = (XOTclObject*) objPtr->internalRep.otherValuePtr; - } - } - return result; -} - -#ifndef NAMESPACEINSTPROCS -static Tcl_Namespace * -GetCallerVarFrame(Tcl_Interp *in, Tcl_CallFrame *varFramePtr) { - Tcl_Namespace *nsPtr = NULL; - if (varFramePtr) { - Tcl_CallFrame *callerVarPtr = Tcl_CallFrame_callerVarPtr(varFramePtr); - if (callerVarPtr) { - nsPtr = (Tcl_Namespace *)callerVarPtr->nsPtr; - } - } - if (nsPtr == NULL) - nsPtr = Tcl_Interp_globalNsPtr(in); - - return nsPtr; -} -#endif - -static Tcl_Obj* -NameInNamespaceObj(Tcl_Interp *in, char *name, Tcl_Namespace *ns) { - Tcl_Obj *objName; - int len; - char *p; - - /*fprintf(stderr,"NameInNamespaceObj %s (%p) ",name,ns);*/ - if (!ns) - ns = Tcl_GetCurrentNamespace(in); - objName = Tcl_NewStringObj(ns->fullName,-1); - len = Tcl_GetCharLength(objName); - p = ObjStr(objName); - if (len == 2 && p[0] == ':' && p[1] == ':') { - } else { - Tcl_AppendToObj(objName,"::",2); - } - Tcl_AppendToObj(objName, name, -1); - - /*fprintf(stderr,"returns %s\n",ObjStr(objName));*/ - return objName; -} - - - -static int -GetXOTclClassFromObj(Tcl_Interp *in, register Tcl_Obj *objPtr, - XOTclClass **cl, int retry) { - XOTclObject *obj; - XOTclClass *cls = NULL; - int result = TCL_OK; - char *objName = ObjStr(objPtr); - - /*fprintf(stderr, "GetXOTclClassFromObj %s retry %d\n", objName, retry);*/ - - if (retry) { - /* we refer to an existing object; use command resolver */ - if (!isAbsolutePath(objName)) { - Tcl_Command cmd = NSFindCommand(in, objName, callingNameSpace(in)); - - /*fprintf(stderr, "GetXOTclClassFromObj %s cmd = %p cl=%p retry=%d\n", - objName, cmd, cmd ? XOTclGetClassFromCmdPtr(cmd) : NULL, retry);*/ - if (cmd) { - cls = XOTclGetClassFromCmdPtr(cmd); - if (cl) *cl = cls; - } - } - } - - if (!cls) { - result = XOTclObjConvertObject(in, objPtr, &obj); - if (result == TCL_OK) { - cls = XOTclObjectToClass(obj); - if (cls) { - if (cl) *cl = cls; - } else { - /* we have an object, but no class */ - result = TCL_ERROR; - } - } - } - - if (!cls && retry) { - Tcl_Obj *ov[3]; - ov[0] = RUNTIME_STATE(in)->theClass->object.cmdName; - ov[1] = XOTclGlobalObjects[XOTE___UNKNOWN]; - if (isAbsolutePath(objName)) { - ov[2] = objPtr; - } else { - ov[2] = NameInNamespaceObj(in,objName,callingNameSpace(in)); - } - INCR_REF_COUNT(ov[2]); - /*fprintf(stderr,"+++ calling %s __unknown for %s, objPtr=%s\n", - ObjStr(ov[0]), ObjStr(ov[2]), ObjStr(objPtr)); */ - - result = Tcl_EvalObjv(in, 3, ov, 0); - if (result == TCL_OK) { - result = GetXOTclClassFromObj(in, objPtr, cl, 0); - } - DECR_REF_COUNT(ov[2]); - } - - /*fprintf(stderr, "GetXOTclClassFromObj %s returns %d cls = %p *cl = %p\n", - objName, result, cls, cl?*cl:NULL);*/ - return result; -} - -extern void -XOTclFreeClasses(XOTclClasses* sl) { - XOTclClasses *n; - for (; sl; sl = n) { - n = sl->next; - FREE(XOTclClasses,sl); - } -} - -extern XOTclClasses** -XOTclAddClass(XOTclClasses **cList, XOTclClass *cl, ClientData cd) { - XOTclClasses *l = *cList, *element = NEW(XOTclClasses); - element->cl = cl; - element->clientData = cd; - element->next = NULL; - if (l) { - while (l->next) l = l->next; - l->next = element; - } else - *cList = element; - return &(element->next); -} - -/* - * precedence ordering functions - */ - -enum colors { WHITE, GRAY, BLACK }; - -static XOTclClasses* Super(XOTclClass *cl) { return cl->super; } -static XOTclClasses* Sub(XOTclClass *cl) { return cl->sub; } - - -static int -TopoSort(XOTclClass *cl, XOTclClass *base, XOTclClasses* (*next)(XOTclClass*)) { - /*XOTclClasses* sl = (*next)(cl);*/ - XOTclClasses* sl = next == Super ? cl->super : cl->sub; - XOTclClasses* pl; - - /* - * careful to reset the color of unreported classes to - * white in case we unwind with error, and on final exit - * reset color of reported classes to white - */ - - cl->color = GRAY; - for (; sl != 0; sl = sl->next) { - XOTclClass *sc = sl->cl; - if (sc->color == GRAY) { cl->color = WHITE; return 0; } - if (sc->color == WHITE && !TopoSort(sc, base, next)) { - cl->color = WHITE; - if (cl == base) { - XOTclClasses* pc = cl->order; - while (pc != 0) { pc->cl->color = WHITE; pc = pc->next; } - } - return 0; - } - } - cl->color = BLACK; - pl = NEW(XOTclClasses); - pl->cl = cl; - pl->next = base->order; - base->order = pl; - if (cl == base) { - XOTclClasses* pc = cl->order; - while (pc != 0) { pc->cl->color = WHITE; pc = pc->next; } - } - return 1; -} - -static XOTclClasses* -TopoOrder(XOTclClass *cl, XOTclClasses* (*next)(XOTclClass*)) { - if (TopoSort(cl, cl, next)) - return cl->order; - XOTclFreeClasses(cl->order); - cl->order = 0; - return 0; -} - -static XOTclClasses* -ComputeOrder(XOTclClass *cl, XOTclClasses *order, XOTclClasses* (*direction)(XOTclClass*)) { - if (order) - return order; - return (cl->order = TopoOrder(cl, direction)); -} - -extern XOTclClasses* -XOTclComputePrecedence(XOTclClass *cl) { - return ComputeOrder(cl, cl->order, Super); -} - -extern XOTclClasses* -XOTclComputeDependents(XOTclClass *cl) { - return ComputeOrder(cl, cl->order, Sub); -} - - -static void -FlushPrecedences(XOTclClass *cl) { - XOTclClasses* pc; - XOTclFreeClasses(cl->order); - cl->order = 0; - pc = ComputeOrder(cl, cl->order, Sub); - - /* - * ordering doesn't matter here - we're just using toposort - * to find all lower classes so we can flush their caches - */ - - if (pc) pc = pc->next; - for (; pc; pc = pc->next) { - XOTclFreeClasses(pc->cl->order); - pc->cl->order = 0; - } - XOTclFreeClasses(cl->order); - cl->order = 0; -} - -static void -AddInstance(XOTclObject *obj, XOTclClass *cl) { - obj->cl = cl; - if (cl != 0) { - int nw; - (void) Tcl_CreateHashEntry(&cl->instances, (char *)obj, &nw); - } -} - -static int -RemoveInstance(XOTclObject *obj, XOTclClass *cl) { - if (cl) { - Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&cl->instances, (char *)obj); - if (hPtr) { - Tcl_DeleteHashEntry(hPtr); - return 1; - } - } - return 0; -} - -/* - * superclass/subclass list maintenance - */ - -static void -AS(XOTclClass *cl, XOTclClass *s, XOTclClasses **sl) { - register XOTclClasses* l = *sl; - while (l && l->cl != s) l = l->next; - if (!l) { - XOTclClasses* sc = NEW(XOTclClasses); - sc->cl = s; - sc->next = *sl; - *sl = sc; - } -} - -static void -AddSuper(XOTclClass *cl, XOTclClass *super) { - if (cl && super) { - /* - * keep corresponding sub in step with super - */ - AS(cl, super, &cl->super); - AS(super, cl, &super->sub); - } -} - -static int -RemoveSuper1(XOTclClass *cl, XOTclClass *s, XOTclClasses **sl) { - XOTclClasses* l = *sl; - if (!l) return 0; - if (l->cl == s) { - *sl = l->next; - FREE(XOTclClasses,l); - return 1; - } - while (l->next && l->next->cl != s) l = l->next; - if (l->next) { - XOTclClasses* n = l->next->next; - FREE(XOTclClasses,l->next); - l->next = n; - return 1; - } - return 0; -} - -static int -RemoveSuper(XOTclClass *cl, XOTclClass *super) { - /* - * keep corresponding sub in step with super - */ - int sp = RemoveSuper1(cl, super, &cl->super); - int sb = RemoveSuper1(super, cl, &super->sub); - - return sp && sb; -} - -/* - * internal type checking - */ - -extern XOTcl_Class* -XOTclIsClass(Tcl_Interp *in, ClientData cd) { - if (cd && XOTclObjectIsClass((XOTclObject *)cd)) - return (XOTcl_Class*) cd; - return 0; -} - -/* - * methods lookup - */ -/*XOTCLINLINE*/ -static Tcl_Command -FindMethod(char *methodName, Tcl_Namespace* nsPtr) { - Tcl_HashEntry *entryPtr; -#if 0 - Tcl_HashTable *cmdTable; - /* if somebody messes around with the deleteProc, we conclude that the - entries of the cmdTable are not ours ... */ - cmdTable = Tcl_Namespace_deleteProc(nsPtr) ? Tcl_Namespace_cmdTable(nsPtr) : NULL ; - if (cmdTable== NULL) { - fprintf(stderr,"********************** FindMethod %s cmdTable = %p\n",methodName, cmdTable); - } - /*fprintf(stderr,"FindMethod '%s', cmdTable %p ns=%p \n",methodName,cmdTable,nsPtr);*/ - - if (cmdTable && (entryPtr = Tcl_FindHashEntry(cmdTable, methodName))) { - return (Tcl_Command) Tcl_GetHashValue(entryPtr); - } - /*fprintf(stderr, "find %s in %p returns %p\n",methodName,cmdTable,cmd);*/ - return NULL; -#endif - if ((entryPtr = Tcl_FindHashEntry(Tcl_Namespace_cmdTable(nsPtr), methodName))) { - return (Tcl_Command) Tcl_GetHashValue(entryPtr); - } - /*fprintf(stderr, "find %s in %p returns %p\n",methodName,cmdTable,cmd);*/ - return NULL; -} - -static XOTclClass* -SearchPLMethod(register XOTclClasses* pl, char *nm, Tcl_Command *cmd) { - /* Search the class hierarchy */ - for (; pl; pl = pl->next) { - Tcl_Command pi = FindMethod(nm, pl->cl->nsPtr); - if (pi) { - *cmd = pi; - return pl->cl; - } - } - return NULL; -} - - -static XOTclClass* -SearchCMethod(XOTclClass *cl, char *nm, Tcl_Command *cmd) { - assert(cl); - return SearchPLMethod(ComputeOrder(cl, cl->order, Super), nm, cmd); -} - -static int -callDestroyMethod(ClientData cd, Tcl_Interp *in, XOTclObject *obj, int flags) { - int result; - - /* don't call destroy after exit handler started physical - destruction */ - if (RUNTIME_STATE(in)->exitHandlerDestroyRound == - XOTCL_EXITHANDLER_ON_PHYSICAL_DESTROY) - return TCL_OK; - - /* fprintf(stderr," obj %p flags %.4x %d\n",obj, obj->flags, - RUNTIME_STATE(in)->callDestroy);*/ - /* we don't call destroy, if we're in the exit handler - during destruction of Object and Class */ - if (!RUNTIME_STATE(in)->callDestroy) { - obj->flags |= XOTCL_DESTROY_CALLED; - /* return TCL_ERROR so that clients know we haven't deleted the - associated command yet */ - return TCL_ERROR; - } - /*fprintf(stderr, "+++ calldestroy flags=%d\n",flags);*/ - if (obj->flags & XOTCL_DESTROY_CALLED) - return TCL_OK; - -#if !defined(NDEBUG) - {char *cmdName = ObjStr(obj->cmdName); - assert(cmdName != NULL); - /*fprintf(stderr,"findCommand %s -> %p obj->id %p\n",cmdName, - Tcl_FindCommand(in, cmdName, NULL, 0),obj->id);*/ - /*assert(Tcl_FindCommand(in, cmdName, NULL, 0) != NULL);*/ - /*fprintf(stderr,"callDestroyMethod: %p command to be destroyed '%s' does not exist\n", - obj, cmdName);*/ - } -#endif - - -#ifdef OBJDELETION_TRACE - fprintf(stderr, " command found\n"); - PRINTOBJ("callDestroy", obj); -#endif - result = callMethod(cd, in, XOTclGlobalObjects[XOTE_DESTROY], 2, 0, flags); - if (result != TCL_OK) { - static char cmd[] = - "puts stderr \"[self]: Error in instproc destroy\n\ - $::errorCode $::errorInfo\""; - Tcl_EvalEx(in, cmd, -1, 0); - if (++RUNTIME_STATE(in)->errorCount > 20) - panic("too many destroy errors occured. Endless loop?", NULL); - } else { - if (RUNTIME_STATE(in)->errorCount > 0) - RUNTIME_STATE(in)->errorCount--; - } - -#ifdef OBJDELETION_TRACE - fprintf(stderr, "callDestroyMethod for %p exit\n", obj); -#endif - return result; -} - -/* - * conditional memory allocations of optional storage - */ - -extern XOTclObjectOpt * -XOTclRequireObjectOpt(XOTclObject *obj) { - if (!obj->opt) { - obj->opt = NEW(XOTclObjectOpt); - memset(obj->opt, 0, sizeof(XOTclObjectOpt)); - } - return obj->opt; -} - -extern XOTclClassOpt* -XOTclRequireClassOpt(XOTclClass *cl) { - assert(cl); - if (!cl->opt) { - cl->opt = NEW(XOTclClassOpt); - memset(cl->opt, 0, sizeof(XOTclClassOpt)); - } - return cl->opt; -} - - - - -static Tcl_Namespace* -NSGetFreshNamespace(Tcl_Interp *in, ClientData cd, char *name); - -static void -makeObjNamespace(Tcl_Interp *in, XOTclObject *obj) { -#ifdef NAMESPACE_TRACE - fprintf(stderr, "+++ Make Namespace for %s\n", ObjStr(obj->cmdName)); -#endif - if (!obj->nsPtr) { - Tcl_Namespace* nsPtr; - char *cmdName = ObjStr(obj->cmdName); - obj->nsPtr = NSGetFreshNamespace(in, (ClientData)obj, cmdName); - if (!obj->nsPtr) - panic("makeObjNamespace: Unable to make namespace",0); - nsPtr = obj->nsPtr; - - /* - * Copy all obj variables to the newly created namespace - */ - - if (obj->varTable) { - Tcl_HashSearch search; - Tcl_HashEntry *hPtr; - TclVarHashTable *varTable = Tcl_Namespace_varTable(nsPtr); - Tcl_HashTable *varHashTable = VarHashTable(varTable); - Tcl_HashTable *objHashTable = VarHashTable(obj->varTable); - - *varHashTable = *objHashTable; /* copy the table */ - - if (objHashTable->buckets == objHashTable->staticBuckets) { - varHashTable->buckets = varHashTable->staticBuckets; - } - for (hPtr = Tcl_FirstHashEntry(varHashTable, &search); hPtr != NULL; - hPtr = Tcl_NextHashEntry(&search)) { -#if defined(PRE85) - Var *varPtr; -# if FORWARD_COMPATIBLE - if (!forwardCompatibleMode) { - varPtr = (Var *) Tcl_GetHashValue(hPtr); - varPtr->nsPtr = (Namespace *)nsPtr; - } -# else - varPtr = (Var *) Tcl_GetHashValue(hPtr); - varPtr->nsPtr = (Namespace *)nsPtr; -# endif -#endif - hPtr->tablePtr = varHashTable; - } - - ckfree((char *) obj->varTable); - obj->varTable = 0; - } - } -} -/* - typedef int (Tcl_ResolveVarProc) _ANSI_ARGS_(( - * Tcl_Interp* in, CONST char * name, Tcl_Namespace *context, - * int flags, Tcl_Var *rPtr)); - */ -int -varResolver(Tcl_Interp *in, CONST char *name, Tcl_Namespace *ns, int flags, Tcl_Var *varPtr) { - *varPtr = (Tcl_Var)LookupVarFromTable(Tcl_Namespace_varTable(ns), name,NULL); - /*fprintf(stderr,"lookup '%s' successful %d\n",name, *varPtr != NULL);*/ - return *varPtr ? TCL_OK : TCL_ERROR; -} - - -static void -requireObjNamespace(Tcl_Interp *in, XOTclObject *obj) { - if (!obj->nsPtr) makeObjNamespace(in,obj); - /* - Tcl_SetNamespaceResolvers(obj->nsPtr, (Tcl_ResolveCmdProc*)NULL, - varResolver, (Tcl_ResolveCompiledVarProc*)NULL); - */ - -} -extern void -XOTclRequireObjNamespace(Tcl_Interp *in, XOTcl_Object *obj) { - requireObjNamespace(in,(XOTclObject*) obj); -} - - -/* - * Namespace related commands - */ - -static int -NSDeleteCmd(Tcl_Interp *in, Tcl_Namespace* ns, char *name) { - /* a simple deletion would delete a global command with - the same name, if the command is not existing, so - we use the CmdToken */ - Tcl_Command token; - assert(ns); - if ((token = FindMethod(name, ns))) { - return Tcl_DeleteCommandFromToken(in, token); - } - return -1; -} - -static void -CallStackDestroyObject(Tcl_Interp *in, XOTclObject *obj); -static void -PrimitiveCDestroy(ClientData cd); -static void -PrimitiveODestroy(ClientData cd); - -static void -NSDeleteChildren(Tcl_Interp *in, Tcl_Namespace* ns) { - Tcl_HashTable *cmdTable = Tcl_Namespace_cmdTable(ns); - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr; - -#ifdef OBJDELETION_TRACE - fprintf(stderr, "NSDeleteChildren %s\n", ns->fullName); -#endif - - Tcl_ForgetImport(in, ns, "*"); /* don't destroy namespace imported objects */ - - for (hPtr = Tcl_FirstHashEntry(cmdTable, &hSrch); hPtr != 0; - hPtr = Tcl_NextHashEntry(&hSrch)) { - Tcl_Command cmd = (Tcl_Command)Tcl_GetHashValue(hPtr); - if (!Tcl_Command_cmdEpoch(cmd)) { - char *oname = Tcl_GetHashKey(cmdTable, hPtr); - Tcl_DString name; - XOTclObject *obj; - /* fprintf(stderr, " ... child %s\n", oname); */ - - ALLOC_NAME_NS(&name, ns->fullName, oname); - obj = XOTclpGetObject(in, Tcl_DStringValue(&name)); - - if (obj) { - /* fprintf(stderr, " ... obj= %s\n", ObjStr(obj->cmdName));*/ - - /* in the exit handler physical destroy --> directly call destroy */ - if (RUNTIME_STATE(in)->exitHandlerDestroyRound - == XOTCL_EXITHANDLER_ON_PHYSICAL_DESTROY) { - if (XOTclObjectIsClass(obj)) - PrimitiveCDestroy((ClientData) obj); - else - PrimitiveODestroy((ClientData) obj); - } else { - if (obj->teardown != 0 && obj->id && - !(obj->flags & XOTCL_DESTROY_CALLED)) { - if (callDestroyMethod((ClientData)obj, in, obj, 0) != TCL_OK) { - /* destroy method failed, but we have to remove the command - anyway. */ - obj->flags |= XOTCL_DESTROY_CALLED; - - if (obj->teardown) { - CallStackDestroyObject(in, obj); - } - /*(void*) Tcl_DeleteCommandFromToken(in, oid);*/ - } - } - } - } - DSTRING_FREE(&name); - } - } -} - -/* - * ensure that a variable exists on object varTable or nsPtr->varTable, - * if necessary create it. Return Var * if successful, otherwise 0 - */ -static Var * -NSRequireVariableOnObj(Tcl_Interp *in, XOTclObject *obj, char *name, int flgs) { - XOTcl_FrameDecls; - Var *varPtr, *arrayPtr; - - XOTcl_PushFrame(in, obj); - varPtr = TclLookupVar(in, name, 0, flgs, "obj vwait", - /*createPart1*/ 1, /*createPart2*/ 0, &arrayPtr); - XOTcl_PopFrame(in, obj); - return varPtr; -} - -/* delete a namespace recursively, but check whether the - namespace is an object or not */ -static void -NSDeleteNamespace(Tcl_Interp *in, Tcl_Namespace* ns) { - Tcl_HashTable *childTable = Tcl_Namespace_childTable(ns); - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr; - - NSDeleteChildren(in, ns); - for (hPtr = Tcl_FirstHashEntry(childTable, &hSrch); hPtr != 0; - hPtr = Tcl_NextHashEntry(&hSrch)) { - Tcl_Namespace *child = ((Tcl_Namespace*)Tcl_GetHashValue(hPtr)); - NSDeleteNamespace(in, child); - } - /* - fprintf(stderr, "NSDeleteNamespace deleting %s\n", ns->fullName); - */ - MEM_COUNT_FREE("TclNamespace",ns); - Tcl_DeleteNamespace(ns); -} - -static int -XOTcl_DeleteCommandFromToken(Tcl_Interp *in, Tcl_Command cmd) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - XOTclCallStackContent *csc = cs->top; - - for (; csc > cs->content; csc--) { - if (csc->cmdPtr == cmd) { - csc->cmdPtr = NULL; - } - } - return Tcl_DeleteCommandFromToken(in, cmd); -} - -/* - * delete all vars & procs in a namespace - */ -static void -NSCleanupNamespace(Tcl_Interp *in, Tcl_Namespace* ns) { - TclVarHashTable *varTable = Tcl_Namespace_varTable(ns); - Tcl_HashTable *cmdTable = Tcl_Namespace_cmdTable(ns); - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr; - Tcl_Command cmd; - /* - * Delete all variables and initialize var table again - * (deleteVars frees the vartable) - */ - TclDeleteVars((Interp *)in, varTable); - InitVarHashTable(varTable, (Namespace *)ns); - - /* - * Delete all user-defined procs in the namespace - */ - for (hPtr = Tcl_FirstHashEntry(cmdTable, &hSrch); hPtr != 0; - hPtr = Tcl_NextHashEntry(&hSrch)) { - cmd = (Tcl_Command) Tcl_GetHashValue(hPtr); - /* objects should not be deleted here to preseve children deletion order*/ - if (!XOTclGetObjectFromCmdPtr(cmd)) { - /*fprintf(stderr,"NSCleanupNamespace deleting %s %p\n", - Tcl_Command_nsPtr(cmd)->fullName, cmd);*/ - XOTcl_DeleteCommandFromToken(in, cmd); - } - } -} - - -static void -NSNamespaceDeleteProc(ClientData clientData) { - /* dummy for ns identification by pointer comparison */ - XOTclObject *obj = (XOTclObject*) clientData; - /*fprintf(stderr,"namespacedeleteproc obj=%p\n",clientData);*/ - if (obj) { - obj->flags |= XOTCL_NS_DESTROYED; - obj->nsPtr = NULL; - } -} - -void -XOTcl_DeleteNamespace(Tcl_Interp *in, Tcl_Namespace *nsPtr) { - int activationCount = 0; - Tcl_CallFrame *f = (Tcl_CallFrame *)Tcl_Interp_framePtr(in); - - /* - fprintf(stderr, " ... correcting ActivationCount for %s was %d ", - nsPtr->fullName, nsp->activationCount); - */ - while (f) { - if (f->nsPtr == nsPtr) - activationCount++; - f = Tcl_CallFrame_callerPtr(f); - } - - Tcl_Namespace_activationCount(nsPtr) = activationCount; - - /* - fprintf(stderr, "to %d. \n", nsp->activationCount); - */ - MEM_COUNT_FREE("TclNamespace",nsPtr); - if (Tcl_Namespace_deleteProc(nsPtr) != NULL) { - /*fprintf(stderr,"calling deteteNamespace\n");*/ - Tcl_DeleteNamespace(nsPtr); - } -} - -static Tcl_Namespace* -NSGetFreshNamespace(Tcl_Interp *in, ClientData cd, char *name) { - Tcl_Namespace *ns = Tcl_FindNamespace(in, name, NULL, 0); - - if (ns) { - if (ns->deleteProc != NULL || ns->clientData != NULL) { - panic("Namespace '%s' exists already with delProc %p and clientData %p; Can only convert a plain Tcl namespace into an XOTcl namespace", - name, ns->deleteProc, ns->clientData); - } - ns->clientData = cd; - ns->deleteProc = (Tcl_NamespaceDeleteProc*) NSNamespaceDeleteProc; - } else { - ns = Tcl_CreateNamespace(in, name, cd, - (Tcl_NamespaceDeleteProc*) NSNamespaceDeleteProc); - } - MEM_COUNT_ALLOC("TclNamespace",ns); - return ns; -} - - -/* - * check colons for illegal object/class names - */ -XOTCLINLINE static int -NSCheckColons(char *name, unsigned l) { - register char *n = name; - if (*n == '\0') return 0; /* empty name */ - if (l==0) l=strlen(name); - if (*(n+l-1) == ':') return 0; /* name ends with : */ - if (*n == ':' && *(n+1) != ':') return 0; /* name begins with single : */ - for (; *n != '\0'; n++) { - if (*n == ':' && *(n+1) == ':' && *(n+2) == ':') - return 0; /* more than 2 colons in series in a name */ - } - return 1; -} - -/* - * check for parent namespace existance (used before commands are created) - */ - -XOTCLINLINE static int -NSCheckForParent(Tcl_Interp *in, char *name, unsigned l) { - register char *n = name+l; - int result = 1; - - /*search for last '::'*/ - while ((*n != ':' || *(n-1) != ':') && n-1 > name) {n--; } - if (*n == ':' && n > name && *(n-1) == ':') {n--;} - - if ((n-name)>0) { - Tcl_DString parentNSName, *dsp = &parentNSName; - char *parentName; - DSTRING_INIT(dsp); - - Tcl_DStringAppend(dsp, name, (n-name)); - parentName = Tcl_DStringValue(dsp); - - if (Tcl_FindNamespace(in, parentName, (Tcl_Namespace *) NULL, TCL_GLOBAL_ONLY) == 0) { - XOTclObject *parentObj = (XOTclObject*) XOTclpGetObject(in, parentName); - if (parentObj) { - /* this is for classes */ - requireObjNamespace(in, parentObj); - } else { - /* call unknown and try again */ - Tcl_Obj *ov[3]; - int rc; - ov[0] = RUNTIME_STATE(in)->theClass->object.cmdName; - ov[1] = XOTclGlobalObjects[XOTE___UNKNOWN]; - ov[2] = Tcl_NewStringObj(parentName,-1); - INCR_REF_COUNT(ov[2]); - /*fprintf(stderr,"+++ parent... calling __unknown for %s\n", ObjStr(ov[2]));*/ - rc = Tcl_EvalObjv(in, 3, ov, 0); - if (rc == TCL_OK) { - XOTclObject *parentObj = (XOTclObject*) XOTclpGetObject(in, parentName); - if (parentObj) { - requireObjNamespace(in, parentObj); - } - result = (Tcl_FindNamespace(in, parentName, - (Tcl_Namespace *) NULL, TCL_GLOBAL_ONLY) != 0); - } else { - result = 0; - } - DECR_REF_COUNT(ov[2]); - } - } else { - XOTclObject *parentObj = (XOTclObject*) XOTclpGetObject(in, parentName); - if (parentObj) { - requireObjNamespace(in, parentObj); - } - } - DSTRING_FREE(dsp); - } - return result; -} - -/* - * Find the "real" command belonging eg. to an XOTcl class or object. - * Do not return cmds produced by Tcl_Import, but the "real" cmd - * to which they point. - */ -XOTCLINLINE static Tcl_Command -NSFindCommand(Tcl_Interp *in, char *name, Tcl_Namespace *ns) { - Tcl_Command cmd; - if ((cmd = Tcl_FindCommand(in, name, ns, 0))) { - Tcl_Command importedCmd; - if ((importedCmd = TclGetOriginalCommand(cmd))) - cmd = importedCmd; - } - return cmd; -} - - - -/* - * C interface routines for manipulating objects and classes - */ - - -extern XOTcl_Object* -XOTclGetObject(Tcl_Interp *in, char *name) { - return (XOTcl_Object*) XOTclpGetObject(in, name); -} - -/* - * Find an object using a char *name - */ -static XOTclObject* -XOTclpGetObject(Tcl_Interp *in, char *name) { - register Tcl_Command cmd; - assert(name); - cmd = NSFindCommand(in, name, NULL); - - /*if (cmd) { - fprintf(stderr,"+++ XOTclGetObject from %s -> objProc=%p, dispatch=%p\n", - name, Tcl_Command_objProc(cmd), XOTclObjDispatch); - }*/ - - if (cmd && Tcl_Command_objProc(cmd) == XOTclObjDispatch) { - return (XOTclObject*)Tcl_Command_objClientData(cmd); - } - return 0; -} - -/* - * Find a class using a char *name - */ - -extern XOTcl_Class* -XOTclGetClass(Tcl_Interp *in, char *name) { - return (XOTcl_Class*)XOTclpGetClass(in, name); -} - -static XOTclClass* -XOTclpGetClass(Tcl_Interp *in, char *name) { - XOTclObject *obj = XOTclpGetObject(in, name); - return (obj && XOTclObjectIsClass(obj)) ? (XOTclClass*)obj : NULL; -} - -void -XOTclAddPMethod(Tcl_Interp *in, XOTcl_Object *obji, char *nm, Tcl_ObjCmdProc* proc, - ClientData cd, Tcl_CmdDeleteProc* dp) { - XOTclObject *obj = (XOTclObject*) obji; - Tcl_DString newCmd, *cptr = &newCmd; - requireObjNamespace(in, obj); - ALLOC_NAME_NS(cptr, obj->nsPtr->fullName, nm); - Tcl_CreateObjCommand(in, Tcl_DStringValue(cptr), proc, cd, dp); - DSTRING_FREE(cptr); -} - -void -XOTclAddIMethod(Tcl_Interp *in, XOTcl_Class *cli, char *nm, - Tcl_ObjCmdProc* proc, ClientData cd, Tcl_CmdDeleteProc* dp) { - XOTclClass *cl = (XOTclClass*) cli; - Tcl_DString newCmd, *cptr = &newCmd; - ALLOC_NAME_NS(cptr, cl->nsPtr->fullName, nm); - Tcl_CreateObjCommand(in, Tcl_DStringValue(cptr), proc, cd, dp); - DSTRING_FREE(cptr); -} - - -/* - * Generic Tcl_Obj List - */ - -static void -TclObjListFreeList(XOTclTclObjList* list) { - XOTclTclObjList* del; - while (list) { - del = list; - list = list->next; - DECR_REF_COUNT(del->content); - FREE(XOTclTclObjList, del); - } -} - -static Tcl_Obj* -TclObjListNewElement(XOTclTclObjList **list, Tcl_Obj *ov) { - XOTclTclObjList* elt = NEW(XOTclTclObjList); - INCR_REF_COUNT(ov); - elt->content = ov; - elt->next = *list; - *list = elt; - return ov; -} - -/* - * Autonaming - */ - -static Tcl_Obj* -AutonameIncr(Tcl_Interp *in, Tcl_Obj *name, XOTclObject *obj, - int instanceOpt, int resetOpt) { - int valueLength, mustCopy = 1, format = 0; - char *valueString, *c; - Tcl_Obj *valueObject, *result = NULL, *savedResult = NULL; -#ifdef PRE83 - int flgs = 0; -#else - int flgs = TCL_LEAVE_ERR_MSG; -#endif - XOTcl_FrameDecls; - - XOTcl_PushFrame(in, obj); - if (obj->nsPtr) - flgs |= TCL_NAMESPACE_ONLY; - - valueObject = Tcl_ObjGetVar2(in, XOTclGlobalObjects[XOTE_AUTONAMES],name, flgs); - if (valueObject != NULL ) { - long autoname_counter; - /* should probably do an overflow check here */ - Tcl_GetLongFromObj(in, valueObject,&autoname_counter); - autoname_counter++; - if (Tcl_IsShared(valueObject)) { - valueObject = Tcl_DuplicateObj(valueObject); - } - Tcl_SetLongObj(valueObject,autoname_counter); - } - Tcl_ObjSetVar2(in, XOTclGlobalObjects[XOTE_AUTONAMES], name, - valueObject, flgs); - - if (resetOpt) { - if (valueObject != NULL) { /* we have an entry */ - Tcl_UnsetVar2(in, XOTclGlobalStrings[XOTE_AUTONAMES], ObjStr(name), flgs); - } - result = XOTclGlobalObjects[XOTE_EMPTY]; - INCR_REF_COUNT(result); - } else { - if (valueObject == NULL) { - valueObject = Tcl_ObjSetVar2(in, XOTclGlobalObjects[XOTE_AUTONAMES], - name, XOTclGlobalObjects[XOTE_ONE], flgs); - } - if (instanceOpt) { - char buffer[1], firstChar, *nextChars; - nextChars = ObjStr(name); - firstChar = *(nextChars ++); - if (isupper((int)firstChar)) { - buffer[0] = tolower((int)firstChar); - result = Tcl_NewStringObj(buffer,1); - INCR_REF_COUNT(result); - Tcl_AppendToObj(result, nextChars, -1); - mustCopy = 0; - } - } - if (mustCopy) { - result = Tcl_DuplicateObj(name); - INCR_REF_COUNT(result); - /* - fprintf(stderr,"*** copy %p %s = %p\n", name,ObjStr(name),result); - */ - } - /* if we find a % in the autoname -> We use Tcl_FormatObjCmd - to let the autoname string be formated, like Tcl "format" - command, with the value. E.g.: - autoname a%06d --> a000000, a000001, a000002, ... - */ - for (c = ObjStr(result); *c != '\0'; c++) { - if (*c == '%') { - if (*(c+1) != '%') { - format = 1; - break; - } else { - /* when we find a %% we format and then append autoname, e.g. - autoname a%% --> a%1, a%2, ... */ - c++; - } - } - } - if (format) { - ALLOC_ON_STACK(Tcl_Obj*,3, ov); - savedResult = Tcl_GetObjResult(in); - INCR_REF_COUNT(savedResult); - ov[0] = XOTclGlobalObjects[XOTE_FORMAT]; - ov[1] = result; - ov[2] = valueObject; - if (Tcl_EvalObjv(in, 3, ov, 0) != TCL_OK) { - XOTcl_PopFrame(in, obj); - DECR_REF_COUNT(savedResult); - FREE_ON_STACK(ov); - return 0; - } - DECR_REF_COUNT(result); - result = Tcl_DuplicateObj(Tcl_GetObjResult(in)); - INCR_REF_COUNT(result); - Tcl_SetObjResult(in, savedResult); - DECR_REF_COUNT(savedResult); - FREE_ON_STACK(ov); - } else { - valueString = Tcl_GetStringFromObj(valueObject,&valueLength); - Tcl_AppendToObj(result, valueString, valueLength); - /*fprintf(stderr,"+++ append to obj done\n");*/ - } - } - - XOTcl_PopFrame(in, obj); - assert((resetOpt && result->refCount>=1) || (result->refCount == 1)); - return result; -} - -/* - * XOTcl CallStack - */ - -XOTclCallStackContent * -XOTclCallStackFindLastInvocation(Tcl_Interp *in, int offset) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - register XOTclCallStackContent *csc = cs->top; - int topLevel = csc->currentFramePtr ? Tcl_CallFrame_level(csc->currentFramePtr) :0; - int deeper = offset; - - /* skip through toplevel inactive filters, do this offset times */ - for (csc=cs->top; csc > cs->content; csc--) { - if ((csc->callType & XOTCL_CSC_CALL_IS_NEXT) || - (csc->frameType & XOTCL_CSC_TYPE_INACTIVE)) - continue; - if (offset) - offset--; - else { - if (!deeper) { - return csc; - } - if (csc->currentFramePtr && Tcl_CallFrame_level(csc->currentFramePtr) < topLevel) { - return csc; - } - } - } - /* for some reasons, we could not find invocation (topLevel, destroy) */ - return NULL; -} - -static XOTclCallStackContent * -CallStackFindActiveFilter(Tcl_Interp *in) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - register XOTclCallStackContent *csc; - - /* search for first active frame and set tcl frame pointers */ - for (csc=cs->top; csc > cs->content; csc --) { - if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) return csc; - } - /* for some reasons, we could not find invocation (topLevel, destroy) */ - return NULL; -} - -XOTclCallStackContent * -XOTclCallStackFindActiveFrame(Tcl_Interp *in, int offset) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - register XOTclCallStackContent *csc; - - /* search for first active frame and set tcl frame pointers */ - for (csc=cs->top-offset; csc > cs->content; csc --) { - if (!(csc->frameType & XOTCL_CSC_TYPE_INACTIVE)) { - /* we found the highest active frame */ - return csc; - } - } - /* we could not find an active frame; called from toplevel? */ - return NULL; -} - -static void -CallStackUseActiveFrames(Tcl_Interp *in, callFrameContext *ctx) { - XOTclCallStackContent *active, *top = RUNTIME_STATE(in)->cs.top; - Tcl_CallFrame *inFramePtr = (Tcl_CallFrame *) Tcl_Interp_varFramePtr(in); - - active = XOTclCallStackFindActiveFrame(in, 0); - /*fprintf(stderr,"active %p, varFrame(in) %p, topVarFrame %p, active->curr %p\n", - active, inFramePtr, top->currentFramePtr, - active? active->currentFramePtr : NULL);*/ - - if (active == top || inFramePtr == NULL || Tcl_CallFrame_level(inFramePtr) == 0) { - /* top frame is a active frame, or we could not find a calling - frame, call frame pointers are fine */ - ctx->framesSaved = 0; - } else if (active == NULL) { - Tcl_CallFrame *cf = inFramePtr; - /*fprintf(stderr,"active == NULL\n"); */ - /* find a proc frame, which is not equal the top level cmd */ - /* XOTclStackDump(in);*/ - for (; cf && Tcl_CallFrame_level(cf); cf = Tcl_CallFrame_callerPtr(cf)) { - if (Tcl_CallFrame_isProcCallFrame(cf) && cf != top->currentFramePtr) - break; - } - ctx->varFramePtr = inFramePtr; - Tcl_Interp_varFramePtr(in) = (CallFrame *) cf; - ctx->framesSaved = 1; - } else { - Tcl_CallFrame *framePtr; - /*fprintf(stderr,"active == deeper active=%p frame %p, active+1 %p frame %p\n", - active, active->currentFramePtr, - active+1, (active+1)->currentFramePtr);*/ - /* search returned a deeper pointer, use stored tcl frame pointers; - If Tcl is mixed with XOTcl it is needed to use instead of - active->currentFrame the callerPtr of the last inactive frame - unless the last inactive is NULL */ - if ((framePtr = (active+1)->currentFramePtr)) - framePtr = Tcl_CallFrame_callerPtr(framePtr); - else - framePtr = active->currentFramePtr; - ctx->varFramePtr = inFramePtr; - Tcl_Interp_varFramePtr(in) = (CallFrame *) framePtr; - ctx->framesSaved = 1; - } -} - -static void -CallStackRestoreSavedFrames(Tcl_Interp *in, callFrameContext *ctx) { - if (ctx->framesSaved) { - Tcl_Interp_varFramePtr(in) = (CallFrame *)ctx->varFramePtr; - /*RUNTIME_STATE(in)->varFramePtr = ctx->varFramePtr;*/ - - } -} - - -XOTCLINLINE static int -CallStackPush(Tcl_Interp *in, XOTclObject *obj, XOTclClass *cl, - Tcl_Command cmd, int objc, Tcl_Obj *CONST objv[], int frameType) { - XOTclCallStack *cs; - register XOTclCallStackContent *csc; - - cs = &RUNTIME_STATE(in)->cs; - if (cs->top >= &cs->content[MAX_NESTING_DEPTH-1]) { - Tcl_SetResult(in, "too many nested calls to Tcl_EvalObj (infinite loop?)", - TCL_STATIC); - return TCL_ERROR; - } - /*fprintf(stderr, "CallStackPush sets self\n");*/ - csc = ++cs->top; - csc->self = obj; - csc->cl = cl; - csc->cmdPtr = cmd; - csc->destroyedCmd = 0; - csc->frameType = frameType; - csc->callType = 0; - csc->currentFramePtr = NULL; /* this will be set by InitProcNSCmd */ - - if (frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) - csc->filterStackEntry = obj->filterStack; - else - csc->filterStackEntry = 0; - - /*fprintf(stderr, "PUSH obj %s, self=%p cmd=%p (%s) id=%p (%s) frame=%p\n", - ObjStr(obj->cmdName), obj, - cmd, (char *) Tcl_GetCommandName(in, cmd), - obj->id, Tcl_GetCommandName(in, obj->id), csc);*/ - - MEM_COUNT_ALLOC("CallStack",NULL); - return TCL_OK; -} - -XOTCLINLINE static void -CallStackDoDestroy(Tcl_Interp *in, XOTclObject *obj) { - Tcl_Command oid; - - PRINTOBJ("CallStackDoDestroy", obj); - oid = obj->id; - obj->id = 0; - if (obj->teardown && oid) { - Tcl_DeleteCommandFromToken(in, oid); - } -} - - -static void -CallStackDestroyObject(Tcl_Interp *in, XOTclObject *obj) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - XOTclCallStackContent *csc; - int countSelfs = 0; - Tcl_Command oid = obj->id; - - for (csc = &cs->content[1]; csc <= cs->top; csc++) { - if (csc->self == obj) { - csc->destroyedCmd = oid; - csc->callType |= XOTCL_CSC_CALL_IS_DESTROY; - /*fprintf(stderr,"setting destroy on frame %p for obj %p\n",csc,obj);*/ - if (csc->destroyedCmd) { - Tcl_Command_refCount(csc->destroyedCmd)++; - MEM_COUNT_ALLOC("command refCount",csc->destroyedCmd); - } - countSelfs++; - } - } - /* if the object is not referenced at the callstack anymore - we have to directly destroy it, because CallStackPop won't - find the object destroy */ - if (countSelfs == 0) { - /*fprintf(stderr,"directdestroy %p\n",obj);*/ - CallStackDoDestroy(in, obj); - } else { - /*fprintf(stderr,"selfcount for %p = %d\n",obj,countSelfs);*/ - /* to prevail the deletion order call delete children now - -> children destructors are called before parent's - destructor */ - if (obj->teardown && obj->nsPtr) { - NSDeleteChildren(in, obj->nsPtr); - } - } -} - -XOTCLINLINE static int -CallStackIsDestroyed(Tcl_Interp *in) { - return (RUNTIME_STATE(in)->cs.top->destroyedCmd == NULL) ? 0 : 1; -} - -XOTCLINLINE static void -CallStackPop(Tcl_Interp *in) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - XOTclCallStackContent *csc; - XOTclCallStackContent *h = cs->top; - - assert(cs->top > cs->content); - csc = cs->top; - - /*fprintf(stderr, "POP frame=%p\n",csc);*/ - - if (csc->destroyedCmd != 0) { - int destroy = 1; - TclCleanupCommand((Command *)csc->destroyedCmd); - MEM_COUNT_FREE("command refCount", csc->destroyedCmd); - /* do not physically destroy, when callstack still contains "self" - entries of the object */ - while (--h > cs->content) { - if (h->self == csc->self) { - destroy = 0; - break; - } - } - if (destroy) { - CallStackDoDestroy(in, csc->self); - } - } - - cs->top--; - MEM_COUNT_FREE("CallStack",NULL); -} - - - -XOTCLINLINE static XOTclCallStackContent* -CallStackGetTopFrame(Tcl_Interp *in) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - return cs->top; -} - -static XOTclCallStackContent* -CallStackGetFrame(Tcl_Interp *in) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - register XOTclCallStackContent *top = cs->top; - Tcl_CallFrame *varFramePtr = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(in); - - /* fprintf(stderr, "Tcl_Interp_framePtr(in) %p != varFramePtr %p && top->currentFramePtr %p\n", Tcl_Interp_framePtr(in), varFramePtr, top->currentFramePtr);*/ - - if (Tcl_Interp_framePtr(in) != varFramePtr && top->currentFramePtr) { - XOTclCallStackContent *bot = cs->content + 1; - /*fprintf(stderr, "uplevel\n");*/ - /* we are in a uplevel */ - while (varFramePtr != top->currentFramePtr && top>bot) { - top--; - } - } - return top; -} - -/* - * cmd list handling - */ - -/* - * Cmd List Add/Remove ... returns the new element - */ -static XOTclCmdList* -CmdListAdd(XOTclCmdList **cList, Tcl_Command c, XOTclClass *clorobj, int noDuplicates) { - XOTclCmdList *l = *cList, *new; - - /* - * check for duplicates, if necessary - */ - if (noDuplicates) { - XOTclCmdList *h = l, **end = NULL; - while (h) { - if (h->cmdPtr == c) - return h; - end = &(h->next); - h = h->next; - } - if (end) { - /* no duplicates, no need to search below, we are at the end of the list */ - cList = end; - l = NULL; - } - } - - /* - * ok, we have no duplicates -> append "new" - * to the end of the list - */ - new = NEW(XOTclCmdList); - new->cmdPtr = c; - Tcl_Command_refCount(new->cmdPtr)++; - MEM_COUNT_ALLOC("command refCount",new->cmdPtr); - new->clientData = NULL; - new->clorobj = clorobj; - new->next = NULL; - - if (l) { - while (l->next) - l = l->next; - l->next = new; - } else - *cList = new; - return new; -} - -static void -CmdListReplaceCmd(XOTclCmdList *replace, Tcl_Command cmd, XOTclClass *clorobj) { - Tcl_Command del = replace->cmdPtr; - replace->cmdPtr = cmd; - replace->clorobj = clorobj; - Tcl_Command_refCount(cmd)++; - MEM_COUNT_ALLOC("command refCount", cmd); - TclCleanupCommand((Command *)del); - MEM_COUNT_FREE("command refCount",cmd); -} - -#if 0 -/** for debug purposes only */ -static void -CmdListPrint(Tcl_Interp *in, char *title, XOTclCmdList *cmdList) { - if (cmdList) - fprintf(stderr,title); - while (cmdList) { - fprintf(stderr, " CL=%p, cmdPtr=%p %s, clorobj %p, clientData=%p\n", - cmdList, - cmdList->cmdPtr, - in ? Tcl_GetCommandName(in, cmdList->cmdPtr) : "", - cmdList->clorobj, - cmdList->clientData); - cmdList = cmdList->next; - } -} -#endif - -/* - * physically delete an entry 'del' - */ -static void -CmdListDeleteCmdListEntry(XOTclCmdList* del, XOTclFreeCmdListClientData* freeFct) { - if (freeFct) - (*freeFct)(del); - MEM_COUNT_FREE("command refCount",del->cmdPtr); - TclCleanupCommand((Command *)del->cmdPtr); - FREE(XOTclCmdList, del); -} - -/* - * remove a command 'delCL' from a command list, but do not - * free it ... returns the removed XOTclCmdList* - */ -static XOTclCmdList* -CmdListRemoveFromList(XOTclCmdList **cmdList, XOTclCmdList* delCL) { - register XOTclCmdList* c = *cmdList, *del = 0; - if (c == 0) - return NULL; - if (c == delCL) { - *cmdList = c->next; - del = c; - } else { - while (c->next && c->next != delCL) { - c = c->next; - } - if (c->next == delCL) { - del = delCL; - c->next = delCL->next; - } - } - return del; -} - -/* - * remove all command pointers from a list that have a bumped epoch - */ -static void -CmdListRemoveEpoched(XOTclCmdList **cmdList, XOTclFreeCmdListClientData *freeFct) { - XOTclCmdList *f = *cmdList, *del; - while (f) { - if (Tcl_Command_cmdEpoch(f->cmdPtr)) { - del = f; - f = f->next; - del = CmdListRemoveFromList(cmdList, del); - CmdListDeleteCmdListEntry(del, freeFct); - } else - f = f->next; - } -} - - -/* - * delete all cmds with given context class object - */ -static void -CmdListRemoveContextClassFromList(XOTclCmdList **cmdList, XOTclClass *clorobj, - XOTclFreeCmdListClientData* freeFct) { - XOTclCmdList* c, *del = 0; - /* - CmdListRemoveEpoched(cmdList, freeFct); - */ - c = *cmdList; - while (c && c->clorobj == clorobj) { - del = c; - *cmdList = c->next; - CmdListDeleteCmdListEntry(del, freeFct); - c = *cmdList; - } - while (c) { - if (c->clorobj == clorobj) { - del = c; - c = *cmdList; - while (c->next && c->next != del) - c = c->next; - if (c->next == del) - c->next = del->next; - CmdListDeleteCmdListEntry(del, freeFct); - } - c = c->next; - } -} - -/* - * free the memory of a whole 'cmdList' - */ -static void -CmdListRemoveList(XOTclCmdList **cmdList, XOTclFreeCmdListClientData* freeFct) { - XOTclCmdList *del; - while (*cmdList) { - del = *cmdList; - *cmdList = (*cmdList)->next; - CmdListDeleteCmdListEntry(del, freeFct); - } -} - -/* - * simple list search proc to search a list of cmds - * for a command ptr - */ -static XOTclCmdList* -CmdListFindCmdInList(Tcl_Command cmd, XOTclCmdList* l) { - register XOTclCmdList* h = l; - while (h != 0) { - if (h->cmdPtr == cmd) - return h; - h = h->next; - } - return 0; -} - -/* - * simple list search proc to search a list of cmds - * for a simple Name - */ -static XOTclCmdList* -CmdListFindNameInList(Tcl_Interp *in, char *name, XOTclCmdList* l) { - register XOTclCmdList* h = l; - while (h != 0) { - CONST84 char *cmdName = Tcl_GetCommandName(in, h->cmdPtr); - if (cmdName[0] == name[0] && !strcmp(cmdName, name)) - return h; - h = h->next; - } - return 0; -} - -/* - * Assertions - */ -static XOTclTclObjList* -AssertionNewList(Tcl_Interp *in, Tcl_Obj *aObj) { - Tcl_Obj **ov; int oc; - XOTclTclObjList *last = NULL; - - if (Tcl_ListObjGetElements(in, aObj, &oc, &ov) == TCL_OK) { - if (oc > 0) { - int i; - for (i=oc-1; i>=0; i--) { - TclObjListNewElement(&last, ov[i]); - } - } - } - return last; -} - -static Tcl_Obj* -AssertionList(Tcl_Interp *in, XOTclTclObjList* alist) { - Tcl_Obj *newAssStr = Tcl_NewStringObj("",0); - for (; alist!=NULL; alist = alist->next) { - Tcl_AppendStringsToObj(newAssStr, "{", ObjStr(alist->content), - "}", (char *) NULL); - if (alist->next != NULL) - Tcl_AppendStringsToObj(newAssStr, " ", (char *) NULL); - } - return newAssStr; -} - -/* append a string of pre and post assertions to a proc - or instproc body */ -static void -AssertionAppendPrePost(Tcl_Interp *in, Tcl_DString *dsPtr, XOTclProcAssertion *procs) { - if (procs) { - Tcl_Obj *preAss = AssertionList(in, procs->pre); - Tcl_Obj *postAss = AssertionList(in, procs->post); - INCR_REF_COUNT(preAss); INCR_REF_COUNT(postAss); - Tcl_DStringAppendElement(dsPtr, ObjStr(preAss)); - Tcl_DStringAppendElement(dsPtr, ObjStr(postAss)); - DECR_REF_COUNT(preAss); DECR_REF_COUNT(postAss); - } -} - -static int -AssertionListCheckOption(Tcl_Interp *in, XOTclObject *obj) { - XOTclObjectOpt *opt = obj->opt; - if (!opt) - return TCL_OK; - if (opt->checkoptions & CHECK_OBJINVAR) - Tcl_AppendElement(in, "invar"); - if (opt->checkoptions & CHECK_CLINVAR) - Tcl_AppendElement(in, "instinvar"); - if (opt->checkoptions & CHECK_PRE) - Tcl_AppendElement(in, "pre"); - if (opt->checkoptions & CHECK_POST) - Tcl_AppendElement(in, "post"); - return TCL_OK; -} - -static XOTclProcAssertion* -AssertionFindProcs(XOTclAssertionStore* aStore, char *name) { - Tcl_HashEntry *hPtr; - if (aStore == NULL) return NULL; - hPtr = Tcl_FindHashEntry(&aStore->procs, name); - if (hPtr == NULL) return NULL; - return (XOTclProcAssertion*) Tcl_GetHashValue(hPtr); -} - -static void -AssertionRemoveProc(XOTclAssertionStore* aStore, char *name) { - Tcl_HashEntry *hPtr; - if (aStore) { - hPtr = Tcl_FindHashEntry(&aStore->procs, name); - if (hPtr) { - XOTclProcAssertion* procAss = - (XOTclProcAssertion*) Tcl_GetHashValue(hPtr); - TclObjListFreeList(procAss->pre); - TclObjListFreeList(procAss->post); - FREE(XOTclProcAssertion, procAss); - Tcl_DeleteHashEntry(hPtr); - } - } -} - -static void -AssertionAddProc(Tcl_Interp *in, char *name, XOTclAssertionStore* aStore, - Tcl_Obj *pre, Tcl_Obj *post) { - int nw = 0; - Tcl_HashEntry* hPtr = NULL; - XOTclProcAssertion *procs = NEW(XOTclProcAssertion); - - AssertionRemoveProc(aStore, name); - procs->pre = AssertionNewList(in, pre); - procs->post = AssertionNewList(in, post); - hPtr = Tcl_CreateHashEntry(&aStore->procs, name, &nw); - if (nw) Tcl_SetHashValue(hPtr, (ClientData)procs); -} - -static XOTclAssertionStore* -AssertionCreateStore() { - XOTclAssertionStore* aStore = NEW(XOTclAssertionStore); - aStore->invariants = NULL; - Tcl_InitHashTable(&aStore->procs, TCL_STRING_KEYS); - MEM_COUNT_ALLOC("Tcl_InitHashTable",&aStore->procs); - return aStore; -} - -static void -AssertionRemoveStore(XOTclAssertionStore* aStore) { - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr; - - if (aStore) { - hPtr = Tcl_FirstHashEntry(&aStore->procs, &hSrch); - while (hPtr) { - /* - * AssertionRemoveProc calls Tcl_DeleteHashEntry(hPtr), thus - * we get the FirstHashEntry afterwards again to proceed - */ - AssertionRemoveProc(aStore, Tcl_GetHashKey(&aStore->procs, hPtr)); - hPtr = Tcl_FirstHashEntry(&aStore->procs, &hSrch); - } - Tcl_DeleteHashTable(&aStore->procs); - MEM_COUNT_FREE("Tcl_InitHashTable",&aStore->procs); - TclObjListFreeList(aStore->invariants); - FREE(XOTclAssertionStore, aStore); - } -} - -/* - * check a given condition in the current callframe's scope - * it's the responsiblity of the caller to push the intended callframe - */ -static int -checkConditionInScope(Tcl_Interp *in, Tcl_Obj *condition) { - int result, success; - Tcl_Obj *ov[2]; - ov [1] = condition; - INCR_REF_COUNT(condition); - /* - fprintf(stderr, "----- evaluating condition '%s'\n", ObjStr(condition)); - */ - result = XOTcl_ExprObjCmd(NULL, in, 2, ov); - DECR_REF_COUNT(condition); - /* - fprintf(stderr, "----- running condition '%s', result=%d '%s'\n", - ObjStr(condition), result, - ObjStr(Tcl_GetObjResult(in))); - */ - if (result == TCL_OK) { - result = Tcl_GetIntFromObj(in,Tcl_GetObjResult(in),&success); - /* - fprintf(stderr, " success=%d\n", success); - */ - if (result == TCL_OK && success == 0) - result = XOTCL_CHECK_FAILED; - } - return result; -} - -static int -AssertionCheckList(Tcl_Interp *in, XOTclObject *obj, - XOTclTclObjList* alist, char *methodName) { - XOTclTclObjList* checkFailed = NULL; - Tcl_Obj *savedObjResult = Tcl_GetObjResult(in); - int savedCheckoptions, acResult = TCL_OK; - - /* - * no obj->opt -> checkoption == CHECK_NONE - */ - if (!obj->opt) - return TCL_OK; - - /* we do not check assertion modifying methods, otherwise - we can not react in catch on a runtime assertion check failure */ - if (isCheckString(methodName) || isInfoString(methodName) || - isInvarString(methodName) || isInstinvarString(methodName) || - isProcString(methodName) || isInstprocString(methodName)) - return TCL_OK; - - INCR_REF_COUNT(savedObjResult); - - Tcl_ResetResult(in); - - while (alist != NULL) { - /* Eval instead of IfObjCmd => the substitutions in the - conditions will be done by Tcl */ - char *assStr = ObjStr(alist->content), *c = assStr; - int comment = 0; - - while (c != 0 && *c != '\0') { - if (*c == '#') { - comment = 1; break; - } - c++; - } - if (!comment) { - XOTcl_FrameDecls; - XOTcl_PushFrame(in, obj); - CallStackPush(in, obj, 0, 0, 0, 0, XOTCL_CSC_TYPE_PLAIN); - - /* don't check assertion during assertion check */ - savedCheckoptions = obj->opt->checkoptions; - obj->opt->checkoptions = CHECK_NONE; - - /*fprintf(stderr, "Checking Assertion %s ", assStr);*/ - - /* - * now check the assertion in the pushed callframe's scope - */ - acResult = checkConditionInScope(in, alist->content); - if (acResult != TCL_OK) - checkFailed = alist; - - obj->opt->checkoptions = savedCheckoptions; - - /*fprintf(stderr, "...%s\n", checkFailed ? "failed" : "ok");*/ - - CallStackPop(in); - XOTcl_PopFrame(in,obj); - } - if (checkFailed) - break; - alist = alist->next; - } - - if (checkFailed != NULL) { - DECR_REF_COUNT(savedObjResult); - if (acResult == TCL_ERROR) { - Tcl_Obj *sr = Tcl_GetObjResult(in); - INCR_REF_COUNT(sr); - XOTclVarErrMsg(in, "Error in Assertion: {", - ObjStr(checkFailed->content), "} in proc '", - GetSelfProc(in), "'\n\n", ObjStr(sr), (char *) NULL); - DECR_REF_COUNT(sr); - return TCL_ERROR; - } - return XOTclVarErrMsg(in, "Assertion failed check: {", - ObjStr(checkFailed->content), "} in proc '", - GetSelfProc(in), "'", (char *) NULL); - } - - Tcl_SetObjResult(in, savedObjResult); - DECR_REF_COUNT(savedObjResult); - return TCL_OK; -} - -static int -AssertionCheckInvars(Tcl_Interp *in, XOTclObject *obj, char *method, - CheckOptions checkoptions) { - int result = TCL_OK; - - if (checkoptions & CHECK_OBJINVAR && obj->opt->assertions) { - result = AssertionCheckList(in, obj, obj->opt->assertions->invariants, - method); - } - - if (result != TCL_ERROR && checkoptions & CHECK_CLINVAR) { - XOTclClasses* clPtr; - clPtr = ComputeOrder(obj->cl, obj->cl->order, Super); - while (clPtr != 0 && result != TCL_ERROR) { - XOTclAssertionStore* aStore = (clPtr->cl->opt) ? clPtr->cl->opt->assertions : 0; - if (aStore) { - result = AssertionCheckList(in, obj, aStore->invariants, method); - } - clPtr = clPtr->next; - } - } - return result; -} - -static int -AssertionCheck(Tcl_Interp *in, XOTclObject *obj, XOTclClass *cl, - char *method, int checkOption) { - XOTclProcAssertion* procs; - int result = TCL_OK; - XOTclAssertionStore* aStore; - - if (cl) - aStore = cl->opt ? cl->opt->assertions : 0; - else - aStore = obj->opt ? obj->opt->assertions : 0; - - assert(obj->opt); - - if (checkOption & obj->opt->checkoptions) { - procs = AssertionFindProcs(aStore, method); - if (procs) { - switch (checkOption) { - case CHECK_PRE: - result = AssertionCheckList(in, obj, procs->pre, method); - break; - case CHECK_POST: - result = AssertionCheckList(in, obj, procs->post, method); - break; - } - } - if (result != TCL_ERROR) - result = AssertionCheckInvars(in, obj, method, obj->opt->checkoptions); - } - return result; -} - - - - -/* - * Per-Object-Mixins - */ - -/* - * push a mixin stack information on this object - */ -static int -MixinStackPush(XOTclObject *obj) { - register XOTclMixinStack* h = NEW(XOTclMixinStack); - h->currentCmdPtr = 0; - h->next = obj->mixinStack; - obj->mixinStack = h; - return 1; -} - -/* - * pop a mixin stack information on this object - */ -static void -MixinStackPop(XOTclObject *obj) { - register XOTclMixinStack *h = obj->mixinStack; - obj->mixinStack = h->next; - FREE(XOTclMixinStack,h); -} - -/* - * Appends XOTclClasses* containing the mixin classes and their - * superclasses to 'mixinClasses' list from a given mixinList - */ -static void -MixinComputeOrderFullList(Tcl_Interp *in, XOTclCmdList **mixinList, - XOTclClasses **mixinClasses, - XOTclClasses **checkList, int level) { - XOTclCmdList *m; - XOTclClasses *pl, **clPtr = mixinClasses; - - CmdListRemoveEpoched(mixinList, GuardDel); - m = *mixinList; - - while (m) { - XOTclClass *mCl = XOTclGetClassFromCmdPtr(m->cmdPtr); - if (mCl) { - for (pl = ComputeOrder(mCl, mCl->order, Super); pl; pl = pl->next) { - /*fprintf(stderr, " %s, ", ObjStr(pl->cl->object.cmdName));*/ - if (!(pl->cl == RUNTIME_STATE(in)->theObject)) { - XOTclClassOpt* opt = pl->cl->opt; - if (opt && opt->instmixins != 0) { - /* compute transitively the instmixin classes of this added - class */ - XOTclClasses *cls; - int i, found=0; - for (i=0, cls = *checkList; cls; i++,cls = cls->next) { - /* fprintf(stderr,"+++ c%d: %s\n",i, - ObjStr(cls->cl->object.cmdName));*/ - if (pl->cl == cls->cl) { - found = 1; - break; - } - } - if (!found) { - XOTclAddClass(checkList, pl->cl, NULL); - /*fprintf(stderr, "+++ transitive %s\n", - ObjStr(pl->cl->object.cmdName));*/ - - MixinComputeOrderFullList(in, &opt->instmixins, mixinClasses, - checkList, level+1); - } - } - /* fprintf(stderr,"+++ add to mixinClasses %p path: %s clPtr %p\n", - mixinClasses, ObjStr(pl->cl->object.cmdName), clPtr);*/ - clPtr = XOTclAddClass(clPtr, pl->cl, m->clientData); - } - } - } - m = m->next; - } - if (level == 0 && *checkList) { - XOTclFreeClasses(*checkList); - *checkList = NULL; - } -} - -static void -MixinResetOrder(XOTclObject *obj) { - /*fprintf(stderr,"removeList %s \n",ObjStr(obj->cmdName));*/ - CmdListRemoveList(&obj->mixinOrder, NULL /*GuardDel*/); - obj->mixinOrder = 0; -} - -/* - * Computes a linearized order of per-object and per-class mixins. Then - * duplicates in the full list and with the class inheritance list of - * 'obj' are eliminated. - * The precendence rule is that the last occurence makes it into the - * final list. - */ -static void -MixinComputeOrder(Tcl_Interp *in, XOTclObject *obj) { - XOTclClasses *fullList, *checkList=0, *mixinClasses = 0, *nextCl, *pl, - *checker, *guardChecker; - - if (obj->mixinOrder) MixinResetOrder(obj); - /*fprintf(stderr, "Mixin Order:\n First List: ");*/ - - /* append per-obj mixins */ - if (obj->opt) { - MixinComputeOrderFullList(in, &obj->opt->mixins, &mixinClasses, - &checkList, 0); - } - - /* append per-class mixins */ - for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); pl; pl = pl->next) { - XOTclClassOpt* opt = pl->cl->opt; - if (opt && opt->instmixins) { - MixinComputeOrderFullList(in, &opt->instmixins, &mixinClasses, - &checkList, 0); - } - } - fullList = mixinClasses; - - /* use no duplicates & no classes of the precedence order - on the resulting list */ - while (mixinClasses) { - checker = nextCl = mixinClasses->next; - /* fprintf(stderr,"--- checking %s\n", - ObjStr(mixinClasses->cl->object.cmdName));*/ - - while (checker) { - if (checker->cl == mixinClasses->cl) break; - checker = checker->next; - } - /* if checker is set, it is a duplicate and ignored */ - - if (checker == 0) { - /* check obj->cl hierachy */ - for (checker = ComputeOrder(obj->cl, obj->cl->order, Super); checker; checker = checker->next) { - if (checker->cl == mixinClasses->cl) - break; - } - /* if checker is set, it was found in the class hierarchy - and it is ignored */ - } - if (checker == 0) { - /* add the class to the mixinOrder list */ - XOTclCmdList* new; - /* fprintf(stderr,"--- adding to mixinlist %s\n", - ObjStr(mixinClasses->cl->object.cmdName));*/ - new = CmdListAdd(&obj->mixinOrder, mixinClasses->cl->object.id,NULL, - /*noDuplicates*/ 0); - - /* in the client data of the order list, we require the first - matching guard ... scan the full list for it. */ - for (guardChecker = fullList; guardChecker; guardChecker = guardChecker->next) { - if (guardChecker->cl == mixinClasses->cl) { - new->clientData = guardChecker->clientData; - break; - } - } - } - mixinClasses = nextCl; - } - - /* ... and free the memory of the full list */ - XOTclFreeClasses(fullList); - - /*CmdListPrint(in,"mixin order\n", obj->mixinOrder);*/ - -} - -/* - * add a mixin class to 'mixinList' by appending it - */ -static int -MixinAdd(Tcl_Interp *in, XOTclCmdList **mixinList, Tcl_Obj *name) { - XOTclClass *mixin; - Tcl_Obj *guard = NULL; - int ocName; Tcl_Obj **ovName; - XOTclCmdList* new; - - if (Tcl_ListObjGetElements(in, name, &ocName, &ovName) == TCL_OK && ocName > 1) { - if (ocName == 3 && !strcmp(ObjStr(ovName[1]), XOTclGlobalStrings[XOTE_GUARD_OPTION])) { - name = ovName[0]; - guard = ovName[2]; - /*fprintf(stderr,"mixinadd name = '%s', guard = '%s'\n", ObjStr(name), ObjStr(guard));*/ - } /*else return XOTclVarErrMsg(in, "mixin registration '", ObjStr(name), - "' has too many elements.", (char *) NULL);*/ - } - - if (GetXOTclClassFromObj(in, name, &mixin, 1) != TCL_OK) - return XOTclErrBadVal(in, "mixin", "a class as mixin", ObjStr(name)); - - - new = CmdListAdd(mixinList, mixin->object.id, NULL, /*noDuplicates*/ 1); - - if (guard) { - GuardAdd(in, new, guard); - } else { - if (new->clientData) - GuardDel(new); - } - - return TCL_OK; -} - -/* - * get all instances of a class recursively to an initialized - * String key hashtable - */ -static void -getAllInstances(Tcl_HashTable *destTable, XOTclClass *startCl) { - Tcl_HashTable *table = &startCl->instances; - Tcl_HashSearch search; - Tcl_HashEntry *hPtr; - - for (hPtr = Tcl_FirstHashEntry(table, &search); hPtr != NULL; - hPtr = Tcl_NextHashEntry(&search)) { - XOTclObject *inst = (XOTclObject*) Tcl_GetHashKey(table, hPtr); - Tcl_HashEntry *hPtrDest; - int new; - hPtrDest = Tcl_CreateHashEntry(destTable, ObjStr(inst->cmdName), &new); - /* - fprintf (stderr, " -- %s (%s)\n", ObjStr(inst->cmdName), ObjStr(startCl->object.cmdName)); - */ - if (new && XOTclObjectIsClass(inst)) { - getAllInstances(destTable, (XOTclClass*) inst); - } - } -} - -/* - * if the class hierarchy or class mixins have changed -> - * invalidate mixin entries in all dependent instances - */ -static void -MixinInvalidateObjOrders(Tcl_Interp *in, XOTclClass *cl) { - XOTclClasses *saved = cl->order, *clPtr; - Tcl_HashSearch hSrch; - Tcl_HashEntry *hPtr; - Tcl_HashTable objTable, *commandTable = &objTable; - XOTclObject *obj; - - cl->order = 0; - - for (clPtr = ComputeOrder(cl, cl->order, Sub); clPtr; clPtr = clPtr->next) { - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr = &clPtr->cl->instances ? - Tcl_FirstHashEntry(&clPtr->cl->instances, &hSrch) : 0; - - /*fprintf(stderr,"invalidating instances of class %s\n", - ObjStr(clPtr->cl->object.cmdName));*/ - - /* here we should check, whether this class is used as - a mixin / instmixin somewhere else and invalidate - the objects of these as well -- */ - - for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { - XOTclObject *obj = (XOTclObject*) - Tcl_GetHashKey(&clPtr->cl->instances, hPtr); - MixinResetOrder(obj); - obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; - } - } - - XOTclFreeClasses(cl->order); - cl->order = saved; -#if 1 - /* TODO: Uwe, this slows down superclass by a factor of 5! - */ - - /* invalidate the mixins on all instances that have this mixin (cl) - at the moment */ - Tcl_InitHashTable(commandTable, TCL_STRING_KEYS); - MEM_COUNT_ALLOC("Tcl_InitHashTable",commandTable); - getAllInstances(commandTable, RUNTIME_STATE(in)->theClass); - hPtr = Tcl_FirstHashEntry(commandTable, &hSrch); - while (hPtr) { - char *key = Tcl_GetHashKey(commandTable, hPtr); - obj = XOTclpGetObject(in, key); - - if (obj && !XOTclObjectIsClass(obj) - && !(obj->flags & XOTCL_DESTROY_CALLED) - && (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID)) { - XOTclCmdList *ml; - for (ml = obj->mixinOrder; ml; ml = ml->next) { - XOTclClass *mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); - if (mixin == cl) { - MixinResetOrder(obj); - obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; - break; - } - } - } - hPtr = Tcl_NextHashEntry(&hSrch); - } - MEM_COUNT_FREE("Tcl_InitHashTable",commandTable); - Tcl_DeleteHashTable(commandTable); -#endif -} - static int MixinInfo(Tcl_Interp *in, XOTclCmdList* m, char *pattern, int withGuards); -/* - * the mixin order is either - * DEFINED (there are mixins on the instance), - * NONE (there are no mixins for the instance), - * or INVALID (a class re-strucuturing has occured, thus it is not clear - * whether mixins are defined or not). - * If it is INVALID MixinComputeDefined can be used to compute the order - * and set the instance to DEFINE or NONE - */ -static void -MixinComputeDefined(Tcl_Interp *in, XOTclObject *obj) { - MixinComputeOrder(in, obj); - obj->flags |= XOTCL_MIXIN_ORDER_VALID; - if (obj->mixinOrder) - obj->flags |= XOTCL_MIXIN_ORDER_DEFINED; - else - obj->flags &= ~XOTCL_MIXIN_ORDER_DEFINED; -} - -/* - * walk through the mixin order until the current mixin is reached. - * then use the next mixin as current mixin. - * - * precondition: obj->mixinStack is not NULL - */ -static void -MixinSeekCurrent(Tcl_Interp *in, XOTclObject *obj, XOTclCmdList **cmdList) { - Tcl_Command currentCmdPtr; - - /* ensure that the mixin order is not invalid, otherwise compute order */ - assert(obj->flags & XOTCL_MIXIN_ORDER_VALID); - /*MixinComputeDefined(in, obj);*/ - currentCmdPtr = obj->mixinStack->currentCmdPtr; - - /* - { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - XOTclCallStackContent *csc = cs->top; - fprintf(stderr, "%p == %p ==> %d \n", csc->cl, currentCmdPtr, - csc->cmdPtr == currentCmdPtr); - } - */ - - /*** - { Tcl_Obj *sr; - - MixinInfo(in, obj->mixinOrder, NULL,0); - sr = Tcl_GetObjResult(in); - fprintf(stderr,"INFO->%s order %p next %p\n",ObjStr(sr), obj->mixinOrder, obj->mixinOrder->next); - } - ***/ - - *cmdList = obj->mixinOrder; - /* - fprintf(stderr, "->1 mixin seek current = %p next = %p %s\n", - currentCmdPtr, - (*cmdList)->next, - (*cmdList)->next ? Tcl_GetCommandName(in, (*cmdList)->next->cmdPtr) : ""); - */ - -#if defined(ACTIVEMIXIN) - /*RUNTIME_STATE(in)->cmdPtr = (*cmdList)->next ? (*cmdList)->next->cmdPtr : NULL;*/ - RUNTIME_STATE(in)->cmdPtr = (*cmdList)->cmdPtr; -#endif - - /* go forward to current class */ - while (*cmdList && currentCmdPtr) { - /* fprintf(stderr, "->2 mixin seek current = %p next = %p\n", currentCmdPtr, (*cmdList)->next);*/ - if ((*cmdList)->cmdPtr == currentCmdPtr) - currentCmdPtr = 0; - *cmdList = (*cmdList)->next; - -#if defined(ACTIVEMIXIN) - /*RUNTIME_STATE(in)->cmdPtr = (*cmdList)->next ? (*cmdList)->next->cmdPtr : NULL;*/ - RUNTIME_STATE(in)->cmdPtr = (*cmdList)->cmdPtr; -#endif - } -} - -/* - * before we can perform a mixin dispatch, MixinSearchProc seeks the - * current mixin and the relevant calling information - */ -static Tcl_Command -MixinSearchProc(Tcl_Interp *in, XOTclObject *obj, char *methodName, - XOTclClass **cl, Tcl_ObjCmdProc **proc, ClientData* cp, - Tcl_Command* currentCmdPtr) { - Tcl_Command cmd = NULL; - XOTclCmdList *cmdList; - XOTclClass *cls; - - assert(obj); - assert(obj->mixinStack); - - MixinSeekCurrent(in, obj, &cmdList); - - /* - fprintf(stderr, "MixinSearch searching for '%s' %p\n", methodName,cmdList); - */ - /*CmdListPrint(in,"MixinSearch CL = \n", cmdList);*/ - - - while (cmdList) { - if (Tcl_Command_cmdEpoch(cmdList->cmdPtr)) { - cmdList = cmdList->next; - } else { - cls = XOTclGetClassFromCmdPtr(cmdList->cmdPtr); - /* - fprintf(stderr,"+++ MixinSearch %s->%s in %p cmdPtr %p clientData %p\n", - ObjStr(obj->cmdName),methodName, cmdList, - cmdList->cmdPtr, cmdList->clientData); - */ - if (cls) { - int guardOk = TCL_OK; - cmd = FindMethod(methodName, cls->nsPtr); - if (cmd && cmdList->clientData) { - if (!RUNTIME_STATE(in)->cs.guardCount) { - guardOk = GuardCall(obj, cls, (Tcl_Command) cmd, in, cmdList->clientData, 1); - } - } - if (cmd && guardOk == TCL_OK) { - /* - * on success: compute mixin call data - */ - *cl = cls; - *proc = Tcl_Command_objProc(cmd); - *cp = Tcl_Command_objClientData(cmd); - *currentCmdPtr = cmdList->cmdPtr; - break; - } else { - cmd = NULL; - cmdList = cmdList->next; - } - } - } - } - - return cmd; -} - -/* - * info option for mixins and instmixins - */ -static int -MixinInfo(Tcl_Interp *in, XOTclCmdList* m, char *pattern, int withGuards) { - Tcl_Obj *list = Tcl_NewListObj(0, NULL); - XOTclClass *mixinClass; - while (m) { - /* fprintf(stderr," mixin info m=%p, next=%p\n",m,m->next); */ - mixinClass = XOTclGetClassFromCmdPtr(m->cmdPtr); - if (mixinClass && - (!pattern || - Tcl_StringMatch(ObjStr(mixinClass->object.cmdName), pattern))) { - if (withGuards && m->clientData) { - Tcl_Obj *l = Tcl_NewListObj(0, NULL); - Tcl_Obj *g = (Tcl_Obj*) m->clientData; - Tcl_ListObjAppendElement(in, l, mixinClass->object.cmdName); - Tcl_ListObjAppendElement(in, l, XOTclGlobalObjects[XOTE_GUARD_OPTION]); - Tcl_ListObjAppendElement(in, l, g); - Tcl_ListObjAppendElement(in, list, l); - } else - Tcl_ListObjAppendElement(in, list, mixinClass->object.cmdName); - } - m = m->next; - } - Tcl_SetObjResult(in, list); - return TCL_OK; -} - -static Tcl_Command -MixinSearchMethodByName(Tcl_Interp *in, XOTclCmdList* mixinList, char *name, XOTclClass **cl) { - Tcl_Command cmd; - while (mixinList) { - XOTclClass *mcl = - XOTclpGetClass(in, (char *) Tcl_GetCommandName(in, mixinList->cmdPtr)); - if (mcl && SearchCMethod(mcl, name, &cmd)) { - if (cl) *cl = mcl; - return cmd; - } - - mixinList = mixinList->next; - } - return 0; -} - - -/* - * Filter-Commands - */ - -/* - * The search method implements filter search order for filter - * and instfilter: first a given name is interpreted as fully - * qualified instproc name. If no instproc is found, a proc is - * search with fully name. Otherwise the simple name is searched - * on the heritage order: object (only for - * per-object filters), class, meta-class - */ - -static Tcl_Command -FilterSearch(Tcl_Interp *in, char *name, XOTclObject *startingObj, - XOTclClass *startingCl, XOTclClass **cl) { - Tcl_Command cmd = NULL; - - if (startingObj) { - XOTclObjectOpt *opt = startingObj->opt; - /* - * the object-specific filter can also be defined on the object's - * class, its hierarchy, or the respective instmixins; thus use the - * object's class as start point for the class-specific search then ... - */ - startingCl = startingObj->cl; - - /* - * search for filters on object mixins - */ - if (opt && opt->mixins) { - if ((cmd = MixinSearchMethodByName(in, opt->mixins, name, cl))) { - return cmd; - } - } - } - - /* - * search for instfilters on instmixins - */ - if (startingCl) { - XOTclClassOpt* opt = startingCl->opt; - if (opt && opt->instmixins) { - if ((cmd = MixinSearchMethodByName(in, opt->instmixins, name, cl))) { - return cmd; - } - } - } - - /* - * seach for object procs that are used as filters - */ - if (startingObj && startingObj->nsPtr) { - if ((cmd = FindMethod(name, startingObj->nsPtr))) { - *cl = (XOTclClass*)startingObj; - return cmd; - } - } - - /* - * ok, no filter on obj or mixins -> search class - */ - if (startingCl) { - *cl = SearchCMethod(startingCl, name, &cmd); - if (!*cl) { - /* - * If no filter is found yet -> search the meta-class - */ - *cl = SearchCMethod(startingCl->object.cl, name, &cmd); - } - } - return cmd; -} - -/* - * Filter Guards - */ - -/* check a filter guard, return 1 if ok */ -static int -GuardCheck(Tcl_Interp *in, ClientData clientData) { - Tcl_Obj *guard = (Tcl_Obj*) clientData; - int rc; - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - - if (guard) { - /* - * if there are more than one filter guard for this filter - * (i.e. they are inherited), then they are OR combined - * -> if one check succeeds => return 1 - */ - - /*fprintf(stderr, "checking guard **%s**\n", ObjStr(guard));*/ - - cs->guardCount++; - rc = checkConditionInScope(in, guard); - cs->guardCount--; - - /*fprintf(stderr, "checking guard **%s** returned rc=%d\n", - ObjStr(fr->content), rc);*/ - - if (rc == TCL_OK) { - /* fprintf(stderr, " +++ OK\n"); */ - return TCL_OK; - } else if (rc == TCL_ERROR) { - Tcl_Obj *sr = Tcl_GetObjResult(in); - INCR_REF_COUNT(sr); - - /* fprintf(stderr, " +++ ERROR\n");*/ - - XOTclVarErrMsg(in, "Guard Error: '", ObjStr(guard), "'\n\n", - ObjStr(sr), (char *) NULL); - DECR_REF_COUNT(sr); - return TCL_ERROR; - } - } - /* - fprintf(stderr, " +++ FAILED\n"); - */ - return XOTCL_CHECK_FAILED; -} - -/* -static void -GuardPrint(Tcl_Interp *in, ClientData clientData) { - Tcl_Obj *guard = (TclObj*) clientData; - fprintf(stderr, " +++ \n"); - if (guard) { - fprintf(stderr, " * %s \n", ObjStr(guard)); - } - fprintf(stderr, " +++ \n"); -} -*/ - -static void -GuardDel(XOTclCmdList* CL) { - /*fprintf(stderr, "GuardDel %p cd = %p\n", - CL, CL? CL->clientData : NULL);*/ - if (CL && CL->clientData) { - DECR_REF_COUNT((Tcl_Obj*)CL->clientData); - CL->clientData = NULL; - } -} - -XOTCLINLINE static void -GuardAdd(Tcl_Interp *in, XOTclCmdList* CL, Tcl_Obj *guard) { - if (guard) { - GuardDel(CL); - if (strlen(ObjStr(guard)) != 0) { - INCR_REF_COUNT(guard); - CL->clientData = (ClientData) guard; - /*fprintf(stderr,"guard added to %p cmdPtr=%p, clientData= %p\n", - CL, CL->cmdPtr, CL->clientData); - */ - } - } -} -/* -static void -GuardAddList(Tcl_Interp *in, XOTclCmdList* dest, ClientData source) { - XOTclTclObjList* s = (XOTclTclObjList*) source; - while (s) { - GuardAdd(in, dest, (Tcl_Obj*) s->content); - s = s->next; - } -} */ - -static int -GuardCall(XOTclObject *obj, XOTclClass *cl, Tcl_Command cmd, - Tcl_Interp *in, ClientData clientData, int push) { - int rc = TCL_OK; - - if (clientData) { - Tcl_Obj *res = Tcl_GetObjResult(in); /* save the result */ - INCR_REF_COUNT(res); - - /* GuardPrint(in, cmdList->clientData); */ - /* - * ok, there is a guard ... we have to push a - * fake callframe on the tcl stack so that uplevel - * is in sync with the XOTcl callstack, and we can uplevel - * into the above pushed CallStack entry - */ - if (push) { - CallStackPush(in, obj, cl, cmd, 0, 0, XOTCL_CSC_TYPE_GUARD); - rc = GuardCheck(in, clientData); - CallStackPop(in); - } else { - rc = GuardCheck(in, clientData); - } - Tcl_SetObjResult(in, res); /* restore the result */ - DECR_REF_COUNT(res); - } - - return rc; -} - -static int -GuardAddFromDefinitionList(Tcl_Interp *in, XOTclCmdList* dest, - XOTclObject *obj, Tcl_Command interceptorCmd, - XOTclCmdList* interceptorDefList) { - XOTclCmdList* h; - if (interceptorDefList != 0) { - h = CmdListFindCmdInList(interceptorCmd, interceptorDefList); - if (h) { - GuardAdd(in, dest, (Tcl_Obj*) h->clientData); - /* - * 1 means we have added a guard successfully "interceptorCmd" - */ - return 1; - } - } - /* - * 0 means we have not added a guard successfully "interceptorCmd" - */ - return 0; -} - -static void -GuardAddInheritedGuards(Tcl_Interp *in, XOTclCmdList* dest, - XOTclObject *obj, Tcl_Command filterCmd) { - XOTclClasses* pl; - int guardAdded = 0; - XOTclObjectOpt *opt; - - /* search guards for instfilters registered on mixins */ - if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) - MixinComputeDefined(in, obj); - if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { - XOTclCmdList *ml = obj->mixinOrder; - XOTclClass *mixin; - while (ml && ! guardAdded) { - mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); - if (mixin && mixin->opt) { - guardAdded = GuardAddFromDefinitionList(in, dest, obj, filterCmd, - mixin->opt->instfilters); - } - ml = ml->next; - } - } - - /* search per-object filters */ - opt = obj->opt; - if (!guardAdded && opt && opt->filters) { - guardAdded = GuardAddFromDefinitionList(in, dest, obj, filterCmd, opt->filters); - } - - if (!guardAdded) { - /* search per-class filters */ - for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); !guardAdded && pl; pl = pl->next) { - XOTclClassOpt* opt = pl->cl->opt; - if (opt) { - guardAdded = GuardAddFromDefinitionList(in, dest, obj, filterCmd, - opt->instfilters); - } - } - - - /* - * if this is not a registered filter, it is an inherited filter, like: - * Class A - * A instproc f ... - * Class B -superclass A - * B instproc {{f {}}} - * B instfilter f - * -> get the guard from the filter that inherits it (here B->f) - */ - if (!guardAdded) { - XOTclCmdList* registeredFilter = - CmdListFindNameInList(in,(char *) Tcl_GetCommandName(in, filterCmd), - obj->filterOrder); - if (registeredFilter) { - GuardAdd(in, dest, (Tcl_Obj*) registeredFilter->clientData); - } - } - } -} - -static int -GuardList(Tcl_Interp *in, XOTclCmdList* frl, char *interceptorName) { - XOTclCmdList* h; - if (frl) { - /* try to find simple name first */ - h = CmdListFindNameInList(in, interceptorName, frl); - if (!h) { - /* maybe it is a qualified name */ - Tcl_Command cmd = NSFindCommand(in, interceptorName, NULL); - if (cmd) { - h = CmdListFindCmdInList(cmd, frl); - } - } - if (h) { - Tcl_ResetResult(in); - if (h->clientData) { - Tcl_Obj *g = (Tcl_Obj*) h->clientData; - Tcl_SetObjResult(in, g); - } - return TCL_OK; - } - } - return XOTclVarErrMsg(in, "info (*)guard: can't find filter/mixin ", - interceptorName, (char *) NULL); -} - -/* - * append a filter command to the 'filterList' of an obj/class - */ -static int -FilterAdd(Tcl_Interp *in, XOTclCmdList **filterList, Tcl_Obj *name, - XOTclObject *startingObj, XOTclClass *startingCl) { - Tcl_Command cmd; - int ocName; Tcl_Obj **ovName; - Tcl_Obj *guard = NULL; - XOTclCmdList *new; - XOTclClass *cl; - - if (Tcl_ListObjGetElements(in, name, &ocName, &ovName) == TCL_OK && ocName > 1) { - if (ocName == 3 && !strcmp(ObjStr(ovName[1]), XOTclGlobalStrings[XOTE_GUARD_OPTION])) { - name = ovName[0]; - guard = ovName[2]; - } - } - - if (!(cmd = FilterSearch(in, ObjStr(name), startingObj, startingCl, &cl))) { - if (startingObj) - return XOTclVarErrMsg(in, "filter: can't find filterproc on: ", - ObjStr(startingObj->cmdName), " - proc: ", - ObjStr(name), (char *) NULL); - else - return XOTclVarErrMsg(in, "instfilter: can't find filterproc on: ", - ObjStr(startingCl->object.cmdName), " - proc: ", - ObjStr(name), (char *) NULL); - } - - /*fprintf(stderr, " +++ adding filter %s cl %p\n", ObjStr(name),cl);*/ - - new = CmdListAdd(filterList, cmd, cl, /*noDuplicates*/ 1); - - if (guard) { - GuardAdd(in, new, guard); - } else { - if (new->clientData) - GuardDel(new); - } - - return TCL_OK; -} - -/* - * reset the filter order cached in obj->filterOrder - */ -static void -FilterResetOrder(XOTclObject *obj) { - CmdListRemoveList(&obj->filterOrder, GuardDel); - obj->filterOrder = 0; -} - -/* - * search the filter in the hierarchy again with FilterSearch, e.g. - * upon changes in the class hierarchy or mixins that carry the filter - * command, so that we can be sure it is still reachable. - */ -static void -FilterSearchAgain(Tcl_Interp *in, XOTclCmdList **filters, - XOTclObject *startingObj, XOTclClass *startingCl) { - char *simpleName; - Tcl_Command cmd; - XOTclCmdList *cmdList, *del; - XOTclClass *cl = NULL; - - CmdListRemoveEpoched(filters, GuardDel); - cmdList = *filters; - while (cmdList) { - simpleName = (char *) Tcl_GetCommandName(in, cmdList->cmdPtr); - cmd = FilterSearch(in, simpleName, startingObj, startingCl, &cl); - if (cmd == NULL) { - del = cmdList; - cmdList = cmdList->next; - del = CmdListRemoveFromList(filters, del); - CmdListDeleteCmdListEntry(del, GuardDel); - } else { - if (cmd != cmdList->cmdPtr) - CmdListReplaceCmd(cmdList, cmd, cl); - cmdList = cmdList->next; - } - } - /* some entries might be NULL now, if they are not found anymore - -> delete those - CmdListRemoveNulledEntries(filters, GuardDel); - */ - -} - -/* - * if the class hierarchy or class filters have changed -> - * invalidate filter entries in all dependent instances - * - */ -static void -FilterInvalidateObjOrders(Tcl_Interp *in, XOTclClass *cl) { - XOTclClasses *saved = cl->order, *clPtr, *savePtr; - - cl->order = 0; - savePtr = clPtr = ComputeOrder(cl, cl->order, Sub); - cl->order = saved; - - while (clPtr != 0) { - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr = &clPtr->cl->instances ? - Tcl_FirstHashEntry(&clPtr->cl->instances, &hSrch) : 0; - - /* recalculate the commands of all instfilter registrations */ - if (clPtr->cl->opt) { - FilterSearchAgain(in, &clPtr->cl->opt->instfilters, 0, clPtr->cl); - } - for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { - XOTclObject *obj = (XOTclObject*) Tcl_GetHashKey(&clPtr->cl->instances, hPtr); - FilterResetOrder(obj); - obj->flags &= ~XOTCL_FILTER_ORDER_VALID; - - /* recalculate the commands of all object filter registrations */ - if (obj->opt) { - FilterSearchAgain(in, &obj->opt->filters, obj, 0); - } - } - clPtr = clPtr->next; - } - XOTclFreeClasses(savePtr); -} - -/* - * from cl on down the hierarchy we remove all filters - * the refer to "removeClass" namespace. E.g. used to - * remove filters defined in superclass list from dependent - * class cl - */ -static void -FilterRemoveDependentFilterCmds(XOTclClass *cl, XOTclClass *removeClass) { - XOTclClasses *saved = cl->order, *clPtr; - cl->order = 0; - - /*fprintf(stderr, "FilterRemoveDependentFilterCmds cl %p %s, removeClass %p %s\n", - cl,ObjStr(cl->object.cmdName), - removeClass,ObjStr(removeClass->object.cmdName));*/ - - for (clPtr = ComputeOrder(cl, cl->order, Sub); clPtr; clPtr = clPtr->next) { - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr = &clPtr->cl->instances ? - Tcl_FirstHashEntry(&clPtr->cl->instances, &hSrch) : 0; - XOTclClassOpt* opt = clPtr->cl->opt; - if (opt) { - CmdListRemoveContextClassFromList(&opt->instfilters,removeClass, GuardDel); - } - for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { - XOTclObject *obj = (XOTclObject*) Tcl_GetHashKey(&clPtr->cl->instances, hPtr); - if (obj->opt) { - CmdListRemoveContextClassFromList(&obj->opt->filters,removeClass, GuardDel); - } - } - } - - XOTclFreeClasses(cl->order); - cl->order = saved; -} - -/* - * build up a qualifier of the form proc/instproc - * if cl is not NULL, we build an instproc identifier for cl, else a proc - * with obj - */ -static Tcl_Obj* -getFullProcQualifier(Tcl_Interp *in, CONST84 char *cmdName, - XOTclObject *obj, XOTclClass *cl, Tcl_Command cmd) { - Tcl_Obj *list = Tcl_NewListObj(0, NULL); - Tcl_Obj *procObj = Tcl_NewStringObj(cmdName, -1); - Tcl_ObjCmdProc *objProc = Tcl_Command_objProc(cmd); - int isTcl = (TclIsProc((Command *)cmd) != NULL); - - if (cl) { - Tcl_ListObjAppendElement(in, list, cl->object.cmdName); - /*fprintf(stderr,"current %p, dispatch %p, forward %p, parametermcd %p, is tcl %p\n", - objProc, XOTclObjDispatch, XOTclForwardMethod, - XOTclSetterMethod, TclIsProc((Command *)cmd)); */ - if (isTcl) { - Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_INSTPROC]); - } else if (objProc == XOTclForwardMethod) { - Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_INSTFORWARD]); - } else if (objProc == XOTclSetterMethod) { - Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_INSTPARAMETERCMD]); - } else { - Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_INSTCMD]); - } - } else { - Tcl_ListObjAppendElement(in, list, obj->cmdName); - if (isTcl) { - Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_PROC]); - } else if (objProc == XOTclForwardMethod) { - Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_FORWARD]); - } else if (objProc == XOTclSetterMethod) { - Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_PARAMETERCMD]); - } else { - Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_CMD]); - } - } - Tcl_ListObjAppendElement(in, list, procObj); - return list; -} - -/* - * info option for filters and instfilters - * withGuards -> if not 0 => append guards - * fullProcQualifiers -> if not 0 => full names with obj/class proc/instproc - */ -static int -FilterInfo(Tcl_Interp *in, XOTclCmdList* f, char *pattern, - int withGuards, int fullProcQualifiers) { - CONST84 char *simpleName; - Tcl_Obj *list = Tcl_NewListObj(0, NULL); - - /* guard lists should only have unqualified filter lists - when withGuards is activated, fullProcQualifiers has not - effect */ - if (withGuards) { - fullProcQualifiers = 0; - } - - while (f) { - simpleName = Tcl_GetCommandName(in, f->cmdPtr); - if (!pattern || Tcl_StringMatch(simpleName, pattern)) { - if (withGuards && f->clientData) { - Tcl_Obj *innerList = Tcl_NewListObj(0, NULL); - Tcl_Obj *g = (Tcl_Obj*) f->clientData; - Tcl_ListObjAppendElement(in, innerList, - Tcl_NewStringObj(simpleName, -1)); - Tcl_ListObjAppendElement(in, innerList, XOTclGlobalObjects[XOTE_GUARD_OPTION]); - Tcl_ListObjAppendElement(in, innerList, g); - Tcl_ListObjAppendElement(in, list, innerList); - } else { - if (fullProcQualifiers) { - XOTclClass *fcl; - XOTclObject *fobj; - if (f->clorobj && !XOTclObjectIsClass(&f->clorobj->object)) { - fobj = (XOTclObject *)f->clorobj; - fcl = NULL; - } else { - fobj = NULL; - fcl = f->clorobj; - } - Tcl_ListObjAppendElement(in, list, - getFullProcQualifier(in, simpleName, - fobj, fcl, f->cmdPtr)); - } else { - Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj(simpleName, -1)); - } - } - } - f = f->next; - } - Tcl_SetObjResult(in, list); - return TCL_OK; -} - -/* - * Appends XOTclCmdPtr* containing the filter cmds and their - * superclass specializations to 'filterList' - */ -static void -FilterComputeOrderFullList(Tcl_Interp *in, XOTclCmdList **filters, - XOTclCmdList **filterList) { - XOTclCmdList *f ; - char *simpleName; - XOTclClass *fcl; - XOTclClasses *pl; - - /* - * ensure that no epoched command is in the filters list - */ - CmdListRemoveEpoched(filters, GuardDel); - - for (f = *filters; f; f = f->next) { - simpleName = (char *) Tcl_GetCommandName(in, f->cmdPtr); - fcl = f->clorobj; - CmdListAdd(filterList, f->cmdPtr, fcl, /*noDuplicates*/ 0); - - if (fcl && !XOTclObjectIsClass(&fcl->object)) { - /* get the object for per-object filter */ - XOTclObject *fObj = (XOTclObject *)fcl; - /* and then get class */ - fcl = fObj->cl; - } - - /* if we have a filter class -> search up the inheritance hierarchy*/ - if (fcl) { - pl = ComputeOrder(fcl, fcl->order, Super); - if (pl && pl->next) { - /* don't search on the start class again */ - pl = pl->next; - /* now go up the hierarchy */ - for(; pl; pl = pl->next) { - Tcl_Command pi = FindMethod(simpleName, pl->cl->nsPtr); - if (pi) { - CmdListAdd(filterList, pi, pl->cl, /*noDuplicates*/ 0); - /* - fprintf(stderr, " %s::%s, ", ObjStr(pl->cl->object.cmdName), simpleName); - */ - } - } - } - } - } - /*CmdListPrint(in,"FilterComputeOrderFullList....\n", *filterList);*/ -} - -/* - * Computes a linearized order of filter and instfilter. Then - * duplicates in the full list and with the class inheritance list of - * 'obj' are eliminated. - * The precendence rule is that the last occurence makes it into the - * final list. - */ -static void -FilterComputeOrder(Tcl_Interp *in, XOTclObject *obj) { - XOTclCmdList *filterList = 0, *next, *checker, *newlist; - XOTclClasses *pl; - - if (obj->filterOrder) FilterResetOrder(obj); - /* - fprintf(stderr, " List: ", ObjStr(obj->cmdName)); - */ - - /* append instfilters registered for mixins */ - if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) - MixinComputeDefined(in, obj); - - if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { - XOTclCmdList *ml = obj->mixinOrder; - XOTclClass *mixin; - while (ml) { - mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); - if (mixin && mixin->opt && mixin->opt->instfilters) - FilterComputeOrderFullList(in, &mixin->opt->instfilters, &filterList); - ml = ml->next; - } - } - - /* append per-obj filters */ - if (obj->opt) - FilterComputeOrderFullList(in, &obj->opt->filters, &filterList); - - /* append per-class filters */ - for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); pl; pl=pl->next) { - XOTclClassOpt* opt = pl->cl->opt; - if (opt && opt->instfilters) { - FilterComputeOrderFullList(in, &opt->instfilters, &filterList); - } - } - - /* - fprintf(stderr, "\n"); - */ - /* use no duplicates & no classes of the precedence order - on the resulting list */ - while (filterList) { - checker = next = filterList->next; - while (checker) { - if (checker->cmdPtr == filterList->cmdPtr) break; - checker = checker->next; - } - if (checker == 0) { - newlist = CmdListAdd(&obj->filterOrder, filterList->cmdPtr, filterList->clorobj, - /*noDuplicates*/ 0); - GuardAddInheritedGuards(in, newlist, obj, filterList->cmdPtr); - /* - fprintf(stderr, " Adding %s::%s,\n", filterList->cmdPtr->nsPtr->fullName, Tcl_GetCommandName(in, filterList->cmdPtr)); - */ - /* - GuardPrint(in, newlist->clientData); - */ - - } - - CmdListDeleteCmdListEntry(filterList, GuardDel); - - filterList = next; - } - /* - fprintf(stderr, "\n"); - */ -} - -/* - * the filter order is either - * DEFINED (there are filter on the instance), - * NONE (there are no filter for the instance), - * or INVALID (a class re-strucuturing has occured, thus it is not clear - * whether filters are defined or not). - * If it is INVALID FilterComputeDefined can be used to compute the order - * and set the instance to DEFINE or NONE - */ -static void -FilterComputeDefined(Tcl_Interp *in, XOTclObject *obj) { - FilterComputeOrder(in, obj); - obj->flags |= XOTCL_FILTER_ORDER_VALID; - if (obj->filterOrder) - obj->flags |= XOTCL_FILTER_ORDER_DEFINED; - else - obj->flags &= ~XOTCL_FILTER_ORDER_DEFINED; -} - -/* - * push a filter stack information on this object - */ -static int -FilterStackPush(Tcl_Interp *in, XOTclObject *obj, Tcl_Obj *calledProc) { - register XOTclFilterStack* h = NEW(XOTclFilterStack); - - h->currentCmdPtr = 0; - h->calledProc = calledProc; - INCR_REF_COUNT(h->calledProc); - h->next = obj->filterStack; - obj->filterStack = h; - return 1; -} - -/* - * pop a filter stack information on this object - */ -static void -FilterStackPop(XOTclObject *obj) { - register XOTclFilterStack *h = obj->filterStack; - obj->filterStack = h->next; - - /* free stack entry */ - DECR_REF_COUNT(h->calledProc); - FREE(XOTclFilterStack, h); -} - -/* - * walk through the filter order until the current filter is reached. - * then use the next filter as current filter. - * - * precondition: obj->filterStack is not NULL - */ -static void -FilterSeekCurrent(Tcl_Interp *in, XOTclObject *obj, XOTclCmdList **cmdList) { - Tcl_Command currentCmd = obj->filterStack->currentCmdPtr; - - assert(obj->flags & XOTCL_FILTER_ORDER_VALID); - /* ensure that the filter order is not invalid, otherwise compute order - FilterComputeDefined(in, obj); - */ - - *cmdList = obj->filterOrder; - - /* go forward to current class */ - while (*cmdList && currentCmd) { - if ((*cmdList)->cmdPtr == currentCmd) - currentCmd = 0; - *cmdList = (*cmdList)->next; - } -} - -/* - * seek through the filters active for "obj" and check whether cmdPtr - * is among them - */ -XOTCLINLINE static int -FilterActiveOnObj(Tcl_Interp *in, XOTclObject *obj, Tcl_Command cmd) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - XOTclCallStackContent *bot = cs->content; - register XOTclCallStackContent *csc = cs->top; - while (csc > bot) { - /* only check the callstack entries for this object && - only check the callstack entries for the given cmd */ - if (obj == csc->self && cmd == csc->cmdPtr && - csc->frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) { - return 1; - } - csc--; - } - return 0; -} - -/* - * search through the filter list on obj and class hierarchy - * for registration of a command ptr as filter - * - * returns a tcl obj list with the filter registration, like: - * " filter , - * " instfilter , - * or an empty list, if not registered - */ -static Tcl_Obj* -FilterFindReg(Tcl_Interp *in, XOTclObject *obj, Tcl_Command cmd) { - Tcl_Obj *list = Tcl_NewListObj(0, NULL); - XOTclClasses* pl; - - /* search per-object filters */ - if (obj->opt && CmdListFindCmdInList(cmd, obj->opt->filters)) { - Tcl_ListObjAppendElement(in, list, obj->cmdName); - Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_FILTER]); - Tcl_ListObjAppendElement(in, list, - Tcl_NewStringObj(Tcl_GetCommandName(in, cmd), -1)); - return list; - } - - /* search per-class filters */ - for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); pl; pl = pl->next) { - XOTclClassOpt* opt = pl->cl->opt; - if (opt && opt->instfilters) { - if (CmdListFindCmdInList(cmd, opt->instfilters)) { - Tcl_ListObjAppendElement(in, list, pl->cl->object.cmdName); - Tcl_ListObjAppendElement(in, list, XOTclGlobalObjects[XOTE_INSTFILTER]); - Tcl_ListObjAppendElement(in, list, - Tcl_NewStringObj(Tcl_GetCommandName(in, cmd), -1)); - return list; - } - } - } - return list; -} - -/* - * before we can perform a filter dispatch, FilterSearchProc seeks the - * current filter and the relevant calling information - */ -static Tcl_Command -FilterSearchProc(Tcl_Interp *in, XOTclObject *obj, Tcl_ObjCmdProc **proc, ClientData* cp, - Tcl_Command* currentCmd, XOTclClass **cl) { - XOTclCmdList *cmdList; - - assert(obj); - assert(obj->filterStack); - - *currentCmd = 0; - *proc = 0; - *cp = 0; - - FilterSeekCurrent(in, obj, &cmdList); - while (cmdList) { - if (Tcl_Command_cmdEpoch(cmdList->cmdPtr)) { - cmdList = cmdList->next; - } else if (FilterActiveOnObj(in, obj, cmdList->cmdPtr)) { - /* fprintf(stderr, "Filter <%s> -- Active on: %s\n", - Tcl_GetCommandName(in, (Tcl_Command)cmdList->cmdPtr), ObjStr(obj->cmdName)); - */ - obj->filterStack->currentCmdPtr = cmdList->cmdPtr; - FilterSeekCurrent(in, obj, &cmdList); - } else { - /* ok. we' ve found it */ - *proc = Tcl_Command_objProc(cmdList->cmdPtr); - *cp = Tcl_Command_objClientData(cmdList->cmdPtr); - if (cmdList->clorobj && !XOTclObjectIsClass(&cmdList->clorobj->object)) { - *cl = NULL; - } else { - *cl = cmdList->clorobj; - } - *currentCmd = cmdList->cmdPtr; - /* fprintf(stderr, "FilterSearchProc - found: %s, %p\n", - Tcl_GetCommandName(in, (Tcl_Command)cmdList->cmdPtr), cmdList->cmdPtr); - */ - return cmdList->cmdPtr; - } - } - return 0; -} - - -static int -SuperclassAdd(Tcl_Interp *in, XOTclClass *cl, int oc, Tcl_Obj **ov, Tcl_Obj *arg) { - XOTclClasses *filterCheck, *osl = 0; - XOTclClass **scl = 0; - int reversed = 0; - int i, j; - - filterCheck = ComputeOrder(cl, cl->order, Super); - /* - * we have to remove all dependent superclass filter referenced - * by class or one of its subclasses - * - * do not check the class "cl" itself (first entry in - * filterCheck class list) - */ - if (filterCheck) - filterCheck = filterCheck->next; - while (filterCheck) { - FilterRemoveDependentFilterCmds(cl, filterCheck->cl); - filterCheck = filterCheck->next; - } - - /* invalidate all interceptors orders of instances of this - and of all depended classes */ - MixinInvalidateObjOrders(in, cl); - FilterInvalidateObjOrders(in, cl); - - scl = NEW_ARRAY(XOTclClass*,oc); - for (i = 0; i < oc; i++) { - if (GetXOTclClassFromObj(in, ov[i], &scl[i], 1) != TCL_OK) { - FREE(XOTclClass**, scl); - return XOTclErrBadVal(in, "superclass", "a list of classes", - ObjStr(arg)); - } - } - - /* - * check that superclasses don't precede their classes - */ - - for (i = 0; i < oc; i++) { - if (reversed != 0) break; - for (j = i+1; j < oc; j++) { - XOTclClasses* dl = ComputeOrder(scl[j], scl[j]->order, Super); - if (reversed != 0) break; - while (dl != 0) { - if (dl->cl == scl[i]) break; - dl = dl->next; - } - if (dl != 0) reversed = 1; - } - } - - if (reversed != 0) { - return XOTclErrBadVal(in, "superclass", "classes in dependence order", - ObjStr(arg)); - } - - while (cl->super != 0) { - - /* - * build up an old superclass list in case we need to revert - */ - - XOTclClass *sc = cl->super->cl; - XOTclClasses* l = osl; - osl = NEW(XOTclClasses); - osl->cl = sc; - osl->next = l; - (void)RemoveSuper(cl, cl->super->cl); - } - for (i = 0; i < oc; i++) - AddSuper(cl, scl[i]); - FREE(XOTclClass**,scl); - FlushPrecedences(cl); - - if (!ComputeOrder(cl, cl->order, Super)) { - - /* - * cycle in the superclass graph, backtrack - */ - - XOTclClasses* l; - while (cl->super != 0) (void)RemoveSuper(cl, cl->super->cl); - for (l = osl; l != 0; l = l->next) AddSuper(cl, l->cl); - XOTclFreeClasses(osl); - return XOTclErrBadVal(in, "superclass", "a cycle-free graph", ObjStr(arg)); - } - XOTclFreeClasses(osl); - - /* if there are no more super classes add the Object - class as superclasses */ - if (cl->super == 0) - AddSuper(cl, RUNTIME_STATE(in)->theObject); - - Tcl_ResetResult(in); - return TCL_OK; -} - - - -static int -varExists(Tcl_Interp *in, XOTclObject *obj, char *varName, char *index, - int triggerTrace, int requireDefined) { - XOTcl_FrameDecls; - Var *varPtr, *arrayPtr; - int result; - int flags; - - flags = (index == NULL) ? TCL_PARSE_PART1 : 0; - - if (obj->nsPtr) { - Tcl_SetNamespaceResolvers(obj->nsPtr, (Tcl_ResolveCmdProc*)NULL, - varResolver, (Tcl_ResolveCompiledVarProc*)NULL); - } - - XOTcl_PushFrame(in, obj); - -#if defined(PRE83) - varPtr = TclLookupVar(in, varName, index, flags, "access", - /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); -#else - if (triggerTrace) - varPtr = TclVarTraceExists(in, varName); - else - varPtr = TclLookupVar(in, varName, index, flags, "access", - /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr); -#endif - result = ((varPtr != NULL) && - (!requireDefined || !TclIsVarUndefined(varPtr))); - - XOTcl_PopFrame(in, obj); - - if (obj->nsPtr) { - Tcl_SetNamespaceResolvers(obj->nsPtr, (Tcl_ResolveCmdProc*)NULL, - (Tcl_ResolveVarProc *)NULL, - (Tcl_ResolveCompiledVarProc*)NULL); - } - return result; -} - -static void -getVarAndNameFromHash(Tcl_HashEntry *hPtr, Var **val, Tcl_Obj **varNameObj) { - *val = VarHashGetValue(hPtr); -#if defined(PRE85) -# if FORWARD_COMPATIBLE - if (forwardCompatibleMode) { - *varNameObj = VarHashGetKey(*val); - } else { - *varNameObj = Tcl_NewStringObj(Tcl_GetHashKey(hPtr->tablePtr, hPtr),-1); - } -# else - *varNameObj = Tcl_NewStringObj(Tcl_GetHashKey(hPtr->tablePtr, hPtr),-1); -# endif -#else - *varNameObj = VarHashGetKey(*val); -#endif -} - -/* - * Search default values specified through 'parameter' on one class - */ -static int -SearchDefaultValuesOnClass(Tcl_Interp *in, XOTclObject *obj, - XOTclClass *cmdCl, XOTclClass *targetClass) { - int result = TCL_OK; - Var *defaults, *initcmds; - Tcl_Namespace *ns = targetClass->object.nsPtr; - TclVarHashTable *varTable = ns ? Tcl_Namespace_varTable(ns) : targetClass->object.varTable; - - defaults = LookupVarFromTable(varTable, "__defaults",(XOTclObject*)targetClass); - initcmds = LookupVarFromTable(varTable, "__initcmds",(XOTclObject*)targetClass); - - if (defaults && TclIsVarArray(defaults)) { - TclVarHashTable *tablePtr = valueOfVar(TclVarHashTable,defaults,tablePtr); - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr = tablePtr ? Tcl_FirstHashEntry(VarHashTable(tablePtr), &hSrch) : 0; - - /*fprintf(stderr, "+++ we have defaults for %s in <%s>\n", - ObjStr(obj->cmdName),className(targetClass));*/ - - /* iterate over all elements of the defaults array */ - for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { - Var *val; - Tcl_Obj *varNameObj; - - getVarAndNameFromHash(hPtr, &val, &varNameObj); - INCR_REF_COUNT(varNameObj); - - if (TclIsVarScalar(val)) { - Tcl_Obj *oldValue = XOTclOGetInstVar2((XOTcl_Object*) obj, - in, varNameObj, NULL, - TCL_LEAVE_ERR_MSG|TCL_PARSE_PART1); - /** we check whether the variable is already set. - if so, we do not set it again */ - if (oldValue == NULL) { - Tcl_Obj *valueObj = valueOfVar(Tcl_Obj,val,objPtr); - char *value = ObjStr(valueObj), *v; - int doSubst = 0; - for (v=value; *v; v++) { - if (*v == '[' && doSubst == 0) - doSubst = 1; - else if ((doSubst == 1 && *v == ']') || *v == '$') { - doSubst = 2; - break; - } - } - if (doSubst == 2) { /* we have to subst */ - Tcl_Obj *ov[2]; - int rc = CallStackPush(in, obj, cmdCl, 0, 1, - &varNameObj, XOTCL_CSC_TYPE_PLAIN); - if (rc != TCL_OK) { - DECR_REF_COUNT(varNameObj); - return rc; - } - ov[1] = valueObj; - Tcl_ResetResult(in); - rc = XOTcl_SubstObjCmd(NULL, in, 2, ov); - CallStackPop(in); - if (rc == TCL_OK) { - valueObj = Tcl_GetObjResult(in); - } else { - DECR_REF_COUNT(varNameObj); - return rc; - } - } - /*fprintf(stderr,"calling %s value='%s'\n", - ObjStr(varNameObj),ObjStr(valueObj));*/ - INCR_REF_COUNT(valueObj); - result = XOTclCallMethodWithArgs((ClientData)obj, in, - varNameObj, valueObj, 1, 0, 0); - DECR_REF_COUNT(valueObj); - - if (result != TCL_OK) { - DECR_REF_COUNT(varNameObj); - return result; - } - } - } - DECR_REF_COUNT(varNameObj); - } - } - - if (initcmds && TclIsVarArray(initcmds)) { - TclVarHashTable *tablePtr = valueOfVar(TclVarHashTable,initcmds,tablePtr); - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr = tablePtr ? Tcl_FirstHashEntry(VarHashTable(tablePtr), &hSrch) : 0; - - /*fprintf(stderr, "+++ we have initcmds for <%s>\n", className(targetClass));*/ - /* iterate over the elements of initcmds */ - for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { - Var *val; - Tcl_Obj *varNameObj; - - getVarAndNameFromHash(hPtr, &val, &varNameObj); - - INCR_REF_COUNT(varNameObj); - /*fprintf(stderr,"varexists(%s->%s) = %d\n", - ObjStr(obj->cmdName), - ObjStr(varNameObj), varExists(in, obj, ObjStr(varNameObj), NULL, 0, 0));*/ - - if (TclIsVarScalar(val) && - (!varExists(in, obj, ObjStr(varNameObj), NULL, 0, 0) || - varExists(in, &targetClass->object, "__defaults", ObjStr(varNameObj), 0,0) - )) { - Tcl_Obj *valueObj = valueOfVar(Tcl_Obj,val,objPtr); - char *string = ObjStr(valueObj); - int rc; - XOTcl_FrameDecls; - if (*string) { - XOTcl_PushFrame(in, obj); /* make instvars accessible */ - CallStackPush(in, obj, cmdCl, 0, 1, - &varNameObj, XOTCL_CSC_TYPE_PLAIN); /*allow to call self*/ - - /*fprintf(stderr,"evaluating '%s' obj=%s\n\n",ObjStr(valueObj),ObjStr(obj->cmdName)); - XOTclCallStackDump(in);*/ - - rc = Tcl_EvalObjEx(in, valueObj, TCL_EVAL_DIRECT); - CallStackPop(in); - XOTcl_PopFrame(in, obj); - if (rc != TCL_OK) { - DECR_REF_COUNT(varNameObj); - return rc; - } - /* fprintf(stderr,"... varexists(%s->%s) = %d\n", - ObjStr(obj->cmdName), - varName, varExists(in, obj, varName, NULL, 0, 0)); */ - } - } - DECR_REF_COUNT(varNameObj); - } - } - return result; -} - -/* - * Search default values specified through 'parameter' on - * mixin and class hierarchy - */ -static int -SearchDefaultValues(Tcl_Interp *in, XOTclObject *obj, XOTclClass *cmdCl) { - XOTcl_FrameDecls; - XOTclClass *cl = obj->cl, *mixin; - XOTclClasses *pl = 0; - XOTclCmdList *ml = 0; - int result = TCL_OK; - - if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) - MixinComputeDefined(in, obj); - if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) - ml = obj->mixinOrder; - - assert(cl); - - XOTcl_PushFrame(in, obj); - - while (ml) { - mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); - result = SearchDefaultValuesOnClass(in, obj, cmdCl, mixin); - if (result != TCL_OK) - break; - ml = ml->next; - } - - for (pl = ComputeOrder(cl, cl->order, Super); pl; pl = pl->next) { - result = SearchDefaultValuesOnClass(in, obj, cmdCl, pl->cl); - if (result != TCL_OK) - break; - } - - XOTcl_PopFrame(in,obj); - return result; -} - -static int -ParameterSearchDefaultsMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - XOTclObject *defaultObj; - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc != 2) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "searchDefaults obj"); - if (XOTclObjConvertObject(in, objv[1], &defaultObj) != TCL_OK) - return XOTclVarErrMsg(in, "Can't find default object ", - ObjStr(objv[1]), (char *) NULL); - - /* - * Search for default values for vars on superclasses - */ - return SearchDefaultValues(in, defaultObj, defaultObj->cl); -} - -static int -callParameterMethodWithArg(XOTclObject *obj, Tcl_Interp *in, Tcl_Obj *method, - Tcl_Obj *arg, int objc, Tcl_Obj *CONST objv[], int flags) { - XOTclClassOpt* opt = obj->cl->opt; - Tcl_Obj *pcl = XOTclGlobalObjects[XOTE_PARAM_CL]; - XOTclClass *paramCl; - int result; - - if (opt && opt->parameterClass) pcl = opt->parameterClass; - - if (GetXOTclClassFromObj(in,pcl,¶mCl, 1) == TCL_OK) { - result = XOTclCallMethodWithArgs((ClientData)paramCl, in, - method, arg, objc-2, objv, flags); - } - else - result = XOTclVarErrMsg(in, "create: can't find parameter class", - (char *) NULL); - return result; -} - - -/* - * method dispatch - */ - -/* actually call a method (with assertion checking) */ -static int -callProcCheck(ClientData cp, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[], - Tcl_Command cmd, XOTclObject *obj, XOTclClass *cl, - char *methodName, int frameType, int isTclProc) { - int result = TCL_OK; - XOTclRuntimeState *rst = RUNTIME_STATE(in); - CheckOptions co; - -#if defined(PROFILE) - long int startUsec, startSec; - struct timeval trt; - - gettimeofday(&trt, NULL); - startSec = trt.tv_sec; - startUsec = trt.tv_usec; -#endif - assert(obj); - - rst->callIsDestroy = 0; - /*fprintf(stderr,"callProcCheck: setting callIsDestroy = 0, m=%s obj=%p (%s)\n", - methodName, obj, ObjStr(obj->cmdName));*/ - - /* - fprintf(stderr,"*** callProcCheck: cmd = %p\n",cmd); - fprintf(stderr, - "cp=%p, isTclProc=%d %p %s, dispatch=%d %p, forward=%d %p, scoped %p, ov[0]=%p oc=%d\n", - cp, - isTclProc, cmd, - Tcl_GetCommandName(in, cmd), - Tcl_Command_objProc(cmd) == XOTclObjDispatch, XOTclObjDispatch, - Tcl_Command_objProc(cmd) == XOTclForwardMethod, XOTclForwardMethod, - XOTclObjscopedMethod, - objv[0], objc - );*/ - - -#ifdef CALLSTACK_TRACE - XOTclCallStackDump(in); -#endif - - if (!isTclProc && obj->teardown) { - co = 0; - if (obj->opt) co = obj->opt->checkoptions; - if ((co & CHECK_INVAR) && - ((result = AssertionCheckInvars(in, obj, methodName, co)) == TCL_ERROR)) { - goto finish; - } - -#ifdef DISPATCH_TRACE - printCall(in,"callProcCheck cmd", objc,objv); - /*fprintf(stderr,"\tproc=%s\n",Tcl_GetCommandName(in,cmd));*/ -#endif - result = (*Tcl_Command_objProc(cmd))(cp, in, objc, objv); - -#ifdef DISPATCH_TRACE - printExit(in,"callProcCheck cmd", objc,objv, result); - /*fprintf(stderr, " returnCode %d xotcl rc %d\n", - Tcl_Interp_returnCode(in), rst->returnCode);*/ -#endif - - /* - if (obj && obj->teardown && cl && !(obj->flags & XOTCL_DESTROY_CALLED)) { - fprintf(stderr, "Obj= %s ", ObjStr(obj->cmdName)); - fprintf(stderr, "CL= %s ", ObjStr(cl->object.cmdName)); - fprintf(stderr, "method=%s\n", methodName); - } - */ - co = 0; - if (!rst->callIsDestroy && obj->opt) co = obj->opt->checkoptions; - if ((co & CHECK_INVAR) && - ((result = AssertionCheckInvars(in, obj, methodName,co)) == TCL_ERROR)) { - goto finish; - } - } else { - /* isTclProc == 1 - * if this is a filter, check whether its guard applies, - * if not: just step forward to the next filter - */ - if (frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) { - XOTclCmdList *cmdList; - /* - * seek cmd in obj's filterOrder - */ - assert(obj->flags & XOTCL_FILTER_ORDER_VALID); - /* otherwise: FilterComputeDefined(in, obj);*/ - - cmdList = obj->filterOrder; - while (cmdList && cmdList->cmdPtr != cmd) - cmdList = cmdList->next; - - /* - * when it is found, check whether it has a filter guard - */ - if (cmdList) { - int rc = GuardCall(obj, cl, (Tcl_Command) cmdList->cmdPtr, in, - cmdList->clientData, 0); - if (rc != TCL_OK) { - if (rc != TCL_ERROR) { - /* - * call next, use the given objv's, not the callstack objv - * we may not be in a method, thus there may be wrong or - * no callstackobjs - */ - /*fprintf(stderr, "... calling nextmethod\n"); XOTclCallStackDump(in);*/ - - rc = XOTclNextMethod(obj, in, cl, methodName, - objc, objv, /*useCallStackObjs*/ 0); - /*fprintf(stderr, "... after nextmethod\n"); - XOTclCallStackDump(in);*/ - - } - - return rc; - } - } - } - - if (!rst->callIsDestroy && obj->teardown - && !(obj->flags & XOTCL_DESTROY_CALLED)) { - if (obj->opt && - (obj->opt->checkoptions & CHECK_PRE) && - (result = AssertionCheck(in, obj, cl, methodName, CHECK_PRE)) == TCL_ERROR) { - goto finish; - } - } - - if (Tcl_Interp_numLevels(in) <= 2) - rst->returnCode = TCL_OK; -#ifdef DISPATCH_TRACE - printCall(in,"callProcCheck tclCmd", objc,objv); - fprintf(stderr,"\tproc=%s\n",Tcl_GetCommandName(in,cmd)); -#endif - - result = (*Tcl_Command_objProc(cmd))(cp, in, objc, objv); - -#ifdef DISPATCH_TRACE - printExit(in,"callProcCheck tclCmd", objc,objv, result); - /* fprintf(stderr, " returnCode %d xotcl rc %d\n", - Tcl_Interp_returnCode(in), rst->returnCode);*/ -#endif - /*if (Tcl_Interp_numLevels(in) <= 2 && rst->returnCode == TCL_BREAK) - result = TCL_BREAK; - else*/ if (result == TCL_BREAK && rst->returnCode == TCL_OK) - rst->returnCode = result; - - /* we give the information whether the call has destroyed the - object back to the caller, because after CallStackPop it - cannot be retrieved via the call stack */ - /* if the object is destroyed -> the assertion structs's are already - destroyed */ - if (rst->cs.top->callType & XOTCL_CSC_CALL_IS_DESTROY) { - rst->callIsDestroy = 1; - /*fprintf(stderr,"callProcCheck: setting callIsDestroy = 1\n");*/ - } - - if (obj->opt && !rst->callIsDestroy && obj->teardown && - (obj->opt->checkoptions & CHECK_POST) && - (result = AssertionCheck(in, obj, cl, methodName, CHECK_POST) == TCL_ERROR)) { - goto finish; - } - } - - finish: - -#if defined(PROFILE) - if (rst->callIsDestroy == 0) { - XOTclProfileEvaluateData(in, startSec, startUsec, obj, cl, methodName); - } -#endif - - return result; -} - -static int -DoCallProcCheck(ClientData cp, ClientData cd, Tcl_Interp *in, - int objc, Tcl_Obj *CONST objv[], - Tcl_Command cmd, XOTclObject *obj, - XOTclClass *cl, char *methodName, - int frameType, int fromNext) { - int rc, push = 1, isTclProc = 0; - - if (cp) { - Tcl_ObjCmdProc *proc = Tcl_Command_objProc(cmd); - if (proc == XOTclObjDispatch) { - assert((TclIsProc((Command *)cmd) == NULL)); - } else if (proc == XOTclForwardMethod || - proc == XOTclObjscopedMethod) { - tclCmdClientData *tcd = (tclCmdClientData *)cp; - tcd->obj = obj; - assert((TclIsProc((Command *)cmd) == NULL)); - } else if (cp == XOTCL_NONLEAF_METHOD) { - cp = cd; - assert((TclIsProc((Command *)cmd) == NULL)); - } else { - assert((TclIsProc((Command *)cmd) != NULL)); - isTclProc = 1; - } - } else { - push = 0; - assert((TclIsProc((Command *)cmd) == NULL)); - cp = cd; - } - - if (!fromNext) { - objc--; - objv++; - } - - if (push) { - /* push the xotcl info */ - if ((CallStackPush(in, obj, cl, cmd, objc, objv, frameType)) != TCL_OK) - return TCL_ERROR; - } - rc = callProcCheck(cp, in, objc, objv, cmd, obj, cl, - methodName, frameType, isTclProc); - if (push) { - CallStackPop(in); - } - - return rc; -} - - -XOTCLINLINE static int -DoDispatch(ClientData cd, Tcl_Interp *in, int objc, - Tcl_Obj *CONST objv[], int flags) { - register XOTclObject *obj = (XOTclObject*)cd; - int result = TCL_OK, mixinStackPushed = 0, - filterStackPushed = 0, unknown, objflags, - frameType = XOTCL_CSC_TYPE_PLAIN; -#ifdef OBJDELETION_TRACE - Tcl_Obj *method; -#endif - char *methodName, *callMethod; - XOTclClass *cl = 0; - ClientData cp = 0; - Tcl_ObjCmdProc *proc = 0; - Tcl_Command cmd = 0; - XOTclRuntimeState *rst = RUNTIME_STATE(in); - Tcl_Obj *cmdName = obj->cmdName; - XOTclCallStack *cs = &rst->cs; - /*int isdestroy = (objv[1] == XOTclGlobalObjects[XOTE_DESTROY]); */ -#ifdef AUTOVARS - int isNext; -#endif - - assert(objc>0); - methodName = ObjStr(objv[1]); - -#ifdef AUTOVARS - isNext = isNextString(methodName); -#endif -#ifdef DISPATCH_TRACE - printCall(in,"DISPATCH", objc,objv); -#endif - -#ifdef OBJDELETION_TRACE - method = objv[1]; - if (method == XOTclGlobalObjects[XOTE_CLEANUP] || - method == XOTclGlobalObjects[XOTE_DESTROY]) { - fprintf(stderr, "%s->%s id=%p destroyCalled=%d\n", - ObjStr(cmdName), methodName, obj, - (obj->flags & XOTCL_DESTROY_CALLED)); - } -#endif - - objflags = obj->flags; /* avoid stalling */ - INCR_REF_COUNT(cmdName); - - if (!(objflags & XOTCL_FILTER_ORDER_VALID)) - FilterComputeDefined(in, obj); - - if (!(objflags & XOTCL_MIXIN_ORDER_VALID)) - MixinComputeDefined(in, obj); - - callMethod = methodName; -#ifdef AUTOVARS - if (!isNext) { -#endif - /* Only start new filter chain, if - (a) filters are defined and - (b) the toplevel csc entry is not an filter on self - */ - if (RUNTIME_STATE(in)->doFilters && - !(flags & XOTCL_CM_NO_FILTERS) && !cs->guardCount && - ((obj->flags & XOTCL_FILTER_ORDER_DEFINED_AND_VALID) == - XOTCL_FILTER_ORDER_DEFINED_AND_VALID)) { - XOTclObject *self = GetSelfObj(in); - if (obj != self || - cs->top->frameType != XOTCL_CSC_TYPE_ACTIVE_FILTER) { - - filterStackPushed = FilterStackPush(in, obj, objv[1]); - cmd = FilterSearchProc(in, obj, &proc, &cp, - &obj->filterStack->currentCmdPtr,&cl); - if (cmd) { /* 'proc' and the other output vars are set as well */ - frameType = XOTCL_CSC_TYPE_ACTIVE_FILTER; - callMethod = (char *)Tcl_GetCommandName(in, cmd); - } else { - FilterStackPop(obj); - filterStackPushed = 0; - } - } - } - - /* check if a mixin is to be called. - don't use mixins on next method calls, since normally it is not - intercepted (it is used as a primitive command). - don't use mixins on init calls, since init is invoked on mixins - during mixin registration (in XOTclOMixinMethod) - */ - - if ((obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) == - XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { - - mixinStackPushed = MixinStackPush(obj); - - if (frameType != XOTCL_CSC_TYPE_ACTIVE_FILTER) { - cmd = MixinSearchProc(in, obj, methodName, &cl, &proc, &cp, - &obj->mixinStack->currentCmdPtr); - if (cmd) { /* 'proc' and the other output vars are set as well */ - frameType = XOTCL_CSC_TYPE_ACTIVE_MIXIN; - } else { /* the else branch could be deleted */ - MixinStackPop(obj); - mixinStackPushed = 0; - } - } - } -#ifdef AUTOVARS - } -#endif - - /* if no filter/mixin is found => do ordinary method lookup */ - if (proc == 0) { - /* - fprintf(stderr,"ordinary lookup for obj %p method %s nsPtr %p\n", - obj, methodName, obj->nsPtr);*/ - /*if (obj->nsPtr && !(obj->flags & XOTCL_NS_DESTROYED))*/ - if (obj->nsPtr) - cmd = FindMethod(methodName, obj->nsPtr); - /*fprintf(stderr,"findMethod for proc '%s' in %p returned %p\n",methodName, obj->nsPtr, cmd);*/ - - if (cmd == NULL) - cl = SearchCMethod(obj->cl, methodName, &cmd); - - if (cmd) { - proc = Tcl_Command_objProc(cmd); - cp = Tcl_Command_objClientData(cmd); - } else { - assert(cp == 0); - } - } - - if (proc) { - result = TCL_OK; - if ((result = DoCallProcCheck(cp, cd, in, objc, objv, cmd, obj, cl, - callMethod, frameType, 0 /* fromNext */)) == TCL_ERROR) { - result = XOTclErrInProc(in, cmdName, cl ? cl->object.cmdName : NULL, callMethod); - } - unknown = RUNTIME_STATE(in)->unknown; - } else { - unknown = 1; - } - - if (result == TCL_OK) { - /*fprintf(stderr,"after doCallProcCheck unknown == %d\n",unknown);*/ - if (unknown) { - - if (XOTclObjectIsClass(obj) && (flags & XOTCL_CM_NO_UNKNOWN)) { - return XOTclVarErrMsg(in, ObjStr(objv[0]), - ": unable to dispatch method '", - callMethod, "'", (char *) NULL); - } else if (objv[1] != XOTclGlobalObjects[XOTE_UNKNOWN]) { - /* - * back off and try unknown; - */ - XOTclObject *obj = (XOTclObject*)cd; - ALLOC_ON_STACK(Tcl_Obj*,objc+1, tov); - /* - fprintf(stderr,"calling unknown for %s %s, flgs=%02x,%02x isClass=%d %p %s\n", - ObjStr(obj->cmdName), ObjStr(objv[1]), flags, XOTCL_CM_NO_UNKNOWN, - XOTclObjectIsClass(obj), obj, ObjStr(obj->cmdName)); - */ - tov[0] = obj->cmdName; - tov[1] = XOTclGlobalObjects[XOTE_UNKNOWN]; - if (objc>1) - memcpy(tov+2, objv+1, sizeof(Tcl_Obj *)*(objc-1)); - /* - fprintf(stderr,"?? %s unknown %s\n",ObjStr(obj->cmdName), ObjStr(tov[2])); - */ - result = DoDispatch(cd, in, objc+1, tov, flags | XOTCL_CM_NO_UNKNOWN); - FREE_ON_STACK(tov); - - } else { /* unknown failed */ - return XOTclVarErrMsg(in, ObjStr(objv[0]), - ": unable to dispatch method '", - ObjStr(objv[2]), "'", (char *) NULL); - } - - } - } - /* be sure to reset unknown flag */ - if (unknown) - RUNTIME_STATE(in)->unknown = 0; - -#ifdef DISPATCH_TRACE - printExit(in,"DISPATCH", objc,objv, result); - fprintf(stderr,"obj %p mixinStackPushed %d mixinStack %p\n", - obj, mixinStackPushed, obj->mixinStack); -#endif - - - /*if (!rst->callIsDestroy ) - fprintf(stderr, "obj freed? %p destroy %p self %p %s %d [%d] reference=%d,%d\n",obj, - cs->top->destroyedCmd, cs->top->self, ObjStr(objv[1]), - rst->callIsDestroy, - cs->top->callType & XOTCL_CSC_CALL_IS_DESTROY, - !rst->callIsDestroy, - isdestroy);*/ - - - if (!rst->callIsDestroy) { - /*!(obj->flags & XOTCL_DESTROY_CALLED)) {*/ - if (mixinStackPushed && obj->mixinStack) - MixinStackPop(obj); - - if (filterStackPushed && obj->filterStack) - FilterStackPop(obj); - } - - DECR_REF_COUNT(cmdName); /* must be after last dereferencing of obj */ - return result; -} - -static int -ObjDispatch(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[], - int flags) { - int result; - -#ifdef STACK_TRACE - XOTclStackDump(in); -#endif - -#ifdef CALLSTACK_TRACE - XOTclCallStackDump(in); -#endif - - if (objc == 1) { - Tcl_Obj *tov[2]; - tov[0] = objv[0]; - tov[1] = XOTclGlobalObjects[XOTE_DEFAULTMETHOD]; - result = DoDispatch(cd, in, 2, tov, flags); - } else { - /* normal dispatch */ - result = DoDispatch(cd, in, objc, objv, flags); - } - - return result; -} - -#ifdef XOTCL_BYTECODE -int -XOTclDirectSelfDispatch(ClientData cd, Tcl_Interp *in, - int objc, Tcl_Obj *CONST objv[]) { - int result; -#ifdef XOTCLOBJ_TRACE - XOTclObject *obj; -#endif - objTrace("BEFORE SELF DISPATCH", obj); - result = ObjDispatch((ClientData)GetSelfObj(in), in, objc, objv, 0); - objTrace("AFTER SELF DISPATCH", obj); - return result; -} -#endif - -int -XOTclObjDispatch(ClientData cd, Tcl_Interp *in, - int objc, Tcl_Obj *CONST objv[]) { - return ObjDispatch(cd, in, objc, objv, 0); -} - -/* - * Non Positional Args - */ - -static void -NonposArgsDeleteHashEntry(Tcl_HashEntry* hPtr) { - XOTclNonposArgs* nonposArg = (XOTclNonposArgs*) Tcl_GetHashValue(hPtr); - if (nonposArg) { - DECR_REF_COUNT(nonposArg->nonposArgs); - DECR_REF_COUNT(nonposArg->ordinaryArgs); - MEM_COUNT_FREE("nonposArg",nonposArg); - ckfree((char *) nonposArg); - Tcl_DeleteHashEntry(hPtr); - } -} - -static Tcl_HashTable* -NonposArgsCreateTable() { - Tcl_HashTable* nonposArgsTable = - (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); - MEM_COUNT_ALLOC("Tcl_HashTable",nonposArgsTable); - Tcl_InitHashTable(nonposArgsTable, TCL_STRING_KEYS); - MEM_COUNT_ALLOC("Tcl_InitHashTable",nonposArgsTable); - return nonposArgsTable; -} - -static void -NonposArgsFreeTable(Tcl_HashTable* nonposArgsTable) { - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr = nonposArgsTable ? - Tcl_FirstHashEntry(nonposArgsTable, &hSrch) : 0; - for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { - NonposArgsDeleteHashEntry(hPtr); - } -} - -static XOTclNonposArgs* -NonposArgsGet(Tcl_HashTable* nonposArgsTable, char * methodName) { - Tcl_HashEntry* hPtr; - if (nonposArgsTable && - ((hPtr = Tcl_FindHashEntry(nonposArgsTable, methodName)))) { - return (XOTclNonposArgs*) Tcl_GetHashValue(hPtr); - } - return NULL; -} - -static Tcl_Obj* -NonposArgsFormat(Tcl_Interp *in, Tcl_Obj* nonposArgsData) { - int r1, npalistc, npac, checkc, i, j, first; - Tcl_Obj **npalistv, **npav, **checkv, - *list = Tcl_NewListObj(0, NULL), *innerlist, - *nameStringObj; - - /*fprintf(stderr, "nonposargsformat '%s'\n", ObjStr(nonposArgsData));*/ - - r1 = Tcl_ListObjGetElements(in, nonposArgsData, &npalistc, &npalistv); - if (r1 == TCL_OK) { - for (i=0; i < npalistc; i++) { - r1 = Tcl_ListObjGetElements(in, npalistv[i], &npac, &npav); - if (r1 == TCL_OK) { - nameStringObj = Tcl_NewStringObj("-", 1); - Tcl_AppendStringsToObj(nameStringObj, ObjStr(npav[0]), - (char *) NULL); - if (npac > 1 && *(ObjStr(npav[1])) != '\0') { - first = 1; - r1 = Tcl_ListObjGetElements(in, npav[1], &checkc, &checkv); - if (r1 == TCL_OK) { - for (j=0; j < checkc; j++) { - if (first) { - Tcl_AppendToObj(nameStringObj,":",1); - first = 0; - } else { - Tcl_AppendToObj(nameStringObj,",",1); - } - Tcl_AppendToObj(nameStringObj, ObjStr(checkv[j]), -1); - } - } - } - /* fprintf(stderr, "nonposargsformat namestring '%s'\n", - ObjStr(nameStringObj));*/ - -#if 1 - innerlist = Tcl_NewListObj(0, NULL); - Tcl_ListObjAppendElement(in, innerlist, nameStringObj); - if (npac > 2) { - Tcl_ListObjAppendElement(in, innerlist, npav[2]); - } -#else - { - Tcl_DString ds, *dsPtr = &ds; - DSTRING_INIT(dsPtr); - Tcl_DStringAppend(dsPtr, ObjStr(nameStringObj), -1); - if (npac > 2) { - Tcl_DStringAppendElement(dsPtr, ObjStr(npav[2])); - } - innerlist = Tcl_NewStringObj(Tcl_DStringValue(dsPtr), - Tcl_DStringLength(dsPtr)); - DSTRING_FREE(dsPtr); - } -#endif - Tcl_ListObjAppendElement(in, list, innerlist); - } - } - } - return list; -} - -/* - * Proc-Creation - */ - -static Tcl_Obj* addPrefixToBody(Tcl_Obj *body, int nonposArgs) { - Tcl_Obj* resultBody; - resultBody = Tcl_NewStringObj("", 0); - INCR_REF_COUNT(resultBody); - Tcl_AppendStringsToObj(resultBody, "::xotcl::initProcNS\n", (char *) NULL); - if (nonposArgs) { - Tcl_AppendStringsToObj(resultBody, - "::xotcl::interpretNonpositionalArgs $args\n", - (char *) NULL); - } - Tcl_AppendStringsToObj(resultBody, ObjStr(body), (char *) NULL); - return resultBody; -} - -static int -parseNonposArgs(Tcl_Interp *in, - char *procName, Tcl_Obj *npArgs, Tcl_Obj *ordinaryArgs, - Tcl_HashTable **nonposArgsTable, - int *haveNonposArgs) { - int rc, nonposArgsDefc, npac; - Tcl_Obj **nonposArgsDefv; - - rc = Tcl_ListObjGetElements(in, npArgs, &nonposArgsDefc, &nonposArgsDefv); - if (rc != TCL_OK) { - return XOTclVarErrMsg(in, "cannot break down non-positional args: ", - ObjStr(npArgs), (char *) NULL); - } - if (nonposArgsDefc > 0) { - int start, end, length, i, j, nw = 0; - char *arg; - Tcl_Obj *npaObj, **npav, *nonposArgsObj = Tcl_NewListObj(0, NULL); - Tcl_HashEntry *hPtr; - - INCR_REF_COUNT(nonposArgsObj); - for (i=0; i < nonposArgsDefc; i++) { - rc = Tcl_ListObjGetElements(in, nonposArgsDefv[i], &npac, &npav); - if (rc == TCL_ERROR || npac < 1 || npac > 2) { - DECR_REF_COUNT(nonposArgsObj); - return XOTclVarErrMsg(in, "wrong # of elements in non-positional args ", - "(should be 1 or 2 list elements): ", - ObjStr(npArgs), (char *) NULL); - } - npaObj = Tcl_NewListObj(0, NULL); - arg = ObjStr(npav[0]); - if (arg[0] != '-') { - DECR_REF_COUNT(npaObj); - DECR_REF_COUNT(nonposArgsObj); - return XOTclVarErrMsg(in, "non-positional args does not start with '-': ", - arg, " in: ", ObjStr(npArgs), (char *) NULL); - } - - length = strlen(arg); - for (j=0; j0 && isspace((int)arg[end-1]); end--); - Tcl_ListObjAppendElement(in, list, - Tcl_NewStringObj(arg+start, end-start)); - l++; - start = l; - while(start0 && isspace((int)arg[end-1]); end--); - Tcl_ListObjAppendElement(in, list, - Tcl_NewStringObj(arg+start, end-start)); - - /* append the whole thing to the list */ - Tcl_ListObjAppendElement(in, npaObj, list); - } else { - Tcl_ListObjAppendElement(in, npaObj, Tcl_NewStringObj(arg+1, length)); - Tcl_ListObjAppendElement(in, npaObj, Tcl_NewStringObj("", 0)); - } - if (npac == 2) { - Tcl_ListObjAppendElement(in, npaObj, npav[1]); - } - Tcl_ListObjAppendElement(in, nonposArgsObj, npaObj); - *haveNonposArgs = 1; - } - - if (*haveNonposArgs) { - XOTclNonposArgs* nonposArg; - - if (*nonposArgsTable == 0) { - *nonposArgsTable = NonposArgsCreateTable(); - } - - hPtr = Tcl_CreateHashEntry(*nonposArgsTable, procName, &nw); - assert(nw); - - MEM_COUNT_ALLOC("nonposArg",nonposArg); - nonposArg = (XOTclNonposArgs*)ckalloc(sizeof(XOTclNonposArgs)); - nonposArg->nonposArgs = nonposArgsObj; - nonposArg->ordinaryArgs = ordinaryArgs; - INCR_REF_COUNT(ordinaryArgs); - Tcl_SetHashValue(hPtr, (ClientData)nonposArg); - } else { - /* for strange reasons, we did not find nonpos-args, although we - have definitions */ - DECR_REF_COUNT(nonposArgsObj); - } - } - return TCL_OK; -} - - -static int -MakeProc(Tcl_Namespace *ns, XOTclAssertionStore *aStore, - Tcl_HashTable **nonposArgsTable, - Tcl_Interp *in, int objc, Tcl_Obj *objv[], XOTclObject *obj) { - int result, incr, haveNonposArgs=0; - TclCallFrame frame, *framePtr = &frame; - Tcl_Obj *ov[4]; - Tcl_HashEntry* hPtr = NULL; - char *procName = ObjStr(objv[1]); - - if (*nonposArgsTable && (hPtr = Tcl_FindHashEntry(*nonposArgsTable, procName))) { - NonposArgsDeleteHashEntry(hPtr); - } - - ov[0] = objv[0]; - ov[1] = objv[1]; - - if (objc == 5 || objc == 7) { - if ((result = parseNonposArgs(in, procName, objv[2], objv[3], - nonposArgsTable, &haveNonposArgs)) != TCL_OK) - return result; - - if (haveNonposArgs) { - ov[2] = XOTclGlobalObjects[XOTE_ARGS]; - ov[3] = addPrefixToBody(objv[4], 1); - } else { /* no nonpos arguments */ - ov[2] = objv[3]; - ov[3] = addPrefixToBody(objv[4], 0); - } - } else { -#if !defined(XOTCL_DISJOINT_ARGLISTS) - int argsc, i; - Tcl_Obj **argsv; - - /* see, if we have nonposArgs in the ordinary argument list */ - result = Tcl_ListObjGetElements(in, objv[2], &argsc, &argsv); - if (result != TCL_OK) { - return XOTclVarErrMsg(in, "cannot break args into list: ", - ObjStr(objv[2]), (char *) NULL); - } - for (i=0; i 0) { - arg = ObjStr(npav[0]); - /* fprintf(stderr, "*** argparse1 arg='%s' rc=%d\n",arg,rc);*/ - if (*arg == '-') { - haveNonposArgs = 1; - continue; - } - } - break; - } - if (haveNonposArgs) { - int nrOrdinaryArgs = argsc - i; - Tcl_Obj *ordinaryArgs = Tcl_NewListObj(nrOrdinaryArgs, &argsv[i]); - Tcl_Obj *nonposArgs = Tcl_NewListObj(i, &argsv[0]); - INCR_REF_COUNT(ordinaryArgs); - INCR_REF_COUNT(nonposArgs); - /* fprintf(stderr, "nonpos <%s> ordinary <%s>\n", - ObjStr(nonposArgs),ObjStr(ordinaryArgs));*/ - result = parseNonposArgs(in, procName, nonposArgs, ordinaryArgs, - nonposArgsTable, &haveNonposArgs); - DECR_REF_COUNT(ordinaryArgs); - DECR_REF_COUNT(nonposArgs); - if (result != TCL_OK) - return result; - } -#endif - if (haveNonposArgs) { - ov[2] = XOTclGlobalObjects[XOTE_ARGS]; - ov[3] = addPrefixToBody(objv[3], 1); - } else { /* no nonpos arguments */ - ov[2] = objv[2]; - ov[3] = addPrefixToBody(objv[3], 0); - } - - } - -#ifdef AUTOVARS - { char *p, *body; - body = ObjStr(ov[3]); - if ((p = strstr(body, "self")) && p != body && *(p-1) != '[') - Tcl_AppendStringsToObj(ov[3], "::set self [self]\n", (char *) NULL); - if (strstr(body, "proc")) - Tcl_AppendStringsToObj(ov[3], "::set proc [self proc]\n", (char *) NULL); - if (strstr(body, "class")) - Tcl_AppendStringsToObj(ov[3], "::set class [self class]\n", (char *) NULL); - } -#endif - - Tcl_PushCallFrame(in,(Tcl_CallFrame *)framePtr,ns,0); - - result = Tcl_ProcObjCmd(0, in, 4, ov) != TCL_OK; -#if defined(NAMESPACEINSTPROCS) - { - Proc *procPtr = TclFindProc((Interp *)in, procName); - /*fprintf(stderr,"proc=%p cmd=%p ns='%s' objns=%s\n",procPtr,procPtr->cmdPtr, - procPtr->cmdPtr->nsPtr->fullName,cmd->nsPtr->fullName);*/ - /*** patch the command ****/ - if (procPtr) { - /* procPtr->cmdPtr = (Command *)obj->id; OLD*/ - procPtr->cmdPtr->nsPtr = ((Command *)obj->id)->nsPtr; - } - } -#endif - - Tcl_PopCallFrame(in); - - if (objc == 6 || objc == 7) { - incr = (objc == 6) ? 0:1; - AssertionAddProc(in, ObjStr(objv[1]), aStore, objv[4+incr], objv[5+incr]); - } - - DECR_REF_COUNT(ov[3]); - - return result; -} - -/* - * List-Functions for Info - */ -static int -ListInfo(Tcl_Interp *in, int isclass) { - Tcl_ResetResult(in); - Tcl_AppendElement(in, "vars"); Tcl_AppendElement(in, "body"); - Tcl_AppendElement(in, "default"); Tcl_AppendElement(in, "args"); - Tcl_AppendElement(in, "procs"); Tcl_AppendElement(in, "commands"); - Tcl_AppendElement(in, "class"); Tcl_AppendElement(in, "children"); - Tcl_AppendElement(in, "filter"); Tcl_AppendElement(in, "filterguard"); - Tcl_AppendElement(in, "forward"); - Tcl_AppendElement(in, "info"); - Tcl_AppendElement(in, "invar"); Tcl_AppendElement(in, "mixin"); - Tcl_AppendElement(in, "methods"); - Tcl_AppendElement(in, "parent"); - Tcl_AppendElement(in, "pre"); Tcl_AppendElement(in, "post"); - Tcl_AppendElement(in, "precedence"); - if (isclass) { - Tcl_AppendElement(in, "superclass"); Tcl_AppendElement(in, "subclass"); - Tcl_AppendElement(in, "heritage"); Tcl_AppendElement(in, "instances"); - Tcl_AppendElement(in, "instcommands"); Tcl_AppendElement(in, "instprocs"); - Tcl_AppendElement(in, "instdefault"); Tcl_AppendElement(in, "instbody"); - Tcl_AppendElement(in, "instmixin"); - Tcl_AppendElement(in, "instforward"); - Tcl_AppendElement(in, "classchildren"); Tcl_AppendElement(in, "classparent"); - Tcl_AppendElement(in, "instfilter"); Tcl_AppendElement(in, "instfilterguard"); - Tcl_AppendElement(in, "instinvar"); - Tcl_AppendElement(in, "instpre"); Tcl_AppendElement(in, "instpost"); - Tcl_AppendElement(in, "parameter"); - } - return TCL_OK; -} - -XOTCLINLINE static int -noMetaChars(char *pattern) { - register char c, *p = pattern; - assert(pattern); - for (c=*p; c; c = *++p) { - if (c == '*' || c == '[') { - return 0; - } - } - return 1; -} - -static int -ListKeys(Tcl_Interp *in, Tcl_HashTable *table, char *pattern) { - Tcl_HashEntry* hPtr; - char *key; - - if (pattern && noMetaChars(pattern)) { - hPtr = table ? Tcl_FindHashEntry(table, pattern) : 0; - if (hPtr) { - key = Tcl_GetHashKey(table, hPtr); - Tcl_SetResult(in, key, TCL_VOLATILE); - } else { - Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); - } - } else { - Tcl_Obj *list = Tcl_NewListObj(0, NULL); - Tcl_HashSearch hSrch; - hPtr = table ? Tcl_FirstHashEntry(table, &hSrch) : 0; - for (; hPtr; hPtr = Tcl_NextHashEntry(&hSrch)) { - key = Tcl_GetHashKey(table, hPtr); - if (!pattern || Tcl_StringMatch(key, pattern)) { - Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj(key,-1)); - } - } - Tcl_SetObjResult(in, list); - } - return TCL_OK; -} - -#if !defined(PRE85) || FORWARD_COMPATIBLE -static int -ListVarKeys(Tcl_Interp *in, Tcl_HashTable *tablePtr, char *pattern) { - Tcl_HashEntry* hPtr; - - if (pattern && noMetaChars(pattern)) { - Tcl_Obj *patternObj = Tcl_NewStringObj(pattern, -1); - INCR_REF_COUNT(patternObj); - - hPtr = tablePtr ? Tcl_CreateHashEntry(tablePtr, (char *)patternObj, NULL) : 0; - if (hPtr) { - Var *val = VarHashGetValue(hPtr); - Tcl_SetObjResult(in, VarHashGetKey(val)); - } else { - Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); - } - DECR_REF_COUNT(patternObj); - } else { - Tcl_Obj *list = Tcl_NewListObj(0, NULL); - Tcl_HashSearch hSrch; - hPtr = tablePtr ? Tcl_FirstHashEntry(tablePtr, &hSrch) : 0; - for (; hPtr; hPtr = Tcl_NextHashEntry(&hSrch)) { - Var *val = VarHashGetValue(hPtr); - Tcl_Obj *key = VarHashGetKey(val); - if (!pattern || Tcl_StringMatch(ObjStr(key), pattern)) { - Tcl_ListObjAppendElement(in, list, key); - } - } - Tcl_SetObjResult(in, list); - } - return TCL_OK; -} -#endif - - -static int -ListVars(Tcl_Interp *in, XOTclObject *obj, char *pattern) { - Tcl_Obj *varlist, *okList, *element; - int i, length; - TclVarHashTable *varTable = obj->nsPtr ? Tcl_Namespace_varTable(obj->nsPtr) : obj->varTable; - -#if defined(PRE85) -# if FORWARD_COMPATIBLE - if (forwardCompatibleMode) { - ListVarKeys(in, VarHashTable(varTable), pattern); - } else { - ListKeys(in, varTable, pattern); - } -# else - ListKeys(in, varTable, pattern); -# endif -#else - ListVarKeys(in, VarHashTable(varTable), pattern); -#endif - varlist = Tcl_GetObjResult(in); - - Tcl_ListObjLength(in, varlist, &length); - okList = Tcl_NewListObj(0, NULL); - for (i=0; icmdName); - } else { - Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); - } - } else { - Tcl_Obj *list = Tcl_NewListObj(0, NULL); - Tcl_HashSearch hSrch; - hPtr = table ? Tcl_FirstHashEntry(table, &hSrch) : 0; - for (; hPtr; hPtr = Tcl_NextHashEntry(&hSrch)) { - XOTclObject *obj = (XOTclObject*)Tcl_GetHashKey(table, hPtr); - if (!pattern || Tcl_StringMatch(ObjStr(obj->cmdName), pattern)) { - Tcl_ListObjAppendElement(in, list, obj->cmdName); - } - } - Tcl_SetObjResult(in, list); - } - return TCL_OK; -} - -static int -ListMethodKeys(Tcl_Interp *in, Tcl_HashTable *table, char *pattern, - int noProcs, int noCmds, int noDups, int onlyForwarder) { - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr = table ? Tcl_FirstHashEntry(table, &hSrch) : 0; - for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { - char *key = Tcl_GetHashKey(table, hPtr); - Tcl_Command cmd = (Tcl_Command)Tcl_GetHashValue(hPtr); - Tcl_ObjCmdProc* proc = Tcl_Command_objProc(cmd); - - if (pattern && !Tcl_StringMatch(key, pattern)) continue; - if (noCmds && proc != RUNTIME_STATE(in)->objInterpProc) continue; - if (noProcs && proc == RUNTIME_STATE(in)->objInterpProc) continue; - if (onlyForwarder && proc != XOTclForwardMethod) continue; - /* XOTclObjscopedMethod ??? */ - if (noDups) { - int listc, i; - Tcl_Obj **listv; - int result = Tcl_ListObjGetElements(in, Tcl_GetObjResult(in), &listc, &listv); - size_t keylen = strlen(key); - if (result == TCL_OK) { - int found = 0; - for (i=0; iprefix) { - Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj("-methodprefix",-1)); - Tcl_ListObjAppendElement(in, list, tcd->prefix); - } - if (tcd->subcommands) { - Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj("-default",-1)); - Tcl_ListObjAppendElement(in, list, tcd->subcommands); - } - if (tcd->objscope) { - Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj("-objscope",-1)); - } - Tcl_ListObjAppendElement(in, list, tcd->cmdName); - if (tcd->args) { - Tcl_Obj **args; - int nrArgs, i; - Tcl_ListObjGetElements(in, tcd->args, &nrArgs, &args); - for (i=0; insPtr) { - Tcl_HashTable *cmdTable = Tcl_Namespace_cmdTable(obj->nsPtr); - ListMethodKeys(in, cmdTable, pattern, noProcs, noCmds, 0, 0); - } - - if (!noMixins) { - if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) - MixinComputeDefined(in, obj); - if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { - XOTclCmdList *ml = obj->mixinOrder; - XOTclClass *mixin; - while (ml) { - int guardOk = TCL_OK; - mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); - if (inContext) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - if (!cs->guardCount) { - guardOk = GuardCall(obj, 0, 0, in, ml->clientData, 1); - } - } - if (mixin && guardOk == TCL_OK) { - Tcl_HashTable *cmdTable = Tcl_Namespace_cmdTable(mixin->nsPtr); - ListMethodKeys(in, cmdTable, pattern, noProcs, noCmds, 1, 0); - } - ml = ml->next; - } - } - } - - /* append per-class filters */ - for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); pl; pl = pl->next) { - Tcl_HashTable *cmdTable = Tcl_Namespace_cmdTable(pl->cl->nsPtr); - ListMethodKeys(in, cmdTable, pattern, noProcs, noCmds, 1, 0); - } - return TCL_OK; -} - -static int XOTclCInfoMethod(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST v[]); - -static int -ListClass(Tcl_Interp *in, XOTclObject *obj, char *pattern, - int objc, Tcl_Obj *CONST objv[]) { - if (pattern == 0) { - Tcl_SetObjResult(in, obj->cl->object.cmdName); - return TCL_OK; - } else { - int result; - ALLOC_ON_STACK(Tcl_Obj*,objc, ov); - - memcpy(ov, objv, sizeof(Tcl_Obj *)*objc); - ov[1] = Tcl_NewStringObj("superclass", 10); - INCR_REF_COUNT(ov[1]); - result = XOTclCInfoMethod((ClientData)obj->cl, in, objc, ov); - DECR_REF_COUNT(ov[1]); - FREE_ON_STACK(ov); - return result; - } -} - -static int -ListSuperclasses(Tcl_Interp *in, XOTclClass *cl, char *pattern) { - if (pattern == 0) { - XOTclClasses* sl = cl->super; - XOTclClasses* sc = 0; - - /* - * reverse the list to obtain presentation order - */ - - Tcl_ResetResult(in); - while (sc != sl) { - XOTclClasses* nl = sl; - while (nl->next != sc) nl = nl->next; - Tcl_AppendElement(in, className(nl->cl)); - sc = nl; - } - } else { - XOTclClass *isc = XOTclpGetClass(in, pattern); - XOTclClasses* pl; - if (isc == 0) - return XOTclErrBadVal(in, "info superclass", "a class", pattern); - - /* - * search precedence to see if we're related or not - */ - for (pl = ComputeOrder(cl, cl->order, Super); pl; pl = pl->next) { - if (pl->cl == isc) { - Tcl_SetIntObj(Tcl_GetObjResult(in), 1); - break; - } - } - if (pl == 0) - Tcl_SetIntObj(Tcl_GetObjResult(in), 0); - } - return TCL_OK; -} - -static int -ListSubclasses(Tcl_Interp *in, XOTclClass *cl, char *pattern) { - if (pattern == 0) { - XOTclClasses* sl = cl->sub; - XOTclClasses* sc = 0; - - /* - * order unimportant - */ - Tcl_ResetResult(in); - for (sc = sl; sc != 0; sc = sc->next) - Tcl_AppendElement(in, className(sc->cl)); - } else { - XOTclClass *isc = XOTclpGetClass(in, pattern); - XOTclClasses* pl; - XOTclClasses* saved; - - if (isc == 0) - return XOTclErrBadVal(in, "info subclass", "a class", pattern); - saved = cl->order; - cl->order = 0; - - /* - * search precedence to see if we're related or not - */ - for (pl = ComputeOrder(cl, cl->order, Sub); pl; pl = pl->next) { - if (pl->cl == isc) { - Tcl_SetIntObj(Tcl_GetObjResult(in), 1); - break; - } - } - if (pl == 0) - Tcl_SetIntObj(Tcl_GetObjResult(in), 0); - - XOTclFreeClasses(cl->order); - cl->order = saved; - } - return TCL_OK; -} - - - -static int -ListHeritage(Tcl_Interp *in, XOTclClass *cl, char *pattern) { - XOTclClasses* pl = ComputeOrder(cl, cl->order, Super); - Tcl_ResetResult(in); - if (pl) pl=pl->next; - for (; pl != 0; pl = pl->next) { - char *name = className(pl->cl); - if (pattern && !Tcl_StringMatch(name, pattern)) continue; - Tcl_AppendElement(in, name); - } - return TCL_OK; -} - -static int -ListPrecedence(Tcl_Interp *in, XOTclObject *obj, char *pattern) { - XOTclClasses* pl; - Tcl_ResetResult(in); - if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) - MixinComputeDefined(in, obj); - - if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { - XOTclCmdList *ml = obj->mixinOrder; - - while (ml) { - XOTclClass *mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); - char *name = className(mixin); - if (pattern && !Tcl_StringMatch(name, pattern)) continue; - Tcl_AppendElement(in, name); - ml = ml->next; - } - } - pl = ComputeOrder(obj->cl, obj->cl->order, Super); - for (; pl != 0; pl = pl->next) { - char *name = className(pl->cl); - if (pattern && !Tcl_StringMatch(name, pattern)) continue; - Tcl_AppendElement(in, name); - } - return TCL_OK; -} - - -static Proc* -FindProc(Tcl_Interp *in, Tcl_HashTable *table, char *name) { - Tcl_HashEntry* hPtr = table ? Tcl_FindHashEntry(table, name) : 0; - if (hPtr) { - Tcl_Command cmd = (Tcl_Command)Tcl_GetHashValue(hPtr); - Tcl_ObjCmdProc *proc = Tcl_Command_objProc(cmd); - if (proc == RUNTIME_STATE(in)->objInterpProc) - return (Proc*) Tcl_Command_objClientData(cmd); -#if USE_INTERP_PROC - else if ((Tcl_CmdProc*)proc == RUNTIME_STATE(in)->interpProc) - return (Proc*) Tcl_Command_clientData(cmd); -#endif - } - return 0; -} - -static int -ListProcArgs(Tcl_Interp *in, Tcl_HashTable *table, char *name) { - Proc* proc = FindProc(in, table, name); - if (proc) { - CompiledLocal *args = proc->firstLocalPtr; - Tcl_ResetResult(in); - for (;args != NULL; args = args->nextPtr) { - if (TclIsCompiledLocalArgument(args)) - Tcl_AppendElement(in, args->name); - - } - return TCL_OK; - } - return XOTclErrBadVal(in, "info args", "a tcl method name", name); -} - -static int -ListArgsFromOrdinaryArgs(Tcl_Interp *in, XOTclNonposArgs* nonposArgs) { - int i, rc, ordinaryArgsDefc, defaultValueObjc; - Tcl_Obj **ordinaryArgsDefv, **defaultValueObjv, *ordinaryArg, - *argList = Tcl_NewListObj(0, NULL); - rc = Tcl_ListObjGetElements(in, nonposArgs->ordinaryArgs, - &ordinaryArgsDefc, &ordinaryArgsDefv); - if (rc != TCL_OK) - return TCL_ERROR; - - for (i=0; i < ordinaryArgsDefc; i++) { - ordinaryArg = ordinaryArgsDefv[i]; - rc = Tcl_ListObjGetElements(in, ordinaryArg, - &defaultValueObjc, &defaultValueObjv); - if (rc == TCL_OK && defaultValueObjc == 2) { - ordinaryArg = defaultValueObjv[0]; - } - Tcl_ListObjAppendElement(in, argList, ordinaryArg); - } - Tcl_SetObjResult(in, argList); - return TCL_OK; -} - -static int -GetProcDefault(Tcl_Interp *in, Tcl_HashTable *table, - char *name, char *arg, Tcl_Obj **resultObj) { - Proc* proc = FindProc(in, table, name); - *resultObj = 0; - if (proc) { - CompiledLocal *ap; - for (ap = proc->firstLocalPtr; ap != 0; ap = ap->nextPtr) { - if (!TclIsCompiledLocalArgument(ap)) continue; - if (strcmp(arg, ap->name) != 0) continue; - - if (ap->defValuePtr != NULL) { - *resultObj = ap->defValuePtr; - return TCL_OK; - } - return TCL_OK; - } - } - return TCL_ERROR; -} - -static int -SetProcDefault(Tcl_Interp *in, Tcl_Obj *var, Tcl_Obj* defVal) { - int result = TCL_OK; - callFrameContext ctx = {0}; - CallStackUseActiveFrames(in,&ctx); - - if (defVal != 0) { - if (Tcl_ObjSetVar2(in, var, NULL, defVal, 0) != NULL) { - Tcl_SetIntObj(Tcl_GetObjResult(in), 1); - } else { - result = TCL_ERROR; - } - } else { - if (Tcl_ObjSetVar2(in, var, NULL, - XOTclGlobalObjects[XOTE_EMPTY], 0) != NULL) { - Tcl_SetIntObj(Tcl_GetObjResult(in), 0); - } else { - result = TCL_ERROR; - } - } - CallStackRestoreSavedFrames(in, &ctx); - - if (result == TCL_ERROR) { - XOTclVarErrMsg(in, "couldn't store default value in variable '", - var, "'", (char *) NULL); - } - return result; -} - -static int -ListProcDefault(Tcl_Interp *in, Tcl_HashTable *table, - char *name, char *arg, Tcl_Obj *var) { - Tcl_Obj *defVal; - int result; - if (GetProcDefault(in, table, name, arg, &defVal) == TCL_OK) { - result = SetProcDefault(in, var, defVal); - } else { - XOTclVarErrMsg(in, "method '", name, - "' doesn't exist or doesn't have an argument '", - arg, "'", (char *) NULL); - result = TCL_ERROR; - } - return result; -} - -static int -ListDefaultFromOrdinaryArgs(Tcl_Interp *in, char *procName, - XOTclNonposArgs* nonposArgs, char *arg, Tcl_Obj *var) { - int i, rc, ordinaryArgsDefc, defaultValueObjc; - Tcl_Obj **ordinaryArgsDefv, **defaultValueObjv, *ordinaryArg; - - rc = Tcl_ListObjGetElements(in, nonposArgs->ordinaryArgs, - &ordinaryArgsDefc, &ordinaryArgsDefv); - if (rc != TCL_OK) - return TCL_ERROR; - - for (i=0; i < ordinaryArgsDefc; i++) { - ordinaryArg = ordinaryArgsDefv[i]; - rc = Tcl_ListObjGetElements(in, ordinaryArg, - &defaultValueObjc, &defaultValueObjv); - if (rc == TCL_OK && !strcmp(arg, ObjStr(defaultValueObjv[0]))) { - return SetProcDefault(in, var, defaultValueObjc == 2 ? - defaultValueObjv[1] : NULL); - } - } - XOTclVarErrMsg(in, "method '", procName, "' doesn't have an argument '", - arg, "'", (char *) NULL); - return TCL_ERROR; -} - -static char * -StripBodyPrefix(char *body) { - if (strncmp(body, "::xotcl::initProcNS\n",20) == 0) - body+=20; - if (strncmp(body, "::xotcl::interpretNonpositionalArgs $args\n",42) == 0) - body+=42; - return body; -} - -static int -ListProcBody(Tcl_Interp *in, Tcl_HashTable *table, char *name) { - Proc* proc = FindProc(in, table, name); - if (proc) { - char *body = ObjStr(proc->bodyPtr); - Tcl_SetObjResult(in, Tcl_NewStringObj(StripBodyPrefix(body), -1)); - return TCL_OK; - } - return XOTclErrBadVal(in, "info body", "a tcl method name", name); -} - -static int -ListChildren(Tcl_Interp *in, XOTclObject *obj, char *pattern, int classesOnly) { - XOTclObject *childobj; - Tcl_HashTable *cmdTable; - XOTcl_FrameDecls; - - if (!obj->nsPtr) return TCL_OK; - - cmdTable = Tcl_Namespace_cmdTable(obj->nsPtr); - if (pattern && noMetaChars(pattern)) { - XOTcl_PushFrame(in, obj); - if ((childobj = XOTclpGetObject(in, pattern)) && - (!classesOnly || XOTclObjectIsClass(childobj)) && - (childobj->id && Tcl_Command_nsPtr(childobj->id) == obj->nsPtr) /* true children */ - ) { - Tcl_SetObjResult(in, childobj->cmdName); - } else { - Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); - } - XOTcl_PopFrame(in,obj); - } else { - Tcl_Obj *list = Tcl_NewListObj(0, NULL); - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr = Tcl_FirstHashEntry(cmdTable, &hSrch); - char *key; - XOTcl_PushFrame(in, obj); - for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { - key = Tcl_GetHashKey(cmdTable, hPtr); - if (!pattern || Tcl_StringMatch(key, pattern)) { - if ((childobj = XOTclpGetObject(in, key)) && - (!classesOnly || XOTclObjectIsClass(childobj)) && - (childobj->id && Tcl_Command_nsPtr(childobj->id) == obj->nsPtr) /* true children */ - ) { - Tcl_ListObjAppendElement(in, list, childobj->cmdName); - } - } - } - XOTcl_PopFrame(in,obj); - Tcl_SetObjResult(in, list); - } - return TCL_OK; -} - -static int -ListParent(Tcl_Interp *in, XOTclObject *obj) { - if (obj->id) { - Tcl_SetResult(in, NSCmdFullName(obj->id), TCL_VOLATILE); - } - return TCL_OK; -} - -static XOTclClass* -FindCalledClass(Tcl_Interp *in, XOTclObject *obj) { - char *methodName = 0; - XOTclClass *cl; - Tcl_Command cmd = NULL; - XOTclCallStackContent *csc = CallStackGetTopFrame(in); - - if (csc->frameType == XOTCL_CSC_TYPE_PLAIN) - return GetSelfClass(in); - - if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) - methodName = ObjStr(csc->filterStackEntry->calledProc); - else if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_MIXIN && obj->mixinStack) - methodName = (char *) GetSelfProc(in); - - if (!methodName) methodName = ""; - - if (obj->nsPtr) - cmd = FindMethod(methodName, obj->nsPtr); - - if (cmd) { - cl = 0; - } else { - cl = SearchCMethod(obj->cl, methodName, &cmd); - } - return cl; -} - -/* - * Next Primitive Handling - */ -XOTCLINLINE static void -NextSearchMethod(XOTclObject *obj, Tcl_Interp *in, XOTclCallStackContent *csc, - XOTclClass **cl, char **method, Tcl_ObjCmdProc **proc, Tcl_Command *cmd, - ClientData *cp, int* isMixinEntry, int* isFilterEntry, - int* endOfFilterChain, Tcl_Command* currentCmd) { - XOTclClasses *pl = 0; - int endOfChain = 0; - *endOfFilterChain = 0; - - /* - * Next in filters - */ - /*assert(obj->flags & XOTCL_FILTER_ORDER_VALID); *** strange, worked before ****/ - - FilterComputeDefined(in, obj); - - if ((obj->flags & XOTCL_FILTER_ORDER_VALID) && - obj->filterStack && - obj->filterStack->currentCmdPtr) { - *cmd = FilterSearchProc(in, obj, proc, cp, currentCmd,cl); - /*fprintf(stderr,"EndOfChain? proc=%p, cmd=%p\n",*proc,*cmd);*/ - /* XOTclCallStackDump(in); XOTclStackDump(in);*/ - - if (*proc == 0) { - if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) { - /* reset the information to the values of method, cl - to the values they had before calling the filters */ - *method = ObjStr(obj->filterStack->calledProc); - endOfChain = 1; - *endOfFilterChain = 1; - *cl = 0; - /*fprintf(stderr,"EndOfChain resetting cl\n");*/ - } - } else { - *method = (char *) Tcl_GetCommandName(in, *cmd); - *isFilterEntry = 1; - return; - } - } - - /* - * Next in Mixins - */ - assert(obj->flags & XOTCL_MIXIN_ORDER_VALID); - /* otherwise: MixinComputeDefined(in, obj); */ - - /*fprintf(stderr,"nextsearch: mixinorder valid %d stack=%p\n", - obj->flags & XOTCL_MIXIN_ORDER_VALID, obj->mixinStack);*/ - - - if ((obj->flags & XOTCL_MIXIN_ORDER_VALID) && obj->mixinStack) { - *cmd = MixinSearchProc(in, obj, *method, cl, proc, cp, currentCmd); - /*fprintf(stderr,"nextsearch: mixinsearch cmd %p, proc=%p\n",*cmd,*proc);*/ - if (*proc == 0) { - if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_MIXIN) { - endOfChain = 1; - *cl = 0; - } - } else { - *isMixinEntry = 1; - return; - } - } - - /* - * otherwise: normal method dispatch - * - * if we are already in the precedence ordering, then advance - * past our last point; otherwise (if cl==0) begin from the start - */ - - /* if a mixin or filter chain has ended -> we have to search - the obj-specific methods as well */ - - if (obj->nsPtr && endOfChain) { - *cmd = FindMethod(*method, obj->nsPtr); - } else { - *cmd = 0; - } - - - if (!*cmd) { - for (pl = ComputeOrder(obj->cl, obj->cl->order, Super); pl && *cl; pl = pl->next) { - if (pl->cl == *cl) - *cl = 0; - } - - /* - * search for a further class method - */ - *cl = SearchPLMethod(pl, *method, cmd); - /*fprintf(stderr, "no cmd, cl = %p %s\n",*cl, ObjStr((*cl)->object.cmdName));*/ - } else { - *cl = 0; - } - - if (*cmd) { - *proc = Tcl_Command_objProc(*cmd); - *cp = Tcl_Command_objClientData(*cmd); - } - - return; -} - -static int -XOTclNextMethod(XOTclObject *obj, Tcl_Interp *in, XOTclClass *givenCl, - char *givenMethod, int objc, Tcl_Obj *CONST objv[], - int useCallstackObjs) { - XOTclCallStackContent *csc = CallStackGetTopFrame(in); - Tcl_ObjCmdProc *proc = 0; - Tcl_Command cmd, currentCmd = NULL; - ClientData cp = 0; - int result = TCL_OK, - frameType = XOTCL_CSC_TYPE_PLAIN, - isMixinEntry = 0, isFilterEntry = 0, - endOfFilterChain = 0; - int nobjc; Tcl_Obj **nobjv; - XOTclClass **cl = &givenCl; - char **method = &givenMethod; - -#if !defined(NDEBUG) - if (useCallstackObjs) { - Tcl_CallFrame *cf = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(in); - int found = 0; - while (cf) { - /* fprintf(stderr, " ... compare fp = %p and cfp %p procFrame %p oc=%d\n", - cf, csc->currentFramePtr, - Tcl_Interp_framePtr(in), Tcl_CallFrame_objc(Tcl_Interp_framePtr(in)) - );*/ - if (cf == csc->currentFramePtr) { - found = 1; - break; - } - cf = (Tcl_CallFrame *)((CallFrame *)cf)->callerPtr; - } - /* - if (!found) { - if (Tcl_Interp_varFramePtr(in)) { - fprintf(stderr,"found (csc->currentFramePtr %p)= %d cur level=%d\n", - csc->currentFramePtr,found, - Tcl_CallFrame_level(Tcl_Interp_varFramePtr(in))); - } else { - fprintf(stderr,"no varFramePtr\n"); - } - return TCL_OK; - } - */ - } -#endif - /* - fprintf(stderr,"givenMethod = %s, csc = %p, useCallstackObj %d, objc %d\n", - givenMethod, csc, useCallstackObjs, objc); - */ - - /* if no args are given => use args from stack */ - if (objc < 2 && useCallstackObjs && csc->currentFramePtr) { - nobjc = Tcl_CallFrame_objc(csc->currentFramePtr); - nobjv = (Tcl_Obj **)Tcl_CallFrame_objv(csc->currentFramePtr); - } else { - nobjc = objc; - nobjv = (Tcl_Obj **)objv; - } - - /* - * Search the next method & compute its method data - */ - NextSearchMethod(obj, in, csc, cl, method, &proc, &cmd, &cp, - &isMixinEntry, &isFilterEntry, &endOfFilterChain, ¤tCmd); - - /* - fprintf(stderr, "NextSearchMethod -- RETURN: method=%s eoffc=%d,", - *method, endOfFilterChain); - if (obj) - fprintf(stderr, " obj=%s,", ObjStr(obj->cmdName)); - if ((*cl)) - fprintf(stderr, " cl=%s,", (*cl)->nsPtr->fullName); - fprintf(stderr, " mixin=%d, filter=%d, proc=%p\n", - isMixinEntry, isFilterEntry, proc); - */ - - Tcl_ResetResult(in); /* needed for bytecode support */ - - if (proc != 0) { - /* - * change mixin state - */ - if (obj->mixinStack) { - if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_MIXIN) - csc->frameType = XOTCL_CSC_TYPE_INACTIVE_MIXIN; - - /* otherwise move the command pointer forward */ - if (isMixinEntry) { - frameType = XOTCL_CSC_TYPE_ACTIVE_MIXIN; - obj->mixinStack->currentCmdPtr = currentCmd; - } - } - /* - * change filter state - */ - if (obj->filterStack) { - if (csc->frameType == XOTCL_CSC_TYPE_ACTIVE_FILTER) - csc->frameType = XOTCL_CSC_TYPE_INACTIVE_FILTER; - - /* otherwise move the command pointer forward */ - if (isFilterEntry) { - frameType = XOTCL_CSC_TYPE_ACTIVE_FILTER; - obj->filterStack->currentCmdPtr = currentCmd; - } - } - - /* - * now actually call the "next" method - */ - - /* cut the flag, that no stdargs should be used, if it is there */ - if (nobjc > 1) { - char *nobjv1 = ObjStr(nobjv[1]); - if (nobjv1[0] == '-' && !strcmp(nobjv1, "--noArgs")) - nobjc = 1; - } - csc->callType |= XOTCL_CSC_CALL_IS_NEXT; - RUNTIME_STATE(in)->unknown = 0; - - - result = DoCallProcCheck(cp, (ClientData)obj, in, nobjc, nobjv, cmd, - obj, *cl, *method, frameType, 1/*fromNext*/); - - csc->callType &= ~XOTCL_CSC_CALL_IS_NEXT; - - if (csc->frameType == XOTCL_CSC_TYPE_INACTIVE_FILTER) - csc->frameType = XOTCL_CSC_TYPE_ACTIVE_FILTER; - else if (csc->frameType == XOTCL_CSC_TYPE_INACTIVE_MIXIN) - csc->frameType = XOTCL_CSC_TYPE_ACTIVE_MIXIN; - } else if (result == TCL_OK && endOfFilterChain) { - /*fprintf(stderr,"setting unknown to 1\n");*/ - RUNTIME_STATE(in)->unknown = 1; - } - - - return result; -} - -int -XOTclNextObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclCallStackContent *csc = CallStackGetTopFrame(in); - - if (!csc->self) - return XOTclVarErrMsg(in, "next: can't find self", (char *) NULL); - - if (!csc->cmdPtr) - return XOTclErrMsg(in, "next: no executing proc", TCL_STATIC); - - return XOTclNextMethod(csc->self, in, csc->cl, - (char *)Tcl_GetCommandName(in, csc->cmdPtr), - objc, objv, 1); -} - - -int -XOTclQualifyObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - char *string; - if (objc != 2) - return XOTclVarErrMsg(in, "wrong # of args for __qualify", (char *) NULL); - - string = ObjStr(objv[1]); - if (!isAbsolutePath(string)) { - Tcl_SetObjResult(in, NameInNamespaceObj(in,string,callingNameSpace(in))); - } else { - Tcl_SetObjResult(in, objv[1]); - } - return TCL_OK; -} - -/* method for calling e.g. $obj __next */ -static int -XOTclONextMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - XOTclCallStackContent *csc = CallStackGetTopFrame(in); - char *methodName; - - for (; csc >= cs->content; csc--) { - if (csc->self == obj) break; - } - if (csccontent) - return XOTclVarErrMsg(in, "__next: can't find object", - ObjStr(obj->cmdName), (char *) NULL); - methodName = (char *)Tcl_GetCommandName(in, csc->cmdPtr); - /*fprintf(stderr,"******* next for proc %s\n", methodName);*/ - return XOTclNextMethod(obj, in, csc->cl, methodName, objc-1, &objv[1], 0); -} - -#if 0 -/* method next for calling e.g. $obj next */ -static int -XOTclONextMethod2(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - int result, nobjc; - /*XOTclCallStack *cs = &RUNTIME_STATE(in)->cs;*/ - XOTclCallStackContent *csc = CallStackGetTopFrame(in); - Tcl_Obj **nobjv; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - - /* if no args are given => use args from stack */ - if (objc < 2) { - nobjc = Tcl_CallFrame_objc(csc->currentFramePtr); - nobjv = (Tcl_Obj **)Tcl_CallFrame_objv(csc->currentFramePtr); - } else { - nobjc = objc; - nobjv = (Tcl_Obj **)objv; - } - { - ALLOC_ON_STACK(Tcl_Obj*,nobjc + 1, ov); - memcpy(ov+1, nobjv, sizeof(Tcl_Obj *)*nobjc); - ov[0] = obj->cmdName; - result = ObjDispatch(cd, in, nobjc+1, ov, 0); - FREE_ON_STACK(ov); - } - /*fprintf(stderr,"******* next for proc %s\n", methodName);*/ - /*result = Tcl_EvalObjv(in, objc, ov, 0);*/ - return result; -} -#endif - -/* - * "self" object command - */ - -static int -FindSelfNext(Tcl_Interp *in, XOTclObject *obj) { - XOTclCallStackContent *csc = CallStackGetTopFrame(in); - Tcl_ObjCmdProc *proc = 0; - Tcl_Command cmd, currentCmd = 0; - ClientData cp = 0; - int isMixinEntry = 0, - isFilterEntry = 0, - endOfFilterChain = 0; - XOTclClass *cl = csc->cl; - XOTclObject *o = csc->self; - char *methodName; - - Tcl_ResetResult(in); - - methodName = (char *) GetSelfProc(in); - if (!methodName) - return TCL_OK; - - NextSearchMethod(o, in, csc, &cl, &methodName, &proc, &cmd, &cp, - &isMixinEntry, &isFilterEntry, &endOfFilterChain, ¤tCmd); - - if (cmd) { - Tcl_SetObjResult(in, getFullProcQualifier(in, Tcl_GetCommandName(in, cmd), - o, cl, cmd)); - } - return TCL_OK; -} - -static Tcl_Obj * -computeLevelObj(Tcl_Interp *in, CallStackLevel level) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - XOTclCallStackContent *csc; - Tcl_Obj *resultObj; - - switch (level) { - case CALLING_LEVEL: csc = XOTclCallStackFindLastInvocation(in, 1); break; - case ACTIVE_LEVEL: csc = XOTclCallStackFindActiveFrame(in, 1); break; - default: csc = NULL; - } - - if (cs->top->currentFramePtr == ((Tcl_CallFrame *)Tcl_Interp_varFramePtr(in)) - && csc && csc < cs->top && csc->currentFramePtr) { - /* this was from an xotcl frame, return absolute frame number */ - char buffer[LONG_AS_STRING]; - int l; - buffer[0] = '#'; - /* fprintf(stderr,"*** csc=%p\n",csc);*/ - XOTcl_ltoa(buffer+1,(long)Tcl_CallFrame_level(csc->currentFramePtr),&l); - resultObj = Tcl_NewStringObj(buffer,l+1); - } else { - /* If not called from an xotcl frame, return 1 as default */ - resultObj = Tcl_NewIntObj(1); - } - /*XOTclStackDump(in);XOTclCallStackDump(in);*/ - - return resultObj; -} - -static int -XOTclSelfSubCommand(Tcl_Interp *in, XOTclObject *obj, char *option) { - assert(option); - - if (isProcString(option)) { /* proc subcommand */ - char *procName = (char *) GetSelfProc(in); - if (procName) { - Tcl_SetResult(in, procName, TCL_VOLATILE); - return TCL_OK; - } else { - return XOTclVarErrMsg(in, "Can't find proc", (char *) NULL); - } - } else if (isClassString(option)) { /* class subcommand */ - XOTclClass *cl = GetSelfClass(in); - Tcl_SetObjResult(in, cl ? cl->object.cmdName : XOTclGlobalObjects[XOTE_EMPTY]); - return TCL_OK; - } else { - XOTclCallStackContent *csc = NULL; - - switch (*option) { /* other callstack information */ - case 'a': - if (!strcmp(option, "activelevel")) { - Tcl_SetObjResult(in, computeLevelObj(in, ACTIVE_LEVEL)); - return TCL_OK; - } else if (!strcmp(option,"args")) { - int nobjc; - Tcl_Obj **nobjv; - csc = CallStackGetTopFrame(in); - nobjc = Tcl_CallFrame_objc(csc->currentFramePtr); - nobjv = (Tcl_Obj **)Tcl_CallFrame_objv(csc->currentFramePtr); - Tcl_SetObjResult(in, Tcl_NewListObj(nobjc-1,nobjv+1)); - return TCL_OK; - } -#if defined(ACTIVEMIXIN) - else if (!strcmp(option, "activemixin")) { - XOTclObject *o = NULL; - csc = CallStackGetTopFrame(in); - /*CmdListPrint(in,"self a....\n", obj->mixinOrder); - fprintf(stderr,"current cmdPtr = %p cl = %p, mo=%p %p\n", csc->cmdPtr, csc->cl, - obj->mixinOrder, RUNTIME_STATE(in)->cmdPtr);*/ - if (RUNTIME_STATE(in)->cmdPtr) { - o = XOTclGetObjectFromCmdPtr(RUNTIME_STATE(in)->cmdPtr); - } - Tcl_SetObjResult(in, o ? o->cmdName : XOTclGlobalObjects[XOTE_EMPTY]); - return TCL_OK; - } -#endif - break; - case 'c': - if (!strcmp(option, "calledproc")) { - if (!(csc = CallStackFindActiveFilter(in))) - return XOTclVarErrMsg(in, - "self calledproc called from outside of a filter", - (char *) NULL); - Tcl_SetObjResult(in, csc->filterStackEntry->calledProc); - return TCL_OK; - } else if (!strcmp(option, "calledclass")) { - Tcl_SetResult(in, className(FindCalledClass(in, obj)), TCL_VOLATILE); - return TCL_OK; - } else if (!strcmp(option, "callingproc")) { - csc = XOTclCallStackFindLastInvocation(in, 1); - Tcl_SetResult(in, csc ? (char *)Tcl_GetCommandName(in, csc->cmdPtr) : "", - TCL_VOLATILE); - return TCL_OK; - } else if (!strcmp(option, "callingclass")) { - csc = XOTclCallStackFindLastInvocation(in, 1); - Tcl_SetObjResult(in, csc && csc->cl ? csc->cl->object.cmdName : - XOTclGlobalObjects[XOTE_EMPTY]); - return TCL_OK; - } else if (!strcmp(option, "callinglevel")) { - Tcl_SetObjResult(in, computeLevelObj(in, CALLING_LEVEL)); - return TCL_OK; - } else if (!strcmp(option, "callingobject")) { - - /*XOTclStackDump(in); XOTclCallStackDump(in);*/ - - csc = XOTclCallStackFindLastInvocation(in, 1); - Tcl_SetObjResult(in, csc ? csc->self->cmdName : XOTclGlobalObjects[XOTE_EMPTY]); - return TCL_OK; - } - break; - - case 'f': - if (!strcmp(option, "filterreg")) { - if (!(csc = CallStackFindActiveFilter(in))) { - return XOTclVarErrMsg(in, - "self filterreg called from outside of a filter", - (char *) NULL); - } - Tcl_SetObjResult(in, FilterFindReg(in, obj, GetSelfProcCmdPtr(in))); - return TCL_OK; - } - break; - - case 'i': - if (!strcmp(option, "isnextcall")) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - csc = cs->top; - csc--; - Tcl_SetBooleanObj(Tcl_GetObjResult(in), - (csc > cs->content && - (csc->callType & XOTCL_CSC_CALL_IS_NEXT))); - return TCL_OK; - } - break; - - case 'n': - if (!strcmp(option, "next")) - return FindSelfNext(in, obj); - break; - } - } - return XOTclVarErrMsg(in, "unknown option '", option, - "' for self", (char *) NULL); -} - -/* -int -XOTclKObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - if (objc < 2) - return XOTclVarErrMsg(in, "wrong # of args for K", (char *) NULL); - - Tcl_SetObjResult(in, objv[1]); - return TCL_OK; -} -*/ - -int -XOTclGetSelfObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj; - - if (objc > 2) - return XOTclVarErrMsg(in, "wrong # of args for self", (char *) NULL); - - obj = GetSelfObj(in); - - /*fprintf(stderr,"getSelfObj returns %p\n",obj);XOTclCallStackDump(in);*/ - - if (!obj) { - if (objc == 2 && !strcmp(ObjStr(objv[1]),"callinglevel")) { - Tcl_SetIntObj(Tcl_GetObjResult(in), 1); - return TCL_OK; - } else { - return XOTclVarErrMsg(in, "self: no current object", (char *) NULL); - } - } - - if (objc == 1) { - Tcl_SetObjResult(in, obj->cmdName); - return TCL_OK; - } else { - return XOTclSelfSubCommand(in, obj, ObjStr(objv[1])); - } -} - - -/* - * object creation & destruction - */ - -static int -unsetInAllNamespaces(Tcl_Interp *in, Namespace *nsPtr, char *name) { - int rc = 0; - fprintf(stderr, "### unsetInAllNamespaces %s\n",name); - if (nsPtr != NULL) { - Tcl_HashSearch search; - Tcl_HashEntry *entryPtr = Tcl_FirstHashEntry(&nsPtr->childTable, &search); - Tcl_Var *varPtr; - int rc = 0; - - varPtr = (Tcl_Var *) Tcl_FindNamespaceVar(in, name, (Tcl_Namespace *) nsPtr, 0); - /*fprintf(stderr, "found %s in %s -> %p\n",name, nsPtr->fullName, varPtr);*/ - if (varPtr) { - Tcl_DString dFullname, *dsPtr = &dFullname; - Tcl_DStringInit(dsPtr); - Tcl_DStringAppend(dsPtr, "unset ", -1); - Tcl_DStringAppend(dsPtr, nsPtr->fullName, -1); - Tcl_DStringAppend(dsPtr, "::", 2); - Tcl_DStringAppend(dsPtr, name, -1); - /*rc = Tcl_UnsetVar2(in, Tcl_DStringValue(dsPtr), NULL, TCL_LEAVE_ERR_MSG);*/ - rc = Tcl_Eval(in, Tcl_DStringValue(dsPtr)); - /* fprintf(stderr, "fqName = '%s' unset => %d %d\n",Tcl_DStringValue(dsPtr), rc, TCL_OK);*/ - if (rc == TCL_OK) { - rc = 1; - } else { - Tcl_Obj *resultObj = Tcl_GetObjResult(in); - fprintf(stderr, " err = '%s'\n", ObjStr(resultObj)); - } - Tcl_DStringFree(dsPtr); - } - - while (entryPtr != NULL) { - Namespace *childNsPtr = (Namespace *) Tcl_GetHashValue(entryPtr); - /*fprintf(stderr, "child = %s\n", childNsPtr->fullName);*/ - entryPtr = Tcl_NextHashEntry(&search); - rc |= unsetInAllNamespaces(in, childNsPtr, name); - } - } - return rc; -} - -static int -freeUnsetTraceVariable(Tcl_Interp *in, XOTclObject *obj) { - int rc = TCL_OK; - if (obj->opt && obj->opt->volatileVarName) { - /* - Somebody destroys a volatile object manually while - the vartrace is still active. Destroying the object will - be a problem in case the variable is deleted later - and fires the trace. So, we unset the variable here - which will cause a destroy via var trace, which in - turn clears the volatileVarName flag. - */ - /*fprintf(stderr,"### freeUnsetTraceVariable %s\n", obj->opt->volatileVarName);*/ - - rc = Tcl_UnsetVar2(in, obj->opt->volatileVarName, NULL, 0); - if (rc != TCL_OK) { - int rc = Tcl_UnsetVar2(in, obj->opt->volatileVarName, NULL, TCL_GLOBAL_ONLY); - if (rc != TCL_OK) { - Namespace *nsPtr = (Namespace *) Tcl_GetCurrentNamespace(in); - if (unsetInAllNamespaces(in, nsPtr, obj->opt->volatileVarName) == 0) { - fprintf(stderr, "### don't know how to delete variable '%s' of volatile object\n", - obj->opt->volatileVarName); - } - } - } - if (rc == TCL_OK) { - /*fprintf(stderr, "### success unset\n");*/ - } - } - return rc; -} - -static char * -XOTclUnsetTrace(ClientData cd, Tcl_Interp *in, CONST84 char *name, CONST84 char *name2, int flags) -{ - Tcl_Obj *obj = (Tcl_Obj *)cd; - XOTclObject *o; - char *result = NULL; - - /*fprintf(stderr,"XOTclUnsetTrace %s flags %x %x\n", name, flags, - flags & TCL_INTERP_DESTROYED); */ - - if ((flags & TCL_INTERP_DESTROYED) == 0) { - if (XOTclObjConvertObject(in, obj, &o) == TCL_OK) { - Tcl_Obj *res = Tcl_GetObjResult(in); /* save the result */ - INCR_REF_COUNT(res); - - /* clear variable, destroy is called from trace */ - if (o->opt && o->opt->volatileVarName) { - o->opt->volatileVarName = NULL; - } - - if (callMethod((ClientData)o, in, XOTclGlobalObjects[XOTE_DESTROY],2,0,0) != TCL_OK) { - result = "Destroy for volatile object failed"; - } else - result = "No XOTcl Object passed"; - - Tcl_SetObjResult(in, res); /* restore the result */ - DECR_REF_COUNT(res); - } - DECR_REF_COUNT(obj); - } else { - /*fprintf(stderr, "omitting destroy on %s %p\n", name);*/ - } - return result; -} - -/* - * mark an obj on the existing callstack, as not destroyed - */ -static void -UndestroyObj(Tcl_Interp *in, XOTclObject *obj) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - XOTclCallStackContent *csc; - - /* - * mark the object on the whole callstack as not destroyed - */ - for (csc = &cs->content[1]; csc <= cs->top; csc++) { - if (obj == csc->self && csc->destroyedCmd) { - /* - * The ref count was incremented, when csc->destroyedCmd - * was set. We revert this first before forgetting the - * destroyedCmd. - */ - if (Tcl_Command_refCount(csc->destroyedCmd) > 1) { - Tcl_Command_refCount(csc->destroyedCmd)--; - MEM_COUNT_FREE("command refCount",csc->destroyedCmd); - } - csc->destroyedCmd = 0; - } - } - /* - * mark obj->flags XOTCL_DESTROY_CALLED as NOT CALLED (0) - */ - obj->flags &= ~XOTCL_DESTROY_CALLED; -} - -/* - * bring an object into a state, as after initialization - */ -static void -CleanupDestroyObject(Tcl_Interp *in, XOTclObject *obj, int softrecreate) { - XOTclClass *thecls, *theobj; - - thecls = RUNTIME_STATE(in)->theClass; - theobj = RUNTIME_STATE(in)->theObject; - /* remove the instance, but not for ::Class/::Object */ - if (obj != &(thecls->object) && obj != &(theobj->object)) { - - if (!softrecreate) { - (void)RemoveInstance(obj, obj->cl); - } - } - - if (obj->nsPtr) { - NSCleanupNamespace(in, obj->nsPtr); - NSDeleteChildren(in, obj->nsPtr); - } - - if (obj->varTable) { - TclDeleteVars(((Interp *)in), obj->varTable); - ckfree((char *)obj->varTable); - /* - FREE(obj->varTable, obj->varTable);*/ - obj->varTable = 0; - } - - if (obj->opt) { - XOTclObjectOpt *opt = obj->opt; - AssertionRemoveStore(opt->assertions); - opt->assertions = NULL; - -#ifdef XOTCL_METADATA - XOTclMetaDataDestroy(obj); -#endif - - if (!softrecreate) { - CmdListRemoveList(&opt->mixins, GuardDel); - CmdListRemoveList(&opt->filters, GuardDel); - - FREE(XOTclObjectOpt,opt); - opt = obj->opt = 0; - } - } - - if (obj->nonposArgsTable) { - NonposArgsFreeTable(obj->nonposArgsTable); - Tcl_DeleteHashTable(obj->nonposArgsTable); - MEM_COUNT_FREE("Tcl_InitHashTable", obj->nonposArgsTable); - ckfree((char *) obj->nonposArgsTable); - MEM_COUNT_FREE("Tcl_HashTable",obj->nonposArgsTable); - } - - obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; - if (obj->mixinOrder) MixinResetOrder(obj); - obj->flags &= ~XOTCL_FILTER_ORDER_VALID; - if (obj->filterOrder) FilterResetOrder(obj); -} - -/* - * do obj initialization & namespace creation - */ -static void -CleanupInitObject(Tcl_Interp *in, XOTclObject *obj, - XOTclClass *cl, Tcl_Namespace *namespacePtr, int softrecreate) { -#ifdef OBJDELETION_TRACE - fprintf(stderr,"+++ CleanupInitObject\n"); -#endif - obj->teardown = in; - obj->nsPtr = namespacePtr; - if (!softrecreate) { - AddInstance(obj, cl); - } - if (obj->flags & XOTCL_RECREATE) { - obj->opt = 0; - obj->varTable = 0; - obj->nonposArgsTable = 0; - obj->mixinOrder = 0; - obj->filterOrder = 0; - obj->flags = 0; - } -} - -/* - * physical object destroy - */ -static void -PrimitiveODestroy(ClientData cd) { - XOTclObject *obj = (XOTclObject*)cd; - Tcl_Interp *in; - - /*fprintf(stderr, "****** PrimitiveODestroy %p\n",obj);*/ - assert(obj && !(obj->flags & XOTCL_DESTROYED)); - - /* - * check and latch against recurrent calls with obj->teardown - */ - PRINTOBJ("PrimitiveODestroy", obj); - - if (!obj || !obj->teardown) return; - in = obj->teardown; - obj->teardown = 0; - - /* - * Don't destroy, if the interpreter is destroyed already - * e.g. TK calls Tcl_DeleteInterp directly, if the window is killed - */ - if (Tcl_InterpDeleted(in)) return; - /* - * call and latch user destroy with obj->id if we haven't - */ - if (!(obj->flags & XOTCL_DESTROY_CALLED)) { - callDestroyMethod(cd, in, obj, 0); - obj->id = 0; - } - -#ifdef OBJDELETION_TRACE - fprintf(stderr," physical delete of %p id=%p destroyCalled=%d '%s'\n", - obj, obj->id, (obj->flags & XOTCL_DESTROY_CALLED), ObjStr(obj->cmdName)); -#endif - - CleanupDestroyObject(in, obj, 0); - - while (obj->mixinStack != NULL) - MixinStackPop(obj); - while (obj->filterStack != NULL) - FilterStackPop(obj); - -#if 0 - { - /* Prevent that PrimitiveODestroy is called more than once. - This code was used in earlier versions of XOTcl - but does not seem necessary any more. If it has to be used - again in the future, don't use Tcl_GetCommandFromObj() - in Tcl 8.4.* versions. - */ - Tcl_Command cmd = Tcl_FindCommand(in, ObjStr(obj->cmdName), 0, 0); - - if (cmd != NULL) - Tcl_Command_deleteProc(cmd) = 0; - } -#endif - - if (obj->nsPtr) { - /*fprintf(stderr,"primitive odestroy calls deletenamespace for obj %p\n",obj);*/ - XOTcl_DeleteNamespace(in, obj->nsPtr); - obj->nsPtr = 0; - } - - /*fprintf(stderr, " +++ OBJ/CLS free: %s\n", ObjStr(obj->cmdName));*/ - - obj->flags |= XOTCL_DESTROYED; - objTrace("ODestroy", obj); -#if REFCOUNT_TRACE - fprintf(stderr,"ODestroy %p flags %d rc %d destr %d dc %d\n", - obj, obj->flags, - (obj->flags & XOTCL_REFCOUNTED) != 0, - (obj->flags & XOTCL_DESTROYED) != 0, - (obj->flags & XOTCL_DESTROY_CALLED) != 0 - ); -#endif -#if REFCOUNTED - if (!(obj->flags & XOTCL_REFCOUNTED)) { - DECR_REF_COUNT(obj->cmdName); - } -#else - DECR_REF_COUNT(obj->cmdName); -#endif - - XOTclCleanupObject(obj); - -#if !defined(NDEBUG) - if (obj != (XOTclObject*)RUNTIME_STATE(in)->theClass) - checkAllInstances(in, RUNTIME_STATE(in)->theClass,0); -#endif -} - -static void -PrimitiveOInit(void* mem, Tcl_Interp *in, char *name, XOTclClass *cl) { - XOTclObject *obj = (XOTclObject*)mem; - -#ifdef OBJDELETION_TRACE - fprintf(stderr,"+++ PrimitiveOInit\n"); -#endif - -#ifdef XOTCLOBJ_TRACE - fprintf(stderr, "OINIT %s = %p\n", name, obj); -#endif - XOTclObjectRefCountIncr(obj); - - /* if the command of the obj was used before, we have to clean - * up the callstack from set "destroyedCmd" flags - */ - UndestroyObj(in, obj); - - if (Tcl_FindNamespace(in, name, NULL, 0)) { - CleanupInitObject(in, obj, cl, - NSGetFreshNamespace(in, (ClientData)obj, name), 0); - } else { - CleanupInitObject(in, obj, cl, NULL, 0); - } - /*obj->flags = XOTCL_MIXIN_ORDER_VALID | XOTCL_FILTER_ORDER_VALID;*/ - obj->mixinStack = 0; - obj->filterStack = 0; -} - -/* - * Object creation: create object name (full name) and Tcl command - */ -static XOTclObject* -PrimitiveOCreate(Tcl_Interp *in, char *name, XOTclClass *cl) { - XOTclObject *obj = (XOTclObject*)ckalloc(sizeof(XOTclObject)); - unsigned length; - - /*fprintf(stderr, "CKALLOC Object %p %s\n", obj, name);*/ -#if defined(XOTCLOBJ_TRACE) - fprintf(stderr, "CKALLOC Object %p %s\n", obj, name); -#endif -#ifdef OBJDELETION_TRACE - fprintf(stderr,"+++ PrimitiveOCreate\n"); -#endif - - memset(obj, 0, sizeof(XOTclObject)); - MEM_COUNT_ALLOC("XOTclObject/XOTclClass",obj); - assert(obj); /* ckalloc panics, if malloc fails */ - assert(isAbsolutePath(name)); - - length = strlen(name); - if (!NSCheckForParent(in, name, length)) { - ckfree((char *) obj); - return 0; - } - obj->id = Tcl_CreateObjCommand(in, name, XOTclObjDispatch, - (ClientData)obj, PrimitiveODestroy); - - PrimitiveOInit(obj, in, name, cl); -#if 0 - /*defined(KEEP_TCL_CMD_TYPE)*/ - /*TclNewObj(obj->cmdName);*/ - obj->cmdName = Tcl_NewStringObj(name,length); - TclSetCmdNameObj(in, obj->cmdName, (Command*)obj->id); - /*fprintf(stderr, "new command has name '%s'\n", ObjStr(obj->cmdName));*/ -#else - obj->cmdName = NewXOTclObjectObjName(obj, name, length); -#endif - INCR_REF_COUNT(obj->cmdName); - - objTrace("PrimitiveOCreate", obj); - - return obj; -} - -/* - * Cleanup class: remove filters, mixins, assertions, instances ... - * and remove class from class hierarchy - */ -static void -CleanupDestroyClass(Tcl_Interp *in, XOTclClass *cl, int softrecreate) { - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr; - XOTclClass *theobj = RUNTIME_STATE(in)->theObject; - XOTclObject *obj = (XOTclObject*)cl; - XOTclClassOpt* opt = cl->opt; - - if (opt) { - CmdListRemoveList(&opt->instmixins, GuardDel); - MixinInvalidateObjOrders(in, cl); - - CmdListRemoveList(&opt->instfilters, GuardDel); - FilterInvalidateObjOrders(in, cl); - - /* remove dependent filters of this class from all subclasses*/ - FilterRemoveDependentFilterCmds(cl, cl); - AssertionRemoveStore(opt->assertions); -#ifdef XOTCL_OBJECTDATA - XOTclFreeObjectData(cl); -#endif - } - - Tcl_ForgetImport(in, cl->nsPtr, "*"); /* don't destroy namespace imported objects */ - NSCleanupNamespace(in, cl->nsPtr); - NSDeleteChildren(in, cl->nsPtr); - - if (!softrecreate) { - /* reset all instances to the class ::xotcl::Object, that makes no sense - for ::Object itself */ - if (cl != theobj) { - hPtr = &cl->instances ? Tcl_FirstHashEntry(&cl->instances, &hSrch) : 0; - for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { - XOTclObject *inst = (XOTclObject*)Tcl_GetHashKey(&cl->instances, hPtr); - if (inst && (inst != (XOTclObject*)cl) && inst->id) { - if (inst != &(theobj->object)) { - (void)RemoveInstance(inst, obj->cl); - AddInstance(inst, theobj); - } - } - } - } - Tcl_DeleteHashTable(&cl->instances); - MEM_COUNT_FREE("Tcl_InitHashTable",&cl->instances); - } - - if (cl->nonposArgsTable) { - NonposArgsFreeTable(cl->nonposArgsTable); - Tcl_DeleteHashTable(cl->nonposArgsTable); - MEM_COUNT_FREE("Tcl_InitHashTable", cl->nonposArgsTable); - ckfree((char *) cl->nonposArgsTable); - MEM_COUNT_FREE("Tcl_HashTable",cl->nonposArgsTable); - } - - if (cl->parameters) { - DECR_REF_COUNT(cl->parameters); - } - - if (opt) { - if (opt->parameterClass) { - DECR_REF_COUNT(opt->parameterClass); - } - FREE(XOTclClassOpt, opt); - opt = cl->opt = 0; - } - - if (!softrecreate) { - /* - * flush all caches, unlink superclasses - */ - - FlushPrecedences(cl); - while (cl->sub) { - XOTclClass *subClass = cl->sub->cl; - (void)RemoveSuper(subClass, cl); - /* if there are no more super classes add the Object - * class as superclasses - * -> don't do that for Object itself! - */ - if (subClass->super == 0 && cl != theobj) - AddSuper(subClass, theobj); - } - while (cl->super) (void)RemoveSuper(cl, cl->super->cl); - } - -} - -/* - * do class initialization & namespace creation - */ -static void -CleanupInitClass(Tcl_Interp *in, XOTclClass *cl, Tcl_Namespace *namespacePtr, - int softrecreate) { - XOTclObject *obj = (XOTclObject*)cl; - -#ifdef OBJDELETION_TRACE - fprintf(stderr,"+++ CleanupInitClass\n"); -#endif - - /* - * during init of Object and Class the theClass value is not set - */ - /* - if (RUNTIME_STATE(in)->theClass != 0) - obj->type = RUNTIME_STATE(in)->theClass; - */ - XOTclObjectSetClass(obj); - - cl->nsPtr = namespacePtr; - - cl->super = 0; - cl->sub = 0; - AddSuper(cl, RUNTIME_STATE(in)->theObject); - cl->parent = RUNTIME_STATE(in)->theObject; - cl->color = WHITE; - cl->order = 0; - cl->parameters = 0; - - if (!softrecreate) { - Tcl_InitHashTable(&cl->instances, TCL_ONE_WORD_KEYS); - MEM_COUNT_ALLOC("Tcl_InitHashTable",&cl->instances); - } - - cl->opt = 0; - cl->nonposArgsTable = 0; -} - -/* - * class physical destruction - */ -static void -PrimitiveCDestroy(ClientData cd) { - XOTclClass *cl = (XOTclClass*)cd; - XOTclObject *obj = (XOTclObject*)cd; - Tcl_Interp *in; - Tcl_Namespace* saved; - - /* - * check and latch against recurrent calls with obj->teardown - */ - if (!obj || !obj->teardown) return; - in = obj->teardown; - - /* - * Don't destroy, if the interpreted is destroyed already - * e.g. TK calls Tcl_DeleteInterp directly, if Window is killed - */ - if (Tcl_InterpDeleted(in)) return; - - /* - * call and latch user destroy with obj->id if we haven't - */ - /*fprintf(stderr,"PrimitiveCDestroy %s flags %x\n",ObjStr(obj->cmdName),obj->flags);*/ - if (!(obj->flags & XOTCL_DESTROY_CALLED)) - /*fprintf(stderr,"PrimitiveCDestroy call destroy\n");*/ - callDestroyMethod(cd, in, obj, 0); - - obj->teardown = 0; - - CleanupDestroyClass(in, cl, 0); - - /* - * handoff the primitive teardown - */ - - saved = cl->nsPtr; - obj->teardown = in; - - /* - * class object destroy + physical destroy - */ - /*fprintf(stderr,"primitive cdestroy calls primitive odestroy\n");*/ - PrimitiveODestroy(cd); - - /*fprintf(stderr,"primitive cdestroy calls deletenamespace for obj %p\n",cl);*/ - saved->clientData = 0; - XOTcl_DeleteNamespace(in, saved); - - return; -} - -/* - * class init - */ -static void -PrimitiveCInit(XOTclClass *cl, Tcl_Interp *in, char *name) { - TclCallFrame frame, *framePtr = &frame; - Tcl_Namespace* ns; - - /* - * ensure that namespace is newly created during CleanupInitClass - * ie. kill it, if it exists already - */ - if (Tcl_PushCallFrame(in, (Tcl_CallFrame *)framePtr, - RUNTIME_STATE(in)->XOTclClassesNS, 0) != TCL_OK) - return; - ns = NSGetFreshNamespace(in, (ClientData)cl, name); - Tcl_PopCallFrame(in); - - CleanupInitClass(in, cl, ns, 0); - return; -} - -/* - * class create: creation of namespace + class full name - * calls class object creation - */ -static XOTclClass* -PrimitiveCCreate(Tcl_Interp *in, char *name, XOTclClass *class) { - XOTclClass *cl = (XOTclClass*)ckalloc(sizeof(XOTclClass)); - unsigned length; - XOTclObject *obj = (XOTclObject*)cl; - - /*fprintf(stderr, "CKALLOC Class %p %s\n", cl, name);*/ - - memset(cl, 0, sizeof(XOTclClass)); - MEM_COUNT_ALLOC("XOTclObject/XOTclClass",cl); - /* - fprintf(stderr, " +++ CLS alloc: %s\n", name); - */ - assert(isAbsolutePath(name)); - length = strlen(name); - /* - fprintf(stderr,"Class alloc %p '%s'\n", cl, name); - */ - /* check whether Object parent NS already exists, - otherwise: error */ - if (!NSCheckForParent(in, name, length)) { - ckfree((char *) cl); - return 0; - } - obj->id = Tcl_CreateObjCommand(in, name, XOTclObjDispatch, - (ClientData)cl, PrimitiveCDestroy); - - PrimitiveOInit(obj, in, name, class); - - obj->cmdName = NewXOTclObjectObjName(obj,name,length); - INCR_REF_COUNT(obj->cmdName); - PrimitiveCInit(cl, in, name+2); - - objTrace("PrimitiveCCreate", obj); - return cl; -} - -/* change XOTcl class conditionally; obj must not be NULL */ - -XOTCLINLINE static int -changeClass(Tcl_Interp *in, XOTclObject *obj, XOTclClass *cl) { - assert(obj); - - if (cl != obj->cl) { - if (IsMetaClass(in, cl) && !IsMetaClass(in, obj->cl)) { - return XOTclVarErrMsg(in, "cannot change class of object ", - ObjStr(obj->cmdName), - " to metaclass ", - ObjStr(cl->object.cmdName),(char *) NULL); - } - (void)RemoveInstance(obj, obj->cl); - AddInstance(obj, cl); - - MixinComputeDefined(in, obj); - FilterComputeDefined(in, obj); - } - return TCL_OK; -} - - -/* - * Undestroy the object, reclass it, and call "cleanup" afterwards - */ -static int -doCleanup(Tcl_Interp *in, XOTclObject *newobj, XOTclObject *classobj, - int objc, Tcl_Obj *CONST objv[]) { - int destroyed = 0, result; - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - XOTclCallStackContent *csc; - /* - * we check whether the object to be re-created is destroyed or not - */ - for (csc = &cs->content[1]; csc <= cs->top; csc++) { - if (newobj == csc->self && csc->destroyedCmd) { - destroyed = 1; break; - } - } - - if (destroyed) - UndestroyObj(in, newobj); - - /* - * re-create, first ensure correct class for newobj - */ - - result = changeClass(in, newobj, (XOTclClass*) classobj); - - if (result == TCL_OK) { - /* - * dispatch "cleanup" - */ - result = callMethod((ClientData) newobj, in, XOTclGlobalObjects[XOTE_CLEANUP], 2, 0, 0); - } - return result; -} - -/* - * Std object initialization: - * call parameter default values - * apply "-" methods (call "configure" with given arguments) - * call constructor "init", if it was not called before - */ -static int -doObjInitialization(Tcl_Interp *in, XOTclObject *obj, int objc, Tcl_Obj *CONST objv[]) { - int result, initArgsC = objc; - Tcl_Obj *savedObjResult = Tcl_GetObjResult(in); /* save the result */ - INCR_REF_COUNT(savedObjResult); - - /* - * Search for default values of parameter on superclasses - */ - if (!(obj->flags & XOTCL_INIT_CALLED)) { - result = callParameterMethodWithArg(obj, in, XOTclGlobalObjects[XOTE_SEARCH_DEFAULTS], - obj->cmdName, 3, 0, 0); - if (result != TCL_OK) - return result; - } - - /* clear INIT_CALLED_FLAG */ - obj->flags &= ~XOTCL_INIT_CALLED; - - /* - * call configure methods (starting with '-') - */ - - result = callMethod((ClientData) obj, in, - XOTclGlobalObjects[XOTE_CONFIGURE], objc, objv+2, 0); - if (result != TCL_OK) - return result; - - /* check, whether init was called already, and determine where the - * configure (with '-') start (we don't send them as args to - * "init"). */ - - if (!(obj->flags & XOTCL_INIT_CALLED)) { - int newargs; - Tcl_Obj *resultObj = Tcl_GetObjResult(in); - /* - * Call the user-defined constructor 'init' - */ - INCR_REF_COUNT(resultObj); - result = Tcl_GetIntFromObj(in,resultObj,&newargs); - DECR_REF_COUNT(resultObj); - - if (result == TCL_OK && newargs+2 < objc) - initArgsC = newargs+2; - result = callMethod((ClientData) obj, in, XOTclGlobalObjects[XOTE_INIT], - initArgsC, objv+2, 0); - obj->flags |= XOTCL_INIT_CALLED; - } - - if (result == TCL_OK) { - Tcl_SetObjResult(in, savedObjResult); - } - DECR_REF_COUNT(savedObjResult); - - return result; -} - - -/* - * experimental resolver implementation -> not used at the moment - */ -#ifdef NOT_USED -static int -XOTclResolveCmd(Tcl_Interp *in, char *name, Tcl_Namespace *contextNsPtr, - int flags, Tcl_Command *rPtr) { - - Tcl_Namespace *nsPtr[2], *cxtNsPtr; - char *simpleName; - register Tcl_HashEntry *entryPtr; - register Tcl_Command cmd; - register int search; - - /*fprintf(stderr, " ***%s->%s\n", contextNsPtr->fullName, name);*/ - - /* - * Find the namespace(s) that contain the command. - */ - if ((flags & TCL_GLOBAL_ONLY) != 0) { - cxtNsPtr = Tcl_GetGlobalNamespace(in); - } - else if (contextNsPtr != NULL) { - cxtNsPtr = contextNsPtr; - } - else { - cxtNsPtr = Tcl_GetCurrentNamespace(in); - } - - TclGetNamespaceForQualName(in, name, (Namespace *) contextNsPtr, - flags, &nsPtr[0], &nsPtr[1], &cxtNsPtr, &simpleName); - - /*fprintf(stderr, " ***Found %s, %s\n", nsPtr[0]->fullName, nsPtr[0]->fullName);*/ - - /* - * Look for the command in the command table of its namespace. - * Be sure to check both possible search paths: from the specified - * namespace context and from the global namespace. - */ - - cmd = NULL; - for (search = 0; (search < 2) && (cmd == NULL); search++) { - if ((nsPtr[search] != NULL) && (simpleName != NULL)) { - cmdTable = Tcl_Namespace_cmdTable(nsPtr[search]); - entryPtr = Tcl_FindHashEntry(cmdTable, simpleName); - if (entryPtr != NULL) { - cmd = (Tcl_Command) Tcl_GetHashValue(entryPtr); - } - } - } - if (cmd != NULL) { - Tcl_ObjCmdProc* objProc = Tcl_Command_objProc(cmd); - if (cxtNsPtr->deleteProc == NSNamespaceDeleteProc && - objProc != XOTclObjDispatch && - objProc != XOTclNextObjCmd && - objProc != XOTclGetSelfObjCmd) { - - /* - * the cmd is defined in an XOTcl object or class namespace, but - * not an object & not self/next -> redispatch in - * global namespace - */ - cmd = 0; - nsPtr[0] = Tcl_GetGlobalNamespace(in); - if ((nsPtr[0] != NULL) && (simpleName != NULL)) { - cmdTable = Tcl_Namespace_cmdTable(nsPtr[0]); - if ((entryPtr = Tcl_FindHashEntry(cmdTable, simpleName))) { - cmd = (Tcl_Command) Tcl_GetHashValue(entryPtr); - } - } - - /* - XOTclStackDump(in); - XOTclCallStackDump(in); - */ - } - *rPtr = cmd; - return TCL_OK; - } - - return TCL_CONTINUE; -} -static int -XOTclResolveVar(Tcl_Interp *in, char *name, Tcl_Namespace *context, - Tcl_ResolvedVarInfo *rPtr) { - /*fprintf(stderr, "Resolving %s in %s\n", name, context->fullName);*/ - - return TCL_CONTINUE; -} -#endif - -/* - * object method implementations - */ - -static int -XOTclODestroyMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 1) return XOTclObjErrArgCnt(in, obj->cmdName, "destroy"); - PRINTOBJ("XOTclODestroyMethod", obj); - - /* - * call instdestroy for [self] - */ - return XOTclCallMethodWithArgs((ClientData)obj->cl, in, - XOTclGlobalObjects[XOTE_INSTDESTROY], obj->cmdName, - objc, objv+1, 0); -} - -static int -XOTclOCleanupMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - XOTclClass *cl = XOTclObjectToClass(obj); - char *fn; - int softrecreate; - Tcl_Obj *savedNameObj; - -#if defined(OBJDELETION_TRACE) - fprintf(stderr,"+++ XOTclOCleanupMethod\n"); -#endif - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 1) return XOTclObjErrArgCnt(in, obj->cmdName, "cleanup"); - PRINTOBJ("XOTclOCleanupMethod", obj); - - fn = ObjStr(obj->cmdName); - savedNameObj = obj->cmdName; - INCR_REF_COUNT(savedNameObj); - - /* save and pass around softrecreate*/ - softrecreate = obj->flags & XOTCL_RECREATE&& RUNTIME_STATE(in)->doSoftrecreate; - - CleanupDestroyObject(in, obj, softrecreate); - CleanupInitObject(in, obj, obj->cl, obj->nsPtr, softrecreate); - - if (cl) { - CleanupDestroyClass(in, cl, softrecreate); - CleanupInitClass(in, cl, cl->nsPtr, softrecreate); - } - - DECR_REF_COUNT(savedNameObj); - - return TCL_OK; -} - -static int -XOTclOIsClassMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - Tcl_Obj *className; - XOTclObject *obj = (XOTclObject*)cd, *o; - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 1 || objc > 2) return XOTclObjErrArgCnt(in, obj->cmdName, - "isclass ?className?"); - className = (objc == 2) ? objv[1] : obj->cmdName; - - Tcl_SetIntObj(Tcl_GetObjResult(in), - (XOTclObjConvertObject(in, className, &o) == TCL_OK - && XOTclObjectIsClass(o) )); - return TCL_OK; -} - -static int -XOTclOIsObjectMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd, *o; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc != 2) return XOTclObjErrArgCnt(in, obj->cmdName, "isobject "); - - if (XOTclObjConvertObject(in, objv[1], &o) == TCL_OK) { - Tcl_SetIntObj(Tcl_GetObjResult(in), 1); - } else { - Tcl_SetIntObj(Tcl_GetObjResult(in), 0); - } - return TCL_OK; -} - -static int -IsMetaClass(Tcl_Interp *in, XOTclClass *cl) { - /* check if cl is a meta-class by checking is Class is a superclass of cl*/ - XOTclClasses *pl, *checkList=0, *mixinClasses = 0, *mc; - int hasMCM = 0; - - if (cl == RUNTIME_STATE(in)->theClass) - return 1; - - for (pl = ComputeOrder(cl, cl->order, Super); pl; pl = pl->next) { - if (pl->cl == RUNTIME_STATE(in)->theClass) - return 1; - } - - for (pl = ComputeOrder(cl, cl->order, Super); pl; pl = pl->next) { - XOTclClassOpt* opt = pl->cl->opt; - if (opt && opt->instmixins) { - MixinComputeOrderFullList(in, - &opt->instmixins, - &mixinClasses, - &checkList, 0); - } - } - - for (mc=mixinClasses; mc; mc = mc->next) { - /*fprintf(stderr,"- got %s\n",ObjStr(mc->cl->object.cmdName));*/ - if (isSubType(mc->cl, RUNTIME_STATE(in)->theClass)) { - hasMCM = 1; - break; - } - } - XOTclFreeClasses(mixinClasses); - XOTclFreeClasses(checkList); - /*fprintf(stderr,"has MC returns %d, mixinClasses = %p\n", - hasMCM, mixinClasses);*/ - - return hasMCM; -} - -static int -XOTclOIsMetaClassMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd, *o; - Tcl_Obj *className; - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 1 || objc > 2) return XOTclObjErrArgCnt(in, obj->cmdName, - "ismetaclass ?metaClassName?"); - - className = (objc == 2) ? objv[1] : obj->cmdName; - - if (XOTclObjConvertObject(in, className, &o) == TCL_OK - && XOTclObjectIsClass(o) - && IsMetaClass(in, (XOTclClass*)o)) { - Tcl_SetIntObj(Tcl_GetObjResult(in), 1); - } else { - Tcl_SetIntObj(Tcl_GetObjResult(in), 0); - } - return TCL_OK; -} - - -static int -isSubType(XOTclClass *subcl, XOTclClass *cl) { - XOTclClasses *t; - int success = 1; - assert(cl && subcl); - - if (cl != subcl) { - success = 0; - for (t = ComputeOrder(subcl, subcl->order, Super); t && t->cl; t = t->next) { - if (t->cl == cl) { - success = 1; - break; - } - } - } - return success; -} - - - -static int -XOTclOIsTypeMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - XOTclClass *cl; - int success = 0; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc != 2) return XOTclObjErrArgCnt(in, obj->cmdName, "istype "); - if (obj->cl && GetXOTclClassFromObj(in,objv[1],&cl, 1) == TCL_OK) { - success = isSubType(obj->cl,cl); - } - Tcl_ResetResult(in); - Tcl_SetIntObj(Tcl_GetObjResult(in), success); - return TCL_OK; -} - -static int -hasMixin(Tcl_Interp *in, XOTclObject *obj, XOTclClass *cl) { - - if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) - MixinComputeDefined(in, obj); - - if ((obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID)) { - XOTclCmdList *ml; - for (ml = obj->mixinOrder; ml; ml = ml->next) { - XOTclClass *mixin = XOTclGetClassFromCmdPtr(ml->cmdPtr); - if (mixin == cl) { - return 1; - } - } - } - return 0; -} - -static int -XOTclOIsMixinMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - XOTclClass *cl; - int success = 0; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc != 2) return XOTclObjErrArgCnt(in, obj->cmdName, "ismixin "); - - if (GetXOTclClassFromObj(in,objv[1],&cl, 1) == TCL_OK) { - success = hasMixin(in, obj, cl); - } - Tcl_ResetResult(in); - Tcl_SetIntObj(Tcl_GetObjResult(in), success); - return TCL_OK; -} - -static int -XOTclOExistsMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc != 2) return XOTclObjErrArgCnt(in, obj->cmdName, "exists var"); - - Tcl_SetIntObj(Tcl_GetObjResult(in), - varExists(in, obj, ObjStr(objv[1]),NULL, 1,1)); - return TCL_OK; -} - -static int -countModifiers(int objc, Tcl_Obj * CONST objv[]) { - int i, count = 0; - char *to; - for (i = 2; i < objc; i++) { - to = ObjStr(objv[i]); - if (to[0] == '-') { - count++; - /* '--' stops modifiers */ - if (to[1] == '-') break; - } - } - return count; -} - -static int -checkForModifier(Tcl_Obj * CONST objv[], int numberModifiers, char *modifier) { - int i; - if (numberModifiers == 0) return 0; - for (i = 2; i-2 < numberModifiers; i++) { - char *ov = ObjStr(objv[i]); - /* all start with a "-", so there must be a ov[1] */ - if (ov[1] == modifier[1] && !strcmp(ov, modifier)) - return 1; - } - return 0; -} - -static int -XOTclOInfoMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - Tcl_Namespace *nsp = obj->nsPtr; - char *cmd, *pattern; - int modifiers = 0; - XOTclObjectOpt *opt; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 2) - return XOTclObjErrArgCnt(in, obj->cmdName, "info ?args?"); - - opt = obj->opt; - cmd = ObjStr(objv[1]); - pattern = (objc > 2) ? ObjStr(objv[2]) : 0; - - /*fprintf(stderr, "OInfo cmd=%s, obj=%s, nsp=%p\n",cmd,ObjStr(obj->cmdName),nsp);*/ - - /* - * check for "-" modifiers - */ - if (pattern && *pattern == '-') { - modifiers = countModifiers(objc, objv); - pattern = (objc > 2+modifiers) ? ObjStr(objv[2+modifiers]) : 0; - } - - switch (*cmd) { - case 'a': - if (isArgsString(cmd)) { - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info args "); - if (obj->nonposArgsTable) { - XOTclNonposArgs* nonposArgs = - NonposArgsGet(obj->nonposArgsTable, pattern); - if (nonposArgs) { - return ListArgsFromOrdinaryArgs(in, nonposArgs); - } - } - if (nsp) - return ListProcArgs(in, Tcl_Namespace_cmdTable(nsp), pattern); - else - return TCL_OK; - } - break; - - case 'b': - if (!strcmp(cmd, "body")) { - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info body "); - if (nsp) - return ListProcBody(in, Tcl_Namespace_cmdTable(nsp), pattern); - else - return TCL_OK; - } - break; - - case 'c': - if (isClassString(cmd)) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info class ?class?"); - return ListClass(in, obj, pattern, objc, objv); - } else if (!strcmp(cmd, "commands")) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info commands ?pat?"); - if (nsp) - return ListKeys(in, Tcl_Namespace_cmdTable(nsp), pattern); - else - return TCL_OK; - } else if (!strcmp(cmd, "children")) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info children ?pat?"); - return ListChildren(in, obj, pattern, 0); - } else if (!strcmp(cmd, "check")) { - if (objc != 2 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info check"); - return AssertionListCheckOption(in, obj); - } - break; - - case 'd': - if (!strcmp(cmd, "default")) { - if (objc != 5 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info default "); - - if (obj->nonposArgsTable) { - XOTclNonposArgs* nonposArgs = - NonposArgsGet(obj->nonposArgsTable, pattern); - if (nonposArgs) { - return ListDefaultFromOrdinaryArgs(in, pattern, nonposArgs, - ObjStr(objv[3]), objv[4]); - } - } - if (nsp) - return ListProcDefault(in, Tcl_Namespace_cmdTable(nsp), pattern, - ObjStr(objv[3]), objv[4]); - else - return TCL_OK; - } - break; - - case 'f': - if (!strcmp(cmd, "filter")) { - int withGuards = 0, withOrder = 0; - if (objc-modifiers > 3) - return XOTclObjErrArgCnt(in, obj->cmdName, - "info filter ?-guards? ?-order? ?pat?"); - if (modifiers > 0) { - withGuards = checkForModifier(objv, modifiers, "-guards"); - withOrder = checkForModifier(objv, modifiers, "-order"); - - if (withGuards == 0 && withOrder == 0) - return XOTclVarErrMsg(in, "info filter: unknown modifier ", - ObjStr(objv[2]), (char *) NULL); - /* - if (withGuards && withOrder) - return XOTclVarErrMsg(in, "info filter: cannot use -guards and -order together", - ObjStr(objv[2]), (char *) NULL); - */ - } - - if (withOrder) { - if (!(obj->flags & XOTCL_FILTER_ORDER_VALID)) - FilterComputeDefined(in, obj); - return FilterInfo(in, obj->filterOrder, pattern, withGuards, 1); - } - - return opt ? FilterInfo(in, opt->filters, pattern, withGuards, 0) : TCL_OK; - - } else if (!strcmp(cmd, "filterguard")) { - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info filterguard filter"); - return opt ? GuardList(in, opt->filters, pattern) : TCL_OK; - } else if (!strcmp(cmd, "forward")) { - int argc = objc-modifiers; - int definition; - if (argc < 2 || argc > 3) - return XOTclObjErrArgCnt(in, obj->cmdName, - "info forward ?-definition? ?name?"); - definition = checkForModifier(objv, modifiers, "-definition"); - if (nsp) - return forwardList(in, Tcl_Namespace_cmdTable(nsp), pattern, definition); - else - return TCL_OK; - } - - break; - - case 'h': - if (!strcmp(cmd, "hasNamespace")) { - Tcl_SetBooleanObj(Tcl_GetObjResult(in), nsp != NULL); - return TCL_OK; - } - break; - - case 'i': - if (!strcmp(cmd, "invar")) { - if (objc != 2 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info invar"); - if (opt && opt->assertions) - Tcl_SetObjResult(in, AssertionList(in, opt->assertions->invariants)); - return TCL_OK; - } else if (!strcmp(cmd, "info")) { - if (objc > 2 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info info"); - return ListInfo(in, GetXOTclClassFromObj(in,obj->cmdName,NULL,0) == TCL_OK); - } - break; - - case 'm': - if (!strcmp(cmd, "mixin")) { - int withOrder = 0, withGuards = 0; - if (objc-modifiers > 3) - return XOTclObjErrArgCnt(in, obj->cmdName, - "info mixin ?-guards? ?-order? ?class?"); - if (modifiers > 0) { - withOrder = checkForModifier(objv, modifiers, "-order"); - withGuards = checkForModifier(objv, modifiers, "-guards"); - - if (withOrder == 0 && withGuards == 0) - return XOTclVarErrMsg(in, "info mixin: unknown modifier . ", - ObjStr(objv[2]), (char *) NULL); - } - - if (withOrder) { - if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) - MixinComputeDefined(in, obj); - return MixinInfo(in, obj->mixinOrder, pattern, withGuards); - } - - return opt ? MixinInfo(in, opt->mixins, pattern, withGuards) : TCL_OK; - - } else if (!strcmp(cmd, "mixinguard")) { - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info mixinguard mixin"); - - return opt ? GuardList(in, opt->mixins, pattern) : TCL_OK; - } else if (!strcmp(cmd, "methods")) { - int noprocs = 0, nocmds = 0, nomixins = 0, inContext = 0; - if (objc-modifiers > 3) - return XOTclObjErrArgCnt(in, obj->cmdName, - "info methods ?-noprocs? ?-nocmds? ?-nomixins? ?-incontext? ?pat?"); - if (modifiers > 0) { - noprocs = checkForModifier(objv, modifiers, "-noprocs"); - nocmds = checkForModifier(objv, modifiers, "-nocmds"); - nomixins = checkForModifier(objv, modifiers, "-nomixins"); - inContext = checkForModifier(objv, modifiers, "-incontext"); - } - return ListMethods(in, obj, pattern, noprocs, nocmds, nomixins, inContext); - } -#ifdef XOTCL_METADATA - else if (!strcmp(cmd, "metadata")) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info metadata ?pat?"); - return ListKeys(in, &obj->metaData, pattern); - } -#endif - break; - - case 'n': - if (!strcmp(cmd, "nonposargs")) { - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info nonposargs "); - if (obj->nonposArgsTable) { - XOTclNonposArgs* nonposArgs = - NonposArgsGet(obj->nonposArgsTable, pattern); - if (nonposArgs) { - Tcl_SetObjResult(in, NonposArgsFormat(in, nonposArgs->nonposArgs)); - } - } - return TCL_OK; - } - break; - - case 'p': - if (!strcmp(cmd, "procs")) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info procs ?pat?"); - if (nsp) - return ListMethodKeys(in, Tcl_Namespace_cmdTable(nsp), pattern, - /*noProcs*/ 0, /*noCmds*/ 1, /* noDups */ 0, 0 ); - else - return TCL_OK; - } else if (!strcmp(cmd, "parent")) { - if (objc > 2 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info parent"); - return ListParent(in, obj); - } else if (!strcmp(cmd, "pre")) { - XOTclProcAssertion* procs; - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info pre "); - if (opt) { - procs = AssertionFindProcs(opt->assertions, ObjStr(objv[2])); - if (procs) Tcl_SetObjResult(in, AssertionList(in, procs->pre)); - } - return TCL_OK; - } else if (!strcmp(cmd, "post")) { - XOTclProcAssertion* procs; - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info post "); - if (opt) { - procs = AssertionFindProcs(opt->assertions, ObjStr(objv[2])); - if (procs) Tcl_SetObjResult(in, AssertionList(in, procs->post)); - } - return TCL_OK; - } else if (!strcmp(cmd, "precedence")) { - return ListPrecedence(in, obj, pattern); - } - break; - case 'v': - if (!strcmp(cmd, "vars")) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, obj->cmdName, "info vars ?pat?"); - return ListVars(in, obj, pattern); - } - break; - } - return XOTclErrBadVal(in, "info", - "an info option (use 'info info' to list all info options)", cmd); -} - - -static int -XOTclOProcMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - char *argStr, *bdyStr, *name; - XOTclObjectOpt *opt; - int incr = 0, result = TCL_OK; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 4 || objc > 7) - return XOTclObjErrArgCnt(in, obj->cmdName, - "proc name ?non-positional-args? args body ?preAssertion postAssertion?"); - - if (objc == 5 || objc == 7) { - incr = 1; - } - - argStr = ObjStr(objv[2 + incr]); - bdyStr = ObjStr(objv[3 + incr]); - name = ObjStr(objv[1 + incr]); - - if (*argStr == 0 && *bdyStr == 0) { - opt = obj->opt; - if (opt) - AssertionRemoveProc(opt->assertions, name); - if (obj->nsPtr) - NSDeleteCmd(in, obj->nsPtr, name); - } else { - XOTclAssertionStore* aStore = NULL; - if (objc > 5) { - opt = XOTclRequireObjectOpt(obj); - if (!opt->assertions) - opt->assertions = AssertionCreateStore(); - aStore = opt->assertions; - } - requireObjNamespace(in, obj); - result = MakeProc(obj->nsPtr, aStore, &(obj->nonposArgsTable), - in, objc, (Tcl_Obj **) objv, obj); - } - - /* could be a filter => recompute filter order */ - FilterComputeDefined(in, obj); - - return result; -} - -static int -XOTclONoinitMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc != 1) return XOTclObjErrArgCnt(in, obj->cmdName, "noninit"); - - obj->flags |= XOTCL_INIT_CALLED; - - return TCL_OK; -} - -Tcl_Obj* -XOTclOSetInstVar(XOTcl_Object *obj, Tcl_Interp *in, - Tcl_Obj *name, Tcl_Obj *value, int flgs) { - return XOTclOSetInstVar2(obj, in, name, (Tcl_Obj *)NULL, value, (flgs|TCL_PARSE_PART1)); -} - -Tcl_Obj* -XOTclOGetInstVar(XOTcl_Object *obj, Tcl_Interp *in, Tcl_Obj *name, int flgs) { - return XOTclOGetInstVar2(obj, in, name, (Tcl_Obj *)NULL, (flgs|TCL_PARSE_PART1)); -} - -int -XOTclUnsetInstVar(XOTcl_Object *obj, Tcl_Interp *in, char *name, int flgs) { - return XOTclUnsetInstVar2 (obj, in, name,(char *)NULL, flgs); -} - -extern int -XOTclCreateObject(Tcl_Interp *in, Tcl_Obj *name, XOTcl_Class *cli) { - XOTclClass *cl = (XOTclClass*) cli; - int result; - INCR_REF_COUNT(name); - result = XOTclCallMethodWithArgs((ClientData)cl, in, - XOTclGlobalObjects[XOTE_CREATE], name, 1, 0, 0); - DECR_REF_COUNT(name); - return result; -} - -extern int -XOTclCreateClass(Tcl_Interp *in, Tcl_Obj *name, XOTcl_Class *cli) { - XOTclClass *cl = (XOTclClass*) cli; - int result; - INCR_REF_COUNT(name); - result = XOTclCallMethodWithArgs((ClientData)cl, in, - XOTclGlobalObjects[XOTE_CREATE], name, 1, 0, 0); - DECR_REF_COUNT(name); - return result; -} - -int -XOTclDeleteObject(Tcl_Interp *in, XOTcl_Object *obji) { - XOTclObject *obj = (XOTclObject*) obji; - return callMethod((ClientData)obj, in, XOTclGlobalObjects[XOTE_DESTROY],2,0,0); -} - -int -XOTclDeleteClass(Tcl_Interp *in, XOTcl_Class *cli) { - XOTclClass *cl = (XOTclClass*) cli; - return callMethod((ClientData)cl, in, XOTclGlobalObjects[XOTE_DESTROY],2,0,0); -} - -extern Tcl_Obj* -XOTclOSetInstVar2(XOTcl_Object *obji, Tcl_Interp *in, Tcl_Obj *name1, Tcl_Obj *name2, - Tcl_Obj *value, int flgs) { - XOTclObject *obj = (XOTclObject*) obji; - Tcl_Obj *result; - XOTcl_FrameDecls; - - XOTcl_PushFrame(in, obj); - if (obj->nsPtr) - flgs |= TCL_NAMESPACE_ONLY; - - result = Tcl_ObjSetVar2(in, name1, name2, value, flgs); - XOTcl_PopFrame(in, obj); - return result; -} - -extern int -XOTclUnsetInstVar2(XOTcl_Object *obji, Tcl_Interp *in, char *name1, char *name2, - int flgs) { - XOTclObject *obj = (XOTclObject*) obji; - int result; - XOTcl_FrameDecls; - - XOTcl_PushFrame(in, obj); - if (obj->nsPtr) - flgs |= TCL_NAMESPACE_ONLY; - - result = Tcl_UnsetVar2(in, name1, name2, flgs); - XOTcl_PopFrame(in, obj); - return result; -} - -static int -GetInstVarIntoCurrentScope(Tcl_Interp *in, XOTclObject *obj, - Tcl_Obj *varName, Tcl_Obj *newName) { - Var *varPtr = NULL, *otherPtr = NULL, *arrayPtr; - int new; - Tcl_CallFrame *varFramePtr; - TclVarHashTable *tablePtr; - XOTcl_FrameDecls; - - int flgs = TCL_LEAVE_ERR_MSG | - /* PARSE_PART1 needed for 8.0.5 */ TCL_PARSE_PART1; - - XOTcl_PushFrame(in, obj); - if (obj->nsPtr) { - flgs = flgs|TCL_NAMESPACE_ONLY; - } - - otherPtr = XOTclObjLookupVar(in, varName, (char *) NULL, flgs, "define", - /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr); - XOTcl_PopFrame(in, obj); - - if (otherPtr == NULL) { - return XOTclVarErrMsg(in, "can't make instvar ", ObjStr(varName), - ": can't find variable on ", ObjStr(obj->cmdName), - (char *) NULL); - } - - /* - * if newName == NULL -> there is no alias, use varName - * as target link name - */ - if (newName == NULL) { - /* - * Variable link into namespace cannot be an element in an array. - * see Tcl_VariableObjCmd ... - */ - if (arrayPtr) { - return XOTclVarErrMsg(in, "can't make instvar ", ObjStr(varName), - " on ", ObjStr(obj->cmdName), - ": variable cannot be an element in an array;", - " use an alias or objeval.", (char *) NULL); - } - - newName = varName; - } - - varFramePtr = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(in); - - /* - * If we are executing inside a Tcl procedure, create a local - * variable linked to the new namespace variable "varName". - */ - if (varFramePtr != NULL && Tcl_CallFrame_isProcCallFrame(varFramePtr)) { - Proc *procPtr = Tcl_CallFrame_procPtr(varFramePtr); - int localCt = procPtr->numCompiledLocals; - CompiledLocal *localPtr = procPtr->firstLocalPtr; - Var *localVarPtr = Tcl_CallFrame_compiledLocals(varFramePtr); - char *newNameString = ObjStr(newName); - int i, nameLen = strlen(newNameString); - - for (i = 0; i < localCt; i++) { /* look in compiled locals */ - - /* fprintf(stderr,"%d of %d %s flags %x not isTemp %d\n",i,localCt, - localPtr->name,localPtr->flags, - !TclIsCompiledLocalTemporary(localPtr));*/ - - if (!TclIsCompiledLocalTemporary(localPtr)) { - char *localName = localPtr->name; - if ((newNameString[0] == localName[0]) - && (nameLen == localPtr->nameLength) - && (strcmp(newNameString, localName) == 0)) { - varPtr = getNthVar(localVarPtr,i); - new = 0; - break; - } - } - localPtr = localPtr->nextPtr; - } - - if (varPtr == NULL) { /* look in frame's local var hashtable */ - tablePtr = Tcl_CallFrame_varTablePtr(varFramePtr); - if (tablePtr == NULL) { - tablePtr = (TclVarHashTable *) ckalloc(varHashTableSize); - InitVarHashTable(tablePtr, NULL); - Tcl_CallFrame_varTablePtr(varFramePtr) = tablePtr; - } - varPtr = VarHashCreateVar(tablePtr, newName, &new); - } - /* - * if we define an alias (newName != varName), be sure that - * the target does not exist already - */ - if (!new) { - if (varPtr == otherPtr) - return XOTclVarErrMsg(in, "can't instvar to variable itself", - (char *) NULL); - - if (TclIsVarLink(varPtr)) { - /* we try to make the same instvar again ... this is ok */ - Var *linkPtr = valueOfVar(Var,varPtr,linkPtr); - if (linkPtr == otherPtr) { - return TCL_OK; - } - - /*fprintf(stderr, "linkvar flags=%x\n",linkPtr->flags); - panic("new linkvar %s... When does this happen?",newNameString,NULL);*/ - - /* We have already a variable with the same name imported - from a different object. Get rid of this old variable - */ - VarHashRefCount(linkPtr)--; - if (TclIsVarUndefined(linkPtr)) { - CleanupVar(linkPtr, (Var *) NULL); - } - - } else if (!TclIsVarUndefined(varPtr)) { - return XOTclVarErrMsg(in, "variable '", ObjStr(newName), - "' exists already", (char *) NULL); - } else if (TclIsVarTraced(varPtr)) { - return XOTclVarErrMsg(in, "variable '", ObjStr(newName), - "' has traces: can't use for instvar", (char *) NULL); - } - } - - TclSetVarLink(varPtr); - TclClearVarUndefined(varPtr); -#if FORWARD_COMPATIBLE - if (forwardCompatibleMode) { - Var85 *vPtr = (Var85 *)varPtr; - vPtr->value.linkPtr = (Var85 *)otherPtr; - } else { - varPtr->value.linkPtr = otherPtr; - } -#else - varPtr->value.linkPtr = otherPtr; -#endif - VarHashRefCount(otherPtr)++; - - /* - { - Var85 *p = (Var85 *)varPtr; - fprintf(stderr,"defining an alias var='%s' in obj %s fwd %d flags %x isLink %d isTraced %d isUndefined %d\n", - ObjStr(newName), ObjStr(obj->cmdName), forwardCompatibleMode, - varFlags(varPtr), - TclIsVarLink(varPtr), TclIsVarTraced(varPtr), TclIsVarUndefined(varPtr)); - } - */ - } - return TCL_OK; -} - -static int -XOTclOInstVarMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]); - -extern int -XOTclInstVar(XOTcl_Object *obji, Tcl_Interp *in, char *name, char *destName) { - XOTclObject *obj = (XOTclObject*) obji; - int result; - Tcl_Obj *alias = 0; - ALLOC_ON_STACK(Tcl_Obj*,2, objv); - - objv[0] = XOTclGlobalObjects[XOTE_INSTVAR]; - objv[1] = Tcl_NewStringObj(name, -1); - INCR_REF_COUNT(objv[1]); - - if (destName != 0) { - alias = Tcl_NewStringObj(destName, -1); - INCR_REF_COUNT(alias); - Tcl_ListObjAppendElement(in, objv[1], alias); - } - - result = XOTclOInstVarMethod((ClientData) obj, in, 2, objv); - - if (destName != 0) { - DECR_REF_COUNT(alias); - } - DECR_REF_COUNT(objv[1]); - FREE_ON_STACK(objv); - return result; -} - -extern void -XOTclRemovePMethod(Tcl_Interp *in, XOTcl_Object *obji, char *nm) { - XOTclObject *obj = (XOTclObject*) obji; - if (obj->nsPtr) - NSDeleteCmd(in, obj->nsPtr, nm); -} - -extern void -XOTclRemoveIMethod(Tcl_Interp *in, XOTcl_Class *cli, char *nm) { - XOTclClass *cl = (XOTclClass*) cli; - NSDeleteCmd(in, cl->nsPtr, nm); -} - -/* - * obj/cl ClientData setter/getter - */ -extern void -XOTclSetObjClientData(XOTcl_Object *obji, ClientData data) { - XOTclObject *obj = (XOTclObject*) obji; - XOTclObjectOpt *opt = XOTclRequireObjectOpt(obj); - opt->clientData = data; -} -extern ClientData -XOTclGetObjClientData(XOTcl_Object *obji) { - XOTclObject *obj = (XOTclObject*) obji; - return (obj && obj->opt) ? obj->opt->clientData : 0; -} -extern void -XOTclSetClassClientData(XOTcl_Class *cli, ClientData data) { - XOTclClass *cl = (XOTclClass*) cli; - XOTclRequireClassOpt(cl); - cl->opt->clientData = data; -} -extern ClientData -XOTclGetClassClientData(XOTcl_Class *cli) { - XOTclClass *cl = (XOTclClass*) cli; - return (cl && cl->opt) ? cl->opt->clientData : 0; -} - -static int -setInstVar(Tcl_Interp *in, XOTclObject *obj, Tcl_Obj *name, Tcl_Obj* value) { - Tcl_Obj *result; - int flags = (obj->nsPtr) ? TCL_LEAVE_ERR_MSG|TCL_NAMESPACE_ONLY : TCL_LEAVE_ERR_MSG; - XOTcl_FrameDecls; - XOTcl_PushFrame(in, obj); - - if (value == NULL) { - result = Tcl_ObjGetVar2(in, name, NULL, flags); - } else { - result = Tcl_ObjSetVar2(in, name, NULL, value, flags); - } - XOTcl_PopFrame(in, obj); - - if (result) { - Tcl_SetObjResult(in, result); - return TCL_OK; - } - return TCL_ERROR; -} - -static int -XOTclOSetMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc > 3) XOTclObjErrArgCnt(in, obj->cmdName, "set var ?value?"); - return setInstVar(in, obj, objv[1], objc == 3 ? objv[2] : NULL); -} - -static int -XOTclSetterMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc > 2) return XOTclObjErrArgCnt(in, obj->cmdName, "parameter ?value?"); - return setInstVar(in, obj, objv[0], objc == 2 ? objv[1] : NULL); -} - - -static int -XOTclOUpvarMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - Tcl_Obj *frameInfoObj = NULL; - int i, result = TCL_ERROR; - char *frameInfo; - callFrameContext ctx = {0}; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 2) return XOTclObjErrArgCnt(in, obj->cmdName, - "?level? otherVar localVar ?otherVar localVar ...?"); - - if (objc % 2 == 0) { - frameInfo = ObjStr(objv[1]); - i = 2; - } else { - frameInfoObj = computeLevelObj(in, CALLING_LEVEL); - INCR_REF_COUNT(frameInfoObj); - frameInfo = ObjStr(frameInfoObj); - i = 1; - } - - if (obj && (obj->filterStack || obj->mixinStack)) { - CallStackUseActiveFrames(in, &ctx); - } - - for ( ; i < objc; i += 2) { - result = Tcl_UpVar2(in, frameInfo, ObjStr(objv[i]), NULL, - ObjStr(objv[i+1]), 0 /*flags*/); - if (result != TCL_OK) - break; - } - - if (frameInfoObj) { - DECR_REF_COUNT(frameInfoObj); - } - CallStackRestoreSavedFrames(in, &ctx); - return result; -} - -static int -XOTclOUplevelMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[]) { - XOTclObject *obj = (XOTclObject *)cd; - int i, result = TCL_ERROR; - char *frameInfo = NULL; - Tcl_CallFrame *framePtr = NULL, *savedVarFramePtr; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 2) { - uplevelSyntax: - return XOTclObjErrArgCnt(in, obj->cmdName, "?level? command ?arg ...?"); - } - /* - * Find the level to use for executing the command. - */ - if (objc>2) { - CallFrame *cf; - frameInfo = ObjStr(objv[1]); - result = TclGetFrame(in, frameInfo, &cf); - if (result == -1) { - return TCL_ERROR; - } - framePtr = (Tcl_CallFrame *)cf; - i = result+1; - } else { - i = 1; - } - - objc -= i; - objv += i; - if (objc == 0) { - goto uplevelSyntax; - } - - if (!framePtr) { - XOTclCallStackContent *csc = XOTclCallStackFindLastInvocation(in, 1); - if (csc) - framePtr = csc->currentFramePtr; - } - - savedVarFramePtr = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(in); - Tcl_Interp_varFramePtr(in) = (CallFrame *)framePtr; - - /* - * Execute the residual arguments as a command. - */ - - if (objc == 1) { - result = Tcl_EvalObjEx(in, objv[0], TCL_EVAL_DIRECT); - } else { - /* - * More than one argument: concatenate them together with spaces - * between, then evaluate the result. Tcl_EvalObjEx will delete - * the object when it decrements its refcount after eval'ing it. - */ - Tcl_Obj *objPtr = Tcl_ConcatObj(objc, objv); - result = Tcl_EvalObjEx(in, objPtr, TCL_EVAL_DIRECT); - } - if (result == TCL_ERROR) { - char msg[32 + TCL_INTEGER_SPACE]; - sprintf(msg, "\n (\"uplevel\" body line %d)", in->errorLine); - Tcl_AddObjErrorInfo(in, msg, -1); - } - - /* - * Restore the variable frame, and return. - */ - - Tcl_Interp_varFramePtr(in) = (CallFrame *)savedVarFramePtr; - return result; -} - -static int -forwardArg(Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[], - Tcl_Obj *o, forwardCmdClientData *tcd, Tcl_Obj **out, - Tcl_Obj **freeList, int *inputarg, int *mapvalue) { - char *element = ObjStr(o), *p; - int totalargs = objc + tcd->nr_args - 1; - char c = *element, c1; - - p = element; - - if (c == '%' && *(element+1) == '@') { - char *remainder = NULL; - long pos; - element += 2; - pos = strtol(element,&remainder,0); - /*fprintf(stderr,"strtol('%s) returned %ld '%s'\n",element,pos,remainder);*/ - if (element == remainder && *element == 'e' && !strncmp(element,"end",3)) { - pos = totalargs; - remainder += 3; - } - if (element == remainder || abs(pos) > totalargs) { - return XOTclVarErrMsg(in, "forward: invalid index specified in argument ", - ObjStr(o), (char *) NULL); - } if (!remainder || *remainder != ' ') { - return XOTclVarErrMsg(in, "forward: invaild syntax in '", ObjStr(o), - "' use: %@ ",(char *) NULL); - } - - element = ++remainder; - if (pos<0) pos = totalargs + pos; - /*fprintf(stderr,"remainder = '%s' pos = %ld\n",remainder,pos);*/ - *mapvalue = pos; - element = remainder; - c = *element; - } - /*fprintf(stderr,"c==%c element = '%s'\n",c,element);*/ - if (c == '%') { - Tcl_Obj *list = 0, **listElements; - int nrargs = objc-1, nrElements = 0; - c = *++element; - c1 = *(element+1); - - if (c == 's' && !strcmp(element,"self")) { - *out = tcd->obj->cmdName; - } else if (c == 'p' && !strcmp(element,"proc")) { - *out = objv[0]; - } else if (c == '1' && (c1 == '\0' || c1 == ' ')) { - /*fprintf(stderr, " nrargs=%d, subcommands=%d inputarg=%d, objc=%d\n", - nrargs, tcd->nr_subcommands, inputarg, objc);*/ - if (c1 != '\0') { - if (Tcl_ListObjIndex(in, o, 1, &list) != TCL_OK) { - return XOTclVarErrMsg(in, "forward: %1 must by a valid list, given: '", - ObjStr(o), "'", (char *) NULL); - } - if (Tcl_ListObjGetElements(in, list, &nrElements, &listElements) != TCL_OK) { - return XOTclVarErrMsg(in, "forward: %1 contains invalid list '", - ObjStr(list),"'", (char *) NULL); - } - } else if (tcd->subcommands) { /* deprecated part */ - if (Tcl_ListObjGetElements(in, tcd->subcommands,&nrElements,&listElements) != TCL_OK) { - return XOTclVarErrMsg(in, "forward: %1 contains invalid list '", - ObjStr(list),"'", (char *) NULL); - } - } - if (nrElements > nrargs) { - /* insert default subcommand depending on number of arguments */ - *out = listElements[nrargs]; - } else if (objc<=1) { - return XOTclObjErrArgCnt(in, objv[0], "no argument given"); - } else { - *out = objv[1]; - *inputarg = 2; - } - } else if (c == 'a' && !strncmp(element,"argcl", 4)) { - if (Tcl_ListObjIndex(in, o, 1, &list) != TCL_OK) { - return XOTclVarErrMsg(in, "forward: %argclindex must by a valid list, given: '", - ObjStr(o), "'", (char *) NULL); - } - if (Tcl_ListObjGetElements(in, list, &nrElements, &listElements) != TCL_OK) { - return XOTclVarErrMsg(in, "forward: %argclindex contains invalid list '", - ObjStr(list),"'", (char *) NULL); - } - if (nrargs >= nrElements) { - return XOTclVarErrMsg(in, "forward: not enough elements in specified list of ARGC argument ", - ObjStr(o), (char *) NULL); - } - *out = listElements[nrargs]; - } else if (c == '%') { - Tcl_Obj *newarg = Tcl_NewStringObj(element,-1); - *out = newarg; - goto add_to_freelist; - } else { - /* evaluating given command */ - int result; - /*fprintf(stderr,"evaluating '%s'\n",element);*/ - if ((result = Tcl_EvalEx(in, element, -1, 0)) != TCL_OK) - return result; - *out = Tcl_DuplicateObj(Tcl_GetObjResult(in)); - /*fprintf(stderr,"result = '%s'\n",ObjStr(*out));*/ - goto add_to_freelist; - } - } else { - if (p == element) - *out = o; - else { - Tcl_Obj *newarg = Tcl_NewStringObj(element,-1); - *out = newarg; - goto add_to_freelist; - } - } - return TCL_OK; - - add_to_freelist: - if (!*freeList) { - *freeList = Tcl_NewListObj(1, out); - INCR_REF_COUNT(*freeList); - } else - Tcl_ListObjAppendElement(in, *freeList, *out); - return TCL_OK; -} - - -static int -callForwarder(forwardCmdClientData *tcd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - ClientData cd; - int result; - XOTcl_FrameDecls; - - if (tcd->verbose) { - Tcl_Obj* cmd = Tcl_NewListObj(objc, objv); - fprintf(stderr,"calling %s\n", ObjStr(cmd)); - DECR_REF_COUNT(cmd); - } - if (tcd->objscope) { - XOTcl_PushFrame(in, tcd->obj); - } - if (tcd->objProc) { - result = (tcd->objProc)(tcd->cd, in, objc, objv); - } else if (tcd->cmdName->typePtr == &XOTclObjectType - && XOTclObjConvertObject(in, tcd->cmdName, (void*)&cd) == TCL_OK) { - /*fprintf(stderr, "XOTcl object %s, objc=%d\n", ObjStr(tcd->cmdName),objc);*/ - result = ObjDispatch(cd, in, objc, objv, 0); - } else { - /*fprintf(stderr, "no XOTcl object %s\n", ObjStr(tcd->cmdName));*/ - result = Tcl_EvalObjv(in, objc, objv, 0); - } - - if (tcd->objscope) { - XOTcl_PopFrame(in, tcd->obj); - } - return result; -} - -static int -XOTclForwardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - forwardCmdClientData *tcd = (forwardCmdClientData *)cd; - int result, j, inputarg=1, outputarg=0; - if (!tcd || !tcd->obj) return XOTclObjErrType(in, objv[0], "Object"); - - /* it is a c-method; establish a value for the currentFramePtr */ - RUNTIME_STATE(in)->cs.top->currentFramePtr = - (Tcl_CallFrame *) Tcl_Interp_varFramePtr(in); - /* - fprintf(stderr,"...setting currentFramePtr %p to %p (ForwardMethod)\n", - RUNTIME_STATE(in)->cs.top->currentFramePtr, - (Tcl_CallFrame *) Tcl_Interp_varFramePtr(in)); */ - - - if (tcd->passthrough) { /* two short cuts for simple cases */ - /* early binding, cmd* resolved, we have to care only for objscope */ - return callForwarder(tcd, in, objc, objv); - } else if (!tcd->args && *(ObjStr(tcd->cmdName)) != '%') { - /* we have ony to replace the method name with the given cmd name */ - ALLOC_ON_STACK(Tcl_Obj*,objc, ov); - memcpy(ov,objv, sizeof(Tcl_Obj *)*objc); - ov[0] = tcd->cmdName; - result = callForwarder(tcd, in, objc, ov); - FREE_ON_STACK(ov); - return result; - } else { - Tcl_Obj **ov, *freeList=NULL; - int totalargs = objc + tcd->nr_args + 3; - ALLOC_ON_STACK(Tcl_Obj*,totalargs, OV); - ALLOC_ON_STACK(int, totalargs, objvmap); - - ov = &OV[1]; - if (tcd->needobjmap) { - memset(objvmap, -1, sizeof(int)*totalargs); - } - -#if 0 - fprintf(stderr,"command %s (%p) objc=%d, subcommand=%d, args=%p, nrargs\n", - ObjStr(objv[0]), tcd, objc, - tcd->nr_subcommands, - tcd->args - ); -#endif - - /* the first argument is always the command, to which we forward */ - - if ((result = forwardArg(in, objc, objv, tcd->cmdName, tcd, - &ov[outputarg], &freeList, &inputarg, - &objvmap[outputarg])) != TCL_OK) { - goto exitforwardmethod; - } - outputarg++; - - if (tcd->args) { - /* copy argument list from definition */ - Tcl_Obj **listElements; - int nrElements; - Tcl_ListObjGetElements(in, tcd->args, &nrElements, &listElements); - - for (j=0; jnr_subcommands=%d size=%d\n", - objc, tcd->nr_subcommands, objc+ 2 );*/ - - if (objc-inputarg>0) { - /*fprintf(stderr, " copying remaining %d args starting at [%d]\n", - objc-inputarg, outputarg);*/ - memcpy(ov+outputarg, objv+inputarg, sizeof(Tcl_Obj *)*(objc-inputarg)); - } else { - /*fprintf(stderr, " nothing to copy, objc=%d, inputarg=%d\n", objc, inputarg);*/ - } - objc += outputarg - inputarg; - -#if 0 - for(j=0; jneedobjmap) - for (j=0; jpos) { - for(i=j; i>pos; i--) { - /*fprintf(stderr,"...moving right %d to %d\n",i-1,i);*/ - ov[i] = ov[i-1]; - objvmap[i] = objvmap[i-1]; - } - } else { - for(i=j; i %s\n",pos,ObjStr(tmp)); */ - ov[pos] = tmp; - objvmap[pos] = -1; - } - - if (tcd->prefix) { - /* prepend a prefix for the subcommands to avoid name clashes */ - Tcl_Obj *methodName = Tcl_DuplicateObj(tcd->prefix); - Tcl_AppendObjToObj(methodName, ov[1]); - ov[1] = methodName; - INCR_REF_COUNT(ov[1]); - } - -#if 0 - for(j=0; jcmdName; - result = callForwarder(tcd, in, objc, ov); - - if (tcd->prefix) {DECR_REF_COUNT(ov[1]);} - exitforwardmethod: - if (freeList) {DECR_REF_COUNT(freeList);} - FREE_ON_STACK(objvmap); - FREE_ON_STACK(OV); - } - return result; -} - - - -static int -XOTclOInstVarMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - Tcl_Obj **ov; - int i, oc, result = TCL_OK; - callFrameContext ctx = {0}; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 2) return XOTclObjErrArgCnt(in, obj->cmdName, "instvar ?vars?"); - - if (obj && (obj->filterStack || obj->mixinStack) ) { - CallStackUseActiveFrames(in, &ctx); - } - if (!Tcl_Interp_varFramePtr(in)) { - CallStackRestoreSavedFrames(in, &ctx); - return XOTclVarErrMsg(in, "instvar used on ", ObjStr(obj->cmdName), - ", but callstack is not in procedure scope", - (char *) NULL); - } - - for (i=1; icmdName, "vwait varname"); - - nameString = ObjStr(objv[1]); - - /* - * Make sure the var table exists and the varname is in there - */ - if (NSRequireVariableOnObj(in, obj, nameString, flgs) == 0) - return XOTclVarErrMsg(in, "Can't lookup (and create) variable ", - nameString, " on ", ObjStr(obj->cmdName), - (char *) NULL); - - XOTcl_PushFrame(in, obj); - /* - * much of this is copied from Tcl, since we must avoid - * access with flag TCL_GLOBAL_ONLY ... doesn't work on - * obj->varTable vars - */ - if (Tcl_TraceVar(in, nameString, flgs, (Tcl_VarTraceProc *)VwaitVarProc, - (ClientData) &done) != TCL_OK) { - return TCL_ERROR; - } - done = 0; - foundEvent = 1; - while (!done && foundEvent) { - foundEvent = Tcl_DoOneEvent(TCL_ALL_EVENTS); - } - Tcl_UntraceVar(in, nameString, flgs, (Tcl_VarTraceProc *)VwaitVarProc, - (ClientData) &done); - XOTcl_PopFrame(in, obj); - /* - * Clear out the interpreter's result, since it may have been set - * by event handlers. - */ - Tcl_ResetResult(in); - - if (!foundEvent) { - return XOTclVarErrMsg(in, "can't wait for variable '", nameString, - "': would wait forever", (char *) NULL); - } - return TCL_OK; -} - -static int -XOTclOInvariantsMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - XOTclObjectOpt *opt; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc != 2) - return XOTclObjErrArgCnt(in, obj->cmdName, "invar "); - - opt = XOTclRequireObjectOpt(obj); - - if (opt->assertions) - TclObjListFreeList(opt->assertions->invariants); - else - opt->assertions = AssertionCreateStore(); - - opt->assertions->invariants = AssertionNewList(in, objv[1]); - return TCL_OK; -} - -static int -XOTclOAutonameMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - int instanceOpt = 0, resetOpt = 0; - Tcl_Obj *autoname; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc == 3) { - instanceOpt = (strcmp(ObjStr(objv[1]), "-instance") == 0); - resetOpt = (strcmp(ObjStr(objv[1]), "-reset") == 0); - } - if ((objc < 2 || objc > 3) || (objc == 3 && !instanceOpt && !resetOpt)) - return XOTclObjErrArgCnt(in, obj->cmdName, "autoname [-instance | -reset] name"); - - autoname = AutonameIncr(in, objv[objc-1], obj, instanceOpt, resetOpt); - if (autoname) { - Tcl_SetObjResult(in, autoname); - DECR_REF_COUNT(autoname); - } - else - return XOTclVarErrMsg(in, - "Autoname failed. Probably format string (with %) was not well-formed", - (char *) NULL); - - return TCL_OK; -} - -static int -XOTclOCheckMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - int ocArgs; Tcl_Obj **ovArgs; - int i; - XOTclObjectOpt *opt; - - /*fprintf(stderr,"checkmethod\n");*/ - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc != 2) - return XOTclObjErrArgCnt(in, obj->cmdName, - "check (?all? ?pre? ?post? ?invar? ?instinvar?)"); - - opt = XOTclRequireObjectOpt(obj); - opt->checkoptions = CHECK_NONE; - - if (Tcl_ListObjGetElements(in, objv[1], &ocArgs, &ovArgs) == TCL_OK - && ocArgs > 0) { - for (i = 0; i < ocArgs; i++) { - char *option = ObjStr(ovArgs[i]); - if (option != 0) { - switch (*option) { - case 'i': - if (strcmp(option, "instinvar") == 0) { - opt->checkoptions |= CHECK_CLINVAR; - } else if (strcmp(option, "invar") == 0) { - opt->checkoptions |= CHECK_OBJINVAR; - } - break; - case 'p': - if (strcmp(option, "pre") == 0) { - opt->checkoptions |= CHECK_PRE; - } else if (strcmp(option, "post") == 0) { - opt->checkoptions |= CHECK_POST; - } - break; - case 'a': - if (strcmp(option, "all") == 0) { - opt->checkoptions |= CHECK_ALL; - } - break; - } - } - } - } - if (opt->checkoptions == CHECK_NONE && ocArgs>0) { - return XOTclVarErrMsg(in, "Unknown check option in command '", - ObjStr(obj->cmdName), " ", ObjStr(objv[0]), - " ", ObjStr(objv[1]), - "', valid: all pre post invar instinvar", - (char *) NULL); - } - - Tcl_ResetResult(in); - return TCL_OK; -} - -static int -XOTclConfigureCommand(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - int bool, opt, result = TCL_OK; - static CONST char *opts[] = { - "filter", "softrecreate", - NULL - }; - enum subCmdIdx { - filterIdx, softrecreateIdx - }; - - if (objc < 2 || objc>3) - return XOTclObjErrArgCnt(in, objv[0], - "::xotcl::configure filter|softrecreate ?on|off?"); - - if (Tcl_GetIndexFromObj(in, objv[1], opts, "option", 0, &opt) != TCL_OK) { - return TCL_ERROR; - } - - if (objc == 3) { - result = Tcl_GetBooleanFromObj(in, objv[2], &bool); - } - if (result == TCL_OK) { - switch (opt) { - case filterIdx: - Tcl_SetBooleanObj(Tcl_GetObjResult(in), - (RUNTIME_STATE(in)->doFilters)); - if (objc == 3) - RUNTIME_STATE(in)->doFilters = bool; - break; - - case softrecreateIdx: - Tcl_SetBooleanObj(Tcl_GetObjResult(in), - (RUNTIME_STATE(in)->doSoftrecreate)); - if (objc == 3) - RUNTIME_STATE(in)->doSoftrecreate = bool; - break; - } - } - return result; -} - -static int -XOTclObjscopedMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - aliasCmdClientData *tcd = (aliasCmdClientData *)cd; - XOTclObject *obj = tcd->obj; - int rc; - XOTcl_FrameDecls; - /*fprintf(stderr,"objscopedMethod obj=%p, ptr=%p\n",obj,tcd->objProc);*/ - XOTcl_PushFrame(in, obj); - rc = (tcd->objProc)(tcd->cd, in, objc, objv); - XOTcl_PopFrame(in, obj); - return rc; -} - -static void aliasCmdDeleteProc(ClientData cd) { - aliasCmdClientData *tcd = (aliasCmdClientData *)cd; - if (tcd->cmdName) {DECR_REF_COUNT(tcd->cmdName);} - /*fprintf(stderr,"aliasCmdDeleteProc\n");*/ - FREE(aliasCmdClientData, tcd); -} - -static int -XOTclAliasCommand(ClientData cd, Tcl_Interp *in, - int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = NULL; - XOTclClass *cl = NULL; - Tcl_Command cmd = NULL; - Tcl_ObjCmdProc *objProc; - char allocation, *methodName, *optionName; - Tcl_CmdDeleteProc* dp = NULL; - aliasCmdClientData *tcd = NULL; - int objscope = 0, i; - - if (objc < 4 || objc > 6) { - return XOTclObjErrArgCnt(in, objv[0], - "| ?-objscope? ?-per-object? "); - } - - GetXOTclClassFromObj(in, objv[1], &cl, 1); - if (!cl) { - XOTclObjConvertObject(in, objv[1], &obj); - if (!obj) - return XOTclObjErrType(in, objv[1], "Class|Object"); - allocation = 'o'; - } else { - allocation = 'c'; - } - - methodName = ObjStr(objv[2]); - - for (i=3; i<5; i++) { - optionName = ObjStr(objv[i]); - if (*optionName != '-') break; - if (!strcmp("-objscope",optionName)) { - objscope = 1; - } else if (!strcmp("-per-object",optionName)) { - allocation = 'o'; - } else { - return XOTclErrBadVal(in, "::xotcl::alias", - "option -objscope or -per-object", optionName); - } - } - - cmd = Tcl_GetCommandFromObj(in, objv[i]); - if (cmd == NULL) - return XOTclVarErrMsg(in, "cannot lookup command '", - ObjStr(objv[i]), "'", (char *) NULL); - objProc = Tcl_Command_objProc(cmd); - - if (objc>i+1) { - return XOTclVarErrMsg(in, "invalid argument '", - ObjStr(objv[i+1]), "'", (char *) NULL); - } - - if (objscope) { - tcd = NEW(aliasCmdClientData); - tcd->cmdName = 0; - tcd->obj = allocation == 'c' ? &cl->object : obj; - tcd->objProc = objProc; - tcd->cd = Tcl_Command_objClientData(cmd); - objProc = XOTclObjscopedMethod; - dp = aliasCmdDeleteProc; - } - - if (allocation == 'c') { - XOTclAddIMethod(in, (XOTcl_Class*)cl, methodName, objProc, tcd, dp); - } else { - XOTclAddPMethod(in, (XOTcl_Object*)obj, methodName, objProc, tcd, dp); - } - return TCL_OK; -} - - -static int -XOTclSetInstvarCommand(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj; - - if (objc < 3 || objc > 4) - return XOTclObjErrArgCnt(in, objv[0], "::xotcl::instvarset obj var ?value?"); - - XOTclObjConvertObject(in, objv[1], &obj); - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - - return setInstVar(in, obj ,objv[2], objc == 4 ? objv[3] : NULL); -} - - -static int -XOTclSetRelationCommand(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - int oc; Tcl_Obj **ov; - XOTclObject *obj = NULL; - XOTclClass *cl = NULL; - XOTclObjectOpt *objopt = NULL; - XOTclClassOpt *clopt = NULL; - int i, opt; - static CONST char *opts[] = { - "mixin", "instmixin", - "filter", "instfilter", - "class", "superclass", - NULL - }; - enum subCmdIdx { - mixinIdx, instmixinIdx, - filterIdx, instfilterIdx, - classIdx, superclassIdx - }; - - if (objc < 3) - return XOTclObjErrArgCnt(in, objv[0], "::xotcl::setrelation obj reltype classes"); - - if (Tcl_GetIndexFromObj(in, objv[2], opts, "relation type", 0, &opt) != TCL_OK) { - return TCL_ERROR; - } - - switch (opt) { - case mixinIdx: - case filterIdx: { - XOTclObjConvertObject(in, objv[1], &obj); - if (!obj) return XOTclObjErrType(in, objv[1], "Object"); - if (Tcl_ListObjGetElements(in, objv[3], &oc, &ov) != TCL_OK) - return TCL_ERROR; - objopt = XOTclRequireObjectOpt(obj); - break; - } - case instmixinIdx: - case instfilterIdx: { - GetXOTclClassFromObj(in, objv[1], &cl, 1); - if (!cl) return XOTclObjErrType(in, objv[1], "Class"); - if (Tcl_ListObjGetElements(in, objv[3], &oc, &ov) != TCL_OK) - return TCL_ERROR; - clopt = XOTclRequireClassOpt(cl); - break; - } - case superclassIdx: - { - GetXOTclClassFromObj(in, objv[1], &cl, 1); - if (!cl) return XOTclObjErrType(in, objv[1], "Class"); - if (Tcl_ListObjGetElements(in, objv[3], &oc, &ov) != TCL_OK) - return TCL_ERROR; - return SuperclassAdd(in, cl, oc, ov, objv[3]); - } - case classIdx: - { - XOTclObjConvertObject(in, objv[1], &obj); - if (!obj) return XOTclObjErrType(in, objv[1], "Object"); - GetXOTclClassFromObj(in, objv[3], &cl, 1); - if (!cl) return XOTclErrBadVal(in, "class", "a class", ObjStr(objv[1])); - return changeClass(in, obj, cl); - } - } - - switch (opt) { - case mixinIdx: - { - if (objopt->mixins) CmdListRemoveList(&objopt->mixins, GuardDel); - - obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; - /* - * since mixin procs may be used as filters -> we have to invalidate - */ - obj->flags &= ~XOTCL_FILTER_ORDER_VALID; - - for (i = 0; i < oc; i++) { - if (MixinAdd(in, &objopt->mixins, ov[i]) != TCL_OK) - return TCL_ERROR; - } - - MixinComputeDefined(in, obj); - FilterComputeDefined(in, obj); - break; - } - case filterIdx: - { - if (objopt->filters) CmdListRemoveList(&objopt->filters, GuardDel); - - obj->flags &= ~XOTCL_FILTER_ORDER_VALID; - for (i = 0; i < oc; i ++) { - if (FilterAdd(in, &objopt->filters, ov[i], obj, 0) != TCL_OK) - return TCL_ERROR; - } - /*FilterComputeDefined(in, obj);*/ - break; - } - - case instmixinIdx: - { - if (clopt->instmixins) CmdListRemoveList(&clopt->instmixins, GuardDel); - - MixinInvalidateObjOrders(in, cl); - /* - * since mixin procs may be used as filters -> we have to invalidate - */ - FilterInvalidateObjOrders(in, cl); - - for (i = 0; i < oc; i++) { - if (MixinAdd(in, &clopt->instmixins, ov[i]) != TCL_OK) - return TCL_ERROR; - } - break; - } - case instfilterIdx: - { - if (clopt->instfilters) CmdListRemoveList(&clopt->instfilters, GuardDel); - - FilterInvalidateObjOrders(in, cl); - - for (i = 0; i < oc; i ++) { - if (FilterAdd(in, &clopt->instfilters, ov[i], 0, cl) != TCL_OK) - return TCL_ERROR; - } - break; - } - } - return TCL_OK; -} - - -static int -XOTclOMixinGuardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - XOTclCmdList* h; - XOTclObjectOpt *opt; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc != 3) - return XOTclObjErrArgCnt(in, obj->cmdName, "mixinguard mixin guards"); - - opt = obj->opt; - if (opt && opt->mixins) { - XOTclClass *mixinCl = XOTclpGetClass(in, ObjStr(objv[1])); - Tcl_Command mixinCmd = NULL; - if (mixinCl) { - mixinCmd = Tcl_GetCommandFromObj(in, mixinCl->object.cmdName); - } - if (mixinCmd) { - h = CmdListFindCmdInList(mixinCmd, opt->mixins); - if (h) { - if (h->clientData) - GuardDel((XOTclCmdList*) h); - GuardAdd(in, h, objv[2]); - obj->flags &= ~XOTCL_MIXIN_ORDER_VALID; - return TCL_OK; - } - } - } - - return XOTclVarErrMsg(in, "Mixinguard: can't find mixin ", - ObjStr(objv[1]), " on ", ObjStr(obj->cmdName), - (char *) NULL); -} - - -static int -XOTclOFilterGuardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - XOTclCmdList* h; - XOTclObjectOpt *opt; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc != 3) - return XOTclObjErrArgCnt(in, obj->cmdName, "filterguard filtername filterGuards"); - - opt = obj->opt; - if (opt && opt->filters) { - h = CmdListFindNameInList(in, ObjStr(objv[1]), opt->filters); - if (h) { - if (h->clientData) - GuardDel((XOTclCmdList*) h); - GuardAdd(in, h, objv[2]); - obj->flags &= ~XOTCL_FILTER_ORDER_VALID; - return TCL_OK; - } - } - - return XOTclVarErrMsg(in, "Filterguard: can't find filter ", - ObjStr(objv[1]), " on ", ObjStr(obj->cmdName), - (char *) NULL); -} - -/* - * Searches for filter on [self] and returns fully qualified name - * if it is not found it returns an empty string - */ -static int -XOTclOFilterSearchMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - char *methodName; - XOTclCmdList *cmdList; - XOTclClass *fcl; - XOTclObject *fobj; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 2) return XOTclObjErrArgCnt(in, obj->cmdName, "filtersearch name"); - Tcl_ResetResult(in); - - if (!(obj->flags & XOTCL_FILTER_ORDER_VALID)) - FilterComputeDefined(in, obj); - if (!(obj->flags & XOTCL_FILTER_ORDER_DEFINED)) - return TCL_OK; - - methodName = ObjStr(objv[1]); - cmdList = obj->filterOrder; - - while (cmdList) { - CONST84 char *filterName = Tcl_GetCommandName(in, cmdList->cmdPtr); - if (filterName[0] == methodName[0] && !strcmp(filterName, methodName)) - break; - cmdList = cmdList->next; - } - - if (!cmdList) - return TCL_OK; - - fcl = cmdList->clorobj; - if (fcl && XOTclObjectIsClass(&fcl->object)) { - fobj = 0; - } else { - fobj = (XOTclObject*)fcl; - fcl = 0; - } - - Tcl_SetObjResult(in, - getFullProcQualifier(in, methodName, fobj, fcl, - cmdList->cmdPtr)); - return TCL_OK; -} - -static int -XOTclOProcSearchMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - XOTclClass *pcl = NULL; - Tcl_Command cmd = 0; - char *simpleName, *methodName; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 2) return XOTclObjErrArgCnt(in, obj->cmdName, "procsearch name"); - - Tcl_ResetResult(in); - - methodName = ObjStr(objv[1]); - - if (obj->nsPtr) - cmd = FindMethod(methodName, obj->nsPtr); - - if (!cmd) { - if (!(obj->flags & XOTCL_MIXIN_ORDER_VALID)) - MixinComputeDefined(in, obj); - - if (obj->flags & XOTCL_MIXIN_ORDER_DEFINED_AND_VALID) { - XOTclCmdList* mixinList = obj->mixinOrder; - while (mixinList) { - XOTclClass *mcl = XOTclpGetClass(in, (char *)Tcl_GetCommandName(in, mixinList->cmdPtr)); - if (mcl && (pcl = SearchCMethod(mcl, methodName, &cmd))) { - break; - } - mixinList = mixinList->next; - } - } - } - - if (!cmd && obj->cl) - pcl = SearchCMethod(obj->cl, methodName, &cmd); - - if (cmd) { - XOTclObject *pobj = pcl ? NULL : obj; - simpleName = (char *)Tcl_GetCommandName(in, cmd); - Tcl_SetObjResult(in, getFullProcQualifier(in, simpleName, pobj, pcl, cmd)); - } - return TCL_OK; -} - -static int -XOTclORequireNamespaceMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc != 1) return XOTclObjErrArgCnt(in, obj->cmdName, "requireNamespace"); - - requireObjNamespace(in, obj); - return TCL_OK; -} - -typedef enum {NO_DASH, SKALAR_DASH, LIST_DASH} dashArgType; - -static dashArgType -isDashArg(Tcl_Interp *in, Tcl_Obj *obj, char **methodName, int *objc, Tcl_Obj **objv[]) { - char *flag; - static Tcl_ObjType *listType = NULL; - - assert(obj); - - /* fetch list type, if not set already; if used on more places, this should - be moved into the interpreter state - */ - if (listType == NULL) { -#if defined(PRE82) - Tcl_Obj *tmp = Tcl_NewListObj(1, &obj); - listType = tmp->typePtr; - DECR_REF_COUNT(tmp); -#else - static XOTclMutex initMutex = 0; - XOTclMutexLock(&initMutex); - if (listType == NULL) { - listType = Tcl_GetObjType("list"); - /*fprintf(stderr, "fetching listType=%p\n",listType);*/ - } - XOTclMutexUnlock(&initMutex); -#endif - } - - if (obj->typePtr == listType) { - if (Tcl_ListObjGetElements(in, obj, objc, objv) == TCL_OK && *objc>1) { - flag = ObjStr(*objv[0]); - /*fprintf(stderr, "we have a list starting with '%s'\n", flag);*/ - if (*flag == '-') { - *methodName = flag+1; - return LIST_DASH; - } - } - } - flag = ObjStr(obj); - /*fprintf(stderr, "we have a scalar '%s'\n", flag);*/ - if (*flag == '-' && isalpha((int)*((flag)+1))) { - *methodName = flag+1; - *objc = 1; - return SKALAR_DASH; - } - return NO_DASH; -} - -static int -callConfigureMethod(Tcl_Interp *in, XOTclObject *obj, - char *methodName, int argc, Tcl_Obj *CONST argv[]) { - int result; - Tcl_Obj *method = Tcl_NewStringObj(methodName,-1); - - /*fprintf(stderr,"callConfigureMethod method %s->'%s' argc %d\n", - ObjStr(obj->cmdName), methodName, argc);*/ - - if (isInitString(methodName)) - obj->flags |= XOTCL_INIT_CALLED; - - INCR_REF_COUNT(method); - result = callMethod((ClientData)obj, in, method, argc, argv, XOTCL_CM_NO_UNKNOWN); - DECR_REF_COUNT(method); - - /*fprintf(stderr, "method '%s' called args: %d o=%p, result=%d\n", - methodName, argc+1, obj, result); */ - - if (result != TCL_OK) { - Tcl_Obj *res = Tcl_DuplicateObj(Tcl_GetObjResult(in)); /* save the result */ - INCR_REF_COUNT(res); - XOTclVarErrMsg(in, ObjStr(res), " during '", ObjStr(obj->cmdName), " ", - methodName, "'", (char *) NULL); - DECR_REF_COUNT(res); - } - return result; -} - - -static int -XOTclOConfigureMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - Tcl_Obj **argv, **nextArgv; - int i, argc, nextArgc, normalArgs, result = TCL_OK, isdasharg = NO_DASH; - char *methodName, *nextMethodName; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 1) return XOTclObjErrArgCnt(in, obj->cmdName, - "configure ?args?"); - /* find arguments without leading dash */ - for (i=1; i < objc; i++) { - if ((isdasharg = isDashArg(in, objv[i], &methodName, &argc, &argv))) - break; - } - normalArgs = i-1; - - for( ; i < objc; argc=nextArgc, argv=nextArgv, methodName=nextMethodName) { - Tcl_ResetResult(in); - switch (isdasharg) { - case SKALAR_DASH: /* argument is a skalar with a leading dash */ - { int j; - for (j = i+1; j < objc; j++, argc++) { - if ((isdasharg = isDashArg(in, objv[j], &nextMethodName, &nextArgc, &nextArgv))) - break; - } - result = callConfigureMethod(in, obj, methodName, argc+1, objv+i+1); - if (result != TCL_OK) - return result; - i += argc; - break; - } - case LIST_DASH: /* argument is a list with a leading dash, grouping determined by list */ - { i++; - if (icmdName), - " configure: unexpected argument '", - ObjStr(objv[i]), - "' between parameters", (char *) NULL); - } - } - } - Tcl_ResetResult(in); - Tcl_SetIntObj(Tcl_GetObjResult(in), normalArgs); - return result; -} - - - -/* - * class method implementations - */ - -static int -XOTclCInstDestroyMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - XOTclObject *delobj; - int rc; - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc < 2) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "instdestroy "); - - if (XOTclObjConvertObject(in, objv[1], &delobj) != TCL_OK) - return XOTclVarErrMsg(in, "Can't destroy object ", - ObjStr(objv[1]), " that does not exist.", - (char *) NULL); - - /* fprintf(stderr,"instdestroy obj=%s, opt=%p\n",ObjStr(delobj->cmdName),delobj->opt);*/ - - rc = freeUnsetTraceVariable(in, delobj); - if (rc != TCL_OK) { - return rc; - } - - /* - * latch, and call delete command if not already in progress - */ - delobj->flags |= XOTCL_DESTROY_CALLED; - RUNTIME_STATE(in)->callIsDestroy = 1; - /*fprintf(stderr,"instDestroy: setting callIsDestroy = 1\n");*/ - if (RUNTIME_STATE(in)->exitHandlerDestroyRound != - XOTCL_EXITHANDLER_ON_SOFT_DESTROY) { - CallStackDestroyObject(in, delobj); - } - - return TCL_OK; -} - - -static Tcl_Namespace * -callingNameSpace(Tcl_Interp *in) { - Tcl_Namespace *ns = NULL; - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - XOTclCallStackContent *top = cs->top; - XOTclCallStackContent *csc = XOTclCallStackFindLastInvocation(in, 0); - - /*fprintf(stderr," **** use last invocation csc = %p\n", csc);*/ - if (csc && csc->currentFramePtr) { - /* use the callspace from the last invocation */ - XOTclCallStackContent *called = csccurrentFramePtr) : NULL; - /*fprintf(stderr," **** csc use frame= %p\n", f);*/ - if (f) { - ns = f->nsPtr; - } else { - Tcl_CallFrame *f = Tcl_CallFrame_callerPtr(csc->currentFramePtr); - ns = Tcl_GetCurrentNamespace(in); - /* find last incovation outside ::xotcl (for things like relmgr) */ - while (ns == RUNTIME_STATE(in)->XOTclNS) { - if (f) { - ns = f->nsPtr; - f = Tcl_CallFrame_callerPtr(f); - } else { - ns = Tcl_GetGlobalNamespace(in); - } - } - /*fprintf(stderr, "found ns %p '%s'\n",ns, ns?ns->fullName:"NULL");*/ - } - } - if (!ns) { - /* calls on xotcl toplevel */ - XOTclCallStackContent *bot = cs->content + 1; - /*fprintf(stderr, " **** bot=%p diff=%d\n",bot, top-bot);*/ - if (top - bot >= 0 && bot->currentFramePtr) { - /* get calling tcl environment */ - Tcl_CallFrame *f = Tcl_CallFrame_callerPtr(bot->currentFramePtr); - if (f) { - ns = f->nsPtr; - /*fprintf(stderr, "top=%p, bot=%p b->c=%p f=%p ns=%p\n", - top,bot,bot->currentFramePtr, f, ns);*/ - /*fprintf(stderr,"ns from calling tcl environment %p '%s'\n", - ns, ns?ns->fullName : "" );*/ - } else { - /* fprintf(stderr, "nothing found, use ::\n"); */ - ns = Tcl_GetGlobalNamespace(in); - } - } - } - - /*XOTclCallStackDump(in);*/ - /*XOTclStackDump(in);*/ - - /*fprintf(stderr,"callingNameSpace returns %p %s\n",ns,ns?ns->fullName:"");*/ - return ns; -} - - -static int -XOTclCAllocMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - XOTclClass *newcl; - XOTclObject *newobj; - int result; - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc < 2) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "alloc ?args?"); - -#if 0 - fprintf(stderr, "type(%s)=%p %s %d\n", - ObjStr(objv[1]), objv[1]->typePtr, objv[1]->typePtr? - objv[1]->typePtr->name:"NULL", - XOTclObjConvertObject(in, objv[1], &newobj) - ); - /* - * if the lookup via GetObject for the object succeeds, - * the object exists already, - * and we do not overwrite it, but re-create it - */ - if (XOTclObjConvertObject(in, objv[1], &newobj) == TCL_OK) { - fprintf(stderr, "lookup successful\n"); - result = doCleanup(in, newobj, &cl->object, objc, objv); - } else -#endif - { - /* - * create a new object from scratch - */ - char *objName = ObjStr(objv[1]); - Tcl_Obj *tmpName = NULL; - - if (!isAbsolutePath(objName)) { - /*fprintf(stderr, "CallocMethod\n");*/ - tmpName = NameInNamespaceObj(in,objName,callingNameSpace(in)); - /*fprintf(stderr, "NoAbsoluteName for '%s' -> determined = '%s'\n", - objName, ObjStr(tmpName));*/ - objName = ObjStr(tmpName); - - /*fprintf(stderr," **** name is '%s'\n", objName);*/ - INCR_REF_COUNT(tmpName); - } - - if (IsMetaClass(in, cl)) { - /* - * if the base class is a meta-class, we create a class - */ - newcl = PrimitiveCCreate(in, objName, cl); - if (newcl == 0) - result = XOTclVarErrMsg(in, "Class alloc failed for '",objName, - "' (possibly parent namespace does not exist)", - (char *) NULL); - else { - Tcl_SetObjResult(in, newcl->object.cmdName); - result = TCL_OK; - } - } else { - /* - * if the base class is an ordinary class, we create an object - */ - newobj = PrimitiveOCreate(in, objName, cl); - if (newobj == 0) - result = XOTclVarErrMsg(in, "Object alloc failed for '",objName, - "' (possibly parent namespace does not exist)", - (char *) NULL); - else { - result = TCL_OK; - Tcl_SetObjResult(in, newobj->cmdName); - } - } - - if (tmpName) { - DECR_REF_COUNT(tmpName); - } - - } - - return result; -} - - -static int -createMethod(Tcl_Interp *in, XOTclClass *cl, XOTclObject *obj, - int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *newobj = NULL; - Tcl_Obj *nameObj, *tmpObj = NULL; - int result; - char *objName, *specifiedName; - - ALLOC_ON_STACK(Tcl_Obj*,objc, tov); - - memcpy(tov, objv, sizeof(Tcl_Obj *)*(objc)); - specifiedName = objName = ObjStr(objv[1]); - /* - * complete the name if it is not absolute - */ - if (!isAbsolutePath(objName)) { - tmpObj = NameInNamespaceObj(in,objName,callingNameSpace(in)); - objName = ObjStr(tmpObj); - /*fprintf(stderr," **** name is '%s'\n", objName);*/ - - INCR_REF_COUNT(tmpObj); - tov[1] = tmpObj; - } - - /* - * Check whether we have to call recreate (i.e. when the - * object exists already) - */ - newobj = XOTclpGetObject(in, objName); - - /*fprintf(stderr,"+++ create objv[1] '%s', specifiedName '%s', newObj=%p\n", - specifiedName, objName, newobj);*/ - - /* don't allow an object to be recreated as a class */ - if (newobj && (!IsMetaClass(in, cl) || IsMetaClass(in, newobj->cl))) { - /*fprintf(stderr, "%%%% recreate, call recreate method ... %s, objc=%d\n", - ObjStr(tov[1]),objc+1);*/ - /* call recreate --> initialization */ - result = callMethod((ClientData) obj, in, - XOTclGlobalObjects[XOTE_RECREATE], objc+1, tov+1, 0); - if (result != TCL_OK) - goto create_method_exit; - - Tcl_SetObjResult(in, newobj->cmdName); - nameObj = newobj->cmdName; - objTrace("RECREATE", newobj); - - } else { - - if (!NSCheckColons(specifiedName, 0)) { - result = XOTclVarErrMsg(in, "Cannot create object -- illegal name '", - specifiedName, "'", (char *) NULL); - goto create_method_exit; - } - - /* fprintf(stderr, "alloc ... %s\n", ObjStr(tov[1]));*/ - result = callMethod((ClientData) obj, in, - XOTclGlobalObjects[XOTE_ALLOC], objc+1, tov+1, 0); - if (result != TCL_OK) - goto create_method_exit; - - nameObj = Tcl_GetObjResult(in); - if (XOTclObjConvertObject(in, nameObj, &newobj) != TCL_OK) { - result = XOTclErrMsg(in, "couldn't find result of alloc", TCL_STATIC); - goto create_method_exit; - } - - (void)RemoveInstance(newobj, newobj->cl); - AddInstance(newobj, cl); - objTrace("CREATE", newobj); - - /* in case, the object is destroyed during initialization, we incr refcount */ - INCR_REF_COUNT(nameObj); - result = doObjInitialization(in, newobj, objc, objv); - DECR_REF_COUNT(nameObj); - } - create_method_exit: - - /* fprintf(stderr, "create -- end ... %s\n", ObjStr(tov[1]));*/ - if (tmpObj) {DECR_REF_COUNT(tmpObj);} - FREE_ON_STACK(tov); - return result; -} - - -static int -XOTclCCreateMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc < 2) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "create ?args?"); - - if (RUNTIME_STATE(in)->exitHandlerDestroyRound != XOTCL_EXITHANDLER_OFF) { - fprintf(stderr,"### Can't create object %s during shutdown\n",ObjStr(objv[1])); - return TCL_ERROR; - return TCL_OK; /* don't fail, if this happens during destroy, it might be canceled */ - } - - return createMethod(in, cl, &cl->object, objc, objv); -} - - -static int -XOTclCNewMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - XOTclObject *child = NULL; - Tcl_Obj *fullname; - int result, offset = 1, -#if REFCOUNTED - isrefcount = 0, -#endif - i, prefixLength; - Tcl_DString dFullname, *dsPtr = &dFullname; - XOTclStringIncrStruct *iss = &RUNTIME_STATE(in)->iss; - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - - if (objc < 1) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "new [-childof obj] ?args?"); - - for (i=1; icmdName), -1); - Tcl_DStringAppend(dsPtr, "::__#", 5); - } else { - Tcl_DStringAppend(dsPtr, "::xotcl::__#", 12); - } - prefixLength = dsPtr->length; - - while (1) { - (void)XOTclStringIncr(iss); - Tcl_DStringAppend(dsPtr, iss->start, iss->length); - if (!Tcl_FindCommand(in, Tcl_DStringValue(dsPtr), NULL, 0)) { - break; - } - /* in case the value existed already, reset prefix to the - original length */ - Tcl_DStringSetLength(dsPtr, prefixLength); - } - - fullname = Tcl_NewStringObj(Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr)); - - INCR_REF_COUNT(fullname); - - objc -= offset; - { - ALLOC_ON_STACK(Tcl_Obj*,objc+3, ov); - - ov[0] = objv[0]; - ov[1] = XOTclGlobalObjects[XOTE_CREATE]; - ov[2] = fullname; - if (objc >= 1) - memcpy(ov+3, objv+offset, sizeof(Tcl_Obj *)*objc); - - result = DoDispatch(cd, in, objc+3, ov, 0); - FREE_ON_STACK(ov); - } - -#if REFCOUNTED - if (result == TCL_OK) { - if (isrefcount) { - Tcl_Obj *obj = Tcl_GetObjResult(in); - XOTclObject *o = (XOTclObject*) obj->internalRep.otherValuePtr; - o->flags |= XOTCL_REFCOUNTED; - o->teardown = in; - DECR_REF_COUNT(obj); - } - } -#endif - - DECR_REF_COUNT(fullname); - Tcl_DStringFree(dsPtr); - - return result; -} - - -static int -XOTclCRecreateMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - XOTclObject *newobj; - int result; - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc < 2) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "recreate ?args?"); - - if (XOTclObjConvertObject(in, objv[1], &newobj) != TCL_OK) - return XOTclVarErrMsg(in, "can't recreate not existing obj ", - ObjStr(objv[1]), (char *) NULL); - - INCR_REF_COUNT(objv[1]); - newobj->flags |= XOTCL_RECREATE; - - result = doCleanup(in, newobj, &cl->object, objc, objv); - if (result == TCL_OK) { - result = doObjInitialization(in, newobj, objc, objv); - if (result == TCL_OK) - Tcl_SetObjResult(in, objv[1]); - } - DECR_REF_COUNT(objv[1]); - return result; -} - -static int -XOTclCInfoMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - Tcl_Namespace *nsp; - XOTclClassOpt *opt; - char *pattern, *cmd; - int modifiers = 0; - - if (objc < 2) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "info ?args?"); - - if (cl) { - nsp = cl->nsPtr; - opt = cl->opt; - - cmd = ObjStr(objv[1]); - pattern = (objc > 2) ? ObjStr(objv[2]) : 0; - - /* - * check for "-" modifiers - */ - if (pattern && *pattern == '-') { - modifiers = countModifiers(objc, objv); - pattern = (objc > 2+modifiers) ? ObjStr(objv[2+modifiers]) : 0; - } - - switch (*cmd) { - case 'c': - if (!strcmp(cmd, "classchildren")) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "info classchildren ?pat?"); - return ListChildren(in, (XOTclObject*) cl, pattern, 1); - } else if (!strcmp(cmd, "classparent")) { - if (objc > 2 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "info classparent"); - return ListParent(in, &cl->object); - } - break; - - case 'h': - if (!strcmp(cmd, "heritage")) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "info heritage ?pat?"); - return ListHeritage(in, cl, pattern); - } - break; - - case 'i': - if (cmd[1] == 'n' && cmd[2] == 's' && cmd[3] == 't') { - char *cmdTail = cmd + 4; - switch (*cmdTail) { - case 'a': - if (!strcmp(cmdTail, "ances")) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "info instances ?pat?"); - return ListObjPtrHashTable(in, &cl->instances, pattern); - } else if (!strcmp(cmdTail, "args")) { - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instargs "); - if (cl->nonposArgsTable) { - XOTclNonposArgs* nonposArgs = - NonposArgsGet(cl->nonposArgsTable, pattern); - if (nonposArgs) { - return ListArgsFromOrdinaryArgs(in, nonposArgs); - } - } - return ListProcArgs(in, Tcl_Namespace_cmdTable(nsp), pattern); - } - break; - - case 'b': - if (!strcmp(cmdTail, "body")) { - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instbody "); - return ListProcBody(in, Tcl_Namespace_cmdTable(nsp), pattern); - } - break; - - case 'c': - if (!strcmp(cmdTail, "commands")) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instcommands ?pat?"); - return ListKeys(in, Tcl_Namespace_cmdTable(nsp), pattern); - } - break; - - case 'd': - if (!strcmp(cmdTail, "default")) { - if (objc != 5 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instdefault "); - - if (cl->nonposArgsTable) { - XOTclNonposArgs* nonposArgs = - NonposArgsGet(cl->nonposArgsTable, pattern); - if (nonposArgs) { - return ListDefaultFromOrdinaryArgs(in, pattern, nonposArgs, - ObjStr(objv[3]), objv[4]); - } - } - return ListProcDefault(in, Tcl_Namespace_cmdTable(nsp), pattern, - ObjStr(objv[3]), objv[4]); - } - break; - - case 'f': - if (!strcmp(cmdTail, "filter")) { - int withGuards = 0; - if (objc-modifiers > 3) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instfilter ?-guards? ?pat?"); - if (modifiers > 0) { - withGuards = checkForModifier(objv, modifiers, "-guards"); - if (withGuards == 0) - return XOTclVarErrMsg(in, "info instfilter: unknown modifier ", - ObjStr(objv[2]), (char *) NULL); - } - return opt ? FilterInfo(in, opt->instfilters, pattern, withGuards, 0) : TCL_OK; - - } else if (!strcmp(cmdTail, "filterguard")) { - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instfilterguard filter"); - return opt ? GuardList(in, opt->instfilters, pattern) : TCL_OK; - } else if (!strcmp(cmdTail, "forward")) { - int argc = objc-modifiers; - int definition; - if (argc < 2 || argc > 3) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instforward ?-definition? ?name?"); - definition = checkForModifier(objv, modifiers, "-definition"); - if (nsp) - return forwardList(in, Tcl_Namespace_cmdTable(nsp), pattern, definition); - else - return TCL_OK; - } - break; - - case 'i': - if (!strcmp(cmdTail, "invar")) { - XOTclAssertionStore *assertions = opt ? opt->assertions : 0; - if (objc != 2 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instinvar"); - - if (assertions && assertions->invariants) - Tcl_SetObjResult(in, AssertionList(in, assertions->invariants)); - return TCL_OK; - } - break; - - case 'm': - if (!strcmp(cmdTail, "mixin")) { - int withGuards = 0; - - if (objc-modifiers > 3 || modifiers > 1) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instmixin ?-guards? ?class?"); - if (modifiers > 0) { - withGuards = checkForModifier(objv, modifiers, "-guards"); - if (withGuards == 0) - return XOTclVarErrMsg(in, "info instfilter: unknown modifier ", - ObjStr(objv[2]), (char *) NULL); - } - return opt ? MixinInfo(in, opt->instmixins, pattern, withGuards) : TCL_OK; - - } else if (!strcmp(cmdTail, "mixinguard")) { - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instmixinguard mixin"); - return opt ? GuardList(in, opt->instmixins, pattern) : TCL_OK; - } - break; - - case 'n': - if (!strcmp(cmdTail, "nonposargs")) { - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instnonposargs "); - if (cl->nonposArgsTable) { - XOTclNonposArgs* nonposArgs = - NonposArgsGet(cl->nonposArgsTable, pattern); - if (nonposArgs) { - Tcl_SetObjResult(in, NonposArgsFormat(in, - nonposArgs->nonposArgs)); - } - } - return TCL_OK; - } - break; - - case 'p': - if (!strcmp(cmdTail, "procs")) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "info instprocs ?pat?"); - return ListMethodKeys(in, Tcl_Namespace_cmdTable(nsp), pattern, - /*noProcs*/ 0, /*noCmds*/ 1, /* noDups */ 0, 0); - } else if (!strcmp(cmdTail, "pre")) { - XOTclProcAssertion* procs; - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instpre "); - if (opt && opt->assertions) { - procs = AssertionFindProcs(opt->assertions, ObjStr(objv[2])); - if (procs) Tcl_SetObjResult(in, AssertionList(in, procs->pre)); - } - return TCL_OK; - } else if (!strcmp(cmdTail, "post")) { - XOTclProcAssertion* procs; - if (objc != 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info instpost "); - if (opt && opt->assertions) { - procs = AssertionFindProcs(opt->assertions, ObjStr(objv[2])); - if (procs) Tcl_SetObjResult(in, AssertionList(in, procs->post)); - } - return TCL_OK; - } - break; - } - } - break; - - case 'p': - if (!strcmp(cmd, "parameterclass")) { - if (opt && opt->parameterClass) { - Tcl_SetObjResult(in, opt->parameterClass); - } else { - Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_PARAM_CL]); - } - return TCL_OK; - } else if (!strcmp(cmd, "parameter")) { - - Tcl_DString ds, *dsPtr = &ds; - XOTclObject *o; - DSTRING_INIT(dsPtr); - Tcl_DStringAppend(dsPtr, className(cl), -1); - Tcl_DStringAppend(dsPtr, "::slot", 6); - o = XOTclpGetObject(in, Tcl_DStringValue(dsPtr)); - if (o) { - Tcl_Obj *varNameObj = Tcl_NewStringObj("__parameter",-1); - Tcl_Obj *parameters = XOTclOGetInstVar2((XOTcl_Object*)o, - in, varNameObj, NULL, - TCL_LEAVE_ERR_MSG); - if (parameters) { - Tcl_SetObjResult(in, parameters); - } else { - fprintf(stderr, "info parameters: No value for %s\n", - Tcl_DStringValue(dsPtr)); - Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); - } - DECR_REF_COUNT(varNameObj); - } else { - Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); - } - DSTRING_FREE(dsPtr); -#if 0 - if (cl->parameters) { - Tcl_SetObjResult(in, cl->parameters); - } else { - Tcl_SetObjResult(in, XOTclGlobalObjects[XOTE_EMPTY]); - } -#endif - return TCL_OK; - } - break; - - case 's': - if (!strcmp(cmd, "superclass")) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info superclass ?class?"); - return ListSuperclasses(in, cl, pattern); - } else if (!strcmp(cmd, "subclass")) { - if (objc > 3 || modifiers > 0) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "info subclass ?class?"); - return ListSubclasses(in, cl, pattern); - } else if (!strcmp(cmd, "slots")) { - Tcl_DString ds, *dsPtr = &ds; - XOTclObject *o; - int rc; - DSTRING_INIT(dsPtr); - Tcl_DStringAppend(dsPtr, className(cl), -1); - Tcl_DStringAppend(dsPtr, "::slot", 6); - o = XOTclpGetObject(in, Tcl_DStringValue(dsPtr)); - if (o) { - rc = ListChildren(in, o, NULL, 0); - } else { - rc = TCL_OK; - } - DSTRING_FREE(dsPtr); - return rc; - } - break; - } - } - - return XOTclOInfoMethod(cd, in, objc, (Tcl_Obj **)objv); -} - -static int -XOTclCParameterMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - Tcl_Obj **pv = 0; - int elts, pc, result; - char * params; - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc != 2) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "parameter ?params?"); - if (cl->parameters) { - DECR_REF_COUNT(cl->parameters); - } - - /* did we delete the parameters ? */ - params = ObjStr(objv[1]); - if ((params == NULL) || (*params == '\0')) { - cl->parameters = 0; - return TCL_OK; - } - - /* ok, remember the params */ - cl->parameters = objv[1]; - INCR_REF_COUNT(cl->parameters); - - /* call getter/setter methods in params */ - result = Tcl_ListObjGetElements(in, objv[1], &pc, &pv); - if (result == TCL_OK) { - for (elts = 0; elts < pc; elts++) { - result = callParameterMethodWithArg(&cl->object, in, - XOTclGlobalObjects[XOTE_MKGETTERSETTER], - cl->object.cmdName, 3+1, &pv[elts],0); - if (result != TCL_OK) - break; - } - } - return result; -} - -static int -XOTclCParameterClassMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - char *paramClStr; - XOTclClassOpt *opt; - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc != 2) - return XOTclObjErrArgCnt(in, cl->object.cmdName, "parameterclass cl"); - - paramClStr = ObjStr(objv[1]); - opt = cl->opt; - if (opt && opt->parameterClass) { - DECR_REF_COUNT(opt->parameterClass); - } - if ((paramClStr == NULL) || (*paramClStr == '\0')) { - if (opt) - opt->parameterClass = 0; - } else { - opt = XOTclRequireClassOpt(cl); - opt->parameterClass = objv[1]; - INCR_REF_COUNT(opt->parameterClass); - } - return TCL_OK; -} - -static int -XOTclCInstParameterCmdMethod(ClientData cd, Tcl_Interp *in, - int objc, Tcl_Obj * CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc < 2) return XOTclObjErrArgCnt(in, cl->object.cmdName, "instparametercmd name"); - XOTclAddIMethod(in, (XOTcl_Class*) cl, ObjStr(objv[1]), - (Tcl_ObjCmdProc*)XOTclSetterMethod, 0, 0); - return TCL_OK; -} - -static int -XOTclCParameterCmdMethod(ClientData cd, Tcl_Interp *in, - int objc, Tcl_Obj * CONST objv[]) { - XOTclObject *obj = (XOTclObject*) cd; - - if (objc < 2) return XOTclObjErrArgCnt(in, obj->cmdName, "parametercmd name"); - XOTclAddPMethod(in, (XOTcl_Object*) obj, ObjStr(objv[1]), - (Tcl_ObjCmdProc*)XOTclSetterMethod, 0, 0); - return TCL_OK; -} - -static void forwardCmdDeleteProc(ClientData cd) { - forwardCmdClientData *tcd = (forwardCmdClientData *)cd; - if (tcd->cmdName) {DECR_REF_COUNT(tcd->cmdName);} - if (tcd->subcommands) {DECR_REF_COUNT(tcd->subcommands);} - if (tcd->prefix) {DECR_REF_COUNT(tcd->prefix);} - if (tcd->args) {DECR_REF_COUNT(tcd->args);} - FREE(forwardCmdClientData, tcd); -} - -static int -forwardProcessOptions(Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[], - forwardCmdClientData **tcdp) { - forwardCmdClientData *tcd; - int i, rc = 0, earlybinding = 0; - - tcd = NEW(forwardCmdClientData); - memset(tcd, 0, sizeof(forwardCmdClientData)); - - for (i=2; isubcommands = objv[i+1]; - rc = Tcl_ListObjLength(in,objv[i+1],&tcd->nr_subcommands); - if (rc != TCL_OK) break; - INCR_REF_COUNT(tcd->subcommands); - i++; - } else if (!strcmp(ObjStr(objv[i]),"-methodprefix")) { - if (objc <= i+1) {rc = TCL_ERROR; break;} - tcd->prefix = objv[i+1]; - INCR_REF_COUNT(tcd->prefix); - i++; - } else if (!strcmp(ObjStr(objv[i]),"-objscope")) { - tcd->objscope = 1; - } else if (!strcmp(ObjStr(objv[i]),"-earlybinding")) { - earlybinding = 1; - } else if (!strcmp(ObjStr(objv[i]),"-verbose")) { - tcd->verbose = 1; - } else { - break; - } - } - - tcd->needobjmap = 0; - for (; ineedobjmap |= (*element == '%' && *(element+1) == '@'); - - if (tcd->cmdName == 0) { - tcd->cmdName = objv[i]; - } else if (tcd->args == 0) { - tcd->args = Tcl_NewListObj(1, &objv[i]); - tcd->nr_args++; - INCR_REF_COUNT(tcd->args); - } else { - Tcl_ListObjAppendElement(in, tcd->args, objv[i]); - tcd->nr_args++; - } - } - - if (!tcd->cmdName) { - tcd->cmdName = objv[1]; - } - - if (tcd->objscope) { - /* when we evaluating objscope, and define ... - o forward append -objscope append - a call to - o append ... - would lead to a recursive call; so we add the appropriate namespace - */ - char *name = ObjStr(tcd->cmdName); - if (!isAbsolutePath(name)) { - tcd->cmdName = NameInNamespaceObj(in, name, callingNameSpace(in)); - /*fprintf(stderr,"name %s not absolute, therefore qualifying %s\n", name, - ObjStr(tcd->cmdName));*/ - } - } - INCR_REF_COUNT(tcd->cmdName); - - if (earlybinding) { - Tcl_Command cmd = Tcl_GetCommandFromObj(in, tcd->cmdName); - if (cmd == NULL) - return XOTclVarErrMsg(in, "cannot lookup command '",ObjStr(tcd->cmdName), "'", (char *) NULL); - - tcd->objProc = Tcl_Command_objProc(cmd); - if (tcd->objProc == XOTclObjDispatch /* don't do direct invoke on xotcl objects */ - || tcd->objProc == TclObjInterpProc /* don't do direct invoke on tcl procs */ - ) { - /* silently ignore earlybinding flag */ - tcd->objProc = NULL; - } else { - tcd->cd = Tcl_Command_objClientData(cmd); - } - } - - tcd->passthrough = !tcd->args && *(ObjStr(tcd->cmdName)) != '%' && tcd->objProc != NULL; - - /*fprintf(stderr, "forward args = %p, name = '%s'\n",tcd->args, ObjStr(tcd->cmdName));*/ - if (rc == TCL_OK) { - *tcdp = tcd; - } else { - forwardCmdDeleteProc((ClientData)tcd); - } - return rc; -} - - -static int -XOTclCInstForwardMethod(ClientData cd, Tcl_Interp *in, - int objc, Tcl_Obj * CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - forwardCmdClientData *tcd; - int rc; - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc < 2) goto forward_argc_error; - rc = forwardProcessOptions(in, objc, objv, &tcd); - - if (rc == TCL_OK) { - tcd->obj = &cl->object; - XOTclAddIMethod(in, (XOTcl_Class*) cl, NSTail(ObjStr(objv[1])), - (Tcl_ObjCmdProc*)XOTclForwardMethod, - (ClientData)tcd, forwardCmdDeleteProc); - return TCL_OK; - } else { - forward_argc_error: - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "instforward method ?target? ?-default name? ?-objscope? ?-methodprefix string? ?args?"); - } -} - -static int -XOTclOForwardMethod(ClientData cd, Tcl_Interp *in, - int objc, Tcl_Obj * CONST objv[]) { - XOTcl_Object *obj = (XOTcl_Object*) cd; - forwardCmdClientData *tcd; - int rc; - - if (!obj) return XOTclObjErrType(in, objv[0], "Object"); - if (objc < 2) goto forward_argc_error; - - rc = forwardProcessOptions(in, objc, objv, &tcd); - - if (rc == TCL_OK) { - tcd->obj = (XOTclObject*)obj; - XOTclAddPMethod(in, obj, NSTail(ObjStr(objv[1])), - (Tcl_ObjCmdProc*)XOTclForwardMethod, - (ClientData)tcd, forwardCmdDeleteProc); - return TCL_OK; - } else { - forward_argc_error: - return XOTclObjErrArgCnt(in, obj->cmdName, - "forward method ?target? ?-default name? ?-objscope? ?-methodprefix string? ?args?"); - } -} - - -static int -XOTclOVolatileMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj * CONST objv[]) { - XOTclObject *obj = (XOTclObject*) cd; - Tcl_Obj *o = obj->cmdName; - int result = TCL_ERROR; - char *fullName = ObjStr(o); - char *vn; - callFrameContext ctx = {0}; - - if (objc != 1) - return XOTclObjErrArgCnt(in, obj->cmdName, "volatile"); - - if (RUNTIME_STATE(in)->exitHandlerDestroyRound != XOTCL_EXITHANDLER_OFF) { - fprintf(stderr,"### Can't make objects volatile during shutdown\n"); - return XOTclVarErrMsg(in, "Can't make objects volatile during shutdown\n",NULL); - } - - CallStackUseActiveFrames(in, &ctx); - vn = NSTail(fullName); - - if (Tcl_SetVar2(in, vn, NULL, fullName, 0) != NULL) { - XOTclObjectOpt *opt = XOTclRequireObjectOpt(obj); - - /*fprintf(stderr,"### setting trace for %s\n", fullName);*/ - result = Tcl_TraceVar(in, vn, TCL_TRACE_UNSETS, (Tcl_VarTraceProc*)XOTclUnsetTrace, - (ClientData)o); - opt->volatileVarName = vn; - } - CallStackRestoreSavedFrames(in, &ctx); - - if (result == TCL_OK) { - INCR_REF_COUNT(o); - } - return result; -} - -static int -XOTclCInstProcMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - char *argStr, *bdyStr, *name; - XOTclClassOpt* opt; - int incr = 0, result = TCL_OK; - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc < 4 || objc > 7) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "instproc name ?non-positional-args? args body ?preAssertion postAssertion?"); - - if (objc == 5 || objc == 7) { - incr = 1; - } - - argStr = ObjStr(objv[2 + incr]); - bdyStr = ObjStr(objv[3 + incr]); - name = ObjStr(objv[1 + incr]); - - if ((cl == RUNTIME_STATE(in)->theObject && isDestroyString(name)) || - (cl == RUNTIME_STATE(in)->theClass && isInstDestroyString(name)) || - (cl == RUNTIME_STATE(in)->theClass && isAllocString(name)) || - (cl == RUNTIME_STATE(in)->theClass && isCreateString(name))) - return XOTclVarErrMsg(in, className(cl), " instproc: '", name, "' of ", - className(cl), " can not be overwritten. Derive a ", - "sub-class", (char *) NULL); - - if (*argStr == 0 && *bdyStr == 0) { - int rc; - opt = cl->opt; - if (opt && opt->assertions) - AssertionRemoveProc(opt->assertions, name); - rc = NSDeleteCmd(in, cl->nsPtr, name); - if (rc < 0) - return XOTclVarErrMsg(in, className(cl), " cannot delete instproc: '", name, - "' of class ", className(cl), (char *) NULL); - } else { - XOTclAssertionStore* aStore = NULL; - if (objc > 5) { - opt = XOTclRequireClassOpt(cl); - if (!opt->assertions) - opt->assertions = AssertionCreateStore(); - aStore = opt->assertions; - } - result = MakeProc(cl->nsPtr, aStore, &(cl->nonposArgsTable), - in, objc, (Tcl_Obj **) objv, &cl->object); - } - - /* could be a filter or filter inheritance ... update filter orders */ - FilterInvalidateObjOrders(in, cl); - - return result; -} - - -static int -XOTclCInstFilterGuardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - XOTclCmdList* h; - XOTclClassOpt* opt; - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc != 3) return XOTclObjErrArgCnt(in, cl->object.cmdName, - "instfilterguard filtername filterGuard"); - - opt = cl->opt; - if (opt && opt->instfilters) { - h = CmdListFindNameInList(in, ObjStr(objv[1]), opt->instfilters); - if (h) { - if (h->clientData) - GuardDel(h); - GuardAdd(in, h, objv[2]); - FilterInvalidateObjOrders(in, cl); - return TCL_OK; - } - } - - return XOTclVarErrMsg(in, "Instfilterguard: can't find filter ", - ObjStr(objv[1]), " on ", ObjStr(cl->object.cmdName), - (char *) NULL); -} - - -static int -XOTclCInstMixinGuardMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - XOTclCmdList* h; - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc != 3) return XOTclObjErrArgCnt(in, cl->object.cmdName, - "instmixinguard mixin guard"); - - if (cl->opt && cl->opt->instmixins) { - XOTclClass *mixinCl = XOTclpGetClass(in, ObjStr(objv[1])); - Tcl_Command mixinCmd = NULL; - if (mixinCl) { - mixinCmd = Tcl_GetCommandFromObj(in, mixinCl->object.cmdName); - } - if (mixinCmd) { - h = CmdListFindCmdInList(mixinCmd, cl->opt->instmixins); - if (h) { - if (h->clientData) - GuardDel((XOTclCmdList*) h); - GuardAdd(in, h, objv[2]); - MixinInvalidateObjOrders(in, cl); - return TCL_OK; - } - } - } - - return XOTclVarErrMsg(in, "Instmixinguard: can't find mixin ", - ObjStr(objv[1]), " on ", ObjStr(cl->object.cmdName), - (char *) NULL); -} - -static int -XOTclCInvariantsMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclClass *cl = XOTclObjectToClass(cd); - XOTclClassOpt* opt; - - if (!cl) return XOTclObjErrType(in, objv[0], "Class"); - if (objc != 2) - return XOTclObjErrArgCnt(in, cl->object.cmdName, - "instinvar "); - opt = XOTclRequireClassOpt(cl); - - if (opt->assertions) - TclObjListFreeList(opt->assertions->invariants); - else - opt->assertions = AssertionCreateStore(); - - opt->assertions->invariants = AssertionNewList(in, objv[1]); - return TCL_OK; -} - -static int -XOTclCUnknownMethod(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*) cd; - char *self = ObjStr(obj->cmdName); - int rc; - - if (objc < 2) return XOTclObjErrArgCnt(in, objv[0], "message ?args .. args?"); - if (isCreateString(self)) - return XOTclVarErrMsg(in, "error ", self, ": unable to dispatch '", - ObjStr(objv[1]), "'", (char *) NULL); - - rc = callMethod(cd, in, XOTclGlobalObjects[XOTE_CREATE], objc+1, objv+1, 0); - return rc; -} - -/* - * New Tcl Commands - */ -static int -XOTcl_NSCopyCmds(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - Tcl_Command cmd; - Tcl_Obj *newFullCmdName, *oldFullCmdName; - char *newName, *oldName, *name; - Tcl_Namespace *ns, *newNs; - Tcl_HashTable *cmdTable; - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr; - - if (objc != 3) - return XOTclObjErrArgCnt(in, NULL, "namespace_copycmds fromNs toNs"); - - ns = ObjFindNamespace(in, objv[1]); - if (!ns) - return TCL_OK; - - newNs = ObjFindNamespace(in, objv[2]); - if (!newNs) - return XOTclVarErrMsg(in, "CopyCmds: Destination namespace ", - ObjStr(objv[2]), " does not exist", (char *) NULL); - /* - * copy all procs & commands in the ns - */ - cmdTable = Tcl_Namespace_cmdTable(ns); - hPtr = Tcl_FirstHashEntry(cmdTable, &hSrch); - while (hPtr != NULL) { - name = Tcl_GetHashKey(cmdTable, hPtr); - - /* - * construct full cmd names - */ - newFullCmdName = Tcl_NewStringObj(newNs->fullName,-1); - oldFullCmdName = Tcl_NewStringObj(ns->fullName,-1); - - INCR_REF_COUNT(newFullCmdName); INCR_REF_COUNT(oldFullCmdName); - Tcl_AppendStringsToObj(newFullCmdName, "::", name, (char *) NULL); - Tcl_AppendStringsToObj(oldFullCmdName, "::", name, (char *) NULL); - newName = ObjStr(newFullCmdName); - oldName = ObjStr(oldFullCmdName); - - /* - * Make sure that the destination command does not already exist. - * Otherwise: do not copy - */ - cmd = Tcl_FindCommand(in, newName, 0, 0); - - if (cmd != NULL) { - /*fprintf(stderr, "%s already exists\n", newName);*/ - if (!XOTclpGetObject(in, newName)) { - /* command or instproc will be deleted & then copied */ - Tcl_DeleteCommandFromToken(in, cmd); - } else { - /* don't overwrite objects -> will be recreated */ - hPtr = Tcl_NextHashEntry(&hSrch); - DECR_REF_COUNT(newFullCmdName); - DECR_REF_COUNT(oldFullCmdName); - continue; - } - } - - /* - * Find the existing command. An error is returned if simpleName can't - * be found - */ - cmd = Tcl_FindCommand(in, oldName, 0, 0); - - if (cmd == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(in), "can't copy ", " \"", - oldName, "\": command doesn't exist", - (char *) NULL); - DECR_REF_COUNT(newFullCmdName); - DECR_REF_COUNT(oldFullCmdName); - return TCL_ERROR; - } - /* - * Do not copy Objects or Classes - */ - if (!XOTclpGetObject(in, oldName)) { - if (TclIsProc((Command*)cmd)) { - Proc *procPtr = TclFindProc((Interp *)in, oldName); - Tcl_Obj *arglistObj; - CompiledLocal *localPtr; - - /* - * Build a list containing the arguments of the proc - */ - - arglistObj = Tcl_NewListObj(0, NULL); - INCR_REF_COUNT(arglistObj); - - for (localPtr = procPtr->firstLocalPtr; localPtr != NULL; - localPtr = localPtr->nextPtr) { - - if (TclIsCompiledLocalArgument(localPtr)) { - Tcl_Obj *defVal, *defStringObj = Tcl_NewStringObj(localPtr->name, -1); - INCR_REF_COUNT(defStringObj); - /* check for default values */ - if ((GetProcDefault(in, cmdTable, name, - localPtr->name, &defVal) == TCL_OK) && - (defVal != 0)) { - Tcl_AppendStringsToObj(defStringObj, " ", ObjStr(defVal), - (char *) NULL); - } - Tcl_ListObjAppendElement(in, arglistObj, defStringObj); - DECR_REF_COUNT(defStringObj); - } - } - - if (Tcl_Command_objProc(cmd) == RUNTIME_STATE(in)->objInterpProc) { - Tcl_DString ds, *dsPtr = &ds; - - if (isClassName(ns->fullName)) { - /* it started with ::xotcl::classes */ - XOTclClass *cl = XOTclpGetClass(in, NSCutXOTclClasses(ns->fullName)); - XOTclProcAssertion* procs; - - if (cl) { - procs = cl->opt ? - AssertionFindProcs(cl->opt->assertions, name) : 0; - } else { - DECR_REF_COUNT(newFullCmdName); - DECR_REF_COUNT(oldFullCmdName); - DECR_REF_COUNT(arglistObj); - return XOTclVarErrMsg(in, "No class for inst - assertions", (char *) NULL); - } - - /* XOTcl InstProc */ - DSTRING_INIT(dsPtr); - Tcl_DStringAppendElement(dsPtr, NSCutXOTclClasses(newNs->fullName)); - Tcl_DStringAppendElement(dsPtr, "instproc"); - Tcl_DStringAppendElement(dsPtr, name); - Tcl_DStringAppendElement(dsPtr, ObjStr(arglistObj)); - Tcl_DStringAppendElement(dsPtr, StripBodyPrefix(ObjStr(procPtr->bodyPtr))); - if (procs) { - XOTclRequireClassOpt(cl); - AssertionAppendPrePost(in, dsPtr, procs); - } - Tcl_EvalEx(in, Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr),0); - DSTRING_FREE(dsPtr); - } else { - XOTclObject *obj = XOTclpGetObject(in, ns->fullName); - XOTclProcAssertion* procs; - if (obj) { - procs = obj->opt ? - AssertionFindProcs(obj->opt->assertions, name) : 0; - } else { - DECR_REF_COUNT(newFullCmdName); - DECR_REF_COUNT(oldFullCmdName); - DECR_REF_COUNT(arglistObj); - return XOTclVarErrMsg(in, "No object for assertions", (char *) NULL); - } - - /* XOTcl Proc */ - DSTRING_INIT(dsPtr); - Tcl_DStringAppendElement(dsPtr, newNs->fullName); - Tcl_DStringAppendElement(dsPtr, "proc"); - Tcl_DStringAppendElement(dsPtr, name); - Tcl_DStringAppendElement(dsPtr, ObjStr(arglistObj)); - Tcl_DStringAppendElement(dsPtr, StripBodyPrefix(ObjStr(procPtr->bodyPtr))); - if (procs) { - XOTclRequireObjectOpt(obj); - AssertionAppendPrePost(in, dsPtr, procs); - } - Tcl_EvalEx(in, Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr),0); - DSTRING_FREE(dsPtr); - } - DECR_REF_COUNT(arglistObj); - } else { - /* Tcl Proc */ - Tcl_VarEval(in, "proc ", newName, " {", ObjStr(arglistObj),"} {\n", - ObjStr(procPtr->bodyPtr), "}", (char *) NULL); - } - } else { - /* - * Otherwise copy command - */ - Tcl_ObjCmdProc* objProc = Tcl_Command_objProc(cmd); - Tcl_CmdDeleteProc *deleteProc = Tcl_Command_deleteProc(cmd); - ClientData cd; - if (objProc) { - cd = Tcl_Command_objClientData(cmd); - if (cd == 0 || cd == XOTCL_NONLEAF_METHOD) { - /* if client data not null, we would have to copy - the client data; we don't know its size...., so rely - on introspection for copying */ - Tcl_CreateObjCommand(in, newName, objProc, - Tcl_Command_objClientData(cmd), deleteProc); - } - } else { - cd = Tcl_Command_clientData(cmd); - if (cd == 0 || cd == XOTCL_NONLEAF_METHOD) { - Tcl_CreateCommand(in, newName, Tcl_Command_proc(cmd), - Tcl_Command_clientData(cmd), deleteProc); - } - } - } - } - hPtr = Tcl_NextHashEntry(&hSrch); - DECR_REF_COUNT(newFullCmdName); DECR_REF_COUNT(oldFullCmdName); - } - return TCL_OK; -} - -static int -XOTcl_NSCopyVars(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - Tcl_Namespace *ns, *newNs; - Var *varPtr = NULL; - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr; - TclVarHashTable *varTable; - int rc = TCL_OK; - XOTclObject *obj; - char *destFullName; - Tcl_Obj *destFullNameObj; - TclCallFrame frame, *framePtr = &frame; - Tcl_Obj *varNameObj = NULL; - Tcl_Obj *nobjv[4]; - int nobjc; - Tcl_Obj *setObj; - - if (objc != 3) - return XOTclObjErrArgCnt(in, NULL, "namespace_copyvars fromNs toNs"); - - ns = ObjFindNamespace(in, objv[1]); - if (ns) { - newNs = ObjFindNamespace(in, objv[2]); - if (!newNs) - return XOTclVarErrMsg(in, "CopyVars: Destination namespace ", - ObjStr(objv[2]), " does not exist", (char *) NULL); - - obj = XOTclpGetObject(in, ObjStr(objv[1])); - destFullName = newNs->fullName; - destFullNameObj = Tcl_NewStringObj(destFullName, -1); - INCR_REF_COUNT(destFullNameObj); - varTable = Tcl_Namespace_varTable(ns); - Tcl_PushCallFrame(in,(Tcl_CallFrame *)framePtr,newNs,0); - } else { - XOTclObject *newObj; - if (XOTclObjConvertObject(in, objv[1], &obj) != TCL_OK) { - return XOTclVarErrMsg(in, "CopyVars: Origin object/namespace ", - ObjStr(objv[1]), " does not exist", (char *) NULL); - } - if (XOTclObjConvertObject(in, objv[2], &newObj) != TCL_OK) { - return XOTclVarErrMsg(in, "CopyVars: Destination object/namespace ", - ObjStr(objv[2]), " does not exist", (char *) NULL); - } - varTable = obj->varTable; - destFullNameObj = newObj->cmdName; - destFullName = ObjStr(destFullNameObj); - } - - setObj= Tcl_NewStringObj("set", 3); - INCR_REF_COUNT(setObj); - nobjc = 4; - nobjv[0] = destFullNameObj; - nobjv[1] = setObj; - - /* copy all vars in the namespace */ - hPtr = varTable ? Tcl_FirstHashEntry(VarHashTable(varTable), &hSrch) : 0; - while (hPtr != NULL) { - - getVarAndNameFromHash(hPtr, &varPtr, &varNameObj); - INCR_REF_COUNT(varNameObj); - - if (!TclIsVarUndefined(varPtr) && !TclIsVarLink(varPtr)) { - if (TclIsVarScalar(varPtr)) { - /* it may seem odd that we do not copy obj vars with the - * same SetVar2 as normal vars, but we want to dispatch it in order to - * be able to intercept the copying */ - - if (obj) { - nobjv[2] = varNameObj; - nobjv[3] = valueOfVar(Tcl_Obj,varPtr,objPtr); - rc = Tcl_EvalObjv(in, nobjc, nobjv, 0); - } else { - Tcl_ObjSetVar2(in, varNameObj, NULL, - valueOfVar(Tcl_Obj,varPtr,objPtr), - TCL_NAMESPACE_ONLY); - } - } else { - if (TclIsVarArray(varPtr)) { - /* HERE!! PRE85 Why not [array get/set] based? Let the core iterate*/ - TclVarHashTable *aTable = valueOfVar(TclVarHashTable,varPtr,tablePtr); - Tcl_HashSearch ahSrch; - Tcl_HashEntry* ahPtr = aTable ? Tcl_FirstHashEntry(VarHashTable(aTable), &ahSrch) :0; - for (; ahPtr != 0; ahPtr = Tcl_NextHashEntry(&ahSrch)) { - Tcl_Obj *eltNameObj; - Var *eltVar; - - getVarAndNameFromHash(ahPtr, &eltVar, &eltNameObj); - - INCR_REF_COUNT(eltNameObj); - - if (TclIsVarScalar(eltVar)) { - if (obj) { - Tcl_Obj *fullVarNameObj = Tcl_DuplicateObj(varNameObj); - - INCR_REF_COUNT(fullVarNameObj); - Tcl_AppendStringsToObj(fullVarNameObj, "(", - ObjStr(eltNameObj), ")", NULL); - nobjv[2] = fullVarNameObj; - nobjv[3] = valueOfVar(Tcl_Obj,eltVar,objPtr); - - rc = Tcl_EvalObjv(in, nobjc, nobjv, 0); - DECR_REF_COUNT(fullVarNameObj); - } else { - Tcl_ObjSetVar2(in, varNameObj, eltNameObj, - valueOfVar(Tcl_Obj,eltVar,objPtr), - TCL_NAMESPACE_ONLY); - } - } - DECR_REF_COUNT(eltNameObj); - } - } - } - } - DECR_REF_COUNT(varNameObj); - hPtr = Tcl_NextHashEntry(&hSrch); - } - if (ns) { - DECR_REF_COUNT(destFullNameObj); - Tcl_PopCallFrame(in); - } - DECR_REF_COUNT(setObj); - return rc; -} - -int -XOTclSelfDispatchCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *self; - int result; - if (objc < 2) return XOTclObjErrArgCnt(in, objv[0], "::xotcl::my method ?args?"); - if ((self = GetSelfObj(in))) { - result = callMethod((ClientData)self, in, objv[1], objc, objv+2, 0); - } else { - result = XOTclVarErrMsg(in, "Cannot resolve 'self', probably called outside the context of an XOTcl Object", - (char *) NULL); - } - return result; -} - -int -XOTclInitProcNSCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - Tcl_CallFrame *varFramePtr = (Tcl_CallFrame *) Tcl_Interp_varFramePtr(in); - - /*RUNTIME_STATE(in)->varFramePtr = varFramePtr;*/ -#if 0 - Tcl_Namespace *nsPtr = Tcl_Command_nsPtr(RUNTIME_STATE(in)->cs.top->cmdPtr); - fprintf(stderr,"initProcNS self=%s cmd=%p, '%s'\n", - ObjStr(RUNTIME_STATE(in)->cs.top->self->cmdName), - nsPtr, nsPtr->fullName); - fprintf(stderr,"\tsetting currentFramePtr in %p to %p in initProcNS\n", - RUNTIME_STATE(in)->cs.top->currentFramePtr, varFramePtr); - XOTclCallStackDump(in); -#endif - - if (RUNTIME_STATE(in)->cs.top->currentFramePtr == 0) { - RUNTIME_STATE(in)->cs.top->currentFramePtr = varFramePtr; - } /* else { - - fprintf(stderr,"not overwriting currentFramePtr in %p from %p to %p\n", - RUNTIME_STATE(in)->cs.top, - RUNTIME_STATE(in)->cs.top->currentFramePtr, varFramePtr); - } */ - -#if !defined(NAMESPACEINSTPROCS) - if (varFramePtr) { - varFramePtr->nsPtr = GetCallerVarFrame(in,varFramePtr); - } -#endif - return TCL_OK; -} - -/* - * Interpretation of Non-Positional Args - */ -int -isNonposArg(Tcl_Interp *in, char * argStr, - int nonposArgsDefc, Tcl_Obj **nonposArgsDefv, - Tcl_Obj **var, char **type) { - int i, npac; - Tcl_Obj **npav; - char *varName; - if (argStr[0] == '-') { - for (i=0; i < nonposArgsDefc; i++) { - if (Tcl_ListObjGetElements(in, nonposArgsDefv[i], - &npac, &npav) == TCL_OK && npac > 0) { - varName = argStr+1; - if (!strcmp(varName, ObjStr(npav[0]))) { - *var = npav[0]; - *type = ObjStr(npav[1]); - return 1; - } - } - } - } - return 0; -} - -int -XOTclCheckBooleanArgs(ClientData cd, Tcl_Interp *in, int objc, - Tcl_Obj *CONST objv[]) { - int result, bool; - Tcl_Obj* boolean; - - if (objc == 2) { - /* the variable is not yet defined (set), so we cannot check - whether it is boolean or not */ - return TCL_OK; - } else if (objc != 3) { - return XOTclObjErrArgCnt(in, NULL, - "::xotcl::nonposArgs boolean name ?value?"); - } - - boolean = Tcl_DuplicateObj(objv[2]); - INCR_REF_COUNT(boolean); - result = Tcl_GetBooleanFromObj(in, boolean, &bool); - DECR_REF_COUNT(boolean); - /* - result = TCL_OK; - */ - if (result != TCL_OK) - return XOTclVarErrMsg(in, - "non-positional argument: '", ObjStr(objv[1]), "' with value '", - ObjStr(objv[2]), "' is not of type boolean", - (char *) NULL); - return TCL_OK; -} - -int -XOTclCheckRequiredArgs(ClientData cd, Tcl_Interp *in, int objc, - Tcl_Obj *CONST objv[]) { - if (objc != 2 && objc != 3) - return XOTclObjErrArgCnt(in, NULL, - "::xotcl::nonposArgs required ?currentValue?"); - - if (objc != 3) - return XOTclVarErrMsg(in, - "required arg: '", ObjStr(objv[1]), "' missing", - (char *) NULL); - return TCL_OK; -} - -int -XOTclInterpretNonpositionalArgsCmd(ClientData cd, Tcl_Interp *in, int objc, - Tcl_Obj *CONST objv[]) { - Tcl_Obj **npav, **checkv, **checkArgv, **argsv, **nonposArgsDefv, - *invocation[4], **ordinaryArgsDefv, **defaultValueObjv, *list, - *checkObj, *ordinaryArg; - int npac, checkc, checkArgc, argsc, nonposArgsDefc, - ordinaryArgsDefc, defaultValueObjc, argsDefined = 0, - ordinaryArgsCounter = 0, i, j, result, ic; - char * lastDefArg = NULL, *arg, *argStr; - int endOfNonposArgsReached = 0; - Var *varPtr; - - XOTclClass* selfClass = GetSelfClass(in); - char *methodName = (char *) GetSelfProc(in); - Tcl_HashTable* nonposArgsTable; - XOTclNonposArgs* nonposArgs; - XOTclObject* selfObj; - int r1, r2, r3, r4; - - if (objc != 2) - return XOTclObjErrArgCnt(in, NULL, - "::xotcl::interpretNonpositionalArgs "); - - if (selfClass) { - nonposArgsTable = selfClass->nonposArgsTable; - } else if ((selfObj = GetSelfObj(in))) { - nonposArgsTable = selfObj->nonposArgsTable; - } else { - return XOTclVarErrMsg(in, "Non positional args: can't find self/self class", - (char *) NULL); - } - - nonposArgs = NonposArgsGet(nonposArgsTable, methodName); - if (nonposArgs == 0) { - return XOTclVarErrMsg(in, - "Non positional args: can't find hash entry for: ", - methodName, - (char *) NULL); - } - - r1 = Tcl_ListObjGetElements(in, nonposArgs->nonposArgs, - &nonposArgsDefc, &nonposArgsDefv); - r2 = Tcl_ListObjGetElements(in, nonposArgs->ordinaryArgs, - &ordinaryArgsDefc, &ordinaryArgsDefv); - r3 = Tcl_ListObjGetElements(in, objv[1], &argsc, &argsv); - - - if (r1 != TCL_OK || r2 != TCL_OK || r3 != TCL_OK) { - return XOTclVarErrMsg(in, - "Cannot split non positional args list: ", - methodName, - (char *) NULL); - } - - /* setting variables to default values */ - for (i=0; i < nonposArgsDefc; i++) { - r1 = Tcl_ListObjGetElements(in, nonposArgsDefv[i], &npac, &npav); - if (r1 == TCL_OK) { - if (npac == 3) { - Tcl_ObjSetVar2(in, npav[0], NULL, npav[2], 0); - } else if (npac == 2 && !strcmp(ObjStr(npav[1]), "switch")) { - Tcl_ObjSetVar2(in, npav[0], NULL, Tcl_NewBooleanObj(0), 0); - } - } - } - - if (ordinaryArgsDefc > 0) { - lastDefArg = ObjStr(ordinaryArgsDefv[ordinaryArgsDefc-1]); - if (isArgsString(lastDefArg)) { - argsDefined = 1; - } - } - - /* setting specified variables */ - for (i=0; i < argsc; i++) { - - if (!endOfNonposArgsReached) { - char *type; - Tcl_Obj *var; - argStr = ObjStr(argsv[i]); - - if (isDoubleDashString(argStr)) { - endOfNonposArgsReached = 1; - i++; - } - if (isNonposArg(in, argStr, nonposArgsDefc, nonposArgsDefv, &var,&type)) { - if (*type == 's' && !strcmp(type, "switch")) { - int bool; - Tcl_Obj *boolObj = Tcl_ObjGetVar2(in, var, 0, 0); - if (Tcl_GetBooleanFromObj(in, boolObj, &bool) != TCL_OK) { - return XOTclVarErrMsg(in, "Non positional arg '",argStr, - "': no boolean value", (char *) NULL); - } - Tcl_ObjSetVar2(in, var, NULL, Tcl_NewBooleanObj(!bool), 0); - } else { - i++; - if (i >= argsc) - return XOTclVarErrMsg(in, "Non positional arg '", - argStr, "': value missing", (char *) NULL); - Tcl_ObjSetVar2(in, var, NULL, argsv[i], 0); - } - } else { - endOfNonposArgsReached = 1; - } - } - - if (endOfNonposArgsReached && i < argsc) { - if (ordinaryArgsCounter >= ordinaryArgsDefc) { - Tcl_Obj *tmp = NonposArgsFormat(in, nonposArgs->nonposArgs); - XOTclVarErrMsg(in, "unknown argument '", - ObjStr(argsv[i]), - "' for method '", - methodName, - "': valid arguments ", - ObjStr(tmp), - " ", - ObjStr(nonposArgs->ordinaryArgs), - (char *) NULL); - DECR_REF_COUNT(tmp); - return TCL_ERROR; - } - arg = ObjStr(ordinaryArgsDefv[ordinaryArgsCounter]); - /* this is the last arg and 'args' is defined */ - if (argsDefined && ordinaryArgsCounter+1 == ordinaryArgsDefc) { - list = Tcl_NewListObj(0, NULL); - INCR_REF_COUNT(list); - for(; i < argsc; i++) - Tcl_ListObjAppendElement(in, list, argsv[i]); - Tcl_ObjSetVar2(in, ordinaryArgsDefv[ordinaryArgsCounter], NULL, list, 0); - DECR_REF_COUNT(list); - } else { - /* break down this argument, if it has a default value, - use only the first part */ - ordinaryArg = ordinaryArgsDefv[ordinaryArgsCounter]; - r4 = Tcl_ListObjGetElements(in, ordinaryArg, - &defaultValueObjc, &defaultValueObjv); - if (r4 == TCL_OK && defaultValueObjc == 2) { - ordinaryArg = defaultValueObjv[0]; - } - Tcl_ObjSetVar2(in, ordinaryArg, NULL, argsv[i], 0); - } - ordinaryArgsCounter++; - } - } - - /*fprintf(stderr,"... args defined %d argsc=%d oa %d oad %d\n", - argsDefined, argsc, - ordinaryArgsCounter, ordinaryArgsDefc); */ - - if ((!argsDefined && ordinaryArgsCounter != ordinaryArgsDefc) || - (argsDefined && ordinaryArgsCounter < ordinaryArgsDefc-1)) { - - /* we do not have enough arguments, maybe there are default arguments - for the missing args */ - while (ordinaryArgsCounter != ordinaryArgsDefc) { - if (argsDefined && ordinaryArgsCounter+1 == ordinaryArgsDefc) - break; - r4 = Tcl_ListObjGetElements(in, ordinaryArgsDefv[ordinaryArgsCounter], - &defaultValueObjc, &defaultValueObjv); - /*fprintf(stderr,"... try to get default for '%s', rc %d, objc %d\n", - ObjStr(ordinaryArgsDefv[ordinaryArgsCounter]), - r4,defaultValueObjc);*/ - if (r4 == TCL_OK && defaultValueObjc == 2) { - Tcl_ObjSetVar2(in, defaultValueObjv[0], NULL, defaultValueObjv[1], 0); - } else { - Tcl_Obj *tmp = NonposArgsFormat(in, nonposArgs->nonposArgs); - XOTclVarErrMsg(in, "wrong # args for method '", - methodName, "': valid arguments ", ObjStr(tmp), " ", - ObjStr(nonposArgs->ordinaryArgs), - (char *) NULL); - DECR_REF_COUNT(tmp); - return TCL_ERROR; - } - ordinaryArgsCounter++; - } - if (argsDefined) { - Tcl_SetVar2(in, "args", NULL, "", 0); - } - } else if (argsDefined && ordinaryArgsCounter == ordinaryArgsDefc-1) { - Tcl_SetVar2(in, "args", NULL, "", 0); - } - - if (!argsDefined) { - Tcl_UnsetVar2(in, "args", NULL, 0); - } - - /* checking vars */ - for (i=0; i < nonposArgsDefc; i++) { - r1 = Tcl_ListObjGetElements(in, nonposArgsDefv[i], &npac, &npav); - if (r1 == TCL_OK && npac > 1 && *(ObjStr(npav[1])) != '\0') { - r1 = Tcl_ListObjGetElements(in, npav[1], &checkc, &checkv); - if (r1 == TCL_OK) { - checkObj = XOTclGlobalObjects[XOTE_NON_POS_ARGS_OBJ]; - for (j=0; j < checkc; j++) { - r1 = Tcl_ListObjGetElements(in, checkv[j], &checkArgc, &checkArgv); - if (r1 == TCL_OK && checkArgc > 1) { - if (isCheckObjString((ObjStr(checkArgv[0]))) && checkArgc == 2) { - checkObj = checkArgv[1]; - continue; - } - } - invocation[0] = checkObj; - invocation[1] = checkv[j]; - varPtr = TclVarTraceExists(in, ObjStr(npav[0])); - invocation[2] = npav[0]; - ic = 3; - if ((varPtr != NULL) && !TclIsVarUndefined(varPtr)) { - invocation[3] = Tcl_ObjGetVar2(in, npav[0], 0, 0); - ic = 4; - } - result = Tcl_EvalObjv(in, ic, invocation, 0); - /* - objPtr = Tcl_ConcatObj(ic, invocation); - fprintf(stderr,"eval on <%s>\n",ObjStr(objPtr)); - result = Tcl_EvalObjEx(in, objPtr, TCL_EVAL_DIRECT); - */ - if (result != TCL_OK) { - return result; - } - } - } - } - } - return TCL_OK; -} - - -/* create a slave interp that calls XOTcl Init */ -static int -XOTcl_InterpObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - Tcl_Interp *slave; - char *subCmd; - ALLOC_ON_STACK(Tcl_Obj*,objc, ov); - - memcpy(ov, objv, sizeof(Tcl_Obj *)*objc); - if (objc < 1) { - XOTclObjErrArgCnt(in, NULL, "::xotcl::interp name ?args?"); - goto interp_error; - } - - ov[0] = XOTclGlobalObjects[XOTE_INTERP]; - if (Tcl_EvalObjv(in, objc, ov, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) != TCL_OK) { - goto interp_error; - } - - subCmd = ObjStr(ov[1]); - if (isCreateString(subCmd)) { - slave = Tcl_GetSlave(in, ObjStr(ov[2])); - if (!slave) { - XOTclVarErrMsg(in, "Creation of slave interpreter failed", (char *) NULL); - goto interp_error; - } - if (Xotcl_Init(slave) == TCL_ERROR) { - goto interp_error; - } -#ifdef XOTCL_MEM_COUNT - xotclMemCountInterpCounter++; -#endif - } - FREE_ON_STACK(ov); - return TCL_OK; - interp_error: - FREE_ON_STACK(ov); - return TCL_ERROR; -} - -extern Tcl_Obj* -XOTclOGetInstVar2(XOTcl_Object *obj, Tcl_Interp *in, Tcl_Obj *name1, Tcl_Obj *name2, - int flgs) { - Tcl_Obj *result; - XOTcl_FrameDecls; - - XOTcl_PushFrame(in, (XOTclObject*)obj); - if (((XOTclObject*)obj)->nsPtr) - flgs |= TCL_NAMESPACE_ONLY; - - result = Tcl_ObjGetVar2(in, name1, name2, flgs); - XOTcl_PopFrame(in, (XOTclObject*)obj); - - return result; -} - - -#if !defined(NDEBUG) -static void -checkAllInstances(Tcl_Interp *in, XOTclClass *cl, int lvl) { - Tcl_HashSearch search; - Tcl_HashEntry *hPtr; - if (cl && cl->object.refCount>0) { - /*fprintf(stderr,"checkallinstances %d cl=%p '%s'\n", lvl, cl, ObjStr(cl->object.cmdName));*/ - for (hPtr = Tcl_FirstHashEntry(&cl->instances, &search); hPtr != NULL; - hPtr = Tcl_NextHashEntry(&search)) { - XOTclObject *inst = (XOTclObject*) Tcl_GetHashKey(&cl->instances, hPtr); - assert(inst); - assert(inst->refCount>0); - assert(inst->cmdName->refCount>0); - if (XOTclObjectIsClass(inst) && (XOTclClass*)inst != RUNTIME_STATE(in)->theClass) { - checkAllInstances(in, (XOTclClass*) inst, lvl+1); - } - } - } -} -#endif - -#ifdef DO_FULL_CLEANUP -/* delete global variables and procs */ -static void deleteProcsAndVars(Tcl_Interp *in) { - Tcl_Namespace *ns = Tcl_GetGlobalNamespace(in); - Tcl_HashTable *varTable = ns ? Tcl_Namespace_varTable(ns) : NULL; - Tcl_HashTable *cmdTable = ns ? Tcl_Namespace_cmdTable(ns) : NULL; - Tcl_HashSearch search; - Var *varPtr; - Tcl_Command cmd; - register Tcl_HashEntry *entryPtr; - char *varName; - - entryPtr = Tcl_FirstHashEntry(varTable, &search); - while (entryPtr != NULL) { - Tcl_Obj *nameObj; - getVarAndNameFromHash(entryPtr, &varPtr, &nameObj); - if (!TclIsVarUndefined(varPtr) || TclIsVarNamespaceVar(varPtr)) { - /* fprintf(stderr, "unsetting var %s\n", ObjStr(nameObj));*/ - Tcl_UnsetVar2(in, ObjStr(nameObj), (char *)NULL, TCL_GLOBAL_ONLY); - } - entryPtr = Tcl_NextHashEntry(&search); - } - - entryPtr = Tcl_FirstHashEntry(cmdTable, &search); - while (entryPtr) { - cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr); - - if (Tcl_Command_objProc(cmd) == RUNTIME_STATE(in)->objInterpProc) { - char *key = Tcl_GetHashKey(cmdTable, entryPtr); - - /*fprintf(stderr, "cmdname = %s cmd %p proc %p objProc %p %d\n", - key,cmd,Tcl_Command_proc(cmd),Tcl_Command_objProc(cmd), - Tcl_Command_proc(cmd)==RUNTIME_STATE(in)->objInterpProc);*/ - - Tcl_DeleteCommandFromToken(in, cmd); - } - entryPtr = Tcl_NextHashEntry(&search); - } -} -#endif - - -#ifdef DO_CLEANUP -static int -ClassHasSubclasses(XOTclClass *cl) { - return (cl->sub != NULL); -} - -static int -ClassHasInstances(XOTclClass *cl) { - Tcl_HashSearch hSrch; - return (Tcl_FirstHashEntry(&cl->instances, &hSrch) != NULL); -} - -static int -ObjectHasChildren(Tcl_Interp *in, XOTclObject *obj) { - Tcl_Namespace *ns = obj->nsPtr; - int result = 0; - - if (ns) { - Tcl_HashEntry *hPtr; - Tcl_HashSearch hSrch; - Tcl_HashTable *cmdTable = Tcl_Namespace_cmdTable(ns); - XOTcl_FrameDecls; - - XOTcl_PushFrame(in, obj); - for (hPtr = Tcl_FirstHashEntry(cmdTable, &hSrch); hPtr; - hPtr = Tcl_NextHashEntry(&hSrch)) { - char *key = Tcl_GetHashKey(cmdTable, hPtr); - if (XOTclpGetObject(in, key)) { - /*fprintf(stderr,"child = %s\n",key);*/ - result = 1; - break; - } - } - XOTcl_PopFrame(in,obj); - } - return result; -} - -static void freeAllXOTclObjectsAndClasses(Tcl_Interp *in, Tcl_HashTable *commandTable) { - Tcl_HashEntry *hPtr, *hDel; - Tcl_HashSearch hSrch; - XOTclObject *obj; - XOTclClass *thecls, *theobj, *cl; - - /* fprintf(stderr,"??? freeAllXOTclObjectsAndClasses in %p\n", in); */ - - thecls = RUNTIME_STATE(in)->theClass; - theobj = RUNTIME_STATE(in)->theObject; - /***** PHYSICAL DESTROY *****/ - RUNTIME_STATE(in)->exitHandlerDestroyRound = XOTCL_EXITHANDLER_ON_PHYSICAL_DESTROY; - while (1) { - int deleted = 0; - hPtr = Tcl_FirstHashEntry(commandTable, &hSrch); - while (hPtr) { - char *key = Tcl_GetHashKey(commandTable, hPtr); - obj = XOTclpGetObject(in, key); - if (obj && !XOTclObjectIsClass(obj) && !ObjectHasChildren(in,obj)) { - /* fprintf(stderr," ... delete object %s %p, class=%s\n",key,obj, - ObjStr(obj->cl->object.cmdName));*/ - freeUnsetTraceVariable(in, obj); - Tcl_DeleteCommandFromToken(in, obj->id); - hDel = hPtr; - deleted++; - } else { - hDel = NULL; - } - hPtr = Tcl_NextHashEntry(&hSrch); - if (hDel) - Tcl_DeleteHashEntry(hDel); - } - /* fprintf(stderr, "deleted %d Objects\n",deleted);*/ - if (deleted>0) - continue; - - - hPtr = Tcl_FirstHashEntry(commandTable, &hSrch); - while (hPtr) { - char *key = Tcl_GetHashKey(commandTable, hPtr); - cl = XOTclpGetClass(in, key); - /* fprintf(stderr,"cl key = %s %p\n", key, cl); */ - if (cl - && !ObjectHasChildren(in, (XOTclObject*)cl) - && !ClassHasInstances(cl) - && !ClassHasSubclasses(cl) - && cl != RUNTIME_STATE(in)->theClass - && cl != RUNTIME_STATE(in)->theObject - ) { - /* fprintf(stderr," ... delete class %s %p\n",key,cl); */ - freeUnsetTraceVariable(in, &cl->object); - Tcl_DeleteCommandFromToken(in, cl->object.id); - hDel = hPtr; - deleted++; - } else { - hDel = NULL; - } - hPtr = Tcl_NextHashEntry(&hSrch); - if (hDel) - Tcl_DeleteHashEntry(hDel); - } - /* fprintf(stderr, "deleted %d Classes\n",deleted);*/ - if (deleted == 0) { - break; - } - } - -#ifdef DO_FULL_CLEANUP - deleteProcsAndVars(in); -#endif - - RUNTIME_STATE(in)->callDestroy = 0; - RemoveSuper(thecls, theobj); - RemoveInstance((XOTclObject*)thecls, thecls); - RemoveInstance((XOTclObject*)theobj, thecls); - - Tcl_DeleteCommandFromToken(in, theobj->object.id); - RUNTIME_STATE(in)->theObject = NULL; - - Tcl_DeleteCommandFromToken(in, thecls->object.id); - RUNTIME_STATE(in)->theClass = NULL; - - XOTcl_DeleteNamespace(in, RUNTIME_STATE(in)->fakeNS); - XOTcl_DeleteNamespace(in, RUNTIME_STATE(in)->XOTclClassesNS); - XOTcl_DeleteNamespace(in, RUNTIME_STATE(in)->XOTclNS); - -} -#endif /* DO_CLEANUP */ - - -/* - * Exit Handler - */ -static void -ExitHandler(ClientData cd) { - Tcl_Interp *in = (Tcl_Interp *) cd; - XOTclObject *obj; - XOTclClass *cl; - int result, flags, i; - Tcl_HashSearch hSrch; - Tcl_HashEntry *hPtr; - Tcl_HashTable objTable, *commandTable = &objTable; - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - - /* - * Don't use exit handler, if the interpreted is destroyed already - * Call to exit handler comes after freeing namespaces, commands, etc. - * e.g. TK calls Tcl_DeleteInterp directly, if Window is killed - */ - - /* - * Ahem ... - * - * Since we *must* be sure that our destroy methods will run - * we must *cheat* (I mean CHEAT) here: we flip the interp - * flag, saying, "hey boy, you're not deleted any more". - * After our handlers are done, we restore the old state... - * All this is needed so we can do an eval in the interp which - * is potentially marked for delete when we start working here. - * - * I know, I know, this is not really elegant. But... I'd need a - * standard way of invoking some code at interpreter delete time - * but JUST BEFORE the actual deletion process starts. Sadly, - * there is no such hook in Tcl as of Tcl8.3.2, that I know of. - * - * So, for the rest of procedure, assume the interp is alive ! - */ - - /*fprintf(stderr,"+++ EXIT handler\n"); */ - flags = Tcl_Interp_flags(in); - Tcl_Interp_flags(in) &= ~DELETED; -#if defined(PROFILE) - XOTclProfilePrintData(in); -#endif - /* - * evaluate user-defined exit handler - */ - result = callMethod((ClientData)RUNTIME_STATE(in)->theObject, in, - XOTclGlobalObjects[XOTE_EXIT_HANDLER], 2, 0, 0); - if (result != TCL_OK) { - fprintf(stderr,"User defined exit handler contains errors!\n" - "Error in line %d: %s\nExecution interrupted.\n", - in->errorLine, ObjStr(Tcl_GetObjResult(in))); - } - /* - * Pop any callstack entry that is still alive (e.g. - * if "exit" is called and we were jumping out of the - * callframe - */ - while (cs->top > cs->content) - CallStackPop(in); - - while (1) { - Tcl_CallFrame *f = Tcl_Interp_framePtr(in); - if (!f) break; - if (Tcl_CallFrame_level(f) == 0) break; - Tcl_PopCallFrame(in); - } - - /* deleting in two rounds: - * (a) SOFT DESTROY: call all user-defined destroys - * (b) PHYSICAL DESTROY: delete the commands, user-defined - * destroys are not executed anymore - * - * this is to prevent user-defined destroys from overriding physical - * destroy during exit handler, but still ensure that all - * user-defined destroys are called. - */ - - Tcl_InitHashTable(commandTable, TCL_STRING_KEYS); - MEM_COUNT_ALLOC("Tcl_InitHashTable",commandTable); - getAllInstances(commandTable, RUNTIME_STATE(in)->theClass); - /***** SOFT DESTROY *****/ - RUNTIME_STATE(in)->exitHandlerDestroyRound = XOTCL_EXITHANDLER_ON_SOFT_DESTROY; - - hPtr = Tcl_FirstHashEntry(commandTable, &hSrch); - while (hPtr) { - char *key = Tcl_GetHashKey(commandTable, hPtr); - obj = XOTclpGetObject(in, key); - /* fprintf(stderr,"key = %s %p %d\n", - key, obj, obj && !XOTclObjectIsClass(obj)); */ - if (obj && !XOTclObjectIsClass(obj) - && !(obj->flags & XOTCL_DESTROY_CALLED)) - callDestroyMethod((ClientData)obj, in, obj, 0); - hPtr = Tcl_NextHashEntry(&hSrch); - } - hPtr = Tcl_FirstHashEntry(commandTable, &hSrch); - while (hPtr) { - char *key = Tcl_GetHashKey(commandTable, hPtr); - cl = XOTclpGetClass(in, key); - if (cl - && !(cl->object.flags & XOTCL_DESTROY_CALLED)) - callDestroyMethod((ClientData)cl, in, (XOTclObject*)cl, 0); - hPtr = Tcl_NextHashEntry(&hSrch); - } -#ifdef DO_CLEANUP - freeAllXOTclObjectsAndClasses(in, commandTable); -#endif - - /* must be before freeing of XOTclGlobalObjects */ - XOTclShadowTclCommands(in, SHADOW_UNLOAD); - /* free global objects */ - for (i = 0; i < nr_elements(XOTclGlobalStrings); i++) { - DECR_REF_COUNT(XOTclGlobalObjects[i]); - } - XOTclStringIncrFree(&RUNTIME_STATE(in)->iss); - FREE(Tcl_Obj**, XOTclGlobalObjects); - FREE(XOTclRuntimeState, RUNTIME_STATE(in)); - - MEM_COUNT_FREE("Tcl_InitHashTable",commandTable); - Tcl_DeleteHashTable(commandTable); - -#if defined(TCL_MEM_DEBUG) - TclDumpMemoryInfo (stderr); - Tcl_DumpActiveMemory ("./xotclActiveMem"); - /* Tcl_GlobalEval(in, "puts {checkmem to checkmemFile}; - checkmem checkmemFile"); */ -#endif - MEM_COUNT_DUMP(); - - Tcl_Interp_flags(in) = flags; - Tcl_Release((ClientData) in); -} - - -#if defined(TCL_THREADS) -/* - * Gets activated at thread-exit - */ -static void -XOTcl_ThreadExitProc(ClientData cd) { - /*fprintf(stderr,"+++ XOTcl_ThreadExitProc\n");*/ -#if !defined(PRE83) - void XOTcl_ExitProc(ClientData cd); - Tcl_DeleteExitHandler(XOTcl_ExitProc, cd); -#endif - ExitHandler(cd); -} -#endif - -/* - * Gets activated at application-exit - */ -void -XOTcl_ExitProc(ClientData cd) { - /*fprintf(stderr,"+++ XOTcl_ExitProc\n");*/ -#if !defined(PRE83) && defined(TCL_THREADS) - Tcl_DeleteThreadExitHandler(XOTcl_ThreadExitProc, cd); -#endif - ExitHandler(cd); -} - - -/* - * Registers thread/appl exit handlers. - */ -static void -RegisterExitHandlers(ClientData cd) { - Tcl_Preserve(cd); -#if !defined(PRE83) && defined(TCL_THREADS) - Tcl_CreateThreadExitHandler(XOTcl_ThreadExitProc, cd); -#endif - Tcl_CreateExitHandler(XOTcl_ExitProc, cd); -} - - - -/* - * Tcl extension initialization routine - */ - -extern int -Xotcl_Init(Tcl_Interp *in) { - XOTclClass *theobj = 0; - XOTclClass *thecls = 0; - XOTclClass *paramCl = 0; - XOTclClass *nonposArgsCl = 0; - ClientData runtimeState; - int result, i; -#ifdef XOTCL_BYTECODE - XOTclCompEnv *instructions = XOTclGetCompEnv(); -#endif - -#ifndef PRE81 -# ifdef USE_TCL_STUBS - if (Tcl_InitStubs(in, "8.1", 0) == NULL) { - return TCL_ERROR; - } -# endif -#endif - -#if defined(TCL_MEM_DEBUG) - TclDumpMemoryInfo(stderr); -#endif - - MEM_COUNT_INIT(); - - /* - fprintf(stderr, "SIZES: obj=%d, tcl_obj=%d, DString=%d, class=%d, namespace=%d, command=%d, HashTable=%d\n", sizeof(XOTclObject), sizeof(Tcl_Obj), sizeof(Tcl_DString), sizeof(XOTclClass), sizeof(Namespace), sizeof(Command), sizeof(Tcl_HashTable)); - */ - -#if FORWARD_COMPATIBLE - { - int major, minor, patchlvl, type; - Tcl_GetVersion(&major, &minor, &patchlvl, &type); - - if ((major == 8) && (minor < 5)) { - /* - * loading a version of xotcl compiled for 8.4 version - * into a 8.4 Tcl - */ - /* - fprintf(stderr, "loading a version of xotcl compiled for 8.4 version into a 8.4 Tcl\n"); - */ - forwardCompatibleMode = 0; - lookupVarFromTable = LookupVarFromTable84; - tclVarHashCreateVar = VarHashCreateVar84; - tclInitVarHashTable = InitVarHashTable84; - tclCleanupVar = TclCleanupVar84; - varRefCountOffset = TclOffset(Var, refCount); - varHashTableSize = sizeof(Tcl_HashTable); - } else { - /* - * loading a version of xotcl compiled for 8.4 version - * into a 8.5 Tcl - */ - /* - fprintf(stderr, "loading a version of xotcl compiled for 8.4 version into a 8.5 Tcl\n"); - */ - forwardCompatibleMode = 1; - lookupVarFromTable = LookupVarFromTable85; - tclVarHashCreateVar = VarHashCreateVar85; - tclInitVarHashTable = (Tcl_InitVarHashTableFunction*)*((&tclIntStubsPtr->reserved0)+235); - tclCleanupVar = (Tcl_CleanupVarFunction*)*((&tclIntStubsPtr->reserved0)+176); - varRefCountOffset = TclOffset(VarInHash, refCount); - varHashTableSize = sizeof(TclVarHashTable85); - } - - } -#endif - - /* - * Runtime State stored in the client data of the Interp's global - * Namespace in order to avoid global state information - */ - runtimeState = (ClientData) NEW(XOTclRuntimeState); -#if USE_ASSOC_DATA - Tcl_SetAssocData(in, "XOTclRuntimeState", NULL, runtimeState); -#else - Tcl_Interp_globalNsPtr(in)->clientData = runtimeState; -#endif - - /* CallStack initialization */ - memset(RUNTIME_STATE(in), 0, sizeof(XOTclRuntimeState)); - memset(RUNTIME_STATE(in)->cs.content, 0, sizeof(XOTclCallStackContent)); - - RUNTIME_STATE(in)->cs.top = RUNTIME_STATE(in)->cs.content; - RUNTIME_STATE(in)->doFilters = 1; - RUNTIME_STATE(in)->callDestroy = 1; - - /* create xotcl namespace */ - RUNTIME_STATE(in)->XOTclNS = - Tcl_CreateNamespace(in, "::xotcl", (ClientData)NULL, (Tcl_NamespaceDeleteProc*)NULL); - - MEM_COUNT_ALLOC("TclNamespace",RUNTIME_STATE(in)->XOTclNS); - - /* - * init an empty, faked proc structure in the RUNTIME state - */ - RUNTIME_STATE(in)->fakeProc.iPtr = (Interp *)in; - RUNTIME_STATE(in)->fakeProc.refCount = 1; - RUNTIME_STATE(in)->fakeProc.cmdPtr = NULL; - RUNTIME_STATE(in)->fakeProc.bodyPtr = NULL; - RUNTIME_STATE(in)->fakeProc.numArgs = 0; - RUNTIME_STATE(in)->fakeProc.numCompiledLocals = 0; - RUNTIME_STATE(in)->fakeProc.firstLocalPtr = NULL; - RUNTIME_STATE(in)->fakeProc.lastLocalPtr = NULL; - RUNTIME_STATE(in)->fakeNS = - Tcl_CreateNamespace(in, "::xotcl::fakeNS", (ClientData)NULL, - (Tcl_NamespaceDeleteProc*)NULL); - MEM_COUNT_ALLOC("TclNamespace",RUNTIME_STATE(in)->fakeNS); - - /* XOTclClasses in separate Namespace / Objects */ - RUNTIME_STATE(in)->XOTclClassesNS = - Tcl_CreateNamespace(in, "::xotcl::classes", (ClientData)NULL, - (Tcl_NamespaceDeleteProc*)NULL); - MEM_COUNT_ALLOC("TclNamespace",RUNTIME_STATE(in)->XOTclClassesNS); - - - /* cache interpreters proc interpretation functions */ - RUNTIME_STATE(in)->objInterpProc = TclGetObjInterpProc(); -#if USE_INTERP_PROC - RUNTIME_STATE(in)->interpProc = TclGetInterpProc(); -#endif - RUNTIME_STATE(in)->exitHandlerDestroyRound = XOTCL_EXITHANDLER_OFF; - - RegisterObjTypes(); - RegisterExitHandlers((ClientData)in); - - XOTclStringIncrInit(&RUNTIME_STATE(in)->iss); - - /* initialize global Tcl_Obj*/ - XOTclGlobalObjects = NEW_ARRAY(Tcl_Obj*,nr_elements(XOTclGlobalStrings)); - - for (i = 0; i < nr_elements(XOTclGlobalStrings); i++) { - XOTclGlobalObjects[i] = Tcl_NewStringObj(XOTclGlobalStrings[i],-1); - INCR_REF_COUNT(XOTclGlobalObjects[i]); - } - - /* create Object and Class, and store them in the RUNTIME STATE */ - theobj = PrimitiveCCreate(in, "::xotcl::Object", 0); - RUNTIME_STATE(in)->theObject = theobj; - if (!theobj) panic("Cannot create ::xotcl::Object",0); - - thecls = PrimitiveCCreate(in, "::xotcl::Class", 0); - RUNTIME_STATE(in)->theClass = thecls; - if (!thecls) panic("Cannot create ::xotcl::Class",0); - - theobj->parent = 0; - thecls->parent = theobj; - - Tcl_Export(in, RUNTIME_STATE(in)->XOTclNS, "Object", 0); - Tcl_Export(in, RUNTIME_STATE(in)->XOTclNS, "Class", 0); - /*Tcl_AddInterpResolvers(in, "XOTcl", XOTclResolveCmd, 0, 0);*/ - -#if defined(PROFILE) - XOTclProfileInit(in); -#endif - - /* test Object and Class creation */ - if (!theobj || !thecls) { - RUNTIME_STATE(in)->callDestroy = 0; - - if (thecls) PrimitiveCDestroy((ClientData) thecls); - if (theobj) PrimitiveCDestroy((ClientData) theobj); - - for (i = 0; i < nr_elements(XOTclGlobalStrings); i++) { - DECR_REF_COUNT(XOTclGlobalObjects[i]); - } - FREE(Tcl_Obj**, XOTclGlobalObjects); - FREE(XOTclRuntimeState, RUNTIME_STATE(in)); - - return XOTclErrMsg(in, "Object/Class failed", TCL_STATIC); - } - - AddInstance((XOTclObject*)theobj, thecls); - AddInstance((XOTclObject*)thecls, thecls); - AddSuper(thecls, theobj); - { - typedef struct methodDefinition { - char *methodName; - Tcl_ObjCmdProc *proc; - } methodDefinition; - methodDefinition objInstcmds[] = { - {"autoname", XOTclOAutonameMethod}, - {"check", XOTclOCheckMethod}, - {"cleanup", XOTclOCleanupMethod}, - {"configure", XOTclOConfigureMethod}, - {"destroy", XOTclODestroyMethod}, - {"exists", XOTclOExistsMethod}, - {"filterguard", XOTclOFilterGuardMethod}, - {"filtersearch", XOTclOFilterSearchMethod}, - {"info", XOTclOInfoMethod}, - {"instvar", XOTclOInstVarMethod}, - {"invar", XOTclOInvariantsMethod}, - {"isclass", XOTclOIsClassMethod}, - {"ismetaclass", XOTclOIsMetaClassMethod}, - {"isobject", XOTclOIsObjectMethod}, - {"istype", XOTclOIsTypeMethod}, - {"ismixin", XOTclOIsMixinMethod}, -#ifdef XOTCL_METADATA - {"metadata", XOTclOMetaDataMethod}, -#endif - {"mixinguard", XOTclOMixinGuardMethod}, - {"__next", XOTclONextMethod}, - /* {"next", XOTclONextMethod2},*/ - {"noinit", XOTclONoinitMethod}, - {"parametercmd", XOTclCParameterCmdMethod}, - { "proc", XOTclOProcMethod}, - {"procsearch", XOTclOProcSearchMethod}, - {"requireNamespace", XOTclORequireNamespaceMethod}, - {"set", XOTclOSetMethod}, /***??**/ - {"forward", XOTclOForwardMethod}, - {"uplevel", XOTclOUplevelMethod}, - {"upvar", XOTclOUpvarMethod}, - {"volatile", XOTclOVolatileMethod}, - {"vwait", XOTclOVwaitMethod} - }; - methodDefinition classInstcmds[] = { - {"autoname", XOTclOAutonameMethod}, - {"alloc", XOTclCAllocMethod}, - {"create", XOTclCCreateMethod}, - {"new", XOTclCNewMethod}, - {"info", XOTclCInfoMethod}, - {"instdestroy", XOTclCInstDestroyMethod}, - {"instfilterguard", XOTclCInstFilterGuardMethod}, - {"instinvar", XOTclCInvariantsMethod}, - {"instmixinguard", XOTclCInstMixinGuardMethod}, - {"instparametercmd", XOTclCInstParameterCmdMethod}, - {"instproc", XOTclCInstProcMethod}, - {"instforward", XOTclCInstForwardMethod}, - {"parameter", XOTclCParameterMethod}, - {"parameterclass", XOTclCParameterClassMethod}, - {"recreate", XOTclCRecreateMethod}, - {"unknown", XOTclCUnknownMethod} - }; - - int namespacelength; - Tcl_DString ds, *dsPtr = &ds; - - DSTRING_INIT(dsPtr); - Tcl_DStringAppend(dsPtr,"::xotcl::Object::instcmd", -1); - Tcl_CreateNamespace(in, Tcl_DStringValue(dsPtr), 0, (Tcl_NamespaceDeleteProc*)NULL); - Tcl_DStringAppend(dsPtr,"::", 2); - namespacelength = Tcl_DStringLength(dsPtr); - - for (i = 0; i < nr_elements(objInstcmds); i++) { - Tcl_DStringAppend(dsPtr, objInstcmds[i].methodName, -1); - Tcl_CreateObjCommand(in, Tcl_DStringValue(dsPtr), objInstcmds[i].proc, 0, 0); - Tcl_DStringSetLength(dsPtr, namespacelength); - } - Tcl_DStringSetLength(dsPtr, 0); - Tcl_DStringAppend(dsPtr,"::xotcl::Class::instcmd", -1); - Tcl_CreateNamespace(in, Tcl_DStringValue(dsPtr), 0, (Tcl_NamespaceDeleteProc*)NULL); - Tcl_DStringAppend(dsPtr,"::", 2); - namespacelength = Tcl_DStringLength(dsPtr); - - for (i = 0; i < nr_elements(classInstcmds); i++) { - Tcl_DStringAppend(dsPtr, classInstcmds[i].methodName, -1); - Tcl_CreateObjCommand(in, Tcl_DStringValue(dsPtr), classInstcmds[i].proc, 0, 0); - Tcl_DStringSetLength(dsPtr, namespacelength); - } - - DSTRING_FREE(dsPtr); - } - - /* - * overwritten tcl objs - */ - result = XOTclShadowTclCommands(in, SHADOW_LOAD); - if (result != TCL_OK) - return result; - - /* - * new tcl cmds - */ -#ifdef XOTCL_BYTECODE - instructions[INST_SELF_DISPATCH].cmdPtr = (Command *) -#endif - Tcl_CreateObjCommand(in, "::xotcl::my", XOTclSelfDispatchCmd, 0, 0); -#ifdef XOTCL_BYTECODE - instructions[INST_NEXT].cmdPtr = (Command *) -#endif - Tcl_CreateObjCommand(in, "::xotcl::next", XOTclNextObjCmd, 0, 0); -#ifdef XOTCL_BYTECODE - instructions[INST_SELF].cmdPtr = (Command *) -#endif - Tcl_CreateObjCommand(in, "::xotcl::self", XOTclGetSelfObjCmd, 0, 0); - /*Tcl_CreateObjCommand(in, "::xotcl::K", XOTclKObjCmd, 0, 0);*/ - - Tcl_CreateObjCommand(in, "::xotcl::alias", XOTclAliasCommand, 0, 0); - Tcl_CreateObjCommand(in, "::xotcl::configure", XOTclConfigureCommand, 0, 0); - Tcl_CreateObjCommand(in, "::xotcl::deprecated", XOTcl_DeprecatedCmd, 0, 0); -#ifdef XOTCL_BYTECODE - instructions[INST_INITPROC].cmdPtr = (Command *) -#endif - Tcl_CreateObjCommand(in, "::xotcl::initProcNS", XOTclInitProcNSCmd, 0, 0); - Tcl_CreateObjCommand(in, "::xotcl::interpretNonpositionalArgs", - XOTclInterpretNonpositionalArgsCmd, 0, 0); - Tcl_CreateObjCommand(in, "::xotcl::interp", XOTcl_InterpObjCmd, 0, 0); - Tcl_CreateObjCommand(in, "::xotcl::namespace_copyvars", XOTcl_NSCopyVars, 0, 0); - Tcl_CreateObjCommand(in, "::xotcl::namespace_copycmds", XOTcl_NSCopyCmds, 0, 0); - Tcl_CreateObjCommand(in, "::xotcl::__qualify", XOTclQualifyObjCmd, 0,0); - Tcl_CreateObjCommand(in, "::xotcl::setinstvar", XOTclSetInstvarCommand, 0, 0); - Tcl_CreateObjCommand(in, "::xotcl::setrelation", XOTclSetRelationCommand, 0, 0); - Tcl_CreateObjCommand(in, "::xotcl::trace", XOTcl_TraceObjCmd, 0, 0); - - Tcl_Export(in, RUNTIME_STATE(in)->XOTclNS, "self", 0); - Tcl_Export(in, RUNTIME_STATE(in)->XOTclNS, "next", 0); - Tcl_Export(in, RUNTIME_STATE(in)->XOTclNS, "my", 0); - -#ifdef XOTCL_BYTECODE - XOTclBytecodeInit(); -#endif - - /* - * Non-Positional Args Object - */ - - nonposArgsCl = PrimitiveCCreate(in, - XOTclGlobalStrings[XOTE_NON_POS_ARGS_CL], - thecls); - XOTclAddIMethod(in, (XOTcl_Class*) nonposArgsCl, - "required", - (Tcl_ObjCmdProc*) XOTclCheckRequiredArgs, 0, 0); - XOTclAddIMethod(in, (XOTcl_Class*) nonposArgsCl, - "switch", - (Tcl_ObjCmdProc*) XOTclCheckBooleanArgs, 0, 0); - XOTclAddIMethod(in, (XOTcl_Class*) nonposArgsCl, - "boolean", - (Tcl_ObjCmdProc*) XOTclCheckBooleanArgs, 0, 0); - PrimitiveOCreate(in, XOTclGlobalStrings[XOTE_NON_POS_ARGS_OBJ], - nonposArgsCl); - - /* - * Parameter Class - */ - { - XOTclObject *paramObject; - paramCl = PrimitiveCCreate(in, XOTclGlobalStrings[XOTE_PARAM_CL], thecls); - paramObject = ¶mCl->object; - XOTclAddPMethod(in, (XOTcl_Object*) paramObject, - XOTclGlobalStrings[XOTE_SEARCH_DEFAULTS], - (Tcl_ObjCmdProc*) ParameterSearchDefaultsMethod, 0, 0); - } - - /* - * set runtime version information in Tcl variable - */ - Tcl_SetVar(in, "::xotcl::version", XOTCLVERSION, TCL_GLOBAL_ONLY); - Tcl_SetVar(in, "::xotcl::patchlevel", XOTCLPATCHLEVEL, TCL_GLOBAL_ONLY); - - /* - * with some methods and library procs in tcl - they could go in a - * xotcl.tcl file, but they're embedded here with Tcl_GlobalEval - * to avoid the need to carry around a separate file at runtime. - */ - { - -#include "predefined.h" - - /* fprintf(stderr, "predefined=<<%s>>\n",cmd);*/ - if (Tcl_GlobalEval(in, cmd) != TCL_OK) - return TCL_ERROR; - } - -#ifndef AOL_SERVER - /* the AOL server uses a different package loading mechanism */ -# ifdef COMPILE_XOTCL_STUBS - Tcl_PkgProvideEx(in, "XOTcl", PACKAGE_VERSION, (ClientData) &xotclStubs); -# else - Tcl_PkgProvide(in, "XOTcl", PACKAGE_VERSION); -# endif -#endif - -#if !defined(TCL_THREADS) && !defined(PRE81) - if ((Tcl_GetVar2(in, "tcl_platform", "threaded", TCL_GLOBAL_ONLY) != NULL)) { - /* a non threaded XOTcl version is loaded into a threaded environment */ - fprintf(stderr, "\n A non threaded XOTCL version is loaded into threaded environment\n Please reconfigure XOTcl with --enable-threads!\n\n\n"); - } -#endif - - Tcl_ResetResult(in); - Tcl_SetIntObj(Tcl_GetObjResult(in), 1); - - return TCL_OK; -} - - -extern int -Xotcl_SafeInit(Tcl_Interp *interp) { - /*** dummy for now **/ - return Xotcl_Init(interp); -} - Index: xotcl/generic/xotcl.decls =================================================================== diff -u -N --- xotcl/generic/xotcl.decls (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/generic/xotcl.decls (revision 0) @@ -1,162 +0,0 @@ -# xotcl.decls -- -# -# This file contains the declarations for all supported public -# functions that are exported by the XOTcl library via the stubs table. -# This file is used to generate the xotclDecls.h, xotclPlatDecls.h, -# xotclStub.c, and xotclPlatStub.c files. -# -# -# Copyright (c) 1998-1999 by Scriptics Corporation. -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: $Id: xotcl.decls,v 1.4 2006/09/27 08:12:40 neumann Exp $ - -library xotcl - -interface xotcl -hooks {xotclInt} - -# Declare each of the functions in the public Tcl interface. Note that -# the an index should never be reused for a different function in order -# to preserve backwards compatibility. - -declare 0 generic { - int Xotcl_Init(Tcl_Interp *interp) -} -# 1 is reserved for safe init -#declare 1 generic { -# int Xotcl_SafeInit(Tcl_Interp *interp) -#} -declare 2 generic { - struct XOTcl_Class* XOTclIsClass(Tcl_Interp* in, ClientData cd) -} -#declare 3 generic { -# -#} -declare 4 generic { - struct XOTcl_Object* XOTclGetObject(Tcl_Interp* in, char* name) -} -declare 5 generic { - struct XOTcl_Class* XOTclGetClass(Tcl_Interp* in, char* name) -} -declare 6 generic { - int XOTclCreateObject(Tcl_Interp* in, Tcl_Obj* name, struct XOTcl_Class* cl) -} -#declare 7 generic { -# -#} -declare 8 generic { - int XOTclCreateClass(Tcl_Interp* in, Tcl_Obj* name, struct XOTcl_Class* cl) -} -declare 9 generic { - int XOTclDeleteObject(Tcl_Interp* in, struct XOTcl_Object* obj) -} -declare 10 generic { - int XOTclDeleteClass(Tcl_Interp* in, struct XOTcl_Class* cl) -} -declare 11 generic { - void XOTclAddPMethod(Tcl_Interp* in, struct XOTcl_Object* obj, - char* nm, Tcl_ObjCmdProc* proc, - ClientData cd, Tcl_CmdDeleteProc* dp) -} -declare 12 generic { - void XOTclAddIMethod(Tcl_Interp* in, struct XOTcl_Class* cl, - char* nm, Tcl_ObjCmdProc* proc, - ClientData cd, Tcl_CmdDeleteProc* dp) -} -declare 13 generic { - void XOTclRemovePMethod(Tcl_Interp* in,struct XOTcl_Object* obj, char* nm) -} -declare 14 generic { - void XOTclRemoveIMethod(Tcl_Interp* in, struct XOTcl_Class* cl, char* nm) -} -declare 15 generic { - Tcl_Obj* XOTclOSetInstVar(struct XOTcl_Object* obj, Tcl_Interp* in, - Tcl_Obj* name, Tcl_Obj* value, int flgs) -} -declare 16 generic { - Tcl_Obj* XOTclOGetInstVar(struct XOTcl_Object* obj, Tcl_Interp* in, - Tcl_Obj* name, int flgs) -} -declare 17 generic { - int XOTclInstVar(struct XOTcl_Object* obj, Tcl_Interp* in, - char* name, char* destName) -} -#declare 18 generic { -# -#} -declare 19 generic { - Tcl_Obj* XOTclOSetInstVar2(struct XOTcl_Object* obj, - Tcl_Interp* in,Tcl_Obj* name1,Tcl_Obj* name2, - Tcl_Obj* value,int flgs) -} -declare 20 generic { - Tcl_Obj* XOTclOGetInstVar2(struct XOTcl_Object* obj, - Tcl_Interp* in,Tcl_Obj* name1,Tcl_Obj* name2, - int flgs) -} -declare 21 generic { - int XOTclUnsetInstVar2(struct XOTcl_Object* obj, Tcl_Interp* in, - char* name1, char* name2, - int flgs) -} -declare 22 generic { - int XOTcl_TraceObjCmd(ClientData cd, Tcl_Interp *in, - int objc, Tcl_Obj *CONST objv[]) -} -declare 23 generic { - int XOTclErrMsg(Tcl_Interp* in, char* msg, Tcl_FreeProc* type) -} -declare 24 generic { - int XOTclVarErrMsg(Tcl_Interp * in, ...) -} -declare 25 generic { - int XOTclErrInProc (Tcl_Interp *in, Tcl_Obj* objName, - Tcl_Obj* clName, char* procName) -} -declare 26 generic { - int XOTclObjErrArgCnt(Tcl_Interp *in, Tcl_Obj *cmdname, char *arglist) -} -declare 27 generic { - int XOTclErrBadVal_(Tcl_Interp *in, char *expected, char *value) -} -declare 28 generic { - int XOTclObjErrType(Tcl_Interp *in, Tcl_Obj *nm, char* wt) -} -declare 29 generic { - void XOTclStackDump (Tcl_Interp* in) -} -declare 30 generic { - void XOTclCallStackDump (Tcl_Interp* in) -} -declare 31 generic { - void XOTclDeprecatedMsg(char* oldCmd, char* newCmd) -} -declare 32 generic { - void XOTclSetObjClientData(XOTcl_Object* obj, ClientData data) -} -declare 33 generic { - ClientData XOTclGetObjClientData(XOTcl_Object* obj) -} -declare 34 generic { - void XOTclSetClassClientData(XOTcl_Class* cl, ClientData data) -} -declare 35 generic { - ClientData XOTclGetClassClientData(XOTcl_Class* cl) -} -declare 36 generic { - void XOTclRequireObjNamespace(Tcl_Interp* in, XOTcl_Object* obj) -} -declare 37 generic { - int XOTclErrBadVal(Tcl_Interp *in, char *context, char *expected, char *value) -} -declare 38 generic { - int XOTclNextObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) -} -declare 39 generic { - int XOTclCallMethodWithArgs(ClientData cd, Tcl_Interp *in, - Tcl_Obj *method, Tcl_Obj *arg, - int objc, Tcl_Obj *CONST objv[], int flags) -} - Index: xotcl/generic/xotcl.h =================================================================== diff -u -N --- xotcl/generic/xotcl.h (revision e44f69435e8db4aa6ed2ffffe8caaa6586c2fc5f) +++ xotcl/generic/xotcl.h (revision 0) @@ -1,207 +0,0 @@ -/* -*- Mode: c++ -*- - * - * $Id: xotcl.h,v 1.13 2007/09/18 19:27:33 neumann Exp $ - * - * Extended Object Tcl (XOTcl) - * - * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation, and that the name of - * M.I.T. not be used in advertising or publicity pertaining to - * distribution of the software without specific, written prior - * permission. M.I.T. makes no representations about the suitability - * of this software for any purpose. It is provided "as is" without - * express or implied warranty. - * */ - -#ifndef _xotcl_h_ -#define _xotcl_h_ - -#include "tcl.h" - -#undef TCL_STORAGE_CLASS -#ifdef BUILD_xotcl -# define TCL_STORAGE_CLASS DLLEXPORT -#else -# ifdef USE_XOTCL_STUBS -# define TCL_STORAGE_CLASS -# else -# define TCL_STORAGE_CLASS DLLIMPORT -# endif -#endif - -/* use documented interface to link XOTcl state to an interpreter */ -#define USE_ASSOC_DATA 1 - -/* new namespace support (post 1.2.0 */ -#define NAMESPACEINSTPROCS 1 - -/* activate bytecode support -#define XOTCL_BYTECODE -*/ - -#define KEEP_TCL_CMD_TYPE 1 - -/* activate/deacticate assert -#define NDEBUG 1 -*/ -#define NDEBUG 1 - - -/* activate/deacticate memory tracing -#define XOTCL_MEM_TRACE 1 -#define XOTCL_MEM_COUNT 1 -*/ -/*#define REFCOUNTED 1*/ - -/* -#define XOTCLOBJ_TRACE 1 -#define REFCOUNT_TRACE 1 -#define DISPATCH_TRACE 1 -*/ - -/* activate/deacticate profiling information at the end - of running the program -#define PROFILE -*/ - -/* make self, proc and class in instproc and procs -#define AUTOVARS -*/ - -/* turn tracing output on/off -#define CALLSTACK_TRACE 1 -#define DISPATCH_TRACE 1 -#define NAMESPACE_TRACE 1 -#define OBJDELETION_TRACE 1 -#define STACK_TRACE 1 -*/ - -#ifdef XOTCL_MEM_COUNT -# define DO_FULL_CLEANUP 1 -#endif - -#ifdef AOL_SERVER -# ifndef TCL_THREADS -# define TCL_THREADS -# endif -#endif - -#ifdef TCL_THREADS -# define DO_CLEANUP -#endif - -#ifdef DO_FULL_CLEANUP -# define DO_CLEANUP -#endif - -/* - * prevent old TCL-versions - */ - -#if TCL_MAJOR_VERSION < 8 -# error Tcl distribution is TOO OLD, we require at least tcl8.0 -#endif - -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<1 -# define PRE81 -#else -# if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION==1 -# define V81 -# endif -#endif -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<2 -# define PRE82 -#endif -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<3 -# define PRE83 -#endif -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<4 -# define PRE84 -#endif -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<5 -# define PRE85 -#endif - -#if !defined(FORWARD_COMPATIBLE) -# if defined(PRE85) -# define FORWARD_COMPATIBLE 1 -# else -# define FORWARD_COMPATIBLE 0 -# endif -#endif - -#define XOTCL_NONLEAF_METHOD (ClientData)0x01 - -/* - * A special definition used to allow this header file to be included - * in resource files so that they can get obtain version information from - * this file. Resource compilers don't like all the C stuff, like typedefs - * and procedure declarations, that occur below. - */ - -#ifndef RC_INVOKED - -/* -#ifdef __cplusplus -extern "C" { -#endif -*/ - - -/* - * The structures XOTcl_Object and XOTcl_Class define mostly opaque - * data structures for the internal use strucures XOTclObject and - * XOTclClass (both defined in XOTclInt.h). Modification of elements - * visible elements must be mirrored in both incarnations. - */ - -typedef struct XOTcl_Object { - Tcl_Obj *cmdName; -} XOTcl_Object; - -typedef struct XOTcl_Class { - struct XOTcl_Object object; -} XOTcl_Class; - - -/* - * Include the public function declarations that are accessible via - * the stubs table. - */ -#include "xotclDecls.h" - -/* - * Xotcl_InitStubs is used by extensions that can be linked - * against the xotcl stubs library. If we are not using stubs - * then this reduces to package require. - */ - -#ifdef USE_XOTCL_STUBS - -# ifdef __cplusplus -extern "C" -# endif -CONST char * -Xotcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, CONST char *version, int exact)); -#else -# define Xotcl_InitStubs(interp, version, exact) \ - Tcl_PkgRequire(interp, "XOTcl", version, exact) -#endif - -#endif /* RC_INVOKED */ - -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLIMPORT - -#endif /* _xotcl_h_ */ Index: xotcl/generic/xotclAccessInt.h =================================================================== diff -u -N --- xotcl/generic/xotclAccessInt.h (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/generic/xotclAccessInt.h (revision 0) @@ -1,65 +0,0 @@ -#define Tcl_Interp_numLevels(in) ((Interp *)in)->numLevels -#define Tcl_Interp_framePtr(in) ((Tcl_CallFrame *)((Interp *)in)->framePtr) -#define Tcl_Interp_varFramePtr(in) (((Interp *)in)->varFramePtr) -#define Tcl_Interp_globalNsPtr(in) ((Tcl_Namespace *)((Interp *)in)->globalNsPtr) -#define Tcl_Interp_flags(in) ((Interp *)in)->flags -#if DISPATCH_TRACE -#define Tcl_Interp_returnCode(in) ((Interp *)in)->returnCode -#endif -#define Tcl_Interp_threadId(in) ((Interp *)in)->threadId - -#define Tcl_CallFrame_callerPtr(cf) ((Tcl_CallFrame*)((CallFrame *)cf)->callerPtr) -#define Tcl_CallFrame_procPtr(cf) ((CallFrame *)cf)->procPtr -#define Tcl_CallFrame_varTablePtr(cf) ((CallFrame *)cf)->varTablePtr -#define Tcl_CallFrame_level(cf) ((CallFrame *)cf)->level -#define Tcl_CallFrame_isProcCallFrame(cf) ((CallFrame *)cf)->isProcCallFrame -#define Tcl_CallFrame_compiledLocals(cf) ((CallFrame *)cf)->compiledLocals -#define Tcl_CallFrame_callerVarPtr(cf) ((Tcl_CallFrame*)((CallFrame *)cf)->callerVarPtr) -#define Tcl_CallFrame_objc(cf) ((CallFrame *)cf)->objc -#define Tcl_CallFrame_objv(cf) ((CallFrame *)cf)->objv - -#define Tcl_Namespace_cmdTable(nsPtr) &((Namespace *)nsPtr)->cmdTable -#define Tcl_Namespace_varTable(nsPtr) &((Namespace *)nsPtr)->varTable -#define Tcl_Namespace_childTable(nsPtr) &((Namespace *)nsPtr)->childTable -#define Tcl_Namespace_activationCount(nsPtr) ((Namespace *)nsPtr)->activationCount -#define Tcl_Namespace_deleteProc(nsPtr) ((Namespace *)nsPtr)->deleteProc - - - -#define Tcl_Command_refCount(cmd) ((Command *)cmd)->refCount -#define Tcl_Command_cmdEpoch(cmd) ((Command *)cmd)->cmdEpoch -/* the following items could be obtained from - Tcl_GetCommandInfoFromToken(cmd, infoPtr) */ -#define Tcl_Command_nsPtr(cmd) ((Tcl_Namespace*)(((Command *)cmd)->nsPtr)) -#define Tcl_Command_objProc(cmd) ((Command *)cmd)->objProc -#define Tcl_Command_objClientData(cmd) ((Command *)cmd)->objClientData -#define Tcl_Command_proc(cmd) ((Command *)cmd)->proc -#define Tcl_Command_clientData(cmd) ((Command *)cmd)->clientData -#define Tcl_Command_deleteProc(cmd) ((Command *)cmd)->deleteProc - -/* - * Conversion from CmdPtr to Class / Object - */ - -static XOTCLINLINE ClientData -XOTclGetCDFromCmdPtr(Tcl_Command cmd) { - assert(cmd); - if (Tcl_Command_objProc(cmd) == XOTclObjDispatch && !Tcl_Command_cmdEpoch(cmd)) - return Tcl_Command_objClientData(cmd); - else - return NULL; -} - -static XOTCLINLINE XOTclClass* -XOTclGetClassFromCmdPtr(Tcl_Command cmd) { - ClientData cd = XOTclGetCDFromCmdPtr(cmd); - if (cd) - return XOTclObjectToClass(cd); - else - return 0; -} - -static XOTCLINLINE XOTclObject* -XOTclGetObjectFromCmdPtr(Tcl_Command cmd) { - return (XOTclObject*) XOTclGetCDFromCmdPtr(cmd); -} Index: xotcl/generic/xotclAppInit.c =================================================================== diff -u -N --- xotcl/generic/xotclAppInit.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/generic/xotclAppInit.c (revision 0) @@ -1,151 +0,0 @@ -/* - * tclAppInit.c -- - * - * Provides a default version of the main program and Tcl_AppInit - * procedure for Tcl applications (without Tk). - * - * Copyright (c) 1993 The Regents of the University of California. - * Copyright (c) 1994-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: @(#) tclAppInit.c 1.20 97/03/24 14:29:43 - */ - -/* include tclInt.h for access to namespace API */ -#include "tclInt.h" - -#include "xotcl.h" - -#if defined(VISUAL_CC) -# include -# include -#endif -#include - -#if TCL_MAJOR_VERSION < 7 - #error Tcl distribution TOO OLD -#endif - -/* - * The following variable is a special hack that is needed in order for - * Sun shared libraries to be used for Tcl. - */ - -#ifdef NEED_MATHERR -extern int matherr(); -int *tclDummyMathPtr = (int *) matherr; -#endif - -/* - *---------------------------------------------------------------------- - * - * main -- - * - * This is the main program for the application. - * - * Results: - * None: Tcl_Main never returns here, so this procedure never - * returns either. - * - * Side effects: - * Whatever the application does. - * - *---------------------------------------------------------------------- - */ - -#if TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION < 4 - -extern int main(); -int *tclDummyMainPtr = (int *) main; - -#else - -int -main(argc, argv) - int argc; /* Number of command-line arguments. */ - char **argv; /* Values of command-line arguments. */ -{ -#if defined(VISUAL_CC) - setlocale(LC_ALL, "C"); -#endif - Tcl_Main(argc, argv, Tcl_AppInit); - return 0; /* Needed only to prevent compiler warning. */ -} - -#endif - - -/* - *---------------------------------------------------------------------- - * - * 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; - } - - /* - * 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 (Xotcl_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - - Tcl_StaticPackage(interp, "XOTcl", Xotcl_Init, 0); - */ - - if (Tcl_PkgRequire(interp, "XOTcl", XOTCLVERSION, 1) == NULL) { - return TCL_ERROR; - } - - /* - * This is xotclsh, so import all xotcl commands by - * default into the global namespace. - */ - - if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), - "::xotcl::*", /* allowOverwrite */ 1) != 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", "~/.tclshrc", TCL_GLOBAL_ONLY); - return TCL_OK; -} Index: xotcl/generic/xotclCompile.c =================================================================== diff -u -N --- xotcl/generic/xotclCompile.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/generic/xotclCompile.c (revision 0) @@ -1,144 +0,0 @@ -#include "xotclInt.h" - -#ifdef XOTCL_BYTECODE -#include - -static CompileProc - initProcNsCompile, nextCompile, - selfCompile, selfDispatchCompile; - -static InstructionDesc instructionTable[] = { - {"initProc", 1, 0, {OPERAND_NONE}}, - {"next", 1, 0, {OPERAND_NONE}}, - {"self", 1, 0, {OPERAND_NONE}}, - {"dispatch", 2, 1, {OPERAND_UINT1}}, -}; - -static XOTclCompEnv instructions[] = { - {0, 0, initProcNsCompile, XOTclInitProcNSCmd}, - {0, 0, nextCompile, XOTclNextObjCmd}, - {0, 0, selfCompile, XOTclGetSelfObjCmd}, - {0, 0, selfDispatchCompile, /*XOTclSelfDispatchCmd*/XOTclDirectSelfDispatch}, - 0 -}; - -XOTclCompEnv * -XOTclGetCompEnv() { - return &instructions[0]; -} - - -static int -initProcNsCompile(Tcl_Interp *interp, Tcl_Parse *parsePtr, - CompileEnv *envPtr) { - - if (parsePtr->numWords != 1) { - Tcl_ResetResult(interp); - Tcl_AppendToObj(Tcl_GetObjResult(interp), - "wrong # args: should be '::xotcl::initProcNS'", -1); - envPtr->maxStackDepth = 0; - return TCL_ERROR; - } - - TclEmitOpcode(instructions[INST_INITPROC].bytecode, envPtr); - envPtr->maxStackDepth = 0; - - return TCL_OK; -} - -static int -nextCompile(Tcl_Interp *interp, Tcl_Parse *parsePtr, - CompileEnv *envPtr) { - - if (parsePtr->numWords != 1) - return TCL_OUT_LINE_COMPILE; - - TclEmitOpcode(instructions[INST_NEXT].bytecode, envPtr); - envPtr->maxStackDepth = 0; - - return TCL_OK; -} -static int -selfCompile(Tcl_Interp *interp, Tcl_Parse *parsePtr, - CompileEnv *envPtr) { - - if (parsePtr->numWords != 1) - return TCL_OUT_LINE_COMPILE; - - TclEmitOpcode(instructions[INST_SELF].bytecode, envPtr); - envPtr->maxStackDepth = 0; - - return TCL_OK; -} -static int -selfDispatchCompile(Tcl_Interp *interp, Tcl_Parse *parsePtr, - CompileEnv *envPtr) { - - Tcl_Token *tokenPtr; - int code, wordIdx; - /* - fprintf(stderr, "****** selfDispatchCompile words=%d tokens=%d, avail=%d\n", - parsePtr->numWords,parsePtr->numTokens,parsePtr->tokensAvailable); - */ - - if (parsePtr->numWords > 255) - return TCL_OUT_LINE_COMPILE; - - /*TclEmitOpcode(instructions[INST_SELF].bytecode, envPtr);*/ - - for (wordIdx=0, tokenPtr = parsePtr->tokenPtr + 0; - wordIdx < parsePtr->numWords; - wordIdx++, tokenPtr += (tokenPtr->numComponents + 1)) { - - /* - fprintf(stderr," %d: %p token type=%d size=%d\n", - wordIdx,tokenPtr,tokenPtr->type,tokenPtr->size ); - */ - if (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD) { - TclEmitPush(TclRegisterLiteral(envPtr, tokenPtr->start, - tokenPtr->size, 0), envPtr); - envPtr->maxStackDepth = 1; - /* - fprintf(stderr," %d: simple '%s' components=%d\n", - wordIdx,tokenPtr->start, tokenPtr->numComponents); - */ - } else { - /* - fprintf(stderr," %d NOT simple '%s' components=%d\n", - wordIdx,tokenPtr->start, tokenPtr->numComponents); - */ - code = TclCompileTokens(interp, tokenPtr+1, - tokenPtr->numComponents, envPtr); - if (code != TCL_OK) { - return code; - } - } - } - - /*fprintf(stderr, "maxdepth=%d, onStack=%d\n",envPtr->maxStackDepth,wordIdx); - */ - TclEmitInstInt1(instructions[INST_SELF_DISPATCH].bytecode, wordIdx, envPtr); - envPtr->maxStackDepth = 0; - - return TCL_OK; -} - - - -void -XOTclBytecodeInit() { - int i; - for(i=0; iobjClientData))) { - instructions[i].cmdPtr->compileProc = instructions[i].compileProc; - } - - } - /*tclTraceCompile = 2;*/ - -} - -#endif Index: xotcl/generic/xotclDecls.h =================================================================== diff -u -N --- xotcl/generic/xotclDecls.h (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/generic/xotclDecls.h (revision 0) @@ -1,369 +0,0 @@ -/* - * xotclDecls.h -- - * - * Declarations of functions in the platform independent public XOTcl 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. - * - */ - -#ifndef _XOTCLDECLS -#define _XOTCLDECLS - -/* - * WARNING: This file is automatically generated by the tools/genStubs.tcl - * script. Any modifications to the function declarations below should be made - * in the xotcl.decls script. - */ - -/* !BEGIN!: Do not edit below this line. */ - -/* - * Exported function declarations: - */ - -/* 0 */ -EXTERN int Xotcl_Init _ANSI_ARGS_((Tcl_Interp * interp)); -/* Slot 1 is reserved */ -/* 2 */ -EXTERN struct XOTcl_Class* XOTclIsClass _ANSI_ARGS_((Tcl_Interp* in, - ClientData cd)); -/* Slot 3 is reserved */ -/* 4 */ -EXTERN struct XOTcl_Object* XOTclGetObject _ANSI_ARGS_((Tcl_Interp* in, - char* name)); -/* 5 */ -EXTERN struct XOTcl_Class* XOTclGetClass _ANSI_ARGS_((Tcl_Interp* in, - char* name)); -/* 6 */ -EXTERN int XOTclCreateObject _ANSI_ARGS_((Tcl_Interp* in, - Tcl_Obj* name, struct XOTcl_Class* cl)); -/* Slot 7 is reserved */ -/* 8 */ -EXTERN int XOTclCreateClass _ANSI_ARGS_((Tcl_Interp* in, - Tcl_Obj* name, struct XOTcl_Class* cl)); -/* 9 */ -EXTERN int XOTclDeleteObject _ANSI_ARGS_((Tcl_Interp* in, - struct XOTcl_Object* obj)); -/* 10 */ -EXTERN int XOTclDeleteClass _ANSI_ARGS_((Tcl_Interp* in, - struct XOTcl_Class* cl)); -/* 11 */ -EXTERN void XOTclAddPMethod _ANSI_ARGS_((Tcl_Interp* in, - struct XOTcl_Object* obj, char* nm, - Tcl_ObjCmdProc* proc, ClientData cd, - Tcl_CmdDeleteProc* dp)); -/* 12 */ -EXTERN void XOTclAddIMethod _ANSI_ARGS_((Tcl_Interp* in, - struct XOTcl_Class* cl, char* nm, - Tcl_ObjCmdProc* proc, ClientData cd, - Tcl_CmdDeleteProc* dp)); -/* 13 */ -EXTERN void XOTclRemovePMethod _ANSI_ARGS_((Tcl_Interp* in, - struct XOTcl_Object* obj, char* nm)); -/* 14 */ -EXTERN void XOTclRemoveIMethod _ANSI_ARGS_((Tcl_Interp* in, - struct XOTcl_Class* cl, char* nm)); -/* 15 */ -EXTERN Tcl_Obj* XOTclOSetInstVar _ANSI_ARGS_(( - struct XOTcl_Object* obj, Tcl_Interp* in, - Tcl_Obj* name, Tcl_Obj* value, int flgs)); -/* 16 */ -EXTERN Tcl_Obj* XOTclOGetInstVar _ANSI_ARGS_(( - struct XOTcl_Object* obj, Tcl_Interp* in, - Tcl_Obj* name, int flgs)); -/* 17 */ -EXTERN int XOTclInstVar _ANSI_ARGS_((struct XOTcl_Object* obj, - Tcl_Interp* in, char* name, char* destName)); -/* Slot 18 is reserved */ -/* 19 */ -EXTERN Tcl_Obj* XOTclOSetInstVar2 _ANSI_ARGS_(( - struct XOTcl_Object* obj, Tcl_Interp* in, - Tcl_Obj* name1, Tcl_Obj* name2, - Tcl_Obj* value, int flgs)); -/* 20 */ -EXTERN Tcl_Obj* XOTclOGetInstVar2 _ANSI_ARGS_(( - struct XOTcl_Object* obj, Tcl_Interp* in, - Tcl_Obj* name1, Tcl_Obj* name2, int flgs)); -/* 21 */ -EXTERN int XOTclUnsetInstVar2 _ANSI_ARGS_(( - struct XOTcl_Object* obj, Tcl_Interp* in, - char* name1, char* name2, int flgs)); -/* 22 */ -EXTERN int XOTcl_TraceObjCmd _ANSI_ARGS_((ClientData cd, - Tcl_Interp * in, int objc, - Tcl_Obj *CONST objv[])); -/* 23 */ -EXTERN int XOTclErrMsg _ANSI_ARGS_((Tcl_Interp* in, char* msg, - Tcl_FreeProc* type)); -/* 24 */ -EXTERN int XOTclVarErrMsg _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,in)); -/* 25 */ -EXTERN int XOTclErrInProc _ANSI_ARGS_((Tcl_Interp * in, - Tcl_Obj* objName, Tcl_Obj* clName, - char* procName)); -/* 26 */ -EXTERN int XOTclObjErrArgCnt _ANSI_ARGS_((Tcl_Interp * in, - Tcl_Obj * cmdname, char * arglist)); -/* 27 */ -EXTERN int XOTclErrBadVal_ _ANSI_ARGS_((Tcl_Interp * in, - char * expected, char * value)); -/* 28 */ -EXTERN int XOTclObjErrType _ANSI_ARGS_((Tcl_Interp * in, - Tcl_Obj * nm, char* wt)); -/* 29 */ -EXTERN void XOTclStackDump _ANSI_ARGS_((Tcl_Interp* in)); -/* 30 */ -EXTERN void XOTclCallStackDump _ANSI_ARGS_((Tcl_Interp* in)); -/* 31 */ -EXTERN void XOTclDeprecatedMsg _ANSI_ARGS_((char* oldCmd, - char* newCmd)); -/* 32 */ -EXTERN void XOTclSetObjClientData _ANSI_ARGS_((XOTcl_Object* obj, - ClientData data)); -/* 33 */ -EXTERN ClientData XOTclGetObjClientData _ANSI_ARGS_((XOTcl_Object* obj)); -/* 34 */ -EXTERN void XOTclSetClassClientData _ANSI_ARGS_((XOTcl_Class* cl, - ClientData data)); -/* 35 */ -EXTERN ClientData XOTclGetClassClientData _ANSI_ARGS_((XOTcl_Class* cl)); -/* 36 */ -EXTERN void XOTclRequireObjNamespace _ANSI_ARGS_((Tcl_Interp* in, - XOTcl_Object* obj)); -/* 37 */ -EXTERN int XOTclErrBadVal _ANSI_ARGS_((Tcl_Interp * in, - char * context, char * expected, - char * value)); -/* 38 */ -EXTERN int XOTclNextObjCmd _ANSI_ARGS_((ClientData cd, - Tcl_Interp * in, int objc, - Tcl_Obj *CONST objv[])); -/* 39 */ -EXTERN int XOTclCallMethodWithArgs _ANSI_ARGS_((ClientData cd, - Tcl_Interp * in, Tcl_Obj * method, - Tcl_Obj * arg, int objc, - Tcl_Obj *CONST objv[], int flags)); - -typedef struct XotclStubHooks { - struct XotclIntStubs *xotclIntStubs; -} XotclStubHooks; - -typedef struct XotclStubs { - int magic; - struct XotclStubHooks *hooks; - - int (*xotcl_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */ - void *reserved1; - struct XOTcl_Class* (*xOTclIsClass) _ANSI_ARGS_((Tcl_Interp* in, ClientData cd)); /* 2 */ - void *reserved3; - struct XOTcl_Object* (*xOTclGetObject) _ANSI_ARGS_((Tcl_Interp* in, char* name)); /* 4 */ - struct XOTcl_Class* (*xOTclGetClass) _ANSI_ARGS_((Tcl_Interp* in, char* name)); /* 5 */ - int (*xOTclCreateObject) _ANSI_ARGS_((Tcl_Interp* in, Tcl_Obj* name, struct XOTcl_Class* cl)); /* 6 */ - void *reserved7; - int (*xOTclCreateClass) _ANSI_ARGS_((Tcl_Interp* in, Tcl_Obj* name, struct XOTcl_Class* cl)); /* 8 */ - int (*xOTclDeleteObject) _ANSI_ARGS_((Tcl_Interp* in, struct XOTcl_Object* obj)); /* 9 */ - int (*xOTclDeleteClass) _ANSI_ARGS_((Tcl_Interp* in, struct XOTcl_Class* cl)); /* 10 */ - void (*xOTclAddPMethod) _ANSI_ARGS_((Tcl_Interp* in, struct XOTcl_Object* obj, char* nm, Tcl_ObjCmdProc* proc, ClientData cd, Tcl_CmdDeleteProc* dp)); /* 11 */ - void (*xOTclAddIMethod) _ANSI_ARGS_((Tcl_Interp* in, struct XOTcl_Class* cl, char* nm, Tcl_ObjCmdProc* proc, ClientData cd, Tcl_CmdDeleteProc* dp)); /* 12 */ - void (*xOTclRemovePMethod) _ANSI_ARGS_((Tcl_Interp* in, struct XOTcl_Object* obj, char* nm)); /* 13 */ - void (*xOTclRemoveIMethod) _ANSI_ARGS_((Tcl_Interp* in, struct XOTcl_Class* cl, char* nm)); /* 14 */ - Tcl_Obj* (*xOTclOSetInstVar) _ANSI_ARGS_((struct XOTcl_Object* obj, Tcl_Interp* in, Tcl_Obj* name, Tcl_Obj* value, int flgs)); /* 15 */ - Tcl_Obj* (*xOTclOGetInstVar) _ANSI_ARGS_((struct XOTcl_Object* obj, Tcl_Interp* in, Tcl_Obj* name, int flgs)); /* 16 */ - int (*xOTclInstVar) _ANSI_ARGS_((struct XOTcl_Object* obj, Tcl_Interp* in, char* name, char* destName)); /* 17 */ - void *reserved18; - Tcl_Obj* (*xOTclOSetInstVar2) _ANSI_ARGS_((struct XOTcl_Object* obj, Tcl_Interp* in, Tcl_Obj* name1, Tcl_Obj* name2, Tcl_Obj* value, int flgs)); /* 19 */ - Tcl_Obj* (*xOTclOGetInstVar2) _ANSI_ARGS_((struct XOTcl_Object* obj, Tcl_Interp* in, Tcl_Obj* name1, Tcl_Obj* name2, int flgs)); /* 20 */ - int (*xOTclUnsetInstVar2) _ANSI_ARGS_((struct XOTcl_Object* obj, Tcl_Interp* in, char* name1, char* name2, int flgs)); /* 21 */ - int (*xOTcl_TraceObjCmd) _ANSI_ARGS_((ClientData cd, Tcl_Interp * in, int objc, Tcl_Obj *CONST objv[])); /* 22 */ - int (*xOTclErrMsg) _ANSI_ARGS_((Tcl_Interp* in, char* msg, Tcl_FreeProc* type)); /* 23 */ - int (*xOTclVarErrMsg) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,in)); /* 24 */ - int (*xOTclErrInProc) _ANSI_ARGS_((Tcl_Interp * in, Tcl_Obj* objName, Tcl_Obj* clName, char* procName)); /* 25 */ - int (*xOTclObjErrArgCnt) _ANSI_ARGS_((Tcl_Interp * in, Tcl_Obj * cmdname, char * arglist)); /* 26 */ - int (*xOTclErrBadVal_) _ANSI_ARGS_((Tcl_Interp * in, char * expected, char * value)); /* 27 */ - int (*xOTclObjErrType) _ANSI_ARGS_((Tcl_Interp * in, Tcl_Obj * nm, char* wt)); /* 28 */ - void (*xOTclStackDump) _ANSI_ARGS_((Tcl_Interp* in)); /* 29 */ - void (*xOTclCallStackDump) _ANSI_ARGS_((Tcl_Interp* in)); /* 30 */ - void (*xOTclDeprecatedMsg) _ANSI_ARGS_((char* oldCmd, char* newCmd)); /* 31 */ - void (*xOTclSetObjClientData) _ANSI_ARGS_((XOTcl_Object* obj, ClientData data)); /* 32 */ - ClientData (*xOTclGetObjClientData) _ANSI_ARGS_((XOTcl_Object* obj)); /* 33 */ - void (*xOTclSetClassClientData) _ANSI_ARGS_((XOTcl_Class* cl, ClientData data)); /* 34 */ - ClientData (*xOTclGetClassClientData) _ANSI_ARGS_((XOTcl_Class* cl)); /* 35 */ - void (*xOTclRequireObjNamespace) _ANSI_ARGS_((Tcl_Interp* in, XOTcl_Object* obj)); /* 36 */ - int (*xOTclErrBadVal) _ANSI_ARGS_((Tcl_Interp * in, char * context, char * expected, char * value)); /* 37 */ - int (*xOTclNextObjCmd) _ANSI_ARGS_((ClientData cd, Tcl_Interp * in, int objc, Tcl_Obj *CONST objv[])); /* 38 */ - int (*xOTclCallMethodWithArgs) _ANSI_ARGS_((ClientData cd, Tcl_Interp * in, Tcl_Obj * method, Tcl_Obj * arg, int objc, Tcl_Obj *CONST objv[], int flags)); /* 39 */ -} XotclStubs; - -#ifdef __cplusplus -extern "C" { -#endif -extern XotclStubs *xotclStubsPtr; -#ifdef __cplusplus -} -#endif - -#if defined(USE_XOTCL_STUBS) && !defined(USE_XOTCL_STUB_PROCS) - -/* - * Inline function declarations: - */ - -#ifndef Xotcl_Init -#define Xotcl_Init \ - (xotclStubsPtr->xotcl_Init) /* 0 */ -#endif -/* Slot 1 is reserved */ -#ifndef XOTclIsClass -#define XOTclIsClass \ - (xotclStubsPtr->xOTclIsClass) /* 2 */ -#endif -/* Slot 3 is reserved */ -#ifndef XOTclGetObject -#define XOTclGetObject \ - (xotclStubsPtr->xOTclGetObject) /* 4 */ -#endif -#ifndef XOTclGetClass -#define XOTclGetClass \ - (xotclStubsPtr->xOTclGetClass) /* 5 */ -#endif -#ifndef XOTclCreateObject -#define XOTclCreateObject \ - (xotclStubsPtr->xOTclCreateObject) /* 6 */ -#endif -/* Slot 7 is reserved */ -#ifndef XOTclCreateClass -#define XOTclCreateClass \ - (xotclStubsPtr->xOTclCreateClass) /* 8 */ -#endif -#ifndef XOTclDeleteObject -#define XOTclDeleteObject \ - (xotclStubsPtr->xOTclDeleteObject) /* 9 */ -#endif -#ifndef XOTclDeleteClass -#define XOTclDeleteClass \ - (xotclStubsPtr->xOTclDeleteClass) /* 10 */ -#endif -#ifndef XOTclAddPMethod -#define XOTclAddPMethod \ - (xotclStubsPtr->xOTclAddPMethod) /* 11 */ -#endif -#ifndef XOTclAddIMethod -#define XOTclAddIMethod \ - (xotclStubsPtr->xOTclAddIMethod) /* 12 */ -#endif -#ifndef XOTclRemovePMethod -#define XOTclRemovePMethod \ - (xotclStubsPtr->xOTclRemovePMethod) /* 13 */ -#endif -#ifndef XOTclRemoveIMethod -#define XOTclRemoveIMethod \ - (xotclStubsPtr->xOTclRemoveIMethod) /* 14 */ -#endif -#ifndef XOTclOSetInstVar -#define XOTclOSetInstVar \ - (xotclStubsPtr->xOTclOSetInstVar) /* 15 */ -#endif -#ifndef XOTclOGetInstVar -#define XOTclOGetInstVar \ - (xotclStubsPtr->xOTclOGetInstVar) /* 16 */ -#endif -#ifndef XOTclInstVar -#define XOTclInstVar \ - (xotclStubsPtr->xOTclInstVar) /* 17 */ -#endif -/* Slot 18 is reserved */ -#ifndef XOTclOSetInstVar2 -#define XOTclOSetInstVar2 \ - (xotclStubsPtr->xOTclOSetInstVar2) /* 19 */ -#endif -#ifndef XOTclOGetInstVar2 -#define XOTclOGetInstVar2 \ - (xotclStubsPtr->xOTclOGetInstVar2) /* 20 */ -#endif -#ifndef XOTclUnsetInstVar2 -#define XOTclUnsetInstVar2 \ - (xotclStubsPtr->xOTclUnsetInstVar2) /* 21 */ -#endif -#ifndef XOTcl_TraceObjCmd -#define XOTcl_TraceObjCmd \ - (xotclStubsPtr->xOTcl_TraceObjCmd) /* 22 */ -#endif -#ifndef XOTclErrMsg -#define XOTclErrMsg \ - (xotclStubsPtr->xOTclErrMsg) /* 23 */ -#endif -#ifndef XOTclVarErrMsg -#define XOTclVarErrMsg \ - (xotclStubsPtr->xOTclVarErrMsg) /* 24 */ -#endif -#ifndef XOTclErrInProc -#define XOTclErrInProc \ - (xotclStubsPtr->xOTclErrInProc) /* 25 */ -#endif -#ifndef XOTclObjErrArgCnt -#define XOTclObjErrArgCnt \ - (xotclStubsPtr->xOTclObjErrArgCnt) /* 26 */ -#endif -#ifndef XOTclErrBadVal_ -#define XOTclErrBadVal_ \ - (xotclStubsPtr->xOTclErrBadVal_) /* 27 */ -#endif -#ifndef XOTclObjErrType -#define XOTclObjErrType \ - (xotclStubsPtr->xOTclObjErrType) /* 28 */ -#endif -#ifndef XOTclStackDump -#define XOTclStackDump \ - (xotclStubsPtr->xOTclStackDump) /* 29 */ -#endif -#ifndef XOTclCallStackDump -#define XOTclCallStackDump \ - (xotclStubsPtr->xOTclCallStackDump) /* 30 */ -#endif -#ifndef XOTclDeprecatedMsg -#define XOTclDeprecatedMsg \ - (xotclStubsPtr->xOTclDeprecatedMsg) /* 31 */ -#endif -#ifndef XOTclSetObjClientData -#define XOTclSetObjClientData \ - (xotclStubsPtr->xOTclSetObjClientData) /* 32 */ -#endif -#ifndef XOTclGetObjClientData -#define XOTclGetObjClientData \ - (xotclStubsPtr->xOTclGetObjClientData) /* 33 */ -#endif -#ifndef XOTclSetClassClientData -#define XOTclSetClassClientData \ - (xotclStubsPtr->xOTclSetClassClientData) /* 34 */ -#endif -#ifndef XOTclGetClassClientData -#define XOTclGetClassClientData \ - (xotclStubsPtr->xOTclGetClassClientData) /* 35 */ -#endif -#ifndef XOTclRequireObjNamespace -#define XOTclRequireObjNamespace \ - (xotclStubsPtr->xOTclRequireObjNamespace) /* 36 */ -#endif -#ifndef XOTclErrBadVal -#define XOTclErrBadVal \ - (xotclStubsPtr->xOTclErrBadVal) /* 37 */ -#endif -#ifndef XOTclNextObjCmd -#define XOTclNextObjCmd \ - (xotclStubsPtr->xOTclNextObjCmd) /* 38 */ -#endif -#ifndef XOTclCallMethodWithArgs -#define XOTclCallMethodWithArgs \ - (xotclStubsPtr->xOTclCallMethodWithArgs) /* 39 */ -#endif - -#endif /* defined(USE_XOTCL_STUBS) && !defined(USE_XOTCL_STUB_PROCS) */ - -/* !END!: Do not edit above this line. */ - -#endif /* _XOTCLDECLS */ - Index: xotcl/generic/xotclError.c =================================================================== diff -u -N --- xotcl/generic/xotclError.c (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/generic/xotclError.c (revision 0) @@ -1,102 +0,0 @@ -/* -*- Mode: c++ -*- - * $Id: xotclError.c,v 1.5 2006/09/27 08:12:40 neumann Exp $ - * - * Extended Object Tcl (XOTcl) - * - * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun - * - * - * xotclError.c -- - * - * error return functions for XOTcl - * - */ - -#include "xotclInt.h" - -int -XOTclErrMsg(Tcl_Interp *in, char *msg, Tcl_FreeProc* type) { - Tcl_SetResult(in, msg, type); - return TCL_ERROR; -} - -int -XOTclVarErrMsg TCL_VARARGS_DEF (Tcl_Interp *, arg1) -{ - va_list argList; - char *string; - Tcl_Interp *in; - - in = TCL_VARARGS_START(Tcl_Interp *, arg1, argList); - Tcl_ResetResult(in); - while (1) { - string = va_arg(argList, char *); - if (string == NULL) { - break; - } - Tcl_AppendResult(in, string, (char *) NULL); - } - va_end(argList); - return TCL_ERROR; -} - - -int -XOTclErrInProc (Tcl_Interp *in, Tcl_Obj *objName, - Tcl_Obj *clName, char *procName) { - Tcl_DString errMsg; - char *cName, *space; - ALLOC_DSTRING(&errMsg, "\n "); - if (clName) { - cName = ObjStr(clName); - space = " "; - } else { - cName = ""; - space =""; - } - Tcl_DStringAppend(&errMsg, ObjStr(objName),-1); - Tcl_DStringAppend(&errMsg, space, -1); - Tcl_DStringAppend(&errMsg, cName, -1); - Tcl_DStringAppend(&errMsg, "->", 2); - Tcl_DStringAppend(&errMsg, procName, -1); - Tcl_AddErrorInfo (in, Tcl_DStringValue(&errMsg)); - DSTRING_FREE(&errMsg); - return TCL_ERROR; -} - -int -XOTclObjErrArgCnt(Tcl_Interp *in, Tcl_Obj *cmdname, char *arglist) { - Tcl_ResetResult(in); - Tcl_AppendResult(in, "wrong # args: should be {", (char *) NULL); - if (cmdname) { - Tcl_AppendResult(in, ObjStr(cmdname), " ", (char *) NULL); - } - if (arglist != 0) Tcl_AppendResult(in, arglist, (char *) NULL); - Tcl_AppendResult(in, "}", (char *) NULL); - return TCL_ERROR; -} - -int -XOTclErrBadVal(Tcl_Interp *in, char *context, char *expected, char *value) { - Tcl_ResetResult(in); - Tcl_AppendResult(in, context, ": expected ", expected, " but got '", - value, "'", (char *) NULL); - return TCL_ERROR; -} - -int -XOTclErrBadVal_(Tcl_Interp *in, char *expected, char *value) { - fprintf(stderr, "Deprecated call, recompile your program with xotcl 1.5 or newer\n"); - Tcl_ResetResult(in); - Tcl_AppendResult(in, ": expected ", expected, " but got '", - value, "'", (char *) NULL); - return TCL_ERROR; -} - -extern int -XOTclObjErrType(Tcl_Interp *in, Tcl_Obj *nm, char *wt) { - Tcl_ResetResult(in); - Tcl_AppendResult(in,"'",ObjStr(nm), "' method should be called on '", - wt, "'", (char *) NULL); - return TCL_ERROR; -} Index: xotcl/generic/xotclInt.decls =================================================================== diff -u -N --- xotcl/generic/xotclInt.decls (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/generic/xotclInt.decls (revision 0) @@ -1,118 +0,0 @@ -# xotclInt.decls -- -# -# This file contains the declarations for all unsupported -# functions that are exported by the Tcl library. This file -# is used to generate the itclIntDecls.h and itclIntStub.c -# files -# -# Copyright (c) 1998-1999 by Scriptics Corporation. -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: xotclInt.decls,v 1.1 2004/05/23 22:50:39 neumann Exp $ - -library xotcl - -# Define the unsupported generic interfaces. - -interface xotclInt - - -# -# Functions used within the package, but not considered "public" -# - -#declare 0 generic { - -#} -#declare 1 generic { - -#} -# declare 2 generic { -# int XOTclErrInProc (Tcl_Interp *in, Tcl_Obj* objName, -# Tcl_Obj* clName, char* procName) -# } -# declare 3 generic { -# int XOTclObjErrArgCnt(Tcl_Interp *in, Tcl_Obj *cmdname, char *arglist) -# } -# declare 4 generic { -# int XOTclErrBadVal(Tcl_Interp *in, char *expected, char *value) -# } -# declare 5 generic { -# int XOTclObjErrType(Tcl_Interp *in, Tcl_Obj *nm, char* wt) -# } -# declare 6 generic { -# void XOTclStackTrace (Tcl_Interp* in) -# } -# declare 7 generic { -# void XOTclCallStackTrace (Tcl_Interp* in) -# } -#declare 8 generic { -# void XOTclFilterTrace (Tcl_Interp* in) -#} -#declare 9 generic { -# int XOTclIsType(XOTclObject* obj, XOTclClass* type) -#} -#declare 10 generic { -# void XOTclRemoveClasses(XOTclClasses* sl) -#} -# declare 11 generic { -# XOTclClasses** XOTclAddClass(XOTclClasses** cList, XOTclClass* cl, ClientData cd) -# } -# declare 12 generic { -# XOTclClasses* XOTclComputePrecedence(register XOTclClass* cl) -# } -# declare 13 generic { -# XOTclClasses* XOTclComputeDependents(register XOTclClass* cl) -# } -# declare 14 generic { -# void XOTclDeprecatedMsg(char* oldCmd, char* newCmd) -# } -# declare 15 generic { -# void XOTclSetObjClientData(XOTclObject* obj, ClientData data) -# } -# declare 16 generic { -# ClientData XOTclGetObjClientData(XOTclObject* obj) -# } -# declare 17 generic { -# void XOTclSetClassClientData(XOTclClass* cl, ClientData data) -# } -# declare 18 generic { -# ClientData XOTclGetClassClientData(XOTclClass* cl) -# } -# declare 19 generic { -# void XOTclRequireObjectOpt(XOTclObject* obj) -# } -# declare 20 generic { -# void XOTclRequireClassOpt(XOTclClass* cl) -# } -# declare 21 generic { -# void XOTclRequireObjNamespace(Tcl_Interp* in, XOTclObject* obj) -# } -# declare 22 generic { - -# } -# declare 23 generic { - -# } -# declare 24 generic { - -# } -# declare 25 generic { - -# } -# declare 26 generic { - -# } -# declare 27 generic { - -# } -# declare 28 generic { - -# } -# declare 29 generic { - -# } -# declare 30 generic { - -# } Index: xotcl/generic/xotclInt.h =================================================================== diff -u -N --- xotcl/generic/xotclInt.h (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/generic/xotclInt.h (revision 0) @@ -1,775 +0,0 @@ -/* -*- Mode: c++ -*- - * $Id: xotclInt.h,v 1.27 2007/10/12 19:53:32 neumann Exp $ - * Extended Object Tcl (XOTcl) - * - * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun - * - * xotclInt.h -- - * - * Mostly internally used API Functions - */ - -#ifndef _xotcl_int_h_ -#define _xotcl_int_h_ - -#include -#include "xotcl.h" - -#include -#include -#include - -#if defined(PROFILE) -# include -#endif - -#ifdef DMALLOC -# include "dmalloc.h" -#endif - -#ifdef BUILD_xotcl -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLEXPORT -#endif - -/* -#define XOTCL_METADATA -*/ - -/* - * Makros - */ -#if defined(PRE85) -# define TclVarHashTable Tcl_HashTable -#endif - -#ifdef XOTCL_MEM_COUNT -Tcl_HashTable xotclMemCount; -extern int xotclMemCountInterpCounter; -typedef struct XOTclMemCounter { - int peak; - int count; -} XOTclMemCounter; -# define MEM_COUNT_ALLOC(id,p) XOTclMemCountAlloc(id,p) -# define MEM_COUNT_FREE(id,p) XOTclMemCountFree(id,p) -# define MEM_COUNT_INIT() \ - if (xotclMemCountInterpCounter == 0) { \ - Tcl_InitHashTable(&xotclMemCount, TCL_STRING_KEYS); \ - xotclMemCountInterpCounter = 1; \ - } -# define MEM_COUNT_DUMP() XOTclMemCountDump(in) -# define MEM_COUNT_OPEN_FRAME() -/*if (obj->varTable) noTableBefore = 0*/ -# define MEM_COUNT_CLOSE_FRAME() -/* if (obj->varTable && noTableBefore) \ - XOTclMemCountAlloc("obj->varTable",NULL)*/ -#else -# define MEM_COUNT_ALLOC(id,p) -# define MEM_COUNT_FREE(id,p) -# define MEM_COUNT_INIT() -# define MEM_COUNT_DUMP() -# define MEM_COUNT_OPEN_FRAME() -# define MEM_COUNT_CLOSE_FRAME() -#endif - -#define DSTRING_INIT(D) Tcl_DStringInit(D); MEM_COUNT_ALLOC("DString",D) -#define DSTRING_FREE(D) Tcl_DStringFree(D); MEM_COUNT_FREE("DString",D) - -#if USE_ASSOC_DATA -# define RUNTIME_STATE(in) ((XOTclRuntimeState*)Tcl_GetAssocData((in), "XOTclRuntimeState", NULL)) -#else -# define RUNTIME_STATE(in) ((XOTclRuntimeState*)((Interp*) in)->globalNsPtr->clientData) -#endif - - -#define ALLOC_NAME_NS(DSP, NS, NAME) \ - DSTRING_INIT(DSP);\ - Tcl_DStringAppend(DSP, NS, -1),\ - Tcl_DStringAppend(DSP, "::", 2),\ - Tcl_DStringAppend(DSP, NAME, -1) -#define ALLOC_TOP_NS(DSP, NAME) \ - DSTRING_INIT(DSP);\ - Tcl_DStringAppend(DSP, "::", 2),\ - Tcl_DStringAppend(DSP, NAME, -1) -#define ALLOC_DSTRING(DSP,ENTRY) \ - DSTRING_INIT(DSP);\ - Tcl_DStringAppend(DSP, ENTRY, -1) - -#define nr_elements(arr) ((int) (sizeof(arr) / sizeof(arr[0]))) - -# define NEW(type) \ - (type *)ckalloc(sizeof(type)); MEM_COUNT_ALLOC(#type, NULL) -# define NEW_ARRAY(type,n) \ - (type *)ckalloc(sizeof(type)*(n)); MEM_COUNT_ALLOC(#type "*", NULL) -# define FREE(type, var) \ - ckfree((char*) var); MEM_COUNT_FREE(#type,var) - -#define isAbsolutePath(m) (*m == ':' && m[1] == ':') -#define isArgsString(m) (\ - *m == 'a' && m[1] == 'r' && m[2] == 'g' && m[3] == 's' && \ - m[4] == '\0') -#define isDoubleDashString(m) (\ - *m == '-' && m[1] == '-' && m[2] == '\0') -#define isBodyString(m) (\ - *m == 'b' && m[1] == 'o' && m[2] == 'd' && m[3] == 'y' && \ - m[4] == '\0') -#define isClassString(m) (\ - *m == 'c' && m[1] == 'l' && m[2] == 'a' && m[3] == 's' && \ - m[4] == 's' && m[5] == '\0') -#define isCheckString(m) (\ - *m == 'c' && m[1] == 'h' && m[2] == 'e' && m[3] == 'c' && \ - m[4] == 'k' && m[5] == '\0') -#define isCheckObjString(m) (\ - *m == 'c' && m[1] == 'h' && m[2] == 'e' && m[3] == 'c' && \ - m[4] == 'k' && m[5] == 'o' && m[6] == 'b' && m[7] == 'j' && \ - m[8] == '\0') -#define isCreateString(m) (\ - *m == 'c' && m[1] == 'r' && m[2] == 'e' && m[3] == 'a' && \ - m[4] == 't' && m[5] == 'e' && m[6] == '\0') -#define isAllocString(m) (\ - *m == 'a' && m[1] == 'l' && m[2] == 'l' && m[3] == 'o' && \ - m[4] == 'c' && m[5] == '\0') -#define isDestroyString(m) (\ - *m == 'd' && m[1] == 'e' && m[2] == 's' && m[3] == 't' && \ - m[4] == 'r' && m[5] == 'o' && m[6] == 'y' && m[7] == '\0') -#define isInstDestroyString(m) (\ - *m == 'i' && m[1] == 'n' && m[2] == 's' && m[3] == 't' && \ - m[4] == 'd' && m[5] == 'e' && m[6] == 's' && m[7] == 't' && \ - m[8] == 'r' && m[9] == 'o' && m[10] == 'y' && m[11] == '\0') -#define isInitString(m) (\ - *m == 'i' && m[1] == 'n' && m[2] == 'i' && m[3] == 't' && \ - m[4] == '\0') -#define isInfoString(m) (\ - *m == 'i' && m[1] == 'n' && m[2] == 'f' && m[3] == 'o' && \ - m[4] == '\0') -#ifdef AUTOVARS -# define isNextString(m) (\ - *m == 'n' && m[1] == 'e' && m[2] == 'x' && m[3] == 't' && \ - m[4] == '\0') -#endif -#define isInstinvarString(m) (\ - *m == 'i' && m[1] == 'n' && m[2] == 's' && m[3] == 't' && \ - m[4] == 'i' && m[5] == 'n' && m[6] == 'v' && m[7] == 'a' && \ - m[8] == 'r' && m[9] == '\0') -#define isInvarString(m) (\ - *m == 'i' && m[1] == 'n' && m[2] == 'v' && m[3] == 'a' && \ - m[4] == 'r' && m[5] == '\0') -#define isInstprocString(m) (\ - *m == 'i' && m[1] == 'n' && m[2] == 's' && m[3] == 't' && \ - m[4] == 'p' && m[5] == 'r' && m[6] == 'o' && m[7] == 'c' && \ - m[8] == '\0') -#define isProcString(m) (\ - *m == 'p' && m[1] == 'r' && m[2] == 'o' && m[3] == 'c' && \ - m[4] == '\0') - -#if (defined(sun) || defined(__hpux)) && !defined(__GNUC__) -# define USE_ALLOCA -#endif - -#if defined(__IBMC__) && !defined(__GNUC__) -# if __IBMC__ >= 0x0306 -# define USE_ALLOCA -# else -# define USE_MALLOC -# endif -#endif - -#if defined(VISUAL_CC) -# define USE_MALLOC -#endif - -#if defined(__GNUC__) && !defined(USE_ALLOCA) && !defined(USE_MALLOC) -# if !defined(NDEBUG) -# define ALLOC_ON_STACK(type,n,var) \ - int __##var##_count = (n); type __##var[n+2]; \ - type *var = __##var + 1; var[-1] = var[__##var##_count] = (type)0xdeadbeaf -# define FREE_ON_STACK(var) \ - assert(var[-1] == var[__##var##_count] && (void *)var[-1] == (void*)0xdeadbeaf) -# else -# define ALLOC_ON_STACK(type,n,var) type var[(n)] -# define FREE_ON_STACK(var) -# endif -#elif defined(USE_ALLOCA) -# define ALLOC_ON_STACK(type,n,var) type *var = (type *)alloca((n)*sizeof(type)) -# define FREE_ON_STACK(var) -#else -# define ALLOC_ON_STACK(type,n,var) type *var = (type *)ckalloc((n)*sizeof(type)) -# define FREE_ON_STACK(var) ckfree((char*)var) -#endif - -#ifdef USE_ALLOCA -# include -#endif - -#ifdef __WIN32__ -# define XOTCLINLINE -# define XOTclNewObj(A) A=Tcl_NewObj() -# define DECR_REF_COUNT(A) \ - MEM_COUNT_FREE("INCR_REF_COUNT",A); Tcl_DecrRefCount(A) -#else -/* - * This was defined to be inline for anything !sun or __IBMC__ >= 0x0306, - * but __hpux should also be checked - switched to only allow in gcc - JH - */ -# if defined(__GNUC__) -# define XOTCLINLINE inline -# else -# define XOTCLINLINE -# endif -# ifdef USE_TCL_STUBS -# define XOTclNewObj(A) A=Tcl_NewObj() -# define DECR_REF_COUNT(A) \ - MEM_COUNT_FREE("INCR_REF_COUNT",A); assert((A)->refCount > -1); \ - Tcl_DecrRefCount(A) -# else -# define XOTclNewObj(A) TclNewObj(A) -# define DECR_REF_COUNT(A) \ - MEM_COUNT_FREE("INCR_REF_COUNT",A); TclDecrRefCount(A) -# endif -#endif - -#if !defined(PRE83) && defined(TCL_THREADS) -# define XOTclMutex Tcl_Mutex -# define XOTclMutexLock(a) Tcl_MutexLock(a) -# define XOTclMutexUnlock(a) Tcl_MutexUnlock(a) -#else -# define XOTclMutex int -# define XOTclMutexLock(a) (*(a))++ -# define XOTclMutexUnlock(a) (*(a))-- -#endif - -#if defined(PRE84) -# define CONST84 -#else -# define CONST84 CONST -#endif - -#if defined(PRE81) -# define ObjStr(obj) Tcl_GetStringFromObj(obj, ((int*)NULL)) -#else -# define ObjStr(obj) (obj)->bytes ? (obj)->bytes : Tcl_GetString(obj) -/*# define ObjStr(obj) Tcl_GetString(obj) */ -#endif - -#ifdef V81 -# define EvalObj(in,cmd) Tcl_EvalObj(in,cmd,0) -# define TclIsVarArgument(args) (args->isArg) -# define Tcl_ObjSetVar2(in,p1,p2,newval,flags) \ - Tcl_SetObjVar2(in,ObjStr(p1),p2,newval,flags) -#define Tcl_ObjGetVar2(in,name1,name2,flgs) \ - Tcl_GetObjVar2(in, ObjStr(name1), \ - ((name2==NULL) ? (char*)NULL : ObjStr(name2)), flgs) -#else -# if defined(PRE83) -# define EvalObj(in,cmd) Tcl_EvalObj(in,cmd) -# else -# define EvalObj(in,cmd) Tcl_EvalObjEx(in,cmd,0) -# endif -# if defined(PRE81) && TCL_RELEASE_SERIAL<3 -# define TclIsVarArgument(args) (args->isArg) -# endif -#endif - -#if 0 -#define XOTcl_FrameDecls CallFrame *oldFramePtr = 0, frame, *newFramePtr = &frame -#define XOTcl_PushFrame(in,obj) \ - memset(newFramePtr, 0, sizeof(CallFrame)); \ - oldFramePtr = ((Interp *)in)->varFramePtr; \ - if ((obj)->nsPtr) { \ - newFramePtr->nsPtr = (Namespace*) (obj)->nsPtr; \ - } else { \ - newFramePtr->nsPtr = (Namespace*) RUNTIME_STATE(in)->fakeNS; \ - newFramePtr->isProcCallFrame = 1; \ - newFramePtr->procPtr = &RUNTIME_STATE(in)->fakeProc; \ - newFramePtr->varTablePtr = (obj)->varTable; \ - } \ - ((Interp *)in)->varFramePtr = newFramePtr; \ - MEM_COUNT_OPEN_FRAME() -#define XOTcl_PopFrame(in,obj) \ - if (!(obj)->nsPtr && (obj)->varTable == 0) \ - (obj)->varTable = newFramePtr->varTablePtr; \ - ((Interp *)in)->varFramePtr = oldFramePtr; \ - MEM_COUNT_CLOSE_FRAME() - -#else -/* slightly slower version based on Tcl_PushCallFrame. - Note that it is possible that between push and pop - a obj->nsPtr can be created (e.g. during a read trace) -*/ -#define XOTcl_FrameDecls TclCallFrame frame, *framePtr = &frame; int frame_constructed = 1 -#define XOTcl_PushFrame(interp,obj) \ - if ((obj)->nsPtr) { \ - frame_constructed = 0; \ - Tcl_PushCallFrame(interp, (Tcl_CallFrame*)framePtr, (obj)->nsPtr, 0); \ - } else { \ - CallFrame *myframe = (CallFrame *)framePtr; \ - Tcl_PushCallFrame(interp, (Tcl_CallFrame*)framePtr, RUNTIME_STATE(interp)->fakeNS, 1); \ - Tcl_CallFrame_procPtr(myframe) = &RUNTIME_STATE(interp)->fakeProc; \ - Tcl_CallFrame_varTablePtr(myframe) = (obj)->varTable; \ - } -#define XOTcl_PopFrame(interp,obj) \ - if (!(obj)->nsPtr) { \ - CallFrame *myframe = (CallFrame *)framePtr; \ - if ((obj)->varTable == 0) \ - (obj)->varTable = Tcl_CallFrame_varTablePtr(myframe); \ - } \ - if (frame_constructed) { \ - Interp *iPtr = (Interp *) interp; \ - register CallFrame *myframe = iPtr->framePtr; \ - Tcl_CallFrame_varTablePtr(myframe) = 0; \ - Tcl_CallFrame_procPtr(myframe) = 0; \ - } \ - Tcl_PopCallFrame(interp) -#endif - - -#define INCR_REF_COUNT(A) MEM_COUNT_ALLOC("INCR_REF_COUNT",A); Tcl_IncrRefCount(A) - -#ifdef OBJDELETION_TRACE -# define PRINTOBJ(ctx,obj) \ - fprintf(stderr, " %s %p %s oid=%p teardown=%p destroyCalled=%d\n", \ - ctx,obj,ObjStr(obj->cmdName), obj->id, obj->teardown, \ - (obj->flags & XOTCL_DESTROY_CALLED)) -#else -# define PRINTOBJ(ctx,obj) -#endif - -#define className(cl) (cl ? ObjStr(cl->object.cmdName) : "") - - -#define LONG_AS_STRING 32 - -/* TCL_CONTINUE is defined as 4, from 5 on we can - use app-specific return codes */ -#define XOTCL_CHECK_FAILED 6 - -/* flags for call method */ -#define XOTCL_CM_NO_FILTERS 1 -#define XOTCL_CM_NO_UNKNOWN 2 - -/* - * - * XOTcl Structures - * - */ - -/* - * Filter structures - */ -typedef struct XOTclFilterStack { - Tcl_Command currentCmdPtr; - Tcl_Obj* calledProc; - struct XOTclFilterStack* next; -} XOTclFilterStack; - -typedef struct XOTclTclObjList { - Tcl_Obj* content; - struct XOTclTclObjList* next; -} XOTclTclObjList; - -/* - * Assertion structures - */ - -typedef struct XOTclProcAssertion { - XOTclTclObjList* pre; - XOTclTclObjList* post; -} XOTclProcAssertion; - -typedef struct XOTclAssertionStore { - XOTclTclObjList* invariants; - Tcl_HashTable procs; -} XOTclAssertionStore; - -typedef enum { /* powers of 2; add to ALL, if default; */ - CHECK_NONE = 0, CHECK_CLINVAR = 1, CHECK_OBJINVAR = 2, - CHECK_PRE = 4, CHECK_POST = 8, - CHECK_INVAR = CHECK_CLINVAR + CHECK_OBJINVAR, - CHECK_ALL = CHECK_INVAR + CHECK_PRE + CHECK_POST -} CheckOptions; - -void XOTclAssertionRename(Tcl_Interp* in, Tcl_Command cmd, - XOTclAssertionStore *as, - char *oldSimpleCmdName, char *newName); -/* - * mixins - */ -typedef struct XOTclMixinStack { - Tcl_Command currentCmdPtr; - struct XOTclMixinStack* next; -} XOTclMixinStack; - -/* - * Generic command pointer list - */ -typedef struct XOTclCmdList { - Tcl_Command cmdPtr; - ClientData clientData; - struct XOTclClass *clorobj; - struct XOTclCmdList* next; -} XOTclCmdList; - -typedef void (XOTclFreeCmdListClientData) _ANSI_ARGS_((XOTclCmdList*)); - -/* for incr string */ -typedef struct XOTclStringIncrStruct { - char *buffer; - char *start; - size_t bufSize; - int length; -} XOTclStringIncrStruct; - -/* - * object flags ... - */ - -/* DESTROY_CALLED indicates that destroy was called on obj */ -#define XOTCL_DESTROY_CALLED 0x0001 -/* INIT_CALLED indicates that init was called on obj */ -#define XOTCL_INIT_CALLED 0x0002 -/* MIXIN_ORDER_VALID set when mixin order is valid */ -#define XOTCL_MIXIN_ORDER_VALID 0x0004 -/* MIXIN_ORDER_DEFINED set, when mixins are defined for obj */ -#define XOTCL_MIXIN_ORDER_DEFINED 0x0008 -#define XOTCL_MIXIN_ORDER_DEFINED_AND_VALID 0x000c -/* FILTER_ORDER_VALID set, when filter order is valid */ -#define XOTCL_FILTER_ORDER_VALID 0x0010 -/* FILTER_ORDER_DEFINED set, when filters are defined for obj */ -#define XOTCL_FILTER_ORDER_DEFINED 0x0020 -#define XOTCL_FILTER_ORDER_DEFINED_AND_VALID 0x0030 -/* IS_CLASS set, when object is a class */ -#define XOTCL_IS_CLASS 0x0040 -/* DESTROYED set, when object is physically destroyed with PrimitiveODestroy */ -#define XOTCL_DESTROYED 0x0080 -#define XOTCL_REFCOUNTED 0x0100 -#define XOTCL_RECREATE 0x0200 -#define XOTCL_NS_DESTROYED 0x0400 - -#define XOTclObjectSetClass(obj) \ - (obj)->flags |= XOTCL_IS_CLASS -#define XOTclObjectIsClass(obj) \ - ((obj)->flags & XOTCL_IS_CLASS) -#define XOTclObjectToClass(obj) \ - (XOTclClass*)((((XOTclObject*)obj)->flags & XOTCL_IS_CLASS)?obj:0) - - -/* - * object and class internals - */ - -typedef struct XOTclNonposArgs { - Tcl_Obj* nonposArgs; - Tcl_Obj* ordinaryArgs; -} XOTclNonposArgs; - -typedef struct XOTclObjectOpt { - XOTclAssertionStore *assertions; - XOTclCmdList* filters; - XOTclCmdList* mixins; -#ifdef XOTCL_METADATA - Tcl_HashTable metaData; -#endif - ClientData clientData; - char *volatileVarName; - short checkoptions; -} XOTclObjectOpt; - -typedef struct XOTclObject { - Tcl_Obj *cmdName; - Tcl_Command id; - Tcl_Interp *teardown; - struct XOTclClass *cl; - TclVarHashTable *varTable; - Tcl_Namespace *nsPtr; - XOTclObjectOpt *opt; - struct XOTclCmdList *filterOrder; - struct XOTclCmdList *mixinOrder; - XOTclFilterStack *filterStack; - XOTclMixinStack *mixinStack; - int refCount; - short flags; - Tcl_HashTable *nonposArgsTable; -} XOTclObject; - -typedef struct XOTclClassOpt { - XOTclCmdList* instfilters; - XOTclCmdList* instmixins; - XOTclAssertionStore *assertions; - Tcl_Obj* parameterClass; -#ifdef XOTCL_OBJECTDATA - Tcl_HashTable* objectdata; -#endif - ClientData clientData; -} XOTclClassOpt; - -typedef struct XOTclClass { - struct XOTclObject object; - struct XOTclClasses* super; - struct XOTclClasses* sub; - short color; - struct XOTclClasses* order; - struct XOTclClass* parent; - Tcl_HashTable instances; - Tcl_Namespace *nsPtr; - Tcl_Obj* parameters; - XOTclClassOpt* opt; - Tcl_HashTable *nonposArgsTable; -} XOTclClass; - -typedef struct XOTclClasses { - struct XOTclClass* cl; - ClientData clientData; - struct XOTclClasses* next; -} XOTclClasses; - -/* XOTcl global names and strings */ -/* these are names and contents for global (corresponding) Tcl_Objs - and Strings - otherwise these "constants" would have to be built - every time they are used; now they are built once in XOTcl_Init */ -typedef enum { - XOTE_EMPTY, XOTE_UNKNOWN, XOTE_CREATE, XOTE_DESTROY, XOTE_INSTDESTROY, - XOTE_ALLOC, XOTE_INIT, XOTE_INSTVAR, XOTE_INTERP, XOTE_AUTONAMES, - XOTE_ZERO, XOTE_ONE, XOTE_MOVE, XOTE_SELF, XOTE_CLASS, XOTE_RECREATE, - XOTE_SELF_CLASS, XOTE_SELF_PROC, XOTE_PARAM_CL, - XOTE_SEARCH_DEFAULTS, XOTE_EXIT_HANDLER, - XOTE_NON_POS_ARGS_CL, XOTE_NON_POS_ARGS_OBJ, - XOTE_CLEANUP, XOTE_CONFIGURE, XOTE_FILTER, XOTE_INSTFILTER, - XOTE_INSTPROC, XOTE_PROC, XOTE_INSTFORWARD, XOTE_FORWARD, - XOTE_INSTCMD, XOTE_CMD, XOTE_INSTPARAMETERCMD, XOTE_PARAMETERCMD, - XOTE_MKGETTERSETTER, XOTE_FORMAT, - XOTE_NEWOBJ, XOTE_GUARD_OPTION, XOTE_DEFAULTMETHOD, - XOTE___UNKNOWN, XOTE_ARGS, XOTE_SPLIT, XOTE_COMMA, - /** these are the redefined tcl commands; leave them - together at the end */ - XOTE_EXPR, XOTE_INFO, XOTE_RENAME, XOTE_SUBST -} XOTclGlobalNames; -#if !defined(XOTCL_C) -extern char *XOTclGlobalStrings[]; -#else -char *XOTclGlobalStrings[] = { - "", "unknown", "create", "destroy", "instdestroy", - "alloc", "init", "instvar", "interp", "__autonames", - "0", "1", "move", "self", "class", "recreate", - "self class", "self proc", "::xotcl::Class::Parameter", - "searchDefaults", "__exitHandler", - "::xotcl::NonposArgs", "::xotcl::nonposArgs", - "cleanup", "configure", "filter", "instfilter", - "instproc", "proc", "instforward", "forward", - "instcmd", "cmd", "instparametercmd", "parametercmd", - "mkGetterSetter", "format", - "__#", "-guard", "defaultmethod", - "__unknown", "args", "split", ",", - "expr", "info", "rename", "subst", -}; -#endif - -#define XOTclGlobalObjects RUNTIME_STATE(in)->methodObjNames - -/* XOTcl ShadowTclCommands */ -typedef struct XOTclShadowTclCommandInfo { - TclObjCmdProcType proc; - ClientData cd; -} XOTclShadowTclCommandInfo; -typedef enum {SHADOW_LOAD=1, SHADOW_UNLOAD=0, SHADOW_REFETCH=2} XOTclShadowOperations; - -int XOTclCallCommand(Tcl_Interp* in, XOTclGlobalNames name, - int objc, Tcl_Obj *CONST objv[]); -int XOTclShadowTclCommands(Tcl_Interp* in, XOTclShadowOperations load); - - -/* - * XOTcl CallStack - */ -typedef struct XOTclCallStackContent { - XOTclObject *self; - XOTclClass *cl; - Tcl_Command cmdPtr; - Tcl_Command destroyedCmd; - Tcl_CallFrame *currentFramePtr; - unsigned short frameType; - unsigned short callType; - XOTclFilterStack *filterStackEntry; -} XOTclCallStackContent; - -#define XOTCL_CSC_TYPE_PLAIN 0 -#define XOTCL_CSC_TYPE_ACTIVE_MIXIN 1 -#define XOTCL_CSC_TYPE_ACTIVE_FILTER 2 -#define XOTCL_CSC_TYPE_INACTIVE 4 -#define XOTCL_CSC_TYPE_INACTIVE_MIXIN 5 -#define XOTCL_CSC_TYPE_INACTIVE_FILTER 6 -#define XOTCL_CSC_TYPE_GUARD 16 - -#define XOTCL_CSC_CALL_IS_NEXT 1 -#define XOTCL_CSC_CALL_IS_DESTROY 2 - -typedef struct XOTclCallStack { - XOTclCallStackContent content[MAX_NESTING_DEPTH]; - XOTclCallStackContent *top; - short guardCount; -} XOTclCallStack; - -#if defined(PROFILE) -typedef struct XOTclProfile { - long int overallTime; - Tcl_HashTable objectData; - Tcl_HashTable methodData; -} XOTclProfile; -#endif - -typedef struct XOTclRuntimeState { - XOTclCallStack cs; - Tcl_Namespace *XOTclClassesNS; - Tcl_Namespace *XOTclNS; - /* - * definitions of the main xotcl objects - */ - XOTclClass *theObject; - XOTclClass *theClass; -#if USE_INTERP_PROC - Tcl_CmdProc *interpProc; -#endif - Tcl_ObjCmdProc *objInterpProc; - Tcl_Obj **methodObjNames; - struct XOTclShadowTclCommandInfo *tclCommands; - int errorCount; - /* these flags could move into a bitarray, but are used only once per interp*/ - int callDestroy; - int callIsDestroy; - int unknown; - int doFilters; - int doSoftrecreate; - int exitHandlerDestroyRound; - int returnCode; - long newCounter; - XOTclStringIncrStruct iss; - Proc fakeProc; - Tcl_Namespace *fakeNS; - XotclStubs *xotclStubs; - Tcl_CallFrame *varFramePtr; - Command *cmdPtr; -#if defined(PROFILE) - XOTclProfile profile; -#endif - ClientData clientData; -} XOTclRuntimeState; - -#define XOTCL_EXITHANDLER_OFF 0 -#define XOTCL_EXITHANDLER_ON_SOFT_DESTROY 1 -#define XOTCL_EXITHANDLER_ON_PHYSICAL_DESTROY 2 - - -#ifdef XOTCL_OBJECTDATA -extern void -XOTclSetObjectData(struct XOTclObject* obj, struct XOTclClass* cl, - ClientData data); -extern int -XOTclGetObjectData(struct XOTclObject* obj, struct XOTclClass* cl, - ClientData* data); -extern int -XOTclUnsetObjectData(struct XOTclObject* obj, struct XOTclClass* cl); -extern void -XOTclFreeObjectData(XOTclClass* cl); -#endif - -/* - * - * internally used API functions - * - */ - -#include "xotclIntDecls.h" - -/* - * Profiling functions - */ - -#if defined(PROFILE) -extern void -XOTclProfileFillTable(Tcl_HashTable* table, Tcl_DString* key, - double totalMicroSec); -extern void -XOTclProfileEvaluateData(Tcl_Interp* in, long int startSec, long int startUsec, - XOTclObject* obj, XOTclClass *cl, char *methodName); -extern void -XOTclProfilePrintTable(Tcl_HashTable* table); - -extern void -XOTclProfilePrintData(Tcl_Interp* in); - -extern void -XOTclProfileInit(Tcl_Interp* in); -#endif - -/* - * MEM Counting - */ -#ifdef XOTCL_MEM_COUNT -void XOTclMemCountAlloc(char* id, void *); -void XOTclMemCountFree(char* id, void *); -void XOTclMemCountDump(); -#endif /* XOTCL_MEM_COUNT */ -/* - * old, deprecated meta-data command - */ -#if defined(XOTCL_METADATA) -extern void -XOTclMetaDataDestroy(XOTclObject* obj); -extern void -XOTclMetaDataInit(XOTclObject* obj); -extern int -XOTclOMetaDataMethod (ClientData cd, Tcl_Interp* in, - int objc, Tcl_Obj *objv[]); -#endif /* XOTCL_METADATA */ - - -/* - * bytecode support - */ -#ifdef XOTCL_BYTECODE -typedef struct XOTclCompEnv { - int bytecode; - Command *cmdPtr; - CompileProc *compileProc; - Tcl_ObjCmdProc *callProc; -} XOTclCompEnv; - -typedef enum {INST_INITPROC, INST_NEXT, INST_SELF, INST_SELF_DISPATCH, - LAST_INSTRUCTION} XOTclByteCodeInstructions; - - -extern XOTclCompEnv *XOTclGetCompEnv(); - -Tcl_ObjCmdProc XOTclInitProcNSCmd, XOTclSelfDispatchCmd, - XOTclNextObjCmd, XOTclGetSelfObjCmd; - -int XOTclDirectSelfDispatch(ClientData cd, Tcl_Interp* in, - int objc, Tcl_Obj *CONST objv[]); -#endif - -int -XOTclObjDispatch(ClientData cd, Tcl_Interp* in, - int objc, Tcl_Obj *CONST objv[]); - -XOTclCallStackContent * -XOTclCallStackFindActiveFrame(Tcl_Interp* in, int offset); - -XOTclCallStackContent * -XOTclCallStackFindLastInvocation(Tcl_Interp* in, int offset); - -/* functions from xotclUtil.c */ -char *XOTcl_ltoa(char *buf, long i, int *len); -char *XOTclStringIncr(XOTclStringIncrStruct *iss); -void XOTclStringIncrInit(XOTclStringIncrStruct *iss); -void XOTclStringIncrFree(XOTclStringIncrStruct *iss); - - -#if !defined(NDEBUG) -/*# define XOTCLINLINE*/ -#endif - - -/*** common win sermon ***/ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLIMPORT - -#endif /* _xotcl_int_h_ */ Index: xotcl/generic/xotclIntDecls.h =================================================================== diff -u -N --- xotcl/generic/xotclIntDecls.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/generic/xotclIntDecls.h (revision 0) @@ -1,57 +0,0 @@ -/* - * xotclIntDecls.h -- - * - * This file contains the declarations for all unsupported - * functions that are exported by the Tcl library. These - * interfaces are not guaranteed to remain the same between - * versions. Use at your own risk. - * - * Copyright (c) 1998-1999 by XXXX - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - */ - -#ifndef _XOTCLINTDECLS -#define _XOTCLINTDECLS - -/* - * WARNING: This file is automatically generated by the tools/genStubs.tcl - * script. Any modifications to the function declarations below should be made - * in the xotclInt.decls script. - */ - -/* !BEGIN!: Do not edit below this line. */ - -/* - * Exported function declarations: - */ - - -typedef struct XotclIntStubs { - int magic; - struct XotclIntStubHooks *hooks; - -} XotclIntStubs; - -#ifdef __cplusplus -extern "C" { -#endif -extern XotclIntStubs *xotclIntStubsPtr; -#ifdef __cplusplus -} -#endif - -#if defined(USE_XOTCL_STUBS) && !defined(USE_XOTCL_STUB_PROCS) - -/* - * Inline function declarations: - */ - - -#endif /* defined(USE_XOTCL_STUBS) && !defined(USE_XOTCL_STUB_PROCS) */ - -/* !END!: Do not edit above this line. */ - -#endif /* _XOTCLINTDECLS */ Index: xotcl/generic/xotclMetaData.c =================================================================== diff -u -N --- xotcl/generic/xotclMetaData.c (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/generic/xotclMetaData.c (revision 0) @@ -1,176 +0,0 @@ -/* -*- Mode: c++ -*- - * $Id: xotclMetaData.c,v 1.5 2006/09/27 08:12:40 neumann Exp $ - * - * Extended Object Tcl (XOTcl) - * - * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun - * - * - * xotclReference.c -- - * - * XOTcl Object References - * - */ - -#include "xotclInt.h" - -#ifdef XOTCL_METADATA -/* - * Meta Data - */ - -void -XOTclMetaDataRemoveDepending(XOTclClass* cl, char* name) { - XOTclClasses *saved = cl->order, *clPtr; - cl->order = 0; - - clPtr = XOTclComputeDependents(cl); - - while (clPtr != 0) { - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr = &clPtr->cl->instances ? - Tcl_FirstHashEntry(&clPtr->cl->instances, &hSrch) : 0; - for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { - XOTclObject* obj = (XOTclObject*) - Tcl_GetHashKey(&clPtr->cl->instances, hPtr); - Tcl_HashEntry* h1Ptr = 0; - if (obj->opt) - h1Ptr = Tcl_FindHashEntry(&obj->opt->metaData, name); - if (h1Ptr) { - Tcl_DeleteHashEntry(h1Ptr); - } - } - clPtr = clPtr->next; - } - - XOTclRemoveClasses(cl->order); - cl->order = saved; -} - -int -XOTclMetaDataInheritance (XOTclObject* obj, char* name) { - XOTclClasses *clPtr; - assert(obj); - - if (!obj->cl->order) - obj->cl->order = XOTclComputePrecedence(obj->cl); - clPtr = obj->cl->order; - if (clPtr) { - while (clPtr != 0) { - if (clPtr->cl->object.opt) { - if (Tcl_FindHashEntry(&clPtr->cl->object.opt->metaData, name)) { - return 1; - } - } - clPtr = clPtr->next; - } - } - return 0; -} - -void -XOTclMetaDataDestroy(XOTclObject* obj) { - if (obj->opt) - Tcl_DeleteHashTable(&obj->opt->metaData); -} - -void -XOTclMetaDataInit(XOTclObject* obj) { - XOTclRequireObjectOpt(obj); - Tcl_InitHashTable(&obj->opt->metaData, TCL_STRING_KEYS); -} - -int -XOTclOMetaDataMethod (ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj *CONST objv[]) { - XOTclObject *obj = (XOTclObject*)cd; - XOTclClass *cl = XOTclObjectToClass(cd); - char* option; int add = -1; - int result = TCL_OK; - int oc; Tcl_Obj** ov; int i; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc < 2) - return XOTclObjErrArgCnt(in,obj->cmdName, - "metadata ?(add|remove)? metaDataList"); - - option = ObjStr(objv[1]); - switch (*option) { - case 'a': - if (strcmp(option,"add") == 0) add = 1; break; - case 'r': - if (strcmp(option,"remove") == 0) add = 0; break; - } - if (add == -1) { - if (objc == 2) { - if (obj->opt) { - Tcl_HashEntry* hPtr = Tcl_FindHashEntry(&obj->opt->metaData, option); - if (hPtr) { - Tcl_Obj* entry = (Tcl_Obj *) Tcl_GetHashValue(hPtr); - if (entry) { - Tcl_SetObjResult(in, (Tcl_Obj *) Tcl_GetHashValue(hPtr)); - } else { - Tcl_ResetResult(in); - } - } - return TCL_OK; - } - } - if (objc == 3) { - if (obj->opt) { - Tcl_HashEntry* hPtr = Tcl_FindHashEntry(&obj->opt->metaData, option); - if (!hPtr) { - int nw; - if (XOTclMetaDataInheritance(obj, option)) { - hPtr = Tcl_CreateHashEntry(&obj->opt->metaData, option, &nw); - if (!nw) - return XOTclVarErrMsg(in, - "MetaData: Can't create MetaData Entry: ", - option, (char*) NULL); - } - } - if (hPtr) { - Tcl_Obj* entry = (Tcl_Obj *) Tcl_GetHashValue(hPtr); - if (entry) - DECR_REF_COUNT(entry); - INCR_REF_COUNT(objv[2]); - Tcl_SetHashValue(hPtr, (ClientData) objv[2]); - return TCL_OK; - } - } - } - return XOTclVarErrMsg(in,"MetaData: Unknown option; given Option: ", - option, (char*) NULL); - } - - if (Tcl_ListObjGetElements(in, objv[2], &oc, &ov) == TCL_OK) { - for (i = 0; i < oc; i ++) { - char* value = ObjStr (ov[i]); - if (obj->opt) { - if (add) { - int nw; - Tcl_HashEntry* hPtr = Tcl_FindHashEntry(&obj->opt->metaData, value); - if (hPtr) - return XOTclVarErrMsg(in, - "Can't add MetaData, MetaData exists: ", - value, - (char*) NULL); - hPtr = Tcl_CreateHashEntry(&obj->opt->metaData, value, &nw); - if (!nw) - return XOTclVarErrMsg(in, - "MetaData: Can't create MetaData Entry: ", - value,(char*) NULL); - } else { - Tcl_HashEntry* hPtr = Tcl_FindHashEntry(&obj->opt->metaData, value); - if (hPtr) { - Tcl_DeleteHashEntry(hPtr); - if (cl) { - XOTclMetaDataRemoveDepending(cl, value); - } - } - } - } - } - } - return result; -} -#endif Index: xotcl/generic/xotclObjectData.c =================================================================== diff -u -N --- xotcl/generic/xotclObjectData.c (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/generic/xotclObjectData.c (revision 0) @@ -1,61 +0,0 @@ -/* -*- Mode: c++ -*- - * xotclObjectData.c - * - * Extended Object Tcl (XOTcl) - * - * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun - * - * - * xotclObjectData.c -- - * - * XOTcl Object Data, needs XOTCL_OBJECTDATA to be compiled in - * - */ - -#include "xotclInt.h" - -#ifdef XOTCL_OBJECTDATA -extern void -XOTclFreeObjectData(XOTclClass* cl) { - if (cl->opt && cl->opt->objectdata) { - Tcl_DeleteHashTable(cl->opt->objectdata); - ckfree((char*)cl->opt->objectdata); - cl->opt->objectdata = 0; - } -} -extern void -XOTclSetObjectData(XOTclObject* obj, XOTclClass* cl, ClientData data) { - Tcl_HashEntry *hPtr; - int nw; - - XOTclRequireClassOpt(cl); - - if (!cl->opt->objectdata) { - cl->opt->objectdata = (Tcl_HashTable*)ckalloc(sizeof(Tcl_HashTable)); - Tcl_InitHashTable(cl->opt->objectdata, TCL_ONE_WORD_KEYS); - } - hPtr = Tcl_CreateHashEntry(cl->opt->objectdata, (char*)obj, &nw); - Tcl_SetHashValue(hPtr, data); -} - -extern int -XOTclGetObjectData(XOTclObject* obj, XOTclClass* cl, ClientData* data) { - Tcl_HashEntry *hPtr; - if (!cl->opt || !cl->opt->objectdata) - return 0; - hPtr = Tcl_FindHashEntry(cl->opt->objectdata, (char*)obj); - if (data) *data = hPtr ? Tcl_GetHashValue(hPtr) : 0; - return hPtr != 0; -} - -extern int -XOTclUnsetObjectData(XOTclObject* obj, XOTclClass* cl) { - Tcl_HashEntry *hPtr; - - if (!cl->opt || !cl->opt->objectdata) - return 0; - hPtr = Tcl_FindHashEntry(cl->opt->objectdata, (char*)obj); - if (hPtr) Tcl_DeleteHashEntry(hPtr); - return hPtr != 0; -} -#endif Index: xotcl/generic/xotclProfile.c =================================================================== diff -u -N --- xotcl/generic/xotclProfile.c (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/generic/xotclProfile.c (revision 0) @@ -1,145 +0,0 @@ -/* -*- Mode: c++ -*- - * $Id: xotclProfile.c,v 1.2 2006/02/18 22:17:33 neumann Exp $ - * - * Extended Object Tcl (XOTcl) - * - * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun - * - * - * xotclProfile.c -- - * - * Profiling information printout for XOTcl - * - * For profiling infos PROFILE (xotcl.h) flag must be activated - * - */ - -#include "xotclInt.h" - -#if defined(PROFILE) -void -XOTclProfileFillTable(Tcl_HashTable* table, Tcl_DString* key, - double totalMicroSec) { - Tcl_HashEntry* hPtr; - char* keyStr = Tcl_DStringValue(key); - long int* value; - - hPtr = Tcl_FindHashEntry(table, keyStr); - if (!hPtr) { - int nw; - hPtr = Tcl_CreateHashEntry(table, keyStr, &nw); - if (!nw) - return; - value = (long int*) ckalloc (sizeof(long int)); - *value = 0; - Tcl_SetHashValue(hPtr, (ClientData) value); - } else - value = (long int*) Tcl_GetHashValue (hPtr); - - *value += totalMicroSec; - - - /* { - long int* d = (long int*) Tcl_GetHashValue (hPtr); - fprintf(stderr, "Entered %s ... %ld\n", Tcl_GetHashKey(table, hPtr), *d); - }*/ - -} - -void -XOTclProfileEvaluateData(Tcl_Interp* in, long int startSec, long int startUsec, - XOTclObject* obj, XOTclClass *cl, char *methodName) { - double totalMicroSec; - struct timeval trt; - Tcl_DString objectKey, methodKey; - - XOTclProfile* profile = &RUNTIME_STATE(in)->profile; - - gettimeofday(&trt, NULL); - - totalMicroSec = (trt.tv_sec - startSec) * 1000000 + - (trt.tv_usec - startUsec); - - profile->overallTime += totalMicroSec; - - if (obj->teardown == 0 || !obj->id || obj->destroyCalled) - return; - - ALLOC_DSTRING(&objectKey, ObjStr(obj->cmdName)); - - if (cl) - ALLOC_DSTRING(&methodKey, ObjStr(cl->object.cmdName)); - else - ALLOC_DSTRING(&methodKey, ObjStr(obj->cmdName)); - Tcl_DStringAppend(&methodKey, "->", 2); - Tcl_DStringAppend(&methodKey, methodName, -1); - if (cl) - Tcl_DStringAppend(&methodKey, " (instproc)", 11); - else - Tcl_DStringAppend(&methodKey, " (proc)", 7); - - XOTclProfileFillTable(&profile->objectData, &objectKey, totalMicroSec); - XOTclProfileFillTable(&profile->methodData, &methodKey, totalMicroSec); - DSTRING_FREE(&objectKey); - DSTRING_FREE(&methodKey); -} - -void -XOTclProfilePrintTable(Tcl_HashTable* table) { - Tcl_HashEntry* topValueHPtr; - long int* topValue; - - do { - Tcl_HashSearch hSrch; - Tcl_HashEntry* hPtr = table ? - Tcl_FirstHashEntry(table, &hSrch) : 0; - char* topKey = 0; - - topValueHPtr = 0; - topValue = 0; - - for (; hPtr != 0; hPtr = Tcl_NextHashEntry(&hSrch)) { - long int *val = (long int*) Tcl_GetHashValue(hPtr); - if (val && (!topValue || (topValue && *val >= *topValue))) { - topValue = val; - topValueHPtr = hPtr; - topKey = Tcl_GetHashKey(table, hPtr); - } - } - - if (topValueHPtr) { - fprintf(stderr, " %15ld %s\n", *topValue, topKey); - ckfree((char*) topValue); - Tcl_DeleteHashEntry(topValueHPtr); - } - } while (topValueHPtr); -} - -void -XOTclProfilePrintData(Tcl_Interp* in) { - XOTclProfile* profile = &RUNTIME_STATE(in)->profile; - - fprintf(stderr, "------------------------------------------------------------------\n"); - fprintf(stderr, "\nXOTcl Profile Information\n\n"); - fprintf(stderr, "------------------------------------------------------------------\n"); - fprintf(stderr, "Overall Elapsed Time %ld\n", - profile->overallTime); - fprintf(stderr, "------------------------------------------------------------------\n"); - fprintf(stderr, " MICROSECONDS OBJECT-NAME\n"); - XOTclProfilePrintTable(&profile->objectData); - fprintf(stderr, "------------------------------------------------------------------\n"); - fprintf(stderr, " MICROSECONDS (CL/OBJ)->METHOD-NAME\n"); - XOTclProfilePrintTable(&profile->methodData); - fprintf(stderr, "------------------------------------------------------------------\n"); -} - -void -XOTclProfileInit(Tcl_Interp* in) { - RUNTIME_STATE(in)->profile.overallTime = 0; - Tcl_InitHashTable(&RUNTIME_STATE(in)->profile.objectData, - TCL_STRING_KEYS); - Tcl_InitHashTable(&RUNTIME_STATE(in)->profile.methodData, - TCL_STRING_KEYS); -} - -#endif Index: xotcl/generic/xotclShadow.c =================================================================== diff -u -N --- xotcl/generic/xotclShadow.c (revision 57972e5a2972b1eb5dd63f6e3d483670117feebf) +++ xotcl/generic/xotclShadow.c (revision 0) @@ -1,194 +0,0 @@ -/* -*- Mode: c++ -*- - * $Id: xotclShadow.c,v 1.10 2007/09/05 19:09:23 neumann Exp $ - * - * Extended Object Tcl (XOTcl) - * - * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun - * - * - * xotclShadow.c -- - * - * Shadowing (overloading) and accessing global tcl obj commands - * - */ - -#include "xotclInt.h" -#include "xotclAccessInt.h" - -static int -XOTclReplaceCommandCleanup(Tcl_Interp *in, XOTclGlobalNames name) { - Tcl_Command cmd; - int result = TCL_OK; - XOTclShadowTclCommandInfo *ti = &RUNTIME_STATE(in)->tclCommands[name-XOTE_EXPR]; - - /*fprintf(stderr," cleanup for %s ti=%p in %p\n", XOTclGlobalStrings[name], ti, in);*/ - cmd = Tcl_GetCommandFromObj(in, XOTclGlobalObjects[name]); - if (cmd != NULL) { - Tcl_Command_objProc(cmd) = ti->proc; - ti->proc = NULL; - } else { - result = TCL_ERROR; - } - - return result; -} - -static void -XOTclReplaceCommandCheck(Tcl_Interp *in, XOTclGlobalNames name, Tcl_ObjCmdProc *proc) { - Tcl_Command cmd; - XOTclShadowTclCommandInfo *ti = &RUNTIME_STATE(in)->tclCommands[name-XOTE_EXPR]; - cmd = Tcl_GetCommandFromObj(in, XOTclGlobalObjects[name]); - - if (cmd != NULL && ti->proc && Tcl_Command_objProc(cmd) != proc) { - /* - fprintf(stderr, "we have to do something about %s %p %p\n", - XOTclGlobalStrings[name], Tcl_Command_objProc(cmd), proc); - */ - ti->proc = Tcl_Command_objProc(cmd); - ti->cd = Tcl_Command_objClientData(cmd); - Tcl_Command_objProc(cmd) = proc; - } -} - -static int -XOTclReplaceCommand(Tcl_Interp *in, XOTclGlobalNames name, - Tcl_ObjCmdProc *xotclReplacementProc, int pass) { - Tcl_Command cmd; - XOTclShadowTclCommandInfo *ti = &RUNTIME_STATE(in)->tclCommands[name-XOTE_EXPR]; - int result = TCL_OK; - - /*fprintf(stderr,"XOTclReplaceCommand %d\n",name);*/ - cmd = Tcl_GetCommandFromObj(in, XOTclGlobalObjects[name]); - - if (cmd == NULL) { - result = TCL_ERROR; - } else { - Tcl_ObjCmdProc *objProc = Tcl_Command_objProc(cmd); - if (xotclReplacementProc != objProc) { - if (pass == 0) { /* setting values on first pass (must be locked here) */ - ti->proc = objProc; - ti->cd = Tcl_Command_objClientData(cmd); - } else if (ti->proc != objProc) { - /*fprintf(stderr, "we have to refetch command for %s\n",XOTclGlobalStrings[name]);*/ - ti->proc = objProc; - ti->cd = Tcl_Command_objClientData(cmd); - } - if (xotclReplacementProc) { - Tcl_Command_objProc(cmd) = xotclReplacementProc; - /*Tcl_CreateObjCommand(in, XOTclGlobalStrings[name], xotclReplacementProc, 0, 0);*/ - } - } - } - return result; -} - -static int -XOTcl_RenameObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - /* this call the Tcl_RenameObjCmd, but it ensures before that - the renamed obj, functions, etc. are not part of XOTcl */ - XOTclObject *obj = NULL; - Tcl_Command cmd; - - /* wrong # args => normal Tcl ErrMsg*/ - if (objc != 3) - return XOTclCallCommand(in, XOTE_RENAME, objc, objv); - - /* if an obj/cl should be renamed => call the XOTcl move method */ - cmd = Tcl_FindCommand(in, ObjStr(objv[1]), (Tcl_Namespace *)NULL,0); - - if (cmd != NULL) { - obj = XOTclGetObjectFromCmdPtr(cmd); - if (obj) { - return XOTclCallMethodWithArgs((ClientData)obj, in, - XOTclGlobalObjects[XOTE_MOVE], objv[2], 1, 0, 0); - } - } - - /* Actually rename the cmd using Tcl's rename*/ - return XOTclCallCommand(in, XOTE_RENAME, objc, objv); -} - -static int -XOTcl_InfoObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - int result, isBody = 0; - if (objc > 1) { - char *opt = ObjStr(objv[1]); - if (isBodyString(opt) && objc > 2) - isBody = 1; - } - result = XOTclCallCommand(in, XOTE_INFO, objc, objv); - - if (isBody && result == TCL_OK) { - char *body = ObjStr(Tcl_GetObjResult(in)); - if (strncmp(body, "::xotcl::initProcNS\n",20) == 0) - body += 20; - Tcl_SetObjResult(in, Tcl_NewStringObj(body, -1)); - } - return result; -} - - -/* - * Obtain the names of the tcl commands - * not available through the stub interface and overload some global commands - */ -int -XOTclShadowTclCommands(Tcl_Interp *in, XOTclShadowOperations load) { - int rc = TCL_OK; - if (load == SHADOW_LOAD) { - int initialized = (RUNTIME_STATE(in)->tclCommands != NULL); - assert(initialized == 0); - RUNTIME_STATE(in)->tclCommands = - NEW_ARRAY(XOTclShadowTclCommandInfo, XOTE_SUBST - XOTE_EXPR + 1); - - /*fprintf(stderr, "+++ load tcl commands %d %d\n", load, initialized);*/ - -#ifdef USE_TCL_STUBS - /* no commands are overloaded, these are only used for calling - e.g. Tcl_ExprObjCmd(), Tcl_IncrObjCmd() and Tcl_SubstObjCmd(), - which are not avalailable in through the stub table */ - rc|= XOTclReplaceCommand(in, XOTE_EXPR, 0, initialized); - rc|= XOTclReplaceCommand(in, XOTE_SUBST, 0, initialized); -#endif - /* for the following commands, we have to add our own semantics */ -#if 1 - rc|= XOTclReplaceCommand(in, XOTE_INFO, XOTcl_InfoObjCmd, initialized); -#endif - rc|= XOTclReplaceCommand(in, XOTE_RENAME, XOTcl_RenameObjCmd, initialized); - - } else if (load == SHADOW_REFETCH) { - XOTclReplaceCommandCheck(in, XOTE_INFO, XOTcl_InfoObjCmd); - XOTclReplaceCommandCheck(in, XOTE_RENAME, XOTcl_RenameObjCmd); - } else { - XOTclReplaceCommandCleanup(in, XOTE_INFO); - XOTclReplaceCommandCleanup(in, XOTE_RENAME); - FREE(XOTclShadowTclCommandInfo*, RUNTIME_STATE(in)->tclCommands); - RUNTIME_STATE(in)->tclCommands = NULL; - } - return rc; -} - -/* - * call a Tcl command with given objv's ... replace objv[0] - * with the given command name - */ -int XOTclCallCommand(Tcl_Interp *in, XOTclGlobalNames name, - int objc, Tcl_Obj *CONST objv[]) { - int result; - XOTclShadowTclCommandInfo *ti = &RUNTIME_STATE(in)->tclCommands[name-XOTE_EXPR]; - ALLOC_ON_STACK(Tcl_Obj*,objc, ov); - - /* {int i; - fprintf(stderr,"calling %s (%p %p) in %p, objc=%d ", - XOTclGlobalStrings[name],ti,ti->proc, in, objc); - for(i=0;i 1) - memcpy(ov+1, objv+1, sizeof(Tcl_Obj *)*(objc-1)); - result = (*ti->proc)(ti->cd, in, objc, ov); - FREE_ON_STACK(ov); - return result; -} Index: xotcl/generic/xotclStubInit.c =================================================================== diff -u -N --- xotcl/generic/xotclStubInit.c (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/generic/xotclStubInit.c (revision 0) @@ -1,81 +0,0 @@ -/* - * xotclStubInit.c -- - * - * This file contains the initializers for the XOTcl stub vectors. - * - * Copyright (c) 1998-1999 by XXX - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - */ - -#include "xotclInt.h" - -/* - * Remove macros that will interfere with the definitions below. - */ - -/* - * WARNING: The contents of this file is automatically generated by the - * tools/genStubs.tcl script. Any modifications to the function declarations - * below should be made in the generic/tcl.decls script. - */ - -/* !BEGIN!: Do not edit below this line. */ - -XotclIntStubs xotclIntStubs = { - TCL_STUB_MAGIC, - NULL, -}; - -static XotclStubHooks xotclStubHooks = { - &xotclIntStubs -}; - -XotclStubs xotclStubs = { - TCL_STUB_MAGIC, - &xotclStubHooks, - Xotcl_Init, /* 0 */ - NULL, /* 1 */ - XOTclIsClass, /* 2 */ - NULL, /* 3 */ - XOTclGetObject, /* 4 */ - XOTclGetClass, /* 5 */ - XOTclCreateObject, /* 6 */ - NULL, /* 7 */ - XOTclCreateClass, /* 8 */ - XOTclDeleteObject, /* 9 */ - XOTclDeleteClass, /* 10 */ - XOTclAddPMethod, /* 11 */ - XOTclAddIMethod, /* 12 */ - XOTclRemovePMethod, /* 13 */ - XOTclRemoveIMethod, /* 14 */ - XOTclOSetInstVar, /* 15 */ - XOTclOGetInstVar, /* 16 */ - XOTclInstVar, /* 17 */ - NULL, /* 18 */ - XOTclOSetInstVar2, /* 19 */ - XOTclOGetInstVar2, /* 20 */ - XOTclUnsetInstVar2, /* 21 */ - XOTcl_TraceObjCmd, /* 22 */ - XOTclErrMsg, /* 23 */ - XOTclVarErrMsg, /* 24 */ - XOTclErrInProc, /* 25 */ - XOTclObjErrArgCnt, /* 26 */ - XOTclErrBadVal_, /* 27 */ - XOTclObjErrType, /* 28 */ - XOTclStackDump, /* 29 */ - XOTclCallStackDump, /* 30 */ - XOTclDeprecatedMsg, /* 31 */ - XOTclSetObjClientData, /* 32 */ - XOTclGetObjClientData, /* 33 */ - XOTclSetClassClientData, /* 34 */ - XOTclGetClassClientData, /* 35 */ - XOTclRequireObjNamespace, /* 36 */ - XOTclErrBadVal, /* 37 */ - XOTclNextObjCmd, /* 38 */ - XOTclCallMethodWithArgs, /* 39 */ -}; - -/* !END!: Do not edit above this line. */ Index: xotcl/generic/xotclStubLib.c =================================================================== diff -u -N --- xotcl/generic/xotclStubLib.c (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/generic/xotclStubLib.c (revision 0) @@ -1,85 +0,0 @@ -/* - * xotclStubLib.c -- - * - * Stub object that will be statically linked into extensions of XOTcl - * - * Copyright (c) 2001 UZ - * Copyright (c) 1998 Paul Duffin. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - */ - -/* - * We need to ensure that we use the stub macros so that this file contains - * no references to any of the stub functions. This will make it possible - * to build an extension that references Tcl_InitStubs but doesn't end up - * including the rest of the stub functions. - */ - -#ifndef USE_TCL_STUBS -#define USE_TCL_STUBS -#endif -#undef USE_TCL_STUB_PROCS - -/* - * This ensures that the Xotcl_InitStubs has a prototype in - * xotcl.h and is not the macro that turns it into Tcl_PkgRequire - */ - -#ifndef USE_XOTCL_STUBS -#define USE_XOTCL_STUBS -#endif - -#include "xotclInt.h" - -XotclStubs *xotclStubsPtr = NULL; -XotclIntStubs *xotclIntStubsPtr = NULL; - -/* - *---------------------------------------------------------------------- - * - * Xotcl_InitStubs -- - * - * Tries to initialise the stub table pointers and ensures that - * the correct version of XOTcl is loaded. - * - * Results: - * The actual version of XOTcl that satisfies the request, or - * NULL to indicate that an error occurred. - * - * Side effects: - * Sets the stub table pointers. - * - *---------------------------------------------------------------------- - */ - -CONST char * -Xotcl_InitStubs (interp, version, exact) - Tcl_Interp *interp; - CONST char *version; - int exact; -{ - CONST char *actualVersion; - - actualVersion = Tcl_PkgRequireEx(interp, "XOTcl", version, exact, - (ClientData *) &xotclStubsPtr); - - if (actualVersion == NULL) { - xotclStubsPtr = NULL; - return NULL; - } - - if (xotclStubsPtr == NULL) { - return NULL; - } - - if (xotclStubsPtr->hooks) { - xotclIntStubsPtr = xotclStubsPtr->hooks->xotclIntStubs; - } else { - xotclIntStubsPtr = NULL; - } - - return actualVersion; -} Index: xotcl/generic/xotclTrace.c =================================================================== diff -u -N --- xotcl/generic/xotclTrace.c (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/generic/xotclTrace.c (revision 0) @@ -1,220 +0,0 @@ -/* -*- Mode: c++ -*- - * $Id: xotclTrace.c,v 1.8 2006/09/27 08:12:40 neumann Exp $ - * - * Extended Object Tcl (XOTcl) - * - * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun - * - * - * xotclTrace.c -- - * - * Tracing facilities for XOTcl - * - */ - -#include "xotclInt.h" -#include "xotclAccessInt.h" - -void -XOTclStackDump(Tcl_Interp *in) { - Interp *iPtr = (Interp *) in; - CallFrame *f = iPtr->framePtr, *v = iPtr->varFramePtr; - Tcl_Obj *varCmdObj; - - XOTclNewObj(varCmdObj); - fprintf (stderr, " TCL STACK:\n"); - if (f == 0) fprintf(stderr, "- "); - while (f) { - Tcl_Obj *cmdObj; - XOTclNewObj(cmdObj); - fprintf(stderr, "\tFrame=%p ", f); - if (f && f->isProcCallFrame && f->procPtr && f->procPtr->cmdPtr) { - fprintf(stderr,"caller %p ",Tcl_CallFrame_callerPtr(f)); - fprintf(stderr,"callerV %p ",Tcl_CallFrame_callerVarPtr(f)); - Tcl_GetCommandFullName(in, (Tcl_Command) f->procPtr->cmdPtr, cmdObj); - fprintf(stderr, "%s (%p) lvl=%d\n", ObjStr(cmdObj), f->procPtr->cmdPtr, f->level); - DECR_REF_COUNT(cmdObj); - } else fprintf(stderr, "- \n"); - - f = f->callerPtr; - } - - fprintf (stderr, " VARFRAME:\n"); - fprintf(stderr, "\tFrame=%p", v); - if (v) {fprintf(stderr, "caller %p", v->callerPtr);} - if (v && v->isProcCallFrame && v->procPtr && v->procPtr->cmdPtr) { - Tcl_GetCommandFullName(in, (Tcl_Command) v->procPtr->cmdPtr, varCmdObj); - if (varCmdObj) { - fprintf(stderr, " %s (%d)\n", ObjStr(varCmdObj), v->level); - } - } else fprintf(stderr, "- \n"); - DECR_REF_COUNT(varCmdObj); -} - -void -XOTclCallStackDump(Tcl_Interp *in) { - XOTclCallStack *cs = &RUNTIME_STATE(in)->cs; - XOTclCallStackContent *csc; - int i=1, entries = cs->top - cs->content; - - fprintf (stderr, " XOTCL CALLSTACK: (%d entries, top: %p) \n", entries, cs->top); - for (csc = &cs->content[1]; csc <= cs->top; csc++) { - fprintf(stderr, " %d: %p ",i++,csc); - if (csc->self) - fprintf(stderr, "OBJ %s (%p), ", ObjStr(csc->self->cmdName), csc->self); - if (csc->cl) - fprintf(stderr, "INSTPROC %s->", className(csc->cl)); - else - fprintf(stderr, "PROC "); - - /*fprintf(stderr, " cmd %p, obj %p, ",csc->cmdPtr, csc->self);*/ - - if (csc->cmdPtr && !csc->destroyedCmd) - fprintf(stderr, "%s (%p), ", Tcl_GetCommandName(in, (Tcl_Command)csc->cmdPtr), - csc->cmdPtr); - else - fprintf(stderr, "NULL, "); - - fprintf(stderr, "frameType: %d, ", csc->frameType); - fprintf(stderr, "callType: %d ", csc->callType); - fprintf(stderr, "cframe %p ", csc->currentFramePtr); - - if (csc->currentFramePtr) - fprintf(stderr,"l=%d ",Tcl_CallFrame_level(csc->currentFramePtr)); - - if (csc->destroyedCmd) - fprintf(stderr, "--destroyed cmd set (%p) ", csc->destroyedCmd); - - fprintf(stderr, "\n"); - } - /* - if (entries > 0) { - XOTclCallStackContent *c; - c = XOTclCallStackFindLastInvocation(in); - fprintf(stderr," --- findLastInvocation %p ",c); - if (c) { - if (c <= cs->top && c->currentFramePtr) - fprintf(stderr," l=%d", Tcl_CallFrame_level(c->currentFramePtr)); - } - c = XOTclCallStackFindActiveFrame(in, 1); - fprintf(stderr," findActiveFrame %p ",c); - if (c) { - if (c <= cs->top && c->currentFramePtr) - fprintf(stderr," l=%d", Tcl_CallFrame_level(c->currentFramePtr)); - } - fprintf(stderr," --- \n"); - } - */ -} - -/* helper function to print the vars dynamically created on a - callframe -static void printLocalTable (CallFrame* c) { - Tcl_HashEntry *entryPtr; - Tcl_HashTable *localVarTablePtr = c->varTablePtr; - Tcl_HashSearch search; - - fprintf(stderr, "LocalVars:"); - - if (localVarTablePtr != NULL) { - for (entryPtr = Tcl_FirstHashEntry(localVarTablePtr, &search); - entryPtr != NULL; - entryPtr = Tcl_NextHashEntry(&search)) { - char *varName = Tcl_GetHashKey(localVarTablePtr, entryPtr); - fprintf(stderr, " %s,", varName); - } - } - fprintf(stderr,"\n"); -} -*/ - -int -XOTcl_TraceObjCmd(ClientData cd, Tcl_Interp *in, int objc, Tcl_Obj *CONST objv[]) { - char *option; - if (objc != 2) - return XOTclObjErrArgCnt(in, NULL, "::xotcl::trace"); - - option = ObjStr(objv[1]); - if (strcmp(option,"stack") == 0) { - XOTclStackDump(in); - return TCL_OK; - } - if (strcmp(option,"callstack") == 0) { - XOTclCallStackDump(in); - return TCL_OK; - } - return XOTclVarErrMsg(in, "xotcltrace: unknown option", (char*) NULL); -} - -#ifdef XOTCL_MEM_COUNT -void -XOTclMemCountAlloc(char *id, void *p) { - int new; - XOTclMemCounter *entry; - Tcl_HashTable *table = &xotclMemCount; - Tcl_HashEntry *hPtr; - hPtr = Tcl_CreateHashEntry(table, id, &new); -#ifdef XOTCL_MEM_TRACE - fprintf(stderr, "+++ alloc %s %p\n",id,p); -#endif - /*fprintf(stderr,"+++alloc '%s'\n",id);*/ - if (new) { - entry = (XOTclMemCounter*)ckalloc(sizeof(XOTclMemCounter)); - entry->count = 1; - entry->peak = 1; - Tcl_SetHashValue(hPtr, entry); - } else { - entry = (XOTclMemCounter*) Tcl_GetHashValue(hPtr); - entry->count++; - if (entry->count > entry->peak) - entry->peak = entry->count; - } -} - -void -XOTclMemCountFree(char *id, void *p) { - XOTclMemCounter *entry; - Tcl_HashTable *table = &xotclMemCount; - Tcl_HashEntry *hPtr; -#ifdef XOTCL_MEM_TRACE - fprintf(stderr, "+++ free %s %p\n",id,p); -#endif - - hPtr = Tcl_FindHashEntry(table, id); - if (!hPtr) { - fprintf(stderr, "******** MEM COUNT ALERT: Trying to free <%s>, but was not allocated\n", id); - return; - } - entry = (XOTclMemCounter*) Tcl_GetHashValue(hPtr); - entry->count--; -} - -void -XOTclMemCountDump() { - Tcl_HashTable *table = &xotclMemCount; - Tcl_HashSearch search; - Tcl_HashEntry *hPtr; - int count = 0; - - xotclMemCountInterpCounter--; - if (xotclMemCountInterpCounter != 0) { - return; - } - - fprintf(stderr, "******** XOTcl MEM Count *********\n* count peak\n"); - - for (hPtr = Tcl_FirstHashEntry(table, &search); hPtr != NULL; - hPtr = Tcl_NextHashEntry(&search)) { - char *id = Tcl_GetHashKey(table, hPtr); - XOTclMemCounter *entry = (XOTclMemCounter*) Tcl_GetHashValue(hPtr); - count += entry->count; - fprintf(stderr, "* %4d %6d %s\n", entry->count, entry->peak, id); - ckfree ((char*) entry); - } - - Tcl_DeleteHashTable(table); - - fprintf(stderr, "******** Count Overall = %d\n", count); -} - -#endif Index: xotcl/generic/xotclUtil.c =================================================================== diff -u -N --- xotcl/generic/xotclUtil.c (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/generic/xotclUtil.c (revision 0) @@ -1,125 +0,0 @@ -/* -*- Mode: c++ -*- - * $Id: xotclUtil.c,v 1.3 2006/02/18 22:17:33 neumann Exp $ - * - * Extended Object Tcl (XOTcl) - * - * Copyright (C) 1999-2006 Gustaf Neumann, Uwe Zdun - * - * - * xotclUtil.c -- - * - * Utility functions - * - */ - -#include "xotclInt.h" - -char * -XOTcl_ltoa(char *buf, long i, int *len) /* fast version of sprintf(buf,"%ld",l); */ { - int nr_written, negative; - char tmp[LONG_AS_STRING], *pointer = &tmp[1], *string, *p; - *tmp = 0; - - if (i<0) { - i = -i; - negative = nr_written = 1; - } else - nr_written = negative = 0; - - do { - nr_written++; - *pointer++ = i%10 + '0'; - i/=10; - } while (i); - - p = string = buf; - if (negative) - *p++ = '-'; - - while ((*p++ = *--pointer)); /* copy number (reversed) from tmp to buf */ - if (len) *len = nr_written; - return string; -} - - -static char *alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; -static int blockIncrement = 8; -/* -static char *alphabet = "ab"; -static int blockIncrement = 2; -*/ -static unsigned char chartable[255] = {0}; - - -char * -XOTclStringIncr(XOTclStringIncrStruct *iss) { - char newch, *currentChar; - - currentChar = iss->buffer + iss->bufSize - 2; - newch = *(alphabet + chartable[(unsigned)*currentChar]); - - while (1) { - if (newch) { /* no overflow */ - *currentChar = newch; - break; - } else { /* overflow */ - *currentChar = *alphabet; /* use first char from alphabet */ - currentChar--; - assert(currentChar >= iss->buffer); - - newch = *(alphabet + chartable[(unsigned)*currentChar]); - if (currentChar < iss->start) { - iss->length++; - if (currentChar == iss->buffer) { - size_t newBufSize = iss->bufSize + blockIncrement; - char *newBuffer = ckalloc(newBufSize); - currentChar = newBuffer+blockIncrement; - /*memset(newBuffer, 0, blockIncrement);*/ - memcpy(currentChar, iss->buffer, iss->bufSize); - *currentChar = newch; - iss->start = currentChar; - ckfree(iss->buffer); - iss->buffer = newBuffer; - iss->bufSize = newBufSize; - } else { - iss->start = currentChar; - } - } - } - } - assert(iss->buffer[iss->bufSize-1] == 0); - assert(iss->buffer[iss->bufSize-2] != 0); - assert(iss->length < iss->bufSize); - assert(iss->start + iss->length + 1 == iss->buffer + iss->bufSize); - - return iss->start; -} - - -void -XOTclStringIncrInit(XOTclStringIncrStruct *iss) { - char *p; - int i = 0; - const size_t bufSize = blockIncrement>2 ? blockIncrement : 2; - - for (p=alphabet; *p; p++) { - chartable[(int)*p] = ++i; - } - - iss->buffer = ckalloc(bufSize); - memset(iss->buffer, 0, bufSize); - iss->start = iss->buffer + bufSize-2; - iss->bufSize = bufSize; - iss->length = 1; - /* - for (i=1; i<50; i++) { - XOTclStringIncr(iss); - fprintf(stderr, "string '%s' (%d)\n", iss->start, iss->length); - } - */ -} - -void -XOTclStringIncrFree(XOTclStringIncrStruct *iss) { - ckfree(iss->buffer); -} Index: xotcl/library/COPYRIGHT =================================================================== diff -u -N --- xotcl/library/COPYRIGHT (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/COPYRIGHT (revision 0) @@ -1,41 +0,0 @@ - * XOTcl - Extended OTcl - * - * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) - * - * (a) Vienna University of Economics and Business Administration - * Dept. of Information Systems / New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - Index: xotcl/library/actiweb/Agent.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/Agent.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/actiweb/Agent.xotcl (revision 0) @@ -1,236 +0,0 @@ -# $Id: Agent.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::actiweb::agent 0.8 - -package require xotcl::trace -package require xotcl::comm::httpAccess -package require xotcl::actiweb::webObject -package require xotcl::store::persistence - -package require XOTcl - -# -# current response codes for agent requests: -# -# OK -- content arrived (can be retrieved with sinks content method) -# ERROR -- error on the place invocation -# FAILED -- call itself failed, e.g. cancel -# - -namespace eval ::xotcl::actiweb::agent { - namespace import ::xotcl::* - - Class AgentMemSink \ - -superclass MemorySink \ - -parameter {{agent ""} responseCode} - - AgentMemSink instproc startCb {r} { - my set d "" - next - } - AgentMemSink instproc notifyCb {r} {next} - AgentMemSink instproc incCb {r t c} {next} - AgentMemSink instproc endCb {r} { - if {[Agent exists responseCodes([$r set responseCode])]} { - my set responseCode OK - } else { - my set responseCode ERROR - } - next - } - AgentMemSink instproc cancelCb {r} { - my set responseCode FAILED - next - } - AgentMemSink instproc endReq {r} { - my instvar agent - if {[Object isobject $agent]} { - if {[$agent exists sinks($r)]} { - $agent unset sinks($r) - } - } - } - - # sink class that calls the agent's endcmd in async calls - # the sink is destroyed automatically after endCmd is called - Class AgentAsyncSink -superclass AgentMemSink - AgentAsyncSink instproc endCb {r} { - next - my instvar endCmd responseCode - set result [my content] - if {[info exists endCmd]} { - eval [concat $endCmd $responseCode \"$result\"] - } - my endReq $r - } - AgentAsyncSink instproc cancelCb {r} { - my instvar endCmd responseCode - if {[info exists endCmd]} { - eval [concat $endCmd $responseCode ""] - } - next - my endReq $r - } - - # sink type for sync request - # has to be destroyed with endReq when content is - # read (see createSyncRequest) - Class AgentSyncSink -superclass AgentMemSink - - - Class Agent -superclass WebObject - Agent array set responseCodes { - 200 {OK} - } - - Agent instproc init args { - #my showCall - #my exportProcs invoke - my array set endCmds {} - my array set sinks {} - next - } - - # - # method to create async requests - # - # endCmd specifies the command (or object method or proc ...) that - # is to be called, when the request has ended, empty for sync requests - # - # args are to be given in the form -name value, like: - # -contentType text/xml - # -method PUT - # -data XXX - # - # returns the request object name - # - Agent instproc createRequest {endCmd url args} { - #my showCall - puts stderr "[self] [self proc]" - my instvar place - set s [AgentAsyncSink create [$place autoname agentmemsink] \ - -agent [self]] - set cmd [list Access createRequest -caching 0 -url $url \ - -informObject $s] - foreach {n v} $args {lappend cmd $n $v} - $s set endCmd $endCmd - set t ::[string trimleft [::eval $cmd $args] :] - my set sinks($t) $s - return $t - } - # - # method to create sync reqs ... url and args identical to - # async req - # - # returns the result of sync request, if "OK" - # otherwise: Raises an error - # - Agent instproc createSyncRequest {url args} { - #my showCall - puts stderr "[self] [self proc]" - my instvar place - set s [AgentSyncSink [$place autoname agentmemsink] -agent [self]] - set cmd [list Access createRequest \ - -httpVersion 1.0 \ - -caching 0 -url $url -informObject $s -blocking 1] - foreach {n v} $args {lappend cmd $n $v} - set t ::[string trimleft [::eval $cmd] :] - #puts stderr "After SyncRequest t=$t [$s responseCode]" - if {[$s responseCode] eq "OK"} { - set content [$s content] - # kill the sink - $s endReq $t - return $content - } - $s endReq $t - error "[self] -- Sync request failed: url=$url, responseCode=[$s responseCode]" - } - # - # invoke a remote method directly along the places' dispatcher - # - Agent instproc invoke {endCmd host receiver args} { - puts stderr [self proc]----host=$host - #my showCall - set url http://$host/${receiver}+[url encode $args] - my createRequest $endCmd $url - } - Agent instproc syncInvoke {host receiver args} { - puts stderr [self proc]----host=$host - #[self] showCall - set url http://$host/${receiver}+[url encode $args] - my createSyncRequest $url - } - - # - # invoke a cloning migration - # - Agent instproc cloneImpl {async host startcmd {endCmd ""}} { - #my showCall - set ai [my agentInfo] - set place [Place getInstance] - - # get the full name of the agent ns from the places's agent mgr - #set ns [${place}::agentMgr::rdfNS searchPrefix agent] - - $ai set agentData(script) [${place}::scriptCreator makeScript [self]] - $ai append agentData(script) [my makeVarScript] - $ai set agentData(startcmd) $startcmd - - set data [$ai getXMLScript [$ai name]] - ###puts $data - - #set data [[Place getInstance]::rdfCreator createFromTriples [$ai getTriples]] - if {$async} { - return [my createRequest $endCmd http://$host/[my selfName] \ - -contentType text/xml \ - -method PUT \ - -data $data] - } else { - return [my createSyncRequest http://$host/[my selfName] \ - -contentType text/xml \ - -method PUT \ - -data $data] - } - } - Agent instproc clone {host startCmd endCmd} { - my cloneImpl 1 $host $startCmd $endCmd - } - Agent instproc syncClone {host startCmd} { - my cloneImpl 0 $host $startCmd - } - - # - # invoke a migration that destroys the object in the current place - # - Agent instproc migrateImpl {async host startcmd {endCmd ""}} { - ### GN ??? - puts stderr "--- async=$async" - if {$async} { - set r [my clone $host $startcmd $endCmd] - } else { - set r [my syncClone $host $startcmd] - } - puts stderr "--- [self] destroy +++ " - my destroy ;### FIXME: this does not work in the asynchronous case - return $r - } - Agent instproc migrate {host startCmd endCmd} { - #my migrateImpl 1 $host $startCmd $endCmd - my migrateImpl 0 $host $startCmd $endCmd - } - Agent instproc syncMigrate {host startCmd} { - my migrateImpl 0 $host $startCmd - } - # - # query a place with its hostname for its name - # - Agent instproc getPlaceFromHostName {endCb host} { - set r [my autoname __result] - my createRequest "[self]::$r set" http://$host/ - return [set [self]::$r] - } - - namespace export AgentMemSink AgentAsyncSink AgentSyncSink Agent -} - -namespace import ::xotcl::actiweb::agent::* Index: xotcl/library/actiweb/AgentManagement.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/AgentManagement.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/actiweb/AgentManagement.xotcl (revision 0) @@ -1,218 +0,0 @@ -# $Id: AgentManagement.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::actiweb::agentManagement 0.8 - -package require xotcl::rdf::parser -package require xotcl::rdf::triple -package require xotcl::actiweb::agent - -package require XOTcl - -namespace eval ::xotcl::actiweb::agentManagement { - namespace import ::xotcl::* - - Class AgentInfo -parameter { - {name ""} - {changed 1} - } - - AgentInfo instproc init args { - next - # - # array providing info on a (migrated) agent - # - my array set agentData {} - RDFTripleDB [self]::db - my trace variable agentData w [list [self] changeOccured] - my trace variable name w [list [self] changeOccured] - } - - AgentInfo instproc getXMLScript {name} { - #my showCall - set s { - - } - set s [subst -nobackslashes $s] - foreach n [my array name agentData] { - append s " - [my set agentData($n)] " - } - append s " - -" - } - - AgentInfo instproc changeOccured args {my set changed 1} - - AgentInfo instproc getTriples {} { - #my showCall - if {[my set changed]} { - # build up the triple-db - [self]::db reset - set place [Place getInstance] - set subject "http://[$place set host]:[$place set port]/[my name]" - foreach n [my array names agentData] { - [self]::db add $n $subject [my set agentData($n)] - } - } - return [[self]::db getTriples] - } - - AgentInfo instproc print {} { - puts "AGENT-INFO:" - puts "Name == [my set name]" - foreach a [my array names agentData] { - puts "$a == [my set agentData($a)]" - } - } - - Class AgentVisitor -superclass NodeTreeVisitor -parameter { - {openProperty ""} - {agentInfo ""} - {rdfNS {[my info parent]::rdfNS}} - } - - AgentVisitor instproc fullName {obj n} { - set ns [$obj resolveNS] - return [$ns getFullName $n] - } - - AgentVisitor instproc visit {objName} { - #puts stderr "AgentVisitor visit -- $objName" - set ai [my set agentInfo] - set cl [$objName info class] - #puts stderr "AgentVisitor visit -- $objName cl=$cl <[$ai name]>" - if {[$ai name] eq ""} { - #### not fixed yet - puts stderr "my fixme (AgentManagement)" - if {$cl eq "::About" && - [string first "::Description" [[$objName info parent] info class]] == 0} { - $ai name [$objName set content] - } - } else { - #puts stderr C=<[$objName content]> - #$cl showVars - switch -exact $cl { - ::RDFProperty { - set c [$objName content] - #$objName showVars - if {[$objName exists pcdata]} { - $ai set agentData($c) [lindex [$objName getPCdataList] 0] - } else { - #puts stderr "empty PCDATA" - } - } - } - } - } - - AgentVisitor instproc interpretNodeTree node { - if {[my set agentInfo] eq "" } { - error "Agent Visitor: no agent info provided." - } - $node accept [self] - } - - Class AgentMgr -superclass Agent \ - -parameter { - {acceptedData [list script startcmd senderPlace senderPort senderHost]} - } - - AgentMgr instproc init args { - next - my array set agents {} - # - # this ns class holds the prefix/Rdf-ns pairs used by this - # agent mgr (with default values) - # - XMLNamespace [self]::rdfNS - [self]::rdfNS add agent {http://www.xotcl.org/schema/agent#} - [self]::rdfNS add service {http://www.xotcl.org/schema/service#} - [self]::rdfNS add xotcl {http://www.xotcl.org/schema/xotcl#} - RDFParser [self]::rdfParser - AgentVisitor [self]::agentVisitor - - #package require xotcl::xml::printVisitor - #PrintVisitor [self]::pv - } - - AgentMgr instproc register {name} { - set ai [AgentInfo [self]::[my autoname agentInfo]] - my set agents($name) $ai - $ai name $name - return $ai - } - - AgentMgr instproc deregister {name} { - if {[my info agents $name]} { - # destroy the agents info objects - #my showMsg "calling destroy on [my set agents($name)]" - [my set agents($name)] destroy - # unset the var - my unset agents($name) - } - } - - AgentMgr instproc info args { - if {[lindex $args 0] eq "agents"} { - if {[llength $args] > 1} { - return [my exists agents([lindex $args 1])] - } else { - return [my array names agents] - } - } - next - } - - # - # parses the data of a migration request into a new agent - # info object - # - # name must be stringleft : !! - AgentMgr instproc parseData {name data} { - set ai [my register $name] - next - - [self]::rdfParser reset - [self]::rdfParser parse $data - - #puts stderr =========================================================== - #[self]::pv interpretAll [self]::rdfParser - #puts stderr =========================================================== - - [self]::agentVisitor agentInfo $ai - #foreach tn [[self]::rdfParser info children topNode*] { - # [self]::agentVisitor interpretNodeTree $tn - #} - - [self]::agentVisitor interpretAll [self]::rdfParser - - #puts "************** Received Agent:" - #$ai print - - return $ai - } - - AgentMgr instproc immigrate {AI} { - #set ns [[self]::rdfNS searchPrefix agent] - #::eval [$AI set agentData(${ns}script)] - - #puts stderr "immigrate call showVars" - #$AI showVars - #puts stderr "immigrate showVars done" - - ::eval [$AI set agentData(agent:script)] - #puts stderr "immigrate persistentVars = '[[$AI name] persistentVars]'" - #foreach v [[$AI name] info vars] { $n persistent $v } - - if {[$AI exists agentData(agent:startcmd)]} { - ::after 10 [list [$AI name] [$AI set agentData(agent:startcmd)]] - } - return "" - } - - namespace export AgentInfo AgentVisitor AgentMgr -} - -namespace import ::xotcl::actiweb::agentManagement::* Index: xotcl/library/actiweb/COPYRIGHT =================================================================== diff -u -N --- xotcl/library/actiweb/COPYRIGHT (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/actiweb/COPYRIGHT (revision 0) @@ -1,41 +0,0 @@ - * XOTcl - Extended OTcl - * - * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) - * - * (a) Vienna University of Economics and Business Administration - * Dept. of Information Systems / New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - Index: xotcl/library/actiweb/HtmlPlace.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/HtmlPlace.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/actiweb/HtmlPlace.xotcl (revision 0) @@ -1,47 +0,0 @@ -# $Id: HtmlPlace.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::actiweb::htmlPlace 0.8 - -package require xotcl::trace -package require xotcl::actiweb::httpPlace -package require xotcl::store::persistence -package require xotcl::actiweb::agent -package require xotcl::actiweb::pageTemplate - -package require XOTcl - -namespace eval ::xotcl::actiweb::htmlPlace { - namespace import ::xotcl::* - - Class HtmlPlace -superclass Place -parameter {allowExit} - - HtmlPlace instproc init args { - next - # - # just define a minimal object that can react - # with HTML decoration, if the called object - # doesn't exist - PageTemplateHtml create [self]::start.html - - my startingObj [self]::start.html - if {[my exists allowExit]} { - set exitObj [WebObject create [self]::[my set allowExit]] - [Place getInstance] exportObjs $exitObj - $exitObj proc default {} {after 500 ::exit; return "Server terminates"} - } - } - HtmlPlace instproc default {} { - set place [string trimleft [self] :] - set msg "Place $place -

    Place $place

    Try one of the following links:
      " - foreach o [my exportedObjs] { - set o [string trimleft $o :] - append msg "
    • $o
    • " - } - append msg "
    \n" - } - - namespace export HtmlPlace -} - -namespace import ::xotcl::actiweb::htmlPlace::* Index: xotcl/library/actiweb/HttpPlace.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/HttpPlace.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/actiweb/HttpPlace.xotcl (revision 0) @@ -1,270 +0,0 @@ -# $Id: HttpPlace.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::actiweb::httpPlace 0.8 - -package require xotcl::trace -package require xotcl::actiweb::invoker -package require xotcl::actiweb::webObject -package require xotcl::comm::httpd -package require xotcl::scriptCreation::scriptCreator -package require xotcl::store::persistence -package require xotcl::pattern::singleton -package require xotcl::registry::registry -package require xotcl::actiweb::agentManagement -package require xotcl::rdf::tripleRecreator - -package require XOTcl - -namespace eval ::xotcl::actiweb::httpPlace { - namespace import ::xotcl::* - - - Singleton Place -superclass Invoker -parameter { - {exportedObjs ""} - {startingObj ""} - {startCommand ""} - {root $::env(HOME)/public_html} - {port 8086} - {redirect [list]} - {logdir $::xotcl::logdir} - {host localhost} - {allowImmigrationHosts ""} - persistenceFile persistenceDir bccFile bccDir dbPackage - {startHTTPServer 1} - } - - # Giving a bccFile (and possibly bccDir) as optional parameter means - # that an identical copy database will be created in that - # location (e.g. for creating a backup on a second hard drive. - - Place instproc exportObjs args { - foreach obj $args { - my lappend exportedObjs [string trimleft $obj :] - puts stderr "*** exporting $obj, self=[self], objs=[my set exportedObjs]" - } - } - Place instproc isExportedObj obj { - expr {[lsearch [my exportedObjs] [string trimleft $obj :]] != -1} - } - Place instproc default {} { - [self] - } - Place instproc init args { - if {[my set startHTTPServer]} { - Httpd [self]::httpd \ - -port [my port] \ - -root [my root] \ - -redirect [my redirect] \ - -logdir [my logdir] \ - -httpdWrk Place::HttpdWrk - } - # - # PersistenceMgr object for web entities - # - ##### so ist das nicht toll ... init args sollten anders konfigurierbar sein - PersistenceMgr [self]::agentPersistenceMgr -dbPackage multi - - if {[my exists dbPackage]} { - set dbp [my set dbPackage] - } else { - set dbp "" - } - - - if {![my exists persistenceDir]} { - my persistenceDir [string trimleft [self] :] - } - if {![my exists persistenceFile]} { - my persistenceFile persistentObjs-[my port] - } - - [self]::agentPersistenceMgr store add $dbp \ - -dirName [my persistenceDir] \ - -fileName [my persistenceFile] - - if {[my exists bccDir] || [my exists bccFile]} { - if {![my exists bccDir]} { - my bccDir [my set persistenceDir] - } - if {![my exists bccFile]} { - my bccFile [my persistenceFile] - } - [self]::agentPersistenceMgr store add $dbp \ - -dirName [my bccDir] \ - -fileName [my bccFile] - } - - AgentMgr create [self]::agentMgr - RDFCreator create [self]::rdfCreator - - # - # minimal obj for default behavior of the place -> calls go - # to web entities default (customize through a redirecting proc - # as in HtmlPlace or changing startingObj) - # - WebObject create [self]::start - my startingObj [self]::start - Registry [self]::registry - ErrorMgr [self]::error - - ScriptCreator [self]::scriptCreator -dependencyChecking 0 - - my exportObjs [self]::start [self]::agentMgr [self]::registry - next - } - - Place instproc startEventLoop args { - if {[llength $args] > 0} { - set startCommand [lindex $args 0] - ::eval $startCommand - } - - vwait forever ;# if we are in xotclsh call the event loop... - } - - ### - ### Mixin-Classes for Http/Wrk that restricts the usable HTTP methods - ### - Class RestrictHTTPMethods -parameter { - {allowedHTTPMethods "GET PUT HEAD POST CGI"} - } - RestrictHTTPMethods instproc init args { - next - my lappend workerMixins RestrictHTTPMethods::Wrk - } - Class RestrictHTTPMethods::Wrk - RestrictHTTPMethods::Wrk instproc respond {} { - my instvar method - [my info parent] instvar allowedHTTPMethods - if {[lsearch $allowedHTTPMethods $method] != -1} { - return [next] - } else { - my log Error "Restricted Method $method called" - my replyCode 405 - my replyErrorMsg - } - } - - Class Place::HttpdWrk -superclass Httpd::Wrk - - Place::HttpdWrk instproc init args { - my set place [Place getInstance] - next - #puts "New Http-Worker: [self class]->[self] on [my set place]" - } - - Place::HttpdWrk instproc parseParams {o m a call} { - upvar [self callinglevel] $o obj $m method $a args - ### - set decodedCall [url decodeItem $call] - #my showMsg decodedCall=$decodedCall - if {[regexp {^([^ ]*) ?([^ ]*) ?(.*)$} $decodedCall _ \ - obj method args]} { - #foreach a [my set formData] {lappend args [$a set content]} - #puts stderr "Parsed -- Obj: $obj, Method: $method, Args: $args" - return 1 - } else { - puts stderr "could not parse <$decodedCall>" - return 0 - } - } - Place::HttpdWrk instproc respond-HEAD {} { - my respond-GET; ### sendMsg inhibits content for method HEAD - } - Place::HttpdWrk instproc respond-GET {} { - my instvar fileName resourceName place - if {$resourceName eq ""} { - my sendMsg [$place default] text/html ;# kind of index.html - } elseif {[my parseParams obj method arguments $resourceName]} { - if {![my isobject $obj] && [file readable $fileName]} { - next ;# let Httpd handle this - } else { - set response [$place invokeCall obj status $method $arguments] - #puts stderr "RESPONSE: $response" - # - # let the object's sending strategy mixin choose - # the appropriate sending mode - # - # $obj showClass - if {[info exists status] && $status >= 300} { - my replyCode $status - my replyErrorMsg $response - } else { - #my lappend replyHeaderFields Cache-Control maxage=0 - my lappend replyHeaderFields Pragma no-cache - $obj send [self] $response - } - } - } else { - my set version 1.0 - my replyCode 400 - my replyErrorMsg [my callError "Could not parse: " $resourceName] - } - } - Place::HttpdWrk instproc respond-POST {} { - my instvar resourceName place - my respond-GET - } - - - Place::HttpdWrk instproc respond-PUT {} { - my instvar resourceName place data - #my showCall - - if {$resourceName ne ""} { - if {[my parseParams obj m a $resourceName]} { - set obj [string trimleft $obj :] - set AMgr ${place}::agentMgr - - if {[info commands $obj] eq "" && - ![$AMgr info agents $obj]} { - #puts stderr "Receiving to put --------------------------------$obj $data" - set AI [$AMgr parseData $obj $data] - #puts stderr "parray --${AI}::agentData------------------------" - #parray ${AI}::agentData - #puts stderr "parray --${AI}::agentData----------------DONE--------" - #$AI showVars - #puts stderr "----[$AI exists agentData(agent:script)]----" - if {[$AI exists agentData(agent:script)]} { - set immigrateResult [$AMgr immigrate $AI] - #puts stderr "immigrateResult=<$immigrateResult>" - my replyCode 200 - my sendMsg $immigrateResult text/plain - } else { - my set version 1.0 - my replyCode 400 - my replyErrorMsg "Migration failed" - } - } else { - my set version 1.0 - my replyCode 400 - my replyErrorMsg "Migration: object name already in use." - } - } else { - my set version 1.0 - my replyCode 400 - my replyErrorMsg "Migration call must provide object name" - } - } else { - # return the own place name -> any client can call the place via - # placename::start ! - my sendMsg $place text/plain - } - } - - namespace export RestrictHTTPMethods Place - namespace eval RestrictHTTPMethods { - namespace export Wrk - } - namespace eval Place { - namespace export HttpdWrk - } -} - -namespace import ::xotcl::actiweb::httpPlace::* -namespace eval RestrictHTTPMethods { - namespace import ::xotcl::actiweb::httpPlace::RestrictHTTPMethods::* -} -namespace eval Place { - namespace import ::xotcl::actiweb::httpPlace::Place::* -} Index: xotcl/library/actiweb/Invoker.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/Invoker.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/actiweb/Invoker.xotcl (revision 0) @@ -1,165 +0,0 @@ -# $Id: Invoker.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::actiweb::invoker 0.8 - -package require XOTcl - -namespace eval ::xotcl::actiweb::invoker { - namespace import ::xotcl::* - - Class AbstractInvoker - AbstractInvoker abstract instproc invokeCall {o method arguments} - AbstractInvoker abstract instproc eval {obj method arguments} - # - # error types are: tclError, invocationError - # - AbstractInvoker abstract instproc callError {type msg obj arguments} - - Class Invoker -superclass AbstractInvoker -parameter {{place [self]}} - - Invoker instproc handleException {response} { - if {[my isExceptionObject $response]} { - set exceptionObj $response - switch [$exceptionObj info class] { - ::RedirectException { - set obj [$exceptionObj obj] - set method [$exceptionObj method] - set arguments [$exceptionObj arguments] - set response [my eval $obj $method $arguments] - } - ::ErrorException { - set response [$exceptionObj set errorText] - } - } - $exceptionObj destroy - } - return $response - } - - Invoker instproc invokeCall {o s method arguments} { - upvar [self callinglevel] $o obj $s status - my instvar place - set response "" - if {[$place isExportedObj $obj]} { - # if method is not given -> call default on the object - if {$method eq ""} { - set method default - } - if {[$obj isExportedProc $method]} { - #puts stderr "ExportedProcs of $obj: [$obj exportedProcs]" - #puts stderr "Call: $obj -- $method -- $arguments" - set response [my eval $obj $method $arguments] - } else { - #puts stderr "ExportedProcs of $obj: [$obj exportedProcs]" - set response [my callError invocationError [$place startingObj] \ - "Method not found or not exported" \ - "$obj $method $arguments"] - set status 405 - } - } else { - set called $obj - set obj [$place startingObj] - set response [my callError invocationError $obj \ - "Object '$called' unknown" ""] - set status 404 - } - - return [my handleException $response] - } - - # - # tests whether "name" is an exception object or not - # - Invoker instproc isExceptionObject name { - if {[Object isobject $name] && [$name istype Exception]} { - return 1 - } - return 0 - } - - # - # central eval -- all remote call - # are invoked through this method - # - Invoker instproc eval {obj method arguments} { - puts stderr "[clock format [clock seconds] \ - -format %Y/%m/%d@%H:%M:%S] \ - Eval Call: $obj $method $arguments" - if {[catch { - set r [::eval $obj $method $arguments] - } ei]} { - set r [my callError tclError $obj $ei "$obj $method $::errorInfo"] - } - return $r - } - - Invoker instproc callError {type obj msg arguments} { - [my set place]::error $type $obj $msg $arguments - } - - Class ErrorMgr - ErrorMgr instproc isHtml o { - if {[my isobject $o]} { - if {[$o exists contentType]} { - if {[$o set contentType] eq "text/html"} { - return 1 - } - } - } - return 0 - } - - ErrorMgr instproc invocationError {obj msg arguments} { - my showCall - set ee [ErrorException [self]::[my autoname ee]] - $ee instvar errorText - if {[my isHtml $obj]} { - set errorText "

    invocation error: $msg" - if {[llength $arguments] > 0} { - append errorText ":\n

    object: '[lindex $arguments 0]' \n" - } else { - append errorText \n - } - if {[llength $arguments] > 1} { - append errorText "

    call: '[lrange $arguments 1 end]' \n" - } - } else { - set errorText "invocation error: $msg $arguments" - } - return $ee - } - - ErrorMgr instproc tclError {obj msg arguments} { - set ee [ErrorException [self]::[my autoname ee]] - if {[my isHtml $obj]} { - $ee errorText "

    tcl error: '$msg' \n

    $arguments
    " - } else { - $ee errorText "tcl error: '$msg'\n$::errorInfo" - } - return $ee - } - - # - # exceptions in invocation behavior - # - Class Exception - # - # Execpetion that tells the invoker to redirect the call to - # parameters - # - Class RedirectException -superclass Exception -parameter { - {obj ""} - {method ""} - {arguments ""} - } - - Class ErrorException -superclass Exception -parameter { - {errorText ""} - } - - namespace export AbstractInvoker \ - Invoker ErrorMgr Exception \ - RedirectException ErrorException -} - -namespace import ::xotcl::actiweb::invoker::* Index: xotcl/library/actiweb/PlaceAccessControl.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/PlaceAccessControl.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/actiweb/PlaceAccessControl.xotcl (revision 0) @@ -1,90 +0,0 @@ -# $Id: PlaceAccessControl.xotcl,v 1.7 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::actiweb::placeAccessControl 0.8 - -package require xotcl::comm::httpd -package require xotcl::actiweb::httpPlace - -package require XOTcl - -# -# Simple Object Pwd Protection with BasicAccessControl -# -#Usage example: -#ConferenceOrgPlace confPlace -port $placeport -root [pwd] \ - # -mixin PlaceAccessControl -# -#confPlace protect conference.html [confData set password] -# -#confPlace setPasswd conference.html xxx - -namespace eval ::xotcl::actiweb::placeAccessControl { - namespace import ::xotcl::* - - Class ObjectAccessControl -superclass BasicAccessControl - - ObjectAccessControl instproc protectedResource {fn method varAuthMethod varRealm} { - # check whether access to $fn via $method is protected - upvar [self callinglevel] $varAuthMethod authMethod $varRealm realm - my instvar root - # we check only the current directory, not the parent directories - set call [url decodeItem $fn] - regsub "^$root" $call "" call - set call [string trimleft $call /] - set call [string trimleft $call :] - regexp {^([^ ]*)} $call _ call - set call "$root/$call" - - foreach i [list $call $call:$method] { - #puts stderr "check <$i>" - if {[my exists protected($i)]} { - set realm [my set protected($i)] - set authMethod Basic - return 1 - } - } - return 0 - } - - Class PlaceAccessControl - PlaceAccessControl instproc init args { - next - [self]::httpd mixin add ObjectAccessControl - [self]::httpd initWorkerMixins - } - - PlaceAccessControl instproc protect {objName id pwd} { - set objName [string trimleft $objName :] - [self]::httpd protectDir $objName $objName {} - if {$pwd ne ""} { - my setPassword $objName $id $pwd - } - } - - PlaceAccessControl instproc credentialsNotOk {credentials authMethod realm} { - #my instvar passwd - #parray passwd - next - } - - PlaceAccessControl instproc setPassword {realm id pwd} { - set httpd [self]::httpd - if {[$httpd exists passwd($realm:$id)]} { - $httpd unset passwd($realm:$id) - $httpd set passwd($realm:$id) $pwd - } else { - $httpd addRealmEntry $realm "$id $pwd" - } - #$httpd set passwd($realm:admin) nimda - } - PlaceAccessControl instproc removeID {realm id} { - set httpd [self]::httpd - if {[$httpd exists passwd($realm:$id)]} { - $httpd unset passwd($realm:$id) - } - } - - namespace export ObjectAccessControl PlaceAccessControl -} - -namespace import ::xotcl::actiweb::placeAccessControl::* Index: xotcl/library/actiweb/SecureHtmlPlace.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/SecureHtmlPlace.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/actiweb/SecureHtmlPlace.xotcl (revision 0) @@ -1,18 +0,0 @@ -# $Id: SecureHtmlPlace.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::actiweb::secureHtmlPlace 0.8 - -package require xotcl::actiweb::secureHttpPlace -package require xotcl::actiweb::htmlPlace - -package require XOTcl - -namespace eval ::xotcl::actiweb::secureHtmlPlace { - namespace import ::xotcl::* - - Class SecureHtmlPlace -superclass {SecurePlace HtmlPlace} - - namespace export SecureHtmlPlace -} - -namespace import ::xotcl::actiweb::secureHtmlPlace::* Index: xotcl/library/actiweb/SecureHttpPlace.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/SecureHttpPlace.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/actiweb/SecureHttpPlace.xotcl (revision 0) @@ -1,52 +0,0 @@ -# $Id: SecureHttpPlace.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::actiweb::secureHttpPlace 0.8 - -package require xotcl::actiweb::httpPlace - -package require XOTcl - -namespace eval ::xotcl::actiweb::secureHttpPlace { - namespace import ::xotcl::* - - Class SecurePlace -superclass Place -parameter { - {port 443} - {requestCert 0} - {requireValidCert 0} - {certfile server.pem} - {keyfile server.key} - {cafile cacert.pem} - {infoCb {}} - } - - SecurePlace instproc startHttpd {} { - my instvar port root requestCert requireValidCert \ - certfile cafile infoCb keyfile - Httpsd h1 -port $port \ - -root $root \ - -httpdWrk SecurePlace::HttpsdWrk \ - -infoCb $infoCb \ - -requestCert $requestCert \ - -requireValidCert $requireValidCert \ - -certfile $certfile -cafile $cafile \ - -keyfile $keyfile - } - - SecurePlace instproc init args { - my set startHTTPServer 0 - next - [self] startHttpd - } - - Class SecurePlace::HttpsdWrk -superclass {Httpsd::Wrk Place::HttpdWrk} - - namespace export SecurePlace - namespace eval SecurePlace { - namespace export HttpsdWrk - } -} - -namespace import ::xotcl::actiweb::secureHttpPlace::* -namespace eval SecurePlace { - namespace import ::xotcl::actiweb::secureHttpPlace::SecurePlace::* -} Index: xotcl/library/actiweb/SendStrategy.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/SendStrategy.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/actiweb/SendStrategy.xotcl (revision 0) @@ -1,51 +0,0 @@ -# $Id: SendStrategy.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::actiweb::sendStrategy 0.8 - -package require XOTcl - -# -# some simple sending strategy classes -- to be used as mixins -# for web objects -# - -namespace eval ::xotcl::actiweb::sendStrategy { - namespace import ::xotcl::* - - Class SendStrategy - SendStrategy abstract instproc send {httpWrk string} - - # - # send the response given from the place as plain text - # - Class Send=PlainString -superclass SendStrategy - Send=PlainString instproc send {httpWrk string} { - $httpWrk sendMsg $string text/plain - } - - # - # send the response given from the place with content - # type of the obj, if it exists - # - Class Send=TypedString -superclass SendStrategy - Send=TypedString instproc send {httpWrk string} { - $httpWrk sendMsg $string [my set contentType] - } - - # - # send file specified in obj's instvar filename - # - Class Send=File -superclass SendStrategy - Send=File instproc send {httpWrk {response ""}} { - if {[my exists contentType]} { - $httpWrk sendFile [my set filename] [my set contentType] - } else { - $httpWrk sendFile [my set filename] "" - } - } - - namespace export \ - SendStrategy Send=PlainString Send=TypedString Send=File -} - -namespace import ::xotcl::actiweb::sendStrategy::* Index: xotcl/library/actiweb/UserMgt.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/UserMgt.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/actiweb/UserMgt.xotcl (revision 0) @@ -1,100 +0,0 @@ -# $Id: UserMgt.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::actiweb::userMgt 0.8 - -package require XOTcl - -namespace eval ::xotcl::actiweb::userMgt { - namespace import ::xotcl::* - - Class UserMgt - Class UserMgt::User -parameter {name password} - - UserMgt instproc addUser {name password} { - [self class]::User [self]::$name -name $name -password $password - } - - UserMgt set exportedInstprocs [list \ - addUser \ - listUsers \ - deleteUser \ - userMgtOptions\ - ] - - UserMgt instproc init args { - next - my exportedProcs [concat [my exportedProcs] [[self class] set exportedInstprocs]] - } - - UserMgt instproc listUsers {} { - #showCall - set users "" - foreach u [my info children] { - lappend users [namespace tail $u] - } - return $users - } - - UserMgt instproc deleteUser {name} { - if {[[self class]::User info instances [self]::$name] != ""} { - [self]::$name destroy - } - } - UserMgt instproc userMgtOptions {} { - return [[self class] set exportedInstprocs] - } - - Class UserMgtHtml -superclass HtmlRep - - UserMgtHtml instproc addUser args { - set place [HtmlPlace getInstance] - if {$args eq ""} { - set action [url encodeItem "[my htmlCall] [my repObj] [self proc]"] - set c { -
    -

    Name: - -

    Password: - -

    - - - } - set c [subst -nobackslashes -nocommands $c] - - return [my simplePage $place "New User" $c] - } else { - if {[llength $args] > 1} { - set name [lindex $args 0] - set password [lindex $args 1] - set user [[my repObj] [self proc] $name $password] - set c "\n$name entered $place successfully\n" - return [my simplePage "New User" "New User" $c] - } else { - # - # error !!! - } - return [my [self proc]] - } - } - - UserMgtHtml instproc listUsers {} { - set c "" - foreach u [[my repObj] [self proc]] { - append c "

    $u \n" - } - return [my simplePage "User List" "User List" $c] - } - - UserMgtHtml instproc userMgtOptions {} { - set c "" - foreach u [[my repObj] [self proc]] { - append c "

    $u \n" - } - return [my simplePage "User Management Options" "User Management Options" $c] - } - - namespace export UserMgt UserMgtHtml -} - -namespace import ::xotcl::actiweb::userMgt::* Index: xotcl/library/actiweb/WebAgent.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/WebAgent.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/actiweb/WebAgent.xotcl (revision 0) @@ -1,61 +0,0 @@ -# $Id: WebAgent.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::actiweb::webAgent 0.8 - -package require xotcl::actiweb::agent -package require xotcl::actiweb::invoker -package require xotcl::mixinStrategy - -package require XOTcl - -namespace eval ::xotcl::actiweb::webAgent { - namespace import ::xotcl::* - - # - # Web Agent are special agents that allow us to define another - # object in the paramter webfacade as a facade for the web agent - # itself and the sub-system shielded by the web agent with an interface - # for agents - # - Class WebAgent -superclass Agent - - WebAgent instproc init args { - next - } - - # - # let the web agents facade handle the call -> interprete args - # as "method args" - # return result of the invoker - # - #WebAgent instproc invokeFacade {args} { - # set a "" - # set m "" - # set l [llength $args] - # set o [my webfacade] - # if {$l > 0} { - # set m [lindex $args 0] - # } - # if {$l > 1} { - # set a [lrange $args 1 end] - # } - # - # #puts stderr "Web Agent [self]->invoke: OBJ: $o PROC: $m ARGS: $a" - # - # # - # # tell the invoker to redirect the call to the webfacade object - # # - # set re [RedirectException [self]::[my autoname re] \ - # -obj $o -method $m -arguments $a] - # - # return $re - #} - - #WebAgent instproc default args { - # return [next] - #} - - namespace export WebAgent -} - -namespace import ::xotcl::actiweb::webAgent::* Index: xotcl/library/actiweb/WebDocument.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/WebDocument.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/library/actiweb/WebDocument.xotcl (revision 0) @@ -1,226 +0,0 @@ -# $Id: WebDocument.xotcl,v 1.9 2007/08/14 16:38:26 neumann Exp $ - -package provide xotcl::actiweb::webDocument 0.8 - -package require xotcl::actiweb::webObject -package require xotcl::comm::httpAccess -package require xotcl::mixinStrategy -package require xotcl::actiweb::sendStrategy - -package require XOTcl - -namespace eval ::xotcl::actiweb::webDocument { - namespace import ::xotcl::* - - Class WebDocument -superclass WebObject \ - -parameter { - {content ""} - filename - } - - - WebDocument instproc init args { - my exportProcs content contentType - next - my mixinStrategy ::Send=TypedString - } - - WebDocument instproc attachFile filename { - my filename $filename - my set oldSendStrategy [my mixinStrategy ::Send=File] - my contentType [Mime guessContentType $filename] - } - - WebDocument instproc detachFile {} { - my mixinStrategy [my set oldSendStrategy] - my unset contentType - my unset filename - } - - WebDocument instproc default args { - if {[my exists content]} { - return [my content] - } - return "" - } - #WebDocument instproc contentLength {} { - # my showCall - # return [expr {[string length [my content]] + 1}] - #} - - - Class TextDocument -superclass WebDocument - TextDocument instproc init args { - next - my contentType text/plain - } - - - Class HtmlDocument -superclass TextDocument - HtmlDocument instproc init args { - next - my contentType text/html - } - - Class FileDocument -superclass WebDocument - - # - # class factory creates classes on the fly if they do not exist - # already, otherwise return exisiting class - # - # auch flyweigth - Class DocumentClassFactory - DocumentClassFactory abstract instproc getClass contentType - - Class FileDocumentClassFactory -superclass DocumentClassFactory - FileDocumentClassFactory instproc getClass contentType { - if {[FileDocument info classchildren $contentType] eq ""} { - Class ::FileDocument::${contentType} -superclass FileDocument - } - return ::FileDocument::${contentType} - } - - Class DocumentFactory - DocumentFactory abstract instproc create {name args} - - Class FileDocumentFactory -superclass DocumentFactory - FileDocumentFactory instproc create {name class filename} { - $class $name - #$name contentType [$class set contentType] - $name attachFile $filename - return $name - } - - Class FileObjectifier - - FileObjectifier instproc init args { - next - FileDocumentClassFactory [self]::clFactory - FileDocumentFactory [self]::objFactory - } - - # - # filename must be given with full path -> - # create objects with filename's tail (prefix can be used to - # give object name a preceding dir) - # - FileObjectifier instproc objectifyFile {place filename {prefix ""}} { - set obj "" - if {[file isfile $filename]} { - set type [Mime guessContentType $filename] - #if {$type ne "unknown/unknown"} { - set fn [string trimleft $prefix/[file tail $filename] /] - set class [[self]::clFactory getClass $type] - set obj [[self]::objFactory create $fn $class $filename] - $place exportObjs $obj - #puts stderr "...objectified: $obj of class $class" - #} - } - return $obj - } - - # - # objectify a whole directory tree - # - FileObjectifier instproc objectifyTree {place dir {prefix ""}} { - if {[file isdirectory $dir]} { - foreach f [glob -nocomplain $dir/*] { - if {[file isfile $f]} { - my objectifyFile $place $f $prefix - } elseif {[file isdirectory $f]} { - my objectifyTree $place $f $prefix/[file tail $f] - } - } - } - } - - - Class GraphicDirectoryObjectifier -superclass FileObjectifier \ - -parameter {{thumbnaildir [::xotcl::tmpdir]}} - GraphicDirectoryObjectifier instproc objectifyTree {place dir {prefix ""}} { - if {[file isdirectory $dir]} { - set indexpage "" - set title "" - set date "" - foreach f [lsort [glob -nocomplain $dir/* $dir/{.date,.title}]] { - set exportedfn [string trimleft $prefix/[file tail $f] /] - if {[file isfile $f]} { - set type [Mime guessContentType $f] - if {[string match "image/*" $type]} { - set class [[self]::clFactory getClass $type] - $class $exportedfn -init -attachFile $f - $place exportObjs $exportedfn - #puts stderr "...objectified: FN=$exportedfn cl=$class d=$dir o=$exportedfn" - ###### - set expThumbnaildir [file dirname $exportedfn]/.thumbnail - set thumbnaildir [file dirname $f]/.thumbnail - if {![file isdirectory $thumbnaildir]} { - file mkdir $thumbnaildir - } - set thumbnail $thumbnaildir/[file tail $f] - set expThumbnail $expThumbnaildir/[file tail $f] - if {![file exists $thumbnail]} { - catch {exec djpeg -pnm $f | \ - pnmscale -xscale .2 -yscale .2 | ppmquant 256 | \ - ppmtogif > $thumbnail} - } - $class $expThumbnail -init -attachFile $thumbnail - $place exportObjs $expThumbnail - #### - append indexpage "" \ - "$exportedfn
    \n" - } elseif {[string match *.title $exportedfn]} { - set title [my fileContent $f] - } elseif {[string match *.date $exportedfn]} { - set date

    [my fileContent $f]

    - } - } elseif {[file isdirectory $f]} { - if {[file exists $f/.title]} { - set desc ": [my fileContent $f/.title]" - } else { - set desc "" - } - append indexpage "" \ - "$exportedfn$desc
    \n" - my objectifyTree $place $f $exportedfn - } - set gindex [string trimleft $prefix/gindex.html /] - HtmlDocument $gindex -content \ - "$title

    $title

    \ - $date$indexpage" - #puts stderr "mixins of HtmlDocument=<[$gindex info mixins]>" - $gindex mixinStrategy ::Send=TypedString - #$gindex showVars - receiver exportObjs $gindex - } - } - } - GraphicDirectoryObjectifier instproc fileContent {f} { - set FILE [open $f r] - set content [read $FILE] - close $FILE - return $content - } - - - - Class HtmlProxy -superclass HtmlDocument -parameter realSubject - HtmlProxy instproc init args { - next - [Place getInstance] exportObjs [self] - } - HtmlProxy instproc unknown {m args} { - my instvar realSubject - ::eval $realSubject $m $args - return [my default] - } - - namespace export \ - WebDocument TextDocument HtmlDocument FileDocument \ - DocumentClassFactory FileDocumentClassFactory \ - DocumentFactory FileDocumentFactory \ - FileObjectifier GraphicDirectoryObjectifier \ - HtmlProxy -} - -namespace import ::xotcl::actiweb::webDocument::* Index: xotcl/library/actiweb/WebObject.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/WebObject.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/actiweb/WebObject.xotcl (revision 0) @@ -1,130 +0,0 @@ -# $Id: WebObject.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::actiweb::webObject 0.8 - -package require xotcl::actiweb::sendStrategy -package require xotcl::mixinStrategy -package require xotcl::store::persistence - -package require XOTcl - -namespace eval ::xotcl::actiweb::webObject { - namespace import ::xotcl::* - - # - # base interface for all web-entitites - # - Class WebObject -parameter { - {exportedProcs {echo default}} - agentInfo - {contentType ""} - {place ""} - } - - # - # default send strategy == send the response from the place - # - WebObject instproc init args { - #my showCall - my mixinStrategy ::Send=PlainString - my registerPlace - my mixinStrategy ::Persistent=Eager - my persistenceMgr [my place]::agentPersistenceMgr - next - } - - WebObject instproc registerPlace {} { - my set place [Place getInstance] - my set agentInfo [[my place]::agentMgr register [my selfName]] - } - - WebObject instproc deregisterPlace {} { - [my place]::agentMgr deregister [my selfName] - } - - # - # seek for the HTTP worker object that has invoked - # the current call - # - WebObject instproc getWorker {} { - for {set level 1} {1} {incr level} { - if {[catch {set worker [uplevel $level self]}]} { - return "" - } elseif {[$worker istype Place::HttpdWrk]} { - return $worker - } - } - } - WebObject instproc getFormData {} { - [my getWorker] formData - } - - # - # code a call for an action on self; - # action is "proc args" - # - WebObject instproc selfAction {action} { - return [url encodeItem "[string trimleft [self] :] $action"] - } - WebObject instproc action {o action} { - return [url encodeItem "[string trimleft $o :] $action"] - } - WebObject instproc echo {} { - return [self] - } - - WebObject instproc error args { - return "Error on [self]: Invocation '$args' failed." - } - - WebObject instproc default {} { - return "No default behaviour on [self]." - } - - WebObject instproc exportProcs args { - my instvar exportedProcs - foreach a $args { - if {[lsearch $exportedProcs $a] == -1} { - lappend exportedProcs $a - } - } - } - - WebObject instproc isExportedProc p { - expr {[lsearch [my set exportedProcs] $p] != -1} - } - - WebObject instproc selfName {} { - return [string trimleft [self] :] - } - - WebObject instproc objName {obj} { - return [string trimleft $obj :] - } - - WebObject instproc buildAdress {} { - my instvar place - set a http://[$place host] - if {[set p [$place port]]} { - append a :$p - } - } - - WebObject instproc destroy args { - my deregisterPlace - next - } - - # - # simple class, to be inherited before WebObject, if - # every remote method should reach the object - # - Class ExportAll - ExportAll instproc isExportedProc p { - return 1 - } - - namespace export WebObject ExportAll -} - -namespace import ::xotcl::actiweb::webObject::* Index: xotcl/library/actiweb/cacert.pem =================================================================== diff -u -N --- xotcl/library/actiweb/cacert.pem (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/actiweb/cacert.pem (revision 0) @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDKjCCApOgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBwDELMAkGA1UEBhMCQVQx -DzANBgNVBAgTBlZpZW5uYTEPMA0GA1UEBxMGVmllbm5hMR0wGwYDVQQKExRNeSBU -ZXN0IE9yZ2FuaXphdGlvbjETMBEGA1UECxMKTXkgRGVtbyBDQTErMCkGA1UEAxMi -TXkgRGVtbyBDQSBhdCBNeSBUZXN0IE9yZ2FuaXphdGlvbjEuMCwGCSqGSIb3DQEJ -ARYfa2xhdXMua29sb3dyYXRuaWtAd3Utd2llbi5hYy5hdDAeFw0wMzA5MDUxMTEw -MDFaFw0xMzA5MDIxMTEwMDFaMIHAMQswCQYDVQQGEwJBVDEPMA0GA1UECBMGVmll -bm5hMQ8wDQYDVQQHEwZWaWVubmExHTAbBgNVBAoTFE15IFRlc3QgT3JnYW5pemF0 -aW9uMRMwEQYDVQQLEwpNeSBEZW1vIENBMSswKQYDVQQDEyJNeSBEZW1vIENBIGF0 -IE15IFRlc3QgT3JnYW5pemF0aW9uMS4wLAYJKoZIhvcNAQkBFh9rbGF1cy5rb2xv -d3JhdG5pa0B3dS13aWVuLmFjLmF0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB -gQDIKhCgkG/rSDc8NjDGtJBKW1+fQsoPoBSnMeWOjRQ0YiYomHLZo2XHxsfHsDHj -xXE69GkY9SuwYX/UiF7C0H5LhVew5GTACZsZTbqUWR3D0+R4RQTNJRhQzHq4HE0o -cWjKRiQWWMqNE6S/M4Eri4SJyoaXzhkXjkboYTf/+Dks1wIDAQABozIwMDAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBT5lsU8wZ72pP5lB5ezzqxi5mk4KTANBgkq -hkiG9w0BAQQFAAOBgQA8pZPqoSDBduMtKzNP5A6TerIc7Whm/mwBmiMq0sRHFPWe -sCHJkBxF+ryJT6WDsm1RuCdueHgoppnJ6epdqxmtOAcNcn+OQDU5lzSATBu60B5m -bH4zRsxwn4L9ts+Q1IbjWXc0P1G+2oQSNfvduS7esrs1RM64h6gUJErzxU5cfg== ------END CERTIFICATE----- Index: xotcl/library/actiweb/pageTemplate.xotcl =================================================================== diff -u -N --- xotcl/library/actiweb/pageTemplate.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/actiweb/pageTemplate.xotcl (revision 0) @@ -1,103 +0,0 @@ -package provide xotcl::actiweb::pageTemplate 0.8 - -package require xotcl::actiweb::webObject -package require xotcl::actiweb::invoker -package require xotcl::mixinStrategy - -package require XOTcl - -namespace eval ::xotcl::actiweb::pageTemplate { - namespace import ::xotcl::* - - Class PageTemplate -superclass WebObject - PageTemplate instproc init args { - next - my mixinStrategy ::Send=TypedString - } - - PageTemplate abstract instproc listExportedProcs args - PageTemplate abstract instproc simplePage args - - Class PageTemplateHtml -superclass PageTemplate - - PageTemplateHtml instproc init args { - my contentType text/html - next - } - - PageTemplateHtml instproc listExportedProcs args { - # - # place must be a Html place! - # - set place [HtmlPlace getInstance] - set c " - The following options are avaiable on $n: - " - - foreach i [my exportedProcs] { - set href [my selfAction "[self] $i"] - set app { -

    $i - } - append c [subst -nobackslashes $app] - } - return [my simplePage $place [self] $c] - } - - PageTemplateHtml instproc simplePage {title heading content {closing ""}} { - set place [Place getInstance] - set c { - -$title - - -

    $heading

    -
    -

    - -$content - -

    $closing - -


    - - -} - return [subst -nobackslashes -nocommands $c] - } - - # - # builds a simple Form -- args are tupels of the form - # {text, name, type, default, size} - # - # - PageTemplateHtml instproc simpleForm {action args} { - set action [my selfAction $action] - set c { - - - } - foreach {text name type def size} $args { - append c " - - - - - " - } - append c { - - - - -
    $text:
    - -

    - } - return [subst -nobackslashes -nocommands $c] - } - - namespace export PageTemplate PageTemplateHtml -} - -namespace import ::xotcl::actiweb::pageTemplate::* Index: xotcl/library/actiweb/pkgIndex.tcl =================================================================== diff -u -N --- xotcl/library/actiweb/pkgIndex.tcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/actiweb/pkgIndex.tcl (revision 0) @@ -1,24 +0,0 @@ -# Tcl package index file, version 1.1 -# This file is generated by the "pkg_mkIndex -direct" command -# and sourced either when an application starts up or -# by a "package unknown" script. It invokes the -# "package ifneeded" command to set up package-related -# information so that packages will be loaded automatically -# in response to "package require" commands. When this -# script is sourced, the variable $dir must contain the -# full path name of this file's directory. - -package ifneeded xotcl::actiweb::agent 0.8 [list source [file join $dir Agent.xotcl]] -package ifneeded xotcl::actiweb::agentManagement 0.8 [list source [file join $dir AgentManagement.xotcl]] -package ifneeded xotcl::actiweb::htmlPlace 0.8 [list source [file join $dir HtmlPlace.xotcl]] -package ifneeded xotcl::actiweb::httpPlace 0.8 [list source [file join $dir HttpPlace.xotcl]] -package ifneeded xotcl::actiweb::invoker 0.8 [list source [file join $dir Invoker.xotcl]] -package ifneeded xotcl::actiweb::pageTemplate 0.8 [list source [file join $dir pageTemplate.xotcl]] -package ifneeded xotcl::actiweb::placeAccessControl 0.8 [list source [file join $dir PlaceAccessControl.xotcl]] -package ifneeded xotcl::actiweb::secureHtmlPlace 0.8 [list source [file join $dir SecureHtmlPlace.xotcl]] -package ifneeded xotcl::actiweb::secureHttpPlace 0.8 [list source [file join $dir SecureHttpPlace.xotcl]] -package ifneeded xotcl::actiweb::sendStrategy 0.8 [list source [file join $dir SendStrategy.xotcl]] -package ifneeded xotcl::actiweb::userMgt 0.8 [list source [file join $dir UserMgt.xotcl]] -package ifneeded xotcl::actiweb::webAgent 0.8 [list source [file join $dir WebAgent.xotcl]] -package ifneeded xotcl::actiweb::webDocument 0.8 [list source [file join $dir WebDocument.xotcl]] -package ifneeded xotcl::actiweb::webObject 0.8 [list source [file join $dir WebObject.xotcl]] Index: xotcl/library/comm/Access.xotcl =================================================================== diff -u -N --- xotcl/library/comm/Access.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/library/comm/Access.xotcl (revision 0) @@ -1,1699 +0,0 @@ -# -*- tcl -*- $Id: Access.xotcl,v 1.9 2007/08/14 16:38:26 neumann Exp $ - -set httpAccessVersion 0.91 -package provide xotcl::comm::httpAccess $httpAccessVersion - -package require xotcl::comm::pcache -package require xotcl::comm::mime -package require xotcl::comm::connection -package require xotcl::trace - -package require XOTcl - -namespace eval ::xotcl::comm::httpAccess { - namespace import ::xotcl::* - - variable os - variable VERSION - - if {[catch {set os [exec uname -sr]}]} { - if {[catch {set os [exec uname -a]}]} { set os unknownOS } - } - if {![info exists VERSION]} { set VERSION 1.0 } - - - # assert is used only for invariants in the source - proc assert {f r} { - set got [eval $f] - if {$got != $r} { - puts stderr "assertion failed: \[$f\] == $r (got $got)" - } - } - - - # resolve and checkUrl implement URL handling (primarily completion) - proc checkUrl {url} { - #puts stderr "checkUrl: <$url>" - if {![regexp {^([^:]+:/)/([^/]+)(/.*)?$} $url _ scheme network path]} { - regexp {^([^:]+:)(/.*)?$} $url _ scheme path - } - if {![info exists path]} { - # no access scheme provided, try some heuristics... - if {[regexp {^[./]} $url]} { - # expand leading "." to pwd - if {[regexp {^\.(.*)$} $url _ url]} { set url [pwd]$url } - return file:$url - } else { - set url http://$url - regsub {///$} $url // url - return $url - } - } - if {$path eq ""} {set path /} - return [expr {[info exists network] ? - "$scheme/$network$path" : "$scheme$path"}] - } - - # resolving a relative url with respect to a base url (based on rfc 1808) - proc resolve {rel base {childTagName ""}} { - if {$base eq ""} { return [checkUrl $rel] } - if {$rel eq ""} { return $base } - if {[regexp {^[^:]+:/} $rel _]} { return [checkUrl $rel] } - if {![regexp {^([^:]+:/)/([^/]+)(/.*)$} $base _ baseScheme baseNetwork basePath]} { - regexp {^([^:]+:)(/.*)$} $base _ baseScheme basePath - } elseif {[regexp {^[^:/]+:} $rel]} { - return $rel - } - regexp {^(.*)\#.*$} $basePath _ basePath - regexp {^(.*)[?].*$} $basePath _ basePath - if {[regexp {^//([^/]+)/(.*)$} $rel _ relNetwork relPath]} { - return $baseScheme/$relNetwork/$relPath - } - if {[info exists baseNetwork]} { - append baseScheme /$baseNetwork - } - #puts stderr rel=<$rel> - if {![string match "/*" $rel]} { - #puts stderr rel<$rel>base<$basePath> - if {[string match \#* $rel]} { - set r $basePath$rel - } elseif {![regsub {/([^/]*)$} $basePath /$rel r]} { - set r /$rel - } - while {[regsub -all {/\./} $r / r]} {} - regsub {/\.$} $r / r - while {[regsub -all {/[^/.]+/\.\./} $r / r]} {} - # remove leading /../ (netscapes navigator does this) - while {[regsub {^/\.\./} $r / r]} {} - set rel $r - #puts stderr finalrel<$r> - } - #if {$childTagName ne ""} - if {1} { - upvar 1 $childTagName childTag - catch {unset childTag} - if {[regexp {^(.+)\#(.+)$} $rel _ rel childTag]} { - #puts stderr childTag=$childTag,url=$baseScheme$rel. - } - } - return $baseScheme$rel - } - - assert {resolve "" http://mohegan/} http://mohegan/ - assert {resolve http://mohegan/ ""} http://mohegan/ - assert {resolve http://mohegan ""} http://mohegan/ - assert {resolve http://mohegan/ http://nestroy} http://mohegan/ - assert {resolve test.html http://127.0.0.1/} http://127.0.0.1/test.html - assert {resolve test http://nestroy/} http://nestroy/test - assert {resolve test file:/u/neumann/old} file:/u/neumann/test - assert {resolve /test http://nestroy/} http://nestroy/test - assert {resolve //mohegan/index.html http://nestroy/} http://mohegan/index.html - assert {resolve //mohegan/index.html http://nestroy/} http://mohegan/index.html - assert {resolve index.html http://nestroy/dir/} http://nestroy/dir/index.html - assert {resolve ./index.html http://nestroy/dir/} http://nestroy/dir/index.html - assert {resolve ././index.html http://nestroy/dir/} http://nestroy/dir/index.html - assert {resolve ../index.html http://nestroy/dir/} http://nestroy/index.html - assert {resolve ../../index.html http://nestroy/dir/} http://nestroy/index.html - assert {resolve ../../../test file:/u/neumann/old} file:/test - assert {resolve newdir/ http://nestroy/dir/} http://nestroy/dir/newdir/ - assert {resolve /newdir/ http://nestroy/dir/} http://nestroy/newdir/ - assert {resolve file:/u/neumann/ice.html ""} file:/u/neumann/ice.html - assert {resolve \#label http://nestroy/h.html} http://nestroy/h.html - assert {resolve mailto:user@host http://nestroy/h.html} mailto:user@host - assert {resolve ../../../../mis2001/folien/081101.ppt http://wwwi.wu-wien.ac.at/Studium/Abschnitt_2/LVA_ws01/IT/index.html} http://wwwi.wu-wien.ac.at/mis2001/folien/081101.ppt - - - ############################################################## - # Every object of class Access informs the (possibly empty) list of - # informObjects during its lifecycle with the following messages - # - # startCb: when the request for the object is created - # and was classified and initialized - # - # notifyCb: when the type of the incming data is dertermined - # (typically after parsing the http header) - # - # incCb: when new data is available - # - # endCb: when the request is finished sucessfully and the object - # is going to be destroyed - # - # cancelCb: when the request is finished nonsucessfully and the object - # is going to be destroyed - # - # All these messages receive the name of the Access object - # as first parameter, incCb has two more arguments (totalsize - # and currentsize) - - # caching: - # 0 no caching - # 1 volatile cache (does not check cache, keeps spool file for back button) - # 2 persistent cache - - Class Access -parameter { - {method GET} {blocking 0} {httpVersion 1.1} {headers {}} - url query data contentType path caching sinkClass parentUrl - } - Access instproc informObject x { - foreach i $x { my lappend informObjects $i } - } - Access instproc method x { - my set method [string toupper $x] - } - Access instproc unknown {m args} { - error "Method '$m' with args '$args' is unknown for [self class]" - } - - Access proc checkRunning {} { - foreach u [my array names running] { - puts stderr "... running: $u" - } - puts stderr "... -----------" - } - Access proc createRequest args { - #my showCall - set informobject {} - set allowJoin 1 - set nargs {} - foreach {a v} $args { - switch -exact -- $a { - -url {set url $v; lappend nargs $a $v} - -informObject {set informobject $v; lappend nargs $a $v} - -parentRequest {set parentRequest $v} - -allowJoin {set allowJoin $v} - default {lappend nargs $a $v} - } - } - #if {[my array exists running]} {parray [self]::running} - if {[my exists running($url)] && $allowJoin} { - my showMsg "we can join running($url)=[my set running($url)]" - # we can join the request. - # requests are joined by adding the informobjects to - # the existing request - set token [my set running($url)] - # delegation to a different request works only so easy - # when loading to a file... - $token informObject $informobject - return $token - } else { - set token [my autoname ::req] - if {[info exists parentRequest]} { - set token ${parentRequest}$token - } - #my showMsg "TOKEN = $token $url" - return [eval my create $token $nargs] - } - } - Access instproc running {} { - #my showCall - [self class] set running([my url]) [self] - } - Access instproc stop {} { - #showCall - my instvar url - if {[[self class] exists running($url)]} { - #puts stderr "my unset [[self class] set running($url)] - [self class] unset running($url) - #if {[my array exists running]} { parray [self class]::running } - } else { - #puts stderr "not running($url)" - #if {[my array exists running]} { parray [self class]::running } - } - } - #Access instproc destroy args { - # my showCall - # next - #} - Access instproc init args { - #my showCall - my instvar method url - if {![my exists informObjects]} { - my set informObjects {} - } - next - if {![my exists caching]} { - if {$method eq "GET"} { - set defaultCaching 2 - } else { - set defaultCaching 1 - } - my caching $defaultCaching - } - #my showVars - - set url [string trim $url] - my initialize - if {[my classify $url]} { - #my showVars - # now inform all interested objects that we have the object - my doCallbacks startCb - #my showVars blocking - # trigger the transfer... (might be blocking or not) - my $method - if {![my exists finished]} { - # the request is not finished - if {[my blocking]} { - #my showMsg "waiting" - my vwait finished - #my showMsg "waiting DONE" - } - } - } - } - Access instproc getContent {} { - [my set sink] content - } - - ######################################### - Access instproc timeout t { - my set timeout [::after $t [self] timeoutOccured] - } - Access instproc timeoutOccured {} { - #my showCall - my unset timeout - my abort "timeout exceeded" - } - Access instproc timeoutFinish {} { - if {[my exists timeout]} { - after cancel [my set timeout] - my unset timeout - } - } - ######################################### - - Access instproc initialize {} { - #my showCall - my set state 0 - my set meta {} - my set currentsize 0 - my set totalsize 0 - } - Access instproc classify {url} { - my instvar host path port method - #my showVars caching - if {[my caching] > 1 && [persistentCache isValidated $url]} { - #puts stderr "*** cacheable && validated" - #showVars - #persistentCache dump - set access CacheAccess - } elseif {[regexp -nocase {^http://([^/:]+)(:([0-9]+))?(/.*)?$} $url \ - _ host y givenPort path]} { - if {$givenPort ne ""} {set port $givenPort } {set port 80} - switch -exact $method { - PROPFIND - - PROPPATCH - - COPY - - MKCOL - - MOVE - - LOCK - - UNLOCK { - package require xotcl::comm::dav - set access Dav - } - default {set access Http} - } - } elseif {[regexp -nocase {^https://([^/:]+)(:([0-9]+))?(/.*)$} $url \ - _ host y givenPort path]} { - if {$givenPort ne ""} {set port $givenPort } {set port 443} - set access Https - } elseif {[regexp -nocase {^file:(.*)$} $url _ path]} { - set access File - } elseif {[regexp -nocase {^ftp://([^/]+)/(.*)$} $url _ host path]} { - package require xotcl::comm::ftp - set access Ftp - } elseif {[regexp -nocase {^imap://([^/]+)/(.*)$} $url _ host path]} { - package require xotcl::comm::imap - set access Imap - } elseif {[regexp -nocase {^cmd:/(.*)$} $url _ path]} { - set access xotcl::Cmd - } elseif {[regexp -nocase {^ldap://([^/:]+)?(:([0-9]+))?(/.*)$} \ - $url _ host y givenPort path]} { - if {$givenPort ne ""} { set port $givenPort } - my showMsg "*** ldap://<$host>:<$port>/<$path>" - package require xotcl::comm::ldap - set access Ldap - } else { - #my set state 0 - my abort "Unsupported URL: '$url'" - return 0 - } - my class $access - #my showMsg "class of request = $access" - return 1 - } - Access instproc revisit {} { - my class ReAccess - my initialize - my [my set method] - } - ### dummy stubs for 'close' and 'GET' for error cases - Access instproc close {} { - } - Access instproc GET {} { - if {[my exists errormsg]} { ;# the error was already reportet - my finish - } else { - my abort "unknown error" - } - } - - Access instproc headerDone {} { - my instvar caching sink - if {[my exists ignoreBody]} return - if {[my exists sinkClass] && $caching>0 } { - error "can´t set both sinkclass and caching" - } - switch $caching { - 2 { - set sink [CacheFileSink create [self]::cfs] - #my showMsg "[self class] result goes to cache" - $sink notifyCb [self] - } - 1 { - set sink [CacheFileSink create [self]::cfs -persistent 0] - #my showMsg "result goes to volatile cache" - $sink notifyCb [self] - } - 0 { - if {[my exists sinkClass]} { - set sink [[my sinkClass] create [self]::s] - } - } - } - my doCallbacks notifyCb - } - Access instproc mkSpoolFile {{name ""}} { - if {![my exists fileName]} { - my set fileName [persistentCache newEntry [my url] [self] [my caching] $name] - } - } - Access instproc block {} { - my set block - } - Access instproc kill {} { - my showCall - my set state -1; #interrupted - my finish - } - Access instproc abort {msg} { - #my showCall - #my showVars - my instvar state errormsg - if {[catch {::printError "[self] ($state): $msg"} err]} { - puts stderr "\n$err\nERROR [self] ($state): $msg\n" - } - #my set error [list $msg $::errorInfo $::errorCode] - my caching 0 - if {[my exists ignoreBody]} { - my unset ignoreBody - } - set state -2 ;# error - set errormsg $msg - my finish - } - Access instproc finish {} { - #my showCall - my timeoutFinish - my close - #my showVars state ignoreBody - # state is "interrupted" or "error" - if {[my set state] < 0} { - set action cancelCb - set success 0 - } else { - set action endCb - #set state ok - set success 1 - } - if {[my exists ignoreBody]} { - my stop - #my set finished $success - set cmd [my set ignoreBody] - my unset ignoreBody - #my showMsg "executing... <$cmd>" - eval my $cmd - } else { - if {[my exists sink]} { - [my set sink] $action [self] - } - #catch {after cancel $after} ;# ???? - my doCallbacks $action - my stop - my set finished $success - } - } - Access instproc eof {} { - #my showCall - #my showMsg "c [my set currentsize]== t [[self set totalsize]]" - #my set state eof - my finish - } - Access instproc doCallbacks {cb} { - #my showCall - if {[my exists ignoreBody]} { - my showMsg "ignoring callback" - } else { - foreach obj [my set informObjects] { - #my showMsg "*** $obj $cb [self]" - #puts stderr "------------ calling: $obj $cb [self]" - if {[catch {$obj $cb [self]} errormsg]} { - puts stderr "--------------$cb:errormsg=$errormsg, \ - errorInfo=$::errorInfo, \ - errorCode=$::errorCode." - } - #puts stderr "------------ calling DONE: $obj $cb [self]" - } - } - } - Access instproc shutdown {} { - #my showMsg "state=[my set state] > 3" - if {[my set state] > 3} { - my set mustDestroy 1 - } else { - #my showVars - #my showStack - #my showMsg "DESTROY !!!" - if {[my set state] > -2} { - my destroy - } - } - } - - - Class FileAccess -superclass Access - FileAccess instproc initialize args { - my caching 0 - next - } - FileAccess instproc close {} { - } - FileAccess instproc block {} { - my showTimeStart - set S [open [my set fileName] r] - fconfigure $S -translation binary - set block [::read $S] - ::close $S - my showTimeEnd - return $block - } - FileAccess instproc GET {} { - my instvar path response totalsize currentsize \ - fileName informObjects - set fileName $path - set totalsize [file size $path] - set response "file 200 OK" - my headerDone - my set state 4 - set currentsize $totalsize - #my showVars informObjects - foreach obj $informObjects { - $obj incCb [self] $totalsize $currentsize - } - my eof - } - - - Class File -superclass FileAccess - File instproc GET {} { - my instvar path - #puts stderr path=$path,exists=[file exists $path] - if {![file exists $path]} { - my abort "No such file '$path'" - return - } - if {![my exists contentType]} { - my contentType [Mime guessContentType $path] - } - my set sink [FileSink create [self]::fas -fileName $path] - #puts stderr ****sink=$sink,[$sink info class] - #puts stderr "*** before next ([self class])" - next - #puts stderr "*** after next ([self class])" - } - - Class CacheAccess -superclass File - CacheAccess instproc GET {} { - my instvar url - my path [persistentCache cacheFileName $url] - my contentType [persistentCache contentType $url] - my set meta [persistentCache meta $url] - next - } - - Class ReAccess -superclass File - ReAccess instproc GET {} { - my instvar fileName sink - my set block "" - my set currentsize 0 - my caching 0 - if {![info exists fileName]} { - set fileName [$sink set fileName] - } - my set path $fileName - next - } - - - - Class Cmd -superclass Access - Cmd instproc init args { - if {![my exists caching]} { - my caching 0 - } - next - } - Cmd instproc GET {} { - my instvar path block totalsize currentsize \ - response informObjects state - if {[catch {set block [eval $path]} error]} { - my contentType text/plain - set block $error - } else { - my contentType text/html - } - set totalsize [string length $block] - set response "cmd 200 OK" - my headerDone - my set state 4 - set currentsize $totalsize - foreach obj $informObjects { - $obj incCb [self] $totalsize $currentsize - #$obj endCb [self] - } - #set state eof - my finish - } - Cmd instproc block args { - my instvar block - return $block - } - - - #Class NetAccess -superclass Access -parameter {host port} - Class NetAccess -superclass Access - NetAccess instproc initialize args { - if {![my exists blocksize]} {my set blocksize 512} - my set readMethod read - next - } - NetAccess instproc read {} { - #my instvar S blocksize block - #set block [::read $S $blocksize] - my instvar S block blocksize - set block [::read $S $blocksize] - } - NetAccess instproc gzread {} { - my instvar S Z blocksize block - puts -nonewline $Z [::read $S $blocksize] - set block [::read $Z] - #puts stderr len=[string length $block],block=<$block> - } - NetAccess instproc gzopen {} { - my instvar Z S readMethod - requireModules {zipchan libzipchan.so} - fconfigure $S -translation binary - set Z [zipchan] - set readMethod gzread - } - NetAccess instproc close {} { - #my showMsg "**** close persistent=[my exists persistent]" - if {![my exists persistent]} { - foreach stream {S Z} { - if {[my exists $stream]} { - ::close [my set $stream] - my unset $stream - } - } - } - my stop - } - NetAccess instproc hold {} { - my instvar S - $S hold - } - NetAccess instproc resume {} { - my instvar S - $S resume - } - NetAccess instproc readData {} { - #my showCall - if {[catch { - #puts stderr "??????????????readMethod=[my set readMethod]" - my [my set readMethod] - my pushBlock - } err]} { - puts stderr ERR=$err - my set block "" - my abort $err - } - } - NetAccess instproc pushBlock {} { - #my showCall - my instvar block - if {[set n [string length $block]]} { - my instvar currentsize totalsize informObjects sink - #my showVars n currentsize totalsize - incr currentsize $n - if {$currentsize > $totalsize} { - set totalsize $currentsize - } - #my showMsg "total=$totalsize current=$currentsize" - if {[my exists ignoreBody]} { - #puts stderr "ignoring: <$block>" - } else { - if {[info exists sink]} { - $sink incCb [self] $totalsize $currentsize - } - foreach obj $informObjects { - #my showMsg "call incbCb $totalsize $currentsize $obj [$obj info class]" - $obj incCb [self] $totalsize $currentsize - #my showMsg "done incbCb $totalsize $currentsize" - } - } - } else { - #my showVars n - return [my eof] - } - } - - Class Http -superclass NetAccess ;### -parameter {query {httpVersion 1.0}} - Http set proxyfilter httpProxyRequired - Http set proxyhost {} - Http set proxyport {} - Http set accept */* - if {[info exists argv0]} { - Http set useragent "[file tail $argv0] httpAccess/$httpAccessVersion xotcl/$::xotcl::version ($os)" - } - Http proc proxyfilter {host phostv pportv} { - my instvar proxyfilter proxyhost proxyport - upvar \#1 $phostv phost $pportv pport - switch -- $proxyfilter { - httpProxyRequired { - if {[string length $proxyhost]} { - if {![string length $proxyport]} { set proxyport 8080 } - set phost $proxyhost - set pport $proxyport - } - } - } - } - - Http instproc initialize args { - if {![my exists port]} {my set port 80} - if {![my exists httpVersion]} {my set httpVersion 1.1} - next - #my showMsg "result queried from net" - } - Http instproc GET {} { - #my showCall - if {[my exists query]} { - my instvar query caching - my append url ?$query - my append path ?$query - if {$caching == 2} {set caching 1} - my showVars caching $query - } - my open - } - Http instproc HEAD {} { - my open - } - Http instproc POST {} { - # we have query and data only for a uniform interface for - # forms that cann pass the attribute value pairs always via - # query. - if {[my exists query]} { - my data [my query] - } - my open - } - Http instproc PUT {} { - my open - } - # Http1.1 - Http instproc OPTIONS {} { - my showCall - my open - } - # Http1.1 - Http instproc TRACE {} { - my showCall - } - # Http1.1 - Http instproc DELETE {} { - #my showCall - my open - } - Http instproc openConnection {host port reuse} { - return [Connection make [self] $host $port $reuse _] - } - Http instproc open {} { - #my showCall - my instvar url S state host port path - if {$state > 0} { - puts stderr "... [self]:$proc ignoring request in state $state" - return - } - Http proxyfilter $host phost pport - if {[info exists phost] && [string length $phost]} { - set usePort $pport - set useHost $phost - set path $url - } else { - set usePort $port - set useHost $host - } - - set S [my openConnection $useHost $usePort [expr {[my httpVersion]>1.0}]] - if {[$S exists error]} { - my abort [$S set error] - return - } - set state 2 - my running - $S event writable [self] ask - } - - Http instproc ask {} { - my instvar url S state host port path \ - method headers data caching - - $S event writable [self] {} - - if {[pwdManager checkAvailableCredentials $url credentials]} { - eval lappend headers $credentials - #my showMsg "*** new headers = <$headers>" - } - if {$caching==2 && [persistentCache ifModifiedHeader $url ifModified]} { - eval lappend headers $ifModified - #puts stderr "new headers = <$headers>" - } - # Send data in cr-lf format, but accept any line terminators - $S translation {auto crlf} - - #my showMsg "'$method $path HTTP/[my httpVersion]' headers {$headers}" - $S puts "$method $path HTTP/[my httpVersion]" - if {[$S exists error]} { - my abort "Connection refused by host '$host' port '$port'\n\ - [$S set error]" - return - } - - $S puts "Accept: [Http set accept]" - $S puts "Host: $host" - $S puts "User-Agent: [Http set useragent]" - foreach {tag value} $headers { - regsub -all \[\n\r\] $value {} value - set tag [string trim $tag] - if {[string length $tag]} { - #my showMsg "+++ <$tag: $value>" - $S puts "$tag: $value" - } - } - if {[my exists data]} { - $S puts "Content-Length: [string length $data]" - $S puts "Content-Type: [my contentType]" - $S puts "" - $S translation {auto binary} - $S puts-nonewline $data - } else { - $S puts "" - } - $S flush - if {[$S exists error]} { - my instvar host port - my abort "Connection refused by host '$host' port '$port'\n\ - [$S set error]" - } else { - set state 3 - $S event readable [self] headerStart - } - } - - Http instproc headerStart {} { - #my showCall - my instvar S response - set n [$S gets response] - #my showVars n response - if {[$S exists error]} { - my instvar host port - my abort "Error on connection to host '$host' port '$port'\n\ - [$S set error]" - return - } - #my showMsg "n=$n, eof=[$S eof]" - if {$n == -1 && ![$S eof]} { - #my showMsg "******************************input pending, no full line" - return - } - my instvar responseCode responseHttpVersion - if {[regexp {^HTTP/([0-9.]+) +([0-9]+) *} $response _ \ - responseHttpVersion responseCode]} { - #my showMsg "response valid: '$response'" - $S event readable [self] header - } else { - my instvar host port - my abort "Unexpected response from $host:$port\n $n: '$response'" - } - } - Http instproc header {} { - my instvar S meta totalsize - if {[$S gets line]} { - #my showMsg "line=$line" - if {[regexp -nocase {^content-type:(.+)$} $line _ type]} { - my contentType [string trim $type] - } elseif {[regexp -nocase {^content-length:(.+)$} $line _ length]} { - set totalsize [string trim $length] - } - if {[regexp -nocase {^([^:]+): *(.+)$} $line _ key value]} { - lappend meta [string tolower $key] $value - } - } else { - my headerDone - } - } - Http array set expectsBody \ - {GET 1 HEAD 0 POST 1 PUT 0 DELETE 1 OPTIONS 0 TRACE 1} - Http instproc headerDone {} { - #my showVars meta - my instvar S meta method responseCode responseHttpVersion - [self class] instvar expectsBody - set expectBody $expectsBody($method) - - array set v [my set meta] - if {([info exists v(connection)] && $v(connection) eq "close") || \ - $responseHttpVersion < 1.1} { - $S makePersistent 0 - } else { - $S makePersistent 1 - } - - switch $responseCode { - 200 {} - 204 { - #set state empty - my finish - set block "" - set expectBody 0 - return - } - 301 - - 302 { - # the request is redirected to another server - my set ignoreBody [list redirect $v(location)] - - # RFC2068 Note: When automatically redirecting a POST request after - # receiving a 302 status code, some existing HTTP/1.0 user agents - # will erroneously change it into a GET request. - #my method GET - - my showMsg "redirect '[my url]' --> '$v(location)'" - } - 304 { ;# Not Modified, use cached version - my set ignoreBody cacheAccess - set expectBody 1 - #my showMsg "result comes from cache" - } - 401 { - my set ignoreBody \ - [list resubmitAuthenticated $v(www-authenticate)] - #my showMsg "resubmitAuthenticated $v(www-authenticate)" - if {[my exists resubmitAuthenticated]} { - if {[my set resubmitAuthenticated] > 5} { - my abort "Too many wrong passwords given" - } else { - my incr resubmitAuthenticated - } - } else { - my set resubmitAuthenticated 1 - } - set expectBody 1 - } - 404 { - my instvar url - #my showVars - my set ignoreBody [list abort "File Not Found on Server '$url'"] - set expectBody 1 - } - default { - #my showVars responseCode - } - } - next - if {![my exists S]} {;# this request was already canceled - return - } - if {[info exists v(transfer-encoding)]} { - if {$v(transfer-encoding) == "chunked"} { - $S translation {auto binary} - my set state 4 - $S event readable [self] readChunkedLength - } else { - my abort "Unexpected Transfer encoding '$v(transfer-encoding)'" - } - } else { - # yahoo does not send a content length for a get request - #if {$totalsize == 0 && ($responseCode > 300 || !$expectsBody($method) )} - #my showVars method totalsize expectsBody($method) expectBody - # the following is used currently for Actiweb-Agents: - # the reponse of a PUTS contains a BODY! - if {!$expectBody && - [::info exists v(content-length)] && - $v(content-length) > 0} { - set expectBody 1 - #my showMsg "setting expectBody 1" - } - - if {!$expectBody} { - #$S event readable [self] "" - #set state eof - my finish - set block "" - } else { - ### To avoid CRLF problmes we set the translation for - ### the body entity to binary - $S translation binary - my set state 4 - $S event readable [self] readData - } - } - } - - Http instproc cacheAccess {} { - # there is an actual version of the document in the cache - #showCall - persistentCache validated [my url] - #my close - my class CacheAccess - #my showMsg "result comes from cache [persistentCache cacheFileName $url]" - my caching 0 ;# should be really: toCache 0 - my GET - } - - Http instproc redirect location { - # the request is redirected to another server - if {$location ne [my url] } { - #my showVars - my url $location - my initialize - my classify $location - my [my set method] - } - } - Http instproc resubmitAuthenticated headerField { - #my showCall - # the server requires authentification - my instvar path method - if {[pwdManager checkRequestedAuthentification $method $path $headerField \ - type realm]} { - my instvar url caching method headers - array set v $headers - #my showVars - catch {unset v(Authorization)} - set headers [array get v] - pwdManager removePasswd $realm - my close - if {[pwdManager requireCredentials $realm $url]} { - my initialize - if {$caching == 2} {set caching 1} - my $method - } - } else { - my abort "unknown authentication method '$headerField'" - } - } - Http instproc readChunkedLength {} { - #my showCall - my instvar S chunkLength totalsize - set length [$S gets lengthString] - if {$length > 0} { - set chunkLength [expr 0x$lengthString] - #my showVars lengthString chunkLength - if {$chunkLength == 0} { - $S event readable [self] readChunkedTrailer - } else { - incr totalsize $chunkLength - $S translation {binary} - $S event readable [self] readChunkedData - } - } - } - Http instproc readChunkedTrailer {} { - #my showCall - my instvar S state block - set size [$S gets line] - if {$size != 0} { - showObj [self] - my abort "expected trailer size 0, got size $size" - } else { - #set state eof - my finish - set block "" - #showObj [self] - } - } - Http instproc readChunkedData {} { - #my showCall - my instvar S block totalsize currentsize chunkLength - set block [$S readSize $chunkLength] - set received [string length $block] - #my showVars block - #my showVars currentsize totalsize chunkLength received - if {$chunkLength == $received} { - $S translation {auto binary} - $S event readable [self] readChunkedLength - } else { - incr chunkLength -$received - } - my pushBlock - } - - Http instproc readData {} { - #my showCall - my instvar S block totalsize currentsize - set block [$S read] - #puts stderr "????? bl=[string length $block]" - if {[$S exists error]} { - set block "" - my abort [$S set error] - return - } - my pushBlock - #my showMsg "c [my set currentsize]== t [[self set totalsize]]" - if {$currentsize == $totalsize && - [my exists S] && [$S exists persistent]} { - #my showMsg "PERSITENT, end of entity reached" - #my set state eof - my finish - set block "" - #showObj [self] - } - if {[my exists mustDestroy]} { - #my showMsg "mustDestroy was set" - my destroy - } - } - Http instproc close {} { - #my showCall - if {[my exists S]} { - [my set S] close - #unset S - } - #next - } - Http instproc freeConnection {} { - #showCall - my instvar S - #::puts stderr "[self] freeing $S !!!!!!!!!!!!!!!!!!!!!!!" - unset S - } - - - #Access instproc makeZombie {} { - # my showMsg "procs= [my info procs], i [Object info instcommands]" - # my class Zombie - #} - #Class Zombie - #Zombie instproc unknown {m args} { - # my showMsg "+++ zombie method '$m' called" - #} - - - Class Https -superclass Http - Https instproc initialize args { - #my showCall - package require tls - if {![my exists port]} { my set port 443} - next - ### temporary solution, FIXME: - ### zur zeit muss man den secure-webserver.xotcl und - ### secure-webclient.xotcl jedenfalls aus dem xotcl/apps/xocomm-apps - ### verzeichnis starten, da haben wir mal die cfg files in unserem - ### baum.... - source .ssl/ssl-configuration.xotcl - ### - } - Https instproc openConnection {host port reuse} { - set S [Connection make [self] $host $port $reuse reused] - if {$reused} { - #my showMsg "reusing $S" - } else { - my showMsg "make the socket ([$S socket]) secure ..." - set cmd [list $S importSSL] - foreach attr {cafile cadir certfile cipher command keyfile \ - model request require ssl2 ssl3 tls1} { - if {[sslClientConfig exists $attr]} { - lappend cmd -$attr [sslClientConfig set $attr] - } - } - my showMsg "the assembled command is... ´$cmd´" - eval $cmd - puts stderr "CHANNELS= [file channels]" - } - return $S - } - - - - ####################################################################### - Object pwdManager - pwdManager proc requirePasswd {realm username password} { - # used by ftp and imap - my instvar user area - upvar [self callinglevel] $password passwd - if {[my exists pwd($realm)]} { - #my showMsg "*** reusing password for $realm" - set passwd [my set pwd($realm)] - return 1 - } else { - userPwd user $username - if {[userPwd show $realm user($realm) passwd]} { - set area($realm/$username) $realm - return 1 - } - } - return 0 - } - pwdManager proc storePasswd {realm username password} { - # used by ftp and imap - my instvar pwd user - set pwd($realm) $password - set user($realm) $username - } - pwdManager proc removePasswd {realm} { - if {[my exists pwd($realm)]} { - my unset pwd($realm) - my unset user($realm) - } - } - pwdManager proc requireCredentials {realm url} { - regexp {^(.*/)[^/]*$} $url _ path - if {[my exists pwd($realm)]} { - #my showMsg "*** register url=$url for ther realm=$realm" - my set area($path) $realm - return 1 - } else { - my instvar pwd user - if {[info exists ::env(USER)]} { - set USER $::env(USER) - } elseif {[info exists ::env(USERNAME)]} { - set USER $::env(USERNAME) - } else { - set USER unknown - } - - userPwd user $USER - if {[userPwd show $realm user($realm) pwd($realm)]} { - #my showMsg "*** setting password for realm '$realm' url=$path" - my set area($path) $realm - return 1 - } - } - return 0 - } - pwdManager proc encodeCredentials {authMethod realm} { - #my showCall - switch $authMethod { - basic {set credential [my encodeCredentialsBasic $realm]} - digest {set credential [my encodeCredentialsDigest $realm]} - } - return $credential - } - pwdManager proc encodeCredentialsBasic {realm} { - my instvar pwd user - return [list Authorization \ - "Basic [base64 encode $user($realm):$pwd($realm)]"] - } - pwdManager proc encodeCredentialsDigest {realm} { - #my showCall - package require tcu; #FIXME: noch nicht in distribution - my instvar digestResponseData - my mkDigestResponseData $realm - set digestResponse {} - foreach {t v} [array get digestResponseData] { - append digestResponse " $t = \"$v\"," - } - return [list Authorization "Digest [string trimright $digestResponse ,]"] - } - pwdManager proc mkDigestResponseData {realm} { - #my showCall - my instvar pwd user digestResponseData requestUri - # RFC 2617 - # credentials = "Digest" digest-response - # digest-response = 1#( username | realm | nonce | digest-uri - # | response | [ algorithm ] | [cnonce] | - # [opaque] | [message-qop] | - # [nonce-count] | [auth-param] ) - # username = "username" "=" username-value - # username-value = quoted-string - # digest-uri = "uri" "=" digest-uri-value - # digest-uri-value = request-uri ; As specified by HTTP/1.1 - # message-qop = "qop" "=" qop-value - # cnonce = "cnonce" "=" cnonce-value - # cnonce-value = nonce-value - # nonce-count = "nc" "=" nc-value - # nc-value = 8LHEX - # response = "response" "=" request-digest - # request-digest = <"> 32LHEX <"> - # LHEX = "0" | "1"| ...| "e" | "f" - set digestResponseData(username) $user($realm) - set digestResponseData(uri) $requestUri - set digestResponseData(cnonce) "TEST" - set digestResponseData(nc) 00000001 - set digestResponseData(response) [my mkRequestDigest] - #parray digestResponseData - } - pwdManager proc mkRequestDigest {} { - # returns a string of 32 hex digits, which proves that the user - # knows a password - - #A1 = unq(username-value) ":" unq(realm-value) ":" passwd - my instvar digestResponseData pwd requestMethod requestUri - append A1 $digestResponseData(username)\ - : $digestResponseData(realm) : $pwd($digestResponseData(realm)) - if {![my exists digestResponseData(qop)] || - $digestResponseData(qop) eq "auth"} { - append A2 $requestMethod : $requestUri - } elseif {$digestResponseData(qop) eq "auth-int"} { - #A2 = Method ":" digest-uri-value ":" H(entity-body) - append A2 $requestMethod : $requestUri: "" - } - if {[my exists digestResponseData(qop)]} { - append reqDigest $digestResponseData(nonce) : \ - $digestResponseData(nc) : \ - $digestResponseData(cnonce): \ - $digestResponseData(qop) - set reqDigest [md5 [md5 $A1]:$reqDigest:[md5 $A2]] - } else { - set reqDigest [md5 [md5 $A1]:$digestResponseData(nonce):[md5 $A2]] - } - return $reqDigest - } - - pwdManager proc checkAvailableCredentials {url returnCredentials} { - # we start a fresh request and check, whether we have sent for this url - # (directory) already some credentials in an earlier reqhest. - my instvar authMethod - regexp {^(.*/)[^/]*$} $url _ path - if {[my exists area($path)]} { - set realm [my set area($path)] - upvar [self callinglevel] $returnCredentials credentials - #my showMsg "*** adding credentials for realm=$realm and $path" - set credentials [my encodeCredentials $authMethod $realm] - return 1 - } - return 0 - } - pwdManager proc checkRequestedAuthentification {reqMethod path headerField - typeVar realmVar} { - # check for which realm with which authentification method the - # server wants an authentification - #my showCall - upvar [self callinglevel] $typeVar type $realmVar realm - my instvar authMethod digestResponseData requestUri requestMethod - set requestUri $path - set requestMethod $reqMethod - if {[regexp {^Basic realm="(.*)"$} $headerField _ realm]} { - set type basic;# FD: musste da lassen wg. call by reference - set authMethod $type - return 1 - } elseif {[regsub {^Digest } $headerField _ headerField]} { - set type digest ;# FD: musste da lassen wg. call by reference - set authMethod $type - foreach pair [split $headerField ,] { - if {[regexp {^(.*) *= *(".*")$} $pair _ n v]} { - set digestResponseData([string trim $n]) [string trim [string trim $v] \"] - } - } - set realm $digestResponseData(realm) - return 1 - } - return 0 - } - - ####################################################################### - # test classes - Class Sink - Sink instproc startCb {r} { - my set contentLength 0 - next - } - Sink instproc notifyCb {r} { - next - } - Sink instproc incCb {r t c} { - my set contentLength $t - next - } - Sink instproc endCb {r} { - next - #showCall - } - Sink instproc cancelCb {r} { - next - #showCall - } - Sink instproc content {} { - next - #showCall - } - Sink instproc contentLength {} { - my set contentLength - #showCall - } - - - Class TimeSink -superclass Sink - TimeSink instproc startCb {r} { - my set startTime [clock clicks] - next - } - TimeSink instproc notifyCb {r} { - my set notifyTime [clock clicks] - next - } - TimeSink instproc endCb {r} { - my set endTime [clock clicks] - next - my reportTimes - } - TimeSink instproc cancelCb {r} { - my set endTime [clock clicks] - next - } - TimeSink instproc reportTimes {} { - my instvar startTime endTime notifyTime - set bytes [my contentLength] - set grossSecs [expr {($endTime-$startTime)/1000000.0}] - set grossKbps [expr {($bytes/1000.0)/$grossSecs}] - set netSecs [expr {($endTime-$notifyTime)/1000000.0}] - set netKbps [expr {($bytes/1000.0)/$netSecs}] - #if {[catch {set netKbps [expr {($bytes/1000.0)/$netSecs}]}]} { - # set netKbps 0 - #} - set headSecs [expr {$grossSecs-$netSecs}] - foreach v {grossSecs grossKbps netSecs netKbps headSecs} { - set $v [format %.2f [set $v]] - } - my showMsg "got $bytes bytes in $grossSecs ($headSecs+$netSecs) seconds,\ - $grossKbps ($netKbps) KB/S" - } - - - Class ParallelSink -superclass Sink -parameter { - {httpVersion 1.1} - {sinkClass TimeSink} - {maxsimultaneous 20} - } - ParallelSink instproc init args { - next - my set running 1 - my set numrequests 0 - my set sumbytes 0 - my set blocked {} - } - ParallelSink instproc startCb r { - #my showCall - my incr running - my incr numrequests - #puts stderr "... running++ [my set running]" - } - ParallelSink instproc endCb r { - #my showCall - my incr sumbytes [$r set currentsize] - my done $r - } - ParallelSink instproc cancelCb r { - #my showCall - my done $r - } - ParallelSink instproc done r { - #my showCall - my instvar blocked - $r shutdown - my incr running -1 - #puts stderr "... running-- [my set running] [llength [Http info instances]]" - #puts stderr [Http info instances] - #foreach i [Http info instances] {puts stderr "\t$i: [$i set method] [$i set url]"} - #puts stderr RUNNING=[my set running] - if {[llength $blocked] > 0} { - set newreq [lindex $blocked 0] - set blocked [lrange $blocked 1 end] - my scheduleRequest [lindex $newreq 0] [lindex $newreq 1] [lindex $newreq 2] - } elseif {[my set running] < 1} { - my set done 1 - } - } - - - ParallelSink instproc scheduleRequest {method url {parentUrl ""}} { - my instvar requests blocked running maxsimultaneous - if {$running > $maxsimultaneous} { - lappend blocked [list $method $url $parentUrl] - } else { - set cmd [list Access createRequest -url $url \ - -sinkClass [my sinkClass] \ - -informObject [self] \ - -method $method \ - -timeout 25000 \ - -caching 0 -allowJoin 0 -httpVersion [my httpVersion]] - if {$parentUrl ne ""} { - lappend cmd -parentUrl $parentUrl - } - set r [eval $cmd] - } - } - - ParallelSink instproc requests {urls} { - my showTimeStart - foreach url $urls { my scheduleRequest GET $url } - my wait - my showTimeEnd - } - - ParallelSink instproc wait {} { - my instvar running - if {$running > 0} { - set savedValue $running - #my showMsg ".......... waiting for initially $running requests" - if {[catch {my vwait done} err]} { - my showMsg "vwait returned: $err " - } - #my showMsg "$savedValue requests FINISHED " - } - } - - Class MemorySink -superclass Sink - MemorySink instproc incCb {r t c} { - my append d [$r block] - next - } - MemorySink instproc content {} { - return [my set d] - } - MemorySink instproc contentLength {} { - if {[my exists d]} { - return [string length [my set d]] - } else { - return 0 - } - } - - Class FileSink -superclass Sink -parameter fileName - ### write methods - #FileSink instproc startCb {r} { - # next - #} - FileSink instproc notifyCb {r} { - #my showVars - next - my instvar file fileName - if {[info exists fileName]} { - set file [::open $fileName w] - fconfigure $file -translation binary - } else { - # we have no filename; we assume the sink must be a dummy sink - # that deletgates its work to some other FileSink - my class ShadowFileSink - my notifyCb $r - } - } - FileSink instproc incCb {r t c} { - next - if {[my exists file]} { - if {$r == "req0"} { - puts stderr "*******************************************************" - puts stderr [$r block] - puts stderr "*******************************************************" - } - puts -nonewline [my set file] [$r block] - } - } - FileSink instproc endCb {r} { - #my showCall - next - my close - } - FileSink instproc cancelCb {r} { - next - my close - } - FileSink instproc close {} { - if {[my exists file]} { - ::close [my set file] - my unset file - } - } - ### read methods - FileSink instproc content {} { - next - my instvar file fileName - set file [::open $fileName r] - fconfigure $file -translation binary - set d [read [my set file]] - my close - return $d - } - FileSink instproc contentLength {} { - next - if {[my exists fileName]} { - return [file size [my set fileName]] - } else { - return 0 - } - } - - - Class ShadowFileSink -superclass Sink - ShadowFileSink instproc notifyCb {r} { - next - my set token $r - } - ShadowFileSink instproc content {} { - my instvar token - next - return [[$token set sink] content] - } - ShadowFileSink instproc contentLength {} { - my instvar token - next - return [[$token set sink] contentLength] - } - - - Class CacheFileSink -superclass FileSink -parameter {{persistent 1}} - CacheFileSink instproc notifyCb req { - #my showCall - if {![my exists fileName]} { - my instvar persistent - set url [$req set url] - my set fileName [persistentCache newEntry $url $req $persistent ""] - } - # it is important to execute next after setting the fileName... - next - } - CacheFileSink instproc endCb req { - #my showCall - my instvar persistent - next - if {$persistent} { - persistentCache entryDone [$req set url] - } - } - CacheFileSink instproc cancelCb req { - next - if {[my exists fileName]} { - file delete [my set fileName] - my unset fileName - } - } - CacheFileSink instproc destroy {} { - #my showCall - if {[my exists fileName] && ![my set persistent]} { - #my showMsg "file delete $fileName" - file delete [my set fileName] - my unset fileName - } - next - } - - - #=========================================================== - - Class SimpleRequest -parameter { - {caching 0} - {useFileSink 0} - {blocking 1} - {timing 0} - url fileName - timeout httpVersion method headers data query contentType informObject - } - SimpleRequest instproc fileName x { - my set fileName $x - my set useFileSink 1 - } - SimpleRequest instproc init args { - my instvar useFileSink fileName sink caching token - #my showMsg "Starting Request" - next - if {[info exists fileName]} { - set sink [FileSink create [self]::sink -fileName $fileName] - } elseif {$useFileSink || $caching > 0} { - set sink [FileSink create [self]::sink] - } else { - set sink [MemorySink create [self]::sink] - } - #my showMsg "class of sink = [$sink info class]" - if {[my set timing]} { - $sink mixin TimeSink - } - set cmd [list Access createRequest \ - -url [my url] \ - -informObject $sink \ - -blocking [my blocking] \ - -caching $caching] - foreach optionalParameter { - timeout httpVersion method headers data query - contentType informObject - } { - if {[my exists $optionalParameter]} { - lappend cmd -$optionalParameter [my set $optionalParameter] - } - } - #my showMsg "cmd=$cmd" - set token [eval $cmd] - #if {[my success]} { - # $sink reportTimes - # #puts stderr <[$sink content]> - #} - } - SimpleRequest instproc success {} { - if {[my exists token]} { - return [expr {[[my set token] set finished] == 1}] - } - return 0 - } - SimpleRequest instproc destroy {} { - if {[my exists token]} { - [my set token] destroy - } - next - } - SimpleRequest instproc getContent {} { - [my set sink] content - } - SimpleRequest instproc getContentLength {} { - [my set sink] contentLength - } - #SimpleRequest instproc destroy args { next } - - ####################################################################### - - namespace export \ - Access FileAccess File CacheAccess ReAccess \ - Cmd NetAccess Http Https Sink TimeSink \ - ParallelSink MemorySink FileSink \ - ShadowFileSink CacheFileSink SimpleRequest -} - -namespace import ::xotcl::comm::httpAccess::* Index: xotcl/library/comm/COPYRIGHT =================================================================== diff -u -N --- xotcl/library/comm/COPYRIGHT (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/comm/COPYRIGHT (revision 0) @@ -1,41 +0,0 @@ - * XOTcl - Extended OTcl - * - * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) - * - * (a) Vienna University of Economics and Business Administration - * Dept. of Information Systems / New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - Index: xotcl/library/comm/Connection.xotcl =================================================================== diff -u -N --- xotcl/library/comm/Connection.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/comm/Connection.xotcl (revision 0) @@ -1,256 +0,0 @@ -# -*- tcl -*- $Id: Connection.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::comm::connection 1.0 - -package require XOTcl - -namespace eval ::xotcl::comm::connection { - namespace import ::xotcl::* - - Class Connection -parameter {host port req socket handle} - - Connection proc make {r host port reuse reusedVar} { - #my showCall - my instvar openConnections - upvar [self callinglevel] $reusedVar reused - if {$reuse} { - set handle $host:$port-[$r set blocking] - #if {[array exists openConnections]} {parray openConnections} - if {![info exists openConnections($handle)]} { - # there is no persistent connection, we create a new one - set reused 0 - set openConnections($handle) \ - [Connection new -host $host -port $port -req $r -handle $handle] - #my showMsg "$openConnections($handle) CONNECTION add for $handle added" - } else { - # there is a persistent connection - set reused 1 - set c $openConnections($handle) - $c instvar req - #::puts stderr "$c CONNECTION reuse for $handle ($c) new req=$r" - if {[info exists req]} { - # the persistent connection is active with some request $req - #::puts stderr "$c CONNECTION req $req already active" - } else { - # the persistent connection is currently not active - $c set req $r - } - } - return $openConnections($handle) - } else { - set reused 0 - return [Connection new -host $host -port $port -req $r] - } - } - Connection proc removeHandle handle { - #my showVars - #puts stderr "***************** unsetting $handle ***************" - if {[my exists openConnections($handle)]} { - my unset openConnections($handle) - } - } - Connection instproc init args { ;# the constructor creates the socket - my set blocked {} - next - if {[my exists socket]} { - my set keepOpen 1 - } else { - my set keepOpen 0 - if {[catch {my socket [socket -async [my host] [my port]]} msg]} { - my set error $msg - return - } - } - ::fconfigure [my socket] -blocking false -buffersize 16384 - } - #Connection instproc STATUS {ctx} { - # my instvar socket - # ::puts stderr "*** $ctx: $socket blocking=[::fconfigure $socket -blocking]" - #} - Connection instproc destroy {} { ;# the destructor closes the socket - #my showCall - if {[my exists handle]} { - #my showVars handle - # the connection was created via make - [self class] removeHandle [my handle] - #::puts stderr "my CONNECTION close and destroy [my handle]" - } else { - #::puts stderr "my CONNECTION close and destroy" - } - # in cases of errors we might not have a socket yet - if {[my exists socket]} { - close [my socket] - } - next - } - Connection instproc translation {translation} { - #showCall - ::fconfigure [my socket] -translation $translation - } - Connection instproc importSSL args { - #my showCall - package require tls - eval tls::import [my socket] $args - } - Connection instproc fconfigure args { - #my showCall - eval ::fconfigure [my socket] $args - } - Connection instproc event {type r method} { - #my showCall - my instvar req blocked - # is the request in the argument list the currently active request? - if {[info exists req] && $r == $req} { - # a request can overwrite its active request - if {$method eq ""} { - ::fileevent [my socket] $type "" - #my showMsg "CONNECTION clear for [my socket]" - } else { - #my showMsg "CONNECTION register for [my socket]" - ::fileevent [my socket] $type [list $r $method] - } - } else { - #my showMsg "event BLOCKING current request=$req, new=$r $method" - #my showMsg "event BLOCKING rd=[::fileevent [my socket] readable]" - #my showMsg "event BLOCKING wr=[::fileevent [my socket] writable]" - #my showMsg "event BLOCKING bl=$blocked" - ::lappend blocked $r $type $method - } - } - Connection instproc hold {} { - my set continueCmd [list ::fileevent [my socket] readable \ - [::fileevent [my socket] readable]] - ::fileevent $socket readable {} - #my showVars continueCmd - } - Connection instproc resume {} { - #my showCall - if {[my exists continueCmd]} { - eval [my set continueCmd] - my unset continueCmd - } - } - - Connection instproc puts {string} { - #my showCall - if {[catch {::puts [my socket] $string} msg]} { - ::puts stderr message=$msg - } - } - Connection instproc puts-nonewline {string} { - #my showCall - if {[catch {::puts -nonewline [my socket] $string} msg]} { - ::puts stderr message=$msg - } - } - Connection instproc gets {var} { - #my showCall - upvar [self callinglevel] $var result - if {[catch {set n [::gets [my socket] result]} msg]} { - my set error $msg - #my showMsg "CONNECTION error" - return 0 - } - #my showMsg "n=$n, result=<$result>" - return $n - } - Connection instproc read {} { - #my showCall - my instvar socket - if {[catch {set result [::read $socket [::fconfigure $socket -buffersize]]} msg]} { - my set error $msg - return "" - } - #my showMsg Done - return $result - } - Connection instproc readSize {length} { - if {[catch {set result [::read [my socket] $length]} msg]} { - my set error $msg - return 0 - } - return $result - } - Connection instproc flush {} { - #my showCall - if {[catch {::flush [my socket]} msg]} { - my set error $msg - } - } - Connection instproc eof {} { - #my showCall - if {[my exists error]} { - return 1 - } else { - return [::eof [my socket]] - } - } - Connection instproc close {} { - #my showCall - my instvar req socket blocked - if {![info exists socket]} return ;# error during connection open - ::fileevent $socket readable "" - ::fileevent $socket writable "" - $req freeConnection - if {[my exists persistent]} { - my flush - #::puts stderr "[self] PERSISTENT CONNECTION wanna close" - if {$blocked eq ""} { - ::fileevent $socket readable [list [self] destroy] - unset req - } else { - #my showVars blocked - set req [lindex $blocked 0] - set type [lindex $blocked 1] - set method [lindex $blocked 2] - set blocked [lrange $blocked 3 end] - #my showMsg "in persistent connection unblock $type [list $req $method]" - ::fileevent $socket $type [list $req $method] - } - } else { - #my showMsg "in nonpersistent connection blocked=$blocked" - if {$blocked ne ""} { - set req [lindex $blocked 0] - set type [lindex $blocked 1] - set method [lindex $blocked 2] - set nblocked [lrange $blocked 3 end] - close $socket - unset socket - if {[my exists handle]} { - [self class] removeHandle [my handle] - } - if {[my exists error]} { - #my showMsg "UNSETTING ERROR -----------" - my unset error - } - my init - set blocked $nblocked - ::fileevent $socket $type [list $req $method] - #my showMsg "REANIMATE $socket $type [list $req $method]" - #my showVars - } else { - #my showMsg "Nothing blocked: readable=[::fileevent $socket readable]" - - my destroy - } - } - } - Connection instproc makePersistent {p} { - if {$p} { - my set persistent 1 - } else { - if {[my exists persistent]} { - my unset persistent - #my showMsg "no longer persistent" - } - } - } - - namespace export Connection -} - -namespace import ::xotcl::comm::connection::* - -if {[info command bgerror] eq ""} { - proc bgerror {msg} { puts stderr "******* bgerror $msg $::errorInfo*****"} -} Index: xotcl/library/comm/Dav.xotcl =================================================================== diff -u -N --- xotcl/library/comm/Dav.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/library/comm/Dav.xotcl (revision 0) @@ -1,175 +0,0 @@ -# $Id: Dav.xotcl,v 1.4 2006/02/18 22:17:33 neumann Exp $ - -package provide xotcl::comm::dav 0.9 - -package require XOTcl - -namespace eval ::xotcl::comm::dav { - package require xotcl::comm::httpAccess - namespace import ::xotcl::* - - Class Dav -superclass Http - Dav instproc initialize args { - my instvar contentType - #showCall - set contentType text/xml - next - } - - Dav instproc PROPFIND {} { - #showCall - # extra dav headers - # Depth: ("0" | "1" | "infinity") [infinity is the default] - - # body is a propfind XML-Element - # - # - # - # - - # this should be set by the clients - # - # - # - # - my open - } - Dav instproc PROPPATCH {} { - #showCall - # body is a propertyupdate XML-Element - # - # - # - - # set xmlReqBody($method) " - # - # - # - # - # - # - # " - my open - } - Dav instproc MKCOL {} { - #showCall - # invoked without a request body (may contain a message body?) - my open - } - Dav instproc GET {} { - #showCall - # invoked without a request body and without extra header - # back to HTTP class - next - } - Dav instproc HEAD {} { - #showCall - # invoked without a request bodyand without extra header - # back to HTTP class - next - } - Dav instproc POST {} { - #showCall - # the same as in RFC2068 - # back to HTTP class - next - } - Dav instproc DELETE {} { - #showCall - # extra dav headers - # Depth: ("0" | "1" | "infinity") - - # invoked without a request body - my open - } - Dav instproc PUT {} { - #showCall - # PUT for Non-Collection Resources --> RFC2068 - # PUT for Collections --> MKCOL - # next - } - Dav instproc COPY {} { - #showCall - # extra dav headers - # If: [see 9.4 WebDAV] - # Destination: [see RFC2396 for the definition of absolutURI] - # Depth: ("0" | "1" | "infinity") - # Overwrite: ("T" | "F") - - - # body is a propertybehavior XML-Element - # - # - # - # - my open - } - Dav instproc MOVE {} { - #showCall - # extra dav headers - # If: [see 9.4 WebDAV] - # Destination: [see RFC2396 for the definition of absolutURI] - # Depth: "infinity" [see 8.9.2] - # Overwrite: ("T" | "F") - - # body is a propertybehavior XML-Element - # see COPY - my open - } - Dav instproc LOCK {} { - #showCall - # extra dav headers - # If: [see 9.4 WebDAV] - # Destination: [see RFC2396 for the definition of absolutURI] - # Depth: ("0" | "1" | "infinity") - # Timeout: [see 9.8 WebDAV] - # Authorization: (defined in HTTP1.1 in 14.8) - - # body is a lockinfo XML-Element - # - # - # - # - # - # - # - my open - } - - # The Lock-Token request header is used with the UNLOCK method to - # identify the lock to be removed. - Dav instproc UNLOCK {} { - my instvar headers - #showCall - # extra dav headers - # Lock-Token: [see 8.11 in WebDAV] - - # invoked without a request body - my open - } - - #--------------------- - # Utility # - #--------------------- - - #? - Object xmlReqBodyManager - xmlReqBodyManager proc requireXmlReqBody {request} { - } - - #? - Object davHeaderManager - davHeaderManager proc requireDavHeader {request} { - } - - - - #LOCK /DAV/welcome.html HTTP/1.1 - #Host: wawog - #Connection: close - - namespace export Dav \ - xmlReqBodyManager davHeaderManager -} - -namespace import ::xotcl::comm::dav::* Index: xotcl/library/comm/Ftp.xotcl =================================================================== diff -u -N --- xotcl/library/comm/Ftp.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/comm/Ftp.xotcl (revision 0) @@ -1,175 +0,0 @@ -# $Id: Ftp.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::comm::ftp 0.9 -package require xotcl::comm::httpAccess - -package require XOTcl - -namespace eval ::xotcl::comm::ftp { - namespace import ::xotcl::* - - Class Ftp -superclass NetAccess -parameter {user passwd} - Ftp instproc initialize args { - #my showCall - my instvar port caching user passwd loginMsg resp blocksize - set port 21 - set blocksize 1024 - set caching 0 - set user ftp - set passwd cineast@ - set loginMsg {} - set resp(connect) {220 provideUser} - set resp(provideUser) {331 providePasswd} - set resp(providePasswd) {230 loginFinished} - set resp(loginFinished) {227 pasv} - set resp(pasv) {200 type} - set resp(type-list) {150 list} - set resp(type-retr) {150 retr 550 retry-retrieve} - set resp(transfer) {226 transferDone} - next - } - Ftp instproc err {state reply} { - my abort "Error in $state: $reply" - } - Ftp instproc queryServer {query state} { - my instvar S - puts $S $query - flush $S - fileevent $S readable [::list [self] response $state] - } - Ftp instproc response {state} { - #my showCall - my instvar S code msg - set reply [gets $S] - #my showVars reply - if {[regexp {^([0-9]+)[-](.*)$} $reply _ code msg]} { - fileevent $S readable [::list [self] responseMulti $state] - } else { - regexp {^([0-9]+) (.*)$} $reply _ code msg - my responseEnd $state - } - } - Ftp instproc responseMulti {state} { - # multi line response - my instvar S code msg - set m [gets $S] - if {[regexp "^$code " $m]} { - my responseEnd $state - } else { - # try to strip code and dash - regexp "^$code-(.*)\$" $m _ m - append msg \n$m - } - } - Ftp instproc responseEnd {state} { - my instvar S code msg resp - fileevent $S readable {} - #puts stderr "code=$code, msg=<$msg>" - foreach {c newState} $resp($state) { - if {$c == $code} { return [my $newState] } - } - my err $state "expected=$resp($state), got $code $msg" - } - Ftp instproc GET {} { - my instvar S host port url - regexp {^(.*):([0-9]+)$} $host _ host port - my running - # rb running my $url ;# ??? - # proxy ? - set S [socket -async $host $port] - fconfigure $S -blocking false -translation {auto crlf} - fileevent $S readable [::list [self] response connect] - } - Ftp instproc provideUser {} { - my instvar user msg loginMsg - set loginMsg $msg - my queryServer "USER $user" provideUser - } - Ftp instproc providePasswd {} { - my instvar passwd - # if {[pwdManager requirePasswd "Ftp $user\@$host" $user password]} { - # my queryServer "PASS $password" providePasswd - # } - my queryServer "PASS $passwd" providePasswd - } - Ftp instproc loginFinished {} { - my instvar msg loginMsg - append loginMsg \n$msg - my queryServer "PASV" loginFinished - } - Ftp instproc pasv {} { - my instvar S D msg - set d {([0-9]+)} - if {[regexp "\[(]$d,$d,$d,$d,$d,$d" $msg _ 1 2 3 4 p1 p2]} { - if {[catch {set D [socket -async $1.$2.$3.$4 [expr {$p1*256 + $p2}]]} err - ]} { - return [my err $proc $err] - } - fconfigure $D -blocking no -translation binary - } else { - return [my err $proc $msg] - } - my queryServer "TYPE I" pasv - } - Ftp instproc type {} { - my instvar path - if {$path=={}} { - my queryServer "LIST" type-list - } elseif {[regexp /$ $path]} { - my queryServer "LIST $path" type-list - } else { - my queryServer "RETR $path" type-retr - } - } - Ftp instproc retry-retrieve {} { - my instvar path url - append url / - my queryServer "LIST $path/" type-list - } - Ftp instproc list {} { - my instvar S D contentType - set contentType text/dirlist - my headerDone - fileevent $S readable [::list [self] response transfer] - fileevent $D readable [::list [self] readData] - } - Ftp instproc read {} { - # the method read is called by the more general method readData - my instvar D block blocksize - if {[::eof $D]} { - set block "" - close $D - unset D - } else { - #puts stderr blocksize=$blocksize - set block [::read $D $blocksize] - #puts stderr read:[string length $block]bytes - } - } - Ftp instproc transferDone {} { - my instvar D S - if {[info exists D]} { - fileevent $S readable {} - set block "" - close $D - unset D - } - my finish - } - Ftp instproc retr {} { - my instvar S D msg totalsize contentType path - regexp {[(]([0-9]+)[ ]+[Bb]ytes} $msg _ totalsize - set contentType [Mime guessContentType $path] - my headerDone - if {[info exists S]} { - # file dialog was not canceled - fileevent $S readable [::list [self] response transfer] - fileevent $D readable [::list [self] readData] - fconfigure $D -translation binary - } - } - - namespace export Ftp -} - -namespace import ::xotcl::comm::ftp::* Index: xotcl/library/comm/Httpd.xotcl =================================================================== diff -u -N --- xotcl/library/comm/Httpd.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/library/comm/Httpd.xotcl (revision 0) @@ -1,837 +0,0 @@ -# -*- tcl -*- $Id: Httpd.xotcl,v 1.9 2007/08/14 16:38:26 neumann Exp $ -# -# The XOTcl class Httpd implements an HTTP/1.0 and HTTP/1.1 server with -# basic functionality. -# -# Gustaf Neumann (neumann@wu-wien.ac.at) - -set VERSION 1.1 -package provide xotcl::comm::httpd $VERSION - -package require XOTcl - -#package require xotcl::comm::httpAccess - -package require xotcl::comm::connection -package require xotcl::trace -package require xotcl::comm::mime - -namespace eval ::xotcl::comm::httpd { - namespace import ::xotcl::* - - Class Httpd -parameter { - {port 80} - ipaddr - {root ./} - {logdir $::xotcl::logdir} - {httpdWrk Httpd::Wrk} - {redirects [list]} - {workerTimeout 10000} - } - Httpd proc Date seconds {clock format $seconds -format {%a, %d %b %Y %T %Z}} - Httpd instproc checkRoot {} { - my instvar root - set root [string trimright $root /] - if {![file isdir $root]} { - puts stderr "Warning: create root directory '$root'" - file mkdir $root - } - # make directory absolute - set currentdir [pwd] - cd $root - set root [pwd] - #puts stderr "[self] root=$root" - cd $currentdir - } - - proc ! string { - set f [open [::xotcl::tmpdir]log w+]; - puts $f "[clock format [clock seconds]] $string" - close $f} - - Httpd instproc init args { - my instvar port logdir logfile redirects - if {![my exists workerMixins]} { - my set workerMixins {} - #puts stderr "resetting workermixins of [self]" - } - next - set proto [string trim [namespace tail [my info class]] :d] - puts stderr "Starting XOTcl [string toupper $proto] server $::VERSION\ - [string tolower $proto]://[info hostname]:$port/" - - # Start a server by listening on the port - if {[my exists ipaddr]} {set ip "-myaddr [my set ipaddr]"} {set ip ""} - my set listen [eval [list socket -server [list [self] accept]] $ip $port] - #my set listen [socket -server [list [self] accept] $port] - - my checkRoot - if {![file isdir $logdir]} {file mkdir $logdir} - set logfile [open $logdir/serverlog-$port a+] - my array set requiresBody \ - {GET 0 HEAD 0 POST 1 PUT 1 DELETE 0 OPTIONS 0 TRACE 0} - } - Httpd instproc destroy {} { # destructor - catch {close [my set listen]} - catch {close [my set logfile]} - next - } - Httpd instproc accept {socket ipaddr port} { # Accept a new connection and set up a handler - #puts stderr "using workermixins of [self] {[my set workerMixins]}" - - [my set httpdWrk] new -childof [self] -socket $socket -ipaddr $ipaddr \ - -port $port -mixin [my set workerMixins] - } - Httpd instproc redirect list { - foreach {pattern hostport} $list { - my lappend redirects $pattern $hostport - } - } - - - Class Httpd::Wrk -parameter {socket port ipaddr} - Httpd::Wrk array set codes { - 200 {Data follows} 201 {Created} 204 {No Content} - 302 {Moved Temporarily} 304 {Not Modified} - 400 {Bad Request} 401 {Unauthorized} 402 {Payment Required} - 403 {Forbidden} 404 {Not Found} 405 {Method Not Allowed} - 406 {Not Acceptable} 408 {Request Timeout} 411 {Length Required} - 500 {Internal Server Error} 503 {Service Unavailable} 504 {Service Temporarily Unavailable} - } - Httpd::Wrk instproc formData {} {my set formData} - Httpd::Wrk instproc init args { # Constructor - my instvar socket port ipaddr - my set formData [list] - my set replyHeaderFields [list] - next - my makeConnection $socket - my log Connect "$ipaddr $port" - my connection translation {auto crlf} - my connection event readable [self] firstLine - } - Httpd::Wrk instproc makeConnection {socket} { - Connection create [self]::connection -socket $socket -req [self] - } - Httpd::Wrk instproc close {} { # logical close of a single request - #my showCall - my instvar version timeout meta - set eof [my connection eof] - if {$version > 1.0 && !$eof} { - #my showMsg "!EOF in http/$version" - my connection flush - set timeout [after [[my info parent] workerTimeout] [self] destroy] - ### reset parameters, worker will be potentially reused - if {[array exists meta]} { - unset meta - array set meta {} - } - unset version - if {[my exists user]} { - my unset user - my unset realm - } - foreach c [my set formData] { $c destroy } - my set replyHeaderFields [list] - my set formData {} - #my showVars - my connection translation {auto crlf} - my connection event readable [self] firstLine - } elseif {$eof} { - #my showMsg "Destroy in http/$version" - # the client side has closed the connection - my destroy - } else { - #my showMsg "!EOF in http/$version ???" - # we close the conneciton actively (e.g. forced by an error) - my connection flush - #puts stderr "DESTROY----this line should never show up" - my destroy - } - } - Httpd::Wrk instproc destroy {} { - #my showCall - if {[my isobject [self]::connection]} { - my connection close - } - next - } - Httpd::Wrk instproc freeConnection {} { - } - Httpd::Wrk instproc firstLine {} { # Read the first line of the request - #my showCall - my instvar method resourceName hasFormData query fileName \ - version timeout - if {[info exists timeout]} { - after cancel $timeout - unset timeout - } - my lappend replyHeaderFields Date [Httpd Date [clock seconds]] - set n [my connection gets firstLine] - if {$n > 0} { - #::puts stderr "[self] firstline=<$firstLine>" - # parse request line, ignore HTTP version for now - if {[regexp {^(POST|GET|PUT|HEAD|OPTIONS) ([^?]+)(\??)([^ ]*) *HTTP/(.*)$} \ - $firstLine _ method resourceName hasFormData query version]} { - set resourceName [string trimright [string trimleft $resourceName ./] " "] - # construct filename - [my info parent] instvar root - set fileName $root/[url decodeName $resourceName] - #puts stderr ---[encoding convertfrom utf-8 $fileName]---- - set fileName [encoding convertfrom utf-8 $fileName] - # - my decode-formData $query - my log Query $firstLine - if {[my exists forceVersion1.0]} { - set version 1.0 - } - my connection makePersistent [expr {$version > 1.0}] - my connection event readable [self] header - } else { - set version 1.0 - set resourceName ??? - set method ??? - my log Error "bad first line:$firstLine" - my replyCode 400 - my replyErrorMsg - } - } elseif {![my connection eof]} { - #my showMsg "+++ not completed EOF=[my connection eof]" - } else { - set version 1.0 - #my showMsg "+++ n=negative ($n) EOF=[my connection eof] version set to 1.0" - my close - } - } - Httpd::Wrk instproc header {} { # Read the header - #my showCall - my instvar method data - if {[my connection gets line] > 0} { - #puts stderr line=$line - if {[regexp -nocase {^([^:]+): *(.+)$} $line _ key value]} { - my set meta([string tolower $key]) $value - } - } else { - #puts stderr line-EMPTY - if {[my exists meta(content-length)] && [my set meta(content-length)]>0} { - #puts stderr "we have content-length [my set meta(content-length)]" - set data "" - my connection translation binary - my connection event readable [self] receive-body - } elseif {[my exists meta(content-type)] && - [regexp -nocase {multipart/form-data; *boundary=} \ - [my set meta(content-type)]]} { - #puts stderr "formdata" - set data "" - my connection event readable [self] receive-body - } else { - #puts stderr "no-content-length, triggering respond" - my connection event readable [self] "" - [my info parent] instvar requiresBody - if {$requiresBody($method)} { - my replyCode 411 - my replyErrorMsg - } else { - my check-redirect - } - } - } - } - Httpd::Wrk instproc receive-body {} { ;# ... now we have to read the body - #my showCall - my instvar method data meta - set d [my connection read] - if {$d ne ""} { - append data $d - #my showMsg "datal=[string length $data], cl=$meta(content-length)" - if {[string length $data] >= $meta(content-length)} { - my connection event readable [self] "" - if {$method eq "POST"} { my decode-POST-query } - my check-redirect - } - } else { ;# 0 byte, must be eof... - my showMsg "received 0 bytes" - my connection event readable [self] "" - if {[string length $data] < $meta(content-length)} { - my replyCode 404 - my replyErrorMsg - } else { - my check-redirect - } - } - } - Httpd::Wrk instproc unmodified mtime { - my instvar meta - if {[info exists meta(if-modified-since)]} { - set ms $meta(if-modified-since) - regexp {^([^;]+);(.*)$} $ms _ ms options - if {[catch {set mss [clock scan $ms]}]} { - regsub -all -- {-} $ms " " ms - if {[catch {set mss [clock scan $ms]}]} { - set ms [lreplace $ms end end] - set mss [clock scan $ms] - } - } - return [expr {$mtime <= $mss}] - } - return 0 - } - Httpd::Wrk instproc check-redirect {} { - [my info parent] instvar redirects - my instvar resourceName hasFormData query - set resource $resourceName$hasFormData$query - foreach {pattern hostport} $redirects { - #puts stderr "match <$pattern> <$resource> [regexp $pattern $resource]" - if {[regexp $pattern $resource]} { - #puts stderr "do redirect to $hostport/$resource" - my replyCode 302 location $hostport/$resource - my replyErrorMsg - return - } - } - my respond - } - Httpd::Wrk instproc respond {} { # Respond to the query - # the request was read completely... This method is wellsuited for mixins! - my respond-[my set method] - } - - Httpd::Wrk instproc respond-GET {} { - #my showCall - my instvar fileName - my sendFile $fileName - } - Httpd::Wrk instproc respond-HEAD {} { # Respond to the query - my instvar fileName - if {[file readable $fileName]} { - my replyCode 200 \ - Last-Modified [Httpd Date [file mtime $fileName]] \ - Content-Type [Mime guessContentType $fileName] \ - Content-Length [file size $fileName] - my connection puts "" - #my log Done "$fileName [Mime guessContentType $fileName]" - my close - } else { - my replyCode 404 - my replyErrorMsg - } - } - Httpd::Wrk instproc respond-OPTIONS {} { # Respond to the query - my replyCode 200 \ - Allow "OPTIONS, GET, HEAD, POST" \ - Public "OPTIONS, GET, HEAD, POST" - my connection puts "" - my close - } - Httpd::Wrk instproc respond-PUT {} { - my instvar data method fileName - my replyCode [expr {[file writable $fileName] ? 200 : 201}] - my connection puts "" - set out [open $fileName w] - fconfigure $out -translation binary - puts -nonewline $out $data - my log Done "$fileName [Mime guessContentType $fileName]" - close $out - my close - } - Httpd::Wrk instproc respond-CGI {} { - my instvar fileName - if {[file executable $fileName]} { - my replyCode 200 - my connection puts [exec $fileName] ;# no parameter handling yet - my close - } else { - my replyCode 403 - my replyErrorMsg - } - } - Httpd::Wrk instproc new-formData {} { - set arg [Object create [self]::[my autoname formData]] - my lappend formData $arg - return $arg - } - Httpd::Wrk instproc decode-formData {query} { - #my showCall - foreach pair [split [string trimleft $query \n] &] { - set arg [my new-formData] - if {[regexp {^(.+)=(.*)$} $pair _ name content]} { - $arg set name [url decodeItem $name] - $arg set content [url decodeItem $content] - } else { - $arg set content [url decodeItem $pair] - } - } - } - Httpd::Wrk instproc decode-POST-query {} { - if {[my exists meta(content-type)]} { - set ct [my set meta(content-type)] - if {[regexp -nocase {application/x-www-form-urlencoded} $ct]} { - #my showMsg "ordinary FORM" - my decode-formData [my set data] - return - } elseif {[regexp -nocase {multipart/form-data; *boundary=(.*)$} $ct \ - _ boundary]} { - #my showMsg "multipart FORM" - set parts [my set data] - set bl [expr {[string length $boundary]+2}] - while {[set endIDX [string first --$boundary $parts]] > -1} { - set part [string range $parts $bl [expr {$endIDX-1}]] - if {[set endHD [string first \r\n\r\n $part]] > -1} { - set arg [my new-formData] - if {[catch {Mime multipart-decode-header \ - [string range $part 0 [expr {$endHD-1}]] \ - $arg} msg]} { - my replyCode 406 - my replyErrorMsg $msg - return 0 - } - $arg set content [string range $part \ - [expr {$endHD + 4}] \ - [expr {[string length $part] -3}]] - #$arg showVars - } - set parts [string range $parts [expr {$endIDX+2}] end] - } - } - } - } - Httpd::Wrk instproc respond-POST {} { - my replyCode 405 - my replyErrorMsg - #my respond-CGI - } - - Httpd::Wrk instproc replyErrorMsg {{msg ""} args} { - my instvar replyCode - [self class] instvar codes - foreach {tag value} $args {my connection puts "$tag: $value"} - my sendText "\nStatus Code: $replyCode\n\ - $msg

    \n\ - Status Code $replyCode: $codes($replyCode)
    \n\ - Resource Name: [my set resourceName]\n" - my close ;# close must be last call - } - Httpd::Wrk instproc replyCode {code args} { - #my showCall - my instvar version - [self class] instvar codes - my set replyCode $code - my connection puts "HTTP/$version $code $codes($code)" - foreach {tag value} [my set replyHeaderFields] {my connection puts "$tag: $value"} - foreach {tag value} $args {my connection puts "$tag: $value"} - if {$code >= 400} { - my log Error "$code $codes($code)\tmeta: [my array get meta]" - } else { - my log Done "$code $codes($code)" - } - } - Httpd::Wrk instproc sendText {response {type text/html}} { - #my showCall - my connection puts "Content-Type: $type" - # bei einer leeren Responses blockieren Klienten und melden Fehler - if {$response eq ""} { set response " " } - my connection puts "Content-Length: [string length $response]\n" - if {[my set method] ne "HEAD"} { - my connection fconfigure -translation {auto binary} - my connection puts-nonewline $response - } else { - my showMsg HEAD! - } - } - Httpd::Wrk instproc sendMsg {response {type text/html}} { - # my showCall - my replyCode 200 - my sendText $response $type - my close - } - Httpd::Wrk instproc sendDir {dirName} { - [my info parent] instvar root - set title "Directory listing" - set reply "$title

    $title

    \n\n" - set oldpwd [pwd] - cd $root - set dirs ""; set files "" - foreach f [lsort -dictionary [glob -nocomplain ./$dirName/*]] { - set full [file join $root $f] - set pname [string trimleft $f ./] - if {[file isdir $full]} { - append pname / - } - if {![catch {set size [file size $full]}]} { - # it is not a broken link - set entry "" - append entry \ - \ - " \ - " \ - \n - if {[string match */ $pname]} {append dirs $entry} else {append files $entry} - } - } - append reply $dirs $files "
    "$pname" " $size " [clock format [file mtime $full]]
    \n" - cd $oldpwd - my sendMsg $reply - return - } - - Httpd::Wrk instproc sendFile {fn {type ""}} { - #my showCall - if {[file isdirectory $fn]} { - set full [file join $fn index.html] - if {[file readable $full]} { - set fn $full - } else { - my sendDir [my set resourceName] - return - } - } - #puts stderr "readable '$fn' [file readable $fn]" - if {[file readable $fn]} { - set mtime [file mtime $fn] - if {[my unmodified $mtime]} { - my replyCode 304 - my replyErrorMsg - return - } - if {$type eq ""} {set type [Mime guessContentType $fn]} - my replyCode 200 \ - Last-Modified [Httpd Date $mtime] \ - Content-Type $type \ - Content-Length [file size $fn] - my connection puts "" - my connection fconfigure -translation binary ;#-buffersize 65536 - set localFile [open $fn] - fconfigure $localFile -translation binary -buffersize 65536 - fcopy $localFile [my connection set socket] \ - -command [list [self] fcopy-end $localFile] - } else { - my replyCode 404 - my replyErrorMsg - } - } - Httpd::Wrk instproc fcopy-end {localFile args} { # End of fcopy - close $localFile - my connection fconfigure -blocking false ;# fconfigure changes blocking in 8.3.2! - my close - } - Httpd::Wrk instproc log {reason arg} { # trivial logging - my instvar port ipaddr - if {[my exists user]} { - set user [my set user]/[my set realm] - } {set user -} - [my info parent] instvar logfile - puts $logfile "[clock format [clock seconds]] $user $ipaddr:$port\t$reason\t$arg" - flush $logfile - } - - - ######################################################################### - Class Httpsd -superclass Httpd -parameter { - {port 443} - {httpdWrk Httpsd::Wrk} - {requestCert 0} - {requireValidCert 0} - {certfile filename.crt} - {keyfile filename.key} - {cafile cacert.pem} - {infoCb {}} - } - Httpsd instproc init args { - package require tls - proc tls::password {} { - puts stderr "getting passwd" - return pemp - } - next - } - - Class Httpsd::Wrk -superclass Httpd::Wrk - Httpsd::Wrk instproc firstLine {} { - my set forceVersion1.0 1 - my lappend replyHeaderFields Connection close - next - } - Httpsd::Wrk instproc makeConnection {socket} { - Connection create [self]::connection -socket $socket -req [self] - [my info parent] instvar \ - keyfile certfile cafile infoCb requestCert requireValidCert - # SSL-enable a regular Tcl channel - it need not be a socket, but - # must provide bi-directional flow. Also setting session parameters - # for SSL handshake. www.sensus.org/tcl/tls.htm - - # -request bool --> Request a certificate from peer during SSL - # handshake. (default: true) - - # -require bool --> Require a valid certificate from peer during SSL - # handshake. If this is set to true then -request must also be set - # to true. (default: false) - - # -server bool --> Handshake as server if true, else handshake as - # client.(default: false) - my connection importSSL -server 1 \ - -certfile $certfile \ - -keyfile $keyfile \ - -cafile $cafile \ - -request $requestCert \ - -require $requireValidCert \ - -command $infoCb - } - ######################################################################### - - - - ### - ### Mixin-Classes for respond patterns - ### mixes into Http and Httpd::Wrk - ### - Class Httpd::Responder - Httpd::Responder instproc init args { - next - my lappend workerMixins Httpd::Responder::Wrk - my set respondpatterns {} - # Example how to register new methods: regexp is matched with the triple - # (HTTP-METHOD URL HASFORMDATA) where HASFORMDATA is empty when no - # parameters are given. The parsed components of the url etc. are - # available as instvars - my actions {^GET cgi[-]bin [?]} respond-CGI - } - Httpd::Responder instproc actions {regexp method} { - my lappend respondpatterns $regexp $method - } - Class Httpd::Responder::Wrk - Httpd::Responder::Wrk instproc respond {} { - my instvar fileName method resourceName hasFormData - [my info parent] instvar respondpatterns - ### auch das ist ein kandidat fuer eine chain of responsibility - foreach {pattern action} $respondpatterns { - if {[regexp $pattern "$method $resourceName $hasFormData"]} { - my $action - return - } - } - next - } - - ### - ### Mixin-Classes for Access Control - ### mixes into Http and Httpd::Wrk - ### - Class Httpd::AccessControl - Httpd::AccessControl abstract instproc protectedResource {fn method varAuthMethod varRealm} - Httpd::AccessControl abstract instproc credentialsNotOk {wrk credentials authMethod realm} - Httpd::AccessControl abstract instproc addRealmFile {realm authFile} - Httpd::AccessControl abstract instproc addRealmEntry {realm passwds} - Httpd::AccessControl abstract instproc protectDir {realm path methods} - - Class Httpd::AccessControl::Wrk - Httpd::AccessControl::Wrk instproc respond {} { - my instvar fileName method digestChallengeData - set controller [my info parent] - if {[$controller protectedResource $fileName $method authMethod realm]} { - #my showMsg "*** Protected resource: $fileName $method" - if {![my exists meta(authorization)] || - [$controller credentialsNotOk [self] \ - [my set meta(authorization)] $authMethod $realm]} { - my unauthorizedAccess $realm - return - } - } - next - } - - ########################################################################### - ## Basic Access Control - ########################################################################### - Class Httpd::BasicAccessControl -superclass Httpd::AccessControl - - Httpd::BasicAccessControl instproc initWorkerMixins {} { - my lappend workerMixins [self class]::Wrk - } - - Httpd::BasicAccessControl instproc init args { - next - my initWorkerMixins - } - - Httpd::BasicAccessControl instproc protectedResource {fn method varAuthMethod varRealm} { - #my showCall - # check whether access to $fn via $method is protected - upvar [self callinglevel] $varAuthMethod authMethod $varRealm realm - # we check only the current directory, not the parent directories - if {[string match */ $fn]} { - set path $fn - } else { - set path [file dirname $fn]/ - } - foreach i [list $path $path:$method] { - if {[my exists protected($i)]} { - set realm [my set protected($i)] - set authMethod Basic - return 1 - } - } - return 0 - } - - Httpd::BasicAccessControl instproc credentialsNotOk {wrk credentials authMethod realm} { - # check whether $credentials are sufficient for $realm - regexp {^(.*):(.*)$} [base64 decode [lindex $credentials 1]] _ user pwd - #puts stderr "passwd($realm:$user)=[my exists passwd($realm:$user)]" - $wrk set user $user - $wrk set realm $realm - if {[my exists passwd($realm:$user)]} { - return [expr {[my set passwd($realm:$user)] != $pwd}] - } - return 1 - } - - Httpd::BasicAccessControl instproc addRealmEntry {realm passwds} { - if {[llength $passwds] == 1} { - my addRealmFile [lindex $passwds 0] - } else { - foreach {name pwd} $passwds { - #puts stderr "realm='$realm' adding user: $name pw: $pwd" - my set passwd($realm:$name) $pwd - } - } - } - Httpd::BasicAccessControl instproc addRealmFile {realm authFile} { - set FILE [open $authFile r] - while {![eof $FILE]} { - foreach {name pwd} [split [gets $FILE] :] { - my addRealmEntry $realm [list $name $pwd] - } - } - close $FILE - } - - Httpd::BasicAccessControl instproc protectDir {realm path methods} { - my instvar root - my checkRoot - set resource $root/$path ;# resources are currently directories - if {$methods == {}} { - my set protected($resource) $realm ;#for every method - } else { - foreach m $methods { - my set protected($resource:$m) $realm ;#for selected methods - } - } - } - Class Httpd::BasicAccessControl::Wrk -superclass Httpd::AccessControl::Wrk - Httpd::BasicAccessControl::Wrk instproc unauthorizedAccess {realm} { - my set digestChallengeData(realm) $realm - my replyCode 401 www-authenticate "Basic realm=\"$realm\"" - my replyErrorMsg "Unauthorized request for realm '$realm'" - } - - - - ########################################################################### - ## Digest Access Control - ########################################################################### - Class Httpd::DigestAccessControl -superclass Httpd::BasicAccessControl - Httpd::DigestAccessControl instproc init args { - package require tcu - next - my lappend workerMixins [self class]::Wrk - } - Httpd::DigestAccessControl instproc credentialsNotOk {wrk credentials authMethod realm} { - # check whether $credentials are sufficient for $realm - my showMsg "Digest Authentication ..." - # HELP FD: hier muss ich noch überprüfen, ob die digest-header - # (credentials) ok sind. Hier habe ich probleme auf die sachen, - # die der worker gesendet (bspw. nonce) hat zu kommen. Ich - # weiß, man kann mit [my info children] daran kommen. Aber, - # was ist, wenn man mehrere Worker hat? - - ## Fredj, das sollte kein Problem sein: das credentialsNotOk wird - ## vom aktuellen worker (respond) aufgerufen. man kann dem *NotOk - ## den worker mitgeben, oder die beiden Methoden etwas umorganisieren. - return - } - Class Httpd::DigestAccessControl::Wrk -superclass Httpd::BasicAccessControl::Wrk - Httpd::DigestAccessControl::Wrk instproc unauthorizedAccess {realm} { - my set digestChallengeData(realm) $realm - my replyCode 401 www-authenticate "Digest [my digestChallenge]" - my replyErrorMsg "Unauthorized request for realm '$realm'" - } - Httpd::DigestAccessControl::Wrk instproc digestChallenge {} { - my showCall - my instvar digestChallengeData - my mkDigestChallengeData - set digestResponse {} - foreach {t v} [array get digestChallengeData] { - append digestResponse "$t = \"$v\", " - } - regsub {, $} $digestResponse {} digestResponse - return $digestResponse - } - Httpd::DigestAccessControl::Wrk instproc mkDigestChallengeData {} { - my showCall - my instvar digestChallengeData - - # RFC 2617 - # challenge = "Digest" digest-challenge - # digest-challenge = 1#( realm | [ domain ] | nonce | - # [ opaque ] |[ stale ] | [ algorithm ] | - # [ qop-options ] | [auth-param] ) - # domain = "domain" "=" <"> URI ( 1*SP URI ) <"> - # URI = absoluteURI | abs_path - # nonce = "nonce" "=" nonce-value - # nonce-value = quoted-string - # opaque = "opaque" "=" quoted-string - # stale = "stale" "=" ( "true" | "false" ) - # algorithm = "algorithm" "=" ( "MD5" | "MD5-sess" | token ) - # qop-options = "qop" "=" <"> 1#qop-value <"> - # qop-value = "auth" | "auth-int" | token - - # FD: hier würde man die nötigen parametern (nonce,domain,opaque, - # etc.) berechnen und in dem asso. Array speichern. - # FD: minimale Anforderung - set digestChallengeData(nonce) [my genNonce] - set digestChallengeData(opaque) [base64 encode [self]:my-self-spcified-string] - set digestChallengeData(algorithm) "MD5" ;#default - set digestChallengeData(qop) "auth" - set digestChallengeData(domain) [array names [my info parent]::protected] - } - - Httpd::DigestAccessControl::Wrk instproc genNonce {} { - my showCall - my instvar digestChallengeData - set timeStamp [clock seconds] - set nonce [base64 encode [md5 $timeStamp:[self]]] - return $nonce - } - - - # - # example usage: - - #Httpd h1 -port 8081 -root [glob ~/wafe] - #Httpd h2 -port 9086 -root $root \ - -mixin {Httpd::Responder Httdp::BasicAccessControl} \ - -addRealmEntry test {test test} -protectDir test "" {} \ - -redirect {^(mailman|pipermail|cgi-bin) http://alice.wu-wien.ac.at:80} - - - namespace export Httpd Httpsd - namespace eval Httpd { - namespace export Wrk \ - AccessControl BasicAccessControl DigestAccessControl \ - Responder - } - namespace eval Httpsd { - namespace export Wrk - } - #namespace eval Responder {namespace export Wrk} - #namespace eval AccessControl {namespace export Wrk} - #namespace eval BasicAccessControl {namespace export Wrk} - #namespace eval DigestAccessControl {namespace export Wrk} -} - -namespace import ::xotcl::comm::httpd::* -namespace eval Httpd {namespace import ::xotcl::comm::httpd::Httpd::*} -namespace eval Httpsd {namespace import ::xotcl::comm::httpd::Httpsd::*} -#namespace eval Responder {namespace import ::xotcl::comm::httpd::Responder::*} -#namespace eval AccessControl {namespace import ::xotcl::comm::httpd::AccessControl::*} -#namespace eval BasicAccessControl {namespace import ::xotcl::comm::httpd::BasicAccessControl::*} -#namespace eval DigestAccessControl {namespace import ::xotcl::comm::httpd::DigestAccessControl::*} Index: xotcl/library/comm/Imap.xotcl =================================================================== diff -u -N --- xotcl/library/comm/Imap.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/library/comm/Imap.xotcl (revision 0) @@ -1,175 +0,0 @@ -# $Id: Imap.xotcl,v 1.4 2006/02/18 22:17:33 neumann Exp $ - -package provide xotcl::comm::imap 0.9 - -package require XOTcl - -namespace eval ::xotcl::comm::imap { - package require xotcl::comm::httpAccess - namespace import ::xotcl::* - - Class Imap -superclass NetAccess -parameter {user} - Imap instproc initialize args { - my instvar port caching tokenCounter resp token - set port 143 - set caching 1 - set resp(connect) {"[*] OK" login} - set resp(login) {"A[0-9]+ OK" loginFinished "A[0-9]+ NO" login} - set resp(loginFinished) {"[*] [0-9]+" inboxSize "[*] OK" inboxSelected} - set resp(mailSelected) {"[*] [0-9]+ FETCH" fetchBody - "A[0-9]+ OK " ignoreLine - "[*] " ignoreLine} - set resp(heads) {"[*] [0-9]+ FETCH" fetchHeaders - "A[0-9]+ OK " ignoreLine - "[*] " ignoreLine} - set tokenCounter 0 - next - set token NONE - } - Imap instproc err {state reply} { - my abort "Error in $state: $reply" - } - Imap instproc token {} { - my instvar tokenCounter - return [format {A%.4d} [incr tokenCounter]] - } - Imap instproc imapString {input} { - regsub -all {(["\])} $input {\\\1} output ;#" - return \"$output\" - } - Imap instproc queryServer {query state} { - #my showCall - my instvar S token - set token [my token] - puts $S "$token $query" - #puts stderr "$token $query" - flush $S - fileevent $S readable [list [self] response $state] - } - Imap instproc response {state} { - my instvar S resp msg token - set msg [gets $S] - #my showVars msg token - foreach {c newState} $resp($state) { - if {![regexp {^[*]} $msg] && ![regexp ^$token $msg]} { - my showMsg "$state: token=$token IGNORING $msg" - return - } - if {[regexp ^$c $msg]} { - #my showMsg "$state NEWSTATE $newState" - return [my $newState] - } - } - my err $state "expected=$resp($state), got $msg" - } - Imap instproc GET {} { - my instvar state S path host port user inbox mailNr - # number at end of path is the message number in the mailbox - if {[regexp {^([^/]+)/([^/]+)/([0-9]+)$} $path _ user inbox mailNr]} { - } elseif {[regexp {^([^/]+)/([^/]+)/?$} $path _ user inbox]} { - } else { - my abort "invalid imap path $path" - } - regexp {^(.*):([0-9]+)$} $host _ host port - # proxy ? - if {[catch {set S [socket -async $host $port]} err]} { - my abort "Could not open connection to host '$host:$port'\n $err" - } else { - fconfigure $S -blocking false - fileevent $S readable [list [self] response connect] - } - } - Imap instproc login {} { - my instvar user host password - if {[pwdManager requirePasswd "Imap $user\@$host" $user password]} { - my queryServer "login $user [my imapString $password]" login - } else { - what now? - } - } - Imap instproc loginFinished {} { - my instvar user host password inbox - pwdManager storePasswd "Imap $user\@$host" $user $password - my queryServer "select $inbox" loginFinished - } - Imap instproc inboxSize {} { - my instvar msg nrMails - regexp {^[*] ([0-9]+) EXISTS} $msg _ nrMails - } - Imap instproc inboxSelected {} { - my instvar msg contentType nrMails mailNr - if {[info exists mailNr]} { - set contentType text/plain - my body-state - my queryServer "fetch $mailNr rfc822" mailSelected - } else { - my instvar header inbox block host user block - set contentType text/html - my body-state - set what "Mailbox $inbox of $user@$host" - set block "$what\n" - append block "

    $what

    \n" \ - "The following $nrMails messages are in this mailbox:" \ - "

    \n

    \n" - my pushBlock - my set state 4 - my finish - } - } - } - - namespace export Imap - } - - namespace import ::xotcl::comm::imap::* Index: xotcl/library/comm/Ldap.xotcl =================================================================== diff -u -N --- xotcl/library/comm/Ldap.xotcl (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) +++ xotcl/library/comm/Ldap.xotcl (revision 0) @@ -1,143 +0,0 @@ -package provide xotcl::comm::ldap 0.9 - -package require xotcl::wafecompat ; # Get 'requireModules'. - -package require XOTcl - -namespace eval ::xotcl::comm::ldap { - namespace import ::xotcl::* - - requireModules { ldapOpen ldaplibGen.so } - - Class Ldap -superclass NetAccess -parameter {host port dn attributes scope filter} - Ldap instproc initialize args { - my instvar port mapToC useCache - my set port 389 - my set useCache 0 - set mapToC(one) onelevel - set mapToC(sub) subtree - set mapToC(base) base - next - } - Ldap proc urlDecode string { - set toParse $string - set parsed "" - while {1} { - if {[regexp {^([^%]*)%(..)(.*)$} $toParse _ front hex toParse]} { - append parsed $front [binary format c 0x$hex] - } else { - append parsed $toParse - break - } - } - return $parsed - } - Ldap instproc getUrlcomponents {} { - showCall - my instvar path dn attributes scope filter url - set path [Ldap urlDecode $path] - puts stderr "___ path=<$path>" - if {[regexp -nocase {^/([^?]*)(\?([^?]*)(\?([^?]*)(\?([^?]*))?)?)?$} \ - $path _ dn a attributes s scope f filter]} { - if {$scope eq ""} { set scope "base" } - if {$filter eq ""} { set filter "(objectClass=*)" } - } else { - set errmsg "*** Ldap Url trail=<$path> does not match!\n" - append errmsg "___ RFC 1959 says:\n" - append errmsg " ldap://:/\[?\[??\]\]\n" - append errmsg "___ Cineast and Netscape uses:\n" - append errmsg " ldap://:/\[?\[?\[?\]\]\]" - my abort "Unsupported URL: '$url' \n $errmsg" - } - } - Ldap instproc GET {} { - my instvar contentType totalsize state currentsize informObjects block - showCall - set contentType text/html - my getUrlcomponents - if {"start" ne $state } { - puts stderr "... [self]:$proc ignoring request in state $state" - return - } - my open - my search - my body-state - set totalsize [string length $block] - set currentsize $totalsize - foreach obj $informObjects { - $obj incCb [self] $totalsize $currentsize - } - my eof - } - Ldap instproc open {} { - showCall - my instvar port host ldapHandle - set ldapHandle [ldapOpen $host $port] - } - Ldap instproc bind {} { - my instvar ldapHandle - showCall - } - Ldap instproc search {} { - showVars - my instvar url ldapHandle searchHandle dn attributes scope filter results mapToC path - set searchHandle [ldapSearch $ldapHandle $dn \ - $mapToC($scope) $filter [split $attributes ,] false results] - set nentries [ldapCountEntries $ldapHandle $searchHandle] - puts stderr "*** nentries = $nentries" - if {!$nentries} {set results ""} - my response - } - Ldap instproc getAttrs {dn} { - } - Ldap instproc makeUrl {dn} { - showCall - my instvar port host scope filter attributes - set tmpUrl ldap://$host:$port/$dn?$attributes?$scope?$filter - return "$dn" - } - Ldap instproc response {} { - showCall - my instvar block results attrsVals ldapHandle searchHandle - set block " - - LDAP searching result!! - -

    Result

    \n
      \n" - foreach {resDN} $results { - append block "
    • [my makeUrl $resDN]

      \n

        \n" - ldapAttributes $ldapHandle $searchHandle $resDN attrsVals - foreach {a v} [array get attrsVals] { - append block "
      • $a = $v

        \n" - } - append block "

      \n" - } - append block "
    \n \n" - } - - # destructor: Close Connection to LDAP-Server and unbind - Ldap instproc destroy {} { - showCall - my instvar ldapHandle - if {[catch {ldapUnbind $ldapHandle} error]} { - return $error - } - my freeSearchHandle - } - Ldap instproc close {} { - showCall - my destroy - next - } - Ldap instproc freeSearchHandle {} { - showCall - my instvar searchHandle - if {[info exists searchHandle]} { - ldapFreeSearch $searchHandle - } - } - - namespace export Ldap -} - -namespace import ::xotcl::comm::ldap::* Index: xotcl/library/comm/Mime.xotcl =================================================================== diff -u -N --- xotcl/library/comm/Mime.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/comm/Mime.xotcl (revision 0) @@ -1,274 +0,0 @@ -# $Id: Mime.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::comm::mime 0.9 - -package require XOTcl - -namespace eval ::xotcl::comm::mime { - namespace import ::xotcl::* - - ####################################################################### - Class MimeTypeLoader - MimeTypeLoader instproc loadMimeTypes {file} { - if {![file exists $file]} return - - puts stderr "Loading Mime types from $file" - set f [open $file r] - set content [read $f] - close $f - regsub -all "\\\\ *\n" $content " " content - foreach line [split $content \n] { - set line [string trim $line] - if {[regexp ^\# $line]} continue - if {$line eq ""} continue - regsub -all " +" $line " " line - #puts stderr <$line> - while {$line ne ""} { - if {[regexp {^ *([^ ]+)=\"([^\"]+)\" *(.*)$} $line _ key value line]} { - set v([string tolower $key]) $value - } elseif {[regexp {^ *([^ ]+)=([^ ]+) *(.*)$} $line _ key value line]} { - set v([string tolower $key]) $value - } else { - set tokens [split $line] - if {![regexp / [lindex $line 0]]} { - puts stderr "Mime: cannot parse line '$line' in $file" - } else { - set v(exts) [join [lrange $tokens 1 end] ,] - set v(type) [lindex $tokens 0] - } - break - } - } - if {[info exists v(exts)] && [info exists v(type)]} { - set v(exts) [string tolower $v(exts)] - set v(type) [string tolower $v(type)] - foreach ext [split $v(exts) ,] { - set ext [string trimleft $ext .] - #puts stderr "ext '$ext', contentType = '$v(type)'" - my set extTable($ext) $v(type) - } - unset v(exts) v(type) - } else { - puts stderr "invalid mime entry in $file" - } - } - } - MimeTypeLoader instproc guessContentType {name} { - my loadMimeTypes ~/.mime.types - my mixin {} - return [next] - } - - Class MIME - MIME instproc guessContentType {name} { - my instvar extTable nameTable - if {[regexp {\.([a-zA-Z0-9]+)$} $name _ ext]} { - catch {set contentType $extTable([string tolower $ext])} - } - if {![info exists contentType]} { - foreach namePattern [array names nameTable] { - if {[regexp $namePattern $name]} { - set contentType text/plain - break - } - } - } - if {![info exists contentType]} { - set contentType unknown/unknown - } - return $contentType - } - MIME instproc multipart-decode-header {header obj} { - $obj instvar name filename contentType - foreach line [split $header \r] { - set line [string trim $line \n] - #puts stderr line=$line - if {[regexp -nocase {^Content-Disposition: *([^;]+);(.*)$} $line _ \ - dispo detail]} { - if {$dispo ne "form-data"} { - error "Unknown Content Disposition '$line'" - } - if {![regexp -nocase { name *= *"([^\"]+)"} $line _ name]} { - error "can't parse form-data name '$line'" - } - regexp -nocase {filename *= *"([^\"]+)"} $line _ filename - } elseif {[regexp -nocase {^Content-Type: *([^; ]+)} $line _ contentType]} { - } else { - my showMsg "ignoring '$line'" - } - } - } - - MIME create Mime -mixin MimeTypeLoader - Mime array set nameTable { - README text/plain - } - Mime array set extTable { - gif image/gif - xpm image/x-xpixmap - xbm image/x-xbitmap - jpg image/jpeg - png image/x-png - html text/html - htm text/html - xml text/xml - css text/css - ps application/postscript - pdf application/pdf - doc application/msword - xls application/msexel - } - - - ################################################################## - Class FormData - FormData instproc encode list {;#RFC 1867 - my showCall - } - FormData formData - ################################################################## - Class Base64 - Base64 instproc init args { - my instvar base64 base64_en - # Emit base64 encoding for a string - set i 0 - foreach char {A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \ - a b c d e f g h i j k l m n o p q r s t u v w x y z \ - 0 1 2 3 4 5 6 7 8 9 + /} { - set base64($char) $i - set base64_en($i) $char - incr i - } - next - } - Base64 instproc encode string { - my instvar base64_en - set result {} - set length 0 - foreach {a b c} [split $string {}] { - scan $a %c x - if {$c ne ""} { - scan $b %c y - scan $c %c z - append result \ - $base64_en([expr {($x>>2) & 0x3F}]) \ - $base64_en([expr {(($x<<4) & 0x30) | (($y>>4) & 0xF)}]) \ - $base64_en([expr {(($y<<2) & 0x3C) | (($z>>6) & 0x3)}]) \ - $base64_en([expr {$z & 0x3F}]) - } elseif {$b ne ""} { - scan $b %c y - append result \ - $base64_en([expr {($x>>2) & 0x3F}]) \ - $base64_en([expr {(($x<<4) & 0x30) | (($y>>4) & 0xF)}]) \ - $base64_en([expr {($y<<2) & 0x3C}]) \ - = - } else { - append result \ - $base64_en([expr {($x>>2) & 0x3F}]) \ - $base64_en([expr {($x<<4) & 0x30}]) \ - == - } - if {[incr length 4] >= 72} { - append result \n - set length 0 - } - } - return $result - } - Base64 instproc decode string { - my instvar base64 - set output {} - set group 0 - set j 18 - foreach char [split $string {}] { - if {$char != "="} { - set group [expr {$group | ($base64($char) << $j)}] - if {[incr j -6] < 0} { - scan [format %06x $group] %2x%2x%2x a b c - append output [format %c%c%c $a $b $c] - set group 0 - set j 18 - } - } else { - scan [format %04x $group] %2x%2x a b - if {$j==6} { - append output [format %c $a] - } else { - append output [format %c%c $a $b] - } - break - } - } - return $output - } - Base64 base64 - ################################################################## - Class Url - Url instproc encode list { - set result "" - set sep "" - foreach i $list { - append result $sep [my encodeItem $i] - if {$sep != "="} { - set sep = - } else { - set sep & - } - } - return $result - } - Url instproc encodeItem string { - my instvar httpFormMap - set alphanumeric a-zA-Z0-9. - if {![info exists httpFormMap]} { - for {set i 1} {$i <= 256} {incr i} { - set c [format %c $i] - if {![string match \[$alphanumeric\] $c]} { - set httpFormMap($c) %[format %.2x $i] - } - } - # these are handled specially - array set httpFormMap { " " + \n %0d%0a } - } - regsub -all \[^$alphanumeric\] $string {$httpFormMap(&)} string - regsub -all \n $string {\\n} string - regsub -all \t $string {\\t} string - regsub -all {[][{})\\]\)} $string {\\&} string - return [subst $string] -} -Url instproc hexToChar hex { - ::scan $hex %x h - #my showMsg "::scan $hex %x h -> $h" - format %c $h -} -Url instproc decodeItem string { - #my showCall - set result "" - regsub -all {\+} $string " " string - regsub -all {%0d%0a} $string "\n" string - regsub -all {%([a-fA-F0-9][a-fA-F0-9])} $string {[my hexToChar \1]} string - return [subst -novariables -nobackslashes $string] -} -Url instproc decodeName string { - #my showCall - set result "" - regsub -all {%0d%0a} $string "\n" string - regsub -all {%([a-fA-F0-9][a-fA-F0-9])} $string {[my hexToChar \1]} string - return [subst -novariables -nobackslashes $string] -} -Url instproc decode string { - #my showCall - set result "" - foreach i [split $string &=] { - lappend result [decodeItem $i] - } - #my showVars result - return $result -} -Url url - -namespace export Mime url base64 -} - -namespace import ::xotcl::comm::mime::* -#puts stderr "importing ::xotcl::comm::mime::* to [namespace current]" Index: xotcl/library/comm/PCache.xotcl =================================================================== diff -u -N --- xotcl/library/comm/PCache.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/library/comm/PCache.xotcl (revision 0) @@ -1,259 +0,0 @@ -# -*- Tcl -*- $Id: PCache.xotcl,v 1.9 2007/08/14 16:38:26 neumann Exp $ -# Persistent Cache object, using gdbm - -# Configuration: -# The persistent cache is kept in a directory which is determined by -# the following three rules. -# -# 1) the global variable "CACHE_DIR", which has to be set, -# before this file is loaded -# 2) If "CACHE_DIR" is not set, the global variable "homedir" -# is checked, which is assumed to be the home directory -# of the Cineast browser -# 3) As a last resource the tmp directory is used as the cache directory -# -# Additionally, the cache directory can be specified after loading of this -# file (before the first open) through the instance variable "dir" -# in the object persistentCache. - -package provide xotcl::comm::pcache 0.9 -#package require xotcl::package - -package require XOTcl - -namespace eval ::xotcl::comm::pcache { - namespace import ::xotcl::* - - variable CACHE_DIR - variable homeDir - - if {![info exists CACHE_DIR]} { - if {![info exists homeDir]} { - set homeDir [::xotcl::tmpdir] - } - set CACHE_DIR $homeDir/cache2 - } - - Object persistentCache - persistentCache set dir $CACHE_DIR - persistentCache proc flush { {cmd {}} } { - my instvar DBID - if {[info exists DBID]} { $DBID close } - if {{} ne $cmd } { - if {[catch {eval $cmd} err]} {puts stderr err=$err} - } - my open ;# UZ: wenn hier das self weggenommen wird, crashed das lintFilter - #open ;# UZ: wenn hier das self weggenommen wird, crashed das lintFilter - - } - # the open method for the first invocation - persistentCache proc open {} { - my instvar dir DBID - package require xotcl::store - set DBID [Storage someNewChildStore] - if {![file isdirectory $dir]} { - # if the cache directory does not exist, create it.. - file mkdir $dir - } - # the open method for later invocations, doing the real work - my proc open {} { - my instvar dir DBID - $DBID open $dir/index - } - # invoke the method - open - } - persistentCache proc clear {} { - my instvar cacheFileName contentType meta entry validated dir - my flush [list eval file delete -force $dir/index \ - [glob -nocomplain $dir/\[0-9\]*::*]] - foreach var {cacheFileName contentType meta entry validated} { - catch {unset $var} - } - } - persistentCache proc clearEntry {url} { - my instvar DBID cacheFileName contentType meta entry validated - my inCache $url - if {[info exists cacheFileName($url)]} { - my flush [list eval file delete -force $cacheFileName($url)] - foreach var {cacheFileName contentType meta entry validated} { - my showMsg "unset ${var}($url)" - catch {unset ${var}($url)} - } - catch {$DBID unset $url} - } - } - persistentCache proc lazyFlush {} { - my instvar flushPending - if {[info exists flushPending]} { after cancel $flushPending } - set flushPending [after 100 [self] flush] - } - persistentCache proc newEntry {url access doCache name} { - my instvar cacheFileName contentType meta dir - if {$name ne ""} { - #$access set caching 0 - return $name - } elseif {$doCache} { - set cacheFileName($url) $dir/[pid]-$access - set contentType($url) [$access set contentType] - set meta($url) [$access set meta] - return $cacheFileName($url) - } else { - # we use the Memory cache only for non-persistent cache entries - # which are deleted when the program terminates - set fileName $dir/v[pid]-$access - MemoryCache + $url $fileName - return $fileName - } - } - persistentCache proc entryDone {url} { - my instvar entry cacheFileName contentType DBID meta - if {![info exists DBID]} { open } - $DBID set $url [list \ - cacheFileName $cacheFileName($url) \ - contentType $contentType($url) \ - meta $meta($url) ] - my lazyFlush - #my showMsg "size=[file size $cacheFileName($url)]" - set entry($url) 1 - my set validated($url) 1 - } - persistentCache proc inCache {url} { - my instvar entry - if {[info exists entry($url)]} { - set result 1 - } else { - my instvar cacheFileName contentType meta DBID - if {![info exists DBID]} { open } - set result [$DBID set $url] - my lazyFlush - if {$result ne ""} { - set entry($url) 1 - array set r $result - set cacheFileName($url) $r(cacheFileName) - set contentType($url) $r(contentType) - set meta($url) $r(meta) - set result 1 - } else { - set result 0 - } - } - return $result - } - persistentCache proc validated {url} { - my set validated($url) 1 - } - persistentCache proc invalidate {url} { - if {[my exists validated($url)]} { - my unset validated($url) - } - } - persistentCache proc isValidated {url} { - if {[my exists validated($url)]} { - return 1 - } - return 0 - } - persistentCache proc ifModifiedHeader {url ifModVar} { - set result 0 - if {[my inCache $url]} { - #puts stderr inCache:$url - upvar [self callinglevel] $ifModVar ifModifiedHeader - my instvar meta - array set m $meta($url) - if {[info exists m(last-modified)]} { - set ifModifiedHeader [list If-Modified-Since $m(last-modified)] - set result 1 - } - } else { - #puts stderr "url=$url is not in cache" - } - return $result - } - persistentCache proc dump {} { - my instvar DBID - puts stderr DUMP: - foreach k [$DBID names] { - puts stderr $k - puts stderr " [$DBID set $k]" - } - } - persistentCache proc cacheFileName {url} { - my instvar cacheFileName - return $cacheFileName($url) - } - persistentCache proc contentType {url} { - my instvar contentType - return $contentType($url) - } - persistentCache proc meta {url} { - my instvar meta - return $meta($url) - } - persistentCache proc destroy {} { - #my showCall - next - } - #persistentCache flush - - - - ########################################################### Cache - Object MemoryCache - MemoryCache proc query {url entry} { - my instvar cache - if {[info exists cache($url)]} { - upvar [self callinglevel] $entry e - #puts stderr "-->[self] [self proc] finds: $url" - set e $cache($url) - return 1 - } - return 0 - } - MemoryCache proc + {url entry} { - #puts stderr "-->[self class]:[self] [self proc] $url" - my set cache($url) $entry - } - MemoryCache proc - {url} { - #puts stderr "-->[self class]:[self] [self proc] $url" - catch {my unset cache($url)} - } - MemoryCache proc destroy {} { - my instvar cache - foreach url [array names cache] { - set f $cache($url) - if {[regexp ^/ $f]} { - #my showMsg "trying to remove $f [file exists $f]" - file delete -force $f - } - } - next - } - - - Object instproc allInstances {} { - # Diese Methode ermittelt rekursiv alle direkten und indirekten - # Instanzen einer Klasse - ::set inst [my info instances] - foreach s [my info subclass] { - foreach i [$s allInstances] { ::lappend inst $i } - } - return $inst - } - - # onExit is automatically called when wafe terminates - proc onExit {} { - #puts stderr "allinstances of Access: [Access allInstances]" - #foreach i [Access allInstances] { - # if {[info command $i] eq ""} continue - # $i destroy - #} - #MemoryCache clear - persistentCache flush - #Trace statReport - } - - namespace export persistentCache MemoryCache -} - -namespace import ::xotcl::comm::pcache::* Index: xotcl/library/comm/pkgIndex.tcl =================================================================== diff -u -N --- xotcl/library/comm/pkgIndex.tcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/comm/pkgIndex.tcl (revision 0) @@ -1,19 +0,0 @@ -# Tcl package index file, version 1.1 -# This file is generated by the "pkg_mkIndex -direct" command -# and sourced either when an application starts up or -# by a "package unknown" script. It invokes the -# "package ifneeded" command to set up package-related -# information so that packages will be loaded automatically -# in response to "package require" commands. When this -# script is sourced, the variable $dir must contain the -# full path name of this file's directory. - -package ifneeded xotcl::comm::connection 1.0 [list source [file join $dir Connection.xotcl]] -package ifneeded xotcl::comm::dav 0.9 [list source [file join $dir Dav.xotcl]] -package ifneeded xotcl::comm::ftp 0.9 [list source [file join $dir Ftp.xotcl]] -package ifneeded xotcl::comm::httpAccess 0.91 [list source [file join $dir Access.xotcl]] -package ifneeded xotcl::comm::httpd 1.1 [list source [file join $dir Httpd.xotcl]] -package ifneeded xotcl::comm::imap 0.9 [list source [file join $dir Imap.xotcl]] -package ifneeded xotcl::comm::ldap 0.9 [list source [file join $dir Ldap.xotcl]] -package ifneeded xotcl::comm::mime 0.9 [list source [file join $dir Mime.xotcl]] -package ifneeded xotcl::comm::pcache 0.9 [list source [file join $dir PCache.xotcl]] Index: xotcl/library/lib/COPYRIGHT =================================================================== diff -u -N --- xotcl/library/lib/COPYRIGHT (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/lib/COPYRIGHT (revision 0) @@ -1,41 +0,0 @@ - * XOTcl - Extended OTcl - * - * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) - * - * (a) Vienna University of Economics and Business Administration - * Dept. of Information Systems / New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - Index: xotcl/library/lib/Script.xotcl =================================================================== diff -u -N --- xotcl/library/lib/Script.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/lib/Script.xotcl (revision 0) @@ -1,40 +0,0 @@ -#$Id: Script.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::script 0.9 -package require XOTcl - -namespace eval ::xotcl::script { - namespace import ::xotcl::* - - @ @File {description { - A small package to instantiate an object, that - represents a script. - } - } - @ Class Script { - description { - An object of type Script becomes automatically the command - line arguments evaluated as "-" method calls during creation, e.g. - <@pre> - Script s -set r 5 - - and a call with cmd-line "-set v 6" of the script, results in an - object s with two vars set: r to 5, and v to 6. - } - } - - - - Class Script - Script proc create args { - eval lappend args $::argv - eval next $args - } - Script instproc unknown args { - puts stderr "$::argv0: Unknown option �-$args� provided" - } - - namespace export Script -} - -namespace import ::xotcl::script::* Index: xotcl/library/lib/changeXOTclVersion.xotcl =================================================================== diff -u -N --- xotcl/library/lib/changeXOTclVersion.xotcl (revision caee4f272cfc744a06a7df61e2f3c73da1b6be64) +++ xotcl/library/lib/changeXOTclVersion.xotcl (revision 0) @@ -1,95 +0,0 @@ -# -# this is a maintenance program for XOTcl that allows us to change the -# version information across the whole distribution automatically. -# -# this program assumes that pwd is in xotcl-full-X.X* directory or subdir -# -set XOTCL_MAJOR_VERSION 1 -set XOTCL_MINOR_VERSION 5 -set XOTCL_RELEASE_LEVEL .6 - -# example settings: -# 1.0 -#set XOTCL_MAJOR_VERSION 1 -#set XOTCL_MINOR_VERSION 0 -#set XOTCL_RELEASE_LEVEL .3 -# -# 0.9.3 -#set XOTCL_MAJOR_VERSION 0 -#set XOTCL_MINOR_VERSION 9 -#set XOTCL_RELEASE_LEVEL .3 - -#set XOTCL_MAJOR_VERSION 0 -#set XOTCL_MINOR_VERSION 9 -#set XOTCL_RELEASE_LEVEL .3 -#set XOTCL_RELEASE_LEVEL .4 -#set XOTCL_RELEASE_LEVEL .5 - - -set XOTCL_VERSION $XOTCL_MAJOR_VERSION.$XOTCL_MINOR_VERSION -set FULL_VERSION $XOTCL_VERSION$XOTCL_RELEASE_LEVEL - -if {![regexp {((^.*/xotcl-)([0-9.]*))/?} [pwd] _ topdirname topdirprefix oldversion]} { - error "this program assumes that pwd is in xotcl-X.X* directory" -} - -puts "Prior version is: $oldversion" -puts "New version is: $FULL_VERSION" -puts "Working in: $topdirname" - -cd $topdirname - -puts "... make clean first" -if {[file exists Makefile]} { - exec make clean -} - -foreach file [exec find . -name configure.in] { - puts "... updating $file" - set F [open $file]; set c [read $F]; close $F - set newFile "" - foreach line [split $c \n] { - set newLine $line - if {[regexp {^XOTCL_MAJOR_VERSION=[0-9]} $line]} { - set line "XOTCL_MAJOR_VERSION=$XOTCL_MAJOR_VERSION" - } elseif {[regexp {^XOTCL_MINOR_VERSION=[0-9]} $line]} { - set line "XOTCL_MINOR_VERSION=$XOTCL_MINOR_VERSION" - } elseif {[regexp {^XOTCL_RELEASE_LEVEL=} $line]} { - set line "XOTCL_RELEASE_LEVEL=$XOTCL_RELEASE_LEVEL" - } elseif {[regexp {^define\(XOTclVersion, .*$} $line]} { - set line "define(XOTclVersion, $XOTCL_MAJOR_VERSION.$XOTCL_MINOR_VERSION$XOTCL_RELEASE_LEVEL)" - } - append newFile $line\n - } - set F [open $file w]; puts $F $newFile; close $F -} - -set newtopdirname $topdirprefix$FULL_VERSION -if {$oldversion != $FULL_VERSION} { - puts "topdir: $topdirname->$newtopdirname" - file rename -force $topdirname $newtopdirname -} -cd $newtopdirname - -foreach file [exec find . -name configure.in] { - set dir [file dirname $file] - set oldpwd [pwd] - cd $dir - exec autoconf - cd $oldpwd -} - -# determine last configure command -cd $newtopdirname -if {[catch {set configurecmd [exec fgrep {$ ./configure} config.log]}]} { - set configurecmd "./configure" -} else { - regsub {^ +\$ } $configurecmd "" configurecmd -} -#puts $configurecmd - -cd $newtopdirname/ -puts "Configuring in [pwd]" -eval exec $configurecmd - -puts "ok ... version is now $FULL_VERSION" Index: xotcl/library/lib/htmllib.xotcl =================================================================== diff -u -N --- xotcl/library/lib/htmllib.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/lib/htmllib.xotcl (revision 0) @@ -1,677 +0,0 @@ -## $Header: /home/neumann/cvs/xotcl/xotcl/library/lib/htmllib.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -# -# htmllib.xotcl -# -# Author: Antti Salonen, as@fishpool.fi -# -# Copyright: -# -# This software is copyrighted by Fishpool Creations Oy Ltd. The following -# terms apply to all files associated with the software unless explicitly -# disclaimed in individual files. -# -# The authors hereby grant permission to use, copy, modify, distribute, -# and license this software and its documentation for any purpose, provided -# that existing copyright notices are retained in all copies and that this -# notice is included verbatim in any distributions. No written agreement, -# license, or royalty fee is required for any of the authorized uses. -# Modifications to this software may be copyrighted by their authors -# and need not follow the licensing terms described here, provided that -# the new terms are clearly indicated on the first page of each file where -# they apply. -# -# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -# MODIFICATIONS. -# - -package provide xotcl::htmllib 0.1 -package require XOTcl - -namespace eval ::xotcl::htmllib { - namespace import ::xotcl::* - - @ @File { - description { - This package provides the class HtmlBuilder, which can be used to - generate HTML documents, or a part of a document. - } - authors { - Antti Salonen, as@fishpool.fi - } - date { - $Date: 2006/09/27 08:12:40 $ - } - } - - # - # the compressed parameter means that minimal HTML page are created - # i.e. that space indentation is turned off - # - Class HtmlBuilder -parameter { - {compressed 0} - } - - ## The constructor. - ## - ## The HtmlBuilder object has two instance variables. The document Tcl list - ## contains the document as a list of strings. The document is stored as a list - ## rather than a single string to allow further indentation of the whole - ## document when necessary. - ## The indentLevel variable is the level of indentation, which is generally - ## increased for the contents of any HTML element that may contain block-level - ## elements. Typical examples would be
      ,
    • , and so forth. - - HtmlBuilder instproc init {} { - my instvar document indentLevel - set document [list] - set indentLevel 0 - return - } - - - HtmlBuilder instproc clear {} { - my instvar document indentLevel - - set document [list] - set indentLevel 0 - return - } - - - HtmlBuilder instproc getDocument {} { - my instvar document - return $document - } - - - HtmlBuilder instproc toString {} { - my instvar document compressed - set rvalue "" - foreach line $document { - if {$compressed == "0"} { - append rvalue "$line\n" - } else { - ## only new line for closing tags at the beginnig - ## of a document element - if {[string equal -length 2 ", for - ## example, is not required by the HTML specification, using the closing method - ## is necessary to have the document properly indented. - - - # Add a string to the document within ... - - HtmlBuilder instproc addStringStrong {str} { - my addString "$str" - return - } - - # Add a string to the document within ... - - HtmlBuilder instproc addStringEmphasized {str} { - my addString "$str" - return - } - - # Add a comment to the document - - HtmlBuilder instproc addComment {str} { - my addString "" - return - } - - HtmlBuilder instproc addLineBreak {} { - my addString "
      " - return - } - - ## startDocument - Start an HTML document. Currently all documents are HTML 4.0 - ## Transitional. HTML, BODY, HEAD and TITLE elements are added/started here. - ## Optional arguments: - ## -title documentTitle (empty if not given) - ## -stylesheet externalStyleSheet - ## -bgcolor backgroundColour (deprecated in HTML 4.0) - - HtmlBuilder instproc startDocument {args} { - set title "" - foreach {name value} $args { - switch -- $name { - -title { - set title $value - } - -stylesheet { - set stylesheet $value - } - -bgcolor { - set bgcolor $value - } - } - } - my addString {} - my addWhiteSpace - my addString {} - my addStringIncr {} - my addString "$title" - if {[info exists stylesheet]} { - my addString "" - } - my addStringDecr {} - my addWhiteSpace - if {[info exists bgcolor]} { - my addStringIncr "" - } else { - my addStringIncr {} - } - return - } - - ## endDocument - end an HTML document - - HtmlBuilder instproc endDocument {} { - my addStringDecr {} - my addString {} - return - } - - ## startParagraph - start a P element - ## Optional arguments: - ## Common HTML arguments - - HtmlBuilder instproc startParagraph {args} { - set attributes [HtmlBuilder parseArguments $args [list] [list]] - my addStringIncr "" - return - } - - ## endParagraph - end a P element - - HtmlBuilder instproc endParagraph {} { - my addStringDecr {

      } - return - } - - ## startAnchor - start an A element - ## Optional arguments: - ## -href URI - ## -name cdata - ## -target frameTarget - ## Common HTML arguments - - HtmlBuilder instproc startAnchor {args} { - set attributes [HtmlBuilder parseArguments $args \ - [list "HREF" "NAME" "TARGET"] [list]] - my addStringIncr "" - return - } - - ## endAnchor - end an A element - - HtmlBuilder instproc endAnchor {args} { - my addStringDecr {} - return - } - - ## addAnchor - add an A element, using content as the visible link. - ## Optional arguments: - ## -href URI - ## -name cdata - ## -target frameTarget - ## Common HTML arguments - - HtmlBuilder instproc addAnchor {content args} { - eval my startAnchor $args - my addString $content - my endAnchor - return - } - - ## startUnorderedList - start a UL element - ## Optional arguments: - ## Commmon HTML arguments - - HtmlBuilder instproc startUnorderedList {args} { - set attributes [HtmlBuilder parseArguments $args [list] [list]] - my addStringIncr "" - return - } - - ## endUnorderedList - end a UL element - - HtmlBuilder instproc endUnorderedList {} { - my addStringDecr {
    } - return - } - - ## startListItem - start an LI element - ## Optional arguments: - ## Common HTML arguments - - HtmlBuilder instproc startListItem {args} { - set attributes [HtmlBuilder parseArguments $args [list] [list]] - my addStringIncr "" - return - } - - ## endListItem - end an LI element - - HtmlBuilder instproc endListItem {} { - my addStringDecr {} - return - } - - ## add a simple list item - HtmlBuilder instproc addListItem {content} { - my startListItem - my addString $content - my endListItem - } - - ## startTable - start a TABLE element. Note that if the -border argument isn't - ## used, by default the table are created with borders (). - - ## Optional arguments: - ## -border pixels - ## -cellpadding length - ## -cellspacing length - ## -summary text - ## -width length - ## -bgcolor color spec - ## Common HTML arguments - - HtmlBuilder instproc startTable {args} { - set attributes [HtmlBuilder parseArguments $args \ - [list "BORDER" "CELLPADDING" "CELLSPACING" "SUMMARY" \ - "WIDTH" "BGCOLOR"] [list]] - if {[lsearch $args "-border"] == -1} { - append attributes " BORDER" - } - my addStringIncr "" - return - } - - ## endTable - end a TABLE element - - HtmlBuilder instproc endTable {} { - my addStringDecr {
    } - return - } - - ## startTableRow - start a TR element - ## Optional arguments: - ## Common HTML arguments - HtmlBuilder instproc startTableRow {args} { - set attributes [HtmlBuilder parseArguments $args [list "VALIGN"] [list]] - my addStringIncr "" - return - } - - ## endTableRow - end a TR element - - HtmlBuilder instproc endTableRow {} { - my addStringDecr {} - return - } - - ## startTableCell - start a TD element - ## Optional arguments: - ## -colspan number - ## -rowspan number - ## -align left|center|right|justify|char - ## -valign top|middle|bottom|baseline - ## -bgcolor - ## -width - ## Common HTML arguments - - HtmlBuilder instproc startTableCell {args} { - set attributes [HtmlBuilder parseArguments $args \ - [list "COLSPAN" "ROWSPAN" "ALIGN" "VALIGN" \ - "BGCOLOR" "WIDTH"] [list]] - my addStringIncr "" - return - } - - ## endTableCell - end a TD element - - HtmlBuilder instproc endTableCell {} { - my addStringDecr {} - return - } - - # - # add a simple table cell which just contains a string - # - HtmlBuilder instproc addTableCell {{string ""} args} { - eval my startTableCell $args - my addString $string - my endTableCell - } - - ## startTableHeaderCell - start a TH element - ## Optional arguments: - ## -colspan number - ## -rowspan number - ## -align left|center|right|justify|char - ## -valign top|middle|bottom|baseline - ## Common HTML arguments - - HtmlBuilder instproc startTableHeaderCell {args} { - set attributes [HtmlBuilder parseArguments $args \ - [list "COLSPAN" "ROWSPAN" "ALIGN" "VALIGN"] [list]] - my addStringIncr "" - return - } - - ## endTableHeaderCell - end a TH element - - HtmlBuilder instproc endTableHeaderCell {} { - my addStringDecr {} - return - } - - ## startForm - start a FORM element - ## Required arguments: - ## -action URI - ## Optional arguments: - ## -method get|post - ## Common HTML arguments - - HtmlBuilder instproc startForm {args} { - set attributes [HtmlBuilder parseArguments $args \ - [list "ACTION" "METHOD" "ENCTYPE"] [list]] - my addStringIncr "" - return - } - - ## endForm - end a FORM element - - HtmlBuilder instproc endForm {} { - my addStringDecr {} - return - } - - ## addInput - add in INPUT element - ## Required arguments: - ## -type - ## -name - ## Optional arguments: - ## -value - ## -size - ## -maxlength - ## -checked - ## Common HTML arguments - - HtmlBuilder instproc addInput {args} { - set attributes [HtmlBuilder parseArguments $args \ - [list "TYPE" "NAME" "VALUE" "SIZE" "MAXLENGTH"] \ - [list "CHECKED"]] - my addString "" - return - } - - ## addTextArea - start a TEXTAREA element - ## First parameter: value - Default value of the text area - ## Required arguments: - ## -rows - ## -cols - ## Optional arguments: - ## -name - ## Common HTML Arguments - - HtmlBuilder instproc addTextArea {value args} { - set attributes [HtmlBuilder parseArguments $args \ - [list "ROWS" "COLS" "NAME"] [list]] - my addString "$value" - return - } - - ## startOptionSelector - start a SELECT element - ## Optional arguments: - ## -name - ## -size - ## -multiple - ## Common HTML arguments - - HtmlBuilder instproc startOptionSelector {args} { - set attributes [HtmlBuilder parseArguments $args \ - [list "NAME" "SIZE"] [list "MULTIPLE"]] - my addStringIncr "" - return - } - - ## endOptionSelector - end a SELECT element - - HtmlBuilder instproc endOptionSelector {} { - my addStringDecr "" - return - } - - ## startOption - start an OPTION element - ## Optional arguments: - ## -value - ## -selected - ## Common HTML arguments - - HtmlBuilder instproc startOption {args} { - set attributes [HtmlBuilder parseArguments $args \ - [list "VALUE"] [list "SELECTED"]] - my addStringIncr "" - return - } - - ## endOption - end an OPTION element - - HtmlBuilder instproc endOption {} { - my addStringDecr "" - return - } - - ## addImage - add an IMG element - ## Required arguments: - ## -src - ## -alt - ## -align (deprecated in HTML 4.0) - ## Optional arguments: - ## Common HTML arguments - - HtmlBuilder instproc addImage {args} { - set attributes [HtmlBuilder parseArguments $args \ - [list "SRC" "ALT" "ALIGN"] [list]] - my addString "" - return - } - - ## startBlock - start a DIV element (a generic block-level container) - ## Optional arguments: - ## Common HTML attributes - - HtmlBuilder instproc startBlock {args} { - set attributes [HtmlBuilder parseArguments $args [list] [list]] - my addStringIncr "" - return - } - - ## endBlock - end a DIV element - - HtmlBuilder instproc endBlock {} { - my addStringDecr "" - return - } - - ## addHorizontalRule - add an HR element - ## Optional arguments: - ## Common HTML arguments - - HtmlBuilder instproc addHorizontalRule {args} { - set attributes [HtmlBuilder parseArguments $args [list] [list]] - my addString "" - return - } - - namespace export HtmlBuilder -} - -namespace import ::xotcl::htmllib::* Index: xotcl/library/lib/make.xotcl =================================================================== diff -u -N --- xotcl/library/lib/make.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/lib/make.xotcl (revision 0) @@ -1,156 +0,0 @@ -# $Id: make.xotcl,v 1.4 2006/09/27 08:12:40 neumann Exp $ -### inEachDir changes now to each directory -### install clears tgarget directory before installing -### Object file added (for better -n processing) -lappend auto_path .. - -package require XOTcl -namespace import -force ::xotcl::* - -### -Object make -# -# shared lib add files for pkgIndex.tcl -# -make proc mkIndex {name} { - #puts stderr "+++ mkIndex in [pwd]" - set fls {} - foreach f [glob -nocomplain *tcl] { - if {![file isdirectory $f]} { - set F [open $f]; set c [read $F]; close $F - if {[string match "*package provide*" $c]} { lappend fls $f } - } - } - - set so [glob -nocomplain *[info sharedlibextension]] - # loading libxotcl into xotclsh crashes on some systems - foreach lib [list libxotcl$::xotcl::version[info sharedlibextension] \ - xotcl$::xotcl::version.dll] { - set p [lsearch -exact $so $lib] - if {$p != -1} { - set so [lreplace $so $p $p] - #puts stderr "new so=<$so>" - } - } - #puts stderr "[pwd]: call so=<$so>" - set fls [concat $fls $so] - - if {$fls ne ""} { - if {[file exists pkgIndex.tcl]} { - file delete -force pkgIndex.tcl - } - #puts stderr "callinglevel <[self callinglevel]> $fls" - #puts stderr "[pwd]:\n\tcall eval pkg_mkIndex -direct . $fls" - if {[catch {eval pkg_mkIndex -direct . $fls} errs]} { - puts stderr "!!! $errs" - } - #puts stderr "[pwd] done" - } - - foreach addFile [glob -nocomplain *.add] { - if {[file exists $addFile]} { - puts stderr "Appending $addFile to pkgIndex.tcl in [pwd]" - set OUT [file open pkgIndex.tcl a] - set IN [file open $addFile] - puts -nonewline $OUT [read $IN] - close $IN; close $OUT - } - } - #puts stderr "+++ mkIndex name=$name, pwd=[pwd] DONE" -} -make proc inEachDir {path cmd} { - #puts stderr "[pwd] inEachDir $path [file isdirectory $path]" - if { [file isdirectory $path] - && ![string match *CVS $path] - && ![string match *SCCS $path] - && ![string match *Attic $path] - && ![string match *dbm* $path] - } { - set olddir [pwd] - cd $path - eval make $cmd $path - set files [glob -nocomplain *] - cd $olddir - foreach p $files { my inEachDir $path/$p $cmd } - #puts stderr "+++ change back to $olddir" - } -} -make proc in {path cmd} { - if {[file isdirectory $path] && ![string match *CVS $path]} { - set olddir [pwd] - cd $path - eval make $cmd $path - cd $olddir - } -} -### tcl file-command -rename file tcl_file -Object file -requireNamespace - -rename open file::open -proc open {f {mode r}} { file open $f $mode } -#file proc open {f {mode r}} { ::open $f $mode } - - -file array set destructive { - atime 0 attributes 0 copy 1 delete 1 dirname 0 - executable 0 exists 0 extension 0 isdirectory 0 isfile 0 - join 0 lstat 0 mkdir 1 mtime 0 nativename 0 - owned 0 pathtype 0 readable 0 readlink 0 rename 1 - rootname 0 size 0 split 0 stat 0 tail 0 - type 0 volumes 0 writable 0 -} -foreach subcmd [file array names destructive] { - file proc $subcmd args { - #puts stderr " [pwd] call: '::tcl_file [self proc] $args'" - eval ::tcl_file [self proc] $args - } -} -### minus n option -Class make::-n -foreach f [file info commands] { - if {$f eq "unknown" || $f eq "next" || $f eq "self"} continue - if {![file exists destructive($f)] || [file set destructive($f)]} { - #puts stderr destruct=$f - make::-n instproc $f args { - puts "--- [pwd]:\t[self proc] $args" - } - } else { - #puts stderr nondestruct=$f - make::-n instproc $f args { - set r [next] - #puts "??? [self proc] $args -> {$r}" - return $r - } - } -} - -### command line parameters -if {![info exists argv] || $argv eq ""} {set argv -all} -if {$argv eq "-n"} {set argv "-n -all"} - -Class Script -Script proc create args { - eval lappend args $::argv - eval next $args -} -Script instproc unknown args { - puts stderr "$::argv0: Unknown option ´-$args´ provided" -} - -Script instproc n {} {file mixin make::-n} -Script instproc all {} { - make inEachDir . mkIndex -} -Script instproc dir {dirName} { - cd $dirName -} -Script instproc target {path} { - make set target $path -} -Script create main - -#puts stderr "+++ make.xotcl finished." -#if {[set ::tcl_platform(platform)] eq "windows"} { -# exit -#} Index: xotcl/library/lib/makeDoc.xotcl =================================================================== diff -u -N --- xotcl/library/lib/makeDoc.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/lib/makeDoc.xotcl (revision 0) @@ -1,105 +0,0 @@ -#$Id: makeDoc.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ -package require XOTcl -namespace import ::xotcl::* -@ @File { - description { - Documentation tool for the XOTcl distribution.
    - Usage: 'makeDoc docdir filename ?filename ...?'
    - Called by Makefile. - } -} -lappend auto_path [file dirname [info script]] - -package require xotcl::package -package verbose 1 -package require xotcl::xodoc -set fileList "" - -puts "XOTcl Documentation Tool" -puts "------------------------" -if {$argc > 1} { - set DOCDIR [lindex $argv 0] - puts "Documenting to directory $DOCDIR:" - if {![file isdirectory $DOCDIR]} { - file mkdir $DOCDIR - } - set files [lrange $argv 1 end] - foreach file $files { - puts "...$file" - if {[catch {XODoc documentFileAsHTML $file $DOCDIR} fb]} { - puts stderr "\terror processing $file:\n[string replace $::errorInfo 400 end ...]" - } else { - lappend fileList $file $fb - } - } -} else { - error "usage: xodoc docdir filename ?filename ...?" -} - -set filesHtml "" -set filesDir "" -## write index page -foreach {f fb} $fileList { - set dir . - regexp {^(.*)/[^/]*$} $f _ dir - if {$fb ne "langRef-xotcl"} { - set tail ", " - if {$dir != $filesDir} { - append filesHtml "
  • Directory '$dir':
    " - set filesDir $dir - set tail "" - } - append filesHtml "$tail[file tail $f]" - } -} - -# -# -# XOTcl - Documentation -# -# -#

    Lanuage Reference - Index

    - -set content { - -The Extended Object Tcl (XOTcl) Documentation contains the -following parts: - -

    XOTcl Language Documentation

    - - -

    Package and Script Documentation

    -
    - This section of the documentation is under work... -
    - -
      - $filesHtml -
    -

    - -

    Tcl Online Information

    - - -} - - -set content [subst -nobackslashes -nocommands $content] -set f [open $DOCDIR/index.html w] -puts $f $content -close $f - -puts "Documentation finished" Index: xotcl/library/lib/metadataAnalyzer.xotcl =================================================================== diff -u -N --- xotcl/library/lib/metadataAnalyzer.xotcl (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) +++ xotcl/library/lib/metadataAnalyzer.xotcl (revision 0) @@ -1,503 +0,0 @@ -package provide xotcl::metadataAnalyzer 0.84 -package require XOTcl - -namespace eval ::xotcl::metadataAnalyzer { - namespace import ::xotcl::* - - @ @File { - description { - XOTcl file analyzer for @ metadata. E.g.\ used for - doumentation with xoDoc (but in the static variant - StaticMetadataAnalyzer which uses the dynamic - variant in this file). - <@p> - Sample sample usage: - <@pre> - package require xotcl::metadataAnalyzer - - # instantiate metadata analyzer object - MetadataAnalyzer @::m - # make this object be known to @ and turn @ metadata processing on - @ analyzerObj @::m - @ onOff 1 - - # read in some metadata tags (in sample file) & execute the file - source lib/testx.xotcl - - # turn @ metadata processing off again - @ onOff 0 - - # print out all collected metadata - puts [@::m print] - - } - } - - @ Class MetadataToken { - description { - Each collected metadata element is stored in a token object. - MetadataToken is superclass of token object classes. Each metadata token - has two interesting parameters: - <@p> - "properties" contains list of all described metadata properties. E.g. can - be printed with - <@pre> - foreach p [my set properties] { - if {[my exists $p]} { - append c " $p=[my set $p]\n" - } - } - - "name" contains the method, object, ... name of the metadata element. - <@p> - All metadata token are aggregated by @. Therefore, - <@pre> - foreach mdt [@ info children] { - if {[$mdt istype MetadataToken]} {$mdt print} - } - - prints all token. - - } - } - Class MetadataToken -parameter { - {name ""} - {properties ""} - } - - @ MetadataToken proc sortTokenList {l "token list"} { - description {Sort a token list with names. Since names are autonames, - this means order of appearance in the program.} - } - MetadataToken proc sortTokenList l { - foreach t $l { - set names([$t set name]) $t - } - set sortedNames [lsort [array names names]] - set sortedList "" - foreach n $sortedNames { - lappend sortedList $names($n) - } - return $sortedList - } - - MetadataToken instproc evaluateMetadata md { - my instvar properties - foreach {p v} $md { - # only append property, if its not already there - # otherwise just overwrite the value - if {[lsearch $properties $p] == -1} { - my lappend properties $p - } - my set $p $v - } - } - - @ MetadataToken instproc printProperties {} { - description {Print metadata properties to stdout.} - } - MetadataToken instproc printProperties {} { - set c "" - foreach p [my set properties] { - if {[my exists $p]} { - append c " [my capitalize $p]=[my set $p]\n" - } - } - return $c - } - - MetadataToken instproc capitalize string { - if {$::tcl_version >= 8.3} { - string toupper $string 0 0 - } else { - return "[string toupper [string range $string 0 0]][string range $string 1 end]" - } - } - - @ MetadataToken abstract instproc print {} { - description { - Abstract method for printing a token to stdout. - } - } - MetadataToken abstract instproc print {} - - @ Class FileToken -superclass MetadataToken { - description { - Token for @File Metadata. - } - } - Class FileToken -superclass MetadataToken - FileToken instproc print {} { - set c "FILE=[my set name]\n" - append c [my printProperties] - return $c - } - - @ Class ConstraintToken -superclass MetadataToken { - description { - Token for @Constraint Metadata. - } - } - Class ConstraintToken -superclass MetadataToken - ConstraintToken instproc print {} { - set c "CONSTRAINT=[my set name]\n" - append c [my printProperties] - return $c - } - - @ Class PackageToken -superclass MetadataToken { - description { - Token for Package metadata. Contains additional parameters: - "version" of the package and "type"= either "require" or "provide". - - } - } - Class PackageToken -superclass MetadataToken -parameter { - {version ""} - {type ""} - } - - @ Class ObjToken -superclass MetadataToken { - description { - Token for Object metadata. Contains additional parameters: - "procList" = list of all proc token and "cl"= class name. - } - } - Class ObjToken -superclass MetadataToken -parameter { - {procList ""} - cl - } - - ObjToken instproc printProcs {} { - set c " PROCS:\n" - set pl [MetadataToken sortTokenList [my procList]] - if {[my istype ClassToken]} { - set pl [concat [MetadataToken sortTokenList [my instprocList]] $pl] - } - foreach p $pl { - append c " [$p set name]\n" - } - return $c - } - - ObjToken instproc print {} { - set c "OBJECT=[my set name]\n" - if {[my exists cl]} {append c " CLASS=[my set cl]\n"} - if {[my exists heritage]} {append c " HERITAGE=[my set heritage]\n"} - append c [my printProperties] - - set pl [MetadataToken sortTokenList [my procList]] - if {[my istype ClassToken]} { - set pl [concat [MetadataToken sortTokenList [my instprocList]] $pl] - } - foreach p $pl { - append c [$p print] - } - - return $c - } - - @ Class ClassToken -superclass ObjToken { - description { - Token for Class metadata. Contains additional parameters: - "instprocList" = list of all instproc token. - } - } - Class ClassToken -superclass ObjToken -parameter { - {instprocList ""} - } - ClassToken instproc print {} { - regsub "^OBJECT=" [next] "CLASS=" r - return $r - } - - @ Class MetaClassToken -superclass ClassToken { - description { - Token for Meta-Class metadata. - } - } - Class MetaClassToken -superclass ClassToken - MetaClassToken instproc print {} { - regsub "^CLASS=" [next] "META-CLASS=" r - return $r - } - - @ Class MethodToken -superclass MetadataToken { - description { - Token for Method metadata. Contains additional parameters: - "arguments" of the method, "returnValue" of the method, - "obj" name, "abstract" = 0 or 1 (whether its an abstract method or not). - } - } - Class MethodToken -superclass MetadataToken -parameter { - arguments - returnValue - obj - {abstract 0} - } - - # Prints out method information - MethodToken instproc print {} { - set c " METHOD=[my set name], ARGUMENTS= " - - if {[my exists arguments]} { - foreach {arg argDescription} [my set arguments] { - # ignore argDescription and default values - if {[llength $arg] > 1} {set arg [lindex $arg 0]} - append c $arg " " - } - } - append c "\n [my printProperties]" - return $c - } - - @ Class ProcToken -superclass MethodToken { - description { - Token for Proc metadata - } - } - Class ProcToken -superclass MethodToken - ProcToken instproc print {} { - regsub "^ METHOD=" [next] " PROC=" r - return $r - } - - @ Class InstprocToken -superclass MethodToken { - description { - Token for Instproc metadata. - } - } - Class InstprocToken -superclass MethodToken - InstprocToken instproc print {} { - regsub "^ METHOD=" [next] " INSTPROC=" r - return $r - } - - @ Class MetadataAnalyzer { - description "Handler class for building a metadata runtime structure" - } - - Class MetadataAnalyzer -parameter { - {objList ""} - {packageList ""} - {knownMetaclasses "Class"} - {ns ""} - fileToken - {constraintList ""} - } - - MetadataAnalyzer instproc init args { - next - } - - MetadataAnalyzer instproc handleMethod {obj type name {argList ""} {doc ""}} { - #puts stderr "+++Method $type $name $argList $doc" - set procClass ProcToken - set objCl ObjToken - if {$type eq "instproc"} { - set procCl InstprocToken - set objCl ClassToken - } - set t [$procClass create [my autoname ::xotcl::@::t]] - - set n [$t set name [string trimleft $name :]] - $t set obj $obj - - set objFound 0 - foreach o [my set objList] { - if {[$o set name] == $obj} { - set objFound 1 - if {$type eq "instproc" && ![$o istype ClassToken]} { - $o class ClassToken - } - break - } - } - if {$objFound == 0} { - set o [$objCl create [my autoname ::xotcl::@::t]] - $o set name $obj - my lappend objList $o - } - $o lappend ${type}List $t - - $t set arguments $argList - - $t evaluateMetadata $doc - return $t - } - - MetadataAnalyzer instproc handleObj {class name args} { - my instvar knownMetaclasses objList extensions - set objCl ObjToken - if {[lsearch $class $knownMetaclasses] != -1} { - set objCl ClassToken - } - # if an instproc/proc has created an entry for this obj/class - # -> use it and overwrite it with new info - if {[set idx [lsearch $name $objList]] != -1} { - set t [lindex $objList $idx] - $t class $objCl - } else { - set t [$objCl create [my autoname ::xotcl::@::t]] - my lappend objList $t - } - - $t set name $name - - set la [llength $args] - - # evaluate -superclass argument - if {($la == 3 || $la == 2) && [lindex $args 0] eq "-superclass"} { - set heritage [$t set heritage [lindex $args 1]] - foreach h $heritage { - if {[lsearch $h $knownMetaclasses] != -1} { - # A new metaclass was defined - lappend knownMetaclasses $name - $t class MetaClassToken - } - } - } - - # evaluate documentation - set doc "" - if {$la == 1} { - set doc [lindex $args 0] - } elseif {$la == 3} { - set doc [lindex $args 2] - } - $t evaluateMetadata $doc - $t set cl $class - - #puts stderr "+++Obj $name $args" - } - - MetadataAnalyzer instproc handleFile doc { - if {[my exists fileToken]} { - [my set fileToken] evaluateMetadata $doc - } - } - - MetadataAnalyzer instproc handleConstraint {constraint name args} { - set t [ConstraintToken create [my autoname ::xotcl::@::t]] - my lappend constraintList $t - $t set name $name - set doc [lindex $args 0] - $t evaluateMetadata $doc - } - - MetadataAnalyzer instproc handlePackage args { - #puts "$args" - if {[llength $args] > 2} { - set type [lindex $args 1] - if {$type eq "provide" || $type eq "require"} { - set t [PackageToken create [my autoname ::xotcl::@::t]] - my lappend packageList $t - $t set name [lindex $args 2] - $t set type $type - if {[llength $args] > 3} { - $t set version [lindex $args 3] - } - } - } - } - - @ MetadataAnalyzer instproc print {} { - description "Print all collected token information to stdout. - This method is also an exmaple how the tokens can be used." - } - MetadataAnalyzer instproc print {} { - my instvar extensions packageList - set c "" - if {[llength $packageList] > 0} { - append c "PACKAGES:" - foreach t $packageList { - if {[$t type] eq "provide"} { - append c " Package provided: [$t name] [$t version]\n" - } elseif {[$t type] eq "require"} { - append c " Package required: [$t name] [$t version]\n" - } - } - } - - if {[my exists fileToken]} { - append c [[my set fileToken] print] - } - - if {[my exists constraintToken]} { - append c [[my set constraintToken] print] - } - - if {[info exists extensions]} { - # Add list of extensions. - foreach extension $extensions { - append c "\nExtensions: [$extension name], " \ - "Description: [$extension description]" - } - } - - set objList [MetadataToken sortTokenList [my objList]] - - if {[llength $objList]>0} { - foreach obj $objList {append c [$obj print]} - } - return $c - } - - @ Class AnalyzerCmd { - description {Class that overload the unknown mechanism of @ to provide metadata analysis.} - } - Class AnalyzerCmd -parameter { - {analyzerObj ""} - {onOff 0} - } - AnalyzerCmd instproc unknown args { - my instvar analyzerObj onOff - - if {!$onOff} {return [next]} - - if {[llength $args] > 1} { - set abstract 0 - if {[lindex $args 1] eq "abstract"} { - if {[llength $args] > 2} { - set p [lindex $args 2] - if {$p eq "proc" || $p eq "instproc"} { - set args [lreplace $args 1 1] - set abstract 1 - } - } - } - switch [lindex $args 1] { - proc - instproc { - set r [eval $analyzerObj handleMethod $args] - if {$abstract} {$r abstract 1} - return $r - } - default { - switch [lindex $args 0] { - @File { - return [$analyzerObj handleFile [lindex $args 1]] - } - @Constraint { - return [eval $analyzerObj handleConstraint $args] - } - default { - return [eval $analyzerObj handleObj $args] - } - } - } - } - } - puts stderr "Unknown @ metadata: '$args'" - } - @ AnalyzerCmd @ { - description {Recreate @ with metadata analyis funtionality.} - } - AnalyzerCmd @ - - namespace export \ - MetadataToken FileToken ConstraintToken PackageToken ObjToken \ - ClassToken MetaClassToken MethodToken ProcToken InstprocToken \ - MetadataAnalyzer AnalyzerCmd -} - -namespace import ::xotcl::metadataAnalyzer::* Index: xotcl/library/lib/mixinStrategy.xotcl =================================================================== diff -u -N --- xotcl/library/lib/mixinStrategy.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/lib/mixinStrategy.xotcl (revision 0) @@ -1,98 +0,0 @@ -#$Id: mixinStrategy.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ -package provide xotcl::mixinStrategy 0.9 - -package require XOTcl - -namespace eval ::xotcl::mixinStrategy { - namespace import ::xotcl::* - - @ @File { description { - These methods provide support for managing "strategies", i.e. - mixin-classes, where only one kind of a family of conformant - mixins should be registered. - <@p> - Naming convertions for strategies: - All strategies must follow the naming convention 'kind=implementation'. - Examples are the persistency strategy 'eager' specfied as - 'persistent=eager' or the persistency strategy 'lazy' (specified as - 'persistent=lazy') - }} - - @ Object instproc mixinStrategy {strategy "Strategy to be added" } { - description { - This method adds or replaces a new strategy from the mixin - list. Strategies are named following the convention mentioned - above. - } - return "old strategy" - } - - Object instproc mixinStrategy {strategy} { - regexp {:?([^:=]+)=} $strategy _ kind - set mixins "" - set oldStrategy "" - foreach mixin [my info mixin] { - if {[string match *${kind}=* $mixin]} { - lappend mixins $strategy - set oldStrategy $mixin - } else { - lappend mixins $mixin - } - } - if {$oldStrategy eq ""} { - lappend mixins $strategy - } - my mixin $mixins - return $oldStrategy - } - - @ Object instproc mixinQueryStrategy {kind "strategy kind"} { - description { - This method searches the mixin list for a mixin of this - kind (starting with $kind=) - } - return "returns the maching strategy" - } - - Object instproc mixinQueryStrategy {kind} { - set m [my info mixin] - return [::lindex $m [::lsearch -glob $m $kind=*]] - } - - @ Object instproc add {construct "(inst) 'filter' or 'mixin'" args "to be added"} { - description "add the specified (inst) 'filters' or 'mixins'" - return "empty" - } - - Object instproc add {kind args} { - if {$kind != {instfilter} && $kind != {instmixin} && - $kind != {filter} && $kind != {mixin}} { - error "Usage: [self proc] ..." - } - ::set classes [my info $kind] - eval ::lappend classes $args - my $kind $classes - #puts stderr "$kind of [self] are now: ´[my info $kind]´" - } - @ Object instproc remove {construct "(inst) 'filter' or 'mixin'" args "to be removed"} { - description "remove the specified (inst) 'filters' or 'mixins'" - return "empty" - } - Object instproc remove {kind args} { - if {$kind != {instfilter} && $kind != {instmixin} && - $kind != {filter} && $kind != {mixin}} { - error "Usage: [self proc] ..." - } - ::set classes [my info $kind] - foreach c $args { - ::set pos [::lsearch $classes $c] - if {$pos == -1} { - error "$kind ´$c´ could not be removed" - } else { - set $classes [::lreplace $classes $pos $pos] - } - } - my $kind $classes - # puts stderr "$kind of [self] are now: ´[my info $kind]´" - } -} Index: xotcl/library/lib/package.xotcl =================================================================== diff -u -N --- xotcl/library/lib/package.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/lib/package.xotcl (revision 0) @@ -1,156 +0,0 @@ -#$Id: package.xotcl,v 1.7 2006/09/27 08:12:40 neumann Exp $ -package provide xotcl::package 0.91 - -package require xotcl::mixinStrategy -package require XOTcl - -rename package tcl_package - -namespace eval ::xotcl::package { - namespace import ::xotcl::* - - @ @File {description { - Represent Tcl package loading command by an XOTcl - object. Enables tracking, tracing, and verbose output - of package loading - } - } - @ Object package { - description { - Supports all Tcl package options plus present and verbose. - } - } - @ package proc present {args "packageName or -exact packageName"} { - description { - Check whether a package is present or not. Similar to Tcl's - package present, but works with Tcl < 8.3 - } - } - @ package proc verbose {v "1 or 0"} { - description { - Toggle verbose output on/off. If on, package prints the locations - from where packages are loaded to the screen. Default is off. - } - } - - Object package - package set component . - package set verbose 0 - package proc unknown args { - #puts stderr "unknown: package $args" - namespace eval :: tcl_package $args - } - package proc verbose value { - my set verbose $value - } - package proc present args { - if {$::tcl_version<8.3} { - my instvar loaded - switch -exact -- [lindex $args 0] { - -exact {set pkg [lindex $args 1]} - default {set pkg [lindex $args 0]} - } - if {[info exists loaded($pkg)]} { - return $loaded($pkg) - } else { - error "not found" - } - } else { - namespace eval :: tcl_package present $args - } - } - - package proc require args { - my instvar component verbose uses loaded - set prevComponent $component - if {[catch {set v [eval package present $args]} msg]} { - #puts stderr "we have to load $msg" - switch -exact -- [lindex $args 0] { - -exact {set pkg [lindex $args 1]} - default {set pkg [lindex $args 0]} - } - set component $pkg - lappend uses($prevComponent) $component - set v [namespace eval :: tcl_package require $args] - if {$v ne "" && $verbose} { - set path [lindex [tcl_package ifneeded $pkg $v] 1] - puts "... $pkg $v loaded from '$path'" - set loaded($pkg) $v ;# loaded stuff needed for Tcl 8.0 - } - } - set component $prevComponent - return $v - } - - Object package::tracker - package::tracker set verbose 0 - package::tracker proc storeEntry {table index} { - my instvar verbose $table - set ${table}($index) "[package set component] [info script]" - if {$verbose} { - puts "... $table $index loaded from [info script]" - } - } - package::tracker proc dump {} { - my instvar class object instproc proc - if {[info exist class]} { parray class } - if {[info exist object]} { parray object } - if {[info exist instproc]} { parray instproc } - if {[info exist proc]} { parray proc } - } - package::tracker proc start {} { - ::Class add mixin [self]::M - ::Object add mixin [self]::M - } - - Class package::tracker::M - package::tracker::M instproc create {cls args} { - set table [string tolower [string trimleft [self] :]] - package::tracker storeEntry $table [lindex $args 0] - next - $cls add mixin [self class] - } - package::tracker::M instproc instproc args { - package::tracker storeEntry instproc [self]->[lindex $args 0] - next - } - package::tracker::M instproc proc args { - package::tracker storeEntry proc [self]->[lindex $args 0] - next - } - - #package::tracker set verbose 1 - #package::tracker start - # - #Class A - #A instproc p args { - # puts A - #} - #A proc pp args { - # a call - #} - #Object o - #o proc ppp args { - # another call - #} - #puts stderr ==================================================== - #package::tracker dump - - #puts stderr AUTO_PATH=$auto_path. - - namespace export package - namespace eval package { - namespace export tracker - namespace eval tracker { - namespace export M - } - } -} - -namespace import ::xotcl::package::* -namespace eval package { - namespace import ::xotcl::package::package::* - namespace eval tracker { - namespace import ::xotcl::package::package::tracker::* - } -} Index: xotcl/library/lib/pkgIndex-package.add =================================================================== diff -u -N --- xotcl/library/lib/pkgIndex-package.add (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/library/lib/pkgIndex-package.add (revision 0) @@ -1 +0,0 @@ -package ifneeded xotcl::package 0.91 [list source [file join $dir package.xotcl]] Index: xotcl/library/lib/pkgIndex.tcl =================================================================== diff -u -N --- xotcl/library/lib/pkgIndex.tcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/library/lib/pkgIndex.tcl (revision 0) @@ -1,21 +0,0 @@ -# Tcl package index file, version 1.1 -# This file is generated by the "pkg_mkIndex -direct" command -# and sourced either when an application starts up or -# by a "package unknown" script. It invokes the -# "package ifneeded" command to set up package-related -# information so that packages will be loaded automatically -# in response to "package require" commands. When this -# script is sourced, the variable $dir must contain the -# full path name of this file's directory. - -package ifneeded xotcl::htmllib 0.1 [list source [file join $dir htmllib.xotcl]] -package ifneeded xotcl::metadataAnalyzer 0.84 [list source [file join $dir metadataAnalyzer.xotcl]] -package ifneeded xotcl::mixinStrategy 0.9 [list source [file join $dir mixinStrategy.xotcl]] -package ifneeded xotcl::script 0.9 [list source [file join $dir Script.xotcl]] -package ifneeded xotcl::staticMetadataAnalyzer 0.84 [list source [file join $dir staticMetadata.xotcl]] -package ifneeded xotcl::test 1.37 [list source [file join $dir test.xotcl]] -package ifneeded xotcl::trace 0.91 [list source [file join $dir trace.xotcl]] -package ifneeded xotcl::upvar-compat 1.0 [list source [file join $dir upvarcompat.xotcl]] -package ifneeded xotcl::wafecompat 0.9 [list source [file join $dir wafecompat.tcl]] -package ifneeded xotcl::xodoc 0.84 [list source [file join $dir xodoc.xotcl]] -package ifneeded xotcl::package 0.91 [list source [file join $dir package.xotcl]] Index: xotcl/library/lib/staticMetadata.xotcl =================================================================== diff -u -N --- xotcl/library/lib/staticMetadata.xotcl (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) +++ xotcl/library/lib/staticMetadata.xotcl (revision 0) @@ -1,82 +0,0 @@ -package require xotcl::metadataAnalyzer -package provide xotcl::staticMetadataAnalyzer 0.84 -package require XOTcl - -namespace eval ::xotcl::staticMetadataAnalyzer { - namespace import ::xotcl::* - - @ @File { - description { - XOTcl file static analyzer for @ metadata. E.g. used for - doumentation with xoDoc. I.e. allows for reading in a - file and evaluating the metadata-related info only. - } - } - - @ Class StaticMetadataAnalyzer -superclass MetadataAnalyzer { - description { - Metadata analyzer class that allows for reading in files - and evaluation of the metadata content in the file. - } - } - - Class StaticMetadataAnalyzer -superclass MetadataAnalyzer \ - -parameter {{namespace ::}} - StaticMetadataAnalyzer instproc cmdsplit {cmd} { - # from Jeffrey's tkcon - set inc {} - set cmds {} - foreach cmd [split [string trimleft $cmd] \n] { - if {{} ne $inc } { - append inc \n$cmd - } else { - append inc [string trimleft $cmd] - } - if {[info complete $inc] && ![regexp {[^\\]\\$} $inc]} { - if {[regexp "^\[^#\]" $inc]} {lappend cmds $inc} - set inc {} - } - } - if {[regexp "^\[^#\]" $inc]} {lappend cmds $inc} - return $cmds - } - StaticMetadataAnalyzer instproc evaluateCommands {c} { - my instvar namespace - foreach command [my cmdsplit $c] { - #puts stderr "$command===========================" - if {[regexp "^ *:*@ " $command]} { - #puts stderr "$command===========================" - namespace eval $namespace $command - } elseif {[regexp "^ *package " $command]} { - #puts stderr "$command===========================" - namespace eval $namespace [list my handlePackage $command] - } elseif {[regexp "^ *namespace *eval *(\[^\{\]*) *\{(.*)\}\[^\}\]*$" $command _ namespace nsc]} { - #puts stderr "$command===========================" - namespace eval $namespace [list my evaluateCommands $nsc] - } - } - } - - - @ StaticMetadataAnalyzer instproc analyzeFile {name "File name"} { - description "Analyze a file and build up a token structure for each metadata token in the file." - } - StaticMetadataAnalyzer instproc analyzeFile name { - my set cmd "" - - set t [FileToken create [my autoname t]] - $t set name $name - my set fileToken $t - - set f [open $name r] - set c [read $f] - close $f - ::@ onOff 1 - my evaluateCommands $c - ::@ onOff 0 - } - - namespace export StaticMetadataAnalyzer -} - -namespace import ::xotcl::staticMetadataAnalyzer::* Index: xotcl/library/lib/test.xotcl =================================================================== diff -u -N --- xotcl/library/lib/test.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/lib/test.xotcl (revision 0) @@ -1,96 +0,0 @@ -package provide xotcl::test 1.37 -package require XOTcl - -namespace eval ::xotcl::test { - namespace import ::xotcl::* - - @ @File {description { - Simple regression test support. - }} - - @ Class Test { - description { - Class Test is used to configure test instances, which can - be configured by the following parameters: - <@ul> - <@li>cmd: the command to be executed - <@li>expected: the expected result - <@li>count: number of executions of cmd - <@li>pre: a command to be executed at the begin of the test (before cmd) - <@li>post: a command to be executed after the test (after all cmds) - <@li>namespace in which pre, post and cmd are evaluated; default :: - - The defined tests can be executed by <@tt>Test run - } - } - - Class Test -parameter { - cmd - {namespace ::} - {verbose 0} - {expected 1} - {count 1000} - msg setResult errorReport - pre post - } - Test set count 0 - Test proc new args { - eval my create t[format %.3d [my incr count]] $args - } - Test proc run {} { - set startTime [clock clicks -milliseconds] - foreach example [lsort [my allInstances]] { - $example run - } - puts stderr "Total Time: [expr {[clock clicks -milliseconds]-$startTime}] ms" - } - Test proc _allInstances {C} { - set set [$C info instances] - foreach sc [$C info subclass] { - eval lappend set [my _allInstances $sc] - } - return $set - } - Test proc allInstances {} { - return [my _allInstances Test] - } - - Test instproc call {msg cmd} { - if {[my verbose]} {puts stderr "$msg: $cmd"} - namespace eval [my namespace] $cmd - } - Test instproc run args { - my instvar cmd expected pre post count msg - if {[info exists pre]} {my call "pre" $pre} - if {![info exists msg]} {set msg $cmd} - set r [my call "run" $cmd] - if {[my exists setResult]} {set r [eval [my set setResult]]} - if {$r == $expected} { - if {[info exists count]} {set c $count} {set c 1000} - if {[my verbose]} { - puts stderr "running test $c times" - } - if {$c > 1} { - #set r0 [time $cmd $c] - #puts stderr "time {time $cmd $c}" - set r1 [time {time {namespace eval [my namespace] $cmd} $c}] - #regexp {^(-?[0-9]+) +} $r0 _ mS0 - regexp {^(-?[0-9]+) +} $r1 _ mS1 - set ms [expr {$mS1*1.0/$c}] - puts stderr "[self]:\t[format %6.1f $ms] mms, $msg" - } else { - puts stderr "[self]: $msg ok" - } - } else { - puts stderr "[self]:\tincorrect result for '$msg'" - puts stderr "\texpected: '$expected', got '$r' [my exists errorReport]" - if {[my exists errorReport]} {eval [my set errorReport]} - exit -1 - } - if {[info exists post]} {my call "post" $post} - } - - namespace export Test -} - -namespace import ::xotcl::test::* Index: xotcl/library/lib/trace.xotcl =================================================================== diff -u -N --- xotcl/library/lib/trace.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/library/lib/trace.xotcl (revision 0) @@ -1,285 +0,0 @@ -# -*- Tcl -*- $Id: trace.xotcl,v 1.12 2007/08/14 16:38:26 neumann Exp $ -package provide xotcl::trace 0.91 -package require XOTcl - -namespace eval ::xotcl::trace { - namespace import ::xotcl::* - - @ @File {description { - Various tracing tools for the XOTcl language. - } - } - @ Object instproc traceFilter { - args "arbitrary args" - } { - Description { - Filter to trace every method call on an object or class hierarchy. - Outputs a message befora and after each call of the traced object. - } - return "empty string" - } - @ Object Trace { - Description { - Write trace outputs and produce statistics. Variable traceStream - defines where to write trace output (default: stderr). - } - } - @ Trace proc puts {line "output line"} { - Description { - Define how traceFilter writes to the output stream. Default: - write to trace stream. - } - } - @ Trace proc openTraceFile {name "file name"} { - Description { - Redirect trace output to file. - } - } - @ Trace proc closeTraceFile {name "file name"} { - Description { - Close trace file and redirect output to stderr. - } - } - @ Object instproc lintFilter {} { - Description {Experimental lint filter} - } - @ Object instproc statFilter {} { - Description {Experimental statistics filter} - } - @ Object instproc showVars {args "ist of variables"} { - Description {Show the values of the specified variables (or of all variables) - of an object on stderr.} - } - @ Object instproc showMsg {msg "optional output"} { - Description {Show a message msg with the form "[self] $cls->$method $msg" on stderr.} - } - @ Object instproc showClass {} { Description {Show classes and mixins of the object}} - @ Object instproc showStack {maxDepth "max stack depth, default=100"} { - Description {Show callstack up to the specified calldepth.}} - @ Object instproc showCall {} { Description {Show the current call with the form "[self] $cls->$method $args" on stderr.}} - @ Object instproc showTimeStart {"?handle?" "Handle object name, optional"} {Description {start a timer}} - @ Object instproc showTimeEnd {"?handle?" "Handle object name, optional"} {Description {end a timer and show result}} - - ########################################################################## - - proc showCall {} { Trace deprecated-function showCall} - proc showVars {} { Trace deprecated-function showVars} - proc showObj {o {printObjectName 1}} { Trace deprecated-function showObj} - proc showStack {{m 100}} { Trace deprecated-function showStack} - - - Object Trace - Trace set traceStream stderr - Trace proc openTraceFile name { - my set traceStream [open $name w] - } - Trace proc closeTraceFile {} { - close $Trace::traceStream - my set traceStream stderr - } - Trace proc puts line { - puts $Trace::traceStream $line - } - Trace proc add {type obj} { - if {[my isclass $obj]} { - $obj instfilter add ${type}Filter - } else { - $obj filter add ${type}Filter - } - } - Trace proc delete {type obj} { - if {[my isclass $obj]} { - $obj instfilter delete ${type}Filter - } else { - $obj filter delete ${type}Filter - } - } - Trace proc statReset {} { - catch {my unset stat} - } - Trace proc statReportClass c { - if {[my exists stat($c)]} { - puts "\nClass $c: [my set stat($c)] references" - foreach method [$c info instprocs] { - set key $c->$method - if {[info exists stat($key)]} { - puts "\t$key: [my set stat($key)] references" - } else { - puts "\t$key: not used" - } - } - } else { - puts "\nClass $c: not used" - } - foreach subclass [lsort [$c info subclass]] { - my [self proc] $subclass - } - } - Trace proc statReport {} { - my statReportClass Object - } - Trace proc statCount key { - if {[my exists stat($key)]} { - my incr stat($key) - } else { - my incr set stat($key) 1 - } - } - Trace proc deprecated-function {name} { - puts stderr "Function <$name> is deprecated. Use method with same name instead." - } - - - - Object instproc traceFilter args { - # don't trace the Trace object - if {[self] eq "::Trace"} {return [next]} - set context "[self callingclass]->[self callingproc]" - set method [self calledproc] - switch -- $method { - proc - - instproc {set dargs [list [lindex $args 0] [lindex $args 1] ...] } - default {set dargs $args } - } - #my showStack - Trace puts "CALL $context> [self]->$method $dargs (next=[self next])" - set result [next] - Trace puts "EXIT $context> [self]->$method ($result)" - return $result - } - - Object instproc lintFilter args { - #puts stderr c=[self class],ic[my info class],p=[self calledproc] - #puts stderr " =====================METHOD='[self calledproc]'" - my instvar __reported - switch -exact -- [self calledproc] { - instvar { - set ccls [self callingclass] - set method [self callingproc] - - #puts stderr ccls=$ccls. - if {$ccls eq ""} { ;## instvar in proc - set bod [my info body $method] - set context "proc [self]->$method" - } else { ;## instvar in instproc - set bod [$ccls info instbody $method] - set context "instproc $ccls->$method" - } - foreach v $args { - set vpattern "$v\[^a-zA-Z0-9\]" - if {[regexp "\[\$\]$vpattern" $bod]} continue - if {[regexp " *$vpattern" $bod]} continue - #if {[regexp "info *exists *$vpattern" $bod]} continue - #if {[regexp "append *$vpattern" $bod]} continue - #if {[regexp "array.*$vpattern" $bod]} continue - if {[info exists __reported($v,$context)]} continue - set __reported($v,$context) 1 - puts stderr "'$v' of 'instvar $args' is NOT used in\n\ - $context ... {$bod}" - } - } - } - next - } - Object instproc statFilter args { - # don't return statistics from the Trace object - #puts stderr "self=[self]" - if {[self] eq "::Trace"} {return [next]} - set ccls [self callingclass] - set cmet [self callingproc] - set met [self calledproc] - #::puts stderr "cls=$ccls->$cmet, [self]->$met" - Trace statCount $ccls - Trace statCount $ccls->$cmet - next - } - - - - ###################################################################### - # show**** methods - # - Object instproc showVars args { - set msg {} - if {$args == {}} { - foreach var [lsort [my info vars]] { - if {[my array exists $var]} { - append msg "\n\t$var: " - #puts stderr "ARRAY $var" - #puts stderr "ARRAY names <[[self]array names $var]>" - foreach i [lsort [my array names $var]] { - append msg $i=[my set ${var}($i)] ", " - } - } elseif {[my exists $var]} { - append msg "\n\t$var: " [list [my set $var]] - } else { - append msg "\n\t$var: " UNKNOWN - } - } - } else { - foreach var $args { - if {[my array exists $var]} { - lappend msg $var: ARRAY - } elseif {[my exists $var]} { - lappend msg $var: [my set $var] - } else { - lappend msg $var: UNKNOWN - } - } - } - set method [self callingproc] - set cls [self callingclass] - puts stderr "[self] $cls->$method $msg" - #puts stderr " MIXINS: [my info mixin]" - } - Object instproc showMsg msg { - set method [self callingproc] - set cls [self callingclass] - puts stderr "[self] $cls->$method $msg" - } - Object instproc showClass {} { - set method [self callingproc] - set cls [self callingclass] - puts stderr "[self] $cls->$method class [my info class]\ - mixins {[my info mixin]}" - } - Object instproc showStack {{m 100}} { - set max [info level] - if {$m<$max} {set max $m} - puts stderr "Call Stack (level: command)" - for {set i 0} {$i < $max} {incr i} { - if {[catch {set s [uplevel $i self]} msg]} { - set s "" - } - puts stderr "[format %5d -$i]:\t$s [info level [expr {-$i}]]" - } - } - Object instproc showCall {} { - set method [self callingproc] - set cls [self callingclass] - set args [lreplace [info level -1] 0 0] - puts stderr "[self] $cls->$method $args" - } - Object instproc showTimeStart {{handle __h}} { - upvar [self callinglevel] $handle obj - set obj [Object [self]::[my autoname __time]] - $obj set clicks [clock clicks] - return - } - Object instproc showTimeEnd {{handle __h}} { - upvar [self callinglevel] $handle obj - set method [self callingproc] - set cls [self callingclass] - set elapsed [expr {([clock clicks]-[$obj set clicks])/1000000.0}] - puts stderr "[self] $cls->$method: elapsed [format %.2f $elapsed]secs" - $obj destroy - } - - - ###################################################################### - - - namespace export showCall showVars showObj showStack Trace -} - -namespace import ::xotcl::trace::* Index: xotcl/library/lib/upvarcompat.xotcl =================================================================== diff -u -N --- xotcl/library/lib/upvarcompat.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/lib/upvarcompat.xotcl (revision 0) @@ -1,42 +0,0 @@ -#$Id: upvarcompat.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::upvar-compat 1.0 -package require XOTcl - -namespace eval ::xotcl::upvar-compat { - namespace import ::xotcl::* - - @ @File {description { - Provide a version of upvar and uplevel that provide - backward compatibility such that these commands - ignore inactive filter and mixin frames (upvar behaves - the same whether or not a filter is installed). Newer - scripts should use <@TT>upvar/uplevel [self callinglevel] var/command - instead. - } } -} - -# Define upvar and uplevel; use the level, if given explizitely: -# otherwise point to the callinglevel from XOTcl -rename ::uplevel ::xotcl::tcl_uplevel -proc ::uplevel {lvl args} { - # the outer uplevel is needed to leave the scope of this proc - if {[regexp {^\#?[0-9]+$} $lvl]} { - ::xotcl::tcl_uplevel 1 [list eval ::xotcl::tcl_uplevel $lvl $args] - } else { - set cl [::xotcl::tcl_uplevel 1 ::xotcl::self callinglevel] - ::xotcl::tcl_uplevel 1 [list eval ::xotcl::tcl_uplevel $cl [list $lvl] $args] - } -} - -rename ::upvar ::xotcl::tcl_upvar -proc ::upvar {lvl args} { - # the outer uplevel is needed to leave the scope of this proc - if {[regexp {^\#?[0-9]+$} $lvl]} { - ::xotcl::tcl_uplevel 1 [list eval ::xotcl::tcl_upvar $lvl $args] - } else { - set cl [::xotcl::tcl_uplevel 1 ::xotcl::self callinglevel] - ::xotcl::tcl_uplevel 1 [list eval ::xotcl::tcl_upvar $cl [list $lvl] $args] - } -} - Index: xotcl/library/lib/wafecompat.tcl =================================================================== diff -u -N --- xotcl/library/lib/wafecompat.tcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/lib/wafecompat.tcl (revision 0) @@ -1,51 +0,0 @@ -# $Id: wafecompat.tcl,v 1.4 2006/09/27 08:12:40 neumann Exp $ -package provide xotcl::wafecompat 0.9 - -set WAFELIB /usr/lib/X11/wafe/ -set MODULE_PATH "$WAFELIB $auto_path" -set COMPONENT_PATH $WAFELIB/otcl-classes -proc MOTIFPREFIX {} {return {}} -proc requireModules modules { - global MODULE_PATH - foreach {cmd module} $modules { - if {{} ne [info command $cmd] } continue - if {[regexp {([A-Za-z1-9]+)Gen} $module _ n] || - [regexp {lib([a-z]+)} $module _ n] || - [regexp {^(.+)[.]so} $module _ n] - } { - set name [string toupper $n] - } - foreach path $MODULE_PATH { - set f $path/tcllib/bin/$module - if {[set found [file exists $f]]} { - puts stderr "Loading module $name from $f" - load $f $name - break - } - } - if {!$found} { error "Could not find module $module in {$MODULE_PATH}"} -}} -proc requireTclComponents {files} { - global COMPONENT_PATH _componentLoaded - foreach component $files { - if {[info exists _componentLoaded($component)]} continue - foreach path $COMPONENT_PATH { - set f $path/$component - if {[file exists $f]} { - puts stderr "Loading source file $f" - uplevel \#0 source $f - set _componentLoaded($component) $f - break - } - } - if {![info exists _componentLoaded($component)]} { - error "Could not find component $component in {$COMPONENT_PATH}" - } -}} -proc addTimeOut {n cmd} { - after $n $cmd -} -proc removeTimeOut {n} { - after cancel $n -} -proc quit {} { exit } Index: xotcl/library/lib/xodoc.xotcl =================================================================== diff -u -N --- xotcl/library/lib/xodoc.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/lib/xodoc.xotcl (revision 0) @@ -1,412 +0,0 @@ -# $Id: xodoc.xotcl,v 1.7 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::xodoc 0.84 -package require xotcl::staticMetadataAnalyzer -package require xotcl::htmllib -#package require xotcl::trace -package require XOTcl - -namespace eval ::xotcl::xodoc { - namespace import ::xotcl::* - - @ @File { - description { - XOTcl documentation tool. Overloads the command @, which is used - as a documentation token. - } - } - - @ Class MetadataTokenHTML { - description {Instmixin to provide HTML printing. Such instmixins - are registered for all token types. - } - } - Class MetadataTokenHTML - @ MetadataTokenHTML abstract instproc printHTML {} { - description {Print token to HTML document object} - } - MetadataTokenHTML abstract instproc printHTML {} - - @ MetadataTokenHTML instproc getDocPropertiesHTML {} { - description { - Returns list of properties as HTML. - } - } - - MetadataTokenHTML instproc getDocPropertiesHTML {htmlDoc} { - foreach p [my set properties] { - $htmlDoc startTableRow -valign top - if {[my exists $p]} { - $htmlDoc startTableCell -valign top - $htmlDoc addString " [my capitalize $p]:" - $htmlDoc endTableCell - - $htmlDoc startTableCell -valign top - if {$p eq "errorCodes"} { - # Build table cell with list of error codes. - foreach {code desc} [my set $p] { - set code [string map [list < <\; > >\;] $code] - set desc [string map [list < <\; > >\;] $desc] - $htmlDoc addString "$code: $desc\n

    " - } - } else { - $htmlDoc addString [my set $p] - } - $htmlDoc endTableCell - } - $htmlDoc endTableRow - } - } - - MetadataTokenHTML instproc reflowHTML {left paragraph} { - #set result "" - #foreach line [split $paragraph \n] { - # if {![regexp {^ *$} $line]} { - # append result "$left$line
    \n" - # } - #} - #return $result - return $paragraph - } - - MetadataToken instmixin [concat [MetadataToken info instmixin] MetadataTokenHTML] - - @ Class FileTokenHTML -superclass MetadataTokenHTML - Class FileTokenHTML -superclass MetadataTokenHTML - FileTokenHTML instproc printHTML {htmlDoc} { - $htmlDoc addLineBreak - $htmlDoc addString " Filename: " - $htmlDoc addAnchor [my set name] -href [my set name] - $htmlDoc addLineBreak - $htmlDoc addLineBreak - $htmlDoc startTable -border 0 - my getDocPropertiesHTML $htmlDoc - $htmlDoc endTable - } - - FileToken instmixin [concat [FileToken info instmixin] FileTokenHTML] - - @ Class ConstraintTokenHTML -superclass MetadataTokenHTML - Class ConstraintTokenHTML -superclass MetadataTokenHTML - ConstraintTokenHTML instproc printHTML {htmlDoc} { - $htmlDoc addAnchor "" -name [my set name] - $htmlDoc addString "

    Constraint: [my set name]

    " - $htmlDoc addLineBreak - $htmlDoc startTable -border 0 - my getDocPropertiesHTML $htmlDoc - $htmlDoc endTable - } - - ConstraintToken instmixin [concat [ConstraintToken info instmixin] ConstraintTokenHTML] - - @ Class ObjTokenHTML -superclass MetadataTokenHTML - Class ObjTokenHTML -superclass MetadataTokenHTML - ObjTokenHTML instproc getProcsHTML {htmlDoc} { - set c "" - set pl [MetadataToken sortTokenList [my procList]] - if {[my istype ClassToken]} { - set pl [concat [MetadataToken sortTokenList [my instprocList]] $pl] - } - foreach p $pl { - set pn [$p set name] - set label($pn) "$pn" - } - foreach l [lsort [array names label]] { - if {$c ne ""} {append c ", "} - append c $label($l) - } - if {$c ne ""} {append c "."} - $htmlDoc addString "$c" - } - - ObjTokenHTML instproc printHTML {htmlDoc} { - $htmlDoc addAnchor "" -name [my set name] - if {[my istype MetaClassToken]} { - set start "

    MetaClass:" - } elseif {[my istype ClassToken]} { - set start "

    Class:" - } else { - set start "

    Object:" - } - $htmlDoc addString "$start [my set name]

    " - if {[my exists cl]} { - $htmlDoc addString "Class: [my set cl]" - $htmlDoc addLineBreak - } - if {[my exists heritage]} { - $htmlDoc addString "Heritage: [my set heritage]" - $htmlDoc addLineBreak - } - - set head "" - if {[my procList] ne ""} {set head " Procs "} - if {[my istype ClassToken]} { - if {[my instprocList] ne ""} {set head " Procs/Instprocs: "} - } - $htmlDoc addString $head - my getProcsHTML $htmlDoc - - $htmlDoc startTable -border 0 - my getDocPropertiesHTML $htmlDoc - $htmlDoc endTable - } - - ObjToken instmixin [concat [ObjToken info instmixin] ObjTokenHTML] - - @ Class MethodTokenHTML -superclass MetadataTokenHTML - Class MethodTokenHTML -superclass MetadataTokenHTML - - # Prints out method information as HTML. - MethodTokenHTML instproc printHTML {htmlDoc} { - #my showVars - set argText "\n" - - HtmlBuilder args - - set a "Arguments:" - - set anchor [my set obj]-[my set name] - $htmlDoc addAnchor "" -name $anchor - - if {[my abstract]} {$htmlDoc addString "abstract"} - $htmlDoc addString "[my set name] " - - args set indentLevel [$htmlDoc set indentLevel] - - if {[my exists arguments]} { - #set argText "\n" - foreach {arg argDescription} [my set arguments] { - if {[llength $arg] > 1} { - # A default value was given to the argument. - $htmlDoc addString "?[lindex $arg 0]?" - set at "?[lindex $arg 0]?:$argDescription Default: \"[lindex $arg 1]\"." - } else { - $htmlDoc addString "$arg" - set at "$arg: $argDescription" - } - args startTableRow -valign top - args startTableCell -valign top - args addString $a - set a "" - args endTableCell - args startTableCell -valign top - args addString $at - args endTableCell - args endTableRow - } - } - $htmlDoc startTable -border 0 - - $htmlDoc addString [args toString] - args destroy - - my getDocPropertiesHTML $htmlDoc - - $htmlDoc endTable - - #$htmlDoc endListItem - } - - MethodToken instmixin [concat [MethodToken info instmixin] MethodTokenHTML] - - @ Class XODoc { description "Handler class for building a documentation database" } - - Class XODoc -superclass StaticMetadataAnalyzer - - @ XODoc proc documentFileAsHTML { - file "filename of the xotcl file to be documented" - docdir "directory to which the html file is written" - } { - description "Uses the xoDoc package to produce an HTML documentation of - a specified file ***.xotcl. The file is written to ***.html - in docdir" - return "file basename without suffix" - } - - XODoc proc documentFileAsHTML {file docdir} { - set docdb [XODoc [XODoc autoname docdb]] - ::@ set analyzerObj $docdb - $docdb analyzeFile $file - set ext [file extension $file] - if {$ext ne ""} {set ext -[string trimleft $ext .]} - set docfilename [file rootname [file tail $file]]$ext - $docdb writeFile ${docdir}/$docfilename.html $file - $docdb destroy - return $docfilename - } - - XODoc instproc printPackages {htmlDoc} { - my instvar packageList - $htmlDoc addString "

    Package/File Information

    " - if {[llength $packageList] > 0} { - foreach t $packageList { - if {[$t type] eq "provide"} { - $htmlDoc addString " Package provided: [$t name] [$t version]" - } elseif {[$t type] eq "require"} { - $htmlDoc addString " Package required: [$t name] [$t version]" - } - $htmlDoc addLineBreak - } - } else { - $htmlDoc addString " No package provided/required " - $htmlDoc addLineBreak - } - } - - XODoc instproc printExtensions {htmlDoc} { - my instvar extensions - if {[info exists extensions]} { - # Add list of extensions. - foreach extension $extensions { - $htmlDoc addLineBreak - $htmlDoc addString "

    Document extension: [$extension name]" - $htmlDoc addString "Description: [$extension description]" - $htmlDoc addLineBreak - } - } - } - - XODoc instproc printObjList {htmlDoc} { - set objList [MetadataToken sortTokenList [my objList]] - - if {[llength $objList]>0} { - $htmlDoc addLineBreak - $htmlDoc addString "Defined Objects/Classes: " - $htmlDoc startUnorderedList - foreach obj $objList { - set on [$obj set name] - $htmlDoc startListItem - $htmlDoc addAnchor "$on:" -href "#$on" - $obj getProcsHTML $htmlDoc - $htmlDoc addLineBreak - $htmlDoc endListItem - } - $htmlDoc endUnorderedList - } - } - - XODoc instproc printFileToken {htmlDoc} { - if {[my exists fileToken]} { - [my set fileToken] printHTML $htmlDoc - } else { - $htmlDoc addString " No file information. \n" - } - $htmlDoc addLineBreak - } - - XODoc instproc printConstraintsList {htmlDoc} { - set constraintList [MetadataToken sortTokenList [my constraintList]] - - if {[llength $constraintList]>0} { - $htmlDoc addLineBreak - $htmlDoc addString "Defined Constraints: " - $htmlDoc startUnorderedList - foreach c $constraintList { - set cn [$c set name] - $htmlDoc startListItem - $htmlDoc addAnchor "$cn:" -href "#$cn" - $htmlDoc addLineBreak - $htmlDoc endListItem - } - $htmlDoc endUnorderedList - } - } - - XODoc instproc printConstraints {htmlDoc} { - foreach c [my set constraintList] { - $htmlDoc addHorizontalRule - $htmlDoc startParagraph - $c printHTML $htmlDoc - $htmlDoc endParagraph - } - $htmlDoc addLineBreak - } - - XODoc instproc printProcsList {htmlDoc list string} { - if {[llength $list] > 0} { - $htmlDoc addString "

    $string

    " - $htmlDoc startUnorderedList - foreach s $list { - $htmlDoc startListItem - $s printHTML $htmlDoc - $htmlDoc endListItem - } - $htmlDoc endUnorderedList - } - } - XODoc instproc printObjs {htmlDoc} { - set objList [MetadataToken sortTokenList [my objList]] - - foreach t $objList { - $htmlDoc addHorizontalRule - $htmlDoc startParagraph - $t printHTML $htmlDoc - if {[$t istype ClassToken]} { - my printProcsList $htmlDoc [$t set instprocList] Instprocs - } - my printProcsList $htmlDoc [$t set procList] Procs - $htmlDoc endParagraph - } - } - - XODoc instproc replaceFormatTags {fc} { - regsub -all <@ $fc < fc - regsub -all " - htmlDoc addImage -src "./logo-100.jpg" -alt "$name" -align MIDDLE - htmlDoc addStringDecr "$name" - htmlDoc addHorizontalRule - htmlDoc startParagraph - - my printPackages htmlDoc - my printExtensions htmlDoc - my printObjList htmlDoc - my printConstraintsList htmlDoc - my printFileToken htmlDoc - my printObjs htmlDoc - my printConstraints htmlDoc - htmlDoc endParagraph - htmlDoc addHorizontalRule - htmlDoc startParagraph - htmlDoc endParagraph - htmlDoc addAnchor "Back to index page." -href "./index.html" - htmlDoc addLineBreak - htmlDoc addHorizontalRule - htmlDoc startParagraph - htmlDoc endParagraph - htmlDoc endDocument - set r [my replaceFormatTags [htmlDoc toString]] - htmlDoc destroy - return $r - } - - @ XODoc instproc writeFile { - filename "file name destination" name "name of the html document" - } { - description "Create HTML docuemntation from metadata token and write to file " - } - XODoc instproc writeFile {filename name} { - set content [my printHTML $name] - set f [open $filename w] - puts $f $content - close $f - } - - namespace export \ - MetadataTokenHTML FileTokenHTML ConstraintTokenHTML ObjTokenHTML \ - MethodTokenHTML XODoc -} - -namespace import ::xotcl::xodoc::* Index: xotcl/library/patterns/COPYRIGHT =================================================================== diff -u -N --- xotcl/library/patterns/COPYRIGHT (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/patterns/COPYRIGHT (revision 0) @@ -1,41 +0,0 @@ - * XOTcl - Extended OTcl - * - * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) - * - * (a) Vienna University of Economics and Business Administration - * Dept. of Information Systems / New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - Index: xotcl/library/patterns/ChainOfResponsibility.xotcl =================================================================== diff -u -N --- xotcl/library/patterns/ChainOfResponsibility.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/patterns/ChainOfResponsibility.xotcl (revision 0) @@ -1,53 +0,0 @@ -# $Id: ChainOfResponsibility.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::pattern::chainOfResponsibility 0.9 -package require XOTcl - -namespace eval ::xotcl::pattern::chainOfResponsibility { - namespace import ::xotcl::* - - Class ChainOfResponsibility -superclass Class - - ChainOfResponsibility instproc chainingFilter args { - set cp [self calledproc] - set registrationclass [lindex [self filterreg] 0] - $registrationclass instvar operations - #puts stderr "CHAIN [array names [self regclass]::chainedOperations ]---$cp" - if {[$registrationclass exists chainedOperations($cp)]} { - # - # a value is found on the chain, if it differs from the failure value ! - # - set failureValue [$registrationclass set chainedOperations($cp)] - set r [my $cp $args] - if {$r == $failureValue} { - if {[my exists successor] && - [set s [my set successor]] != ""} { - #puts stderr "CHAIN: forwarding to $s" - set r [$s $cp $args] - } - } - set r ;# return $r - } else { - next ;# return [next] - } - } - - ChainOfResponsibility instproc init args { - my instfilter add chainingFilter - my parameter {successor} - # chained operations hold their value of failure - my array set chainedOperations {} - } - - ChainOfResponsibility instproc addChainedOperation {name {failureValue ""}} { - my set chainedOperations($name) $failureValue - } - - ChainOfResponsibility instproc removeChainedOperation {name} { - my unset chainedOperations($name) - } - - namespace export ChainOfResponsibility -} - -namespace import ::xotcl::pattern::chainOfResponsibility::* Index: xotcl/library/patterns/OnCalleeProxy.xotcl =================================================================== diff -u -N --- xotcl/library/patterns/OnCalleeProxy.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/patterns/OnCalleeProxy.xotcl (revision 0) @@ -1,41 +0,0 @@ -# $Id: OnCalleeProxy.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::pattern::onCalleeProxy 0.8 -package require XOTcl - -namespace eval ::xotcl::pattern::onCalleeProxy { - namespace import ::xotcl::* - - Class OnCalleeProxy -superclass Class - - @ @File { - description { - Simple proxy pattern implementation enhanced with the ability to adapt - calls solely for specified calling objects - for each calling obj there may be a different delegator obj - } - } - - OnCalleeProxy instproc onCalleeProxyFilter args { - set o [string trimleft [self callingobject] :] - my instvar callee - #puts stderr "[self class]: checking $o -- [self] -- [self calledproc] " - if {[info exists callee($o)]} { - return [::eval [set callee($o)] [self calledproc] $args] - } else { - next - } - } - - OnCalleeProxy instproc init args { - my instfilter add onCalleeProxyFilter - next - my instproc setCallee {callingObj a} { - my set callee([string trimleft $callingObj :]) $a - } - } - - namespace export OnCalleeProxy -} - -namespace import ::xotcl::pattern::onCalleeProxy::* Index: xotcl/library/patterns/Singleton.xotcl =================================================================== diff -u -N --- xotcl/library/patterns/Singleton.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/patterns/Singleton.xotcl (revision 0) @@ -1,84 +0,0 @@ -# $Id: Singleton.xotcl,v 1.7 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::pattern::singleton 0.8 -package require XOTcl - -namespace eval ::xotcl::pattern::singleton { - namespace import ::xotcl::* - - Class SingletonBase - SingletonBase instproc getInstance args { - my instvar _instance - if {[info exists _instance]} { - return $_instance - } - return "" - } - - - # - # A simple pattern mixin that makes a class to a non-specializable singleton - # - Class NonSpecializableSingleton -superclass SingletonBase - - NonSpecializableSingleton instproc create args { - my instvar _instance - if {![info exists _instance]} { - set _instance [self] - next - } - return $_instance - } - - NonSpecializableSingleton instproc getInstance {} { - if {[info exists _instance]} { - my instvar _instance - return $_instance - } - return "" - } - - # - # Specializable Singleton - # - Class Singleton -superclass {SingletonBase Class} - Singleton instproc singletonFilter args { - switch -exact [self calledproc] { - init { - set registrationclass [lindex [self filterreg] 0] - $registrationclass instvar _instance - if {![info exists _instance]} { - set _instance [self] - next - } else { - my destroy - } - return $_instance - } - default { - return [next] - } - } - } - - Singleton instproc init args { - my instfilter add singletonFilter - # - # specialized singletons have to look up the singleton class - # first - Class instproc getInstance {} { - foreach sc [my info superclass] { - if {[$sc info class] eq "::Singleton"} { - return [$sc getInstance] - } else { - return "" - } - } - } - next - } - - namespace export SingletonBase NonSpecializableSingleton Singleton -} - -namespace import ::xotcl::pattern::singleton::* Index: xotcl/library/patterns/SortedComposite.xotcl =================================================================== diff -u -N --- xotcl/library/patterns/SortedComposite.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/patterns/SortedComposite.xotcl (revision 0) @@ -1,80 +0,0 @@ -# $Id: SortedComposite.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::pattern::sortedCompositeWithAfter 0.9 -package require XOTcl - -namespace eval ::xotcl::pattern::sortedCompositeWithAfter { - namespace import ::xotcl::* - - Class SortedComposite -superclass Class - - @ @File { - description { - Composite pattern enhanced with sorting - } - } - - SortedComposite instproc remove {array element} { - if {[my exists ${array}($element)]} { - my unset ${array}($element) - } - } - - SortedComposite instproc addOperations args { - foreach pair $args { - foreach {proc op} $pair {my set operations($proc) $op} - } - } - - SortedComposite instproc removeOperations args { - foreach op $args {my remove operations $op} - } - - SortedComposite instproc addAfterOperations args { - foreach pair $args { - foreach {proc op} $pair {my set afterOperations($proc) $op} - } - } - SortedComposite instproc removeAfterOperations args { - foreach op $args {my remove afterOperations $op} - } - - SortedComposite instproc compositeFilter args { - set registrationclass [lindex [self filterreg] 0] - set r [self calledproc] - set result [next] - if {[$registrationclass exists operations($r)] && [my exists children]} { - set method [$registrationclass set operations($r)] - foreach object [my set children] { - eval [self]::$object $method $args - } - } - if {[$registrationclass exists afterOperations($r)]} { - eval my [$registrationclass set afterOperations($r)] $args - } - set result - } - - SortedComposite instproc init args { - my array set operations {} - my array set afterOperations {} - - my instproc setChildren args { - switch [llength $args] { - 0 { return [my set children] } - 1 { return [my set children [lindex $args 0]] } - default {error "wrong # args: [self] setChildren ?children?"} - } - } - my instproc appendChildren args { - eval my lappend children $args - } - - next - my instfilter add compositeFilter - } - - namespace export SortedComposite -} - -namespace import ::xotcl::pattern::sortedCompositeWithAfter::* Index: xotcl/library/patterns/adapter.xotcl =================================================================== diff -u -N --- xotcl/library/patterns/adapter.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/patterns/adapter.xotcl (revision 0) @@ -1,44 +0,0 @@ -# $Id: adapter.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::pattern::adapter 0.9 - -package require XOTcl - -namespace eval ::xotcl::pattern::adapter { - namespace import ::xotcl::* - - Class Adapter -superclass Class - - @ @File { - description { - Simple adapter pattern meta-class taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - } - } - - Adapter instproc adapterFilter args { - set r [self calledproc] - my instvar specificRequest adaptee \ - [list specificRequest($r) sr] - if {[info exists sr]} { - return [eval $adaptee $sr $args] - } - next - } - - Adapter instproc init args { - my instfilter add adapterFilter - next - my instproc setRequest {r sr} { - my set specificRequest($r) $sr - } - my instproc setAdaptee {a} { - my set adaptee $a - } - } - - namespace export Adapter -} - -namespace import ::xotcl::pattern::adapter::* Index: xotcl/library/patterns/composite.xotcl =================================================================== diff -u -N --- xotcl/library/patterns/composite.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/patterns/composite.xotcl (revision 0) @@ -1,62 +0,0 @@ -# $Id: composite.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::pattern::composite 0.9 -package require XOTcl - -namespace eval ::xotcl::pattern::composite { - namespace import ::xotcl::* - - Class Composite -superclass Class - - @ @File { - description { - Simple composite pattern meta-class taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - } - } - - Composite instproc addOperations args { - foreach op $args { - if {![my exists operations($op)]} { - my set operations($op) $op - } - } - } - - Composite instproc removeOperations args { - foreach op $args { - if {![my exists operations($op)]} { - my unset operations($op) - } - } - } - - Composite instproc compositeFilter args { - # get the operations class variable from the object's class - set registrationclass [lindex [self filterreg] 0] - $registrationclass instvar operations - # get the request - set r [self calledproc] - - # check if the request is a registered operation - if {[info exists operations($r)]} { - foreach object [my info children] { - # forward request - eval $object $r $args - } - } - return [next] - } - - - Composite instproc init {args} { - my array set operations {} - next - my instfilter add compositeFilter - } - - namespace export Composite -} - -namespace import ::xotcl::pattern::composite::* Index: xotcl/library/patterns/link.xotcl =================================================================== diff -u -N --- xotcl/library/patterns/link.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/patterns/link.xotcl (revision 0) @@ -1,58 +0,0 @@ -# $Id: link.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::pattern::link 0.9 -package require XOTcl - -namespace eval ::xotcl::pattern::link { - namespace import ::xotcl::* - - # - # establish/introspect 'link' through link-instproc - # - Class Link -parameter { - {link ""} - } - - Link instproc adapterFilter args { - set l [my set link] - set m [self calledproc] - - # let link/destroy requests go through to the link - if {$m eq "link" || $m eq "destroy"} { - return [next] - } - - if {[Object isobject $l]} { - puts stderr "adapting $m on link [self] -> $l" - eval $l $m $args - } else { - # if there is currently no link establish -> return - if {$l eq ""} {return} - error "Link: object $l is no xotcl object" - } - } - - Link instfilter adapterFilter - - # Link L - # Class A - - # L link A - - # L w - - # w set a 45 - - # puts [w set a] - - # puts [L link] - - # #A destroy - # puts ----1 - # L set r 45 - # puts ----2 - - namespace export Link -} - -namespace import ::xotcl::pattern::link::* Index: xotcl/library/patterns/manager.xotcl =================================================================== diff -u -N --- xotcl/library/patterns/manager.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/patterns/manager.xotcl (revision 0) @@ -1,40 +0,0 @@ -# $Id: manager.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::pattern::manager 0.8 -package require XOTcl - -namespace eval ::xotcl::pattern::manager { - namespace import ::xotcl::* - - # - # a simle manager pattern following buschmann (164) - # based on dynamic object aggregation and using dynamic code - # for supplier creation (instead of loading) - # - # it shares the suppliers ! - # - - # - # abstract supplier, init starts dynamic code creation - # - Class Supplier - Supplier abstract instproc init args - Supplier abstract instproc m args - - - Class Manager -parameter { - {supplierClass Supplier} - } - - Manager instproc getSupplier {name} { - if {[my info children [namespace tail $name]] != ""} { - return [self]::[namespace tail $name] - } else { - return [my [my supplierClass] [namespace tail $name]] - } - } - - namespace export Supplier Manager -} - -namespace import ::xotcl::pattern::manager::* Index: xotcl/library/patterns/observer.xotcl =================================================================== diff -u -N --- xotcl/library/patterns/observer.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/patterns/observer.xotcl (revision 0) @@ -1,100 +0,0 @@ -# $Id: observer.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::pattern::observer 0.8 -package require XOTcl - -namespace eval ::xotcl::pattern::observer { - namespace import ::xotcl::* - - Class Observer -superclass Class - - @ @File { - description { - Simple observer pattern meta-class taken from the paper - 'Filters as a Language Support for Design Patterns in - Object-Oriented Scripting Languages'. - } - } - - Class Observer::Subject -superclass Class - - Observer::Subject instproc notificationFilter {args} { - set procName [self calledproc] - my instvar \ - preObservers [list preObservers($procName) preObs] \ - postObservers [list postObservers($procName) postObs] - - if {[info exists preObs]} { - foreach obj $preObs { $obj update [self] $args } - } - set result [next] - - if {[info exists postObs]} { - foreach obj $postObs { $obj update [self] $args } - } - return $result - } - - Class Observer::SubjectMgt - Observer::SubjectMgt instproc attach {hook objs} { - upvar [self callinglevel] $hook observers - foreach obj $objs { - if {![info exists observers] || [lsearch $observers $obj] == -1} { - lappend observers $obj - } - } - } - Observer::SubjectMgt instproc detach {hook objs} { - upvar [self callinglevel] $hook observers - if {[info exists observers]} { - foreach obj $objs { - set p [lsearch $observers $obj] - set observers [lreplace $observers $p $p] - } - } - } - - Observer::SubjectMgt instproc attachPre {procName args} { - my instvar preObservers - my attach preObservers($procName) $args - } - Observer::SubjectMgt instproc attachPost {procName args} { - my instvar postObservers - my attach postObservers($procName) $args - } - Observer::SubjectMgt instproc detachPre {procName args} { - my instvar preObservers - my detach preObservers($procName) $args - } - Observer::SubjectMgt instproc detachPost {procName args} { - my instvar postObservers - my detach postObservers($procName) $args - } - - Observer::Subject instproc init args { - next - my superclass [list Observer::SubjectMgt [my info superclass]] - my instfilter notificationFilter - } - - Observer instproc timeout t { - my set timeout $t - } - - Observer instproc update {subject args} { - #addTimeOut [my set timeout] "my update $subject $args" - #$subject getResponse - # do something with the response - puts [self]---update - } - - namespace export Observer - namespace eval Observer { - namespace export Subject SubjectMgt - } -} - -namespace import ::xotcl::pattern::observer::* -namespace eval Observer { - namespace import ::xotcl::pattern::observer::Observer::* -} Index: xotcl/library/patterns/pkgIndex.tcl =================================================================== diff -u -N --- xotcl/library/patterns/pkgIndex.tcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/patterns/pkgIndex.tcl (revision 0) @@ -1,19 +0,0 @@ -# Tcl package index file, version 1.1 -# This file is generated by the "pkg_mkIndex -direct" command -# and sourced either when an application starts up or -# by a "package unknown" script. It invokes the -# "package ifneeded" command to set up package-related -# information so that packages will be loaded automatically -# in response to "package require" commands. When this -# script is sourced, the variable $dir must contain the -# full path name of this file's directory. - -package ifneeded xotcl::pattern::adapter 0.9 [list source [file join $dir adapter.xotcl]] -package ifneeded xotcl::pattern::chainOfResponsibility 0.9 [list source [file join $dir ChainOfResponsibility.xotcl]] -package ifneeded xotcl::pattern::composite 0.9 [list source [file join $dir composite.xotcl]] -package ifneeded xotcl::pattern::link 0.9 [list source [file join $dir link.xotcl]] -package ifneeded xotcl::pattern::manager 0.8 [list source [file join $dir manager.xotcl]] -package ifneeded xotcl::pattern::observer 0.8 [list source [file join $dir observer.xotcl]] -package ifneeded xotcl::pattern::onCalleeProxy 0.8 [list source [file join $dir OnCalleeProxy.xotcl]] -package ifneeded xotcl::pattern::singleton 0.8 [list source [file join $dir Singleton.xotcl]] -package ifneeded xotcl::pattern::sortedCompositeWithAfter 0.9 [list source [file join $dir SortedComposite.xotcl]] Index: xotcl/library/pkgIndex.tcl =================================================================== diff -u -N --- xotcl/library/pkgIndex.tcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/pkgIndex.tcl (revision 0) @@ -1,10 +0,0 @@ -set __dir__ $dir -foreach index [concat \ - [glob -nocomplain [file join $dir * pkgIndex.tcl]] \ - [glob -nocomplain [file join $dir * * pkgIndex.tcl]]] { - set dir [file dirname $index] - source $index -} -set dir $__dir__ -unset __dir__ - Index: xotcl/library/rdf/COPYRIGHT =================================================================== diff -u -N --- xotcl/library/rdf/COPYRIGHT (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/rdf/COPYRIGHT (revision 0) @@ -1,41 +0,0 @@ - * XOTcl - Extended OTcl - * - * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) - * - * (a) Vienna University of Economics and Business Administration - * Dept. of Information Systems / New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - Index: xotcl/library/rdf/RDFCreator.xotcl =================================================================== diff -u -N --- xotcl/library/rdf/RDFCreator.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/rdf/RDFCreator.xotcl (revision 0) @@ -1,142 +0,0 @@ -# $Id: RDFCreator.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::rdf::tripleRecreator 0.9 -package require XOTcl -package require xotcl::rdf::parser - -namespace eval ::xotcl::rdf::tripleRecreator { - namespace import ::xotcl::* - - Class RDFCreator -parameter { - {rdfNS "http://www.w3.org/1999/02/22-rdf-syntax-ns#"} - {openExprs ""} - } - - Class OpenExpr -parameter { - {type ""} - {subject ""} - {closing ""} - } - - RDFCreator instproc init args { - next - } - - RDFCreator instproc free {} { - my instvar openExprs - while {$openExprs ne ""} { - set o [lindex $openExprs 0] - set openExprs [lrange $openExprs 1 end] - $o destroy - } - } - - RDFCreator instproc sort {tl} { - # - # this assumes that the triples are created and named in node tree order, e.g. - # through autonames like triple0, triple1, ... (as in rdfTripleCreator) - # - # => bag types defs are before bag's _1, _2 -- etc. - # - # otherwise overload sorting method ! - # - return [lsort $tl] - } - - RDFCreator instproc createFromTriples {tripleList} { - my instvar openExprs - set heading "\n" - set closing "\n" - } - } - } - - if {[set nsPrefix [[self]::ns searchFullName $ns]] == ""} { - [self]::ns add [set nsPrefix [my autoname $prefix]] $ns - append heading "\n xmlns:${nsPrefix}=\"$ns\"" - } - - set oe [lindex [my set openExprs] 0] - - if {$oe eq "" || [$oe subject] != $s} { - if {$oe ne ""} { - append body [$oe closing] - [lindex [set openExprs] 0] destroy - set openExprs [lrange $openExprs 1 end] - } - if {$opening eq ""} { - append body "\n" - set closing "\n" - set type "Description" - } else { - append body $opening - } - set noe [my OpenExpr [my autoname oe]] - set openExprs [concat $noe $openExprs] - - $noe subject $s - $noe closing $closing - $noe type $type - set oe $noe - } - set tn ${nsPrefix}:$name - - switch -exact [$oe type] { - RDFDescription { - #puts DESCRIPTION - append body "\n<$tn> [$t object] " - } - RDFAlt - RDFSeq { - #puts ALT---$tn - if {[regexp {rdf:_([0-9]*)} $tn _ __]} { - append body "\n" - } - } - RDFBag { - if {[regexp {rdf:_([0-9]*)} $tn _ __]} { - append body "\n<$tn resource=\"[$t object]\"/>" - } - } - } - } else { - puts "Predicate '$p' not matched" - # hier als xmlns behandeln ... - } - } - append heading ">" - set r $heading - while {$openExprs ne ""} { - set oe [lindex $openExprs 0] - set openExprs [lrange $openExprs 1 end] - append body [$oe closing] - $oe destroy - } - append r $body - append r "\n" - return $r - } - - namespace export RDFCreator OpenExpr -} - -namespace import ::xotcl::rdf::tripleRecreator::* Index: xotcl/library/rdf/RDFTriple.xotcl =================================================================== diff -u -N --- xotcl/library/rdf/RDFTriple.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/rdf/RDFTriple.xotcl (revision 0) @@ -1,545 +0,0 @@ -# $Id: RDFTriple.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ -package provide xotcl::rdf::triple 1.0 - -package require XOTcl -package require xotcl::rdf::parser - -namespace eval ::xotcl::rdf::triple { - namespace import ::xotcl::* - - Class RDFTriple -parameter { - predicate - subject - object - } - - RDFTriple instproc dump {} { - #set o [my object]; if {[info command $o] ne ""} { $o showVars } - #return "P: [my predicate] S: [my subject] O: [my object]\n" - return "[my subject] -[my predicate]-> '[my object]'\n" - } - - Class NodeInfo -parameter { - lastCurrentNode - {aboutEach 0} - {aboutEachPrefix 0} - topID - {statements ""} - } - - Class DescriptionInfo -superclass NodeInfo -parameter { - {bagID 0} - } - - Class PropertyInfo -superclass NodeInfo -parameter { - {reify 0} - generatedParentID - } - - Class AboutEachMgr - - AboutEachMgr instproc init args { - my array set entries {} - next - } - - AboutEachMgr instproc reset {} { - foreach c [my info children] {$c destroy} - my init - } - - AboutEachMgr instproc addEntry {name} { - my set entries($name) "" - } - - AboutEachMgr instproc isEntry {name} { - my exists entries($name) - } - - AboutEachMgr instproc addTriple {name p s o} { - if {[my exists entries($name)]} { - set r [RDFTriple create [self]::[my autoname name%08d]] - $r set predicate $p - $r set subject $s - $r set object $o - my lappend entries($name) $r - return $r - } - return "" - } - - AboutEachMgr instproc getTriples {name} { - if {[my exists entries($name)]} { - my set entries($name) - } else {return ""} - } - - Class RDFTripleDB - RDFTripleDB instproc add {p s o} { - #my showCall - set r [RDFTriple create [self]::[my autoname triple%08d]] - $r set predicate $p - $r set subject $s - $r set object $o - return $r - } - RDFTripleDB instproc dump {} { - #my showCall - set r "" - foreach fact [my info children] {append r [$fact dump]} - return $r - } - RDFTripleDB instproc getTriples {} { - # for the time being: return only children of type RDFTriple - set ch {} - foreach c [my info children] {if {[$c istype "RDFTriple"]} {lappend ch $c}} - return $ch - #my info children - } - RDFTripleDB instproc reset {} { - #my showCall - foreach c [my info children] {$c destroy} - my autoname -reset triple - #my showMsg "children after reset: <[my info children]>'" - } - # return all triples that match the subject - RDFTripleDB instproc querySubject {s} { - #my showCall - set r "" - foreach t [my info children] { - if {[string match $s [$t subject]]} { - lappend r $t - } - } - return $r - } - - RDFTripleDB instproc queryPredicate {p} { - #my showCall - set r "" - foreach t [my info children] { - if {[string match $p [$t predicate]]} { - lappend r $t - } - } - return $r - } - - RDFTripleDB instproc queryPredicateOnSubject {p s} { - #my showCall - foreach t [my querySubject $s] { - if {[string match $p [$t predicate]]} { - # there may be only one matching P on a S - # return the triple - return $t - } - } - return "" - } - RDFTripleDB instproc prettyTriples {} { - my instvar result - if {[my exists table]} {my unset table} - if {[my exists subjectPrinted]} {my unset subjectPrinted} - set result "" - - foreach triple [lsort [my getTriples]] { - set subject [$triple set subject] - set predicate [$triple set predicate] - set object [$triple set object] - - regexp {^http.*w3[.]org.*(\#.*)$} $predicate _ predicate - regexp {^http.*w3[.]org.*(\#.*)$} $object _ object - my lappend table($subject) $predicate $object - } - foreach subject [lsort [my array names table]] { - if {![regexp {^rdfdoc\#} $subject]} { my prettyStatements "" $subject } - } - set r $result; set result "" - foreach subject [lsort [my array names table]] { - if {![my exists subjectPrinted($subject)]} { - my prettyStatements "" $subject - } - } - if {$result ne ""} { - append r "\n=================== unreferenced:\n$result" - - } - return $r - } - RDFTripleDB instproc prettyStatement {space subject predicate object} { - my append result "$space [format %-35s $subject] [format %-25s $predicate] $object\n" - } - RDFTripleDB instproc prettyStatements {space subject} { - if {![my exists table($subject)]} { - my append result "$space NO VALUE FOR $subject\n" - } else { - if {![my exists subjectPrinted($subject)]} { - my set subjectPrinted($subject) 1 - foreach {predicate object} [my set table($subject)] { - my prettyStatement $space $subject $predicate $object - if {[regexp {^rdfdoc\#} $object]} { - my prettyStatements "$space " $object - } - } - } - } - } - - - Class TripleVisitor -superclass NodeTreeVisitor -parameter { - {descriptionAsBag 0} - {currentNode ""} - parser - rdfNS - } - - TripleVisitor instproc getInfo {} { - my set openNode([my set currentNode]) - } - - TripleVisitor instproc getLastInfo {info} { - my set openNode([$info set lastCurrentNode]) - } - - TripleVisitor instproc popInfo {objName} { - set i [my getInfo] - my set currentNode [$i set lastCurrentNode] - my unset openNode($objName) - return $i - } - - TripleVisitor instproc pushInfo {objName ei} { - set lce [$ei set lastCurrentNode [my set currentNode]] - if {$lce ne ""} { - set lastInfo [my set openNode($lce)] - $ei aboutEach [$lastInfo aboutEach] - $ei aboutEachPrefix [$lastInfo aboutEachPrefix] - } - my set openNode($objName) $ei - my set currentNode $objName - } - - TripleVisitor instproc qualify {obj var} { - [$obj resolveNS] getFullName $var - } - - TripleVisitor instproc init args { - my array set openNode {{} {}} - RDFTripleDB create [self]::db - AboutEachMgr create [self]::aboutEach - AboutEachMgr create [self]::aboutEachPrefix - next - } - - TripleVisitor instproc resetWithoutDB args { - [self]::aboutEach reset - [self]::aboutEachPrefix reset - next - } - - TripleVisitor instproc reset args { - [self]::db reset - my resetWithoutDB - next - } - - TripleVisitor instproc addDB {p s o} { - #puts "ADDDB: P<$p> S<$s> O<$o>" - set info [my getInfo] - if {$info ne ""} { - set topID [$info set topID] - if {[$info aboutEach]} { - return [[self]::aboutEach addTriple $topID $p $s $o] - } elseif {[$info aboutEachPrefix]} { - return [[self]::aboutEachPrefix addTriple $topID $p $s $o] - } - } - return [[self]::db add $p $s $o] - } - - TripleVisitor instproc checkReification {triple node} { - # for statements that nest inside a description/property, we remember - # the statement to be able to reify them - # (e.g., bag created for description) - if {$triple ne "" && $node ne ""} { - set info [my set openNode($node)] - if {[my isobject $info] && [$info istype NodeInfo]} { - ${info} lappend statements $triple - } - } - } - - TripleVisitor instproc qualifyWithBaseURL v { - if {[string match "\#*" $v]} { - return [[my set parser] baseURL]$v - } - return $v - } - - TripleVisitor instproc RDFTag {objName} { - set ns [$objName resolveNS] - set rdfNS [$ns searchNamespaceByPrefix rdf] - if {$rdfNS eq ""} { - set rdfNS [$ns searchNamespaceByPrefix xmlns] - } - my set rdfNS $rdfNS - } - TripleVisitor instproc DescriptionNode objName { - set di [DescriptionInfo create [self]::[my autoname di]] - $di topID [my qualifyWithBaseURL [$objName getSubject]] - my pushInfo $objName $di - # - # if a description nests inside a Member, we need a triple - # for the member index (connected to the Description topId) - # - if {[namespace tail [[set member [$objName info parent]] info class]] \ - == "RDFMember"} { - set bag_ID [[$member info parent] set ID] - my addDB [my qualify $objName [$member set memberIndex]] \ - $bag_ID [$di set topID] - } - } - - TripleVisitor instproc handlePCData {objName pcdata} { - set info [my getInfo] - - if {[set lcn [$info set lastCurrentNode]] == ""} { - #puts stderr "cannot determine lastCurrentNode from $info" - #$info showVars - set selector "" - } else { - set selector [namespace tail [$lcn info class]] - } - - switch -exact $selector { - RDFDescription { - set triple [my addDB \ - [my qualify $objName [$objName set content]] \ - [$info set topID] $pcdata] - my checkReification $triple $lcn - } - RDFProperty { - if {[set rAttr [$lcn getRDFAttribute resource]] != ""} { - set triple [my addDB \ - [my qualify $objName [$objName set content]] \ - [$lcn set $rAttr] $pcdata] - #$lcn showVars - } else { - set lastInfo [my getLastInfo $info] - if {[$lastInfo exists generatedParentID]} { - set parentID [$lastInfo set generatedParentID] - } else { - set parentID [[$objName info parent] set ID] - } - #set parentID [$lastInfo set generatedParentID] - set triple [my addDB \ - [my qualify $objName [$objName set content]] \ - $parentID $pcdata] - } - } - default { - #puts stderr "create a generatedParentID for reification" - $info set generatedParentID [[my set parser] makeID] - set triple [my addDB \ - [my qualify $objName [$objName set content]] \ - [$info set generatedParentID] $pcdata] - my checkReification $triple [my set currentNode] - } - } - $info set tripleWritten 1 - } - - TripleVisitor instproc Property objName { - set info [PropertyInfo create [self]::[my autoname pi]] - ## if we find no subject and are in Container -> - ## reifiy over generatedParentID - set propSubject [$objName getSubject] - - $info topID [my qualifyWithBaseURL $propSubject] - my pushInfo $objName $info - - if {[$objName exists pcdata]} { - my handlePCData $objName [$objName getFirstPCData] - } - } - - TripleVisitor instproc ContainerNode objName { - set ID [my qualifyWithBaseURL [$objName set ID]] - foreach t [$objName array names rdfTypes] { - my addDB [my qualify $objName \ - [$objName qualifyWithRdfNsPrefix type]] $ID $t - } - } - - TripleVisitor instproc Member objName { - set container [$objName info parent] - set resource [$objName qualifyWithRdfNsPrefix resource] - set parseType [$objName qualifyWithRdfNsPrefix parseType] - if {[$objName exists pcdata]} { - set co [$objName getFirstPCData] - } elseif {[$objName exists attributes(resource)]} { - set co [$objName set attributes(resource)] - } elseif {[$objName exists attributes($resource)]} { - set co [$objName set attributes($resource)] - } - #puts stderr "CONTAINER = [info exists co]" - if {[info exists co]} { - my addDB \ - [my qualify $container [$objName set memberIndex]] \ - [$container set ID] $co - } else { - #$objName showVars - } - } - - TripleVisitor instproc visit objName { - set cl [namespace tail [$objName info class]] - $objName instvar attributes - set triple "" - - #puts "********Visit $objName -- $cl" - - switch -exact $cl { - RDFTag {my RDFTag $objName} - RDFDescription {my DescriptionNode $objName} - RDFProperty {my Property $objName} - RDFBag - RDFSeq - RDFAlt {my ContainerNode $objName} - RDFMember {my Member $objName} - } - - foreach a [array names attributes] { - regexp "^([$objName set rdfNSPrefix]:|)(.*)" $a _ __ an - switch -exact $an { - bagID { - set info [my getInfo] - $info set bagID 1 - } - aboutEach { - set info [my getInfo] - if {[DescriptionInfo info instances $info] eq ""} { - error "AboutEach not in description" - } - $info aboutEach 1 - [self]::aboutEach addEntry [my qualifyWithBaseURL [$objName getSubject]] - } - aboutEachPrefix { - set info [my getInfo] - if {[DescriptionInfo info instances $info] eq ""} { - error "AboutEachPrefix not in description" - } - $info aboutEachPrefix 1 - [self]::aboutEachPrefix addEntry [my qualifyWithBaseURL [$objName getSubject]] - } - resource { - if {$cl eq "RDFProperty"} { - my handlePCData $objName [set attributes($a)] - } - } - } - } - } - - TripleVisitor instproc reificate {objName p s o} { - set memberID [[my set parser] makeID] - my addDB [my qualify $objName \ - [$objName qualifyWithRdfNsPrefix predicate]] $memberID $p - my addDB [my qualify $objName \ - [$objName qualifyWithRdfNsPrefix subject]] $memberID $s - my addDB [my qualify $objName \ - [$objName qualifyWithRdfNsPrefix object]] $memberID $o - my addDB [my qualify $objName \ - [$objName qualifyWithRdfNsPrefix type]] $memberID \ - [my qualify $objName [$objName qualifyWithRdfNsPrefix Statement]] - return $memberID - } - - TripleVisitor instproc visitEnd objName { - switch -exact [namespace tail [$objName info class]] { - RDFDescription { - set di [my popInfo $objName] - if {[my descriptionAsBag] || [$di set bagID]} { - set bagID [$objName set bagID] - my addDB [my qualify $objName [$objName qualifyWithRdfNsPrefix type]] \ - $bagID [my qualify $objName [$objName qualifyWithRdfNsPrefix Bag]] - - set bagCount 0 - - foreach s [$di set statements] { - set memberID [my reificate $objName \ - [$s set predicate] [$s set subject] [$s set object]] - my addDB [my qualify $objName \ - [$objName qualifyWithRdfNsPrefix _[incr bagCount]]] \ - $bagID $memberID - } - } - foreach t [$objName array names rdfTypes] { - my addDB [my qualify $objName [$objName qualifyWithRdfNsPrefix "type"]] \ - [$objName getSubject] $t - } - $di destroy - } - RDFProperty { - set info [my popInfo $objName] - if {![$info exists tripleWritten]} { - set triple "" - foreach fc [$objName info children] { - switch -exact [namespace tail [$fc info class]] { - RDFDescription { - set triple [my addDB \ - [my qualify $objName [$objName set content]] \ - [my qualifyWithBaseURL [$objName getSubject]] [$fc getSubject]] - break - } - RDFBag - RDFSeq - RDFAlt { - set triple [my addDB \ - [my qualify $objName [$objName set content]] \ - [my qualifyWithBaseURL [$objName getSubject]] [$fc set ID]] - break - } - } - } - if {$triple ne ""} { - my checkReification $triple [my set currentNode] - } - } - $info destroy - } - } - } - - TripleVisitor instproc evaluateAboutEach {} { - set triplesWritten "" - set rdfNSFullName [[my rdfNS] searchPrefix rdf] - - foreach entry [[self]::aboutEach array names entries] { - # matching entry triples should be bag types and their - # members -> duplication of aboutEach statements for the - # members - foreach entryTriple [lsort [[self]::db querySubject $entry]] { - if {[regexp "^${rdfNSFullName}_\[0-9\]*$" [$entryTriple predicate]]} { - foreach t [[self]::aboutEach getTriples $entry] { - set subject [$t subject] - # if this is a toplevel elt of an about each tree -> its - # subject is the object of the container member - if {$subject eq $entry} { - [self]::db add [$t predicate] [$entryTriple object] [$t object] - } elseif {[lsearch $triplesWritten $t] == -1} { - [self]::db add [$t predicate] $subject [$t object] - lappend triplesWritten $t - } - } - } - } - } - } - - TripleVisitor instproc interpretNodeTree {node} { - my set parser [$node set parser] - $node accept [self] - my evaluateAboutEach - } - - namespace export RDFTriple NodeInfo DescriptionInfo PropertyInfo \ - AboutEachMgr RDFTripleDB TripleVisitor -} -namespace import ::xotcl::rdf::triple::* Index: xotcl/library/rdf/pkgIndex.tcl =================================================================== diff -u -N --- xotcl/library/rdf/pkgIndex.tcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/library/rdf/pkgIndex.tcl (revision 0) @@ -1,14 +0,0 @@ -# Tcl package index file, version 1.1 -# This file is generated by the "pkg_mkIndex -direct" command -# and sourced either when an application starts up or -# by a "package unknown" script. It invokes the -# "package ifneeded" command to set up package-related -# information so that packages will be loaded automatically -# in response to "package require" commands. When this -# script is sourced, the variable $dir must contain the -# full path name of this file's directory. - -package ifneeded xotcl::rdf::parser 1.0 [list source [file join $dir xoRDF.xotcl]] -package ifneeded xotcl::rdf::recreatorVisitor 0.9 [list source [file join $dir rdfRecreatorVisitor.xotcl]] -package ifneeded xotcl::rdf::triple 1.0 [list source [file join $dir RDFTriple.xotcl]] -package ifneeded xotcl::rdf::tripleRecreator 0.9 [list source [file join $dir RDFCreator.xotcl]] Index: xotcl/library/rdf/rdfExample.xotcl =================================================================== diff -u -N --- xotcl/library/rdf/rdfExample.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/library/rdf/rdfExample.xotcl (revision 0) @@ -1,76 +0,0 @@ -#!/usr/bin/env tclsh -# $Id: rdfExample.xotcl,v 1.2 2006/02/18 22:17:33 neumann Exp $ -# -# small Example for usage of xoXML -# -package require XOTcl; namespace import -force xotcl::* -package require xotcl::package -package require xotcl::trace -package require xotcl::rdf::parser -package require xotcl::rdf::recreatorVisitor -package require xotcl::xml::printVisitor - -# -# instantiate parser and parser an example text into a node tree -# -RDFParser x -x parse { - - - - - Mary Andrew - Jacky Crystal - - - - - - - - - - - - - The Coolest Web Page - Il Pagio di Web Fuba - - - - - some text - - - - -} - -proc run {} { - # - # print the node treee to the std output - # - puts ************************************************************************ - puts "Node Tree:" - puts ************************************************************************ - PrintVisitor pv - foreach tn [x info children topNode*] { - pv interpretNodeTree $tn - } - - # - # recreate xml text and print it to the std output - # - puts \n - puts ************************************************************************ - puts "Recreated RDF Text:" - puts ************************************************************************ - RDFRecreatorVisitor rv - foreach tn [x info children topNode*] { - set result [rv interpretNodeTree $tn] - puts $result - } -} -run Index: xotcl/library/rdf/rdfRecreatorVisitor.xotcl =================================================================== diff -u -N --- xotcl/library/rdf/rdfRecreatorVisitor.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/rdf/rdfRecreatorVisitor.xotcl (revision 0) @@ -1,45 +0,0 @@ -#$Id: rdfRecreatorVisitor.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::rdf::recreatorVisitor 0.9 -package require xotcl::rdf::parser -package require xotcl::xml::recreatorVisitor -package require XOTcl - -namespace eval ::xotcl::rdf::recreatorVisitor { - namespace import ::xotcl::* - - ############################################################################## - # - # a visitor that recreates an RDF representation from a - # node tree - # - ############################################################################# - Class RDFRecreatorVisitor -superclass XMLRecreatorVisitor - - RDFRecreatorVisitor instproc appendLineFeed obj { - if {[set parseType [$obj getRDFAttribute parseType]] != ""} { - if {$parseType ne "Resource"} { - # we have parseType == Literal - # -> don't append "\n" - return "" - } - } - return "\n" - } - - RDFRecreatorVisitor instproc visit objName { - next - my instvar result - if {[$objName istype RDFResource]} { - foreach t [$objName array names rdfTypes] { - set ts [$objName prependRDFPrefix type] - append result " [my insertIndent $objName]<$ts resource=\"$t\"/>\n" - } - } - return $result - } - - namespace export RDFRecreatorVisitor -} - -namespace import ::xotcl::rdf::recreatorVisitor::* Index: xotcl/library/rdf/xoRDF.xotcl =================================================================== diff -u -N --- xotcl/library/rdf/xoRDF.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/rdf/xoRDF.xotcl (revision 0) @@ -1,777 +0,0 @@ -# $Id: xoRDF.xotcl,v 1.4 2005/09/09 21:09:01 neumann Exp $ -package provide xotcl::rdf::parser 1.0 - -package require XOTcl -package require xotcl::xml::parser -#package require xotcl::pattern::link -package require xotcl::trace - -namespace eval ::xotcl::rdf::parser { - namespace import ::xotcl::* - - ############################################################################## - # - # RDF Parse Type Handling for RDF Node Class and RDF Parser class - # to be used as mixin. Here, we have decomposed the parse type handling - # - ############################################################################## - - # - # Nodes just call "isParseLiteral", "isParseResource", and "handleParseType" - # by their template methods -> mixins concretizes implementation - # - Class RDFNodeParseTypeHandling - - # - # parseType=literal nodes are not parsed, but handled as literals - # -> the XML parser should parse these nodes -> we have cut them off - # if we encounter "parseType = literal" nextParsedLiterals searches the - # parseLiterals array and returns the content - # - RDFNodeParseTypeHandling instproc nextParsedLiterals {} { - set parser [my set parser] - $parser set parseLiterals([$parser incr parseLiteralsCount]) - } - - # - # handle attributes that determine the parse type - # - RDFNodeParseTypeHandling instproc handleParseType value { - if {$value eq "Resource"} { - my set parseResource 1 - } else { - # with RDF 1.0 all values other than Resource are treated - # as parseType = literal - my set pcdata [list "" [my nextParsedLiterals]] - my set parseLiteral 1 - } - } - - # - # two convinience methods that tell us whether the parse type is literal/resource - # - RDFNodeParseTypeHandling instproc isParseLiteral {} { - # - # if the parse literal var is set -> one child - # is of type ParseTypeLiteral ! - # - my exists parseLiteral - } - RDFNodeParseTypeHandling instproc isParseResource {} { - # - # if the parseResource var is set -> one child - # is of type ParseTypeResource ! - # - my exists parseResource - } - - # - # and we overload the Parser's parse method in order to cut off - # all parseType = "Literal", because we have to hinder the XML - # parser to parse RDF text that is marked as parseType = literal - # we store the result in an array "parseLiterals" that is used - # by the RDFNodeParseTypeHandling Mixin - # - Class RDFParserParseTypeHandling - RDFParserParseTypeHandling instproc parse data { - my array set parseLiterals {} - my set parseLiteralsCount 0 - set count 0 - - set dt $data - - while {[set pt [string first "parseType" $dt]] != -1} { - # we cut the string off manually, because a regexp is slower - if {$::tcl_version > 8.0} { - set last [string first "=" $dt $pt] - } else { - set last [string first "=" [string range $dt $pt end]] - incr last $pt - } - set ptStart [expr {[string last "<" [string range $dt 0 $pt]] + 1}] - set propName [string range $dt $ptStart $pt] - set blank [string first " " $propName] - if {$blank != -1} { - set propName [string range $propName 0 [expr {$blank -1}]] - } - set dt [string range $dt $last end] - # All parse types != Resource treated as literals - if {![regexp {^= *[\"']Resource} $dt]} { - regexp -indices ">" $dt idx - set start [lindex $idx 1] - if {[regexp -indices "" $dt idx]} { - set endTagLeft [lindex $idx 0] - set literal [string range $dt [expr {$start + 1}] [expr {$endTagLeft - 1}]] - set dt [string range $dt $endTagLeft end] - my set parseLiterals([incr count]) $literal - } else { - error "end tag for $propName missing" - } - } - } - next $data - } - - ############################################################################## - # - # RDFNode Node Class - # - ############################################################################## - - Class RDFNode -superclass XMLNode -parameter { - subject - {rdfNSPrefix ""} - } - @ Class RDFNode -superclass XMLNode { - description { - general superclass for RDF nodes - common properties - } - } - - # - # add mixins for parse type handling - # - RDFNode instproc init args { - next - my mixin add RDFNodeParseTypeHandling - set p [my info parent] - if {[$p exists rdfNSPrefix]} { - my set rdfNSPrefix [$p set rdfNSPrefix] - #puts stderr "RDF Prefix defined in [self]->init to [$p set rdfNSPrefix]" - } - } - - RDFNode instproc parseData {text} { - if {[my isParseLiteral]} {return} - next - } - - # - # try to find the "subject" of the RDF statement -> - # if it not found on the actual node search the parents - # - # per default subject is ""; subclasses add subjects, - # when they encounter ID, about, ... attrs - # - RDFNode instproc getSubject {} { - for {set o [self]} {![$o istype RDFTag]} {set o [$o info parent]} { - if {[$o exists subject]} {return [$o set subject]} - } - return "" - } - - - # - # lets the parser construct an unique ID in the parser - # - RDFNode instproc makeID {} { - [my set parser] makeID - } - - # - # abstract methods that have to be concretized with parse type handling - # by a parse type mixin (or in subclass) - # - RDFNode abstract instproc isParseLiteral {} - RDFNode abstract instproc isParseResource {} - RDFNode abstract instproc handleParseType value - - RDFNode instproc appendRDFType t { - set t [[my resolveNS] getFullName $t] - my set rdfTypes($t) 1 - } - - # - # get a typed node abbreviation -> convert it to - # a description + a nested rdf:type property - # - RDFNode instproc getTypedNode {name attrList} { - set r [my getNestingNode RDFDescription \ - [my qualifyWithRdfNsPrefix Description] $attrList] - $r appendRDFType $name - set r - } - - # - # try to parse children corresponding to parse type or if none is given - # try to parse a child of type obj -> Description or Container - # - RDFNode instproc parseNestedChild {name attrList} { - if {[my isParseResource]} { - if {![my exists resourceDescription]} { - my set resourceDescription \ - [my getNestingNode RDFDescription \ - [my qualifyWithRdfNsPrefix Description] {}] - # we have resolved parseType="resource" with a description - # -> remove parse type attribute info ... it is not correct anymore, - # but remember parseResource flag - if {[my exists attributes(parseType)]} { - my unset attributes(parseType) - } - if {[my exists attributes([set parseType [my qualifyWithRdfNsPrefix parseType]])]} { - my unset attributes($parseType) - } - } - - set r [[my set resourceDescription] getPropertyNodeChild $name $attrList] - } elseif {[my isParseLiteral]} { - set r [self] - # literal -> do nothing - } else { - if {[set node [my isNestingNode $name]] ne ""} { - set r [my getNestingNode $node $name $attrList] - } else { - set r [my getTypedNode $name $attrList] - } - } - return $r - } - - # - # step forward in the attrList - # - RDFNode instproc nextAttrNode {node attrList index} { - upvar [self callinglevel] $index i $attrList a - if {$node ne ""} { - set a [lreplace $a $i [expr {$i + 1}]] - } else { - incr i 2 - } - } - - # - # create a child node of Property type and return it - # - # don't build a node for "type" properties, but append them to - # the list - # - RDFNode instproc getPropertyNodeChild {name attrList} { - regexp "^[my set rdfNSPrefix]:(.*)" $name _ name - set parser [my set parser] - if {$name eq "type" && [my istype RDFResource]} { - # seek for resource attribute and append type to list - set rp [my prependRDFPrefix resource] - set rdfns [$parser set rdfNamespace] - foreach {n v} $attrList { - if {![my istype RDFContainerNodeClass]} { - if {$n eq $rp || $n eq "resource"} { - foreach c {Bag Alt Seq} { - if {$v eq "$rdfns$c"} { - my class RDF$c - my set memberNr 0 - my set ID [my set bagID] - my unset bagID - my set content [my prependRDFPrefix $c] - # reclass existing li props to member - set li [my prependRDFPrefix li] - foreach child [lsort [my info children]] { - if {[namespace tail [$child info class]] eq "RDFProperty"} { - if {[$child set content] eq $li || - [$child set content] eq "li"} { - $child class RDFMember - my giveMemberNr $child - $child set content $li - } - } - } - } - } - } - } - my appendRDFType $v - } - return [self] - } else { - set nf [$parser set nodeFactory] - set r [$nf getNode RDFProperty [self]::[my nextChild prop] $parser] - $r set content $name - $r parseAttributes $name $attrList - set r - } - } - - # - # property in abbr syntax (as attribute) - # - RDFNode instproc propertyAttribute {n v} { - set r [my getPropertyNodeChild $n ""] - $r parseData $v - set r - } - - # - # check whether an attribute name matches an attributed RDFNode - # of this class or not - # return the corresponding node class - # - RDFNode instproc isAttribute {n} { - regexp "^[my set rdfNSPrefix]:(.*)" $n _ n - if {[lsearch [[my info class] set attributeList] $n] != -1} { - return $n - } elseif {$n eq "xml:lang"} { - # we create attribute for xml_lang (for recreation purposes) - return $n - } - return "" - } - - # - # check if name matches an node class that may be nested in [self] - # - RDFNode instproc isNestingNode {n} { - regexp "^[my set rdfNSPrefix]:(.*)" $n _ n - set cl [my info class] - if {[$cl exists nestingList($n)]} { - return [$cl set nestingList($n)] - } - return "" - } - - RDFNode instproc getNestingNode {node name attrList} { - set parser [my set parser] - set nf [$parser set nodeFactory] - switch [namespace tail $node] { - "RDFMember" - "RDFProperty" {set objName prop} - default {set objName res} - } - set r [$nf getNode $node [self]::[my nextChild $objName] $parser] - $r set content $name - $r parseAttributes $name $attrList - set r - } - - # - # check whether the RDF namespace is redefined to another prefix - # - RDFNode instproc makeIndividualNSEntry {prefix entry} { - if {$entry eq [[my set parser] rdfNamespace]} { - if {[my set rdfNSPrefix] eq "" || $prefix ne "xmlns"} { - my set rdfNSPrefix $prefix - } - #puts stderr "RDF Prefix redefined in [self] to $prefix" - } - next - } - - RDFNode instproc qualifyWithRdfNsPrefix t { - set ns [my set rdfNSPrefix] - if {$ns eq "xmlns"} {return $t} - return $ns:$t - } - - # - # checks whether a given attribute is part of the attributes array - # and returns the varname, otherwise "" - # - RDFNode instproc getAttribute {n nsFullName} { - set ns [my resolveNS] - set xmlns [$ns searchPrefix xmlns] - if {$xmlns eq $nsFullName && [my exists attributes($n)]} { - return attributes($n) - } - set prefix [$ns searchFullName $nsFullName] - if {$prefix ne "" && - [my exists attributes($prefix:$n)]} { - return attributes($prefix:$n) - } - return "" - } - - # - # searches for attribute "n" with rdf namespace prefix - # - RDFNode instproc getRDFAttribute {n} { - if {[my exists attributes($n)]} { - return [my set attributes($n)] - } - set rdfNSPrefix [my set rdfNSPrefix] - if {$rdfNSPrefix ne "xmlns"} { - set n $rdfNSPrefix:$n - if {[my exists attributes($n)]} { - return [my set attributes($n)] - } - } - return "" - } - - RDFNode instproc prependRDFPrefix ts { - set rdfNSPrefix [my set rdfNSPrefix] - if {$rdfNSPrefix ne "xmlns"} {set ts $rdfNSPrefix:$ts} - return $ts - } - - ############################################################################## - # - # superclass for all resources (like Description, Alt, Seq, Beg) - # used directly in the parse tree ... resource nodes are mixed in - # - ############################################################################## - - Class RDFResource -superclass RDFNode - - RDFResource instproc print {} { - set t [my array names rdfTypes] - if {$t eq ""} {return [next]} else {return "[next]\nTYPES: $t"} - } - - - ############################################################################## - # - # superclasses for container node classes (alt seq bag) - # - ############################################################################## - Class RDFContainerNodeClass -superclass RDFResource - - RDFContainerNodeClass instproc init args { - # cache the member number - # 0 inidicates, there is currently no member - next - - my set memberNr 0 - my set ID [my makeID] - my appendRDFType [my qualifyWithRdfNsPrefix \ - [[my info class] set content]] - } - - RDFContainerNodeClass instproc parseAttributes {name attrList} { - #set index 0 - foreach {n v} $attrList { - if {[set an [my isAttribute $n]] ne ""} { - my set attributes($n) $v - if {$an eq "ID"} { - my set subject $v - my set ID [[my set parser] set baseURL]\#$v - } - } - #set attrList [my nextAttrNode $an attrList index] - } - } - - RDFContainerNodeClass instproc giveMemberNr {member} { - set pf [my getContentPrefix] - if {$pf ne ""} {append pf ":"} - $member set memberIndex "${pf}_[my incr memberNr]" - } - - RDFContainerNodeClass instproc parseStart {name attrList} { - set r [self] - next - if {[set node [my isNestingNode $name]] ne ""} { - set r [my getNestingNode $node $name $attrList] - if {[namespace tail [$r info class]] eq "RDFMember"} { - my giveMemberNr $r - } - } else { - set r [my getPropertyNodeChild $name $attrList] - } - return $r - } - - ############################################################################## - # - # Concrete Factory for creating RDF-style nodes - # - ############################################################################## - Class RDFNodeClassFactory -superclass XMLNodeClassFactory - RDFNodeClassFactory instproc content content { - my set content $content - } - RDFNodeClassFactory instproc attributeList attributeList { - my set attributeList $attributeList - } - RDFNodeClassFactory instproc nestingTo nestingTo { - set name [string trimleft [self] :] - foreach cl $nestingTo { - $cl set nestingList([my set content]) $name - } - } - - RDFNodeClassFactory proc create args { - # create the class - set name [next] - switch -exact $name { - RDFDescription - RDFProperty - RDFMember { - my array set attributeList {} - } - RDFMember - RDFProperty { - my array set nestingList {} - } - } - } - ########################################################################## - # - # now create a factory and build all the node classes - # needed for the RDF Parser/Interpreter - # - ########################################################################## - RDFNodeClassFactory proc createFactories {} { - foreach {name superclasses content attributeList} { - RDFTag RDFNode RDF {} - RDFBag RDFContainerNodeClass Bag {ID} - RDFSeq RDFContainerNodeClass Seq {ID} - RDFAlt RDFContainerNodeClass Alt {ID} - RDFProperty RDFNode "" {bagID ID resource parseType} - RDFMember RDFProperty li {resource parseType} - RDFDescription RDFResource Description {ID bagID about type aboutEach aboutEachPrefix} - } { - #puts "Create class: $name -superclass $superclasses" - RDFNodeClassFactory create $name -superclass $superclasses \ - -content $content \ - -attributeList $attributeList - } - } - RDFNodeClassFactory createFactories - - # - # define nesting constraints - # - RDFTag nestingTo {} - RDFBag nestingTo {RDFTag RDFProperty} - RDFSeq nestingTo {RDFTag RDFProperty} - RDFAlt nestingTo {RDFTag RDFProperty} - RDFMember nestingTo {RDFContainerNodeClass RDFBag RDFSeq RDFAlt} - RDFProperty nestingTo {} - RDFDescription nestingTo {RDFTag RDFMember RDFProperty} - - ############################################################################## - # - # add some methods to the property node class - # - ############################################################################## - - RDFProperty instproc parseAttributes {name attrList} { - set r [self] - #set index 0 - foreach {n v} $attrList { - if {[my checkForXmlNS $n $v]} {continue} - if {[set an [my isAttribute $n]] ne ""} { - my set attributes($n) $v - if {$an eq "parseType"} {my handleParseType $v} - } else { - if {![info exists abbrvPropResource]} { - set abbrvPropResource \ - [my getNestingNode RDFDescription \ - [my qualifyWithRdfNsPrefix Description] {}] - } - $abbrvPropResource propertyAttribute $n $v - } - #set attrList [my nextAttrNode $an attrList index] - } - - if {[info exists abbrvPropResource]} { - # if resource attribute is given -> use it for abbr property - # description as about attr - if {[my exists attributes(resource)]} { - set about [my set attributes(resource)] - my unset attributes(resource) - } - if {[my exists attributes([set resource [my qualifyWithRdfNsPrefix resource]])]} { - set about [my set attributes($resource)] - my unset attributes($resource) - } - if {[info exists about]} { - $abbrvPropResource set attributes(about) $about - $abbrvPropResource set subject $about - } - } - } - RDFProperty instproc parseStart {name attrList} { - if {[my isParseLiteral]} {return [self]} - next - return [my parseNestedChild $name $attrList] - } - - ############################################################################## - # - # add methods to the member class - # - ############################################################################## - - RDFMember parameter { - memberIndex - } - - RDFMember instproc parseAttributes {name attrList} { - #set index 0 - foreach {n v} $attrList { - if {[set an [my isAttribute $n]] ne ""} { - my set attributes($n) $v - if {$an eq "parseType"} {my handleParseType $v} - } - #set attrList [my nextAttrNode $an attrList index] - } - } - - RDFMember instproc print {} { - return "[next]\nMEMBER-INDEX: [my set memberIndex]" - } - - ############################################################################## - # - # add methods to the description node class - # - ############################################################################## - - RDFDescription instproc init {args} { - next - set ID [my makeID] - my set subject $ID - my set bagID $ID - } - - RDFDescription instproc parseAttributes {name attrList} { - set r [self] - - # if the parent is a property with an ID -> use it - # as description subject - set ID [my qualifyWithRdfNsPrefix ID] - set parent [my info parent] - if {[$parent exists attributes(ID)]} { - my set subject [$parent set attributes(ID)] - } elseif {[$parent exists attributes($ID)]} { - my set subject [$parent set attributes($ID)] - } - - foreach {n v} $attrList { - if {[my checkForXmlNS $n $v]} {continue} - if {[set an [my isAttribute $n]] ne ""} { - my set attributes($n) $v - switch -exact $an { - about - - ID - - aboutEach - - aboutEachPrefix { - my set subject $v - } - bagID { - my set bagID [[my set parser] set baseURL]\#$v - } - type { - my appendRDFType $v - } - } - } else { - set r [my propertyAttribute $n $v] - } - } - return $r - } - - RDFDescription instproc parseStart {name attrList} { - next - return [my getPropertyNodeChild $name $attrList] - } - - ############################################################################## - # - # add some methods to the node class - # - ############################################################################## - - RDFTag parameter {{startTagOn 0}} - - RDFTag instproc match {c} { - # the prefix of the topnode determines initially how the RDF - # namespace is named ... since several examples don't have a - # namespace definition for this ns, we set here a default, which - # may be overridden by ns definitions in the XML text - if {[regexp {^([^:]*):(.*)} $c _ pre c]} { - my makeIndividualNSEntry $pre [[my set parser] rdfNamespace] - #puts stderr "Making RDF namespace entry for <$pre>" - } - #puts "Match for $c --- Content: [[my info class] set content]" - expr {$c eq [[my info class] set content]} - } - - RDFTag instproc parseStart {name attrList} { - set parsed 0 - if {[set node [my isNestingNode $name]] ne ""} { - set r [my getNestingNode $node $name $attrList] - } else { - set r [my getTypedNode $name $attrList] - } - next - return $r - } - - RDFTag instproc parseEnd content { - if {!([my startTagOn] && [my match $content])} { - [my errorChild $content] - } - next - self ;# return [self] - } - - ############################################################################## - # - # RDF Factory for creating node objects - # - ############################################################################## - Class RDFNodeFactory -superclass XMLNodeFactory - RDFNodeFactory create rdfNodeFactory -sharedNodes {RDFDescription RDFTag} - - - ############################################################################## - # - # RDF parser class used to access the xml parser and produce the - # rdf node tree - # - ############################################################################## - Class RDFParser -superclass XMLParser -parameter { - {baseURL "rdfdoc"} - {rdfNamespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#"} - } - - RDFParser instproc init args { - my mixin add RDFParserParseTypeHandling - - ### this special parser handles rdf:RDF tags - my topLevelHandlerPattern {^([^:]*):RDF|RDF} RDFTag - - next - my set nodeFactory "rdfNodeFactory" - } - - RDFParser instproc makeID {} { - my autoname [my baseURL]\#id - } - - RDFParser instproc reset {} { - next - set id [my baseURL]\#id - my autoname -reset $id - } - - RDFParser instproc createTopLevelNode {name attrList} { - set tn [next] - #$tn makeIndividualNSEntry xmlns [my set rdfNamespace] - ### toplevel node must be of type RDFTag - if {![$tn istype RDFTag]} { - error "Top level node must be of type RDFTag" - } - if {[$tn match $name]} { - $tn set content $name - $tn startTagOn 1 - - ### use default values for rdf/default (xmlns) namespace - #my makeIndividualNSEntry rdfs "http://www.w3.org/TR/1999/PR-rdf-schema-19990303#" - - foreach {n v} $attrList { - if {[$tn checkForXmlNS $n $v]} {continue} - } - } - return $tn - } - - #RDFParser instproc parse data { - # next - #} - - namespace export RDFNodeParseTypeHandling RDFParserParseTypeHandling \ - RDFNode RDFResource RDFContainerNodeClass RDFNodeClassFactory \ - RDFNodeFactory RDFParser rdfNodeFactory \ - RDFTag RDFBag RDFSeq RDFAlt RDFProperty RDFMember RDFDescription -} - -namespace import ::xotcl::rdf::parser::* Index: xotcl/library/registry/COPYRIGHT =================================================================== diff -u -N --- xotcl/library/registry/COPYRIGHT (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/registry/COPYRIGHT (revision 0) @@ -1,41 +0,0 @@ - * XOTcl - Extended OTcl - * - * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) - * - * (a) Vienna University of Economics and Business Administration - * Dept. of Information Systems / New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - Index: xotcl/library/registry/Registry.xotcl =================================================================== diff -u -N --- xotcl/library/registry/Registry.xotcl (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) +++ xotcl/library/registry/Registry.xotcl (revision 0) @@ -1,73 +0,0 @@ -package provide xotcl::registry::registry 0.8 - -package require xotcl::trace -package require xotcl::rdf::triple -package require xotcl::rdf::tripleRecreator -package require xotcl::actiweb::agent -package require XOTcl - -namespace eval ::xotcl::registry::registry { - namespace import ::xotcl::* - - Class Registry -superclass Agent - - Registry instproc init args { - next - my exportProcs register query queryProperty - RDFParser [self]::parser - TripleVisitor [self]::tripleVisitor -parser [self]::parser - [self]::tripleVisitor descriptionAsBag 0 - my array set services {} - } - - Registry instproc register {rdfScript} { - #my showCall - [[self]::tripleVisitor set parser] parse $rdfScript - [self]::tripleVisitor interpretNodeTree [self]::parser::topNode - [self]::tripleVisitor resetWithoutDB - foreach serviceTriple [[self]::tripleVisitor::db queryPredicate \ - "http://nestroy.wi-inf.uni-essen.de/schema/service#name"] { - set service [$serviceTriple object] - if {[info exists services($service)]} { - puts stderr "we have already such a service '$service'" - # hier koennte man ueberlegen, den service zu loeschen oder nicht - # zZT: loesche altes service - } - puts stderr "REGISTRY: registering $service with [$serviceTriple subject]" - my set services($service) [$serviceTriple subject]; - } - } - - Registry instproc query {service} { - my showCall - if {[info exists services($service)]} { - set s [my set services($service)] - return [[Place getInstance]::rdfCreator createFromTriples [[self]::tripleVisitor::db querySubject $s]] - } - } - - Registry instproc queryProperty {args} { - # returns first service with matching properties - my showCall - foreach s [my array names services] { - set success 1 - foreach {att value} $args { - set t [[self]::tripleVisitor::db queryPredicateOnSubject $att [my set services($s)]] - if {$t eq "" || [$t object] != $value} { - set success 0 - break - } - } - if {$success} { - set r [my query $s] - return $r - } else { - return "" - } - } - } - - namespace export Registry -} - -namespace import ::xotcl::registry::registry::* Index: xotcl/library/registry/pkgIndex.tcl =================================================================== diff -u -N --- xotcl/library/registry/pkgIndex.tcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/registry/pkgIndex.tcl (revision 0) @@ -1,11 +0,0 @@ -# Tcl package index file, version 1.1 -# This file is generated by the "pkg_mkIndex -direct" command -# and sourced either when an application starts up or -# by a "package unknown" script. It invokes the -# "package ifneeded" command to set up package-related -# information so that packages will be loaded automatically -# in response to "package require" commands. When this -# script is sourced, the variable $dir must contain the -# full path name of this file's directory. - -package ifneeded xotcl::registry::registry 0.8 [list source [file join $dir Registry.xotcl]] Index: xotcl/library/serialize/COPYRIGHT =================================================================== diff -u -N --- xotcl/library/serialize/COPYRIGHT (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/serialize/COPYRIGHT (revision 0) @@ -1,41 +0,0 @@ - * XOTcl - Extended OTcl - * - * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) - * - * (a) Vienna University of Economics and Business Administration - * Dept. of Information Systems / New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - Index: xotcl/library/serialize/RecoveryPoint.xotcl =================================================================== diff -u -N --- xotcl/library/serialize/RecoveryPoint.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/library/serialize/RecoveryPoint.xotcl (revision 0) @@ -1,441 +0,0 @@ -# $Id: RecoveryPoint.xotcl,v 1.4 2006/02/18 22:17:33 neumann Exp $ - -package provide xotcl::scriptCreation::recoveryPoint 0.8 -package require XOTcl - -namespace eval ::xotcl::scriptCreation::recoveryPoint { - namespace import ::xotcl::* - - ## fehlt noch: filter, mixins, metadata, ass, assoption, etc - ## beim recover Class's,Object's proc instproc vars nicht ueberschreiben - ## filter dann anhaengen etc ... - ## der Recovery Filter darf durch Object filter "" nicht gelöscht werden - - # - # filter to ensure that recovering doesn't overwrite - # existing objs/classes - # - - Object instproc recoveryFilter args { - ::set method [self calledproc] - - switch -- $method { - create { - # don't overwrite objects - if {![::Object isobject [lindex $args 0]]} { - next - } else { - # puts stderr "Recovery Filter: omitting [lindex $args 0]" - } - } - proc { - if {[lsearch [my info procs] [lindex $args 0]] == -1} { - next - } else { - # puts stderr "Recovery Filter: omitting proc [self]::[lindex $args 0]" - } - } - instproc { - if {[lsearch [my info instprocs] [lindex $args 0]] == -1} { - next - } else { - # puts stderr "Recovery Filter: omitting instproc [self]::[lindex $args 0]" - } - } - set { - if {[lsearch [my info vars] [lindex $args 0]] == -1} { - next - } else { - # puts stderr "Recovery Filter: omitting var [self]::[lindex $args 0]" - } - } - default {next} - } - } - - # - # remove filter from object - # - Object instproc filterremove f { - ::set fl [my info filter] - puts stderr "filterremove on [self] with $f; fullName: [my filtersearch $f]" - while {[::set index [lsearch $fl [my filtersearch $f]]] != -1} { - ::set fl [lreplace $fl $index $index] - } - my filter $fl - } - - # - # remove mixin from object - # - Object instproc mixinremove m { - puts stderr "mixinremove on [self] with $m" - ::set ml [my info mixins] - while {[::set index [lsearch $ml $m]] != -1} { - ::set ml [lreplace $ml $index $index] - } - my mixin $ml - } - - Class RecoveryPoint \ - -parameter { - {appendedObjs ""} - {appendedCls ""} - {appendedNamespaces ""} - {withState 0} - {appendToFile 0} - {definedObjs [list Object \ - Class \ - Class::Parameter]} - {excludeNames ""} - } - - # - # queries the definedObjs variable whether a given object - # is already defined/predefined or not - # -> a way to exclude classes/objs from saving - # - RecoveryPoint instproc isDefined {n} { - my instvar definedObjs - puts stderr "Checking Defined: $n in $definedObjs" - if {[lsearch $definedObjs [string trimleft $n :]] == -1} { - return 0 - } else { - return 1 - } - } - - RecoveryPoint instproc appendDefined {n} { - my instvar definedObjs - lappend definedObjs [string trimleft $n :] - } - - # - # check whether an obj/cls/namespace is appended already - # append obj/cls/namespace - # - foreach method {Obj Cl Namespace} { - set r { - my instvar {appended${method}s name}} - set r [subst -nocommands -nobackslash $r] - - set s $r - append s { - if {[lsearch $name [string trimleft $n :]] == -1} { - return 0 - } else { - return 1 - } - } - - RecoveryPoint instproc isAppended$method {n} $s - - append r { - lappend name [string trimleft $n :] - } - RecoveryPoint instproc append$method {n} $r - } - - - # - # compare command for lsort - # - RecoveryPoint instproc namespaceDepth {a b} { - set aCount 0 - set bCount 0 - for {set i 0} {$i < [string length $a]} {incr i} { - if {[string index $a $i] eq ":"} { - incr aCount - } - } - for {set i 0} {$i < [string length $b]} {incr i} { - if {[string index $b $i] eq ":"} { - incr bCount - } - } - if {$aCount == $bCount} { - return 0 - } elseif {$aCount > $bCount} { - return 1 - } - - return -1 - } - - # - # produces a script containing the current state of - # the given obj - # - RecoveryPoint instproc stateScript {obj} { - set script "" - foreach v [$obj info vars] { - if {[lsearch [my set excludeNames] $v] == -1} { - $obj instvar $v - if {[array exists $v]} { - foreach name [array names $v] { - set arr ${v}($name) - set value [$obj set $arr] - append script "$obj set $arr \"$value\"\n" - } - } else { - set value [set $v] - append script "$obj set $v \"$value\"\n" - } - } - } - return $script - } - - # - # produces a script containing the procs of the given obj - # - RecoveryPoint instproc procScript {obj} { - set script "" - foreach p [$obj info procs] { - if {[lsearch [my set excludeNames] $v] == -1} { - append script \ - "$obj proc $p \{[$obj info args $p]\} \{[$obj info body $p]\}\n" - } - } - return $script - } - - # - # produces a script containing the instprocs of the given class - # - RecoveryPoint instproc instprocScript {cl} { - set script "" - foreach p [$cl info instprocs] { - if {[lsearch [my set excludeNames] $v] == -1} { - append script \ - "$cl instproc $p \{[$cl info instargs $p]\} \{[$cl info instbody $p]\}\n" - } - } - return $script - } - - # - # append parent obj/classes/namespaces of an object completly - # - - RecoveryPoint instproc appendParents {name} { - # puts stderr "Recovery -- appendParents $name " - set p "" - set script "" - - set n $name - while {[set np [namespace parent ::$n]] != "::"} { - lappend p $np - set n $np - } - set p [lsort -command {[self] namespaceDepth} $p] - - foreach n $p { - if {[Object isobject $n]} { - if {[$n isclass]} { - append script [my classScript $n] - } else { - append script [my objectScript $n] - } - } else { - if {![my isAppendedNamespace $n]} { - append script "namespace eval $n \{\}\n" - # puts stderr "Recovery -- Appending Namespace: $n" - my appendedNamespace $n - } - } - } - return $script - } - - - # - # produces a script recovering the given obj with all children - # without state - # - RecoveryPoint instproc objectScript {obj} { - # puts stderr "Recovery -- Object Script $obj" - my instvar withState - set script "" - if {![my isDefined $obj] && - ![my isAppendedObj $obj]} { - # if the object's class is not yet appended => do it now - set objClass [$obj info class] - append script [my classScript $objClass] - - # append all parent namespaces - append script [my appendParents $obj] - - # append the obj - append script "$objClass $obj\n" - append script [my procScript $obj] - if {$withState == 1} { - append script [my stateScript $obj] - } - # puts stderr "Recovery -- Appending Object: $obj" - my appendObj $obj - - # append its children - foreach o [$obj info children] { - append script [my objectScript $o] - } - } - return $script - } - - # - # produces a script recovering the given class with all children - # without state - # - RecoveryPoint instproc classScript {cl} { - # puts stderr "Recovery -- Class Script $cl" - my instvar withState - set script "" - if {![my isDefined $cl] && - ![my isAppendedCl $cl]} { - # if the class's meta-class is not yet appended => do it now - set metaClass [$cl info class] - append script [my classScript $metaClass] - - # append all parent namespaces - append script [my appendParents $cl] - - # append the class - append script "$metaClass $cl" - - set sl [$cl info superclass] - if {$sl ne ""} { - append script " -superclass \{$sl\}\n" - } else { - append script "\n" - } - - append script [my instprocScript $cl] - append script [my procScript $cl] - - if {$withState == 1} { - append script [my stateScript $cl] - } - - # puts stderr "Recovery -- Appending Class: $cl \n $script" - my appendCl $cl - - # append children - set children [$cl info children] - set classChildren [$cl info classchildren] - - foreach c $children { - if {[lsearch $classChildren $c] != -1} { - append script [my classScript $c] - } else { - append script [my objectScript $c] - } - } - } - return $script - } - - # - # produces a script recovering the given class and all subclasses - # with all their children and all instances - # - # - RecoveryPoint instproc hierarchyScript {cl} { - set script [my classScript $cl] - set sortedInstances \ - [lsort -command {[self] namespaceDepth} [$cl info instances]] - - foreach o $sortedInstances { - append script [my objectScript $o] - } - - foreach c [$cl info subclass] { - append script [my hierarchyScript $c] - } - - return $script - } - - # - # saves a script to a file - # - RecoveryPoint instproc saveScript {filename script} { - my instvar appendToFile - if {$appendToFile} { - set mode a - } else { - set mode w - } - set f [open $filename $mode] - puts $f $script - close $f - } - - # - # load a script from a file - # - RecoveryPoint instproc loadScript {filename} { - set f [open $filename r] - set r [read $f] - close $f - return $r - } - - # - # produce methods to save/recover an object script to/from a file - # with/without state/only state - # - - foreach method { - Object ObjectState ObjectWithState Class ClassWithState \ - Hierarchy HierarchyWithState - } { - set s { - my set withState - } - - if {[regexp {(.*)WithState} $method _ m]} { - set call $m - append s "1" - } else { - set call $method - append s "0" - } - - scan $call %c l - set ::low "[format %c [expr {$l + 32}]][string range $call 1 end]" - - append s { - my appendedObjs "" - my appendedCls "" - my appendedNamespaces "" - } - append s " - foreach a \$args \{" - set r { - set script [my ${low}Script } - set r [subst -nocommands -nobackslash $r] - append s $r - append s {$a] - my saveScript $filename $script} - append s " - \} - " - - RecoveryPoint instproc save$method {filename args} $s - } - - RecoveryPoint instproc recover {filename} { - set r [my loadScript $filename] - Object filterappend recoveryFilter - # puts stderr "RecoveryFilter appended for $filename" - eval $r - Object filterremove recoveryFilter - # puts stderr "RecoveryFilter removed for $filename" - return - } - - namespace export RecoveryPoint -} - -namespace import ::xotcl::scriptCreation::recoveryPoint::* Index: xotcl/library/serialize/ScriptCreator.xotcl =================================================================== diff -u -N --- xotcl/library/serialize/ScriptCreator.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/library/serialize/ScriptCreator.xotcl (revision 0) @@ -1,228 +0,0 @@ -# $Id: ScriptCreator.xotcl,v 1.4 2006/02/18 22:17:33 neumann Exp $ - -package provide xotcl::scriptCreation::scriptCreator 0.8 -package require XOTcl - -namespace eval ::xotcl::scriptCreation::scriptCreator { - namespace import ::xotcl::* - - Class ScriptCreator \ - -parameter { - {excludedObjs {Object Class Class::Parameter}} - {excludeNames ""} - {dependencyChecking 1} - } - - - # - # queries the excludedObjs variable whether a given object - # is already defined/predefined or not - # -> a way to exclude classes/objs from saving - # - ScriptCreator instproc isExcluded {n} { - my instvar excludedObjs - #puts stderr "Checking Excluded: $n in $excludedObjs" - if {[lsearch $excludedObjs [string trimleft $n :]] == -1} { - return 0 - } else { - return 1 - } - } - - ScriptCreator instproc appendExcluded {n} { - my instvar excludedObjs - lappend excludedObjs [string trimleft $n :] - } - - # - # compare command for lsort - # - ScriptCreator instproc namespaceDepth {a b} { - set aCount 0 - set bCount 0 - for {set i 0} {$i < [string length $a]} {incr i} { - if {[string index $a $i] eq ":"} { - incr aCount - } - } - for {set i 0} {$i < [string length $b]} {incr i} { - if {[string index $b $i] eq ":"} { - incr bCount - } - } - if {$aCount == $bCount} { - return 0 - } elseif {$aCount > $bCount} { - return 1 - } - - return -1 - } - - # - # produces a script containing the current state of - # the given obj - # - ScriptCreator instproc stateScript {obj} { - set script "" - foreach v [$obj info vars] { - if {[lsearch [my set excludeNames] $v] == -1} { - if {[$obj array exists $v]} { - foreach name [$obj array names $v] { - set arr ${v}($name) - set value [$obj set $arr] - append script "$obj set $arr \"$value\"\n" - } - } else { - set value [$obj set $v] - append script "$obj set $v \"$value\"\n" - } - } - } - return $script - } - - # - # produces a script containing the procs of the given obj - # - ScriptCreator instproc procScript {obj} { - set script "" - foreach p [$obj info procs] { - if {[lsearch [my set excludeNames] $p] == -1} { - append script \ - "$obj proc $p \{[$obj info args $p]\} \{[$obj info body $p]\}\n" - } - } - return $script - } - - # - # produces a script containing the instprocs of the given class - # - ScriptCreator instproc instprocScript {cl} { - set script "" - foreach p [$cl info instprocs] { - if {[lsearch [my set excludeNames] $p] == -1} { - append script \ - "$cl instproc $p \{[$cl info instargs $p]\} \{[$cl info instbody $p]\}\n" - } - } - return $script - } - - - - # - # saves a script to a file - # - ScriptCreator instproc saveScript {filename script} { - set f [open $filename w] - puts $f $script - close $f - } - - # - # load a script from a file - # - ScriptCreator instproc loadScript {filename} { - set f [open $filename r] - set r [read $f] - close $f - return $r - } - - # - # check parent obj/classes/namespaces of an object completly - # - ScriptCreator instproc checkParents {name} { - set p "" - - set n $name - while {[set np [namespace parent ::$n]] != "::"} { - lappend p $np - set n $np - } - set p [lsort -command {my namespaceDepth} $p] - - foreach n $p { - if {![my isExcluded $n] && - ![my isAppended $n]} { - error "ScriptCreator: $name needs parent $n, neither appended nor excluded yet." - } - } - } - - ScriptCreator instproc checkClass {obj class} { - if {![my isExcluded $class] && - ![my isAppended $class]} { - error "ScriptCreator: $obj depends on $class, neither appended nor excluded yet." - } - } - - ScriptCreator instproc isAppended name { - set n [string trimleft $name :] - if {[lsearch [my set appendedNames] $n]!=-1} { - return 1 - } else { - return 0 - } - } - - ScriptCreator instproc appendName name { - set n [string trimleft $name :] - my lappend appendedNames $n - } - - ScriptCreator instproc makeScript args { - my instvar dependencyChecking - my set appendedNames "" - set script "" - foreach name $args { - #puts stderr "Script Creator -- $name" - if {![my isExcluded $name] && - ![my isAppended $name]} { - - if {$dependencyChecking} { - my checkParents $name - } - if {[Object isobject $name]} { - set class [$name info class] - if {$dependencyChecking} { - my checkClass $name $class - } - if {[Object isclass $name]} { - # append the class - #puts stderr "Appending Class: $name" - append script "[$name info class] $name" - set sl [$name info superclass] - if {$dependencyChecking} { - foreach c $sl { - my checkClass $name $c - } - } - if {$sl ne ""} { - append script " -superclass \{$sl\}\n" - } else { - append script "\n" - } - append script [my instprocScript $name] - } else { - # append the obj - #puts stderr "Appending Object: $name" - append script "[$name info class] $name\n" - } - append script [my procScript $name] - } else { - append script "namespace eval $name \{\}\n" - #puts stderr "Appending Namespace: $name" - } - my appendName $name - } - } - return $script - } - - namespace export ScriptCreator -} - -namespace import ::xotcl::scriptCreation::scriptCreator::* Index: xotcl/library/serialize/Serializer.xotcl =================================================================== diff -u -N --- xotcl/library/serialize/Serializer.xotcl (revision caee4f272cfc744a06a7df61e2f3c73da1b6be64) +++ xotcl/library/serialize/Serializer.xotcl (revision 0) @@ -1,546 +0,0 @@ -# $Id: Serializer.xotcl,v 1.19 2007/10/05 09:06:00 neumann Exp $ -package require XOTcl 1.5 -package provide xotcl::serializer 1.0 - -namespace eval ::xotcl::serializer { - - namespace import -force ::xotcl::* - - @ @File { - description { - This package provides the class Serializer, which can be used to - generate a snapshot of the current state of the workspace - in the form of XOTcl source code. - } - authors { - Gustaf Neumann, Gustaf.Neumann@wu-wien.ac.at - } - date { $Date: 2007/10/05 09:06:00 $ } - } - - @ Serializer proc all { - ?-ignoreVarsRE RE? - "provide regular expression; matching vars are ignored" - ?-ignore obj1 obj2 ...? - "provide a list of objects to be omitted"} { - Description { - Serialize all objects and classes that are currently - defined (except the specified omissions and the current - Serializer object). -

    Examples:<@br> - <@pre class='code'>Serializer all -ignoreVarsRE {::b$} - Do not serialize any instance variable named b (of any object).

    - <@pre class='code'>Serializer all -ignoreVarsRE {^::o1::.*text.*$|^::o2::x$} - Do not serialize any variable of c1 whose name contains - the string "text" and do not serialze the variable x of o2.

    - <@pre class='code'>Serializer all -ignore obj1 obj2 ... - do not serizalze the specified objects - } - return "script" - } - - @ Serializer proc deepSerialize { - objs "Objects to be serialized" - ?-ignoreVarsRE RE? - "provide regular expression; matching vars are ignored" - ?-ignore obj1 obj2 ...? - "provide a list of objects to be omitted" - ?-map list? "translate object names in serialized code" - } { - Description { - Serialize object with all child objects (deep operation) - except the specified omissions. For the description of - <@tt>ignore and <@tt>igonoreVarsRE see - <@tt>Serizalizer all. <@tt>map can be used - in addition to provide pairs of old-string and new-string - (like in the tcl command <@tt>string map). This option - can be used to regenerate the serialized object under a different - object or under an different name, or to translate relative - object names in the serialized code.

    - - Examples: - <@pre class='code'>Serializer deepSerialize ::a::b::c -map {::a::b ::x::y} - Serialize the object <@tt>c which is a child of <@tt>a::b; - the object will be reinitialized as object <@tt>::x::y::c, - all references <@tt>::a::b will be replaced by <@tt>::x::y.

    - - <@pre class='code'>Serializer deepSerialize ::a::b::c -map {::a::b [self]} - The serizalized object can be reinstantiated under some current object, - under which the script is evaluated.

    - - <@pre class='code'>Serializer deepSerialize ::a::b::c -map {::a::b::c ${var}} - The serizalized object will be reinstantiated under a name specified - by the variable <@tt>var<@tt> in the recreation context. - } - return "script" - } - - @ Serializer proc methodSerialize { - object "object or class" - method "name of method" - prefix "either empty or 'inst' (latter for instprocs)" - } { - Description { - Serialize the specified method. In order to serialize - an instproc, <@tt>prefix should be 'inst'; to serialze - procs, it should be empty.

    - - Examples: - <@pre class='code'>Serializer methodSerialize Serializer deepSerialize "" - This command serializes the proc <@tt>deepSerialize - of the Class <@tt>Serializer.

    - - <@pre class='code'>Serializer methodSerialize Serializer serialize inst - This command serializes the instproc <@tt>serialize - of the Class <@tt>Serializer.

    - } - return {Script, which can be used to recreate the specified method} - } - @ Serializer proc exportMethods { - list "list of methods of the form 'object proc|instproc methodname'" - } { - Description { - This method can be used to specify methods that should be - exported in every <@tt>Serializer all<@/tt>. The rationale - behind this is that the serializer does not serialize objects - from the ::xotcl:: namespace, which is used for XOTcl internals - and volatile objects. It is however often useful to define - methods on ::xotcl::Class or ::xotcl::Objects, which should - be exported. One can export procs, instprocs, forward and instforward

    - Example: - <@pre class='code'> Serializer exportMethods { - ::xotcl::Object instproc __split_arguments - ::xotcl::Object instproc __make_doc - ::xotcl::Object instproc ad_proc - ::xotcl::Class instproc ad_instproc - ::xotcl::Object forward expr - }<@/pre> - } - } - - - @ Serializer instproc serialize {entity "Object or Class"} { - Description { - Serialize the specified object or class. - } - return {Object or Class with all currently defined methods, - variables, invariants, filters and mixins} - } - - ################################################################################## - # real clode starts here..... - # ################################################################################ - Class Serializer -parameter {ignoreVarsRE map} - namespace export Serializer - - Serializer proc ignore args { - my set skip $args - } - Serializer instproc ignore args { - foreach i $args { - my set skip($i) 1 - # skip children of ignored objects as well - foreach j [$i info children] { - my ignore $j - } - } - } - Serializer instproc init {} { - my ignore [self] - if {[[self class] exists skip]} { - eval my ignore [[self class] set skip] - } - } - Serializer instproc method-serialize {o m prefix} { - my pcmd [my unescaped-method-serialize $o $m $prefix] - } - Serializer instproc unescaped-method-serialize {o m prefix} { - set arglist [list] - foreach v [$o info ${prefix}args $m] { - if {[$o info ${prefix}default $m $v x]} { - lappend arglist [list $v $x] } {lappend arglist $v} - } - lappend r ${prefix}proc $m \ - [concat [$o info ${prefix}nonposargs $m] $arglist] \ - [$o info ${prefix}body $m] - foreach p {pre post} { - if {[$o info ${prefix}$p $m]!=""} {lappend r [$o info ${prefix}$p $m]} - } - return $r - } - Serializer instproc pcmd list { - foreach a $list { - if {[regexp -- {^-[[:alpha:]]} $a]} { - set mustEscape 1 - break - } - } - if {[info exists mustEscape]} { - return "\[list -$list\]" - } else { - return -$list - } - } - Serializer instproc collect-var-traces o { - my instvar traces - foreach v [$o info vars] { - set t [$o __trace__ info variable $v] - if {$t ne ""} { - foreach ops $t { - foreach {op cmd} $ops break - # save traces in post_cmds - my append post_cmds [list $o trace add variable $v $op $cmd] "\n" - # remove trace from object - $o trace remove variable $v $op $cmd - } - } - } - } - Serializer instproc Object-serialize o { - my collect-var-traces $o - append cmd [list [$o info class] create [$o self]] - # slots needs to be initialized when optimized, since - # parametercmds are not serialized - if {![$o istype ::xotcl::Slot]} {append cmd " -noinit"} - append cmd " \\\n" - foreach i [$o info procs] { - append cmd " " [my method-serialize $o $i ""] " \\\n" - } - foreach i [$o info forward] { - set fwd [concat [list forward $i] [$o info forward -definition $i]] - append cmd \t [my pcmd $fwd] " \\\n" - } - set vset {} - set nrVars 0 - foreach v [$o info vars] { - set setcmd [list] - if {![my exists ignoreVarsRE] || - ![regexp [my set ignoreVarsRE] ${o}::$v]} { - if {[$o array exists $v]} { - lappend setcmd array set $v [$o array get $v] - } else { - lappend setcmd set $v [$o set $v] - } - incr nrVars - append cmd \t [my pcmd $setcmd] " \\\n" - } - } - foreach x {mixin invar} { - set v [$o info $x] - if {$v ne ""} {my append post_cmds [list $o $x set $v] "\n"} - } - set v [$o info filter -guards] - if {$v ne ""} {append cmd [my pcmd [list filter $v]] " \\\n"} - return $cmd - } - Serializer instproc Class-serialize o { - set cmd [my Object-serialize $o] - #set p [$o info parameter] - #if {$p ne ""} { - # append cmd " " [my pcmd [list parameter $p]] " \\\n" - #} - foreach i [$o info instprocs] { - append cmd " " [my method-serialize $o $i inst] " \\\n" - } - foreach i [$o info instforward] { - set fwd [concat [list instforward $i] [$o info instforward -definition $i]] - append cmd \t [my pcmd $fwd] " \\\n" - } - foreach x {superclass instinvar} { - set v [$o info $x] - if {$v ne "" && "::xotcl::Object" ne $v } { - append cmd " " [my pcmd [list $x $v]] " \\\n" - } - } - foreach x {instmixin} { - set v [$o info $x] - if {$v ne "" && "::xotcl::Object" ne $v } { - my append post_cmds [list $o $x set $v] "\n" - #append cmd " " [my pcmd [list $x $v]] " \\\n" - } - } - set v [$o info instfilter -guards] - if {$v ne ""} {append cmd [my pcmd [list instfilter $v]] " \\\n"} - return $cmd\n - } - - Serializer instproc args {o prefix m} { - foreach v [$o info ${prefix}args $m] { - if {[$o info ${prefix}default $m $v x]} { - lappend arglist [list $v $x] } { - lappend arglist $v } - } - return $arglist - } - Serializer instproc category c { - if {[$c istype ::xotcl::Class]} {return Class} {return Object} - } - Serializer instproc allChildren o { - set set $o - foreach c [$o info children] { - eval lappend set [my allChildren $c] - } - return $set - } - Serializer instproc allInstances C { - set set [$C info instances] - foreach sc [$C info subclass] { - eval lappend set [my allInstances $sc] - } - return $set - } - Serializer instproc exportedObject o { - # check, whether o is exported. for exported objects. - # we export the object tree. - set oo $o - while {1} { - if {[[self class] exists exportObjects($o)]} { - #puts stderr "exported: $o -> exported $oo" - return 1 - } - # we do this for object trees without object-less name spaces - if {![my isobject $o]} {return 0} - set o [$o info parent] - } - } - - Serializer instproc topoSort {set all} { - if {[my array exists s]} {my array unset s} - if {[my array exists level]} {my array unset level} - foreach c $set { - if {!$all && - [string match "::xotcl::*" $c] && - ![my exportedObject $c]} continue - if {[my exists skip($c)]} continue - my set s($c) 1 - } - set stratum 0 - while {1} { - set set [my array names s] - if {[llength $set] == 0} break - incr stratum - #my warn "$stratum set=$set" - my set level($stratum) {} - foreach c $set { - if {[my [my category $c]-needsNothing $c]} { - my lappend level($stratum) $c - } - } - if {[my set level($stratum)] eq ""} { - my set level($stratum) $set - my warn "Cyclic dependency in $set" - } - foreach i [my set level($stratum)] {my unset s($i)} - } - } - Serializer instproc warn msg { - if {[info command ns_log] ne ""} { - ns_log Notice $msg - } else { - puts stderr "!!! $msg" - } - } - - Serializer instproc Class-needsNothing x { - if {![my Object-needsNothing $x]} {return 0} - set scs [$x info superclass] - if {[my needsOneOf $scs]} {return 0} - foreach sc $scs {if {[my needsOneOf [$sc info slots]]} {return 0}} - #if {[my needsOneOf [$x info instmixin ]]} {return 0} - return 1 - } - Serializer instproc Object-needsNothing x { - set p [$x info parent] - if {$p ne "::" && [my needsOneOf $p]} {return 0} - if {[my needsOneOf [$x info class]]} {return 0} - if {[my needsOneOf [[$x info class] info slots]]} {return 0} - #if {[my needsOneOf [$x info mixin ]]} {return 0} - return 1 - } - Serializer instproc needsOneOf list { - foreach e $list {if {[my exists s($e)]} { - #upvar x x; puts stderr "$x needs $e" - return 1 - }} - return 0 - } - Serializer instproc serialize {objectOrClass} { - string trimright [my [my category $objectOrClass]-serialize $objectOrClass] "\\\n" - } - Serializer instproc serialize-objects {list all} { - my instvar post_cmds - set post_cmds "" - # register for introspection purposes "trace" under a different name - ::xotcl::alias ::xotcl::Object __trace__ -objscope ::trace - my topoSort $list $all - #foreach i [lsort [my array names level]] {my warn "$i: [my set level($i)]"} - set result "" - foreach l [lsort -integer [my array names level]] { - foreach i [my set level($l)] { - #my warn "serialize $i" - #append result "# Stratum $l\n" - append result [my serialize $i] \n - } - } - foreach e $list { - set namespace($e) 1 - set namespace([namespace qualifiers $e]) 1 - } - ::xotcl::Object proc __trace__ {} {} - - # Handling of variable traces: traces might require a - # different topological sort, which is hard to handle. - # Similar as with filters, we deactivate the variable - # traces during initialization. This happens by - # (1) replacing the XOTcl's trace method by a no-op - # (2) collecting variable traces through collect-var-traces - # (3) re-activating the traces after variable initialization - - set exports "" - set pre_cmds "" - - # delete ::xotcl from the namespace list, if it exists... - catch {unset namespace(::xotcl)} - foreach ns [array name namespace] { - if {![namespace exists $ns]} continue - if {![my isobject $ns]} { - append pre_cmds "namespace eval $ns {}\n" - } elseif {$ns ne [namespace origin $ns] } { - append pre_cmds "namespace eval $ns {}\n" - } - set exp [namespace eval $ns {namespace export}] - if {$exp ne ""} { - append exports "namespace eval $ns {namespace export $exp}" \n - } - } - - #append post_cmds "::xotcl::alias ::xotcl::Object trace -objscope ::trace\n" - return $pre_cmds$result$post_cmds$exports - } - Serializer instproc deepSerialize o { - # assumes $o to be fully qualified - my serialize-objects [my allChildren $o] 1 - } - Serializer instproc serializeMethod {object kind name} { - set code "" - switch $kind { - proc { - if {[$object info procs $name] ne ""} { - set code [my method-serialize $object $name ""] - } - } - instproc { - if {[$object info instprocs $name] ne ""} { - set code [my method-serialize $object $name inst] - } - } - forward - instforward { - if {[$object info $kind $name] ne ""} { - set fwd [concat [list $kind $name] [$object info $kind -definition $name]] - set code [my pcmd $fwd] - } - } - } - return $code - } - - - Serializer proc exportMethods list { - foreach {o p m} $list {my set exportMethods($o,$p,$m) 1} - } - Serializer proc exportObjects list { - foreach o $list {my set exportObjects($o) 1} - } - - Serializer proc serializeExportedMethods {s} { - set r "" - foreach k [my array names exportMethods] { - foreach {o p m} [split $k ,] break - #if {$o ne "::xotcl::Object" && $o ne "::xotcl::Class"} { - #error "method export only for ::xotcl::Object and\ - # ::xotcl::Class implemented, not for $o" - #} - if {![string match "::xotcl::*" $o]} { - error "method export is only for ::xotcl::* \ - object an classes implemented, not for $o" - } - append methods($o) [$s serializeMethod $o $p $m] " \\\n " - } - set objects [array names methods] - foreach o [list ::xotcl::Object ::xotcl::Class] { - set p [lsearch $o $objects] - if {$p == -1} continue - set objects [lreplace $objects $p $p] - } - foreach o [concat ::xotcl::Object ::xotcl::Class $objects] { - if {![info exists methods($o)]} continue - append r \n "$o configure \\\n " \ - [string trimright $methods($o) "\\\n "] - } - #puts stderr "... exportedMethods <$r\n>" - return "$r\n" - } - - Serializer proc all {args} { - # don't filter anything during serialization - set filterstate [::xotcl::configure filter off] - set s [eval my new -childof [self] -volatile $args] - # always export __exitHandler - my exportMethods [list ::xotcl::Object proc __exitHandler] - set r { - set ::xotcl::__filterstate [::xotcl::configure filter off] - ::xotcl::Object instproc trace args {} - ::xotcl::Slot instmixin add ::xotcl::Slot::Nocheck - } - append r "::xotcl::configure softrecreate [::xotcl::configure softrecreate]" - append r \n [my serializeExportedMethods $s] - # export the objects and classes - #$s warn "export objects = [my array names exportObjects]" - #$s warn "export objects = [my array names exportMethods]" - append r [$s serialize-objects [$s allInstances ::xotcl::Object] 0] - foreach o [list ::xotcl::Object ::xotcl::Class] { - foreach x {mixin instmixin invar instinvar} { - set v [$o info $x] - if {$v ne "" && $v ne "::xotcl::Object"} { - append r "$o configure " [$s pcmd [list $x $v]] "\n" - } - } - } - append r { - ::xotcl::alias ::xotcl::Object trace -objscope ::trace - ::xotcl::Slot instmixin delete ::xotcl::Slot::Nocheck - ::xotcl::configure filter $::xotcl::__filterstate - unset ::xotcl::__filterstate - } - ::xotcl::configure filter $filterstate - return $r - } - Serializer proc methodSerialize {object method prefix} { - set s [my new -childof [self] -volatile] - concat $object [$s unescaped-method-serialize $object $method $prefix] - } - Serializer proc deepSerialize args { - set s [my new -childof [self] -volatile] - set nr [eval $s configure $args] - foreach o [lrange $args 0 [incr nr -1]] { - append r [$s deepSerialize [$o]] - } - if {[$s exists map]} {return [string map [$s map] $r]} - return $r - } - - # register serialize a global method - ::xotcl::Object instproc serialize {} { - ::Serializer deepSerialize [self] - } - - # include this method in the serialized code - Serializer exportMethods { - ::xotcl::Object instproc contains - } - - # include Serializer in the serialized code - Serializer exportObjects [namespace current]::Serializer - - namespace eval :: "namespace import -force [namespace current]::*" -} Index: xotcl/library/serialize/Serializer2.xotcl =================================================================== diff -u -N --- xotcl/library/serialize/Serializer2.xotcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/serialize/Serializer2.xotcl (revision 0) @@ -1,290 +0,0 @@ -# $Id: Serializer2.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ -package require XOTcl 1.0 -package provide xotcl::serializer 0.4 - -@ @File { - description { - This package provides the class Serializer, which can be used to - generate a snapshot of the current state of the workspace - in the form of XOTcl source code. - } - authors { - Gustaf Neumann, Gustaf.Neumann@wu-wien.ac.at - } - date { $Date: 2004/05/23 22:50:39 $ } -} - -@ Serializer proc all { - ?-ignoreVarsRE RE? - "provide regular expression; matching vars are ignored" - ?-ignore obj1 obj2 ...? - "provide a list of objects to be omitted"} { - Description { - Serialize all objects and classes that are currently - defined (except the specified omissions and the current - Serializer object). -

    Examples:<@br> - <@tt>Serializer all -ignoreVarsRE {::b$}<@br> - do not serialize any instance variable named b (of any object)

    - <@tt>Serializer all -ignoreVarsRE {^::o1::.*text.*$|^::o2::x$}<@br> - do not serialize any variable of c1 whose name contains - the string "text" and do not serialze the variable x of o2

    - <@tt>Serializer all - ignore obj1 obj2 ... <@br> - do not serizalze the specified objects - } - return "script" -} - -@ Serializer proc deepSerialize { - objs "Objects to be serialized" - ?-ignoreVarsRE RE? - "provide regular expression; matching vars are ignored" - ?-ignore obj1 obj2 ...? - "provide a list of objects to be omitted" - ?-map list? "translate object names in serialized code" -} { - Description { - Serialize object with all child objects (deep operation) - except the specified omissions. For the description of - <@tt>ignore and <@tt>igonoreVarsRE see - <@tt>Serizalizer all. <@tt>map can be used - in addition to provide pairs of old-string and new-string - (like in the tcl command <@tt>string map). This option - can be used to regenerate the serialized object under a different - object or under an different name, or to translate relative - object names in the serialized code.

    - - Examples: - <@tt>Serializer deepSerialize ::a::b::c -map {::a::b ::x::y}<@br> - Serialize the object <@tt>c which is a child of <@tt>a::b; - the object will be reinitialized as object <@tt>::x::y::c, - all references <@tt>::a::b will be replaced by <@tt>::x::y.

    - - <@tt>Serializer deepSerialize ::a::b::c -map {::a::b [self]}<@br> - The serizalized object can be reinstantiated under some current object, - under which the script is evaluated.

    - - <@tt>Serializer deepSerialize ::a::b::c -map {::a::b::c ${var}}<@br> - The serizalized object will be reinstantiated under a name specified - by the variable <@tt>var<@tt> in the recreation context. - } - return "script" -} - -@ Serializer instproc serialize {entity "Object or Class"} { - Description { - Serialize the specified object or class. - } - return {Object or Class with all currently defined methods, - variables, invariants, filters and mixins} -} - -######################################################################################## -Class Serializer -parameter {ignoreVarsRE map} -Serializer proc ignore args { - my set skip $args -} -Serializer instproc ignore args { - foreach i $args { my set skip($i) 1 } -} -Serializer instproc init {} { - my ignore [self] - if {[[self class] exists skip]} { - eval my ignore [[self class] set skip] - } -} -Serializer instproc method-serialize {o m prefix} { - set arglist "" - foreach v [$o info ${prefix}args $m] { - if {[$o info ${prefix}default $m $v x]} { - lappend arglist [list $v $x] } { - lappend arglist $v } - } - lappend r ${prefix}proc $m $arglist [$o info ${prefix}body $m] - foreach p {pre post} { - if {[$o info ${prefix}$p $m]!=""} {lappend r [$o info ${prefix}$p $m]} - } - return [my pcmd $r] -} -Serializer instproc pcmd list { - foreach a $list { - if {[regexp -- {^-[[:alpha:]]} $a]} { - set mustEscape 1 - break - } - } - if {[info exists mustEscape]} { - return "\[list -$list\]" - } else { - return -$list - } -} -Serializer instproc Object-serialize o { - append alloc [list [$o info class] alloc $o] - foreach i [$o info procs] { - append cmd " " [my method-serialize $o $i ""] " \\\n" - } - set vset {} - set nrVars 0 - foreach v [$o info vars] { - set setcmd [list] - if {![my exists ignoreVarsRE] || - ![regexp [my set ignoreVarsRE] ${o}::$v]} { - if {[$o array exists $v]} { - lappend setcmd array set $v [$o array get $v] - } else { - lappend setcmd set $v [$o set $v] - } - incr nrVars - append cmd \t [my pcmd $setcmd] " \\\n" - } - } - foreach x {mixin invar} { - set v [$o info $x] - if {[string compare "" $v]} {append cmd [my pcmd [list $x $v]] " \\\n"} - } - set v [$o info filter -guards] - if {[string compare "" $v]} {append cmd [my pcmd [list filter $v]] " \\\n"} - if {[info exists cmd]} { - return "\[$alloc\] configure $cmd\\\n" - } else { - return $alloc - } - return $cmd -} -Serializer instproc Class-serialize o { - set cmd [my Object-serialize $o] - set p [$o info parameter] - if {[string compare "" $p]} { - append cmd " " [my pcmd [list parameter $p]] " \\\n" - } - foreach i [$o info instprocs] { - append cmd " " [my method-serialize $o $i inst] " \\\n" - } - foreach x {superclass instmixin instinvar} { - set v [$o info $x] - if {[string compare "" $v] && [string compare "::xotcl::Object" $v]} { - append cmd " " [my pcmd [list $x $v]] " \\\n" - } - } - set v [$o info instfilter -guards] - if {[string compare "" $v]} {append cmd [my pcmd [list instfilter $v]] " \\\n"} - return $cmd\n -} - -Serializer instproc args {o prefix m} { - foreach v [$o info ${prefix}args $m] { - if {[$o info ${prefix}default $m $v x]} { - lappend arglist [list $v $x] } { - lappend arglist $v } - } - return $arglist -} -Serializer instproc category c { - if {[$c istype ::Class]} {return Class} {return Object} -} -Serializer instproc allChildren o { - set set $o - foreach c [$o info children] { - eval lappend set [my allChildren $c] - } - return $set -} -Serializer instproc allInstances C { - set set [$C info instances] - foreach sc [$C info subclass] { - eval lappend set [my allInstances $sc] - } - return $set -} - -Serializer instproc topoSort {set} { - if {[my array exists s]} {my array unset s} - if {[my array exists level]} {my array unset level} - foreach c $set { - if {[regexp ^::xotcl:: $c]} continue - if {[my exists skip($c)]} continue - my set s($c) 1 - } - set stratum 0 - while {1} { - set set [my array names s] - if {[llength $set] == 0} break - incr stratum - #puts "$stratum set=$set" - my set level($stratum) {} - foreach c $set { - if {[my [my category $c]-needsNothing $c]} { - my lappend level($stratum) $c - } - } - if {[string equal "" [my set level($stratum)]]} { - my set level($stratum) $set - my warn "Cyclic dependency in $set" - } - foreach i [my set level($stratum)] {my unset s($i)} - } -} -Serializer instproc warn msg { - if {[string compare "" [info command ns_log]]} { - ns_log Notice $msg - } else { - puts stderr "!!! Warning: $msg" - } -} - -Serializer instproc Class-needsNothing x { - if {![my Object-needsNothing $x]} {return 0} - if {[my needsOneOf [$x info superclass]]} {return 0} - if {[my needsOneOf [$x info instmixin ]]} {return 0} - return 1 -} -Serializer instproc Object-needsNothing x { - set p [$x info parent] - if {[string compare $p "::"] && [my needsOneOf $p]} {return 0} - if {[my needsOneOf [$x info class]]} {return 0} - if {[my needsOneOf [$x info mixin ]]} {return 0} - return 1 -} -Serializer instproc needsOneOf list { - foreach e $list {if {[my exists s($e)]} {return 1}} - return 0 -} -Serializer instproc serialize {objectOrClass} { - my [my category $objectOrClass]-serialize $objectOrClass -} -Serializer instproc serializeList {list} { - my topoSort $list - #foreach i [lsort [my array names level]] {puts "$i: [my set level($i)]"} - set result "" - foreach l [lsort [my array names level]] { - foreach i [my set level($l)] { - append result [string trimright [my serialize $i] "\\\n"] \n - } - } - return $result -} -Serializer instproc deepSerialize o { - # assumes $o to be fully qualified - my serializeList [my allChildren $o] -} - -Serializer proc all {args} { - set s [eval my new -childof [self] -volatile $args] - set r [$s serializeList [$s allInstances ::Object]] - if {[string compare [::xotcl::Object info body __exitHandler] "\n;"]} { - append r \n "::xotcl::Object configure " \ - [$s method-serialize ::xotcl::Object __exitHandler ""] \n - } - return $r -} -Serializer proc deepSerialize args { - set s [my new -childof [self] -volatile] - set nr [eval $s configure $args] - foreach o [lrange $args 0 [incr nr -1]] { - append r [$s deepSerialize [$o]] - } - if {[$s exists map]} {return [string map [$s map] $r]} - return $r -} - Index: xotcl/library/serialize/pkgIndex.tcl =================================================================== diff -u -N --- xotcl/library/serialize/pkgIndex.tcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/serialize/pkgIndex.tcl (revision 0) @@ -1,13 +0,0 @@ -# Tcl package index file, version 1.1 -# This file is generated by the "pkg_mkIndex -direct" command -# and sourced either when an application starts up or -# by a "package unknown" script. It invokes the -# "package ifneeded" command to set up package-related -# information so that packages will be loaded automatically -# in response to "package require" commands. When this -# script is sourced, the variable $dir must contain the -# full path name of this file's directory. - -package ifneeded xotcl::scriptCreation::recoveryPoint 0.8 [list source [file join $dir RecoveryPoint.xotcl]] -package ifneeded xotcl::scriptCreation::scriptCreator 0.8 [list source [file join $dir ScriptCreator.xotcl]] -package ifneeded xotcl::serializer 1.0 [list source [file join $dir Serializer.xotcl]] Index: xotcl/library/store/COPYRIGHT =================================================================== diff -u -N --- xotcl/library/store/COPYRIGHT (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/COPYRIGHT (revision 0) @@ -1,41 +0,0 @@ - * XOTcl - Extended OTcl - * - * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) - * - * (a) Vienna University of Economics and Business Administration - * Dept. of Information Systems / New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - Index: xotcl/library/store/JufGdbmStorage.xotcl =================================================================== diff -u -N --- xotcl/library/store/JufGdbmStorage.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/store/JufGdbmStorage.xotcl (revision 0) @@ -1,50 +0,0 @@ -# $Id: JufGdbmStorage.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::store::jufgdbm 0.81 - -package require xotcl::store::juf_gdbm -package require xotcl::store -package require XOTcl - -namespace eval ::xotcl::store::jufgdbm { - namespace import ::xotcl::* - - # - # a simple GNU Gdbm DB Store Access - # - Class Storage=JufGdbm -superclass Storage - Storage=JufGdbm instproc open f { - my set persistenceDB [juf_gdbm open $f rwc] - } - - Storage=JufGdbm instproc store {k v} { - #my showCall - juf_gdbm store [my set persistenceDB] $k $v - } - - Storage=JufGdbm instproc list {} { - juf_gdbm list [my set persistenceDB] - } - - Storage=JufGdbm instproc fetch {k var} { - my instvar persistenceDB - if {[juf_gdbm exists $persistenceDB $k]} { - upvar [self callinglevel] $var value - set value [juf_gdbm fetch $persistenceDB $k] - return 1 - } - return 0 - } - - Storage=JufGdbm instproc close args { - juf_gdbm close [my set persistenceDB] - } - - Storage=JufGdbm instproc delete k { - juf_gdbm delete [my set persistenceDB] $k - } - - namespace export Storage=JufGdbm -} - -namespace import ::xotcl::store::jufgdbm::* Index: xotcl/library/store/MemStorage.xotcl =================================================================== diff -u -N --- xotcl/library/store/MemStorage.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/store/MemStorage.xotcl (revision 0) @@ -1,102 +0,0 @@ -# $Id: MemStorage.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::store::mem 0.84 -package require xotcl::store 0.84 -package require XOTcl - -namespace eval ::xotcl::store::mem { - namespace import ::xotcl::* - - Object ::xotcl::memStoragePool - ::xotcl::memStoragePool proc add {filename} { - my set memStores($filename) [Object new -childof [self]] - } - ::xotcl::memStoragePool proc get {filename} { - if {[my exists memStores($filename)]} { - return [my set memStores($filename)] - } - return "" - } - ::xotcl::memStoragePool proc remove {filename} { - catch { - set store [my set memStores($filename)] - $store destroy - my unset memStores($filename) - } - } - - # - # a class using an XOTcl Object for memory storage - Class Storage=Mem -superclass Storage - Storage=Mem instproc init args { - my instvar searchID - ::set searchID "" - } - Storage=Mem instproc names {} { - my instvar store - $store array names v - } - Storage=Mem instproc exists name { - my instvar store - $store exists v($name) - } - Storage=Mem instproc unset name { - my instvar store - $store unset v($name) - } - Storage=Mem instproc set args { - my instvar store - ::set l [llength $args] - if {$l == 1} { - $store set v([lindex $args 0]) - } elseif {$l == 2} { - $store set v([lindex $args 0]) [lindex $args 1] - } else { - eval $store set $args - } - } - Storage=Mem instproc close {} { - my instvar store - ::unset store - } - Storage=Mem instproc open filename { - my instvar store - if {[::set store [::xotcl::memStoragePool get $filename]] == ""} { - ::set store [::xotcl::memStoragePool add $filename] - } - } - Storage=Mem instproc firstkey {} { - my instvar store - $store instvar v - my instvar searchID - if {$searchID ne ""} { - array donesearch v $searchID - } - ::set searchID [array startsearch v] - return [array nextelement v $searchID] - } - Storage=Mem instproc nextkey {} { - my instvar store - $store instvar v - my instvar searchID - if {$searchID eq ""} { - error "[self class]: firstkey was not invoked on storage search" - } - - ::set elt [array nextelement v $searchID] - if {$elt eq ""} { - # if array end is reach search is terminated automatically!! - ::set searchID "" - } - return $elt - } - - ### warum geht eigentlich folgendes nicht: - ## Object o; o set a::b::c 1 - ### dann koennte man sich das set und exists schenken... - - namespace export Storage=Mem -} - -namespace import ::xotcl::store::mem::* -#namespace eval ::xotcl {namespace import ::xotcl::store::mem::*} Index: xotcl/library/store/MultiStorage.xotcl =================================================================== diff -u -N --- xotcl/library/store/MultiStorage.xotcl (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) +++ xotcl/library/store/MultiStorage.xotcl (revision 0) @@ -1,74 +0,0 @@ - -package provide xotcl::store::multi 0.9 -package require xotcl::store 0.84 -package require XOTcl - -namespace eval ::xotcl::store::multi { - namespace import ::xotcl::* - - Class Storage=multi -superclass Storage - Storage=multi instproc add {dbPackage args} { - my instvar storages names - if {$dbPackage eq ""} { - set dbPackage [Storage defaultPackage] - } - package require xotcl::store::[string tolower $dbPackage] - lappend storages [eval Storage=$dbPackage new -childof [self] $args] - } - Storage=multi instproc init args { - my instvar storages - set storages {} - } - Storage=multi instproc names {} { - my instvar storages - [lindex $storages 0] $names - } - Storage=multi instproc exists name { - my instvar storages - [lindex $storages 0] exists $name - } - Storage=multi instproc unset name { - my instvar storages - foreach s $storages {$s [self proc] $name} - } - Storage=multi instproc set args { - my instvar storages - set l [llength $args] - set name [lindex $args 0] - if {$l == 1} { - [lindex $storages 0] set $name - } elseif {$l == 2} { - foreach s $storages { $s set $name [lindex $args 1]} - } else { - eval set $args - } - } - Storage=multi instproc close {} { - my instvar storages - foreach s $storages {$s [self proc]} - } - Storage=multi instproc dbOpen {} { - my instvar storages - foreach s $storages {$s [self proc]} - } - Storage=multi instproc firstkey {} { - my instvar storages - [lindex $storages 0] firstkey - } - Storage=multi instproc nextkey {} { - my instvar storages - [lindex $storages 0] nextkey - } - Storage=multi instproc checkdir {} { - my instvar storages - foreach s $storages {$s [self proc]} - } - Storage=multi instproc dbOpen {} { - my instvar storages - foreach s $storages {$s [self proc]} - } - - namespace export Storage=multi -} - -namespace import ::xotcl::store::multi::* Index: xotcl/library/store/Persistence.xotcl =================================================================== diff -u -N --- xotcl/library/store/Persistence.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/store/Persistence.xotcl (revision 0) @@ -1,365 +0,0 @@ -# $Id: Persistence.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::store::persistence 0.8 - -package require xotcl::trace -package require xotcl::package -package require xotcl::mixinStrategy -package require xotcl::store -package require XOTcl - -namespace eval ::xotcl::store::persistence { - namespace import ::xotcl::* - - @ @File { - description { - Persistent store for XOTcl objects with Eager and Lazy persistence. - Take a look at "persistenceExample.xotcl" for exmaple of usage. - } - } - - @ Class PersistenceMgr { - description { - A persistent store requires a persistent manager. The persistent - manager implements the Storage interface via storage mixin. With - the parameter "dbPackage" we can specify which storage will be used. - The persistent manager than tries to load the package - "xotcl::${dbPackage}Storage". Default is Sdbm. - - Example: - <@pre> - PersistenceMgr pmgr -persistenceDir . -persistenceFile example-db - - - } - } - - # - # base class for persistent managers -- just register corresponding - # storage mixin and open DB - # - Class PersistenceMgr -parameter { - {fileName {[string trimleft [self] :]}} - {dbPackage Sdbm} - trace - dirName - } - - PersistenceMgr instproc init args { - my instvar dbPackage - package require xotcl::store::[string tolower $dbPackage] - - Storage=$dbPackage [self]::store $args - foreach v {dirName fileName} { - if {[my exists $v]} { - [self]::store $v [my set $v] - } - } - - if {[my exists trace]} { - [self]::store filter traceFilter - } - my array set persistentObjs {} - next - } - # delegate methods to the store object - PersistenceMgr instproc store args { - eval [self]::store $args - } - - - PersistenceMgr instproc destroy args { - foreach obj [my array names persistentObjs] { - $obj storeall - $obj persistenceMgr "" - } - [self]::store close - next - } - PersistenceMgr instproc assureOpenDb {} { - if {![my exists dbOpen]} { - [self]::store dbOpen - my set dbOpen 1 - } - } - PersistenceMgr instproc addPersistentObj {obj} { - my set persistentObjs($obj) "" - } - PersistenceMgr instproc removePersistentObj {obj} { - if {[my exists persistentObjs($obj)]} { - my unset persistentObjs($obj) - } - } - - @ Class Persistent { - description { - Superclass or mixin class for all persistent objects. Normally - subclasses are used as mixins or instmixins on object, like: - <@pre> - o mixin Persistent=Eager - p mixin Persistent=Lazy - - } - } - # - # Persistence (mixin) classes# - Class Persistent -parameter { - persistenceMgr - } - - # can be overloaded by subclasses, that need a cleanup on - # persistenceMgr->destroy (like Lazy) - Persistent instproc storeall {} {;} - - @ Persistent instproc persistenceMgr {args "persistent manager name"} { - description { - Specify which persistence manager to use for [self] object, like: - <@pre> - o persistenceMgr pmgr - - Each persistent object must have a persistence manager specified, - before vars can be made persistent. - } - } - - # - # turn off persistence with ... persistenceMgr "", but - # persistent vars stay persistent - # - Persistent instproc persistenceMgr args { - if {[llength $args] == 0} { - return [my set [self proc]] - } elseif {[llength $args] == 1} { - set pmgr [lindex $args 0] - if {$pmgr eq "" && [my exists persistenceMgr]} { - [my set persistenceMgr] removePersistentObj [self] - my unset persistenceMgr - return "" - } - $pmgr addPersistentObj [self] - return [my set [self proc] $pmgr] - } else { - error "wrong # args: [self] [self proc] ?value?" - } - } - - @ Persistent instproc persistentVars {} { - description { - Returns list of persistent vars. - } - } - - Persistent instproc persistentVars {} { - if {[my exists __persistentVars]} { - return [my set __persistentVars] - } - return "" - } - - @ Persistent instproc persistent {list "persistent variables" } { - description { - Make a list of object variables persistent. If a persistent - DB exists, the values are read from this DB, overwriting the current value. - E.g.: - <@pre> - o persistent {x y} - - - } - } - - Persistent instproc persistent {list} { - my instvar persistenceMgr - if {![info exists persistenceMgr]} {return} - set store ${persistenceMgr}::store - - $persistenceMgr assureOpenDb - foreach var $list { - my lappend __persistentVars $var - # try to refetch vars from db - if {[$store exists [self]::${var}(_____arraynames)]} { - #puts stderr array=[self]::${var} - foreach i [$store set [self]::${var}(_____arraynames)] { - my set ${var}($i) [$store set [self]::${var}($i)] - } - } elseif {[$store exists [self]::$var]} { - #puts stderr "---store=$store exists [self]::$var" - #puts stderr "---set [self]::$var <[$store set [self]::$var]>" - my instvar $var - #set name [$store set [self]::$var] - #puts ***name*[set name]--$var - set $var [$store set [self]::$var] - } elseif {[my exists $var]} { - # - # first store of the variable in persistent store - if {[my array exists $var]} { - # this variable is an array - #puts stderr array=[self]::$var - set anames [my array names $var] - foreach n $anames { - $store set [self]::${var}($n) [my set ${var}($n)] - } - $store set [self]::${var}(_____arraynames) $anames - } else { - #puts stderr "+++set [self]::$var [$store set [self]::$var]" - $store set [self]::$var [my set $var] - } - } else { - error "persistent: $var is not a variable on [self]" - } - } - } - - @ Persistent instproc persistent+init {list "persistent variables" } { - description { - Initialize all data in the list as empty strings, - if they do not exist yet, and then make them persistent - using the 'persistent' method - } - } - - Persistent instproc persistent+init {list} { - foreach pd $list { - if {![my exists $pd]} { - my set $pd "" - } - } - my persistent $list - } - - - @ Persistent instproc unPersistent {list "persistent variables" } { - description { - Make a list of object variables not persistent. - } - } - - Persistent instproc unPersistent {list} { - my instvar __persistentVars - set pMgr [my set persistenceMgr] - foreach v $list { - set i [lsearch -exact $__persistentVars $v] - catch { - set __persistentVars [lreplace $__persistentVars $i $i] - ${pMgr}::store unset [self]::$v - } - } - } - - @ Persistent instproc makeVarScript {} { - description { - Build a Tcl script of "set ..." statements reflecting the current situation in the database. - } - } - Persistent instproc makeVarScript {} { - set script "" - foreach v [my persistentVars] { - set vt [namespace tail $v] - append script [list my set $vt [my set $vt]]\n - } - #set script [concat [next] $script] - return $script - } - - Persistent instproc destroy args { - if {[my exists persistenceMgr]} { - [my set persistenceMgr] removePersistentObj [self] - my unset persistenceMgr - } - next - #my showMsg "Persistent object [self] destroyed." - } - - @ Class Persistent=Eager { - description { - Eager persistence strategy. Store everything at the same moment to the database - } - } - Class Persistent=Eager -superclass Persistent - - # - # we use 'strange' argument names to avoid name clashes with given - # variable names, when we have to instvar "[self] instvar $nametail" - # - Persistent=Eager instproc vartrace {__name_vartrace __sub_vartrace __op_vartrace} { - #my showCall - if {$__op_vartrace eq "w"} { - my instvar persistenceMgr - if {![info exists persistenceMgr]} {return} - set store ${persistenceMgr}::store - - set nametail [namespace tail $__name_vartrace] - set key [self]::$nametail - if {$__sub_vartrace eq ""} { - my instvar $nametail - #puts stderr "+++VT: $store set $key [set $nametail]" - $store set $key [set $nametail] - } else { - if {$__sub_vartrace ne "_____arraynames"} { - my instvar "${nametail}($__sub_vartrace) subname" - $store set ${key}($__sub_vartrace) $subname - $store set ${key}(_____arraynames) [my array names $nametail] - } else { - error "With persistent arrays you may not use '_____arraynames' as index" - } - } - } - } - - Persistent=Eager instproc persistent {list} { - #my showCall - next - foreach v $list { - #puts stderr "***trace variable [self]::$v w [list my vartrace]" - my trace variable $v w [list [self] vartrace] - } - } - - Persistent=Eager instproc unPersistent {list} { - foreach v $list { - my trace vdelete $v w [list [self] vartrace] - } - next - } - - @ Class Persistent=Lazy { - description { - Lazy persistence strategy. Store everything on object destroy (or program termination). - } - } - - Class Persistent=Lazy -superclass Persistent - Persistent=Lazy instproc storeall {} { - my instvar persistenceMgr - if {![info exists persistenceMgr]} {return} - set store ${persistenceMgr}::store - - foreach v [my persistentVars] { - if {[my array exists $v]} { - set anames "" - foreach sub [my array names $v] { - if {[my exists ${v}($sub)]} { - set key [self]::${v}($sub) - $store set $key [my set ${v}($sub)] - lappend anames $sub - } - } - $store set [self]::${v}(_____arraynames) $anames - } else { - if {[my exists $v]} { - set key [self]::$v - $store set $key [my set $v] - } - } - } - } - - Persistent=Lazy instproc destroy args { - my storeall - next - } - - namespace export PersistenceMgr Persistent Persistent=Eager Persistent=Lazy -} - -namespace import ::xotcl::store::persistence::* Index: xotcl/library/store/Storage.xotcl =================================================================== diff -u -N --- xotcl/library/store/Storage.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/store/Storage.xotcl (revision 0) @@ -1,175 +0,0 @@ -# $Id: Storage.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::store 0.84 -package require XOTcl - -namespace eval ::xotcl::store { - namespace import ::xotcl::* - - @ @File { - description { - Simple generic storage interface for hashtable-like (persistent) - storages. There are several different existing stores, including - a memory storage, a GDBM storage, a SDBM storage, and a - TextFile storage. - } - date { $Date: 2005/09/09 21:09:01 $ } - } - - # - # abstract interface for storage access - # - @ Class Storage { - description { - Abstract storage interface class (superclass of all storages). - } - } - Class Storage -parameter {{dirName .} fileName} - - ### - @ Storage instproc open { - filename "database filename (or filename base, if more - than one file has to be created)" - } { - Description { - Each storage object represents exactly one database table. The db - has to be opened, before it can it used. If it is not opened all - other methods return errors. - } - return "empty string" - } - Storage abstract instproc open filename - - ### - @ Storage instproc close {} { - Description { - Close associated database. - } - return "empty string" - } - Storage abstract instproc close {} - - ### - @ Storage instproc exists { - key {Key to be searched for.} - } { - Description { - Search for a key whether it exists or not. - } - return {1, if key exists in the database, otherwise 0} - } - Storage abstract instproc exists key - - ### - @ Storage instproc set { - key {Key to be set.} - ?value? {Optional value that might be set} - } { - Description { - Set or query a database key in the same way as Tcl's set functions. - } - return {Key value.} - } - Storage abstract instproc set {key ?value?} - - ### - @ Storage instproc unset { - key {Key to be unset.} - } { - Description { - Unset a database key in the same way as Tcl's unset functions. - } - return {empty string} - } - Storage abstract instproc unset key - - ### - @ Storage instproc names {} { - Description { - Return a list of keys in the database (functions in the same - way as Tcl's array names) - } - return {List of keys in the db.} - } - Storage abstract instproc names {} - - ### - @ Storage instproc firstkey {} { - Description { - Start a traversal of the database, starting with any key. - } - return {Name of first key.} - } - Storage abstract instproc firstkey {} - - ### - @ Storage instproc nextkey {} { - Description { - Proceed with the db traversal. Requires a firstkey before - first usage, otherwise it returns an error. - } - return {Name of next key, if one exists. Otherwise an empty string is returned.} - } - Storage abstract instproc nextkey {} - - Storage instproc traceFilter args { - set context "[self callingclass]->[self callingproc]" - set method [self calledproc] - set dargs $args - puts "CALL $context> [self]->$method $dargs" - set result [next] - puts "EXIT $context> [self]->$method ($result)" - return $result - } - - ### - @ Storage proc someNewChildStore {} { - Description { - Create a childStore according to a preference list depending on - which storages are available. Currently the preference list has - the following order: Gdbm, Sdbm and TextFile. - } - return {name of the created storage object.} - } - Storage proc someNewChildStore {} { - foreach store {Gdbm Sdbm TextFile} { - if {![catch {package require xotcl::store::[string tolower $store]}]} { - set s [Storage=$store new -childof [self]] - break - } - } - return $s - } - - Storage instproc checkDir {} { - my instvar dirName - if {[info exists dirName]} { - if {![file exists $dirName]} { - file mkdir $dirName - } elseif {![file isdirectory $dirName]} { - error "specified directory $dirName is no directory!" - } - } - } - Storage instproc mkFileName {} { - my instvar dirName fileName - if {[info exists dirName]} { - return [file join $dirName $fileName] - } else { - return $fileName - } - } - Storage instproc dbOpen {} { - my checkDir - my open [my mkFileName] - } - - - Storage proc defaultPackage {} { - return Sdbm - } - - namespace export Storage -} - -namespace import ::xotcl::store::* Index: xotcl/library/store/TclGdbmStorage.xotcl =================================================================== diff -u -N --- xotcl/library/store/TclGdbmStorage.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/store/TclGdbmStorage.xotcl (revision 0) @@ -1,61 +0,0 @@ -# $Id: TclGdbmStorage.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::store::tclgdbm 0.84 - -package require xotcl::store::gdbm -package require xotcl::store -package require XOTcl - -namespace eval ::xotcl::store::tclgdbm { - namespace import ::xotcl::* - - # - # a simple GNU Gdbm DB Store Access based on TclGdbm - # - Class Storage=TclGdbm -superclass Storage - Storage=TclGdbm instproc open f { - my instvar persistenceDB - ::set persistenceDB [gdbm_open -wrcreat $f] - } - - Storage=TclGdbm instproc set args { - my instvar persistenceDB - ::set l [llength $args] - if {$l == 1} {[::set persistenceDB] fetch [lindex $args 0] - } elseif {$l == 2} {[::set persistenceDB] -replace store \ - [lindex $args 0] [lindex $args 1] - } else { next } - } - - Storage=TclGdbm instproc exists k { - my instvar persistenceDB - $persistenceDB exists $k - } - - Storage=TclGdbm instproc names {} { - my instvar persistenceDB - ::set list "" - if {[::set key [$persistenceDB firstkey]] != ""} { - lappend list $key - while {[::set key [$persistenceDB nextkey $key]] != ""} { - lappend list $key - } - } - return $list - } - - - Storage=TclGdbm instproc close args { - my instvar persistenceDB - $persistenceDB close - } - - Storage=TclGdbm instproc unset k { - my instvar persistenceDB - $persistenceDB delete $k - } - - namespace export Storage=TclGdbm -} - -namespace import ::xotcl::store::tclgdbm::* Index: xotcl/library/store/TextFileStorage.xotcl =================================================================== diff -u -N --- xotcl/library/store/TextFileStorage.xotcl (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) +++ xotcl/library/store/TextFileStorage.xotcl (revision 0) @@ -1,160 +0,0 @@ -package provide xotcl::store::textfile 0.84 -package require xotcl::store -package require XOTcl - -namespace eval ::xotcl::store::textfile { - namespace import ::xotcl::* - - Class Storage=TextFile -superclass Storage -parameter { - filename - reorgCounter - reorgMaxValue - } - - Storage=TextFile instproc init args { - my instvar reorgCounter reorgMaxValue searchID - ::set reorgCounter 0 - ::set reorgMaxValue 1000 - ::set searchID "" - next - } - Storage=TextFile instproc reorganizeDB {} { - my instvar noreorg reorgCounter reorgMaxValue filename keys - ::set reorgCounter -1 - #puts "***reorganizeDB" - if {[::info exists filename]} { - ::set noreorg 1 - ::array set bkeys [::array get keys] - ::array set keys {} - # parray bkeys - - ::set bak $filename.orig - file rename -force $filename $bak - foreach k [::array names bkeys] { - ::set bf [::open $bak r] - seek $bf [lindex $bkeys($k) 0] - ::set c [read $bf [lindex $bkeys($k) 1]] - ::close $bf - #puts "***STORING $k [lindex $c 1]" - my set $k [lindex $c 1] - } - file delete -force $bak - ::unset noreorg - } - } - Storage=TextFile instproc open fn { - my instvar keys filename - ::array set keys {} - ::set position 0 - ::set filename $fn - if {[file exists $filename]} { - ::set f [::open $filename r] - ::set c [read $f] - ::close $f - foreach {k v} $c { - lappend keyList $k - } - ::set f [::open $filename r] - while {1} { - set position [tell $f] - if {!([gets $f line] >= 0)} { - break - } - - set k [lindex $keyList 0] - if {[string match $k* $line]} { - set lastLength [string length $line] - set keys($k) [concat $position $lastLength] - set lastKey $k - set lastPosition $position - set keyList [lreplace $keyList 0 0] - } elseif {[info exists lastKey]} { - set lastLength [expr $lastLength + [string length $line] + 1] - set keys($lastKey) [concat $lastPosition $lastLength] - } - } - ::close $f - - #parray keys - } - } - Storage=TextFile instproc exists key { - my instvar keys - info exists keys($key) - } - - Storage=TextFile instproc set args { - my instvar keys noreorg reorgCounter reorgMaxValue filename - ::set key [lindex $args 0] - ::set l [llength $args] - if {$l == 1} { ;# fetch - if {[::info exists keys($key)]} { - ::set f [::open $filename r] - #puts "***fetch -- $keys($key)" - seek $f [lindex $keys($key) 0] - ::set c [read $f [lindex $keys($key) 1]] - ::close $f - return [lindex $c 1] - } else { - error "no such variable '$key'" - } - } elseif {$l == 2} { ;# store - if {![::info exists noreorg] && [::info exists keys($key)]} { - ::incr reorgCounter - } - ::set f [::open $filename a+] - ::set position [tell $f] - #puts "***store -- putting [::list $key [lindex $args 1]] at $position" - ::set c [::list $key [lindex $args 1]] - puts $f $c - ::close $f - ::set keys($key) [::list $position [expr {[string length $c] + 1}]] - # parray keys - if {$reorgCounter > $reorgMaxValue} { - my reorganizeDB - } - } else { next } - } - - Storage=TextFile instproc names {} { - my array names keys - } - Storage=TextFile instproc close {} { - my instvar filename keys - my reorganizeDB - ::unset filename - ::unset keys - } - Storage=TextFile instproc unset key { - my instvar keys - if {[::info exists keys($key)]} { - ::unset keys($key) - } - my reorganizeDB - } - - Storage=TextFile instproc firstkey {} { - my instvar keys searchID - if {$searchID ne ""} { - array donesearch keys $searchID - } - ::set searchID [array startsearch keys] - return [array nextelement keys $searchID] - } - Storage=TextFile instproc nextkey {} { - my instvar keys searchID - if {$searchID eq ""} { - error "[self class]: firstkey was not invoked on storage search" - } - ::set elt [array nextelement keys $searchID] - if {$elt eq ""} { - # if array end is reach search is terminated automatically!! - ::set searchID "" - } - return $elt - } - - namespace export Storage=TextFile -} - -namespace import ::xotcl::store::textfile::* Index: xotcl/library/store/XOTclGdbm/Makefile =================================================================== diff -u -N --- xotcl/library/store/XOTclGdbm/Makefile (revision fce8f28780c2c91fc8320c5a480eb2b6031b3b5b) +++ xotcl/library/store/XOTclGdbm/Makefile (revision 0) @@ -1,433 +0,0 @@ -# Makefile.in -- -# -# This file is a Makefile for Sample TEA Extension. If it has the name -# "Makefile.in" then it is a template for a Makefile; to generate the -# actual Makefile, run "./configure", which is a configuration script -# generated by the "autoconf" program (constructs like "@foo@" will get -# replaced in the actual Makefile. -# -# Copyright (c) 1999 Scriptics Corporation. -# Copyright (c) 2002-2003 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,v 1.27 2007/09/13 15:21:54 neumann 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. -#======================================================================== - -#======================================================================== -# The names of the source files is defined in the configure script. -# The object files are used for linking into the final library. -# 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 = xotclgdbm.c -PKG_OBJECTS = xotclgdbm.o - -PKG_STUB_SOURCES = -PKG_STUB_OBJECTS = - -#======================================================================== -# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with -# this package that need to be installed, if any. -#======================================================================== - -PKG_TCL_SOURCES = - -#======================================================================== -# This is a list of public header files to be installed, if any. -#======================================================================== - -PKG_HEADERS = - -#======================================================================== -# "PKG_LIB_FILE" refers to the library (dynamic or static as per -# configuration options) composed of the named objects. -#======================================================================== - -PKG_LIB_FILE = libxotclgdbm1.2.dylib -PKG_STUB_LIB_FILE = libxotclgdbmstub1.2.a - -lib_BINARIES = $(PKG_LIB_FILE) -BINARIES = $(lib_BINARIES) - -SHELL = /bin/sh - -srcdir = . -prefix = /usr/local/aolserver-4.5 -exec_prefix = /usr/local/aolserver-4.5 - -bindir = ${exec_prefix}/bin -libdir = ${exec_prefix}/lib -datadir = ${prefix}/share -mandir = ${prefix}/man -includedir = ${prefix}/include - -DESTDIR = - -PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) -pkgdatadir = $(datadir)/$(PKG_DIR) -pkglibdir = $(libdir)/$(PKG_DIR) -pkgincludedir = $(includedir)/$(PKG_DIR) - -top_builddir = . - -INSTALL = /usr/bin/install -c -INSTALL_PROGRAM = ${INSTALL} -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_SCRIPT = ${INSTALL} - -PACKAGE_NAME = xotclgdbm -PACKAGE_VERSION = 1.2 -CC = gcc -CFLAGS_DEFAULT = -Os -CFLAGS_WARNING = -Wall -Wno-implicit-int -CLEANFILES = pkgIndex.tcl -EXEEXT = -LDFLAGS_DEFAULT = -prebind -headerpad_max_install_names -Wl,-search_paths_first -MAKE_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} -MAKE_SHARED_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} -MAKE_STATIC_LIB = ${STLIB_LD} $@ $(PKG_OBJECTS) -MAKE_STUB_LIB = ${STLIB_LD} $@ $(PKG_STUB_OBJECTS) -OBJEXT = o -RANLIB = : -RANLIB_STUB = ranlib -SHLIB_CFLAGS = -fno-common -SHLIB_LD = ${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT} -Wl,-single_module -SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@ -SHLIB_LD_LIBS = ${LIBS} -L/usr/local/aolserver-4.5/lib -ltclstub8.4 -STLIB_LD = ${AR} cr -TCL_DEFS = -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DHAVE_COREFOUNDATION=1 -DMAC_OSX_TCL=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_MTSAFE_GETHOSTBYNAME=1 -DHAVE_MTSAFE_GETHOSTBYADDR=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_COPYFILE=1 -DHAVE_LIBKERN_OSATOMIC_H=1 -DHAVE_OSSPINLOCKLOCK=1 -DHAVE_PTHREAD_ATFORK=1 -DUSE_VFORK=1 -DTCL_DEFAULT_ENCODING=\"utf-8\" -DTCL_LOAD_FROM_MEMORY=1 -DHAVE_AVAILABILITYMACROS_H=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -TCL_BIN_DIR = /usr/local/aolserver-4.5/lib -TCL_SRC_DIR = /usr/local/src/tcl8.4.14 -# This is necessary for packages that use private Tcl headers -#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ -# Not used, but retained for reference of what libs Tcl required -TCL_LIBS = ${DL_LIBS} ${LIBS} ${MATH_LIBS} - -#======================================================================== -# 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). -#======================================================================== - -EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) -TCLSH_ENV = TCL_LIBRARY=`echo $(TCL_SRC_DIR)/library` \ - DYLD_LIBRARY_PATH="$(EXTRA_PATH):$(DYLD_LIBRARY_PATH)" \ - PATH="$(EXTRA_PATH):$(PATH)" \ - TCLLIBPATH="$(top_builddir)" -TCLSH_PROG = /usr/local/aolserver-4.5/bin/tclsh8.4 -TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) -SHARED_BUILD = 1 - -INCLUDES = -I/Users/neumann/src/xotcl-1.5.5/generic -I./generic -I"/usr/local/aolserver-4.5/include" - -EXTRA_CFLAGS = - -# TCL_DEFS is not strictly need here, but if you remove it, then you -# must make sure that configure.in 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) -DPACKAGE_NAME=\"xotclgdbm\" -DPACKAGE_TARNAME=\"xotclgdbm\" -DPACKAGE_VERSION=\"1.2\" -DPACKAGE_STRING=\"xotclgdbm\ 1.2\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 $(EXTRA_CFLAGS) -DEFS = -DPACKAGE_NAME=\"xotclgdbm\" -DPACKAGE_TARNAME=\"xotclgdbm\" -DPACKAGE_VERSION=\"1.2\" -DPACKAGE_STRING=\"xotclgdbm\ 1.2\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 $(EXTRA_CFLAGS) - -CONFIG_CLEAN_FILES = Makefile - -CPPFLAGS = -LIBS = -L/Users/neumann/src/xotcl-1.5.5 -lxotclstub1.5.5 -L/Users/neumann/src/xotcl-1.5.5 -lxotcl1.5.5 -lgdbm -AR = ar -CFLAGS = -pipe ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - -#======================================================================== -# Start of user-definable TARGETS section -#======================================================================== - -#======================================================================== -# TEA TARGETS. Please note that the "libraries:" target refers to platform -# independent files, and the "binaries:" target inclues executable programs and -# platform-dependent libraries. Modify these targets so that they install -# the various pieces of your package. The make and install rules -# for the BINARIES that you specified above have already been done. -#======================================================================== - -all: binaries libraries doc - -#======================================================================== -# The binaries target builds executable programs, Windows .dll's, unix -# shared/static libraries, and any other platform-dependent files. -# The list of targets to build for "binaries:" is specified at the top -# of the Makefile, in the "BINARIES" variable. -#======================================================================== - -binaries: $(BINARIES) pkgIndex.tcl - -libraries: - -doc: - @echo "If you have documentation to create, place the commands to" - @echo "build the docs in the 'doc:' target. For example:" - @echo " xml2nroff sample.xml > sample.n" - @echo " xml2html sample.xml > sample.html" - -install: all install-binaries install-libraries install-doc - -install-binaries: binaries install-lib-binaries install-bin-binaries - if test "x$(SHARED_BUILD)" = "x1"; then \ - $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ - fi - -#======================================================================== -# This rule installs platform-independent files, such as header files. -#======================================================================== - -install-libraries: libraries - @mkdir -p $(DESTDIR)$(includedir) - @echo "Installing header files in $(DESTDIR)$(includedir)" - @if test -n "$(PKG_HEADERS)" ; then \ - for i in "$(PKG_HEADERS)" ; do \ - echo "Installing $(srcdir)/$$i" ; \ - $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ - done; \ - fi - -#======================================================================== -# Install documentation. Unix manpages should go in the $(mandir) -# directory. -#======================================================================== - -install-doc: doc -#install-doc: doc -# @mkdir -p $(DESTDIR)$(mandir)/mann -# @echo "Installing documentation in $(DESTDIR)$(mandir)" -# @for i in $(srcdir)/doc/*.n; do \ -# echo "Installing $$i"; \ -# rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ -# $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ -# done - -test: binaries libraries - $(TCLSH) `echo $(srcdir)/tests/all.tcl` $(TESTFLAGS) - -shell: binaries libraries - @$(TCLSH) $(SCRIPT) - -gdb: - $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) - -depend: - -#======================================================================== -# $(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". -# -# 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. -#======================================================================== - -$(PKG_LIB_FILE): $(PKG_OBJECTS) - -rm -f $(PKG_LIB_FILE) - ${MAKE_LIB} - $(RANLIB) $(PKG_LIB_FILE) - -$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) - -rm -f $(PKG_STUB_LIB_FILE) - ${MAKE_STUB_LIB} - $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# -# 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 `echo $(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:.... -#======================================================================== - -VPATH = $(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win - -.c.o: - $(COMPILE) -c `echo $<` -o $@ - -#======================================================================== -# Create the pkgIndex.tcl file. -# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but -# you may find that you need to customize the package. If so, either -# modify the -hand version, or create a pkgIndex.tcl.in file and have -# the configure script output the pkgIndex.tcl by editing configure.in. -#======================================================================== - -#pkgIndex.tcl: -# ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) - -pkgIndex.tcl: - (echo 'package ifneeded xotcl::store::gdbm $(PACKAGE_VERSION) \ - [list load [file join $$dir $(PKG_LIB_FILE)]]'\ - ) > pkgIndex.tcl - -#======================================================================== -# Distribution creation -# You may need to tweak this target to make it work correctly. -#======================================================================== - -#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar -COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) -DIST_ROOT = /tmp/dist -DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) - -dist-clean: - rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* - -dist: dist-clean - mkdir -p $(DIST_DIR) - cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ - $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ - $(DIST_DIR)/ - chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 - chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in - - cp -p $(srcdir)/*.[ch] $(DIST_DIR)/ - - mkdir $(DIST_DIR)/tclconfig - cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ - $(DIST_DIR)/tclconfig/ - chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 - chmod +x $(DIST_DIR)/tclconfig/install-sh - - list='demos doc generic library mac tests unix win'; \ - for p in $$list; do \ - if test -d $(srcdir)/$$p ; then \ - mkdir $(DIST_DIR)/$$p; \ - cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ - fi; \ - done - - (cd $(DIST_ROOT); $(COMPRESS);) - -#======================================================================== -# End of user-definable section -#======================================================================== - -#======================================================================== -# Don't modify the file to clean here. Instead, set the "CLEANFILES" -# variable in configure.in -#======================================================================== - -clean: - -test -z "$(BINARIES)" || rm -f $(BINARIES) - -rm -f *.$(OBJEXT) core *.core - -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 - -#======================================================================== -# 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) -# -# You should not have to modify this target. -#======================================================================== - -install-lib-binaries: - @mkdir -p $(DESTDIR)$(pkglibdir) - @list='$(lib_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ - stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ - if test "x$$stub" = "xstub"; then \ - echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ - else \ - echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ - fi; \ - ext=`echo $$p|sed -e "s/.*\.//"`; \ - if test "x$$ext" = "xdll"; then \ - 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; \ - fi; \ - fi; \ - 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; \ - done - -#======================================================================== -# 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. -# -# You should not have to modify this target, except to define bin_BINARIES -# above if necessary. -#======================================================================== - -install-bin-binaries: - @mkdir -p $(DESTDIR)$(bindir) - @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; \ - done - -.SUFFIXES: .c .$(OBJEXT) - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -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; \ - done - -.PHONY: all binaries clean depend distclean doc install libraries test - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Index: xotcl/library/store/XOTclGdbm/Makefile.in =================================================================== diff -u -N --- xotcl/library/store/XOTclGdbm/Makefile.in (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/library/store/XOTclGdbm/Makefile.in (revision 0) @@ -1,433 +0,0 @@ -# Makefile.in -- -# -# This file is a Makefile for Sample TEA Extension. If it has the name -# "Makefile.in" then it is a template for a Makefile; to generate the -# actual Makefile, run "./configure", which is a configuration script -# generated by the "autoconf" program (constructs like "@foo@" will get -# replaced in the actual Makefile. -# -# Copyright (c) 1999 Scriptics Corporation. -# Copyright (c) 2002-2003 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.5 2007/08/14 16:38:26 neumann 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. -#======================================================================== - -#======================================================================== -# The names of the source files is defined in the configure script. -# The object files are used for linking into the final library. -# 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@ - -PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ -PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ - -#======================================================================== -# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with -# this package that need to be installed, if any. -#======================================================================== - -PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ - -#======================================================================== -# This is a list of public header files to be installed, if any. -#======================================================================== - -PKG_HEADERS = @PKG_HEADERS@ - -#======================================================================== -# "PKG_LIB_FILE" refers to the library (dynamic or static as per -# configuration options) composed of the named objects. -#======================================================================== - -PKG_LIB_FILE = @PKG_LIB_FILE@ -PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ - -lib_BINARIES = $(PKG_LIB_FILE) -BINARIES = $(lib_BINARIES) - -SHELL = @SHELL@ - -srcdir = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -libdir = @libdir@ -datadir = @datadir@ -mandir = @mandir@ -includedir = @includedir@ - -DESTDIR = - -PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) -pkgdatadir = $(datadir)/$(PKG_DIR) -pkglibdir = $(libdir)/$(PKG_DIR) -pkgincludedir = $(includedir)/$(PKG_DIR) - -top_builddir = . - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ - -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -CC = @CC@ -CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ -CFLAGS_WARNING = @CFLAGS_WARNING@ -CLEANFILES = @CLEANFILES@ -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_FLAGS = @SHLIB_LD_FLAGS@ -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@ -# This is necessary for packages that use private Tcl headers -#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ -# Not used, but retained for reference of what libs Tcl required -TCL_LIBS = @TCL_LIBS@ - -#======================================================================== -# 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). -#======================================================================== - -EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) -TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ - @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ - PATH="$(EXTRA_PATH):$(PATH)" \ - TCLLIBPATH="$(top_builddir)" -TCLSH_PROG = @TCLSH_PROG@ -TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) -SHARED_BUILD = @SHARED_BUILD@ - -INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ - -EXTRA_CFLAGS = @PKG_CFLAGS@ - -# TCL_DEFS is not strictly need here, but if you remove it, then you -# must make sure that configure.in 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@ $(EXTRA_CFLAGS) -DEFS = @DEFS@ $(EXTRA_CFLAGS) - -CONFIG_CLEAN_FILES = Makefile - -CPPFLAGS = @CPPFLAGS@ -LIBS = @PKG_LIBS@ @LIBS@ -AR = ar -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - -#======================================================================== -# Start of user-definable TARGETS section -#======================================================================== - -#======================================================================== -# TEA TARGETS. Please note that the "libraries:" target refers to platform -# independent files, and the "binaries:" target inclues executable programs and -# platform-dependent libraries. Modify these targets so that they install -# the various pieces of your package. The make and install rules -# for the BINARIES that you specified above have already been done. -#======================================================================== - -all: binaries libraries doc - -#======================================================================== -# The binaries target builds executable programs, Windows .dll's, unix -# shared/static libraries, and any other platform-dependent files. -# The list of targets to build for "binaries:" is specified at the top -# of the Makefile, in the "BINARIES" variable. -#======================================================================== - -binaries: $(BINARIES) pkgIndex.tcl - -libraries: - -doc: - @echo "If you have documentation to create, place the commands to" - @echo "build the docs in the 'doc:' target. For example:" - @echo " xml2nroff sample.xml > sample.n" - @echo " xml2html sample.xml > sample.html" - -install: all install-binaries install-libraries install-doc - -install-binaries: binaries install-lib-binaries install-bin-binaries - if test "x$(SHARED_BUILD)" = "x1"; then \ - $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ - fi - -#======================================================================== -# This rule installs platform-independent files, such as header files. -#======================================================================== - -install-libraries: libraries - @mkdir -p $(DESTDIR)$(includedir) - @echo "Installing header files in $(DESTDIR)$(includedir)" - @if test -n "$(PKG_HEADERS)" ; then \ - for i in "$(PKG_HEADERS)" ; do \ - echo "Installing $(srcdir)/$$i" ; \ - $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ - done; \ - fi - -#======================================================================== -# Install documentation. Unix manpages should go in the $(mandir) -# directory. -#======================================================================== - -install-doc: doc -#install-doc: doc -# @mkdir -p $(DESTDIR)$(mandir)/mann -# @echo "Installing documentation in $(DESTDIR)$(mandir)" -# @for i in $(srcdir)/doc/*.n; do \ -# echo "Installing $$i"; \ -# rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ -# $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ -# done - -test: binaries libraries - $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) - -shell: binaries libraries - @$(TCLSH) $(SCRIPT) - -gdb: - $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) - -depend: - -#======================================================================== -# $(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". -# -# 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. -#======================================================================== - -$(PKG_LIB_FILE): $(PKG_OBJECTS) - -rm -f $(PKG_LIB_FILE) - ${MAKE_LIB} - $(RANLIB) $(PKG_LIB_FILE) - -$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) - -rm -f $(PKG_STUB_LIB_FILE) - ${MAKE_STUB_LIB} - $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# -# 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:.... -#======================================================================== - -VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win - -.c.@OBJEXT@: - $(COMPILE) -c `@CYGPATH@ $<` -o $@ - -#======================================================================== -# Create the pkgIndex.tcl file. -# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but -# you may find that you need to customize the package. If so, either -# modify the -hand version, or create a pkgIndex.tcl.in file and have -# the configure script output the pkgIndex.tcl by editing configure.in. -#======================================================================== - -#pkgIndex.tcl: -# ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) - -pkgIndex.tcl: - (echo 'package ifneeded xotcl::store::gdbm $(PACKAGE_VERSION) \ - [list load [file join $$dir $(PKG_LIB_FILE)]]'\ - ) > pkgIndex.tcl - -#======================================================================== -# Distribution creation -# You may need to tweak this target to make it work correctly. -#======================================================================== - -#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar -COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) -DIST_ROOT = /tmp/dist -DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) - -dist-clean: - rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* - -dist: dist-clean - mkdir -p $(DIST_DIR) - cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ - $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ - $(DIST_DIR)/ - chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 - chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in - - cp -p $(srcdir)/*.[ch] $(DIST_DIR)/ - - mkdir $(DIST_DIR)/tclconfig - cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ - $(DIST_DIR)/tclconfig/ - chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 - chmod +x $(DIST_DIR)/tclconfig/install-sh - - list='demos doc generic library mac tests unix win'; \ - for p in $$list; do \ - if test -d $(srcdir)/$$p ; then \ - mkdir $(DIST_DIR)/$$p; \ - cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ - fi; \ - done - - (cd $(DIST_ROOT); $(COMPRESS);) - -#======================================================================== -# End of user-definable section -#======================================================================== - -#======================================================================== -# Don't modify the file to clean here. Instead, set the "CLEANFILES" -# variable in configure.in -#======================================================================== - -clean: - -test -z "$(BINARIES)" || rm -f $(BINARIES) - -rm -f *.$(OBJEXT) core *.core - -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 - -#======================================================================== -# 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) -# -# You should not have to modify this target. -#======================================================================== - -install-lib-binaries: - @mkdir -p $(DESTDIR)$(pkglibdir) - @list='$(lib_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ - stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ - if test "x$$stub" = "xstub"; then \ - echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ - else \ - echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ - fi; \ - ext=`echo $$p|sed -e "s/.*\.//"`; \ - if test "x$$ext" = "xdll"; then \ - 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; \ - fi; \ - fi; \ - 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; \ - done - -#======================================================================== -# 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. -# -# You should not have to modify this target, except to define bin_BINARIES -# above if necessary. -#======================================================================== - -install-bin-binaries: - @mkdir -p $(DESTDIR)$(bindir) - @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; \ - done - -.SUFFIXES: .c .$(OBJEXT) - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -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; \ - done - -.PHONY: all binaries clean depend distclean doc install libraries test - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Index: xotcl/library/store/XOTclGdbm/Makefile.in--ok =================================================================== diff -u -N --- xotcl/library/store/XOTclGdbm/Makefile.in--ok (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/XOTclGdbm/Makefile.in--ok (revision 0) @@ -1,379 +0,0 @@ -# Makefile.in -- -# -# This file is a Makefile for Sample TEA Extension. If it has the name -# "Makefile.in" then it is a template for a Makefile; to generate the -# actual Makefile, run "./configure", which is a configuration script -# generated by the "autoconf" program (constructs like "@foo@" will get -# replaced in the actual Makefile. -# -# Copyright (c) 1999 Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: Makefile.in--ok,v 1.1 2004/05/23 22:50:39 neumann Exp $ - -#======================================================================== -# Edit the following few lines when writing a new extension -#======================================================================== - -configdir=$(srcdir)/../../../config - -#======================================================================== -# 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= -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. -#======================================================================== - -xotclgdbm_SOURCES = $(srcdir)/xotclgdbm.c -SOURCES = $(xotclgdbm_SOURCES) - -#======================================================================== -# Enumerate the names of the object files included in this package. -# These objects are created and linked into the final library. In -# most cases these object files will correspond to the source files -# above. -# -#======================================================================== - -xotclgdbm_OBJECTS = xotclgdbm.$(OBJEXT) -OBJECTS = $(xotclgdbm_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. -#======================================================================== - -xotclgdbm_LIB_FILE = @xotclgdbm_LIB_FILE@ -$(xotclgdbm_LIB_FILE)_OBJECTS = $(xotclgdbm_OBJECTS) - -#======================================================================== -# This is a list of header files to be installed -#======================================================================== - -GENERIC_HDRS= - -#======================================================================== -# Add additional lines to handle any additional AC_SUBST cases that -# have been added to the configure script. -#======================================================================== - -SAMPLE_NEW_VAR=@SAMPLE_NEW_VAR@ - -#======================================================================== -# Nothing of the variables below this line need to be changed. Please -# check the TARGETS section below to make sure the make targets are -# correct. -#======================================================================== - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_FLAG = -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : - -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ -CC = @CC@ -CFLAGS_DEBUG = @CFLAGS_DEBUG@ -CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ -CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ -CLEANFILES = @CLEANFILES@ -EXEEXT = @EXEEXT@ -LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ -LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ -LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ -MAKE_LIB = @MAKE_LIB@ -MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ -MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ -OBJEXT = @OBJEXT@ -RANLIB = @RANLIB@ -SHLIB_CFLAGS = @SHLIB_CFLAGS@ -SHLIB_LD = @SHLIB_LD@ -SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ -SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ -STLIB_LD = @STLIB_LD@ -TCL_BIN_DIR = @TCL_BIN_DIR@ -TCL_DEFS = @TCL_DEFS@ -TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ -TCL_LD_FLAGS = @TCL_LD_FLAGS@ -TCL_LIBS = @TCL_LIBS@ -TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ -TCL_SRC_DIR = @TCL_SRC_DIR@ -TCL_DBGX = @TCL_DBGX@ -TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ -TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ -TCL_TOOL_DIR_NATIVE = @TCL_TOOL_DIR_NATIVE@ -TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ -TCL_UNIX_DIR_NATIVE = @TCL_UNIX_DIR_NATIVE@ -TCL_WIN_DIR_NATIVE = @TCL_WIN_DIR_NATIVE@ -INCLUDE_DIR_NATIVE = @INCLUDE_DIR_NATIVE@ -TCL_BMAP_DIR_NATIVE = @TCL_BMAP_DIR_NATIVE@ -TCL_PLATFORM_DIR_NATIVE = @TCL_PLATFORM_DIR_NATIVE@ -TCL_GENERIC_DIR_NATIVE = @TCL_GENERIC_DIR_NATIVE@ -TCLSH_PROG = @TCLSH_PROG@ - -AUTOCONF = autoconf - -LDFLAGS = $(LDFLAGS_DEFAULT) - -INCLUDES = @TCL_INCLUDES@ - -EXTRA_CFLAGS = $(TCL_DEFS) $(PROTO_FLAGS) $(SECURITY_FLAGS) $(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) $(NO_DEPRECATED_FLAGS) - -DEFS = @DEFS@ $(EXTRA_CFLAGS) - -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(configdir)/mkinstalldirs -CONFIG_CLEAN_FILES = $(configdir)/mkIndex.tcl - -CPPFLAGS = @CPPFLAGS@ -LIBS = @LIBS@ -AR = ar -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -I@XOTCL_SRC_DIR@/generic -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ - -#======================================================================== -# Start of user-definable TARGETS section -#======================================================================== - -#======================================================================== -# TEA TARGETS. Please note that the "libraries:" target refers to platform -# independent files, and the "binaries:" target inclues executable programs and -# platform-dependent libraries. Modify these targets so that they install -# the various pieces of your package. The make and install rules -# for the BINARIES that you specified above have already been done. -#======================================================================== - -all: binaries libraries doc - -#======================================================================== -# The binaries target builds executable programs, Windows .dll's, unix -# shared/static libraries, and any other platform-dependent files. -# The list of targets to build for "binaries:" is specified at the top -# of the Makefile, in the "BINARIES" variable. -#======================================================================== - -binaries: - -libraries: $(srcdir)/../$(xotclgdbm_LIB_FILE) - -doc: - -install: all install-binaries install-libraries install-doc - -install-binaries: binaries install-lib-binaries install-bin-binaries - -#======================================================================== -# This rule installs platform-independent files, such as header files. -#======================================================================== - -install-libraries: libraries $(DESTDIR)$(includedir) - @if test ! -z $(GENERIC_HDRS) ; then \ - echo "Installing header files in $(DESTDIR)$(includedir)" ; \ - fi - @for i in $(GENERIC_HDRS) ; do \ - echo "Installing $$i" ; \ - $(INSTALL_DATA) $$i $(DESTDIR)$(includedir) ; \ - done; - -#======================================================================== -# Install documentation. Unix manpages should go in the $(mandir) -# directory. -#======================================================================== - -install-doc: - -test: - -depend: - -#======================================================================== -# Enumerate the names of the object files included in this package. -# These objects are created and linked into the final library. In -# most cases these object files will correspond to the source files -# above. -# -# $(exampleA_LIB_FILE) should be listed as part of the BINARIES variable -# at the top of the Makefile. That will ensure that this target is built -# when you run "make binaries". -# -# You shouldn't need to modify this target, except to change the package -# name from "exampleA" to your package's name. -#======================================================================== - -$(xotclgdbm_LIB_FILE): $(xotclgdbm_OBJECTS) - -rm -f $@ - @MAKE_LIB@ -lgdbm - $(RANLIB) $@ - -$(srcdir)/../$(xotclgdbm_LIB_FILE): $(xotclgdbm_LIB_FILE) - cp $< $@ - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# Unfortunately, there does not seem to be any other way to do this -# in a Makefile-independent way. We can't use VPATH because it picks up -# object files that may be located in the source directory. -# -# In the following lines, $(srcdir) refers to the toplevel directory -# containing your extension. If your sources are in a subdirectory, -# you will have to modify the paths to reflect this: -# -# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c -# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@ -#======================================================================== - -%.o: $(srcdir)/%.c - $(COMPILE) -c `@CYGPATH@ $<` -o $@ - -#======================================================================== -# End of user-definable section -#======================================================================== - -#======================================================================== -# Don't modify the file to clean here. Instead, set the "CLEANFILES" -# variable in configure.in -#======================================================================== - -clean: - @rm -f $(xotclgdbm_LIB_FILE) $(srcdir)/../$(xotclgdbm_LIB_FILE) \ - *.o core *.core *.$(OBJEXT) $(CLEANFILES) config.log - -distclean: clean - -rm -f *.tab.c - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -rm -f config.status - -#======================================================================== -# Install binary object libraries. On Windows this includes both .dll and -# .lib files. Because the .lib files are not explicitly listed anywhere, -# we need to deduce their existence from the .dll file of the same name. -# Additionally, the .dll files go into the bin directory, but the .lib -# files go into the lib directory. On Unix platforms, all library files -# go into the lib directory. In addition, this will generate the pkgIndex.tcl -# file in the install location (assuming it can find a usable tclsh8.2 shell) -# -# You should not have to modify this target. -#======================================================================== - -install-lib-binaries: $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) - @list='$(lib_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - ext=`echo $$p|sed -e "s/.*\.//"`; \ - if test "x$$ext" = "xdll"; then \ - echo " $(INSTALL_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)$(libdir)/$$lib"; \ - $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \ - fi; \ - else \ - echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \ - $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \ - fi; \ - else :; fi; \ - done - @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 -# $(TCLSH_PROG) $(configdir)/mkIndex.tcl - -#======================================================================== -# Install binary executables (e.g. .exe files) -# -# You should not have to modify this target. -#======================================================================== - -install-bin-binaries: $(DESTDIR)$(bindir) - @list='$(BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \ - $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \ - else :; fi; \ - done - -.SUFFIXES: .c .o .obj - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - - -uninstall-binaries: - @$(NORMAL_UNINSTALL) - list='$(BINARIES)'; for p in $$list; do \ - rm -f $(DESTDIR)$(libdir)/$$p; \ - done - -$(DESTDIR)$(includedir): - $(mkinstalldirs) $@ -$(DESTDIR)$(libdir): - $(mkinstalldirs) $@ -$(DESTDIR)$(bindir): - $(mkinstalldirs) $@ - -.PHONY: all binaries clean depend distclean doc install libraries test - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Index: xotcl/library/store/XOTclGdbm/aclocal.m4 =================================================================== diff -u -N --- xotcl/library/store/XOTclGdbm/aclocal.m4 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/XOTclGdbm/aclocal.m4 (revision 0) @@ -1,3 +0,0 @@ -builtin(include,xotcl.m4) -builtin(include,tcl.m4) - Index: xotcl/library/store/XOTclGdbm/config.log =================================================================== diff -u -N --- xotcl/library/store/XOTclGdbm/config.log (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/XOTclGdbm/config.log (revision 0) @@ -1,1026 +0,0 @@ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by xotclgdbm configure 1.2, which was -generated by GNU Autoconf 2.57. Invocation command line was - - $ ./configure --prefix=/usr --enable-threads --prefix=/usr --with-all --cache-file=/dev/null --srcdir=. - -## --------- ## -## Platform. ## -## --------- ## - -hostname = localhost.localdomain -uname -m = i686 -uname -r = 2.4.22-1.2188.nptl -uname -s = Linux -uname -v = #1 Wed Apr 21 20:36:05 EDT 2004 - -/usr/bin/uname -p = unknown -/bin/uname -X = unknown - -/bin/arch = i686 -/usr/bin/arch -k = unknown -/usr/convex/getsysinfo = unknown -hostinfo = unknown -/bin/machine = unknown -/usr/bin/oslevel = unknown -/bin/universe = unknown - -PATH: . -PATH: /home/neumann/bin -PATH: . -PATH: /home/neumann/bin -PATH: /usr/local/bin -PATH: /usr/bin -PATH: /bin -PATH: /usr/X11R6/bin -PATH: /usr/X11R6/bin -PATH: /sbin -PATH: /usr/sbin -PATH: /opt/bin -PATH: /usr/X11R6/bin -PATH: /sbin -PATH: /usr/sbin -PATH: /opt/bin - - -## ----------- ## -## Core tests. ## -## ----------- ## - -configure:1294: checking for correct TEA configuration -configure:1313: result: ok -configure:1433: checking for Tcl configuration -configure:1505: result: found /usr/lib/tclConfig.sh -configure:1511: checking for existence of /usr/lib/tclConfig.sh -configure:1515: result: loading -configure:1670: checking for gcc -configure:1686: found /usr/bin/gcc -configure:1696: result: gcc -configure:1940: checking for C compiler version -configure:1943: gcc --version &5 -gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1) -Copyright (C) 2003 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -configure:1946: $? = 0 -configure:1948: gcc -v &5 -Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs -Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux -Thread model: posix -gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) -configure:1951: $? = 0 -configure:1953: gcc -V &5 -gcc: `-V' option must have argument -configure:1956: $? = 1 -configure:1980: checking for C compiler default output -configure:1983: gcc conftest.c >&5 -configure:1986: $? = 0 -configure:2032: result: a.out -configure:2037: checking whether the C compiler works -configure:2043: ./a.out -configure:2046: $? = 0 -configure:2063: result: yes -configure:2070: checking whether we are cross compiling -configure:2072: result: no -configure:2075: checking for suffix of executables -configure:2077: gcc -o conftest conftest.c >&5 -configure:2080: $? = 0 -configure:2105: result: -configure:2111: checking for suffix of object files -configure:2133: gcc -c conftest.c >&5 -configure:2136: $? = 0 -configure:2158: result: o -configure:2162: checking whether we are using the GNU C compiler -configure:2187: gcc -c conftest.c >&5 -configure:2190: $? = 0 -configure:2193: test -s conftest.o -configure:2196: $? = 0 -configure:2209: result: yes -configure:2215: checking whether gcc accepts -g -configure:2237: gcc -c -g conftest.c >&5 -configure:2240: $? = 0 -configure:2243: test -s conftest.o -configure:2246: $? = 0 -configure:2257: result: yes -configure:2274: checking for gcc option to accept ANSI C -configure:2335: gcc -c conftest.c >&5 -configure:2338: $? = 0 -configure:2341: test -s conftest.o -configure:2344: $? = 0 -configure:2362: result: none needed -configure:2380: gcc -c conftest.c >&5 -conftest.c:2: error: syntax error before "me" -configure:2383: $? = 1 -configure: failed program was: -| #ifndef __cplusplus -| choke me -| #endif -configure:2497: checking how to run the C preprocessor -configure:2533: gcc -E conftest.c -configure:2539: $? = 0 -configure:2571: gcc -E conftest.c -configure:2570:28: ac_nonexistent.h: No such file or directory -configure:2577: $? = 1 -configure: failed program was: -| #line 2562 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclgdbm" -| #define PACKAGE_TARNAME "xotclgdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclgdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| /* end confdefs.h. */ -| #include -configure:2615: result: gcc -E -configure:2640: gcc -E conftest.c -configure:2646: $? = 0 -configure:2678: gcc -E conftest.c -configure:2677:28: ac_nonexistent.h: No such file or directory -configure:2684: $? = 1 -configure: failed program was: -| #line 2669 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclgdbm" -| #define PACKAGE_TARNAME "xotclgdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclgdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| /* end confdefs.h. */ -| #include -configure:2739: checking for a BSD-compatible install -configure:2793: result: /usr/bin/install -c -configure:2809: checking whether make sets $(MAKE) -configure:2829: result: yes -configure:2884: checking for ranlib -configure:2900: found /usr/bin/ranlib -configure:2911: result: ranlib -configure:2933: checking for egrep -configure:2943: result: grep -E -configure:2948: checking for ANSI C header files -configure:2974: gcc -c conftest.c >&5 -configure:2977: $? = 0 -configure:2980: test -s conftest.o -configure:2983: $? = 0 -configure:3072: gcc -o conftest conftest.c >&5 -configure:3075: $? = 0 -configure:3077: ./conftest -configure:3080: $? = 0 -configure:3095: result: yes -configure:3119: checking for sys/types.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for sys/stat.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for stdlib.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for string.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for memory.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for strings.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for inttypes.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for stdint.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for unistd.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3178: checking if the compiler understands -pipe -configure:3199: gcc -pipe -c conftest.c >&5 -configure:3202: $? = 0 -configure:3205: test -s conftest.o -configure:3208: $? = 0 -configure:3210: result: yes -configure:3228: checking for required early compiler flags -configure:3252: gcc -pipe -c conftest.c >&5 -configure:3255: $? = 0 -configure:3258: test -s conftest.o -configure:3261: $? = 0 -configure:3338: gcc -pipe -c conftest.c >&5 -configure: In function `main': -configure:3343: error: storage size of `buf' isn't known -configure:3341: $? = 1 -configure: failed program was: -| #line 3321 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclgdbm" -| #define PACKAGE_TARNAME "xotclgdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclgdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| /* end confdefs.h. */ -| #include -| int -| main () -| { -| struct stat64 buf; int i = stat64("/", &buf); -| ; -| return 0; -| } -configure:3372: gcc -pipe -c conftest.c >&5 -configure:3375: $? = 0 -configure:3378: test -s conftest.o -configure:3381: $? = 0 -configure:3407: result: _LARGEFILE64_SOURCE -configure:3412: checking for 64-bit integer type -configure:3435: gcc -pipe -c conftest.c >&5 -configure: In function `main': -configure:3441: error: `__int64' undeclared (first use in this function) -configure:3441: error: (Each undeclared identifier is reported only once -configure:3441: error: for each function it appears in.) -configure:3441: error: syntax error before "value" -configure:3438: $? = 1 -configure: failed program was: -| #line 3418 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclgdbm" -| #define PACKAGE_TARNAME "xotclgdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclgdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| /* end confdefs.h. */ -| -| int -| main () -| { -| __int64 value = (__int64) 0; -| ; -| return 0; -| } -configure:3471: gcc -pipe -o conftest conftest.c >&5 -configure:3474: $? = 0 -configure:3476: ./conftest -configure:3479: $? = 0 -configure:3507: result: long long -configure:3511: checking for struct dirent64 -configure:3535: gcc -pipe -c conftest.c >&5 -configure:3538:24: sys/dirent.h: No such file or directory -configure: In function `main': -configure:3542: error: storage size of `p' isn't known -configure:3538: $? = 1 -configure: failed program was: -| #line 3517 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclgdbm" -| #define PACKAGE_TARNAME "xotclgdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclgdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| /* end confdefs.h. */ -| #include -| #include -| int -| main () -| { -| struct dirent64 p; -| ; -| return 0; -| } -configure:3562: result: no -configure:3565: checking for struct stat64 -configure:3589: gcc -pipe -c conftest.c >&5 -configure:3592: $? = 0 -configure:3595: test -s conftest.o -configure:3598: $? = 0 -configure:3616: result: yes -configure:3619: checking for off64_t -configure:3643: gcc -pipe -c conftest.c >&5 -configure:3646: $? = 0 -configure:3649: test -s conftest.o -configure:3652: $? = 0 -configure:3670: result: yes -configure:3674: checking whether byte ordering is bigendian -configure:3702: gcc -pipe -c conftest.c >&5 -configure:3705: $? = 0 -configure:3708: test -s conftest.o -configure:3711: $? = 0 -configure:3736: gcc -pipe -c conftest.c >&5 -configure: In function `main': -configure:3743: error: `not' undeclared (first use in this function) -configure:3743: error: (Each undeclared identifier is reported only once -configure:3743: error: for each function it appears in.) -configure:3743: error: syntax error before "big" -configure:3739: $? = 1 -configure: failed program was: -| #line 3714 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclgdbm" -| #define PACKAGE_TARNAME "xotclgdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclgdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| #include -| #include -| -| int -| main () -| { -| #if BYTE_ORDER != BIG_ENDIAN -| not big endian -| #endif -| -| ; -| return 0; -| } -configure:3859: result: no -configure:3887: checking for sin -configure:3937: gcc -pipe -o conftest conftest.c >&5 -configure:3930: warning: conflicting types for built-in function `sin' -/tmp/ccNx6b7V.o(.text+0x16): In function `main': -: undefined reference to `sin' -/tmp/ccNx6b7V.o(.data+0x0): undefined reference to `sin' -collect2: ld returned 1 exit status -configure:3940: $? = 1 -configure: failed program was: -| #line 3892 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclgdbm" -| #define PACKAGE_TARNAME "xotclgdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclgdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char sin (); below. -| Prefer to if __STDC__ is defined, since -| exists even on freestanding compilers. */ -| #ifdef __STDC__ -| # include -| #else -| # include -| #endif -| /* Override any gcc2 internal prototype to avoid an error. */ -| #ifdef __cplusplus -| extern "C" -| { -| #endif -| /* We use char because int might match the return type of a gcc2 -| builtin and then its argument prototype would still apply. */ -| char sin (); -| /* The GNU C library defines this for functions which it implements -| to always fail with ENOSYS. Some functions are actually named -| something starting with __ and the normal name is an alias. */ -| #if defined (__stub_sin) || defined (__stub___sin) -| choke me -| #else -| char (*f) () = sin; -| #endif -| #ifdef __cplusplus -| } -| #endif -| -| int -| main () -| { -| return f != sin; -| ; -| return 0; -| } -configure:3957: result: no -configure:3965: checking for main in -lieee -configure:3990: gcc -pipe -o conftest conftest.c -lieee >&5 -configure:3993: $? = 0 -configure:3996: test -s conftest -configure:3999: $? = 0 -configure:4011: result: yes -configure:4023: checking for main in -linet -configure:4048: gcc -pipe -o conftest conftest.c -linet >&5 -/usr/bin/ld: cannot find -linet -collect2: ld returned 1 exit status -configure:4051: $? = 1 -configure: failed program was: -| #line 4030 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclgdbm" -| #define PACKAGE_TARNAME "xotclgdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclgdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| -| -| int -| main () -| { -| main (); -| ; -| return 0; -| } -configure:4069: result: no -configure:4085: checking net/errno.h usability -configure:4098: gcc -pipe -c conftest.c >&5 -configure:4143:23: net/errno.h: No such file or directory -configure:4101: $? = 1 -configure: failed program was: -| #line 4087 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclgdbm" -| #define PACKAGE_TARNAME "xotclgdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclgdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| #include -| #if HAVE_SYS_TYPES_H -| # include -| #endif -| #if HAVE_SYS_STAT_H -| # include -| #endif -| #if STDC_HEADERS -| # include -| # include -| #else -| # if HAVE_STDLIB_H -| # include -| # endif -| #endif -| #if HAVE_STRING_H -| # if !STDC_HEADERS && HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #if HAVE_STRINGS_H -| # include -| #endif -| #if HAVE_INTTYPES_H -| # include -| #else -| # if HAVE_STDINT_H -| # include -| # endif -| #endif -| #if HAVE_UNISTD_H -| # include -| #endif -| #include -configure:4117: result: no -configure:4121: checking net/errno.h presence -configure:4132: gcc -E conftest.c -configure:4145:23: net/errno.h: No such file or directory -configure:4138: $? = 1 -configure: failed program was: -| #line 4123 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclgdbm" -| #define PACKAGE_TARNAME "xotclgdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclgdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| #include -configure:4157: result: no -configure:4193: checking for net/errno.h -configure:4200: result: no -configure:4232: checking for connect -configure:4282: gcc -pipe -o conftest conftest.c >&5 -configure:4285: $? = 0 -configure:4288: test -s conftest -configure:4291: $? = 0 -configure:4302: result: yes -configure:4531: checking for gethostbyname -configure:4581: gcc -pipe -o conftest conftest.c >&5 -configure:4584: $? = 0 -configure:4587: test -s conftest -configure:4590: $? = 0 -configure:4601: result: yes -configure:4675: checking dirent.h -configure:4713: gcc -pipe -o conftest conftest.c >&5 -configure:4716: $? = 0 -configure:4719: test -s conftest -configure:4722: $? = 0 -configure:4740: result: yes -configure:4752: checking errno.h usability -configure:4765: gcc -pipe -c conftest.c >&5 -configure:4768: $? = 0 -configure:4771: test -s conftest.o -configure:4774: $? = 0 -configure:4784: result: yes -configure:4788: checking errno.h presence -configure:4799: gcc -E conftest.c -configure:4805: $? = 0 -configure:4824: result: yes -configure:4860: checking for errno.h -configure:4867: result: yes -configure:4891: checking float.h usability -configure:4904: gcc -pipe -c conftest.c >&5 -configure:4907: $? = 0 -configure:4910: test -s conftest.o -configure:4913: $? = 0 -configure:4923: result: yes -configure:4927: checking float.h presence -configure:4938: gcc -E conftest.c -configure:4944: $? = 0 -configure:4963: result: yes -configure:4999: checking for float.h -configure:5006: result: yes -configure:5030: checking values.h usability -configure:5043: gcc -pipe -c conftest.c >&5 -configure:5046: $? = 0 -configure:5049: test -s conftest.o -configure:5052: $? = 0 -configure:5062: result: yes -configure:5066: checking values.h presence -configure:5077: gcc -E conftest.c -configure:5083: $? = 0 -configure:5102: result: yes -configure:5138: checking for values.h -configure:5145: result: yes -configure:5169: checking limits.h usability -configure:5182: gcc -pipe -c conftest.c >&5 -configure:5185: $? = 0 -configure:5188: test -s conftest.o -configure:5191: $? = 0 -configure:5201: result: yes -configure:5205: checking limits.h presence -configure:5216: gcc -E conftest.c -configure:5222: $? = 0 -configure:5241: result: yes -configure:5277: checking for limits.h -configure:5284: result: yes -configure:5299: checking for stdlib.h -configure:5304: result: yes -configure:5495: checking for string.h -configure:5500: result: yes -configure:5687: checking sys/wait.h usability -configure:5700: gcc -pipe -c conftest.c >&5 -configure:5703: $? = 0 -configure:5706: test -s conftest.o -configure:5709: $? = 0 -configure:5719: result: yes -configure:5723: checking sys/wait.h presence -configure:5734: gcc -E conftest.c -configure:5740: $? = 0 -configure:5759: result: yes -configure:5795: checking for sys/wait.h -configure:5802: result: yes -configure:5826: checking dlfcn.h usability -configure:5839: gcc -pipe -c conftest.c >&5 -configure:5842: $? = 0 -configure:5845: test -s conftest.o -configure:5848: $? = 0 -configure:5858: result: yes -configure:5862: checking dlfcn.h presence -configure:5873: gcc -E conftest.c -configure:5879: $? = 0 -configure:5898: result: yes -configure:5934: checking for dlfcn.h -configure:5941: result: yes -configure:5967: checking for limits.h -configure:5972: result: yes -configure:5967: checking for unistd.h -configure:5972: result: yes -configure:5976: checking sys/param.h usability -configure:5989: gcc -pipe -c conftest.c >&5 -configure:5992: $? = 0 -configure:5995: test -s conftest.o -configure:5998: $? = 0 -configure:6008: result: yes -configure:6012: checking sys/param.h presence -configure:6023: gcc -E conftest.c -configure:6029: $? = 0 -configure:6048: result: yes -configure:6084: checking for sys/param.h -configure:6091: result: yes -configure:6181: checking for XOTcl configuration -configure:6242: result: found /home/neumann/xotcl-1.2.1/xotclConfig.sh -configure:6248: checking for existence of /home/neumann/xotcl-1.2.1/xotclConfig.sh -configure:6252: result: loading -configure:6421: checking for Tcl public headers -configure:6476: result: /usr/include -configure:6524: checking for pthread_mutex_init in -lpthread -configure:6555: gcc -pipe -o conftest conftest.c -lpthread >&5 -configure:6558: $? = 0 -configure:6561: test -s conftest -configure:6564: $? = 0 -configure:6576: result: yes -configure:6863: checking for pthread_attr_setstacksize -configure:6913: gcc -pipe -o conftest conftest.c -lpthread >&5 -configure:6916: $? = 0 -configure:6919: test -s conftest -configure:6922: $? = 0 -configure:6933: result: yes -configure:6948: checking for readdir_r -configure:6998: gcc -pipe -o conftest conftest.c >&5 -configure:7001: $? = 0 -configure:7004: test -s conftest -configure:7007: $? = 0 -configure:7018: result: yes -configure:7033: checking for building with threads -configure:7040: result: yes -configure:7079: checking how to build libraries -configure:7097: result: shared -configure:7123: checking if 64bit support is enabled -configure:7132: result: no -configure:7137: checking if 64bit Sparc VIS support is requested -configure:7146: result: no -configure:7174: checking system version (for dynamic loading) -configure:7197: result: Linux-2.4.22-1.2188.nptl -configure:7205: checking for dlopen in -ldl -configure:7236: gcc -pipe -o conftest conftest.c -ldl >&5 -configure:7239: $? = 0 -configure:7242: test -s conftest -configure:7245: $? = 0 -configure:7257: result: yes -configure:7287: checking for ar -configure:7303: found /usr/bin/ar -configure:7313: result: ar -configure:9199: checking for build with symbols -configure:9213: result: no -configure:9348: checking for tclsh -configure:9379: result: /usr/lib/../bin/tclsh8.4 -configure:9523: creating ./config.status - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by xotclgdbm config.status 1.2, which was -generated by GNU Autoconf 2.57. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status - -on localhost.localdomain - -config.status:675: creating Makefile - -## ---------------- ## -## Cache variables. ## -## ---------------- ## - -ac_cv_c_bigendian=no -ac_cv_c_compiler_gnu=yes -ac_cv_c_tclconfig=/usr/lib -ac_cv_c_tclh=/usr/include -ac_cv_c_xotclconfig=/home/neumann/xotcl-1.2.1 -ac_cv_env_CC_set= -ac_cv_env_CC_value= -ac_cv_env_CFLAGS_set= -ac_cv_env_CFLAGS_value= -ac_cv_env_CPPFLAGS_set= -ac_cv_env_CPPFLAGS_value= -ac_cv_env_CPP_set= -ac_cv_env_CPP_value= -ac_cv_env_LDFLAGS_set= -ac_cv_env_LDFLAGS_value= -ac_cv_env_build_alias_set= -ac_cv_env_build_alias_value= -ac_cv_env_host_alias_set= -ac_cv_env_host_alias_value= -ac_cv_env_target_alias_set= -ac_cv_env_target_alias_value= -ac_cv_exeext= -ac_cv_func_connect=yes -ac_cv_func_gethostbyname=yes -ac_cv_func_pthread_attr_setstacksize=yes -ac_cv_func_readdir_r=yes -ac_cv_func_sin=no -ac_cv_header_dlfcn_h=yes -ac_cv_header_errno_h=yes -ac_cv_header_float_h=yes -ac_cv_header_inttypes_h=yes -ac_cv_header_limits_h=yes -ac_cv_header_memory_h=yes -ac_cv_header_net_errno_h=no -ac_cv_header_stdc=yes -ac_cv_header_stdint_h=yes -ac_cv_header_stdlib_h=yes -ac_cv_header_string_h=yes -ac_cv_header_strings_h=yes -ac_cv_header_sys_param_h=yes -ac_cv_header_sys_stat_h=yes -ac_cv_header_sys_types_h=yes -ac_cv_header_sys_wait_h=yes -ac_cv_header_unistd_h=yes -ac_cv_header_values_h=yes -ac_cv_lib_dl_dlopen=yes -ac_cv_lib_ieee_main=yes -ac_cv_lib_inet_main=no -ac_cv_lib_pthread_pthread_mutex_init=yes -ac_cv_objext=o -ac_cv_path_install='/usr/bin/install -c' -ac_cv_path_tclsh=/usr/lib/../bin/tclsh8.4 -ac_cv_prog_AR=ar -ac_cv_prog_CPP='gcc -E' -ac_cv_prog_ac_ct_CC=gcc -ac_cv_prog_ac_ct_RANLIB=ranlib -ac_cv_prog_cc_g=yes -ac_cv_prog_cc_stdc= -ac_cv_prog_egrep='grep -E' -ac_cv_prog_make_make_set=yes -tcl_cv_flag__isoc99_source=no -tcl_cv_flag__largefile64_source=yes -tcl_cv_struct_dirent64=no -tcl_cv_struct_stat64=yes -tcl_cv_type_64bit='long long' -tcl_cv_type_off64_t=yes - -## ----------------- ## -## Output variables. ## -## ----------------- ## - -AR='ar' -CC='gcc -pipe' -CFLAGS=' ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' -CFLAGS_DEBUG='-g' -CFLAGS_DEFAULT='-O' -CFLAGS_OPTIMIZE='-O' -CFLAGS_WARNING='-Wall -Wconversion -Wno-implicit-int' -CLEANFILES='pkgIndex.tcl' -CPP='gcc -E' -CPPFLAGS='' -CYGPATH='echo' -DEFS='-DPACKAGE_NAME=\"xotclgdbm\" -DPACKAGE_TARNAME=\"xotclgdbm\" -DPACKAGE_VERSION=\"1.2\" -DPACKAGE_STRING=\"xotclgdbm\ 1.2\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -DTCL_THREADS=1 -DUSE_TCL_STUBS=1 ' -DL_LIBS='-ldl' -ECHO_C='' -ECHO_N='-n' -ECHO_T='' -EGREP='grep -E' -EXEEXT='' -EXTRA_CFLAGS='' -INSTALL_DATA='${INSTALL} -m 644' -INSTALL_PROGRAM='${INSTALL}' -INSTALL_SCRIPT='${INSTALL}' -LDFLAGS='-rdynamic' -LDFLAGS_DEBUG='' -LDFLAGS_DEFAULT='-rdynamic' -LDFLAGS_OPTIMIZE='' -LD_LIBRARY_PATH_VAR='LD_LIBRARY_PATH' -LIBOBJS='' -LIBS='' -LTLIBOBJS='' -MAKE_LIB='${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_FLAGS} ${SHLIB_LD_LIBS} ' -MAKE_SHARED_LIB='${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_FLAGS} ${SHLIB_LD_LIBS}' -MAKE_STATIC_LIB='${STLIB_LD} $@ $(PKG_OBJECTS)' -MAKE_STUB_LIB='${STLIB_LD} $@ $(PKG_STUB_OBJECTS)' -MATH_LIBS='-lieee -lm' -OBJEXT='o' -PACKAGE_BUGREPORT='' -PACKAGE_NAME='xotclgdbm' -PACKAGE_STRING='xotclgdbm 1.2' -PACKAGE_TARNAME='xotclgdbm' -PACKAGE_VERSION='1.2' -PATH_SEPARATOR=':' -PKG_CFLAGS=' ' -PKG_HEADERS='' -PKG_INCLUDES=' -I/home/neumann/xotcl-1.2.1/generic' -PKG_LIBS=' -L/home/neumann/xotcl-1.2.1 -lxotclstub1.2.1 -lgdbm' -PKG_LIB_FILE='libxotclgdbm1.2.so' -PKG_OBJECTS=' xotclgdbm.o' -PKG_SOURCES=' xotclgdbm.c' -PKG_STUB_LIB_FILE='libxotclgdbmstub1.2.a' -PKG_STUB_OBJECTS='' -PKG_STUB_SOURCES='' -PKG_TCL_SOURCES='' -RANLIB=':' -RANLIB_STUB='ranlib' -SET_MAKE='' -SHARED_BUILD='1' -SHELL='/bin/sh' -SHLIB_CFLAGS='-fPIC' -SHLIB_LD='gcc -pipe -shared' -SHLIB_LD_FLAGS='' -SHLIB_LD_LIBS='${LIBS} -L/usr/lib -ltclstub8.4' -STLIB_LD='${AR} cr' -TCLSH_PROG='/usr/lib/../bin/tclsh8.4' -TCL_BIN_DIR='/usr/lib' -TCL_DBGX='' -TCL_DEFS=' -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DPEEK_XCLOSEIM=1 -DHAVE_SYS_IOCTL_H=1 ' -TCL_EXTRA_CFLAGS='' -TCL_INCLUDES='-I"/usr/include"' -TCL_LD_FLAGS='-rdynamic' -TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' -TCL_LIB_FILE='libtcl8.4.so' -TCL_LIB_FLAG='-ltcl8.4' -TCL_LIB_SPEC='-L/usr/lib -ltcl8.4' -TCL_SHLIB_LD_LIBS='${LIBS}' -TCL_SRC_DIR='/home/neumann/tcl8.4.5' -TCL_STUB_LIB_FILE='libtclstub8.4.a' -TCL_STUB_LIB_FLAG='-ltclstub8.4' -TCL_STUB_LIB_SPEC='-L/usr/lib -ltclstub8.4' -TCL_THREADS='1' -TCL_VERSION='8.4' -XOTCL_BUILD_LIB_SPEC='-L/home/neumann/xotcl-1.2.1 -lxotcl1.2.1' -XOTCL_BUILD_STUB_LIB_SPEC='-L/home/neumann/xotcl-1.2.1 -lxotclstub1.2.1' -XOTCL_LIB_FILE='libxotcl1.2.1.so' -XOTCL_LIB_SPEC='-L/usr/lib -lxotcl1.2.1' -XOTCL_MAJOR_VERSION='1' -XOTCL_MINOR_VERSION='2' -XOTCL_RELEASE_LEVEL='.1' -XOTCL_SRC_DIR='/home/neumann/xotcl-1.2.1' -XOTCL_STUB_LIB_FILE='' -XOTCL_STUB_LIB_SPEC='-L/usr/lib -lxotclstub1.2.1' -XOTCL_VERSION='1.2' -ac_ct_CC='gcc' -ac_ct_RANLIB='ranlib' -bindir='${exec_prefix}/bin' -build_alias='' -datadir='${prefix}/share' -exec_prefix='/usr' -host_alias='' -includedir='${prefix}/include' -infodir='${prefix}/info' -libdir='${exec_prefix}/lib' -libexecdir='${exec_prefix}/libexec' -localstatedir='${prefix}/var' -mandir='${prefix}/man' -oldincludedir='/usr/include' -prefix='/usr' -program_transform_name='s,x,x,' -sbindir='${exec_prefix}/sbin' -sharedstatedir='${prefix}/com' -sysconfdir='${prefix}/etc' -target_alias='' - -## ----------- ## -## confdefs.h. ## -## ----------- ## - -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 -#define HAVE_READDIR_R 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRUCT_STAT64 1 -#define HAVE_SYS_PARAM_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_TYPE_OFF64_T 1 -#define HAVE_UNISTD_H 1 -#define HAVE_UNISTD_H 1 -#define PACKAGE_BUGREPORT "" -#define PACKAGE_NAME "xotclgdbm" -#define PACKAGE_STRING "xotclgdbm 1.2" -#define PACKAGE_TARNAME "xotclgdbm" -#define PACKAGE_VERSION "1.2" -#define STDC_HEADERS 1 -#define TCL_THREADS 1 -#define TCL_WIDE_INT_TYPE long long -#define USE_TCL_STUBS 1 -#define USE_THREAD_ALLOC 1 -#define _LARGEFILE64_SOURCE 1 -#define _REENTRANT 1 -#define _THREAD_SAFE 1 - -configure: exit 0 Index: xotcl/library/store/XOTclGdbm/configure =================================================================== diff -u -N --- xotcl/library/store/XOTclGdbm/configure (revision caee4f272cfc744a06a7df61e2f3c73da1b6be64) +++ xotcl/library/store/XOTclGdbm/configure (revision 0) @@ -1,11000 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for xotclgdbm 1.2. -# -# Copyright (C) 2003 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_config_libobj_dir=. -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -# Identity of this package. -PACKAGE_NAME='xotclgdbm' -PACKAGE_TARNAME='xotclgdbm' -PACKAGE_VERSION='1.2' -PACKAGE_STRING='xotclgdbm 1.2' -PACKAGE_BUGREPORT='' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_STAT_H -# include -#endif -#if STDC_HEADERS -# include -# include -#else -# if HAVE_STDLIB_H -# include -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif -# include -#endif -#if HAVE_STRINGS_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif -#if HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG LTLIBOBJS' -ac_subst_files='' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures xotclgdbm 1.2 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -_ACEOF - - cat <<_ACEOF -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] -_ACEOF - - cat <<\_ACEOF -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of xotclgdbm 1.2:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-threads build with threads - --enable-shared build and link with shared libraries (default: on) - --enable-64bit enable 64bit support (default: off) - --enable-64bit-vis enable 64bit Sparc VIS support (default: off) - --enable-wince enable Win/CE support (where applicable) - --enable-load allow dynamic loading and "load" command (default: - on) - --enable-symbols build with debugging symbols (default: off) - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gdbm=GDBM_INCLUDE_DIR,GDBM_LIB_DIR - absolute path to gdbm.h and optionally the path to the library, - --without-gdbm disables build of Tcl Gdbm - --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH - absolute path to xotclConfig.sh, - --without-xotcl disables, but this is pointless - --with-tcl directory containing tcl configuration - (tclConfig.sh) - --with-tclinclude directory containing the public Tcl header files - --with-celib=DIR use Windows/CE support library from DIR - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\_ACEOF -xotclgdbm configure 1.2 -generated by GNU Autoconf 2.59 - -Copyright (C) 2003 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit 0 -fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by xotclgdbm $as_me 1.2, which was -generated by GNU Autoconf 2.59. Invocation command line was - - $ $0 $@ - -_ACEOF -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_sep= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - sed "/^$/d" confdefs.h | sort - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#-------------------------------------------------------------------- -# 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 extensions pass this us the version of TEA they think they - # are compatible with. - TEA_VERSION="3.6" - - echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 -echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 - if test x"${PACKAGE_NAME}" = x ; then - { { echo "$as_me:$LINENO: error: -The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 -echo "$as_me: error: -The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} - { (exit 1); exit 1; }; } - fi - if test x"3.5" = x ; then - { { echo "$as_me:$LINENO: error: -TEA version not specified." >&5 -echo "$as_me: error: -TEA version not specified." >&2;} - { (exit 1); exit 1; }; } - elif test "3.5" != "${TEA_VERSION}" ; then - echo "$as_me:$LINENO: result: warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&5 -echo "${ECHO_T}warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&6 - else - echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 -echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 - fi - case "`uname -s`" in - *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) - # Extract the first word of "cygpath", so it can be a program name with args. -set dummy cygpath; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CYGPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CYGPATH"; then - ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CYGPATH="cygpath -w" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" -fi -fi -CYGPATH=$ac_cv_prog_CYGPATH -if test -n "$CYGPATH"; then - echo "$as_me:$LINENO: result: $CYGPATH" >&5 -echo "${ECHO_T}$CYGPATH" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - EXEEXT=".exe" - TEA_PLATFORM="windows" - ;; - *) - CYGPATH=echo - EXEEXT="" - TEA_PLATFORM="unix" - ;; - esac - - # Check if exec_prefix is set. If not use fall back to prefix. - # Note when adjusted, so that TEA_PREFIX can correct for this. - # This is needed for recursive configures, since autoconf propagates - # $prefix, but not $exec_prefix (doh!). - if test x$exec_prefix = xNONE ; then - exec_prefix_default=yes - exec_prefix=$prefix - fi - - - - - # This package name must be replaced statically for AC_SUBST to work - - # Substitute STUB_LIB_FILE in case package creates a stub library too. - - - # We AC_SUBST these here to ensure they are subst'ed, - # in case the user doesn't call TEA_ADD_... - - - - - - - - - -ac_aux_dir= -for ac_dir in ../../../config $srcdir/../../../config; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../../config $srcdir/../../../config" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in ../../../config $srcdir/../../../config" >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - - -#-------------------------------------------------------------------- -# specify some extra flags -#-------------------------------------------------------------------- - -# Check whether --with-gdbm or --without-gdbm was given. -if test "${with_gdbm+set}" = set; then - withval="$with_gdbm" - with_gdbm=$withval -else - with_gdbm=no -fi; - - -# Check whether --with-xotcl or --without-xotcl was given. -if test "${with_xotcl+set}" = set; then - withval="$with_xotcl" - with_xotcl=$withval -else - { { echo "$as_me:$LINENO: error: --with-xotcl is required" >&5 -echo "$as_me: error: --with-xotcl is required" >&2;} - { (exit 1); exit 1; }; } -fi; - -#-------------------------------------------------------------------- -# Load the tclConfig.sh file -#-------------------------------------------------------------------- - - - - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - - if test x"${no_tcl}" = x ; then - # we reset no_tcl in case something fails here - no_tcl=true - -# Check whether --with-tcl or --without-tcl was given. -if test "${with_tcl+set}" = set; then - withval="$with_tcl" - with_tclconfig=${withval} -fi; - echo "$as_me:$LINENO: checking for Tcl configuration" >&5 -echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 - if test "${ac_cv_c_tclconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - case ${with_tclconfig} in - */tclConfig.sh ) - if test -f ${with_tclconfig}; then - { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 -echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} - with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 -echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} - { (exit 1); exit 1; }; } - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tcl.framework/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - -fi - - - if test x"${ac_cv_c_tclconfig}" = x ; then - TCL_BIN_DIR="# no Tcl configs found" - { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 -echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} - exit 0 - else - no_tcl= - TCL_BIN_DIR=${ac_cv_c_tclconfig} - echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 - fi - fi - - - echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 - - if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - echo "$as_me:$LINENO: result: loading" >&5 -echo "${ECHO_T}loading" >&6 - . "${TCL_BIN_DIR}/tclConfig.sh" - else - echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tcl.framework installed in an arbitary location. - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then - for i in "`cd ${TCL_BIN_DIR}; pwd`" \ - "`cd ${TCL_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then - TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" - break - fi - done - fi - if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then - TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" - TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - - - - - - - - - - - - - - - - - - - -#-------------------------------------------------------------------- -# Load the tkConfig.sh file if necessary (Tk extension) -#-------------------------------------------------------------------- - -#TEA_PATH_TKCONFIG -#TEA_LOAD_TKCONFIG - -#----------------------------------------------------------------------- -# Handle the --prefix=... option by defaulting to what Tcl gave. -# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. -#----------------------------------------------------------------------- - - - if test "${prefix}" = "NONE"; then - prefix_default=yes - if test x"${TCL_PREFIX}" != x; then - { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 -echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} - prefix=${TCL_PREFIX} - else - { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 -echo "$as_me: --prefix defaulting to /usr/local" >&6;} - prefix=/usr/local - fi - fi - if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ - -o x"${exec_prefix_default}" = x"yes" ; then - if test x"${TCL_EXEC_PREFIX}" != x; then - { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 -echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} - exec_prefix=${TCL_EXEC_PREFIX} - else - { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 -echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} - exec_prefix=$prefix - fi - fi - - -#----------------------------------------------------------------------- -# Standard compiler checks. -# This sets up CC by using the CC env var, or looks for gcc otherwise. -# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create -# the basic setup necessary to compile executables. -#----------------------------------------------------------------------- - - - # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) - # in this macro, they need to go into TEA_SETUP_COMPILER instead. - - # If the user did not set CFLAGS, set it now to keep - # the AC_PROG_CC macro from adding "-g -O2". - if test "${CFLAGS+set}" != "set" ; then - CFLAGS="" - fi - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - # Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - - #-------------------------------------------------------------------- - # Checks to see if the make program sets the $MAKE variable. - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\_ACEOF -all: - @echo 'ac_maketemp="$(MAKE)"' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftest.make -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SET_MAKE= -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - - #-------------------------------------------------------------------- - # Find ranlib - #-------------------------------------------------------------------- - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - - - #-------------------------------------------------------------------- - # Determines the correct binary file extension (.o, .obj, .exe etc.) - #-------------------------------------------------------------------- - - - - - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. - - - #------------------------------------------------------------------------ - # If we're using GCC, see if the compiler understands -pipe. If so, use it. - # It makes compiling go faster. (This is only a performance feature.) - #------------------------------------------------------------------------ - - if test -z "$no_pipe" -a -n "$GCC"; then - echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 -echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 -if test "${tcl_cv_cc_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_pipe=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_pipe=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 -echo "${ECHO_T}$tcl_cv_cc_pipe" >&6 - if test $tcl_cv_cc_pipe = yes; then - CFLAGS="$CFLAGS -pipe" - fi - fi - - #-------------------------------------------------------------------- - # Common compiler flag setup - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_bigendian=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -# It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - - if test "${TEA_PLATFORM}" = "unix" ; then - - #-------------------------------------------------------------------- - # On a few very rare systems, all of the libm.a stuff is - # already in libc.a. Set compiler flags accordingly. - # Also, Linux requires the "ieee" library for math to work - # right (and it must appear before "-lm"). - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking for sin" >&5 -echo $ECHO_N "checking for sin... $ECHO_C" >&6 -if test "${ac_cv_func_sin+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define sin to an innocuous variant, in case declares sin. - For example, HP-UX 11i declares gettimeofday. */ -#define sin innocuous_sin - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char sin (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef sin - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char sin (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_sin) || defined (__stub___sin) -choke me -#else -char (*f) () = sin; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != sin; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_sin=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_sin=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 -echo "${ECHO_T}$ac_cv_func_sin" >&6 -if test $ac_cv_func_sin = yes; then - MATH_LIBS="" -else - MATH_LIBS="-lm" -fi - - echo "$as_me:$LINENO: checking for main in -lieee" >&5 -echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 -if test "${ac_cv_lib_ieee_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lieee $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_ieee_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_ieee_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 -echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 -if test $ac_cv_lib_ieee_main = yes; then - MATH_LIBS="-lieee $MATH_LIBS" -fi - - - #-------------------------------------------------------------------- - # Interactive UNIX requires -linet instead of -lsocket, plus it - # needs net/errno.h to define the socket-related error codes. - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking for main in -linet" >&5 -echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 -if test "${ac_cv_lib_inet_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-linet $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_inet_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_inet_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 -echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 -if test $ac_cv_lib_inet_main = yes; then - LIBS="$LIBS -linet" -fi - - if test "${ac_cv_header_net_errno_h+set}" = set; then - echo "$as_me:$LINENO: checking for net/errno.h" >&5 -echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_net_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking net/errno.h usability" >&5 -echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking net/errno.h presence" >&5 -echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclgdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for net/errno.h" >&5 -echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_net_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_net_errno_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 - -fi -if test $ac_cv_header_net_errno_h = yes; then - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_NET_ERRNO_H 1 -_ACEOF - -fi - - - - #-------------------------------------------------------------------- - # Check for the existence of the -lsocket and -lnsl libraries. - # The order here is important, so that they end up in the right - # order in the command line generated by make. Here are some - # special considerations: - # 1. Use "connect" and "accept" to check for -lsocket, and - # "gethostbyname" to check for -lnsl. - # 2. Use each function name only once: can't redo a check because - # autoconf caches the results of the last check and won't redo it. - # 3. Use -lnsl and -lsocket only if they supply procedures that - # aren't already present in the normal libraries. This is because - # IRIX 5.2 has libraries, but they aren't needed and they're - # bogus: they goof up name resolution if used. - # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. - # To get around this problem, check for both libraries together - # if -lsocket doesn't work by itself. - #-------------------------------------------------------------------- - - tcl_checkBoth=0 - echo "$as_me:$LINENO: checking for connect" >&5 -echo $ECHO_N "checking for connect... $ECHO_C" >&6 -if test "${ac_cv_func_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define connect to an innocuous variant, in case declares connect. - For example, HP-UX 11i declares gettimeofday. */ -#define connect innocuous_connect - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef connect - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_connect) || defined (__stub___connect) -choke me -#else -char (*f) () = connect; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != connect; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_connect=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_connect=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 -echo "${ECHO_T}$ac_cv_func_connect" >&6 -if test $ac_cv_func_connect = yes; then - tcl_checkSocket=0 -else - tcl_checkSocket=1 -fi - - if test "$tcl_checkSocket" = 1; then - echo "$as_me:$LINENO: checking for setsockopt" >&5 -echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 -if test "${ac_cv_func_setsockopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define setsockopt to an innocuous variant, in case declares setsockopt. - For example, HP-UX 11i declares gettimeofday. */ -#define setsockopt innocuous_setsockopt - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char setsockopt (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef setsockopt - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setsockopt (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_setsockopt) || defined (__stub___setsockopt) -choke me -#else -char (*f) () = setsockopt; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != setsockopt; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_setsockopt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_setsockopt=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 -if test $ac_cv_func_setsockopt = yes; then - : -else - echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 -echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 -if test "${ac_cv_lib_socket_setsockopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setsockopt (); -int -main () -{ -setsockopt (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_socket_setsockopt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_socket_setsockopt=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 -if test $ac_cv_lib_socket_setsockopt = yes; then - LIBS="$LIBS -lsocket" -else - tcl_checkBoth=1 -fi - -fi - - fi - if test "$tcl_checkBoth" = 1; then - tk_oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - echo "$as_me:$LINENO: checking for accept" >&5 -echo $ECHO_N "checking for accept... $ECHO_C" >&6 -if test "${ac_cv_func_accept+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define accept to an innocuous variant, in case declares accept. - For example, HP-UX 11i declares gettimeofday. */ -#define accept innocuous_accept - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char accept (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef accept - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char accept (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_accept) || defined (__stub___accept) -choke me -#else -char (*f) () = accept; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != accept; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_accept=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_accept=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 -echo "${ECHO_T}$ac_cv_func_accept" >&6 -if test $ac_cv_func_accept = yes; then - tcl_checkNsl=0 -else - LIBS=$tk_oldLibs -fi - - fi - echo "$as_me:$LINENO: checking for gethostbyname" >&5 -echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 -if test "${ac_cv_func_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. - For example, HP-UX 11i declares gettimeofday. */ -#define gethostbyname innocuous_gethostbyname - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef gethostbyname - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -char (*f) () = gethostbyname; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != gethostbyname; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_gethostbyname=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 -if test $ac_cv_func_gethostbyname = yes; then - : -else - echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 -echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 -if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -int -main () -{ -gethostbyname (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_nsl_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_nsl_gethostbyname=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 -if test $ac_cv_lib_nsl_gethostbyname = yes; then - LIBS="$LIBS -lnsl" -fi - -fi - - - # Don't perform the eval of the libraries here because DL_LIBS - # won't be set until we call TEA_CONFIG_CFLAGS - - TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' - - - - - echo "$as_me:$LINENO: checking dirent.h" >&5 -echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 -if test "${tcl_cv_dirent_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ - -#ifndef _POSIX_SOURCE -# ifdef __Lynx__ - /* - * Generate compilation error to make the test fail: Lynx headers - * are only valid if really in the POSIX environment. - */ - - missing_procedure(); -# endif -#endif -DIR *d; -struct dirent *entryPtr; -char *p; -d = opendir("foobar"); -entryPtr = readdir(d); -p = entryPtr->d_name; -closedir(d); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_dirent_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_dirent_h=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 -echo "${ECHO_T}$tcl_cv_dirent_h" >&6 - - if test $tcl_cv_dirent_h = no; then - -cat >>confdefs.h <<\_ACEOF -#define NO_DIRENT_H 1 -_ACEOF - - fi - - if test "${ac_cv_header_errno_h+set}" = set; then - echo "$as_me:$LINENO: checking for errno.h" >&5 -echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_errno_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking errno.h usability" >&5 -echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking errno.h presence" >&5 -echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclgdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for errno.h" >&5 -echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_errno_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_errno_h" >&6 - -fi -if test $ac_cv_header_errno_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_ERRNO_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_float_h+set}" = set; then - echo "$as_me:$LINENO: checking for float.h" >&5 -echo $ECHO_N "checking for float.h... $ECHO_C" >&6 -if test "${ac_cv_header_float_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 -echo "${ECHO_T}$ac_cv_header_float_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking float.h usability" >&5 -echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking float.h presence" >&5 -echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclgdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for float.h" >&5 -echo $ECHO_N "checking for float.h... $ECHO_C" >&6 -if test "${ac_cv_header_float_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_float_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 -echo "${ECHO_T}$ac_cv_header_float_h" >&6 - -fi -if test $ac_cv_header_float_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_FLOAT_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_values_h+set}" = set; then - echo "$as_me:$LINENO: checking for values.h" >&5 -echo $ECHO_N "checking for values.h... $ECHO_C" >&6 -if test "${ac_cv_header_values_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 -echo "${ECHO_T}$ac_cv_header_values_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking values.h usability" >&5 -echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking values.h presence" >&5 -echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclgdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for values.h" >&5 -echo $ECHO_N "checking for values.h... $ECHO_C" >&6 -if test "${ac_cv_header_values_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_values_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 -echo "${ECHO_T}$ac_cv_header_values_h" >&6 - -fi -if test $ac_cv_header_values_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_VALUES_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_limits_h+set}" = set; then - echo "$as_me:$LINENO: checking for limits.h" >&5 -echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 -if test "${ac_cv_header_limits_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 -echo "${ECHO_T}$ac_cv_header_limits_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking limits.h usability" >&5 -echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking limits.h presence" >&5 -echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclgdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for limits.h" >&5 -echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 -if test "${ac_cv_header_limits_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_limits_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 -echo "${ECHO_T}$ac_cv_header_limits_h" >&6 - -fi -if test $ac_cv_header_limits_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIMITS_H 1 -_ACEOF - -else - -cat >>confdefs.h <<\_ACEOF -#define NO_LIMITS_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_stdlib_h+set}" = set; then - echo "$as_me:$LINENO: checking for stdlib.h" >&5 -echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking stdlib.h usability" >&5 -echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking stdlib.h presence" >&5 -echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclgdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for stdlib.h" >&5 -echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_stdlib_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 - -fi -if test $ac_cv_header_stdlib_h = yes; then - tcl_ok=1 -else - tcl_ok=0 -fi - - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtol" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtoul" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtod" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - if test $tcl_ok = 0; then - -cat >>confdefs.h <<\_ACEOF -#define NO_STDLIB_H 1 -_ACEOF - - fi - if test "${ac_cv_header_string_h+set}" = set; then - echo "$as_me:$LINENO: checking for string.h" >&5 -echo $ECHO_N "checking for string.h... $ECHO_C" >&6 -if test "${ac_cv_header_string_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 -echo "${ECHO_T}$ac_cv_header_string_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking string.h usability" >&5 -echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking string.h presence" >&5 -echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclgdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for string.h" >&5 -echo $ECHO_N "checking for string.h... $ECHO_C" >&6 -if test "${ac_cv_header_string_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_string_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 -echo "${ECHO_T}$ac_cv_header_string_h" >&6 - -fi -if test $ac_cv_header_string_h = yes; then - tcl_ok=1 -else - tcl_ok=0 -fi - - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strstr" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strerror" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - - # See also memmove check below for a place where NO_STRING_H can be - # set and why. - - if test $tcl_ok = 0; then - -cat >>confdefs.h <<\_ACEOF -#define NO_STRING_H 1 -_ACEOF - - fi - - if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo "$as_me:$LINENO: checking for sys/wait.h" >&5 -echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 -if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 -echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 -echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclgdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for sys/wait.h" >&5 -echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 -if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_sys_wait_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 - -fi -if test $ac_cv_header_sys_wait_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_SYS_WAIT_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_dlfcn_h+set}" = set; then - echo "$as_me:$LINENO: checking for dlfcn.h" >&5 -echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 -if test "${ac_cv_header_dlfcn_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 -echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 -echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 -echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclgdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for dlfcn.h" >&5 -echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 -if test "${ac_cv_header_dlfcn_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_dlfcn_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 -echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 - -fi -if test $ac_cv_header_dlfcn_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_DLFCN_H 1 -_ACEOF - -fi - - - - # OS/390 lacks sys/param.h (and doesn't need it, by chance). - -for ac_header in sys/param.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclgdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - # Let the user call this, because if it triggers, they will - # need a compat/strtod.c that is correct. Users can also - # use Tcl_GetDouble(FromObj) instead. - #TEA_BUGGY_STRTOD - fi - - -#----------------------------------------------------------------------- -# __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. -#----------------------------------------------------------------------- -if test ! "${with_gdbm}" = no; then - GDBM_INC_DIR="`echo $with_gdbm |cut -f1 -d,`" - GDBM_LIB_DIR="`echo $with_gdbm |cut -f2 -d, -s`" -fi -if test -z "$GDBM_INC_DIR" ; then - gdbm_h_ok=1 - GDBM_INC_SPEC="" -else - GDBM_INC_SPEC="-I${GDBM_INC_DIR}" - echo "Checking ${GDBM_INC_DIR}/gdbm.h" - if test -f "${GDBM_INC_DIR}/gdbm.h" ; then - gdbm_h_ok=1 - else - gdbm_h_ok=0 - fi -fi - -if test "${gdbm_h_ok}" == "0" ; then - { { echo "$as_me:$LINENO: error: - Could not locate gdbm.h on your machine to build XOTclGdbm. - You can download a precompiled lib 'libgdbm' - and the header file 'gdbm.h' from http://www.gnu.org/software/gdbm/ - and compile again. Alternatively, you can compile XOTcl without gdbm. - " >&5 -echo "$as_me: error: - Could not locate gdbm.h on your machine to build XOTclGdbm. - You can download a precompiled lib 'libgdbm' - and the header file 'gdbm.h' from http://www.gnu.org/software/gdbm/ - and compile again. Alternatively, you can compile XOTcl without gdbm. - " >&2;} - { (exit 1); exit 1; }; } -fi - -if test -z "${GDBM_LIB_DIR}" ; then - GDBM_LIB_SPEC="" -else - GDBM_LIB_SPEC="-L${GDBM_LIB_DIR}" -fi - -#echo "Gdbm include spec = '${GDBM_INC_SPEC}'" -#echo "Gdbm lib spec = '${GDBM_LIB_SPEC}'" - -#-------------------------------------------------------------------- -# Load the xotclConfig.sh file -#-------------------------------------------------------------------- - -{ echo "$as_me:$LINENO: Reading file ${with_xotcl}/xotclConfig.sh" >&5 -echo "$as_me: Reading file ${with_xotcl}/xotclConfig.sh" >&6;} -source ${with_xotcl}/xotclConfig.sh - - - vars="xotclgdbm.c" - for i in $vars; do - case $i in - \$*) - # allow $-var names - PKG_SOURCES="$PKG_SOURCES $i" - PKG_OBJECTS="$PKG_OBJECTS $i" - ;; - *) - # check for existence - allows for generic/win/unix VPATH - # To add more dirs here (like 'src'), you have to update VPATH - # in Makefile.in as well - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 -echo "$as_me: error: could not find source file '$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_SOURCES="$PKG_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" - fi - PKG_OBJECTS="$PKG_OBJECTS $j" - ;; - esac - done - - - - - vars="" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 -echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_HEADERS="$PKG_HEADERS $i" - done - - - - vars="-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC} ${GDBM_INC_SPEC}" - for i in $vars; do - PKG_INCLUDES="$PKG_INCLUDES $i" - done - - - - vars="$XOTCL_BUILD_STUB_LIB_SPEC $XOTCL_BUILD_LIB_SPEC $GDBM_LIB_SPEC -lgdbm" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - - - - PKG_CFLAGS="$PKG_CFLAGS " - - - - vars="" - for i in $vars; do - # check for existence - allows for generic/win/unix VPATH - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 -echo "$as_me: error: could not find stub source file '$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" - fi - PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" - done - - - - - vars="" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 -echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" - done - - - -#-------------------------------------------------------------------- -# __CHANGE__ -# A few miscellaneous platform-specific items: -# -# Define a special symbol for Windows (BUILD_sample in this case) so -# that we create the export library with the dll. -# -# 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. -# -# TEA_ADD_* any platform specific compiler/build info here. -#-------------------------------------------------------------------- - -if test "${TEA_PLATFORM}" = "windows" ; then - cat >>confdefs.h <<\_ACEOF -#define BUILD_sample 1 -_ACEOF - - CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" - #TEA_ADD_SOURCES([win/winFile.c]) - #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) -else - CLEANFILES="pkgIndex.tcl" - #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 -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking for Tcl public headers" >&5 -echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 - - -# Check whether --with-tclinclude or --without-tclinclude was given. -if test "${with_tclinclude+set}" = set; then - withval="$with_tclinclude" - with_tclinclude=${withval} -fi; - - if test "${ac_cv_c_tclh+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - # Use the value from --with-tclinclude, if it was given - - if test x"${with_tclinclude}" != x ; then - if test -f "${with_tclinclude}/tcl.h" ; then - ac_cv_c_tclh=${with_tclinclude} - else - { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 -echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} - { (exit 1); exit 1; }; } - fi - else - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers directory - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tcl is not installed, - # and in that situation, look there before installed locations. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - if test x"${TCL_INCLUDE_SPEC}" != x ; then - d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` - list="$list `ls -d ${d} 2>/dev/null`" - fi - fi - for i in $list ; do - if test -f "$i/tcl.h" ; then - ac_cv_c_tclh=$i - break - fi - done - fi - -fi - - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tclh}" = x ; then - { { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 -echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} - { (exit 1); exit 1; }; } - else - echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 -echo "${ECHO_T}${ac_cv_c_tclh}" >&6 - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` - - TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - - -#TEA_PRIVATE_TCL_HEADERS - -#TEA_PUBLIC_TK_HEADERS -#TEA_PRIVATE_TK_HEADERS -#TEA_PATH_X - -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -#-------------------------------------------------------------------- - - - # Check whether --enable-threads or --disable-threads was given. -if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval -else - tcl_ok=yes -fi; - - if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then - TCL_THREADS=1 - - if test "${TEA_PLATFORM}" != "windows" ; then - # We are always OK on Windows, so check what this platform wants: - - # USE_THREAD_ALLOC tells us to try the special thread-based - # allocator that significantly reduces lock contention - -cat >>confdefs.h <<\_ACEOF -#define USE_THREAD_ALLOC 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - if test "`uname -s`" = "SunOS" ; then - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - fi - -cat >>confdefs.h <<\_ACEOF -#define _THREAD_SAFE 1 -_ACEOF - - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 -if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthread_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthread_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 -if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "no"; then - # Check a little harder for __pthread_mutex_init in the same - # library, as some systems hide it there until pthread.h is - # defined. We could alternatively do an AC_TRY_COMPILE with - # pthread.h, but that will work with libpthread really doesn't - # exist, like AIX 4.2. [Bug: 4359] - echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 -echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 -if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char __pthread_mutex_init (); -int -main () -{ -__pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthread___pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthread___pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 -if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthread" - else - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 -if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthreads $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthreads_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthreads_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 -if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthreads" - else - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 -if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_c_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_c_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 -if test $ac_cv_lib_c_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "no"; then - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 -if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc_r $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_c_r_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_c_r_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 -if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -pthread" - else - TCL_THREADS=0 - { echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 -echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} - fi - fi - fi - fi - fi - else - TCL_THREADS=0 - fi - # Do checking message here to not mess up interleaved configure output - echo "$as_me:$LINENO: checking for building with threads" >&5 -echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 - if test "${TCL_THREADS}" = 1; then - -cat >>confdefs.h <<\_ACEOF -#define TCL_THREADS 1 -_ACEOF - - echo "$as_me:$LINENO: result: yes (default)" >&5 -echo "${ECHO_T}yes (default)" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - # TCL_THREADS sanity checking. See if our request for building with - # threads is the same as the way Tcl was built. If not, warn the user. - case ${TCL_DEFS} in - *THREADS=1*) - if test "${TCL_THREADS}" = "0"; then - { echo "$as_me:$LINENO: WARNING: - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads." >&5 -echo "$as_me: WARNING: - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads." >&2;} - fi - ;; - *) - if test "${TCL_THREADS}" = "1"; then - { echo "$as_me:$LINENO: WARNING: - --enable-threads requested, but building against a Tcl that is NOT - thread-enabled. This is an OK configuration that will also run in - a thread-enabled core." >&5 -echo "$as_me: WARNING: - --enable-threads requested, but building against a Tcl that is NOT - thread-enabled. This is an OK configuration that will also run in - a thread-enabled core." >&2;} - fi - ;; - esac - - - -#-------------------------------------------------------------------- -# The statement below defines a collection of symbols related to -# building as a shared library instead of a static library. -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking how to build libraries" >&5 -echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 - # Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval -else - tcl_ok=yes -fi; - - if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" ; then - echo "$as_me:$LINENO: result: shared" >&5 -echo "${ECHO_T}shared" >&6 - SHARED_BUILD=1 - else - echo "$as_me:$LINENO: result: static" >&5 -echo "${ECHO_T}static" >&6 - SHARED_BUILD=0 - -cat >>confdefs.h <<\_ACEOF -#define STATIC_BUILD 1 -_ACEOF - - fi - - - -#-------------------------------------------------------------------- -# 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. -#-------------------------------------------------------------------- - - - - - # Step 0.a: Enable 64 bit support? - - echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 -echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 - # Check whether --enable-64bit or --disable-64bit was given. -if test "${enable_64bit+set}" = set; then - enableval="$enable_64bit" - do64bit=$enableval -else - do64bit=no -fi; - echo "$as_me:$LINENO: result: $do64bit" >&5 -echo "${ECHO_T}$do64bit" >&6 - - # Step 0.b: Enable Solaris 64 bit VIS support? - - echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 -echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 - # Check whether --enable-64bit-vis or --disable-64bit-vis was given. -if test "${enable_64bit_vis+set}" = set; then - enableval="$enable_64bit_vis" - do64bitVIS=$enableval -else - do64bitVIS=no -fi; - echo "$as_me:$LINENO: result: $do64bitVIS" >&5 -echo "${ECHO_T}$do64bitVIS" >&6 - - if test "$do64bitVIS" = "yes"; then - # Force 64bit on with VIS - do64bit=yes - fi - - # Step 0.c: Cross-compiling options for Windows/CE builds? - - if test "${TEA_PLATFORM}" = "windows" ; then - echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 -echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 - # Check whether --enable-wince or --disable-wince was given. -if test "${enable_wince+set}" = set; then - enableval="$enable_wince" - doWince=$enableval -else - doWince=no -fi; - echo "$as_me:$LINENO: result: $doWince" >&5 -echo "${ECHO_T}$doWince" >&6 - fi - - # Step 1: set the variable "system" to hold the name and version number - # for the system. - - - echo "$as_me:$LINENO: checking system version" >&5 -echo $ECHO_N "checking system version... $ECHO_C" >&6 -if test "${tcl_cv_sys_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - if test "${TEA_PLATFORM}" = "windows" ; then - tcl_cv_sys_version=windows - elif test -f /usr/lib/NextStep/software_version; then - tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` - else - tcl_cv_sys_version=`uname -s`-`uname -r` - if test "$?" -ne 0 ; then - { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 -echo "$as_me: WARNING: can't find uname command" >&2;} - tcl_cv_sys_version=unknown - else - # Special check for weird MP-RAS system (uname returns weird - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` - fi - if test "`uname -s`" = "AIX" ; then - tcl_cv_sys_version=AIX-`uname -v`.`uname -r` - fi - fi - fi - -fi -echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 -echo "${ECHO_T}$tcl_cv_sys_version" >&6 - system=$tcl_cv_sys_version - - - # Step 2: check for existence of -ldl library. This is needed because - # Linux can use either -ldl or -ldld for dynamic loading. - - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - have_dl=yes -else - have_dl=no -fi - - - # Require ranlib early so we can override it in special cases below. - - - - # Step 3: set configuration options based on system name and version. - # This is similar to Tcl's unix/tcl.m4 except that we've added a - # "windows" case. - - do64bit_ok=no - LDFLAGS_ORIG="$LDFLAGS" - # When ld needs options to work in 64-bit mode, put them in - # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] - # is disabled by the user. [Bug 1016796] - LDFLAGS_ARCH="" - TCL_EXPORT_FILE_SUFFIX="" - UNSHARED_LIB_SUFFIX="" - TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' - ECHO_VERSION='`echo ${PACKAGE_VERSION}`' - TCL_LIB_VERSIONS_OK=ok - CFLAGS_DEBUG=-g - CFLAGS_OPTIMIZE=-O - if test "$GCC" = "yes" ; then - CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wno-implicit-int" - else - CFLAGS_WARNING="" - fi - TCL_NEEDS_EXP_FILE=0 - TCL_BUILD_EXP_FILE="" - TCL_EXP_FILE="" - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - STLIB_LD='${AR} cr' - LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" - case $system in - windows) - # This is a 2-stage check to make sure we have the 64-bit SDK - # We have to know where the SDK is installed. - # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs - # MACHINE is IX86 for LINK, but this is used by the manifest, - # which requires x86|amd64|ia64. - MACHINE="X86" - if test "$do64bit" != "no" ; then - if test "x${MSSDK}x" = "xx" ; then - MSSDK="C:/Progra~1/Microsoft Platform SDK" - fi - MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` - PATH64="" - case "$do64bit" in - amd64|x64|yes) - MACHINE="AMD64" ; # default to AMD64 64-bit build - PATH64="${MSSDK}/Bin/Win64/x86/AMD64" - ;; - ia64) - MACHINE="IA64" - PATH64="${MSSDK}/Bin/Win64" - ;; - esac - if test ! -d "${PATH64}" ; then - { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 -echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} - { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 -echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} - do64bit="no" - else - echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 -echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 - do64bit_ok="yes" - fi - fi - - if test "$doWince" != "no" ; then - if test "$do64bit" != "no" ; then - { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 -echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} - { (exit 1); exit 1; }; } - fi - if test "$GCC" = "yes" ; then - { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 -echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} - { (exit 1); exit 1; }; } - fi - - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-celib - - if test x"${no_celib}" = x ; then - # we reset no_celib in case something fails here - no_celib=true - -# Check whether --with-celib or --without-celib was given. -if test "${with_celib+set}" = set; then - withval="$with_celib" - with_celibconfig=${withval} -fi; - echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 -echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 - if test "${ac_cv_c_celibconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - # First check to see if --with-celibconfig was specified. - if test x"${with_celibconfig}" != x ; then - if test -d "${with_celibconfig}/inc" ; then - ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` - else - { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 -echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} - { (exit 1); exit 1; }; } - fi - fi - - # then check for a celib library - if test x"${ac_cv_c_celibconfig}" = x ; then - for i in \ - ../celib-palm-3.0 \ - ../celib \ - ../../celib-palm-3.0 \ - ../../celib \ - `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ - ${srcdir}/../celib-palm-3.0 \ - ${srcdir}/../celib \ - `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ - ; do - if test -d "$i/inc" ; then - ac_cv_c_celibconfig=`(cd $i; pwd)` - break - fi - done - fi - -fi - - if test x"${ac_cv_c_celibconfig}" = x ; then - { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 -echo "$as_me: error: Cannot find celib support library directory" >&2;} - { (exit 1); exit 1; }; } - else - no_celib= - CELIB_DIR=${ac_cv_c_celibconfig} - CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` - echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 -echo "${ECHO_T}found $CELIB_DIR" >&6 - fi - fi - - # Set defaults for common evc4/PPC2003 setup - # Currently Tcl requires 300+, possibly 420+ for sockets - CEVERSION=420; # could be 211 300 301 400 420 ... - TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... - ARCH=ARM; # could be ARM MIPS X86EM ... - PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" - if test "$doWince" != "yes"; then - # If !yes then the user specified something - # Reset ARCH to allow user to skip specifying it - ARCH= - eval `echo $doWince | awk -F, '{ \ - if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ - if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ - if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ - if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ - if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ - }'` - if test "x${ARCH}" = "x" ; then - ARCH=$TARGETCPU; - fi - fi - OSVERSION=WCE$CEVERSION; - if test "x${WCEROOT}" = "x" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" - if test ! -d "${WCEROOT}" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded Tools" - fi - fi - if test "x${SDKROOT}" = "x" ; then - SDKROOT="C:/Program Files/Windows CE Tools" - if test ! -d "${SDKROOT}" ; then - SDKROOT="C:/Windows CE Tools" - fi - fi - WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` - SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` - if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ - -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then - { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 -echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} - { (exit 1); exit 1; }; } - doWince="no" - else - # We could PATH_NOSPACE these, but that's not important, - # as long as we quote them when used. - CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" - if test -d "${CEINCLUDE}/${TARGETCPU}" ; then - CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" - fi - CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" - fi - fi - - if test "$GCC" != "yes" ; then - if test "${SHARED_BUILD}" = "0" ; then - runtime=-MT - else - runtime=-MD - fi - - if test "$do64bit" != "no" ; then - # All this magic is necessary for the Win64 SDK RC1 - hobbs - CC="\"${PATH64}/cl.exe\"" - CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" - RC="\"${MSSDK}/bin/rc.exe\"" - lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" - LINKBIN="\"${PATH64}/link.exe\"" - CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - # Avoid 'unresolved external symbol __security_cookie' - # errors, c.f. http://support.microsoft.com/?id=894573 - - vars="bufferoverflowU.lib" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - - - elif test "$doWince" != "no" ; then - CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" - if test "${TARGETCPU}" = "X86"; then - CC="\"${CEBINROOT}/cl.exe\"" - else - CC="\"${CEBINROOT}/cl${ARCH}.exe\"" - fi - CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" - RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" - arch=`echo ${ARCH} | awk '{print tolower($0)}'` - defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" - if test "${SHARED_BUILD}" = "1" ; then - # Static CE builds require static celib as well - defs="${defs} _DLL" - fi - for i in $defs ; do - -cat >>confdefs.h <<_ACEOF -#define $i 1 -_ACEOF - - done - -cat >>confdefs.h <<_ACEOF -#define _WIN32_WCE $CEVERSION -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define UNDER_CE $CEVERSION -_ACEOF - - CFLAGS_DEBUG="-nologo -Zi -Od" - CFLAGS_OPTIMIZE="-nologo -Ox" - lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` - lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" - LINKBIN="\"${CEBINROOT}/link.exe\"" - - else - RC="rc" - lflags="-nologo" - LINKBIN="link" - CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - fi - fi - - if test "$GCC" = "yes"; then - # mingw gcc mode - RC="windres" - CFLAGS_DEBUG="-g" - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - SHLIB_LD="$CC -shared" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" - LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" - else - SHLIB_LD="${LINKBIN} -dll ${lflags}" - # link -lib only works when -lib is the first arg - STLIB_LD="${LINKBIN} -lib ${lflags}" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' - PATHTYPE=-w - # For information on what debugtype is most useful, see: - # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp - # This essentially turns it all on. - LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" - LDFLAGS_OPTIMIZE="-release" - if test "$doWince" != "no" ; then - LDFLAGS_CONSOLE="-link ${lflags}" - LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} - else - LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" - LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" - fi - fi - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dll" - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' - - TCL_LIB_VERSIONS_OK=nodots - # Bogus to avoid getting this turned off - DL_OBJS="tclLoadNone.obj" - ;; - AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then - # AIX requires the _r compiler when gcc isn't being used - case "${CC}" in - *_r) - # ok ... - ;; - *) - CC=${CC}_r - ;; - esac - echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 -echo "${ECHO_T}Using $CC for compiling with threads" >&6 - fi - LIBS="$LIBS -lc" - SHLIB_CFLAGS="" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - DL_OBJS="tclLoadDl.o" - LD_LIBRARY_PATH_VAR="LIBPATH" - - # Check to enable 64-bit flags for compiler/linker on AIX 4+ - if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then - if test "$GCC" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} - else - do64bit_ok=yes - CFLAGS="$CFLAGS -q64" - LDFLAGS_ARCH="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi - - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - else - SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - fi - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' - fi - - # AIX v<=4.1 has some different flags than 4.2+ - if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then - case $LIBOBJS in - "tclLoadAix.$ac_objext" | \ - *" tclLoadAix.$ac_objext" | \ - "tclLoadAix.$ac_objext "* | \ - *" tclLoadAix.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; -esac - - DL_LIBS="-lld" - fi - - # On AIX <=v4 systems, libbsd.a has to be linked in to support - # non-blocking file IO. This library has to be linked in after - # the MATH_LIBS or it breaks the pow() function. The way to - # insure proper sequencing, is to add it to the tail of MATH_LIBS. - # This library also supplies gettimeofday. - # - # AIX does not have a timezone field in struct tm. When the AIX - # bsd library is used, the timezone global and the gettimeofday - # methods are to be avoided for timezone deduction instead, we - # deduce the timezone by comparing the localtime result on a - # known GMT value. - - echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 -echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 -if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbsd $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gettimeofday (); -int -main () -{ -gettimeofday (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_bsd_gettimeofday=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_bsd_gettimeofday=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 -if test $ac_cv_lib_bsd_gettimeofday = yes; then - libbsd=yes -else - libbsd=no -fi - - if test $libbsd = yes; then - MATH_LIBS="$MATH_LIBS -lbsd" - -cat >>confdefs.h <<\_ACEOF -#define USE_DELTA_FOR_TZ 1 -_ACEOF - - fi - ;; - BeOS*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC} -nostart" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - - #----------------------------------------------------------- - # Check for inet_ntoa in -lbind, for BeOS (which also needs - # -lsocket, even if the network functions are in -lnet which - # is always linked to, for compatibility. - #----------------------------------------------------------- - echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 -echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 -if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbind $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char inet_ntoa (); -int -main () -{ -inet_ntoa (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_bind_inet_ntoa=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_bind_inet_ntoa=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 -if test $ac_cv_lib_bind_inet_ntoa = yes; then - LIBS="$LIBS -lbind -lsocket" -fi - - ;; - BSD/OS-2.1*|BSD/OS-3*) - SHLIB_CFLAGS="" - SHLIB_LD="shlicc -r" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - BSD/OS-4.*) - SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="cc -shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - dgux*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - HP-UX-*.11.*) - # Use updated header definitions where possible - -cat >>confdefs.h <<\_ACEOF -#define _XOPEN_SOURCE_EXTENDED 1 -_ACEOF - - # Needed by Tcl, but not most extensions - #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) - #LIBS="$LIBS -lxnet" # Use the XOPEN network library - - if test "`uname -m`" = "ia64" ; then - SHLIB_SUFFIX=".so" - # Use newer C++ library for C++ extensions - #if test "$GCC" != "yes" ; then - # CPPFLAGS="-AA" - #fi - else - SHLIB_SUFFIX=".sl" - fi - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS='${LIBS}' - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - SHLIB_LD_LIBS='${LIBS}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - - # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc - #CFLAGS="$CFLAGS +DAportable" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - hpux_arch=`${CC} -dumpmachine` - case $hpux_arch in - hppa64*) - # 64-bit gcc in use. Fix flags for GNU ld. - do64bit_ok=yes - SHLIB_LD="${CC} -shared" - SHLIB_LD_LIBS='${LIBS}' - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ;; - *) - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} - ;; - esac - else - do64bit_ok=yes - CFLAGS="$CFLAGS +DD64" - LDFLAGS_ARCH="+DD64" - fi - fi - ;; - HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) - SHLIB_SUFFIX=".sl" - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS="" - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - ;; - IRIX-5.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - ;; - IRIX-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mabi=n32" - LDFLAGS="$LDFLAGS -mabi=n32" - else - case $system in - IRIX-6.3) - # Use to build 6.2 compatible binaries on 6.3. - CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" - ;; - *) - CFLAGS="$CFLAGS -n32" - ;; - esac - LDFLAGS="$LDFLAGS -n32" - fi - ;; - IRIX64-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - - # Check to enable 64-bit flags for compiler/linker - - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 -echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} - else - do64bit_ok=yes - SHLIB_LD="ld -64 -shared -rdata_shared" - CFLAGS="$CFLAGS -64" - LDFLAGS_ARCH="-64" - fi - fi - ;; - Linux*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings - # when you inline the string and math operations. Turn this off to - # get rid of the warnings. - #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" - - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - if test $do64bit = yes; then - echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_m64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -m64" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_m64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_m64=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 -echo "${ECHO_T}$tcl_cv_cc_m64" >&6 - if test $tcl_cv_cc_m64 = yes; then - CFLAGS="$CFLAGS -m64" - do64bit_ok=yes - fi - fi - - # The combo of gcc + glibc has a bug related - # to inlining of functions like strtod(). The - # -fno-builtin flag should address this problem - # but it does not work. The -fno-inline flag - # is kind of overkill but it works. - # Disable inlining only when one of the - # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x ; then - CFLAGS="$CFLAGS -fno-inline" - fi - - ;; - GNU*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - SHLIB_LD="${CC} -shared" - DL_OBJS="" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - ;; - Lynx*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - CFLAGS_OPTIMIZE=-02 - SHLIB_LD="${CC} -shared " - DL_OBJS="tclLoadDl.o" - DL_LIBS="-mshared -ldl" - LD_FLAGS="-Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - ;; - MP-RAS-02*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - MP-RAS-*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,-Bexport" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - NetBSD-*|FreeBSD-[1-2].*) - # NetBSD/SPARC needs -fPIC, -fpic will not do. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - echo "$as_me:$LINENO: checking for ELF" >&5 -echo $ECHO_N "checking for ELF... $ECHO_C" >&6 -if test "${tcl_cv_ld_elf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef __ELF__ - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - tcl_cv_ld_elf=yes -else - tcl_cv_ld_elf=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 -echo "${ECHO_T}$tcl_cv_ld_elf" >&6 - if test $tcl_cv_ld_elf = yes; then - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - else - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - fi - - # Ancient FreeBSD doesn't handle version numbers with dots. - - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - OpenBSD-*) - # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. - case `machine` in - sparc|sparc64) - SHLIB_CFLAGS="-fPIC";; - *) - SHLIB_CFLAGS="-fpic";; - esac - SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - echo "$as_me:$LINENO: checking for ELF" >&5 -echo $ECHO_N "checking for ELF... $ECHO_C" >&6 -if test "${tcl_cv_ld_elf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef __ELF__ - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - tcl_cv_ld_elf=yes -else - tcl_cv_ld_elf=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 -echo "${ECHO_T}$tcl_cv_ld_elf" >&6 - if test $tcl_cv_ld_elf = yes; then - LDFLAGS=-Wl,-export-dynamic - else - LDFLAGS="" - fi - - # OpenBSD doesn't do version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - FreeBSD-*) - # FreeBSD 3.* and greater have ELF. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "${TCL_THREADS}" = "1" ; then - # The -pthread needs to go in the CFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - case $system in - FreeBSD-3.*) - # FreeBSD-3 doesn't handle version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - TCL_LIB_VERSIONS_OK=nodots - ;; - esac - ;; - Darwin-*) - CFLAGS_OPTIMIZE="-Os" - SHLIB_CFLAGS="-fno-common" - # To avoid discrepancies between what headers configure sees during - # preprocessing tests and compiling tests, move any -isysroot and - # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: - CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" - CFLAGS="`echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" - if test $do64bit = yes; then - case `arch` in - ppc) - echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_arch_ppc64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_arch_ppc64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_arch_ppc64=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 -echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 - if test $tcl_cv_cc_arch_ppc64 = yes; then - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - do64bit_ok=yes - fi;; - i386) - echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_arch_x86_64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch x86_64" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_arch_x86_64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_arch_x86_64=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 -echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 - if test $tcl_cv_cc_arch_x86_64 = yes; then - CFLAGS="$CFLAGS -arch x86_64" - do64bit_ok=yes - fi;; - *) - { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 -echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; - esac - else - # Check for combined 32-bit and 64-bit fat build - echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ - echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ - fat_32_64=yes - fi - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' - echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 -echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_single_module+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_single_module=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_single_module=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 -echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 - if test $tcl_cv_ld_single_module = yes; then - SHLIB_LD="${SHLIB_LD} -Wl,-single_module" - fi - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dylib" - DL_OBJS="tclLoadDyld.o" - DL_LIBS="" - # Don't use -prebind when building for Mac OS X 10.4 or later only: - test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ - "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \ - LDFLAGS="$LDFLAGS -prebind" - LDFLAGS="$LDFLAGS -headerpad_max_install_names" - echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 -echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_search_paths_first+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_search_paths_first=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_search_paths_first=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 -echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 - if test $tcl_cv_ld_search_paths_first = yes; then - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" - - # TEA specific: for Tk extensions, remove 64-bit arch flags from - # CFLAGS et al. for combined 32 & 64 bit fat builds as neither - # TkAqua nor TkX11 can be built for 64-bit at present. - test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done - ;; - NEXTSTEP-*) - SHLIB_CFLAGS="" - SHLIB_LD="cc -nostdlib -r" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadNext.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OS/390-*) - CFLAGS_OPTIMIZE="" # Optimizer is buggy - -cat >>confdefs.h <<\_ACEOF -#define _OE_SOCKETS 1 -_ACEOF - - ;; - OSF1-1.0|OSF1-1.1|OSF1-1.2) - # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 - SHLIB_CFLAGS="" - # Hack: make package name same as library name - SHLIB_LD='ld -R -export :' - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadOSF.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-1.*) - # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - SHLIB_CFLAGS="-fPIC" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD="ld -shared" - else - SHLIB_LD="ld -non_shared" - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-V*) - # Digital OSF/1 - SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD='ld -shared -expect_unresolved "*"' - else - SHLIB_LD='ld -non_shared -expect_unresolved "*"' - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mieee" - else - CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" - fi - # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = "1" ; then - CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" - CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" - LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = "yes" ; then - LIBS="$LIBS -lpthread -lmach -lexc" - else - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - fi - - ;; - QNX-6*) - # QNX RTP - # This may work for all QNX, but it was only reported for v6. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - # dlopen is in -lc on QNX - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SCO_SV-3.2*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, - # this test works, since "uname -s" was non-standard in 3.2.4 and - # below. - if test "$GCC" = "yes" ; then - SHLIB_CFLAGS="-fPIC -melf" - LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" - else - SHLIB_CFLAGS="-Kpic -belf" - LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" - fi - SHLIB_LD="ld -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SINIX*5.4*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SunOS-4*) - SHLIB_CFLAGS="-PIC" - SHLIB_LD="ld" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - - # SunOS can't handle version numbers with dots in them in library - # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it - # requires an extra version number at the end of .so file names. - # So, the library has to have a name like libtcl75.so.1.0 - - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - SunOS-5.[0-6]) - # Careful to not let 5.10+ fall into this case - - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - - SHLIB_CFLAGS="-KPIC" - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - ;; - SunOS-5*) - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - - SHLIB_CFLAGS="-KPIC" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - arch=`isainfo` - if test "$arch" = "sparcv9 sparc" ; then - if test "$GCC" = "yes" ; then - if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} - else - do64bit_ok=yes - CFLAGS="$CFLAGS -m64 -mcpu=v9" - LDFLAGS="$LDFLAGS -m64 -mcpu=v9" - SHLIB_CFLAGS="-fPIC" - fi - else - do64bit_ok=yes - if test "$do64bitVIS" = "yes" ; then - CFLAGS="$CFLAGS -xarch=v9a" - LDFLAGS_ARCH="-xarch=v9a" - else - CFLAGS="$CFLAGS -xarch=v9" - LDFLAGS_ARCH="-xarch=v9" - fi - # Solaris 64 uses this as well - #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" - fi - elif test "$arch" = "amd64 i386" ; then - if test "$GCC" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} - else - do64bit_ok=yes - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64" - fi - else - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 -echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} - fi - fi - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = "yes" ; then - # We need to specify -static-libgcc or we need to - # add the path to the sparv9 libgcc. - # JH: static-libgcc is necessary for core Tcl, but may - # not be necessary for extensions. - SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" - # for finding sparcv9 libgcc, get the regular libgcc - # path, remove so name and append 'sparcv9' - #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." - #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" - fi - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - fi - ;; - UNIX_SV* | UnixWare-5*) - SHLIB_CFLAGS="-KPIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers - # that don't grok the -Bexport option. Test that it does. - echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 -echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_Bexport+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-Bexport" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_Bexport=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_Bexport=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 -echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 - if test $tcl_cv_ld_Bexport = yes; then - LDFLAGS="$LDFLAGS -Wl,-Bexport" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - esac - - if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then - { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 -echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} - fi - - - - # Step 4: disable dynamic loading if requested via a command-line switch. - - # Check whether --enable-load or --disable-load was given. -if test "${enable_load+set}" = set; then - enableval="$enable_load" - tcl_ok=$enableval -else - tcl_ok=yes -fi; - if test "$tcl_ok" = "no"; then - DL_OBJS="" - fi - - if test "x$DL_OBJS" != "x" ; then - BUILD_DLTEST="\$(DLTEST_TARGETS)" - else - echo "Can't figure out how to do dynamic loading or shared libraries" - echo "on this system." - SHLIB_CFLAGS="" - SHLIB_LD="" - SHLIB_SUFFIX="" - DL_OBJS="tclLoadNone.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS_ORIG" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - BUILD_DLTEST="" - fi - LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" - - # If we're running gcc, then change the C flags for compiling shared - # libraries to the right flags for gcc, instead of those for the - # standard manufacturer compiler. - - if test "$DL_OBJS" != "tclLoadNone.o" ; then - if test "$GCC" = "yes" ; then - case $system in - AIX-*) - ;; - BSD/OS*) - ;; - IRIX*) - ;; - NetBSD-*|FreeBSD-*) - ;; - Darwin-*) - ;; - SCO_SV-3.2*) - ;; - windows) - ;; - *) - SHLIB_CFLAGS="-fPIC" - ;; - esac - fi - fi - - if test "$SHARED_LIB_SUFFIX" = "" ; then - SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' - fi - if test "$UNSHARED_LIB_SUFFIX" = "" ; then - UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' - fi - - - - - - - - - - - - - - - - # These must be called after we do the basic CFLAGS checks and - # verify any possible 64-bit or similar switches are necessary - - echo "$as_me:$LINENO: checking for required early compiler flags" >&5 -echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 - tcl_flags="" - - if test "${tcl_cv_flag__isoc99_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *)strtoll; char *q = (char *)strtoull; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__isoc99_source=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _ISOC99_SOURCE 1 -#include -int -main () -{ -char *p = (char *)strtoll; char *q = (char *)strtoull; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__isoc99_source=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__isoc99_source=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define _ISOC99_SOURCE 1 -_ACEOF - - tcl_flags="$tcl_flags _ISOC99_SOURCE" - fi - - - if test "${tcl_cv_flag__largefile64_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -struct stat64 buf; int i = stat64("/", &buf); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile64_source=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGEFILE64_SOURCE 1 -#include -int -main () -{ -struct stat64 buf; int i = stat64("/", &buf); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile64_source=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__largefile64_source=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define _LARGEFILE64_SOURCE 1 -_ACEOF - - tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" - fi - - - if test "${tcl_cv_flag__largefile_source64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *)open64; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile_source64=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGEFILE_SOURCE64 1 -#include -int -main () -{ -char *p = (char *)open64; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile_source64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__largefile_source64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define _LARGEFILE_SOURCE64 1 -_ACEOF - - tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" - fi - - if test "x${tcl_flags}" = "x" ; then - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 - else - echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 -echo "${ECHO_T}${tcl_flags}" >&6 - fi - - - echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 -echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 - if test "${tcl_cv_type_64bit+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - tcl_cv_type_64bit=none - # See if the compiler knows natively about __int64 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -__int64 value = (__int64) 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_type_64bit=__int64 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_type_64bit="long long" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - # See if we should use long anyway Note that we substitute in the - # type that is our current guess for a 64-bit type inside this check - # program, so it should be modified only carefully... - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -switch (0) { - case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; - } - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_type_64bit=${tcl_type_64bit} -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "${tcl_cv_type_64bit}" = none ; then - -cat >>confdefs.h <<\_ACEOF -#define TCL_WIDE_INT_IS_LONG 1 -_ACEOF - - echo "$as_me:$LINENO: result: using long" >&5 -echo "${ECHO_T}using long" >&6 - elif test "${tcl_cv_type_64bit}" = "__int64" \ - -a "${TEA_PLATFORM}" = "windows" ; then - # We actually want to use the default tcl.h checks in this - # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* - echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 -echo "${ECHO_T}using Tcl header defaults" >&6 - else - -cat >>confdefs.h <<_ACEOF -#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} -_ACEOF - - echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 -echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 - - # Now check for auxiliary declarations - echo "$as_me:$LINENO: checking for struct dirent64" >&5 -echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 -if test "${tcl_cv_struct_dirent64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ -struct dirent64 p; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_struct_dirent64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_struct_dirent64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 -echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 - if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_DIRENT64 1 -_ACEOF - - fi - - echo "$as_me:$LINENO: checking for struct stat64" >&5 -echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 -if test "${tcl_cv_struct_stat64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -struct stat64 p; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_struct_stat64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_struct_stat64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 -echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 - if test "x${tcl_cv_struct_stat64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_STAT64 1 -_ACEOF - - fi - - - -for ac_func in open64 lseek64 -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - echo "$as_me:$LINENO: checking for off64_t" >&5 -echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 - if test "${tcl_cv_type_off64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -off64_t offset; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_type_off64_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_type_off64_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_type_off64_t}" = "xyes" && \ - test "x${ac_cv_func_lseek64}" = "xyes" && \ - test "x${ac_cv_func_open64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_TYPE_OFF64_T 1 -_ACEOF - - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - fi - - - -#-------------------------------------------------------------------- -# Set the default compiler switches based on the --enable-symbols option. -#-------------------------------------------------------------------- - - - - echo "$as_me:$LINENO: checking for build with symbols" >&5 -echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 - # Check whether --enable-symbols or --disable-symbols was given. -if test "${enable_symbols+set}" = set; then - enableval="$enable_symbols" - tcl_ok=$enableval -else - tcl_ok=no -fi; - DBGX="" - if test "$tcl_ok" = "no"; then - CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" - LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - else - CFLAGS_DEFAULT="${CFLAGS_DEBUG}" - LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" - if test "$tcl_ok" = "yes"; then - echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 -echo "${ECHO_T}yes (standard debugging)" >&6 - fi - fi - if test "${TEA_PLATFORM}" != "windows" ; then - LDFLAGS_DEFAULT="${LDFLAGS}" - fi - - - - - - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - -cat >>confdefs.h <<\_ACEOF -#define TCL_MEM_DEBUG 1 -_ACEOF - - fi - - if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then - if test "$tcl_ok" = "all"; then - echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 -echo "${ECHO_T}enabled symbols mem debugging" >&6 - else - echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 -echo "${ECHO_T}enabled $tcl_ok debugging" >&6 - fi - 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. Add Tk too if necessary. -#-------------------------------------------------------------------- - -cat >>confdefs.h <<\_ACEOF -#define USE_TCL_STUBS 1 -_ACEOF - -#AC_DEFINE(USE_TK_STUBS) - -#-------------------------------------------------------------------- -# 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. -#-------------------------------------------------------------------- - - - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then - MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" - MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" - else - MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" - MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" - fi - - if test "${SHARED_BUILD}" = "1" ; then - MAKE_LIB="${MAKE_SHARED_LIB} " - else - MAKE_LIB="${MAKE_STATIC_LIB} " - fi - - #-------------------------------------------------------------------- - # Shared libraries and static libraries have different names. - # Use the double eval to make sure any variables in the suffix is - # substituted. (@@@ Might not be necessary anymore) - #-------------------------------------------------------------------- - - if test "${TEA_PLATFORM}" = "windows" ; then - if test "${SHARED_BUILD}" = "1" ; then - # We force the unresolved linking of symbols that are really in - # the private libraries of Tcl and Tk. - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" - fi - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - else - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - if test "$GCC" = "yes"; then - PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} - fi - # These aren't needed on Windows (either MSVC or gcc) - RANLIB=: - RANLIB_STUB=: - else - RANLIB_STUB="${RANLIB}" - if test "${SHARED_BUILD}" = "1" ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" - fi - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - fi - - # These are escaped so that only CFLAGS is picked up at configure time. - # The other values will be substituted at make time. - CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" - if test "${SHARED_BUILD}" = "1" ; then - CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" - fi - - - - - - - - -#-------------------------------------------------------------------- -# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl -# file during the install process. Don't run the TCLSH_PROG through -# ${CYGPATH} because it's being used directly by make. -# Require that we use a tclsh shell version 8.2 or later since earlier -# versions have bugs in the pkg_mkIndex routine. -# Add WISH as well if this is a Tk extension. -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking for tclsh" >&5 -echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 - if test -f "${TCL_BIN_DIR}/Makefile" ; then - # tclConfig.sh is in Tcl build directory - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="${TCL_BIN_DIR}/tclsh" - fi - else - # tclConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" - fi - list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${TCLSH_PROG}" ; then - REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" - fi - echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 -echo "${ECHO_T}${TCLSH_PROG}" >&6 - - -#TEA_PROG_WISH - -#-------------------------------------------------------------------- -# Finally, substitute all of the various values into the Makefile. -# You may alternatively have a special pkgIndex.tcl.in or other files -# which require substituting th AC variables in. Include these here. -#-------------------------------------------------------------------- - - ac_config_files="$ac_config_files Makefile" - - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g -t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g -t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by xotclgdbm $as_me 1.2, which was -generated by GNU Autoconf 2.59. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to ." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -xotclgdbm config.status 1.2 -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2003 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - - - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CYGPATH@,$CYGPATH,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t -s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t -s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t -s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t -s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t -s,@PKG_HEADERS@,$PKG_HEADERS,;t t -s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t -s,@PKG_LIBS@,$PKG_LIBS,;t t -s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t -s,@TCL_VERSION@,$TCL_VERSION,;t t -s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t -s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t -s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t -s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t -s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t -s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t -s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t -s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t -s,@TCL_LIBS@,$TCL_LIBS,;t t -s,@TCL_DEFS@,$TCL_DEFS,;t t -s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t -s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t -s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@EGREP@,$EGREP,;t t -s,@MATH_LIBS@,$MATH_LIBS,;t t -s,@PKG_SOURCES@,$PKG_SOURCES,;t t -s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t -s,@CLEANFILES@,$CLEANFILES,;t t -s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t -s,@TCL_THREADS@,$TCL_THREADS,;t t -s,@SHARED_BUILD@,$SHARED_BUILD,;t t -s,@AR@,$AR,;t t -s,@CELIB_DIR@,$CELIB_DIR,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@DL_LIBS@,$DL_LIBS,;t t -s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t -s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t -s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t -s,@STLIB_LD@,$STLIB_LD,;t t -s,@SHLIB_LD@,$SHLIB_LD,;t t -s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t -s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t -s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t -s,@TCL_DBGX@,$TCL_DBGX,;t t -s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t -s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t -s,@MAKE_LIB@,$MAKE_LIB,;t t -s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t -s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t -s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t -s,@RANLIB_STUB@,$RANLIB_STUB,;t t -s,@TCLSH_PROG@,$TCLSH_PROG,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: xotcl/library/store/XOTclGdbm/configure.in =================================================================== diff -u -N --- xotcl/library/store/XOTclGdbm/configure.in (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/library/store/XOTclGdbm/configure.in (revision 0) @@ -1,285 +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. -# -# RCS: @(#) $Id: configure.in,v 1.20 2007/10/12 19:53:32 neumann Exp $ - -#----------------------------------------------------------------------- -# Sample configure.in for Tcl Extensions. The only places you should -# need to modify this file are marked by the string __CHANGE__ -#----------------------------------------------------------------------- - -configdir=$(srcdir)/../../../config - -#----------------------------------------------------------------------- -# __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. -#----------------------------------------------------------------------- - -AC_INIT([xotclgdbm], [1.2]) - -#-------------------------------------------------------------------- -# 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([3.5]) - -AC_CONFIG_AUX_DIR(../../../config) - -#-------------------------------------------------------------------- -# specify some extra flags -#-------------------------------------------------------------------- -AC_ARG_WITH(gdbm, - [ --with-gdbm=GDBM_INCLUDE_DIR[,GDBM_LIB_DIR] - absolute path to gdbm.h and optionally the path to the library, - --without-gdbm disables build of Tcl Gdbm], - [with_gdbm=$withval], [with_gdbm=no]) - -AC_ARG_WITH(xotcl, - [ --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH - absolute path to xotclConfig.sh, - --without-xotcl disables, but this is pointless], - [with_xotcl=$withval], [AC_MSG_ERROR([--with-xotcl is required])]) - -#-------------------------------------------------------------------- -# 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 - -#----------------------------------------------------------------------- -# 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, AC_PROG_INSTALL 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. -#----------------------------------------------------------------------- -if test ! "${with_gdbm}" = no; then - GDBM_INC_DIR="`echo $with_gdbm |cut -f1 -d,`" - GDBM_LIB_DIR="`echo $with_gdbm |cut -f2 -d, -s`" -fi -if test -z "$GDBM_INC_DIR" ; then - gdbm_h_ok=1 - GDBM_INC_SPEC="" -else - GDBM_INC_SPEC="-I${GDBM_INC_DIR}" - echo "Checking ${GDBM_INC_DIR}/gdbm.h" - if test -f "${GDBM_INC_DIR}/gdbm.h" ; then - gdbm_h_ok=1 - else - gdbm_h_ok=0 - fi -fi - -if test "${gdbm_h_ok}" == "0" ; then - AC_MSG_ERROR([ - Could not locate gdbm.h on your machine to build XOTclGdbm. - You can download a precompiled lib 'libgdbm' - and the header file 'gdbm.h' from http://www.gnu.org/software/gdbm/ - and compile again. Alternatively, you can compile XOTcl without gdbm. - ]) -fi - -if test -z "${GDBM_LIB_DIR}" ; then - GDBM_LIB_SPEC="" -else - GDBM_LIB_SPEC="-L${GDBM_LIB_DIR}" -fi - -#echo "Gdbm include spec = '${GDBM_INC_SPEC}'" -#echo "Gdbm lib spec = '${GDBM_LIB_SPEC}'" - -#-------------------------------------------------------------------- -# Load the xotclConfig.sh file -#-------------------------------------------------------------------- - -AC_MSG_NOTICE([Reading file ${with_xotcl}/xotclConfig.sh]) -source ${with_xotcl}/xotclConfig.sh - -TEA_ADD_SOURCES([xotclgdbm.c]) -TEA_ADD_HEADERS([]) -TEA_ADD_INCLUDES([-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC} ${GDBM_INC_SPEC}]) -TEA_ADD_LIBS([$XOTCL_BUILD_STUB_LIB_SPEC $XOTCL_BUILD_LIB_SPEC $GDBM_LIB_SPEC -lgdbm]) -TEA_ADD_CFLAGS([]) -TEA_ADD_STUB_SOURCES([]) -TEA_ADD_TCL_SOURCES([]) - -#-------------------------------------------------------------------- -# __CHANGE__ -# A few miscellaneous platform-specific items: -# -# Define a special symbol for Windows (BUILD_sample in this case) so -# that we create the export library with the dll. -# -# 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. -# -# TEA_ADD_* any platform specific compiler/build info here. -#-------------------------------------------------------------------- - -if test "${TEA_PLATFORM}" = "windows" ; then - AC_DEFINE(BUILD_sample) - CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" - #TEA_ADD_SOURCES([win/winFile.c]) - #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) -else - CLEANFILES="pkgIndex.tcl" - #TEA_ADD_SOURCES([unix/unixFile.c]) - #TEA_ADD_LIBS([-lsuperfly]) -fi -AC_SUBST(CLEANFILES) - -#-------------------------------------------------------------------- -# __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 - -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -#-------------------------------------------------------------------- - -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 - -#-------------------------------------------------------------------- -# 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. Add Tk too if necessary. -#-------------------------------------------------------------------- - -AC_DEFINE(USE_TCL_STUBS) -#AC_DEFINE(USE_TK_STUBS) - -#-------------------------------------------------------------------- -# 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 - -#-------------------------------------------------------------------- -# 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. -# Add WISH as well if this is a Tk extension. -#-------------------------------------------------------------------- - -TEA_PROG_TCLSH -#TEA_PROG_WISH - -#-------------------------------------------------------------------- -# Finally, substitute all of the various values into the Makefile. -# You may alternatively have a special pkgIndex.tcl.in or other files -# which require substituting th AC variables in. Include these here. -#-------------------------------------------------------------------- - -AC_CONFIG_FILES([Makefile]) - -AC_OUTPUT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: xotcl/library/store/XOTclGdbm/tcl.m4 =================================================================== diff -u -N --- xotcl/library/store/XOTclGdbm/tcl.m4 (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/library/store/XOTclGdbm/tcl.m4 (revision 0) @@ -1,4041 +0,0 @@ -# tcl.m4 -- -# -# This file provides a set of autoconf macros to help TEA-enable -# a Tcl extension. -# -# Copyright (c) 1999-2000 Ajuba Solutions. -# 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: tcl.m4,v 1.2 2007/10/12 19:53:32 neumann Exp $ - -AC_PREREQ(2.57) - -dnl TEA extensions pass us the version of TEA they think they -dnl are compatible with (must be set in TEA_INIT below) -dnl TEA_VERSION="3.6" - -# Possible values for key variables defined: -# -# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') -# TEA_PLATFORM - windows unix -# - -#------------------------------------------------------------------------ -# TEA_PATH_TCLCONFIG -- -# -# Locate the tclConfig.sh file and perform a sanity check on -# the Tcl compile flags -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-tcl=... -# -# Defines the following vars: -# TCL_BIN_DIR Full path to the directory containing -# the tclConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_TCLCONFIG], [ - dnl Make sure we are initialized - AC_REQUIRE([TEA_INIT]) - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - - if test x"${no_tcl}" = x ; then - # we reset no_tcl in case something fails here - no_tcl=true - AC_ARG_WITH(tcl, - AC_HELP_STRING([--with-tcl], - [directory containing tcl configuration (tclConfig.sh)]), - with_tclconfig=${withval}) - AC_MSG_CHECKING([for Tcl configuration]) - AC_CACHE_VAL(ac_cv_c_tclconfig,[ - - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - case ${with_tclconfig} in - */tclConfig.sh ) - if test -f ${with_tclconfig}; then - AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) - with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tcl.framework/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_tclconfig}" = x ; then - TCL_BIN_DIR="# no Tcl configs found" - AC_MSG_WARN([Can't find Tcl configuration definitions]) - exit 0 - else - no_tcl= - TCL_BIN_DIR=${ac_cv_c_tclconfig} - AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_PATH_TKCONFIG -- -# -# Locate the tkConfig.sh file -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-tk=... -# -# Defines the following vars: -# TK_BIN_DIR Full path to the directory containing -# the tkConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_TKCONFIG], [ - # - # Ok, lets find the tk configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tk - # - - if test x"${no_tk}" = x ; then - # we reset no_tk in case something fails here - no_tk=true - AC_ARG_WITH(tk, - AC_HELP_STRING([--with-tk], - [directory containing tk configuration (tkConfig.sh)]), - with_tkconfig=${withval}) - AC_MSG_CHECKING([for Tk configuration]) - AC_CACHE_VAL(ac_cv_c_tkconfig,[ - - # First check to see if --with-tkconfig was specified. - if test x"${with_tkconfig}" != x ; then - case ${with_tkconfig} in - */tkConfig.sh ) - if test -f ${with_tkconfig}; then - AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) - with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tkconfig}/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` - else - AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) - fi - fi - - # then check for a private Tk library - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in \ - ../tk \ - `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../tk \ - `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../../tk \ - `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tk.framework/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in \ - ${srcdir}/../tk \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_tkconfig}" = x ; then - TK_BIN_DIR="# no Tk configs found" - AC_MSG_WARN([Can't find Tk configuration definitions]) - exit 0 - else - no_tk= - TK_BIN_DIR=${ac_cv_c_tkconfig} - AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_TCLCONFIG -- -# -# Load the tclConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# TCL_BIN_DIR -# -# Results: -# -# Subst the following vars: -# TCL_BIN_DIR -# TCL_SRC_DIR -# TCL_LIB_FILE -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_TCLCONFIG], [ - AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) - - if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - AC_MSG_RESULT([loading]) - . "${TCL_BIN_DIR}/tclConfig.sh" - else - AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tcl.framework installed in an arbitary location. - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then - for i in "`cd ${TCL_BIN_DIR}; pwd`" \ - "`cd ${TCL_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then - TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" - break - fi - done - fi - if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then - TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" - TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - AC_SUBST(TCL_VERSION) - AC_SUBST(TCL_BIN_DIR) - AC_SUBST(TCL_SRC_DIR) - - AC_SUBST(TCL_LIB_FILE) - AC_SUBST(TCL_LIB_FLAG) - AC_SUBST(TCL_LIB_SPEC) - - AC_SUBST(TCL_STUB_LIB_FILE) - AC_SUBST(TCL_STUB_LIB_FLAG) - AC_SUBST(TCL_STUB_LIB_SPEC) - - AC_SUBST(TCL_LIBS) - AC_SUBST(TCL_DEFS) - AC_SUBST(TCL_EXTRA_CFLAGS) - AC_SUBST(TCL_LD_FLAGS) - AC_SUBST(TCL_SHLIB_LD_LIBS) -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_TKCONFIG -- -# -# Load the tkConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# TK_BIN_DIR -# -# Results: -# -# Sets the following vars that should be in tkConfig.sh: -# TK_BIN_DIR -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_TKCONFIG], [ - AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) - - if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then - AC_MSG_RESULT([loading]) - . "${TK_BIN_DIR}/tkConfig.sh" - else - AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) - fi - - # eval is required to do the TK_DBGX substitution - eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" - eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" - - # If the TK_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TK_LIB_SPEC will be set to the value - # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC - # instead of TK_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TK_BIN_DIR}/Makefile" ; then - TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} - TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} - TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tk.framework installed in an arbitary location. - case ${TK_DEFS} in - *TK_FRAMEWORK*) - if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then - for i in "`cd ${TK_BIN_DIR}; pwd`" \ - "`cd ${TK_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then - TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" - break - fi - done - fi - if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then - TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" - TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TK_DBGX substitution - eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" - eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" - eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" - eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" - - # Ensure windowingsystem is defined - if test "${TEA_PLATFORM}" = "unix" ; then - case ${TK_DEFS} in - *MAC_OSX_TK*) - AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) - TEA_WINDOWINGSYSTEM="aqua" - ;; - *) - TEA_WINDOWINGSYSTEM="x11" - ;; - esac - elif test "${TEA_PLATFORM}" = "windows" ; then - TEA_WINDOWINGSYSTEM="win32" - fi - - AC_SUBST(TK_VERSION) - AC_SUBST(TK_BIN_DIR) - AC_SUBST(TK_SRC_DIR) - - AC_SUBST(TK_LIB_FILE) - AC_SUBST(TK_LIB_FLAG) - AC_SUBST(TK_LIB_SPEC) - - AC_SUBST(TK_STUB_LIB_FILE) - AC_SUBST(TK_STUB_LIB_FLAG) - AC_SUBST(TK_STUB_LIB_SPEC) - - AC_SUBST(TK_LIBS) - AC_SUBST(TK_XINCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_SHARED -- -# -# Allows the building of shared libraries -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-shared=yes|no -# -# Defines the following vars: -# STATIC_BUILD Used for building import/export libraries -# on Windows. -# -# Sets the following vars: -# SHARED_BUILD Value of 1 or 0 -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_SHARED], [ - AC_MSG_CHECKING([how to build libraries]) - AC_ARG_ENABLE(shared, - AC_HELP_STRING([--enable-shared], - [build and link with shared libraries (default: on)]), - [tcl_ok=$enableval], [tcl_ok=yes]) - - if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" ; then - AC_MSG_RESULT([shared]) - SHARED_BUILD=1 - else - AC_MSG_RESULT([static]) - SHARED_BUILD=0 - AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) - fi - AC_SUBST(SHARED_BUILD) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_THREADS -- -# -# Specify if thread support should be enabled. If "yes" is specified -# as an arg (optional), threads are enabled by default, "no" means -# threads are disabled. "yes" is the default. -# -# TCL_THREADS is checked so that if you are compiling an extension -# against a threaded core, your extension must be compiled threaded -# as well. -# -# Note that it is legal to have a thread enabled extension run in a -# threaded or non-threaded Tcl core, but a non-threaded extension may -# only run in a non-threaded Tcl core. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-threads -# -# Sets the following vars: -# THREADS_LIBS Thread library(s) -# -# Defines the following vars: -# TCL_THREADS -# _REENTRANT -# _THREAD_SAFE -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_THREADS], [ - AC_ARG_ENABLE(threads, - AC_HELP_STRING([--enable-threads], - [build with threads]), - [tcl_ok=$enableval], [tcl_ok=yes]) - - if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then - TCL_THREADS=1 - - if test "${TEA_PLATFORM}" != "windows" ; then - # We are always OK on Windows, so check what this platform wants: - - # USE_THREAD_ALLOC tells us to try the special thread-based - # allocator that significantly reduces lock contention - AC_DEFINE(USE_THREAD_ALLOC, 1, - [Do we want to use the threaded memory allocator?]) - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - if test "`uname -s`" = "SunOS" ; then - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - fi - AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) - AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) - if test "$tcl_ok" = "no"; then - # Check a little harder for __pthread_mutex_init in the same - # library, as some systems hide it there until pthread.h is - # defined. We could alternatively do an AC_TRY_COMPILE with - # pthread.h, but that will work with libpthread really doesn't - # exist, like AIX 4.2. [Bug: 4359] - AC_CHECK_LIB(pthread, __pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthread" - else - AC_CHECK_LIB(pthreads, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthreads" - else - AC_CHECK_LIB(c, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "no"; then - AC_CHECK_LIB(c_r, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -pthread" - else - TCL_THREADS=0 - AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) - fi - fi - fi - fi - fi - else - TCL_THREADS=0 - fi - # Do checking message here to not mess up interleaved configure output - AC_MSG_CHECKING([for building with threads]) - if test "${TCL_THREADS}" = 1; then - AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) - AC_MSG_RESULT([yes (default)]) - else - AC_MSG_RESULT([no]) - fi - # TCL_THREADS sanity checking. See if our request for building with - # threads is the same as the way Tcl was built. If not, warn the user. - case ${TCL_DEFS} in - *THREADS=1*) - if test "${TCL_THREADS}" = "0"; then - AC_MSG_WARN([ - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads.]) - fi - ;; - *) - if test "${TCL_THREADS}" = "1"; then - AC_MSG_WARN([ - --enable-threads requested, but building against a Tcl that is NOT - thread-enabled. This is an OK configuration that will also run in - a thread-enabled core.]) - fi - ;; - esac - AC_SUBST(TCL_THREADS) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_SYMBOLS -- -# -# Specify if debugging symbols should be used. -# Memory (TCL_MEM_DEBUG) debugging can also be enabled. -# -# Arguments: -# none -# -# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives -# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. -# Requires the following vars to be set in the Makefile: -# CFLAGS_DEFAULT -# LDFLAGS_DEFAULT -# -# Results: -# -# Adds the following arguments to configure: -# --enable-symbols -# -# Defines the following vars: -# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true -# Sets to $(CFLAGS_OPTIMIZE) if false -# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true -# Sets to $(LDFLAGS_OPTIMIZE) if false -# DBGX Formerly used as debug library extension; -# always blank now. -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_SYMBOLS], [ - dnl Make sure we are initialized - AC_REQUIRE([TEA_CONFIG_CFLAGS]) - AC_MSG_CHECKING([for build with symbols]) - AC_ARG_ENABLE(symbols, - AC_HELP_STRING([--enable-symbols], - [build with debugging symbols (default: off)]), - [tcl_ok=$enableval], [tcl_ok=no]) - DBGX="" - if test "$tcl_ok" = "no"; then - CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" - LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" - AC_MSG_RESULT([no]) - else - CFLAGS_DEFAULT="${CFLAGS_DEBUG}" - LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" - if test "$tcl_ok" = "yes"; then - AC_MSG_RESULT([yes (standard debugging)]) - fi - fi - if test "${TEA_PLATFORM}" != "windows" ; then - LDFLAGS_DEFAULT="${LDFLAGS}" - fi - - AC_SUBST(TCL_DBGX) - AC_SUBST(CFLAGS_DEFAULT) - AC_SUBST(LDFLAGS_DEFAULT) - - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) - fi - - if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then - if test "$tcl_ok" = "all"; then - AC_MSG_RESULT([enabled symbols mem debugging]) - else - AC_MSG_RESULT([enabled $tcl_ok debugging]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_LANGINFO -- -# -# Allows use of modern nl_langinfo check for better l10n. -# This is only relevant for Unix. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-langinfo=yes|no (default is yes) -# -# Defines the following vars: -# HAVE_LANGINFO Triggers use of nl_langinfo if defined. -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_LANGINFO], [ - AC_ARG_ENABLE(langinfo, - AC_HELP_STRING([--enable-langinfo], - [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), - [langinfo_ok=$enableval], [langinfo_ok=yes]) - - HAVE_LANGINFO=0 - if test "$langinfo_ok" = "yes"; then - AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) - fi - AC_MSG_CHECKING([whether to use nl_langinfo]) - if test "$langinfo_ok" = "yes"; then - AC_CACHE_VAL(tcl_cv_langinfo_h, [ - AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], - [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) - AC_MSG_RESULT([$tcl_cv_langinfo_h]) - if test $tcl_cv_langinfo_h = yes; then - AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) - fi - else - AC_MSG_RESULT([$langinfo_ok]) - fi -]) - -#-------------------------------------------------------------------- -# TEA_CONFIG_SYSTEM -# -# Determine what the system is (some things cannot be easily checked -# on a feature-driven basis, alas). This can usually be done via the -# "uname" command, but there are a few systems, like Next, where -# this doesn't work. -# -# Arguments: -# none -# -# Results: -# Defines the following var: -# -# system - System/platform/version identification code. -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_CONFIG_SYSTEM], [ - AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ - if test "${TEA_PLATFORM}" = "windows" ; then - tcl_cv_sys_version=windows - elif test -f /usr/lib/NextStep/software_version; then - tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` - else - tcl_cv_sys_version=`uname -s`-`uname -r` - if test "$?" -ne 0 ; then - AC_MSG_WARN([can't find uname command]) - tcl_cv_sys_version=unknown - else - # Special check for weird MP-RAS system (uname returns weird - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid` - fi - if test "`uname -s`" = "AIX" ; then - tcl_cv_sys_version=AIX-`uname -v`.`uname -r` - fi - fi - fi - ]) - system=$tcl_cv_sys_version -]) - -#-------------------------------------------------------------------- -# TEA_CONFIG_CFLAGS -# -# Try to determine the proper flags to pass to the compiler -# for building shared libraries and other such nonsense. -# -# Arguments: -# none -# -# Results: -# -# Defines and substitutes the following vars: -# -# DL_OBJS - Name of the object file that implements dynamic -# loading for Tcl on this system. -# DL_LIBS - Library file(s) to include in tclsh and other base -# applications in order for the "load" command to work. -# LDFLAGS - Flags to pass to the compiler when linking object -# files into an executable application binary such -# as tclsh. -# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", -# that tell the run-time dynamic linker where to look -# for shared libraries such as libtcl.so. Depends on -# the variable LIB_RUNTIME_DIR in the Makefile. Could -# be the same as CC_SEARCH_FLAGS if ${CC} is used to link. -# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", -# that tell the run-time dynamic linker where to look -# for shared libraries such as libtcl.so. Depends on -# the variable LIB_RUNTIME_DIR in the Makefile. -# SHLIB_CFLAGS - Flags to pass to cc when compiling the components -# of a shared library (may request position-independent -# code, among other things). -# SHLIB_LD - Base command to use for combining object files -# into a shared library. -# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when -# creating shared libraries. This symbol typically -# goes at the end of the "ld" commands that build -# shared libraries. The value of the symbol is -# "${LIBS}" if all of the dependent libraries should -# be specified when creating a shared library. If -# dependent libraries should not be specified (as on -# SunOS 4.x, where they cause the link to fail, or in -# general if Tcl and Tk aren't themselves shared -# libraries), then this symbol has an empty string -# as its value. -# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable -# extensions. An empty string means we don't know how -# to use shared libraries on this platform. -# LIB_SUFFIX - Specifies everything that comes after the "libfoo" -# in a static or shared library name, using the $VERSION variable -# to put the version in the right place. This is used -# by platforms that need non-standard library names. -# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs -# to have a version after the .so, and ${VERSION}.a -# on AIX, since a shared library needs to have -# a .a extension whereas shared objects for loadable -# extensions have a .so extension. Defaults to -# ${VERSION}${SHLIB_SUFFIX}. -# TCL_NEEDS_EXP_FILE - -# 1 means that an export file is needed to link to a -# shared library. -# TCL_EXP_FILE - The name of the installed export / import file which -# should be used to link to the Tcl shared library. -# Empty if Tcl is unshared. -# TCL_BUILD_EXP_FILE - -# The name of the built export / import file which -# should be used to link to the Tcl shared library. -# Empty if Tcl is unshared. -# CFLAGS_DEBUG - -# Flags used when running the compiler in debug mode -# CFLAGS_OPTIMIZE - -# Flags used when running the compiler in optimize mode -# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_CONFIG_CFLAGS], [ - dnl Make sure we are initialized - AC_REQUIRE([TEA_INIT]) - - # Step 0.a: Enable 64 bit support? - - AC_MSG_CHECKING([if 64bit support is requested]) - AC_ARG_ENABLE(64bit, - AC_HELP_STRING([--enable-64bit], - [enable 64bit support (default: off)]), - [do64bit=$enableval], [do64bit=no]) - AC_MSG_RESULT([$do64bit]) - - # Step 0.b: Enable Solaris 64 bit VIS support? - - AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) - AC_ARG_ENABLE(64bit-vis, - AC_HELP_STRING([--enable-64bit-vis], - [enable 64bit Sparc VIS support (default: off)]), - [do64bitVIS=$enableval], [do64bitVIS=no]) - AC_MSG_RESULT([$do64bitVIS]) - - if test "$do64bitVIS" = "yes"; then - # Force 64bit on with VIS - do64bit=yes - fi - - # Step 0.c: Cross-compiling options for Windows/CE builds? - - if test "${TEA_PLATFORM}" = "windows" ; then - AC_MSG_CHECKING([if Windows/CE build is requested]) - AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) - AC_MSG_RESULT([$doWince]) - fi - - # Step 1: set the variable "system" to hold the name and version number - # for the system. - - TEA_CONFIG_SYSTEM - - # Step 2: check for existence of -ldl library. This is needed because - # Linux can use either -ldl or -ldld for dynamic loading. - - AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) - - # Require ranlib early so we can override it in special cases below. - - AC_REQUIRE([AC_PROG_RANLIB]) - - # Step 3: set configuration options based on system name and version. - # This is similar to Tcl's unix/tcl.m4 except that we've added a - # "windows" case. - - do64bit_ok=no - LDFLAGS_ORIG="$LDFLAGS" - # When ld needs options to work in 64-bit mode, put them in - # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] - # is disabled by the user. [Bug 1016796] - LDFLAGS_ARCH="" - TCL_EXPORT_FILE_SUFFIX="" - UNSHARED_LIB_SUFFIX="" - TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' - ECHO_VERSION='`echo ${PACKAGE_VERSION}`' - TCL_LIB_VERSIONS_OK=ok - CFLAGS_DEBUG=-g - CFLAGS_OPTIMIZE=-O - if test "$GCC" = "yes" ; then - CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wno-implicit-int" - else - CFLAGS_WARNING="" - fi - TCL_NEEDS_EXP_FILE=0 - TCL_BUILD_EXP_FILE="" - TCL_EXP_FILE="" -dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. -dnl AC_CHECK_TOOL(AR, ar) - AC_CHECK_PROG(AR, ar, ar) - STLIB_LD='${AR} cr' - LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" - case $system in - windows) - # This is a 2-stage check to make sure we have the 64-bit SDK - # We have to know where the SDK is installed. - # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs - # MACHINE is IX86 for LINK, but this is used by the manifest, - # which requires x86|amd64|ia64. - MACHINE="X86" - if test "$do64bit" != "no" ; then - if test "x${MSSDK}x" = "xx" ; then - MSSDK="C:/Progra~1/Microsoft Platform SDK" - fi - MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` - PATH64="" - case "$do64bit" in - amd64|x64|yes) - MACHINE="AMD64" ; # default to AMD64 64-bit build - PATH64="${MSSDK}/Bin/Win64/x86/AMD64" - ;; - ia64) - MACHINE="IA64" - PATH64="${MSSDK}/Bin/Win64" - ;; - esac - if test ! -d "${PATH64}" ; then - AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) - AC_MSG_WARN([Ensure latest Platform SDK is installed]) - do64bit="no" - else - AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) - do64bit_ok="yes" - fi - fi - - if test "$doWince" != "no" ; then - if test "$do64bit" != "no" ; then - AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) - fi - if test "$GCC" = "yes" ; then - AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) - fi - TEA_PATH_CELIB - # Set defaults for common evc4/PPC2003 setup - # Currently Tcl requires 300+, possibly 420+ for sockets - CEVERSION=420; # could be 211 300 301 400 420 ... - TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... - ARCH=ARM; # could be ARM MIPS X86EM ... - PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" - if test "$doWince" != "yes"; then - # If !yes then the user specified something - # Reset ARCH to allow user to skip specifying it - ARCH= - eval `echo $doWince | awk -F, '{ \ - if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ - if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ - if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ - if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ - if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ - }'` - if test "x${ARCH}" = "x" ; then - ARCH=$TARGETCPU; - fi - fi - OSVERSION=WCE$CEVERSION; - if test "x${WCEROOT}" = "x" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" - if test ! -d "${WCEROOT}" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded Tools" - fi - fi - if test "x${SDKROOT}" = "x" ; then - SDKROOT="C:/Program Files/Windows CE Tools" - if test ! -d "${SDKROOT}" ; then - SDKROOT="C:/Windows CE Tools" - fi - fi - WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` - SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` - if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ - -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then - AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) - doWince="no" - else - # We could PATH_NOSPACE these, but that's not important, - # as long as we quote them when used. - CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" - if test -d "${CEINCLUDE}/${TARGETCPU}" ; then - CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" - fi - CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" - fi - fi - - if test "$GCC" != "yes" ; then - if test "${SHARED_BUILD}" = "0" ; then - runtime=-MT - else - runtime=-MD - fi - - if test "$do64bit" != "no" ; then - # All this magic is necessary for the Win64 SDK RC1 - hobbs - CC="\"${PATH64}/cl.exe\"" - CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" - RC="\"${MSSDK}/bin/rc.exe\"" - lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" - LINKBIN="\"${PATH64}/link.exe\"" - CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - # Avoid 'unresolved external symbol __security_cookie' - # errors, c.f. http://support.microsoft.com/?id=894573 - TEA_ADD_LIBS([bufferoverflowU.lib]) - elif test "$doWince" != "no" ; then - CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" - if test "${TARGETCPU}" = "X86"; then - CC="\"${CEBINROOT}/cl.exe\"" - else - CC="\"${CEBINROOT}/cl${ARCH}.exe\"" - fi - CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" - RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" - arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` - defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" - if test "${SHARED_BUILD}" = "1" ; then - # Static CE builds require static celib as well - defs="${defs} _DLL" - fi - for i in $defs ; do - AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) - done - AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) - AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) - CFLAGS_DEBUG="-nologo -Zi -Od" - CFLAGS_OPTIMIZE="-nologo -Ox" - lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` - lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" - LINKBIN="\"${CEBINROOT}/link.exe\"" - AC_SUBST(CELIB_DIR) - else - RC="rc" - lflags="-nologo" - LINKBIN="link" - CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - fi - fi - - if test "$GCC" = "yes"; then - # mingw gcc mode - RC="windres" - CFLAGS_DEBUG="-g" - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - SHLIB_LD="$CC -shared" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" - LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" - else - SHLIB_LD="${LINKBIN} -dll ${lflags}" - # link -lib only works when -lib is the first arg - STLIB_LD="${LINKBIN} -lib ${lflags}" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' - PATHTYPE=-w - # For information on what debugtype is most useful, see: - # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp - # This essentially turns it all on. - LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" - LDFLAGS_OPTIMIZE="-release" - if test "$doWince" != "no" ; then - LDFLAGS_CONSOLE="-link ${lflags}" - LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} - else - LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" - LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" - fi - fi - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dll" - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' - - TCL_LIB_VERSIONS_OK=nodots - # Bogus to avoid getting this turned off - DL_OBJS="tclLoadNone.obj" - ;; - AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then - # AIX requires the _r compiler when gcc isn't being used - case "${CC}" in - *_r) - # ok ... - ;; - *) - CC=${CC}_r - ;; - esac - AC_MSG_RESULT([Using $CC for compiling with threads]) - fi - LIBS="$LIBS -lc" - SHLIB_CFLAGS="" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - DL_OBJS="tclLoadDl.o" - LD_LIBRARY_PATH_VAR="LIBPATH" - - # Check to enable 64-bit flags for compiler/linker on AIX 4+ - if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - else - do64bit_ok=yes - CFLAGS="$CFLAGS -q64" - LDFLAGS_ARCH="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi - - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - else - SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - fi - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' - fi - - # AIX v<=4.1 has some different flags than 4.2+ - if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then - AC_LIBOBJ([tclLoadAix]) - DL_LIBS="-lld" - fi - - # On AIX <=v4 systems, libbsd.a has to be linked in to support - # non-blocking file IO. This library has to be linked in after - # the MATH_LIBS or it breaks the pow() function. The way to - # insure proper sequencing, is to add it to the tail of MATH_LIBS. - # This library also supplies gettimeofday. - # - # AIX does not have a timezone field in struct tm. When the AIX - # bsd library is used, the timezone global and the gettimeofday - # methods are to be avoided for timezone deduction instead, we - # deduce the timezone by comparing the localtime result on a - # known GMT value. - - AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) - if test $libbsd = yes; then - MATH_LIBS="$MATH_LIBS -lbsd" - AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) - fi - ;; - BeOS*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC} -nostart" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - - #----------------------------------------------------------- - # Check for inet_ntoa in -lbind, for BeOS (which also needs - # -lsocket, even if the network functions are in -lnet which - # is always linked to, for compatibility. - #----------------------------------------------------------- - AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) - ;; - BSD/OS-2.1*|BSD/OS-3*) - SHLIB_CFLAGS="" - SHLIB_LD="shlicc -r" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - BSD/OS-4.*) - SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="cc -shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - dgux*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - HP-UX-*.11.*) - # Use updated header definitions where possible - AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) - # Needed by Tcl, but not most extensions - #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) - #LIBS="$LIBS -lxnet" # Use the XOPEN network library - - if test "`uname -m`" = "ia64" ; then - SHLIB_SUFFIX=".so" - # Use newer C++ library for C++ extensions - #if test "$GCC" != "yes" ; then - # CPPFLAGS="-AA" - #fi - else - SHLIB_SUFFIX=".sl" - fi - AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS='${LIBS}' - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - SHLIB_LD_LIBS='${LIBS}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - - # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc - #CFLAGS="$CFLAGS +DAportable" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - hpux_arch=`${CC} -dumpmachine` - case $hpux_arch in - hppa64*) - # 64-bit gcc in use. Fix flags for GNU ld. - do64bit_ok=yes - SHLIB_LD="${CC} -shared" - SHLIB_LD_LIBS='${LIBS}' - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ;; - *) - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - ;; - esac - else - do64bit_ok=yes - CFLAGS="$CFLAGS +DD64" - LDFLAGS_ARCH="+DD64" - fi - fi - ;; - HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) - SHLIB_SUFFIX=".sl" - AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS="" - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - ;; - IRIX-5.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - ;; - IRIX-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mabi=n32" - LDFLAGS="$LDFLAGS -mabi=n32" - else - case $system in - IRIX-6.3) - # Use to build 6.2 compatible binaries on 6.3. - CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" - ;; - *) - CFLAGS="$CFLAGS -n32" - ;; - esac - LDFLAGS="$LDFLAGS -n32" - fi - ;; - IRIX64-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - - # Check to enable 64-bit flags for compiler/linker - - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN([64bit mode not supported by gcc]) - else - do64bit_ok=yes - SHLIB_LD="ld -64 -shared -rdata_shared" - CFLAGS="$CFLAGS -64" - LDFLAGS_ARCH="-64" - fi - fi - ;; - Linux*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings - # when you inline the string and math operations. Turn this off to - # get rid of the warnings. - #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" - - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - if test $do64bit = yes; then - AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -m64" - AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_m64 = yes; then - CFLAGS="$CFLAGS -m64" - do64bit_ok=yes - fi - fi - - # The combo of gcc + glibc has a bug related - # to inlining of functions like strtod(). The - # -fno-builtin flag should address this problem - # but it does not work. The -fno-inline flag - # is kind of overkill but it works. - # Disable inlining only when one of the - # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x ; then - CFLAGS="$CFLAGS -fno-inline" - fi - - ;; - GNU*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - SHLIB_LD="${CC} -shared" - DL_OBJS="" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - ;; - Lynx*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - CFLAGS_OPTIMIZE=-02 - SHLIB_LD="${CC} -shared " - DL_OBJS="tclLoadDl.o" - DL_LIBS="-mshared -ldl" - LD_FLAGS="-Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - ;; - MP-RAS-02*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - MP-RAS-*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,-Bexport" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - NetBSD-*|FreeBSD-[[1-2]].*) - # NetBSD/SPARC needs -fPIC, -fpic will not do. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ - AC_EGREP_CPP(yes, [ -#ifdef __ELF__ - yes -#endif - ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) - if test $tcl_cv_ld_elf = yes; then - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - else - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - fi - - # Ancient FreeBSD doesn't handle version numbers with dots. - - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - OpenBSD-*) - # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. - case `machine` in - sparc|sparc64) - SHLIB_CFLAGS="-fPIC";; - *) - SHLIB_CFLAGS="-fpic";; - esac - SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ - AC_EGREP_CPP(yes, [ -#ifdef __ELF__ - yes -#endif - ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) - if test $tcl_cv_ld_elf = yes; then - LDFLAGS=-Wl,-export-dynamic - else - LDFLAGS="" - fi - - # OpenBSD doesn't do version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - FreeBSD-*) - # FreeBSD 3.* and greater have ELF. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "${TCL_THREADS}" = "1" ; then - # The -pthread needs to go in the CFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - case $system in - FreeBSD-3.*) - # FreeBSD-3 doesn't handle version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - TCL_LIB_VERSIONS_OK=nodots - ;; - esac - ;; - Darwin-*) - CFLAGS_OPTIMIZE="-Os" - SHLIB_CFLAGS="-fno-common" - # To avoid discrepancies between what headers configure sees during - # preprocessing tests and compiling tests, move any -isysroot and - # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: - CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" - CFLAGS="`echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" - if test $do64bit = yes; then - case `arch` in - ppc) - AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], - tcl_cv_cc_arch_ppc64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes, - tcl_cv_cc_arch_ppc64=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_arch_ppc64 = yes; then - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - do64bit_ok=yes - fi;; - i386) - AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], - tcl_cv_cc_arch_x86_64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch x86_64" - AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes, - tcl_cv_cc_arch_x86_64=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_arch_x86_64 = yes; then - CFLAGS="$CFLAGS -arch x86_64" - do64bit_ok=yes - fi;; - *) - AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; - esac - else - # Check for combined 32-bit and 64-bit fat build - echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ - echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ - fat_32_64=yes - fi - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' - AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) - LDFLAGS=$hold_ldflags]) - if test $tcl_cv_ld_single_module = yes; then - SHLIB_LD="${SHLIB_LD} -Wl,-single_module" - fi - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dylib" - DL_OBJS="tclLoadDyld.o" - DL_LIBS="" - # Don't use -prebind when building for Mac OS X 10.4 or later only: - test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \ - "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \ - LDFLAGS="$LDFLAGS -prebind" - LDFLAGS="$LDFLAGS -headerpad_max_install_names" - AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no) - LDFLAGS=$hold_ldflags]) - if test $tcl_cv_ld_search_paths_first = yes; then - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" - - # TEA specific: for Tk extensions, remove 64-bit arch flags from - # CFLAGS et al. for combined 32 & 64 bit fat builds as neither - # TkAqua nor TkX11 can be built for 64-bit at present. - test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done - ;; - NEXTSTEP-*) - SHLIB_CFLAGS="" - SHLIB_LD="cc -nostdlib -r" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadNext.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OS/390-*) - CFLAGS_OPTIMIZE="" # Optimizer is buggy - AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h - [Should OS/390 do the right thing with sockets?]) - ;; - OSF1-1.0|OSF1-1.1|OSF1-1.2) - # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 - SHLIB_CFLAGS="" - # Hack: make package name same as library name - SHLIB_LD='ld -R -export $@:' - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadOSF.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-1.*) - # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - SHLIB_CFLAGS="-fPIC" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD="ld -shared" - else - SHLIB_LD="ld -non_shared" - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-V*) - # Digital OSF/1 - SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD='ld -shared -expect_unresolved "*"' - else - SHLIB_LD='ld -non_shared -expect_unresolved "*"' - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mieee" - else - CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" - fi - # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = "1" ; then - CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" - CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" - LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = "yes" ; then - LIBS="$LIBS -lpthread -lmach -lexc" - else - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - fi - - ;; - QNX-6*) - # QNX RTP - # This may work for all QNX, but it was only reported for v6. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - # dlopen is in -lc on QNX - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SCO_SV-3.2*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, - # this test works, since "uname -s" was non-standard in 3.2.4 and - # below. - if test "$GCC" = "yes" ; then - SHLIB_CFLAGS="-fPIC -melf" - LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" - else - SHLIB_CFLAGS="-Kpic -belf" - LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" - fi - SHLIB_LD="ld -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SINIX*5.4*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SunOS-4*) - SHLIB_CFLAGS="-PIC" - SHLIB_LD="ld" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - - # SunOS can't handle version numbers with dots in them in library - # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it - # requires an extra version number at the end of .so file names. - # So, the library has to have a name like libtcl75.so.1.0 - - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - SunOS-5.[[0-6]]) - # Careful to not let 5.10+ fall into this case - - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - - SHLIB_CFLAGS="-KPIC" - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - ;; - SunOS-5*) - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - - SHLIB_CFLAGS="-KPIC" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - arch=`isainfo` - if test "$arch" = "sparcv9 sparc" ; then - if test "$GCC" = "yes" ; then - if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then - AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) - else - do64bit_ok=yes - CFLAGS="$CFLAGS -m64 -mcpu=v9" - LDFLAGS="$LDFLAGS -m64 -mcpu=v9" - SHLIB_CFLAGS="-fPIC" - fi - else - do64bit_ok=yes - if test "$do64bitVIS" = "yes" ; then - CFLAGS="$CFLAGS -xarch=v9a" - LDFLAGS_ARCH="-xarch=v9a" - else - CFLAGS="$CFLAGS -xarch=v9" - LDFLAGS_ARCH="-xarch=v9" - fi - # Solaris 64 uses this as well - #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" - fi - elif test "$arch" = "amd64 i386" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - else - do64bit_ok=yes - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64" - fi - else - AC_MSG_WARN([64bit mode not supported for $arch]) - fi - fi - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = "yes" ; then - # We need to specify -static-libgcc or we need to - # add the path to the sparv9 libgcc. - # JH: static-libgcc is necessary for core Tcl, but may - # not be necessary for extensions. - SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" - # for finding sparcv9 libgcc, get the regular libgcc - # path, remove so name and append 'sparcv9' - #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." - #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" - fi - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - fi - ;; - UNIX_SV* | UnixWare-5*) - SHLIB_CFLAGS="-KPIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers - # that don't grok the -Bexport option. Test that it does. - AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-Bexport" - AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) - LDFLAGS=$hold_ldflags]) - if test $tcl_cv_ld_Bexport = yes; then - LDFLAGS="$LDFLAGS -Wl,-Bexport" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - esac - - if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then - AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) - fi - -dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so -dnl # until the end of configure, as configure's compile and link tests use -dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's -dnl # preprocessing tests use only CPPFLAGS. - AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) - - # Step 4: disable dynamic loading if requested via a command-line switch. - - AC_ARG_ENABLE(load, - AC_HELP_STRING([--enable-load], - [allow dynamic loading and "load" command (default: on)]), - [tcl_ok=$enableval], [tcl_ok=yes]) - if test "$tcl_ok" = "no"; then - DL_OBJS="" - fi - - if test "x$DL_OBJS" != "x" ; then - BUILD_DLTEST="\$(DLTEST_TARGETS)" - else - echo "Can't figure out how to do dynamic loading or shared libraries" - echo "on this system." - SHLIB_CFLAGS="" - SHLIB_LD="" - SHLIB_SUFFIX="" - DL_OBJS="tclLoadNone.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS_ORIG" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - BUILD_DLTEST="" - fi - LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" - - # If we're running gcc, then change the C flags for compiling shared - # libraries to the right flags for gcc, instead of those for the - # standard manufacturer compiler. - - if test "$DL_OBJS" != "tclLoadNone.o" ; then - if test "$GCC" = "yes" ; then - case $system in - AIX-*) - ;; - BSD/OS*) - ;; - IRIX*) - ;; - NetBSD-*|FreeBSD-*) - ;; - Darwin-*) - ;; - SCO_SV-3.2*) - ;; - windows) - ;; - *) - SHLIB_CFLAGS="-fPIC" - ;; - esac - fi - fi - - if test "$SHARED_LIB_SUFFIX" = "" ; then - SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' - fi - if test "$UNSHARED_LIB_SUFFIX" = "" ; then - UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' - fi - - AC_SUBST(DL_LIBS) - - AC_SUBST(CFLAGS_DEBUG) - AC_SUBST(CFLAGS_OPTIMIZE) - AC_SUBST(CFLAGS_WARNING) - - AC_SUBST(STLIB_LD) - AC_SUBST(SHLIB_LD) - - AC_SUBST(SHLIB_LD_LIBS) - AC_SUBST(SHLIB_CFLAGS) - - AC_SUBST(LD_LIBRARY_PATH_VAR) - - # These must be called after we do the basic CFLAGS checks and - # verify any possible 64-bit or similar switches are necessary - TEA_TCL_EARLY_FLAGS - TEA_TCL_64BIT_FLAGS -]) - -#-------------------------------------------------------------------- -# TEA_SERIAL_PORT -# -# Determine which interface to use to talk to the serial port. -# Note that #include lines must begin in leftmost column for -# some compilers to recognize them as preprocessor directives, -# and some build environments have stdin not pointing at a -# pseudo-terminal (usually /dev/null instead.) -# -# Arguments: -# none -# -# Results: -# -# Defines only one of the following vars: -# HAVE_SYS_MODEM_H -# USE_TERMIOS -# USE_TERMIO -# USE_SGTTY -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_SERIAL_PORT], [ - AC_CHECK_HEADERS(sys/modem.h) - AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ - AC_TRY_RUN([ -#include - -int main() { - struct termios t; - if (tcgetattr(0, &t) == 0) { - cfsetospeed(&t, 0); - t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - if test $tcl_cv_api_serial = no ; then - AC_TRY_RUN([ -#include - -int main() { - struct termio t; - if (ioctl(0, TCGETA, &t) == 0) { - t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no ; then - AC_TRY_RUN([ -#include - -int main() { - struct sgttyb t; - if (ioctl(0, TIOCGETP, &t) == 0) { - t.sg_ospeed = 0; - t.sg_flags |= ODDP | EVENP | RAW; - return 0; - } - return 1; -}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no ; then - AC_TRY_RUN([ -#include -#include - -int main() { - struct termios t; - if (tcgetattr(0, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - cfsetospeed(&t, 0); - t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no; then - AC_TRY_RUN([ -#include -#include - -int main() { - struct termio t; - if (ioctl(0, TCGETA, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; - }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no; then - AC_TRY_RUN([ -#include -#include - -int main() { - struct sgttyb t; - if (ioctl(0, TIOCGETP, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - t.sg_ospeed = 0; - t.sg_flags |= ODDP | EVENP | RAW; - return 0; - } - return 1; -}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) - fi]) - case $tcl_cv_api_serial in - termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; - termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; - sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; - esac -]) - -#-------------------------------------------------------------------- -# TEA_MISSING_POSIX_HEADERS -# -# Supply substitutes for missing POSIX header files. Special -# notes: -# - stdlib.h doesn't define strtol, strtoul, or -# strtod insome versions of SunOS -# - some versions of string.h don't declare procedures such -# as strstr -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# NO_DIRENT_H -# NO_ERRNO_H -# NO_VALUES_H -# HAVE_LIMITS_H or NO_LIMITS_H -# NO_STDLIB_H -# NO_STRING_H -# NO_SYS_WAIT_H -# NO_DLFCN_H -# HAVE_SYS_PARAM_H -# -# HAVE_STRING_H ? -# -# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and -# CHECK on limits.h -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ - AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ - AC_TRY_LINK([#include -#include ], [ -#ifndef _POSIX_SOURCE -# ifdef __Lynx__ - /* - * Generate compilation error to make the test fail: Lynx headers - * are only valid if really in the POSIX environment. - */ - - missing_procedure(); -# endif -#endif -DIR *d; -struct dirent *entryPtr; -char *p; -d = opendir("foobar"); -entryPtr = readdir(d); -p = entryPtr->d_name; -closedir(d); -], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) - - if test $tcl_cv_dirent_h = no; then - AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) - fi - - AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(limits.h, - [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], - [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) - AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) - AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) - AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) - if test $tcl_ok = 0; then - AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) - fi - AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) - AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) - AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) - - # See also memmove check below for a place where NO_STRING_H can be - # set and why. - - if test $tcl_ok = 0; then - AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) - fi - - AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) - - # OS/390 lacks sys/param.h (and doesn't need it, by chance). - AC_HAVE_HEADERS(sys/param.h) -]) - -#-------------------------------------------------------------------- -# TEA_PATH_X -# -# Locate the X11 header files and the X11 library archive. Try -# the ac_path_x macro first, but if it doesn't find the X stuff -# (e.g. because there's no xmkmf program) then check through -# a list of possible directories. Under some conditions the -# autoconf macro will return an include directory that contains -# no include files, so double-check its result just to be safe. -# -# This should be called after TEA_CONFIG_CFLAGS as setting the -# LIBS line can confuse some configure macro magic. -# -# Arguments: -# none -# -# Results: -# -# Sets the following vars: -# XINCLUDES -# XLIBSW -# PKG_LIBS (appends to) -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_PATH_X], [ - if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then - TEA_PATH_UNIX_X - fi -]) - -AC_DEFUN([TEA_PATH_UNIX_X], [ - AC_PATH_X - not_really_there="" - if test "$no_x" = ""; then - if test "$x_includes" = ""; then - AC_TRY_CPP([#include ], , not_really_there="yes") - else - if test ! -r $x_includes/X11/Intrinsic.h; then - not_really_there="yes" - fi - fi - fi - if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then - AC_MSG_CHECKING([for X11 header files]) - found_xincludes="no" - AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") - if test "$found_xincludes" = "no"; then - dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" - for i in $dirs ; do - if test -r $i/X11/Intrinsic.h; then - AC_MSG_RESULT([$i]) - XINCLUDES=" -I$i" - found_xincludes="yes" - break - fi - done - fi - else - if test "$x_includes" != ""; then - XINCLUDES="-I$x_includes" - found_xincludes="yes" - fi - fi - if test found_xincludes = "no"; then - AC_MSG_RESULT([couldn't find any!]) - fi - - if test "$no_x" = yes; then - AC_MSG_CHECKING([for X11 libraries]) - XLIBSW=nope - dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" - for i in $dirs ; do - if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then - AC_MSG_RESULT([$i]) - XLIBSW="-L$i -lX11" - x_libraries="$i" - break - fi - done - else - if test "$x_libraries" = ""; then - XLIBSW=-lX11 - else - XLIBSW="-L$x_libraries -lX11" - fi - fi - if test "$XLIBSW" = nope ; then - AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) - fi - if test "$XLIBSW" = nope ; then - AC_MSG_RESULT([could not find any! Using -lX11.]) - XLIBSW=-lX11 - fi - if test x"${XLIBSW}" != x ; then - PKG_LIBS="${PKG_LIBS} ${XLIBSW}" - fi -]) - -#-------------------------------------------------------------------- -# TEA_BLOCKING_STYLE -# -# The statements below check for systems where POSIX-style -# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. -# On these systems (mostly older ones), use the old BSD-style -# FIONBIO approach instead. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# HAVE_SYS_IOCTL_H -# HAVE_SYS_FILIO_H -# USE_FIONBIO -# O_NONBLOCK -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_BLOCKING_STYLE], [ - AC_CHECK_HEADERS(sys/ioctl.h) - AC_CHECK_HEADERS(sys/filio.h) - TEA_CONFIG_SYSTEM - AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) - case $system in - # There used to be code here to use FIONBIO under AIX. However, it - # was reported that FIONBIO doesn't work under AIX 3.2.5. Since - # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO - # code (JO, 5/31/97). - - OSF*) - AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) - AC_MSG_RESULT([FIONBIO]) - ;; - SunOS-4*) - AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) - AC_MSG_RESULT([FIONBIO]) - ;; - *) - AC_MSG_RESULT([O_NONBLOCK]) - ;; - esac -]) - -#-------------------------------------------------------------------- -# TEA_TIME_HANLDER -# -# Checks how the system deals with time.h, what time structures -# are used on the system, and what fields the structures have. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# USE_DELTA_FOR_TZ -# HAVE_TM_GMTOFF -# HAVE_TM_TZADJ -# HAVE_TIMEZONE_VAR -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TIME_HANDLER], [ - AC_CHECK_HEADERS(sys/time.h) - AC_HEADER_TIME - AC_STRUCT_TIMEZONE - - AC_CHECK_FUNCS(gmtime_r localtime_r) - - AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ - AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], - tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) - if test $tcl_cv_member_tm_tzadj = yes ; then - AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) - fi - - AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ - AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], - tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) - if test $tcl_cv_member_tm_gmtoff = yes ; then - AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) - fi - - # - # Its important to include time.h in this check, as some systems - # (like convex) have timezone functions, etc. - # - AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ - AC_TRY_COMPILE([#include ], - [extern long timezone; - timezone += 1; - exit (0);], - tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) - if test $tcl_cv_timezone_long = yes ; then - AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) - else - # - # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. - # - AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ - AC_TRY_COMPILE([#include ], - [extern time_t timezone; - timezone += 1; - exit (0);], - tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) - if test $tcl_cv_timezone_time = yes ; then - AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) - fi - fi -]) - -#-------------------------------------------------------------------- -# TEA_BUGGY_STRTOD -# -# Under Solaris 2.4, strtod returns the wrong value for the -# terminating character under some conditions. Check for this -# and if the problem exists use a substitute procedure -# "fixstrtod" (provided by Tcl) that corrects the error. -# Also, on Compaq's Tru64 Unix 5.0, -# strtod(" ") returns 0.0 instead of a failure to convert. -# -# Arguments: -# none -# -# Results: -# -# Might defines some of the following vars: -# strtod (=fixstrtod) -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_BUGGY_STRTOD], [ - AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) - if test "$tcl_strtod" = 1; then - AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ - AC_TRY_RUN([ - extern double strtod(); - int main() { - char *infString="Inf", *nanString="NaN", *spaceString=" "; - char *term; - double value; - value = strtod(infString, &term); - if ((term != infString) && (term[-1] == 0)) { - exit(1); - } - value = strtod(nanString, &term); - if ((term != nanString) && (term[-1] == 0)) { - exit(1); - } - value = strtod(spaceString, &term); - if (term == (spaceString+1)) { - exit(1); - } - exit(0); - }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, - tcl_cv_strtod_buggy=buggy)]) - if test "$tcl_cv_strtod_buggy" = buggy; then - AC_LIBOBJ([fixstrtod]) - USE_COMPAT=1 - AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) - fi - fi -]) - -#-------------------------------------------------------------------- -# TEA_TCL_LINK_LIBS -# -# Search for the libraries needed to link the Tcl shell. -# Things like the math library (-lm) and socket stuff (-lsocket vs. -# -lnsl) are dealt with here. -# -# Arguments: -# Requires the following vars to be set in the Makefile: -# DL_LIBS -# LIBS -# MATH_LIBS -# -# Results: -# -# Subst's the following var: -# TCL_LIBS -# MATH_LIBS -# -# Might append to the following vars: -# LIBS -# -# Might define the following vars: -# HAVE_NET_ERRNO_H -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_LINK_LIBS], [ - #-------------------------------------------------------------------- - # On a few very rare systems, all of the libm.a stuff is - # already in libc.a. Set compiler flags accordingly. - # Also, Linux requires the "ieee" library for math to work - # right (and it must appear before "-lm"). - #-------------------------------------------------------------------- - - AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") - AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) - - #-------------------------------------------------------------------- - # Interactive UNIX requires -linet instead of -lsocket, plus it - # needs net/errno.h to define the socket-related error codes. - #-------------------------------------------------------------------- - - AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) - AC_CHECK_HEADER(net/errno.h, [ - AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) - - #-------------------------------------------------------------------- - # Check for the existence of the -lsocket and -lnsl libraries. - # The order here is important, so that they end up in the right - # order in the command line generated by make. Here are some - # special considerations: - # 1. Use "connect" and "accept" to check for -lsocket, and - # "gethostbyname" to check for -lnsl. - # 2. Use each function name only once: can't redo a check because - # autoconf caches the results of the last check and won't redo it. - # 3. Use -lnsl and -lsocket only if they supply procedures that - # aren't already present in the normal libraries. This is because - # IRIX 5.2 has libraries, but they aren't needed and they're - # bogus: they goof up name resolution if used. - # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. - # To get around this problem, check for both libraries together - # if -lsocket doesn't work by itself. - #-------------------------------------------------------------------- - - tcl_checkBoth=0 - AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) - if test "$tcl_checkSocket" = 1; then - AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, - LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) - fi - if test "$tcl_checkBoth" = 1; then - tk_oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) - fi - AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, - [LIBS="$LIBS -lnsl"])]) - - # Don't perform the eval of the libraries here because DL_LIBS - # won't be set until we call TEA_CONFIG_CFLAGS - - TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' - AC_SUBST(TCL_LIBS) - AC_SUBST(MATH_LIBS) -]) - -#-------------------------------------------------------------------- -# TEA_TCL_EARLY_FLAGS -# -# Check for what flags are needed to be passed so the correct OS -# features are available. -# -# Arguments: -# None -# -# Results: -# -# Might define the following vars: -# _ISOC99_SOURCE -# _LARGEFILE64_SOURCE -# _LARGEFILE_SOURCE64 -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_EARLY_FLAG],[ - AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), - AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, - AC_TRY_COMPILE([[#define ]$1[ 1 -]$2], $3, - [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, - [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) - if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then - AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) - tcl_flags="$tcl_flags $1" - fi -]) - -AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ - AC_MSG_CHECKING([for required early compiler flags]) - tcl_flags="" - TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], - [char *p = (char *)strtoll; char *q = (char *)strtoull;]) - TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], - [struct stat64 buf; int i = stat64("/", &buf);]) - TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ], - [char *p = (char *)open64;]) - if test "x${tcl_flags}" = "x" ; then - AC_MSG_RESULT([none]) - else - AC_MSG_RESULT([${tcl_flags}]) - fi -]) - -#-------------------------------------------------------------------- -# TEA_TCL_64BIT_FLAGS -# -# Check for what is defined in the way of 64-bit features. -# -# Arguments: -# None -# -# Results: -# -# Might define the following vars: -# TCL_WIDE_INT_IS_LONG -# TCL_WIDE_INT_TYPE -# HAVE_STRUCT_DIRENT64 -# HAVE_STRUCT_STAT64 -# HAVE_TYPE_OFF64_T -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ - AC_MSG_CHECKING([for 64-bit integer type]) - AC_CACHE_VAL(tcl_cv_type_64bit,[ - tcl_cv_type_64bit=none - # See if the compiler knows natively about __int64 - AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], - tcl_type_64bit=__int64, tcl_type_64bit="long long") - # See if we should use long anyway Note that we substitute in the - # type that is our current guess for a 64-bit type inside this check - # program, so it should be modified only carefully... - AC_TRY_COMPILE(,[switch (0) { - case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; - }],tcl_cv_type_64bit=${tcl_type_64bit})]) - if test "${tcl_cv_type_64bit}" = none ; then - AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) - AC_MSG_RESULT([using long]) - elif test "${tcl_cv_type_64bit}" = "__int64" \ - -a "${TEA_PLATFORM}" = "windows" ; then - # We actually want to use the default tcl.h checks in this - # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* - AC_MSG_RESULT([using Tcl header defaults]) - else - AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, - [What type should be used to define wide integers?]) - AC_MSG_RESULT([${tcl_cv_type_64bit}]) - - # Now check for auxiliary declarations - AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ - AC_TRY_COMPILE([#include -#include ],[struct dirent64 p;], - tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) - if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then - AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) - fi - - AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ - AC_TRY_COMPILE([#include ],[struct stat64 p; -], - tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) - if test "x${tcl_cv_struct_stat64}" = "xyes" ; then - AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) - fi - - AC_CHECK_FUNCS(open64 lseek64) - AC_MSG_CHECKING([for off64_t]) - AC_CACHE_VAL(tcl_cv_type_off64_t,[ - AC_TRY_COMPILE([#include ],[off64_t offset; -], - tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) - dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the - dnl functions lseek64 and open64 are defined. - if test "x${tcl_cv_type_off64_t}" = "xyes" && \ - test "x${ac_cv_func_lseek64}" = "xyes" && \ - test "x${ac_cv_func_open64}" = "xyes" ; then - AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi -]) - -## -## Here ends the standard Tcl configuration bits and starts the -## TEA specific functions -## - -#------------------------------------------------------------------------ -# TEA_INIT -- -# -# Init various Tcl Extension Architecture (TEA) variables. -# This should be the first called TEA_* macro. -# -# Arguments: -# none -# -# Results: -# -# Defines and substs the following vars: -# CYGPATH -# EXEEXT -# Defines only: -# TEA_VERSION -# TEA_INITED -# TEA_PLATFORM (windows or unix) -# -# "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. -# -# EXEEXT -# Select the executable extension based on the host type. This -# is a lightweight replacement for AC_EXEEXT that doesn't require -# a compiler. -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_INIT], [ - # TEA extensions pass this us the version of TEA they think they - # are compatible with. - TEA_VERSION="3.6" - - AC_MSG_CHECKING([for correct TEA configuration]) - if test x"${PACKAGE_NAME}" = x ; then - AC_MSG_ERROR([ -The PACKAGE_NAME variable must be defined by your TEA configure.in]) - fi - if test x"$1" = x ; then - AC_MSG_ERROR([ -TEA version not specified.]) - elif test "$1" != "${TEA_VERSION}" ; then - AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) - else - AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) - fi - case "`uname -s`" in - *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) - AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) - EXEEXT=".exe" - TEA_PLATFORM="windows" - ;; - *) - CYGPATH=echo - EXEEXT="" - TEA_PLATFORM="unix" - ;; - esac - - # Check if exec_prefix is set. If not use fall back to prefix. - # Note when adjusted, so that TEA_PREFIX can correct for this. - # This is needed for recursive configures, since autoconf propagates - # $prefix, but not $exec_prefix (doh!). - if test x$exec_prefix = xNONE ; then - exec_prefix_default=yes - exec_prefix=$prefix - fi - - AC_SUBST(EXEEXT) - AC_SUBST(CYGPATH) - - # This package name must be replaced statically for AC_SUBST to work - AC_SUBST(PKG_LIB_FILE) - # Substitute STUB_LIB_FILE in case package creates a stub library too. - AC_SUBST(PKG_STUB_LIB_FILE) - - # We AC_SUBST these here to ensure they are subst'ed, - # in case the user doesn't call TEA_ADD_... - AC_SUBST(PKG_STUB_SOURCES) - AC_SUBST(PKG_STUB_OBJECTS) - AC_SUBST(PKG_TCL_SOURCES) - AC_SUBST(PKG_HEADERS) - AC_SUBST(PKG_INCLUDES) - AC_SUBST(PKG_LIBS) - AC_SUBST(PKG_CFLAGS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_SOURCES -- -# -# Specify one or more source files. Users should check for -# the right platform before adding to their list. -# It is not important to specify the directory, as long as it is -# in the generic, win or unix subdirectory of $(srcdir). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_SOURCES -# PKG_OBJECTS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_SOURCES], [ - vars="$@" - for i in $vars; do - case $i in - [\$]*) - # allow $-var names - PKG_SOURCES="$PKG_SOURCES $i" - PKG_OBJECTS="$PKG_OBJECTS $i" - ;; - *) - # check for existence - allows for generic/win/unix VPATH - # To add more dirs here (like 'src'), you have to update VPATH - # in Makefile.in as well - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - AC_MSG_ERROR([could not find source file '$i']) - fi - PKG_SOURCES="$PKG_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" - fi - PKG_OBJECTS="$PKG_OBJECTS $j" - ;; - esac - done - AC_SUBST(PKG_SOURCES) - AC_SUBST(PKG_OBJECTS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_STUB_SOURCES -- -# -# Specify one or more source files. Users should check for -# the right platform before adding to their list. -# It is not important to specify the directory, as long as it is -# in the generic, win or unix subdirectory of $(srcdir). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_STUB_SOURCES -# PKG_STUB_OBJECTS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_STUB_SOURCES], [ - vars="$@" - for i in $vars; do - # check for existence - allows for generic/win/unix VPATH - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - AC_MSG_ERROR([could not find stub source file '$i']) - fi - PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" - fi - PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" - done - AC_SUBST(PKG_STUB_SOURCES) - AC_SUBST(PKG_STUB_OBJECTS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_TCL_SOURCES -- -# -# Specify one or more Tcl source files. These should be platform -# independent runtime files. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_TCL_SOURCES -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_TCL_SOURCES], [ - vars="$@" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) - fi - PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" - done - AC_SUBST(PKG_TCL_SOURCES) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_HEADERS -- -# -# Specify one or more source headers. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_HEADERS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_HEADERS], [ - vars="$@" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - AC_MSG_ERROR([could not find header file '${srcdir}/$i']) - fi - PKG_HEADERS="$PKG_HEADERS $i" - done - AC_SUBST(PKG_HEADERS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_INCLUDES -- -# -# Specify one or more include dirs. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_INCLUDES -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_INCLUDES], [ - vars="$@" - for i in $vars; do - PKG_INCLUDES="$PKG_INCLUDES $i" - done - AC_SUBST(PKG_INCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_LIBS -- -# -# Specify one or more libraries. Users should check for -# the right platform before adding to their list. For Windows, -# libraries provided in "foo.lib" format will be converted to -# "-lfoo" when using GCC (mingw). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_LIBS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_LIBS], [ - vars="$@" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - AC_SUBST(PKG_LIBS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_CFLAGS -- -# -# Specify one or more CFLAGS. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_CFLAGS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_CFLAGS], [ - PKG_CFLAGS="$PKG_CFLAGS $@" - AC_SUBST(PKG_CFLAGS) -]) - -#------------------------------------------------------------------------ -# TEA_PREFIX -- -# -# Handle the --prefix=... option by defaulting to what Tcl gave -# -# Arguments: -# none -# -# Results: -# -# If --prefix or --exec-prefix was not specified, $prefix and -# $exec_prefix will be set to the values given to Tcl when it was -# configured. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_PREFIX], [ - if test "${prefix}" = "NONE"; then - prefix_default=yes - if test x"${TCL_PREFIX}" != x; then - AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) - prefix=${TCL_PREFIX} - else - AC_MSG_NOTICE([--prefix defaulting to /usr/local]) - prefix=/usr/local - fi - fi - if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ - -o x"${exec_prefix_default}" = x"yes" ; then - if test x"${TCL_EXEC_PREFIX}" != x; then - AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) - exec_prefix=${TCL_EXEC_PREFIX} - else - AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) - exec_prefix=$prefix - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_SETUP_COMPILER_CC -- -# -# Do compiler checks the way we want. This is just a replacement -# for AC_PROG_CC in TEA configure.in files to make them cleaner. -# -# Arguments: -# none -# -# Results: -# -# Sets up CC var and other standard bits we need to make executables. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_SETUP_COMPILER_CC], [ - # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) - # in this macro, they need to go into TEA_SETUP_COMPILER instead. - - # If the user did not set CFLAGS, set it now to keep - # the AC_PROG_CC macro from adding "-g -O2". - if test "${CFLAGS+set}" != "set" ; then - CFLAGS="" - fi - - AC_PROG_CC - AC_PROG_CPP - - AC_PROG_INSTALL - - #-------------------------------------------------------------------- - # Checks to see if the make program sets the $MAKE variable. - #-------------------------------------------------------------------- - - AC_PROG_MAKE_SET - - #-------------------------------------------------------------------- - # Find ranlib - #-------------------------------------------------------------------- - - AC_PROG_RANLIB - - #-------------------------------------------------------------------- - # Determines the correct binary file extension (.o, .obj, .exe etc.) - #-------------------------------------------------------------------- - - AC_OBJEXT - AC_EXEEXT -]) - -#------------------------------------------------------------------------ -# TEA_SETUP_COMPILER -- -# -# Do compiler checks that use the compiler. This must go after -# TEA_SETUP_COMPILER_CC, which does the actual compiler check. -# -# Arguments: -# none -# -# Results: -# -# Sets up CC var and other standard bits we need to make executables. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_SETUP_COMPILER], [ - # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. - AC_REQUIRE([TEA_SETUP_COMPILER_CC]) - - #------------------------------------------------------------------------ - # If we're using GCC, see if the compiler understands -pipe. If so, use it. - # It makes compiling go faster. (This is only a performance feature.) - #------------------------------------------------------------------------ - - if test -z "$no_pipe" -a -n "$GCC"; then - AC_CACHE_CHECK([if the compiler understands -pipe], - tcl_cv_cc_pipe, [ - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_pipe = yes; then - CFLAGS="$CFLAGS -pipe" - fi - fi - - #-------------------------------------------------------------------- - # Common compiler flag setup - #-------------------------------------------------------------------- - - AC_C_BIGENDIAN - if test "${TEA_PLATFORM}" = "unix" ; then - TEA_TCL_LINK_LIBS - TEA_MISSING_POSIX_HEADERS - # Let the user call this, because if it triggers, they will - # need a compat/strtod.c that is correct. Users can also - # use Tcl_GetDouble(FromObj) instead. - #TEA_BUGGY_STRTOD - fi -]) - -#------------------------------------------------------------------------ -# TEA_MAKE_LIB -- -# -# Generate a line that can be used to build a shared/unshared library -# in a platform independent manner. -# -# Arguments: -# none -# -# Requires: -# -# Results: -# -# Defines the following vars: -# CFLAGS - Done late here to note disturb other AC macros -# MAKE_LIB - Command to execute to build the Tcl library; -# differs depending on whether or not Tcl is being -# compiled as a shared library. -# MAKE_SHARED_LIB Makefile rule for building a shared library -# MAKE_STATIC_LIB Makefile rule for building a static library -# MAKE_STUB_LIB Makefile rule for building a stub library -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_MAKE_LIB], [ - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then - MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" - MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" - else - MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" - MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" - fi - - if test "${SHARED_BUILD}" = "1" ; then - MAKE_LIB="${MAKE_SHARED_LIB} " - else - MAKE_LIB="${MAKE_STATIC_LIB} " - fi - - #-------------------------------------------------------------------- - # Shared libraries and static libraries have different names. - # Use the double eval to make sure any variables in the suffix is - # substituted. (@@@ Might not be necessary anymore) - #-------------------------------------------------------------------- - - if test "${TEA_PLATFORM}" = "windows" ; then - if test "${SHARED_BUILD}" = "1" ; then - # We force the unresolved linking of symbols that are really in - # the private libraries of Tcl and Tk. - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" - fi - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - else - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - if test "$GCC" = "yes"; then - PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} - fi - # These aren't needed on Windows (either MSVC or gcc) - RANLIB=: - RANLIB_STUB=: - else - RANLIB_STUB="${RANLIB}" - if test "${SHARED_BUILD}" = "1" ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" - fi - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - fi - - # These are escaped so that only CFLAGS is picked up at configure time. - # The other values will be substituted at make time. - CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" - if test "${SHARED_BUILD}" = "1" ; then - CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" - fi - - AC_SUBST(MAKE_LIB) - AC_SUBST(MAKE_SHARED_LIB) - AC_SUBST(MAKE_STATIC_LIB) - AC_SUBST(MAKE_STUB_LIB) - AC_SUBST(RANLIB_STUB) -]) - -#------------------------------------------------------------------------ -# TEA_LIB_SPEC -- -# -# Compute the name of an existing object library located in libdir -# from the given base name and produce the appropriate linker flags. -# -# Arguments: -# basename The base name of the library without version -# numbers, extensions, or "lib" prefixes. -# extra_dir Extra directory in which to search for the -# library. This location is used first, then -# $prefix/$exec-prefix, then some defaults. -# -# Requires: -# TEA_INIT and TEA_PREFIX must be called first. -# -# Results: -# -# Defines the following vars: -# ${basename}_LIB_NAME The computed library name. -# ${basename}_LIB_SPEC The computed linker flags. -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LIB_SPEC], [ - AC_MSG_CHECKING([for $1 library]) - - # Look in exec-prefix for the library (defined by TEA_PREFIX). - - tea_lib_name_dir="${exec_prefix}/lib" - - # Or in a user-specified location. - - if test x"$2" != x ; then - tea_extra_lib_dir=$2 - else - tea_extra_lib_dir=NONE - fi - - for i in \ - `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do - if test -f "$i" ; then - tea_lib_name_dir=`dirname $i` - $1_LIB_NAME=`basename $i` - $1_LIB_PATH_NAME=$i - break - fi - done - - if test "${TEA_PLATFORM}" = "windows"; then - $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" - else - # Strip off the leading "lib" and trailing ".a" or ".so" - - tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` - $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" - fi - - if test "x${$1_LIB_NAME}" = x ; then - AC_MSG_ERROR([not found]) - else - AC_MSG_RESULT([${$1_LIB_SPEC}]) - fi -]) - -#------------------------------------------------------------------------ -# TEA_PRIVATE_TCL_HEADERS -- -# -# Locate the private Tcl include files -# -# Arguments: -# -# Requires: -# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has -# already been called. -# -# Results: -# -# Substs the following vars: -# TCL_TOP_DIR_NATIVE -# TCL_GENERIC_DIR_NATIVE -# TCL_UNIX_DIR_NATIVE -# TCL_WIN_DIR_NATIVE -# TCL_BMAP_DIR_NATIVE -# TCL_TOOL_DIR_NATIVE -# TCL_PLATFORM_DIR_NATIVE -# TCL_BIN_DIR_NATIVE -# TCL_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ - AC_MSG_CHECKING([for Tcl private include files]) - - TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` - TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" - TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" - TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" - TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" - TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" - TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" - TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" - - if test "${TEA_PLATFORM}" = "windows"; then - TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} - else - TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} - fi - # We want to ensure these are substituted so as not to require - # any *_NATIVE vars be defined in the Makefile - TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers and PrivateHeaders directories - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then - TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else - TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi - ;; - esac - else - if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then - AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) - fi - fi - - - AC_SUBST(TCL_TOP_DIR_NATIVE) - AC_SUBST(TCL_GENERIC_DIR_NATIVE) - AC_SUBST(TCL_UNIX_DIR_NATIVE) - AC_SUBST(TCL_WIN_DIR_NATIVE) - AC_SUBST(TCL_BMAP_DIR_NATIVE) - AC_SUBST(TCL_TOOL_DIR_NATIVE) - AC_SUBST(TCL_PLATFORM_DIR_NATIVE) - - AC_SUBST(TCL_INCLUDES) - AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) -]) - -#------------------------------------------------------------------------ -# TEA_PUBLIC_TCL_HEADERS -- -# -# Locate the installed public Tcl header files -# -# Arguments: -# None. -# -# Requires: -# CYGPATH must be set -# -# Results: -# -# Adds a --with-tclinclude switch to configure. -# Result is cached. -# -# Substs the following vars: -# TCL_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ - AC_MSG_CHECKING([for Tcl public headers]) - - AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) - - AC_CACHE_VAL(ac_cv_c_tclh, [ - # Use the value from --with-tclinclude, if it was given - - if test x"${with_tclinclude}" != x ; then - if test -f "${with_tclinclude}/tcl.h" ; then - ac_cv_c_tclh=${with_tclinclude} - else - AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) - fi - else - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers directory - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tcl is not installed, - # and in that situation, look there before installed locations. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - if test x"${TCL_INCLUDE_SPEC}" != x ; then - d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` - list="$list `ls -d ${d} 2>/dev/null`" - fi - fi - for i in $list ; do - if test -f "$i/tcl.h" ; then - ac_cv_c_tclh=$i - break - fi - done - fi - ]) - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tclh}" = x ; then - AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) - else - AC_MSG_RESULT([${ac_cv_c_tclh}]) - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` - - TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - AC_SUBST(TCL_INCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_PRIVATE_TK_HEADERS -- -# -# Locate the private Tk include files -# -# Arguments: -# -# Requires: -# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has -# already been called. -# -# Results: -# -# Substs the following vars: -# TK_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ - AC_MSG_CHECKING([for Tk private include files]) - - TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` - TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" - TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" - TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" - TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" - TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" - if test "${TEA_PLATFORM}" = "windows"; then - TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} - else - TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} - fi - # We want to ensure these are substituted so as not to require - # any *_NATIVE vars be defined in the Makefile - TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" - # Detect and add ttk subdir - if test -d ${TK_SRC_DIR_NATIVE}/generic/ttk; then - TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" - fi - if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ - -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" - fi - if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" - fi - if test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use - # the framework's Headers and PrivateHeaders directories - case ${TK_DEFS} in - *TK_FRAMEWORK*) - if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then - TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi - ;; - esac - else - if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then - AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) - fi - fi - - AC_SUBST(TK_TOP_DIR_NATIVE) - AC_SUBST(TK_UNIX_DIR_NATIVE) - AC_SUBST(TK_WIN_DIR_NATIVE) - AC_SUBST(TK_GENERIC_DIR_NATIVE) - AC_SUBST(TK_XLIB_DIR_NATIVE) - AC_SUBST(TK_PLATFORM_DIR_NATIVE) - - AC_SUBST(TK_INCLUDES) - AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) -]) - -#------------------------------------------------------------------------ -# TEA_PUBLIC_TK_HEADERS -- -# -# Locate the installed public Tk header files -# -# Arguments: -# None. -# -# Requires: -# CYGPATH must be set -# -# Results: -# -# Adds a --with-tkinclude switch to configure. -# Result is cached. -# -# Substs the following vars: -# TK_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ - AC_MSG_CHECKING([for Tk public headers]) - - AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) - - AC_CACHE_VAL(ac_cv_c_tkh, [ - # Use the value from --with-tkinclude, if it was given - - if test x"${with_tkinclude}" != x ; then - if test -f "${with_tkinclude}/tk.h" ; then - ac_cv_c_tkh=${with_tkinclude} - else - AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) - fi - else - if test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use - # the framework's Headers directory. - case ${TK_DEFS} in - *TK_FRAMEWORK*) - list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tk is not installed, - # and in that situation, look there before installed locations. - if test -f "${TK_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tk's --prefix location, - # relative to directory of tkConfig.sh, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TK_PREFIX}/include 2>/dev/null` \ - `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - fi - for i in $list ; do - if test -f "$i/tk.h" ; then - ac_cv_c_tkh=$i - break - fi - done - fi - ]) - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tkh}" = x ; then - AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) - else - AC_MSG_RESULT([${ac_cv_c_tkh}]) - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` - - TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - AC_SUBST(TK_INCLUDES) - - if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ - -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - # On Windows and Aqua, we need the X compat headers - AC_MSG_CHECKING([for X11 header files]) - if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then - INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" - TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - AC_SUBST(TK_XINCLUDES) - fi - AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) - fi -]) - -#------------------------------------------------------------------------ -# TEA_PROG_TCLSH -# Determine the fully qualified path name of the tclsh executable -# in the Tcl build directory or the tclsh installed in a bin -# directory. This macro will correctly determine the name -# of the tclsh executable even if tclsh has not yet been -# built in the build directory. The tclsh found is always -# associated with a tclConfig.sh file. This tclsh should be used -# only for running extension test cases. It should never be -# or generation of files (like pkgIndex.tcl) at build time. -# -# Arguments -# none -# -# Results -# Subst's the following values: -# TCLSH_PROG -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PROG_TCLSH], [ - AC_MSG_CHECKING([for tclsh]) - if test -f "${TCL_BIN_DIR}/Makefile" ; then - # tclConfig.sh is in Tcl build directory - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="${TCL_BIN_DIR}/tclsh" - fi - else - # tclConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" - fi - list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${TCLSH_PROG}" ; then - REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" - fi - AC_MSG_RESULT([${TCLSH_PROG}]) - AC_SUBST(TCLSH_PROG) -]) - -#------------------------------------------------------------------------ -# TEA_PROG_WISH -# Determine the fully qualified path name of the wish executable -# in the Tk build directory or the wish installed in a bin -# directory. This macro will correctly determine the name -# of the wish executable even if wish has not yet been -# built in the build directory. The wish found is always -# associated with a tkConfig.sh file. This wish should be used -# only for running extension test cases. It should never be -# or generation of files (like pkgIndex.tcl) at build time. -# -# Arguments -# none -# -# Results -# Subst's the following values: -# WISH_PROG -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PROG_WISH], [ - AC_MSG_CHECKING([for wish]) - if test -f "${TK_BIN_DIR}/Makefile" ; then - # tkConfig.sh is in Tk build directory - if test "${TEA_PLATFORM}" = "windows"; then - WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" - else - WISH_PROG="${TK_BIN_DIR}/wish" - fi - else - # tkConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" - else - WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" - fi - list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TK_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${WISH_PROG}" ; then - REAL_TK_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" - fi - AC_MSG_RESULT([${WISH_PROG}]) - AC_SUBST(WISH_PROG) -]) - -#------------------------------------------------------------------------ -# TEA_PATH_CONFIG -- -# -# Locate the ${1}Config.sh file and perform a sanity check on -# the ${1} compile flags. These are used by packages like -# [incr Tk] that load *Config.sh files from more than Tcl and Tk. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-$1=... -# -# Defines the following vars: -# $1_BIN_DIR Full path to the directory containing -# the $1Config.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_CONFIG], [ - # - # Ok, lets find the $1 configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-$1 - # - - if test x"${no_$1}" = x ; then - # we reset no_$1 in case something fails here - no_$1=true - AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) - AC_MSG_CHECKING([for $1 configuration]) - AC_CACHE_VAL(ac_cv_c_$1config,[ - - # First check to see if --with-$1 was specified. - if test x"${with_$1config}" != x ; then - case ${with_$1config} in - */$1Config.sh ) - if test -f ${with_$1config}; then - AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) - with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` - fi;; - esac - if test -f "${with_$1config}/$1Config.sh" ; then - ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` - else - AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) - fi - fi - - # then check for a private $1 installation - if test x"${ac_cv_c_$1config}" = x ; then - for i in \ - ../$1 \ - `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ../../$1 \ - `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ../../../$1 \ - `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ${srcdir}/../$1 \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ; do - if test -f "$i/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i; pwd)` - break - fi - if test -f "$i/unix/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i/unix; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_$1config}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_$1config}" = x ; then - $1_BIN_DIR="# no $1 configs found" - AC_MSG_WARN([Cannot find $1 configuration definitions]) - exit 0 - else - no_$1= - $1_BIN_DIR=${ac_cv_c_$1config} - AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_CONFIG -- -# -# Load the $1Config.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# $1_BIN_DIR -# -# Results: -# -# Subst the following vars: -# $1_SRC_DIR -# $1_LIB_FILE -# $1_LIB_SPEC -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_CONFIG], [ - AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) - - if test -f "${$1_BIN_DIR}/$1Config.sh" ; then - AC_MSG_RESULT([loading]) - . "${$1_BIN_DIR}/$1Config.sh" - else - AC_MSG_RESULT([file not found]) - fi - - # - # If the $1_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable $1_LIB_SPEC will be set to the value - # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC - # instead of $1_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - # - - if test -f "${$1_BIN_DIR}/Makefile" ; then - AC_MSG_WARN([Found Makefile - using build library specs for $1]) - $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} - $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} - $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} - fi - - AC_SUBST($1_VERSION) - AC_SUBST($1_BIN_DIR) - AC_SUBST($1_SRC_DIR) - - AC_SUBST($1_LIB_FILE) - AC_SUBST($1_LIB_SPEC) - - AC_SUBST($1_STUB_LIB_FILE) - AC_SUBST($1_STUB_LIB_SPEC) - AC_SUBST($1_STUB_LIB_PATH) -]) - -#------------------------------------------------------------------------ -# TEA_PATH_CELIB -- -# -# Locate Keuchel's celib emulation layer for targeting Win/CE -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-celib=... -# -# Defines the following vars: -# CELIB_DIR Full path to the directory containing -# the include and platform lib files -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_CELIB], [ - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-celib - - if test x"${no_celib}" = x ; then - # we reset no_celib in case something fails here - no_celib=true - AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) - AC_MSG_CHECKING([for Windows/CE celib directory]) - AC_CACHE_VAL(ac_cv_c_celibconfig,[ - # First check to see if --with-celibconfig was specified. - if test x"${with_celibconfig}" != x ; then - if test -d "${with_celibconfig}/inc" ; then - ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` - else - AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) - fi - fi - - # then check for a celib library - if test x"${ac_cv_c_celibconfig}" = x ; then - for i in \ - ../celib-palm-3.0 \ - ../celib \ - ../../celib-palm-3.0 \ - ../../celib \ - `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ - ${srcdir}/../celib-palm-3.0 \ - ${srcdir}/../celib \ - `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ - ; do - if test -d "$i/inc" ; then - ac_cv_c_celibconfig=`(cd $i; pwd)` - break - fi - done - fi - ]) - if test x"${ac_cv_c_celibconfig}" = x ; then - AC_MSG_ERROR([Cannot find celib support library directory]) - else - no_celib= - CELIB_DIR=${ac_cv_c_celibconfig} - CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` - AC_MSG_RESULT([found $CELIB_DIR]) - fi - fi -]) - - -# Local Variables: -# mode: autoconf -# End: Index: xotcl/library/store/XOTclGdbm/xotcl.m4 =================================================================== diff -u -N --- xotcl/library/store/XOTclGdbm/xotcl.m4 (revision 9620bd8d134f2f6c30fc0d32c769c8a84c6c597b) +++ xotcl/library/store/XOTclGdbm/xotcl.m4 (revision 0) @@ -1,139 +0,0 @@ -# xotcl.m4 -- -# -# This file provides a set of autoconf macros to help TEA-enable -# a Tcl extension. -# -# Copyright (c) 1999 Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. - -#------------------------------------------------------------------------ -# SC_PATH_XOTCLCONFIG -- -# -# Locate the xotclConfig.sh file and perform a sanity check on -# the Tcl compile flags -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-xotcl=... -# -# Defines the following vars: -# XOTCL_BIN_DIR Full path to the directory containing -# the xotclConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN(SC_PATH_XOTCLCONFIG, [ - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - if test x"${no_xotcl}" = x ; then - # we reset no_xotcl in case something fails here - no_xotcl=true - AC_ARG_WITH(xotcl, [ --with-xotcl directory containing xotcl configuration (xotclConfig.sh)], with_xotclconfig=${withval}) - AC_MSG_CHECKING([for XOTcl configuration]) - AC_CACHE_VAL(ac_cv_c_xotclconfig,[ - - # First check to see if --with-xotcl was specified. - if test x"${with_xotclconfig}" != x ; then - if test -f "${with_xotclconfig}/xotclConfig.sh" ; then - ac_cv_c_xotclconfig=`(cd ${with_xotclconfig}; pwd)` - else - AC_MSG_ERROR([${with_xotclconfig} directory doesn't contain xotclConfig.sh]) - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_xotclconfig}" = x ; then - for i in \ - ${srcdir}/../xotcl \ - `ls -dr ${srcdir}/../xotcl-* 2>/dev/null` \ - ${srcdir}/../../xotcl \ - `ls -dr ${srcdir}/../../xotcl-* 2>/dev/null` \ - ${srcdir}/../../../xotcl \ - `ls -dr ${srcdir}/../../../xotcl-* 2>/dev/null` \ - ${srcdir}/../../../../xotcl \ - `ls -dr ${srcdir}/../../../../xotcl-* 2>/dev/null` \ - ${srcdir}/../../../../../xotcl \ - `ls -dr ${srcdir}/../../../../../xotcl-* 2>/dev/null` ; do - if test -f "$i/xotclConfig.sh" ; then - ac_cv_c_xotclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_xotclconfig}" = x ; then - for i in `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` ; do - if test -f "$i/xotclConfig.sh" ; then - ac_cv_c_xotclconfig=`(cd $i; pwd)` - break - fi - done - fi - - ]) - - if test x"${ac_cv_c_xotclconfig}" = x ; then - XOTCL_BIN_DIR="# no XOTcl configs found" - AC_MSG_WARN(Can't find XOTcl configuration definitions) - exit 0 - else - no_xotcl= - XOTCL_BIN_DIR=${ac_cv_c_xotclconfig} - AC_MSG_RESULT(found $XOTCL_BIN_DIR/xotclConfig.sh) - fi - fi -]) - -#------------------------------------------------------------------------ -# SC_LOAD_XOTCLCONFIG -- -# -# Load the tclConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# XOTCL_BIN_DIR -# -# Results: -# -# Subst the vars: -# -#------------------------------------------------------------------------ - -AC_DEFUN(SC_LOAD_XOTCLCONFIG, [ - AC_MSG_CHECKING([for existence of $XOTCL_BIN_DIR/xotclConfig.sh]) - - if test -f "$XOTCL_BIN_DIR/xotclConfig.sh" ; then - AC_MSG_RESULT([loading]) - . $XOTCL_BIN_DIR/xotclConfig.sh - else - AC_MSG_RESULT([file not found]) - fi - - # - # The eval is required to do the TCL_DBGX substitution in the - # TCL_LIB_FILE variable - # - AC_SUBST(XOTCL_VERSION) - AC_SUBST(XOTCL_MAJOR_VERSION) - AC_SUBST(XOTCL_MINOR_VERSION) - AC_SUBST(XOTCL_RELEASE_LEVEL) - AC_SUBST(XOTCL_LIB_FILE) - AC_SUBST(XOTCL_BUILD_LIB_SPEC) - AC_SUBST(XOTCL_LIB_SPEC) - AC_SUBST(XOTCL_STUB_LIB_FILE) - AC_SUBST(XOTCL_BUILD_STUB_LIB_SPEC) - AC_SUBST(XOTCL_STUB_LIB_SPEC) - AC_SUBST(XOTCL_SRC_DIR) -]) - Index: xotcl/library/store/XOTclGdbm/xotclgdbm.c =================================================================== diff -u -N --- xotcl/library/store/XOTclGdbm/xotclgdbm.c (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/store/XOTclGdbm/xotclgdbm.c (revision 0) @@ -1,369 +0,0 @@ -/* - * xotclgdbm.c - * - * based on Tclndbm 0.5 by John Ellson (ellson@lucent.com) - */ - -#include -#include -#include -#include -#include -#include - -#if (TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<1) -# define TclObjStr(obj) Tcl_GetStringFromObj(obj, ((int*)NULL)) -#else -# define TclObjStr(obj) Tcl_GetString(obj) -#endif - -typedef struct db_s { - datum* lastSearchKey; - GDBM_FILE db; -} db_t; - -void -gdbmFatalFunc(char* message) { - fprintf(stderr, "GDBM FATAL:\n%s\n", message); - exit(1); -} - -static int -XOTclGdbmOpenMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - db_t *db; - XOTcl_Object* obj = (XOTcl_Object*) cd; - int flags, block_size, mode; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 2) - return XOTclObjErrArgCnt(in, obj->cmdName, "open filename"); - - /* name not in hashtab - create new db */ - if (XOTclGetObjClientData(obj)) - return XOTclVarErrMsg(in, "Called open on '", TclObjStr(obj->cmdName), - "', but open database was not closed before.", 0); - - db = (db_t*) ckalloc (sizeof(db_t)); - db->lastSearchKey = NULL; - - flags = GDBM_WRCREAT; - block_size = 0; - mode = 0644; - - db->db = gdbm_open(TclObjStr(objv[1]), block_size, flags, mode, gdbmFatalFunc); - - if (db->db == NULL) { - ckfree ((char*) db); - db = (db_t*) NULL ; - return XOTclVarErrMsg(in, "Open on '", TclObjStr(obj->cmdName), - "' failed with '", TclObjStr(objv[1]),"': ", - gdbm_strerror(gdbm_errno), 0); - } - /* - * success - */ - XOTclSetObjClientData(obj, (ClientData) db); - return TCL_OK; -} - -static int -XOTclGdbmCloseMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - db_t *db; - XOTcl_Object* obj = (XOTcl_Object *) cd; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 1) - return XOTclObjErrArgCnt(in, obj->cmdName, "close"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called close on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - gdbm_close(db->db); - ckfree ((char*)db); - XOTclSetObjClientData(obj, 0); - - return TCL_OK; -} - -static int -XOTclGdbmNamesMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - XOTcl_Object* obj = (XOTcl_Object *) cd; - Tcl_Obj *list; - db_t *db; - Tcl_DString result; - datum del, key; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 1) - return XOTclObjErrArgCnt(in, obj->cmdName, "names"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called names on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - Tcl_DStringInit(&result); - - key = gdbm_firstkey(db->db); - if (!key.dptr) { - /* empty db */ - return TCL_OK ; - } - - /* - * copy key to result and go to next key - */ - list = Tcl_NewListObj(0, NULL); - do { - Tcl_ListObjAppendElement(in,list,Tcl_NewStringObj(key.dptr,key.dsize-1)); - del.dptr = key.dptr; - key = gdbm_nextkey(db->db, key); - free(del.dptr); - } while (key.dptr); - Tcl_SetObjResult(in, list); - - return TCL_OK; -} - -static int -XOTclGdbmSetMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - XOTcl_Object* obj = (XOTcl_Object *)cd; - db_t *db; - datum key, content; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc <2 || objc > 3) - return XOTclObjErrArgCnt(in, obj->cmdName, "set key ?value?"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called set on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - - key.dptr = TclObjStr(objv[1]); - key.dsize = objv[1]->length + 1; - - if (objc == 2) { - /* get value */ - content = gdbm_fetch(db->db, key); - if (content.dptr) { - /* found */ - Tcl_Obj *r = Tcl_NewStringObj(content.dptr, content.dsize-1); - Tcl_SetObjResult(in, r); - free(content.dptr); - } else { - /* key not found */ - return XOTclVarErrMsg(in, "no such variable '", key.dptr, - "'", 0); - } - } else { - /* set value */ - content.dptr = TclObjStr(objv[2]); - content.dsize = objv[2]->length + 1; - if (gdbm_store(db->db, key, content, GDBM_REPLACE) == 0) { - /*fprintf(stderr,"setting %s to '%s'\n",key.dptr,content.dptr);*/ - Tcl_SetObjResult(in, objv[2]); - } else { - return XOTclVarErrMsg(in, "set of variable '", TclObjStr(obj->cmdName), - "' failed.", 0); - } - } - return TCL_OK; -} - -static int -XOTclGdbmExistsMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - XOTcl_Object* obj = (XOTcl_Object *) cd; - db_t *db; - datum key; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 2) - return XOTclObjErrArgCnt(in, obj->cmdName, "exists variable"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called exists on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - - key.dptr = TclObjStr(objv[1]); - key.dsize = objv[1]->length + 1; - - if (gdbm_exists(db->db, key)) - Tcl_SetIntObj(Tcl_GetObjResult(in), 1); - else - Tcl_SetIntObj(Tcl_GetObjResult(in), 0); - - return TCL_OK; -} - -static int -XOTclGdbmUnsetMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - XOTcl_Object* obj = (XOTcl_Object *) cd; - db_t *db; - datum key; - int ret; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 2) - return XOTclObjErrArgCnt(in, obj->cmdName, "unset key"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - - key.dptr = TclObjStr(objv[1]); - key.dsize = objv[1]->length + 1; - - ret = gdbm_delete(db->db, key); - - if (ret == 0) { - return TCL_OK; - } else { - return XOTclVarErrMsg(in, "Tried to unset '", TclObjStr(objv[1]), - "' but key does not exist.", 0); - } -} - -static int -XOTclGdbmFirstKeyMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - XOTcl_Object* obj = (XOTcl_Object *) cd; - db_t *db; - datum key; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 1) - return XOTclObjErrArgCnt(in, obj->cmdName, "firstkey"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - - if (db->lastSearchKey != 0) { - ckfree((char*) db->lastSearchKey->dptr); - ckfree((char*) db->lastSearchKey); - db->lastSearchKey = 0; - } - - key = gdbm_firstkey(db->db); - if (!key.dptr) { - /* - * empty db - */ - return TCL_OK; - } - - Tcl_AppendResult (in, key.dptr, (char*)0); - - db->lastSearchKey = (datum*) ckalloc(sizeof(datum)); - db->lastSearchKey->dptr = key.dptr; - db->lastSearchKey->dsize = key.dsize; - - return TCL_OK; -} - -static int -XOTclGdbmNextKeyMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - XOTcl_Object* obj = (XOTcl_Object *) cd; - db_t *db; - datum newkey; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 1) - return XOTclObjErrArgCnt(in, obj->cmdName, "nextkey"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - if (db->lastSearchKey == 0) - return XOTclVarErrMsg(in, - "nextkey invoked, but no search was started on '", - TclObjStr(obj->cmdName), "'", 0); - - newkey = gdbm_nextkey(db->db, *db->lastSearchKey); - - if (!newkey.dptr) { - /* - * end of search - */ - if (db->lastSearchKey != 0) { - free((char*) db->lastSearchKey->dptr); - ckfree((char*) db->lastSearchKey); - db->lastSearchKey = 0; - } - return TCL_OK ; - } - - Tcl_AppendResult (in, newkey.dptr, (char*)0); - if (db->lastSearchKey != 0) { - free((char*) db->lastSearchKey->dptr); - } - db->lastSearchKey->dptr = newkey.dptr; - db->lastSearchKey->dsize = newkey.dsize; - return TCL_OK; -} - - -/* - * Xotclgdbm_Init - * register commands, init data structures - */ - -extern int -Xotclgdbm_Init(Tcl_Interp * in) { - XOTcl_Class* cl; - int result; - -#ifdef USE_TCL_STUBS - if (Tcl_InitStubs(in, TCL_VERSION, 0) == NULL) { - return TCL_ERROR; - } -# ifdef USE_XOTCL_STUBS - if (Xotcl_InitStubs(in, "1.1", 0) == NULL) { - return TCL_ERROR; - } -# endif -#else - if (Tcl_PkgRequire(in, "Tcl", TCL_VERSION, 0) == NULL) { - return TCL_ERROR; - } -#endif - Tcl_PkgProvide(in, "xotcl::store::gdbm", PACKAGE_VERSION); - -#ifdef PACKAGE_REQUIRE_XOTL_FROM_SLAVE_INTERP_WORKS_NOW - if (Tcl_PkgRequire(in, "XOTcl", XOTCLVERSION, 0) == NULL) { - return TCL_ERROR; - } -#endif - if (Tcl_PkgRequire(in, "xotcl::store", 0, 0) == NULL) { - return TCL_ERROR; - } - result = Tcl_VarEval (in, - "::xotcl::Class Storage=Gdbm -superclass Storage", - (char *) NULL); - if (result != TCL_OK) - return result; - - cl = XOTclGetClass(in, "Storage=Gdbm"); - XOTclAddIMethod(in, cl, "open", XOTclGdbmOpenMethod, 0, 0); - XOTclAddIMethod(in, cl, "close", XOTclGdbmCloseMethod, 0, 0); - XOTclAddIMethod(in, cl, "set", XOTclGdbmSetMethod, 0, 0); - XOTclAddIMethod(in, cl, "exists", XOTclGdbmExistsMethod, 0, 0); - XOTclAddIMethod(in, cl, "names", XOTclGdbmNamesMethod, 0, 0); - XOTclAddIMethod(in, cl, "unset", XOTclGdbmUnsetMethod, 0, 0); - XOTclAddIMethod(in, cl, "firstkey", XOTclGdbmFirstKeyMethod, 0, 0); - XOTclAddIMethod(in, cl, "nextkey", XOTclGdbmNextKeyMethod, 0, 0); - - Tcl_SetIntObj(Tcl_GetObjResult(in), 1); - return TCL_OK; -} - -extern int -Xotclgdbm_SafeInit(interp) - Tcl_Interp *interp; -{ - return Xotclgdbm_Init(interp); -} Index: xotcl/library/store/XOTclSdbm/Makefile =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/Makefile (revision fce8f28780c2c91fc8320c5a480eb2b6031b3b5b) +++ xotcl/library/store/XOTclSdbm/Makefile (revision 0) @@ -1,433 +0,0 @@ -# Makefile.in -- -# -# This file is a Makefile for Sample TEA Extension. If it has the name -# "Makefile.in" then it is a template for a Makefile; to generate the -# actual Makefile, run "./configure", which is a configuration script -# generated by the "autoconf" program (constructs like "@foo@" will get -# replaced in the actual Makefile. -# -# Copyright (c) 1999 Scriptics Corporation. -# Copyright (c) 2002-2003 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,v 1.30 2007/09/13 15:21:54 neumann 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. -#======================================================================== - -#======================================================================== -# The names of the source files is defined in the configure script. -# The object files are used for linking into the final library. -# 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 = hash.c pair.c sdbm.c xotclsdbm.c -PKG_OBJECTS = hash.o pair.o sdbm.o xotclsdbm.o - -PKG_STUB_SOURCES = -PKG_STUB_OBJECTS = - -#======================================================================== -# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with -# this package that need to be installed, if any. -#======================================================================== - -PKG_TCL_SOURCES = - -#======================================================================== -# This is a list of public header files to be installed, if any. -#======================================================================== - -PKG_HEADERS = - -#======================================================================== -# "PKG_LIB_FILE" refers to the library (dynamic or static as per -# configuration options) composed of the named objects. -#======================================================================== - -PKG_LIB_FILE = libxotclsdbm1.2.dylib -PKG_STUB_LIB_FILE = libxotclsdbmstub1.2.a - -lib_BINARIES = $(PKG_LIB_FILE) -BINARIES = $(lib_BINARIES) - -SHELL = /bin/sh - -srcdir = . -prefix = /usr/local/aolserver-4.5 -exec_prefix = /usr/local/aolserver-4.5 - -bindir = ${exec_prefix}/bin -libdir = ${exec_prefix}/lib -datadir = ${prefix}/share -mandir = ${prefix}/man -includedir = ${prefix}/include - -DESTDIR = - -PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) -pkgdatadir = $(datadir)/$(PKG_DIR) -pkglibdir = $(libdir)/$(PKG_DIR) -pkgincludedir = $(includedir)/$(PKG_DIR) - -top_builddir = . - -INSTALL = /usr/bin/install -c -INSTALL_PROGRAM = ${INSTALL} -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_SCRIPT = ${INSTALL} - -PACKAGE_NAME = xotclsdbm -PACKAGE_VERSION = 1.2 -CC = gcc -CFLAGS_DEFAULT = -Os -CFLAGS_WARNING = -Wall -Wno-implicit-int -CLEANFILES = pkgIndex.tcl -EXEEXT = -LDFLAGS_DEFAULT = -prebind -headerpad_max_install_names -Wl,-search_paths_first -MAKE_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} -MAKE_SHARED_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} -MAKE_STATIC_LIB = ${STLIB_LD} $@ $(PKG_OBJECTS) -MAKE_STUB_LIB = ${STLIB_LD} $@ $(PKG_STUB_OBJECTS) -OBJEXT = o -RANLIB = : -RANLIB_STUB = ranlib -SHLIB_CFLAGS = -fno-common -SHLIB_LD = ${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT} -Wl,-single_module -SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@ -SHLIB_LD_LIBS = ${LIBS} -L/usr/local/aolserver-4.5/lib -ltclstub8.4 -STLIB_LD = ${AR} cr -TCL_DEFS = -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DHAVE_COREFOUNDATION=1 -DMAC_OSX_TCL=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_MTSAFE_GETHOSTBYNAME=1 -DHAVE_MTSAFE_GETHOSTBYADDR=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_COPYFILE=1 -DHAVE_LIBKERN_OSATOMIC_H=1 -DHAVE_OSSPINLOCKLOCK=1 -DHAVE_PTHREAD_ATFORK=1 -DUSE_VFORK=1 -DTCL_DEFAULT_ENCODING=\"utf-8\" -DTCL_LOAD_FROM_MEMORY=1 -DHAVE_AVAILABILITYMACROS_H=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -TCL_BIN_DIR = /usr/local/aolserver-4.5/lib -TCL_SRC_DIR = /usr/local/src/tcl8.4.14 -# This is necessary for packages that use private Tcl headers -#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ -# Not used, but retained for reference of what libs Tcl required -TCL_LIBS = ${DL_LIBS} ${LIBS} ${MATH_LIBS} - -#======================================================================== -# 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). -#======================================================================== - -EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) -TCLSH_ENV = TCL_LIBRARY=`echo $(TCL_SRC_DIR)/library` \ - DYLD_LIBRARY_PATH="$(EXTRA_PATH):$(DYLD_LIBRARY_PATH)" \ - PATH="$(EXTRA_PATH):$(PATH)" \ - TCLLIBPATH="$(top_builddir)" -TCLSH_PROG = /usr/local/aolserver-4.5/bin/tclsh8.4 -TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) -SHARED_BUILD = 1 - -INCLUDES = -I/Users/neumann/src/xotcl-1.5.5/generic -I./generic -I"/usr/local/aolserver-4.5/include" - -EXTRA_CFLAGS = - -# TCL_DEFS is not strictly need here, but if you remove it, then you -# must make sure that configure.in 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) -DPACKAGE_NAME=\"xotclsdbm\" -DPACKAGE_TARNAME=\"xotclsdbm\" -DPACKAGE_VERSION=\"1.2\" -DPACKAGE_STRING=\"xotclsdbm\ 1.2\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 $(EXTRA_CFLAGS) -DEFS = -DPACKAGE_NAME=\"xotclsdbm\" -DPACKAGE_TARNAME=\"xotclsdbm\" -DPACKAGE_VERSION=\"1.2\" -DPACKAGE_STRING=\"xotclsdbm\ 1.2\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 $(EXTRA_CFLAGS) - -CONFIG_CLEAN_FILES = Makefile - -CPPFLAGS = -LIBS = -L/Users/neumann/src/xotcl-1.5.5 -lxotclstub1.5.5 -L/Users/neumann/src/xotcl-1.5.5 -lxotcl1.5.5 -AR = ar -CFLAGS = -pipe ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - -#======================================================================== -# Start of user-definable TARGETS section -#======================================================================== - -#======================================================================== -# TEA TARGETS. Please note that the "libraries:" target refers to platform -# independent files, and the "binaries:" target inclues executable programs and -# platform-dependent libraries. Modify these targets so that they install -# the various pieces of your package. The make and install rules -# for the BINARIES that you specified above have already been done. -#======================================================================== - -all: binaries libraries doc - -#======================================================================== -# The binaries target builds executable programs, Windows .dll's, unix -# shared/static libraries, and any other platform-dependent files. -# The list of targets to build for "binaries:" is specified at the top -# of the Makefile, in the "BINARIES" variable. -#======================================================================== - -binaries: $(BINARIES) pkgIndex.tcl - -libraries: - -doc: - @echo "If you have documentation to create, place the commands to" - @echo "build the docs in the 'doc:' target. For example:" - @echo " xml2nroff sample.xml > sample.n" - @echo " xml2html sample.xml > sample.html" - -install: all install-binaries install-libraries install-doc - -install-binaries: binaries install-lib-binaries install-bin-binaries - if test "x$(SHARED_BUILD)" = "x1"; then \ - $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ - fi - -#======================================================================== -# This rule installs platform-independent files, such as header files. -#======================================================================== - -install-libraries: libraries - @mkdir -p $(DESTDIR)$(includedir) - @echo "Installing header files in $(DESTDIR)$(includedir)" - @if test -n "$(PKG_HEADERS)" ; then \ - for i in "$(PKG_HEADERS)" ; do \ - echo "Installing $(srcdir)/$$i" ; \ - $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ - done; \ - fi - -#======================================================================== -# Install documentation. Unix manpages should go in the $(mandir) -# directory. -#======================================================================== - -install-doc: doc -#install-doc: doc -# @mkdir -p $(DESTDIR)$(mandir)/mann -# @echo "Installing documentation in $(DESTDIR)$(mandir)" -# @for i in $(srcdir)/doc/*.n; do \ -# echo "Installing $$i"; \ -# rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ -# $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ -# done - -test: binaries libraries - $(TCLSH) `echo $(srcdir)/tests/all.tcl` $(TESTFLAGS) - -shell: binaries libraries - @$(TCLSH) $(SCRIPT) - -gdb: - $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) - -depend: - -#======================================================================== -# $(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". -# -# 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. -#======================================================================== - -$(PKG_LIB_FILE): $(PKG_OBJECTS) - -rm -f $(PKG_LIB_FILE) - ${MAKE_LIB} - $(RANLIB) $(PKG_LIB_FILE) - -$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) - -rm -f $(PKG_STUB_LIB_FILE) - ${MAKE_STUB_LIB} - $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# -# 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 `echo $(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:.... -#======================================================================== - -VPATH = $(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win - -.c.o: - $(COMPILE) -c `echo $<` -o $@ - -#======================================================================== -# Create the pkgIndex.tcl file. -# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but -# you may find that you need to customize the package. If so, either -# modify the -hand version, or create a pkgIndex.tcl.in file and have -# the configure script output the pkgIndex.tcl by editing configure.in. -#======================================================================== - -#pkgIndex.tcl: -# ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) - -pkgIndex.tcl: - (echo 'package ifneeded xotcl::store::sdbm $(PACKAGE_VERSION) \ - [list load [file join $$dir $(PKG_LIB_FILE)]]'\ - ) > pkgIndex.tcl - -#======================================================================== -# Distribution creation -# You may need to tweak this target to make it work correctly. -#======================================================================== - -#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar -COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) -DIST_ROOT = /tmp/dist -DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) - -dist-clean: - rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* - -dist: dist-clean - mkdir -p $(DIST_DIR) - cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ - $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ - $(DIST_DIR)/ - chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 - chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in - - cp -p $(srcdir)/*.[ch] $(DIST_DIR)/ - - mkdir $(DIST_DIR)/tclconfig - cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ - $(DIST_DIR)/tclconfig/ - chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 - chmod +x $(DIST_DIR)/tclconfig/install-sh - - list='demos doc generic library mac tests unix win'; \ - for p in $$list; do \ - if test -d $(srcdir)/$$p ; then \ - mkdir $(DIST_DIR)/$$p; \ - cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ - fi; \ - done - - (cd $(DIST_ROOT); $(COMPRESS);) - -#======================================================================== -# End of user-definable section -#======================================================================== - -#======================================================================== -# Don't modify the file to clean here. Instead, set the "CLEANFILES" -# variable in configure.in -#======================================================================== - -clean: - -test -z "$(BINARIES)" || rm -f $(BINARIES) - -rm -f *.$(OBJEXT) core *.core - -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 - -#======================================================================== -# 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) -# -# You should not have to modify this target. -#======================================================================== - -install-lib-binaries: - @mkdir -p $(DESTDIR)$(pkglibdir) - @list='$(lib_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ - stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ - if test "x$$stub" = "xstub"; then \ - echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ - else \ - echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ - fi; \ - ext=`echo $$p|sed -e "s/.*\.//"`; \ - if test "x$$ext" = "xdll"; then \ - 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; \ - fi; \ - fi; \ - 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; \ - done - -#======================================================================== -# 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. -# -# You should not have to modify this target, except to define bin_BINARIES -# above if necessary. -#======================================================================== - -install-bin-binaries: - @mkdir -p $(DESTDIR)$(bindir) - @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; \ - done - -.SUFFIXES: .c .$(OBJEXT) - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -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; \ - done - -.PHONY: all binaries clean depend distclean doc install libraries test - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Index: xotcl/library/store/XOTclSdbm/Makefile.in =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/Makefile.in (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/library/store/XOTclSdbm/Makefile.in (revision 0) @@ -1,433 +0,0 @@ -# Makefile.in -- -# -# This file is a Makefile for Sample TEA Extension. If it has the name -# "Makefile.in" then it is a template for a Makefile; to generate the -# actual Makefile, run "./configure", which is a configuration script -# generated by the "autoconf" program (constructs like "@foo@" will get -# replaced in the actual Makefile. -# -# Copyright (c) 1999 Scriptics Corporation. -# Copyright (c) 2002-2003 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.5 2007/08/14 16:38:26 neumann 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. -#======================================================================== - -#======================================================================== -# The names of the source files is defined in the configure script. -# The object files are used for linking into the final library. -# 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@ - -PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ -PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ - -#======================================================================== -# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with -# this package that need to be installed, if any. -#======================================================================== - -PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ - -#======================================================================== -# This is a list of public header files to be installed, if any. -#======================================================================== - -PKG_HEADERS = @PKG_HEADERS@ - -#======================================================================== -# "PKG_LIB_FILE" refers to the library (dynamic or static as per -# configuration options) composed of the named objects. -#======================================================================== - -PKG_LIB_FILE = @PKG_LIB_FILE@ -PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ - -lib_BINARIES = $(PKG_LIB_FILE) -BINARIES = $(lib_BINARIES) - -SHELL = @SHELL@ - -srcdir = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -libdir = @libdir@ -datadir = @datadir@ -mandir = @mandir@ -includedir = @includedir@ - -DESTDIR = - -PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) -pkgdatadir = $(datadir)/$(PKG_DIR) -pkglibdir = $(libdir)/$(PKG_DIR) -pkgincludedir = $(includedir)/$(PKG_DIR) - -top_builddir = . - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ - -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -CC = @CC@ -CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ -CFLAGS_WARNING = @CFLAGS_WARNING@ -CLEANFILES = @CLEANFILES@ -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_FLAGS = @SHLIB_LD_FLAGS@ -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@ -# This is necessary for packages that use private Tcl headers -#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ -# Not used, but retained for reference of what libs Tcl required -TCL_LIBS = @TCL_LIBS@ - -#======================================================================== -# 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). -#======================================================================== - -EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) -TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ - @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ - PATH="$(EXTRA_PATH):$(PATH)" \ - TCLLIBPATH="$(top_builddir)" -TCLSH_PROG = @TCLSH_PROG@ -TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) -SHARED_BUILD = @SHARED_BUILD@ - -INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ - -EXTRA_CFLAGS = @PKG_CFLAGS@ - -# TCL_DEFS is not strictly need here, but if you remove it, then you -# must make sure that configure.in 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@ $(EXTRA_CFLAGS) -DEFS = @DEFS@ $(EXTRA_CFLAGS) - -CONFIG_CLEAN_FILES = Makefile - -CPPFLAGS = @CPPFLAGS@ -LIBS = @PKG_LIBS@ @LIBS@ -AR = ar -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - -#======================================================================== -# Start of user-definable TARGETS section -#======================================================================== - -#======================================================================== -# TEA TARGETS. Please note that the "libraries:" target refers to platform -# independent files, and the "binaries:" target inclues executable programs and -# platform-dependent libraries. Modify these targets so that they install -# the various pieces of your package. The make and install rules -# for the BINARIES that you specified above have already been done. -#======================================================================== - -all: binaries libraries doc - -#======================================================================== -# The binaries target builds executable programs, Windows .dll's, unix -# shared/static libraries, and any other platform-dependent files. -# The list of targets to build for "binaries:" is specified at the top -# of the Makefile, in the "BINARIES" variable. -#======================================================================== - -binaries: $(BINARIES) pkgIndex.tcl - -libraries: - -doc: - @echo "If you have documentation to create, place the commands to" - @echo "build the docs in the 'doc:' target. For example:" - @echo " xml2nroff sample.xml > sample.n" - @echo " xml2html sample.xml > sample.html" - -install: all install-binaries install-libraries install-doc - -install-binaries: binaries install-lib-binaries install-bin-binaries - if test "x$(SHARED_BUILD)" = "x1"; then \ - $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ - fi - -#======================================================================== -# This rule installs platform-independent files, such as header files. -#======================================================================== - -install-libraries: libraries - @mkdir -p $(DESTDIR)$(includedir) - @echo "Installing header files in $(DESTDIR)$(includedir)" - @if test -n "$(PKG_HEADERS)" ; then \ - for i in "$(PKG_HEADERS)" ; do \ - echo "Installing $(srcdir)/$$i" ; \ - $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ - done; \ - fi - -#======================================================================== -# Install documentation. Unix manpages should go in the $(mandir) -# directory. -#======================================================================== - -install-doc: doc -#install-doc: doc -# @mkdir -p $(DESTDIR)$(mandir)/mann -# @echo "Installing documentation in $(DESTDIR)$(mandir)" -# @for i in $(srcdir)/doc/*.n; do \ -# echo "Installing $$i"; \ -# rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ -# $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ -# done - -test: binaries libraries - $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) - -shell: binaries libraries - @$(TCLSH) $(SCRIPT) - -gdb: - $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) - -depend: - -#======================================================================== -# $(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". -# -# 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. -#======================================================================== - -$(PKG_LIB_FILE): $(PKG_OBJECTS) - -rm -f $(PKG_LIB_FILE) - ${MAKE_LIB} - $(RANLIB) $(PKG_LIB_FILE) - -$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) - -rm -f $(PKG_STUB_LIB_FILE) - ${MAKE_STUB_LIB} - $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# -# 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:.... -#======================================================================== - -VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win - -.c.@OBJEXT@: - $(COMPILE) -c `@CYGPATH@ $<` -o $@ - -#======================================================================== -# Create the pkgIndex.tcl file. -# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but -# you may find that you need to customize the package. If so, either -# modify the -hand version, or create a pkgIndex.tcl.in file and have -# the configure script output the pkgIndex.tcl by editing configure.in. -#======================================================================== - -#pkgIndex.tcl: -# ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) - -pkgIndex.tcl: - (echo 'package ifneeded xotcl::store::sdbm $(PACKAGE_VERSION) \ - [list load [file join $$dir $(PKG_LIB_FILE)]]'\ - ) > pkgIndex.tcl - -#======================================================================== -# Distribution creation -# You may need to tweak this target to make it work correctly. -#======================================================================== - -#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar -COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) -DIST_ROOT = /tmp/dist -DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) - -dist-clean: - rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* - -dist: dist-clean - mkdir -p $(DIST_DIR) - cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ - $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ - $(DIST_DIR)/ - chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 - chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in - - cp -p $(srcdir)/*.[ch] $(DIST_DIR)/ - - mkdir $(DIST_DIR)/tclconfig - cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ - $(DIST_DIR)/tclconfig/ - chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 - chmod +x $(DIST_DIR)/tclconfig/install-sh - - list='demos doc generic library mac tests unix win'; \ - for p in $$list; do \ - if test -d $(srcdir)/$$p ; then \ - mkdir $(DIST_DIR)/$$p; \ - cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ - fi; \ - done - - (cd $(DIST_ROOT); $(COMPRESS);) - -#======================================================================== -# End of user-definable section -#======================================================================== - -#======================================================================== -# Don't modify the file to clean here. Instead, set the "CLEANFILES" -# variable in configure.in -#======================================================================== - -clean: - -test -z "$(BINARIES)" || rm -f $(BINARIES) - -rm -f *.$(OBJEXT) core *.core - -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 - -#======================================================================== -# 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) -# -# You should not have to modify this target. -#======================================================================== - -install-lib-binaries: - @mkdir -p $(DESTDIR)$(pkglibdir) - @list='$(lib_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ - stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ - if test "x$$stub" = "xstub"; then \ - echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ - else \ - echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ - fi; \ - ext=`echo $$p|sed -e "s/.*\.//"`; \ - if test "x$$ext" = "xdll"; then \ - 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; \ - fi; \ - fi; \ - 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; \ - done - -#======================================================================== -# 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. -# -# You should not have to modify this target, except to define bin_BINARIES -# above if necessary. -#======================================================================== - -install-bin-binaries: - @mkdir -p $(DESTDIR)$(bindir) - @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; \ - done - -.SUFFIXES: .c .$(OBJEXT) - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -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; \ - done - -.PHONY: all binaries clean depend distclean doc install libraries test - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Index: xotcl/library/store/XOTclSdbm/Makefile.in-ok =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/Makefile.in-ok (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/XOTclSdbm/Makefile.in-ok (revision 0) @@ -1,389 +0,0 @@ -# Makefile.in -- -# -# This file is a Makefile for Sample TEA Extension. If it has the name -# "Makefile.in" then it is a template for a Makefile; to generate the -# actual Makefile, run "./configure", which is a configuration script -# generated by the "autoconf" program (constructs like "@foo@" will get -# replaced in the actual Makefile. -# -# Copyright (c) 1999 Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: Makefile.in-ok,v 1.1 2004/05/23 22:50:39 neumann Exp $ - -#======================================================================== -# Edit the following few lines when writing a new extension -#======================================================================== - -configdir=$(srcdir)/../../../config - -#======================================================================== -# 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= -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. -#======================================================================== - -xotclsdbm_SOURCES = \ - $(srcdir)/hash.c \ - $(srcdir)/pair.c \ - $(srcdir)/sdbm.c \ - $(srcdir)/xotclsdbm.c -SOURCES = $(xotclsdbm_SOURCES) - -#======================================================================== -# Enumerate the names of the object files included in this package. -# These objects are created and linked into the final library. In -# most cases these object files will correspond to the source files -# above. -# -#======================================================================== - -xotclsdbm_OBJECTS = \ - ./hash.$(OBJEXT) \ - ./pair.$(OBJEXT) \ - ./sdbm.$(OBJEXT) \ - ./xotclsdbm.$(OBJEXT) -OBJECTS = $(xotclsdbm_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. -#======================================================================== - -xotclsdbm_LIB_FILE = @xotclsdbm_LIB_FILE@ -$(xotclsdbm_LIB_FILE)_OBJECTS = $(xotclsdbm_OBJECTS) - -#======================================================================== -# This is a list of header files to be installed -#======================================================================== - -#GENERIC_HDRS= pair.h sdbm.h tune.h -GENERIC_HDRS= - -#======================================================================== -# Add additional lines to handle any additional AC_SUBST cases that -# have been added to the configure script. -#======================================================================== - -SAMPLE_NEW_VAR=@SAMPLE_NEW_VAR@ - -#======================================================================== -# Nothing of the variables below this line need to be changed. Please -# check the TARGETS section below to make sure the make targets are -# correct. -#======================================================================== - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_FLAG = -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : - -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ -CC = @CC@ -CFLAGS_DEBUG = @CFLAGS_DEBUG@ -CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ -CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ -CLEANFILES = @CLEANFILES@ -EXEEXT = @EXEEXT@ -LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ -LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ -LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ -MAKE_LIB = @MAKE_LIB@ -MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ -MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ -OBJEXT = @OBJEXT@ -RANLIB = @RANLIB@ -SHLIB_CFLAGS = @SHLIB_CFLAGS@ -SHLIB_LD = @SHLIB_LD@ -SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ -SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ -STLIB_LD = @STLIB_LD@ -TCL_BIN_DIR = @TCL_BIN_DIR@ -TCL_DEFS = @TCL_DEFS@ -TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ -TCL_LD_FLAGS = @TCL_LD_FLAGS@ -TCL_LIBS = @TCL_LIBS@ -TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ -TCL_SRC_DIR = @TCL_SRC_DIR@ -TCL_DBGX = @TCL_DBGX@ -TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ -TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ -TCL_TOOL_DIR_NATIVE = @TCL_TOOL_DIR_NATIVE@ -TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ -TCL_UNIX_DIR_NATIVE = @TCL_UNIX_DIR_NATIVE@ -TCL_WIN_DIR_NATIVE = @TCL_WIN_DIR_NATIVE@ -INCLUDE_DIR_NATIVE = @INCLUDE_DIR_NATIVE@ -TCL_BMAP_DIR_NATIVE = @TCL_BMAP_DIR_NATIVE@ -TCL_PLATFORM_DIR_NATIVE = @TCL_PLATFORM_DIR_NATIVE@ -TCL_GENERIC_DIR_NATIVE = @TCL_GENERIC_DIR_NATIVE@ -TCLSH_PROG = @TCLSH_PROG@ - -AUTOCONF = autoconf - -LDFLAGS = $(LDFLAGS_DEFAULT) - -INCLUDES = @TCL_INCLUDES@ - -EXTRA_CFLAGS = $(TCL_DEFS) $(PROTO_FLAGS) $(SECURITY_FLAGS) $(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) $(NO_DEPRECATED_FLAGS) - -DEFS = @DEFS@ $(EXTRA_CFLAGS) - -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(configdir)/mkinstalldirs -CONFIG_CLEAN_FILES = $(configdir)/mkIndex.tcl - -CPPFLAGS = @CPPFLAGS@ -LIBS = @LIBS@ -AR = ar -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -I@XOTCL_SRC_DIR@/generic -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ - -#======================================================================== -# Start of user-definable TARGETS section -#======================================================================== - -#======================================================================== -# TEA TARGETS. Please note that the "libraries:" target refers to platform -# independent files, and the "binaries:" target inclues executable programs and -# platform-dependent libraries. Modify these targets so that they install -# the various pieces of your package. The make and install rules -# for the BINARIES that you specified above have already been done. -#======================================================================== - -all: binaries libraries doc - -#======================================================================== -# The binaries target builds executable programs, Windows .dll's, unix -# shared/static libraries, and any other platform-dependent files. -# The list of targets to build for "binaries:" is specified at the top -# of the Makefile, in the "BINARIES" variable. -#======================================================================== - -binaries: - -libraries: $(srcdir)/../$(xotclsdbm_LIB_FILE) - -doc: - -install: all install-binaries install-libraries install-doc - -install-binaries: binaries install-lib-binaries install-bin-binaries - -#======================================================================== -# This rule installs platform-independent files, such as header files. -#======================================================================== - -install-libraries: libraries $(DESTDIR)$(includedir) - @if test ! -z $(GENERIC_HDRS) ; then \ - echo "Installing header files in $(DESTDIR)$(includedir)" ; \ - fi - @for i in $(GENERIC_HDRS) ; do \ - echo "Installing $$i" ; \ - $(INSTALL_DATA) $$i $(DESTDIR)$(includedir) ; \ - done; - -#======================================================================== -# Install documentation. Unix manpages should go in the $(mandir) -# directory. -#======================================================================== - -install-doc: - -test: - -depend: - -#======================================================================== -# Enumerate the names of the object files included in this package. -# These objects are created and linked into the final library. In -# most cases these object files will correspond to the source files -# above. -# -# $(exampleA_LIB_FILE) should be listed as part of the BINARIES variable -# at the top of the Makefile. That will ensure that this target is built -# when you run "make binaries". -# -# You shouldn't need to modify this target, except to change the package -# name from "exampleA" to your package's name. -#======================================================================== - -$(xotclsdbm_LIB_FILE): $(xotclsdbm_OBJECTS) - rm -f $@ - @MAKE_LIB@ - $(RANLIB) $@ - -$(srcdir)/../$(xotclsdbm_LIB_FILE): $(xotclsdbm_LIB_FILE) - cp $< $@ - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# Unfortunately, there does not seem to be any other way to do this -# in a Makefile-independent way. We can't use VPATH because it picks up -# object files that may be located in the source directory. -# -# In the following lines, $(srcdir) refers to the toplevel directory -# containing your extension. If your sources are in a subdirectory, -# you will have to modify the paths to reflect this: -# -# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c -# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@ -#======================================================================== - -%.o: $(srcdir)/%.c - $(COMPILE) -c `@CYGPATH@ $<` -o $@ - -#======================================================================== -# End of user-definable section -#======================================================================== - -#======================================================================== -# Don't modify the file to clean here. Instead, set the "CLEANFILES" -# variable in configure.in -#======================================================================== - -clean: - @rm -f $(xotclsdbm_LIB_FILE) $(srcdir)/../$(xotclsdbm_LIB_FILE) \ - *.o core *.core *.$(OBJEXT) $(CLEANFILES) config.log - -distclean: clean - -rm -f *.tab.c - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -rm -f config.status - -#======================================================================== -# Install binary object libraries. On Windows this includes both .dll and -# .lib files. Because the .lib files are not explicitly listed anywhere, -# we need to deduce their existence from the .dll file of the same name. -# Additionally, the .dll files go into the bin directory, but the .lib -# files go into the lib directory. On Unix platforms, all library files -# go into the lib directory. In addition, this will generate the pkgIndex.tcl -# file in the install location (assuming it can find a usable tclsh8.2 shell) -# -# You should not have to modify this target. -#======================================================================== - -install-lib-binaries: $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) - @list='$(lib_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - ext=`echo $$p|sed -e "s/.*\.//"`; \ - if test "x$$ext" = "xdll"; then \ - echo " $(INSTALL_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)$(libdir)/$$lib"; \ - $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \ - fi; \ - else \ - echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \ - $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \ - fi; \ - else :; fi; \ - done - @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 -# $(TCLSH_PROG) $(configdir)/mkIndex.tcl - -#======================================================================== -# Install binary executables (e.g. .exe files) -# -# You should not have to modify this target. -#======================================================================== - -install-bin-binaries: $(DESTDIR)$(bindir) - @list='$(BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \ - $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \ - else :; fi; \ - done - -.SUFFIXES: .c .o .obj - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - - -uninstall-binaries: - @$(NORMAL_UNINSTALL) - list='$(BINARIES)'; for p in $$list; do \ - rm -f $(DESTDIR)$(libdir)/$$p; \ - done - -$(DESTDIR)$(includedir): - $(mkinstalldirs) $@ -$(DESTDIR)$(libdir): - $(mkinstalldirs) $@ -$(DESTDIR)$(bindir): - $(mkinstalldirs) $@ - -.PHONY: all binaries clean depend distclean doc install libraries test \ - install-binaries install-bin-binaries install-lib-binaries - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Index: xotcl/library/store/XOTclSdbm/Makefile.vc =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/Makefile.vc (revision 638782f84b31e4ebfd00529381e280c70f9950bc) +++ xotcl/library/store/XOTclSdbm/Makefile.vc (revision 0) @@ -1,224 +0,0 @@ -###################################################################### -# -# XOTclSdbm Makefile for Visual C++ -# -###################################################################### - -# Be sure to adapt the "configs.vc" file in the toplevel directory -# to your system settings. -!include "..\..\..\win\configs.vc" - -BINROOT = . -ROOT = .. -NAMEPREFIX = lib -NAME = xotclsdbm -XOTCL_DIR = ..\..\.. -GENERICDIR = . -WINDIR = . - -###################################################################### - -!if $(DEBUG) -TMPNAME = Debug -DBGX = d -!else -TMPNAME = Release -DBGX = -!endif - -TMP_DIR = $(BINROOT)\$(TMPNAME) -OUT_DIR = $(TMP_DIR) - -!if $(STATIC_BUILD) -OUTNAME = $(NAMEPREFIX)$(NAME)$(XOTCL_VERSION)$(DBGX) -TARGET = "$(OUT_DIR)\$(OUTNAME).lib" -!else -OUTNAME = $(NAMEPREFIX)$(NAME)$(XOTCL_VERSION)$(DBGX) -IMPLIB = "$(OUT_DIR)\$(OUTNAME).lib" -TARGET = "$(OUT_DIR)\$(OUTNAME).dll" -!endif - -TCLSTUBLIB = "$(TCLROOT)\win\Release\tclstub$(TCL_VERSION).lib" -TCLIMPLIB = "$(TCLROOT)\win\$(OUT_DIR)\tcl$(TCL_VERSION)$(DBGX).lib" -TCLSH = "$(TCLROOT)\win\$(OUT_DIR)\tclsh$(TCL_VERSION)$(DBGX).exe" - -XOTCLSTUBLIB = "$(XOTCL_DIR)\win\Release\libxotclstub$(XOTCL_VERSION).lib" -XOTCLIMPLIB = "$(XOTCL_DIR)\win\$(OUT_DIR)\libxotcl$(XOTCL_VERSION)$(DBGX).lib" - -LIB_INSTALL_DIR = $(INSTALLDIR)\lib -BIN_INSTALL_DIR = $(INSTALLDIR)\bin -SCRIPT_INSTALL_DIR = $(INSTALLDIR)\lib\xotcl$(XOTCL_VERSION) -INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include - -OBJS = $(TMP_DIR)\hash.obj \ - $(TMP_DIR)\pair.obj \ - $(TMP_DIR)\sdbm.obj \ - $(TMP_DIR)\xotclsdbm.obj \ -!if $(STATIC_BUILD) == 0 - $(TMP_DIR)\dllEntryPoint.obj -!endif - -###################################################################### -# Link flags -###################################################################### - -!if $(DEBUG) -ldebug = -debug:full -debugtype:cv -pdb:none -!else -ldebug = -release -opt:ref -!endif - -# declarations common to all linker options -lcommon = -nologo -link50compat -machine:$(MACHINE) - -LFLAGS = $(lcommon) -subsystem:windows -dll - -!if $(USE_TCL_STUBS) == 0 -LLIBS = $(TCLIMPLIB) $(XOTCLIMPLIB) -!else -### should be: -### LLIBS = $(TCLSTUBLIB) $(XOTCLSTUBLIB) when xotcl stub lib is mature -### LLIBS = $(TCLSTUBLIB) $(XOTCLIMPLIB) -LLIBS = $(TCLSTUBLIB) $(XOTCLSTUBLIB) -!endif - -###################################################################### -# Compile flags -###################################################################### - -!IF $(DEBUG) == 0 -!IF "$(MACHINE)" == "ALPHA" -# MSVC on Alpha doesn't understand -Ot -cdebug = -O2i -!ELSE -cdebug = -Ox -!ENDIF -!ELSE -!if $(MSDEV_VER) < 6 -cdebug = -Zi -Od -WX -!else -cdebug = -ZI -Od -WX -!endif -!ENDIF - -!if $(STATIC_BUILD) -cdll = -!else -cdll = -GD -!endif - -# declarations common to all compiler options -ccommon = -nologo -c -W3 -YX \ - - -!if $(STATIC_BUILD) && $(NOMSVCRT) -crt = -MT$(DBGX) -!else -crt = -MD$(DBGX) -!endif - -INCLUDES = -I"$(TCLROOT)\generic" -I"$(XOTCL_DIR)\generic" - -DEFINES = -DBUILD_$(NAME) -DTCL_THREADS=1 \ - -DXOLIBPKG=$(INST_XOLIBPKG) \ - -DXOTCLVERSION=$(XOTCLVERSION) \ - -DPACKAGE_VERSION=$(XOTCLVERSION) \ - -DVERSION=$(XOTCLVERSION) \ - -DXOTCLPATCHLEVEL=$(XOTCLPATCHLEVEL) \ - -D__WIN32__ -DVISUAL_CC - -EXE_CFLAGS = $(ccommon) $(cdebug) $(crt) $(cdll) $(INCLUDES) $(DEFINES) - -!if $(USE_TCL_STUBS) -#CFLAGS = $(EXE_CFLAGS) -DUSE_TCL_STUBS -CFLAGS = $(EXE_CFLAGS) -DUSE_TCL_STUBS -DUSE_XOTCL_STUBS -!else -CFLAGS = $(EXE_CFLAGS) -!endif - -###################################################################### -# Project specific targets -###################################################################### - -all : libs ./pkgIndex.tcl - -libs : setup $(TARGET) - copy $(TARGET) .. - -setup : - @$(vcvars) > nul - @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) &\ - echo Created directory '$(TMP_DIR)' - @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) &\ - echo Created directory '$(OUT_DIR)' - -$(TARGET) : $(OBJS) -!if $(STATIC_BUILD) - $(lib32) -nologo -machine:$(MACHINE) -out:$@ @<< -!else - $(link32) $(LFLAGS) -base:@$(XOTCL_DIR)\win\dllBase.txt,$@ -out:$@ $(LLIBS) @<< -!endif - $(OBJS) -<< - -./pkgIndex.tcl : $(TARGET) - echo package ifneeded xotcl::store::sdbm $(XOTCL_VERSION) [list load [file join $$dir $(TMPNAME)/$(OUTNAME).dll]] > \ - ".\pkgIndex.tcl" - -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 $(TARGET) "$(SCRIPT_INSTALL_DIR)" - -###################################################################### -# Inference rules. Use batch-mode when supported. -###################################################################### - -!if $(_NMAKE_VER) < 162 -{$(WINDIR)}.c{$(TMP_DIR)}.obj : -!else -{$(WINDIR)}.c{$(TMP_DIR)}.obj :: -!endif - $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -!if $(_NMAKE_VER) < 162 -{$(GENERICDIR)}.c{$(TMP_DIR)}.obj : -!else -{$(GENERICDIR)}.c{$(TMP_DIR)}.obj :: -!endif - $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -#{$(RCDIR)}.rc{$(TMP_DIR)}.res : -# $(rc32) -fo $@ -DDEBUG=$(DEBUG) $(XOTCL_VERSION_DEFINES) $(XOTCL_INCLUDES) $(TCL_INCLUDES) $(XOTCL_DEFINES) $< - -###################################################################### -# Clean up -###################################################################### - -tidy : - -del $(TMP_DIR)\*.pch - -del $(TMP_DIR)\*.obj - -del $(TMP_DIR)\*.res - -del .\*.pch - -del .\*.pdb - -clean : tidy - -del $(OUT_DIR)\*.exp - -del $(OUT_DIR)\*.lib - -del $(OUT_DIR)\*.dll - -del $(OUT_DIR)\*.tcl - -del ..\*.exp - -del ..\*.lib - -del ..\*.dll - -distclean : clean - -rmdir $(OUT_DIR) - -rmdir $(TMP_DIR) - Index: xotcl/library/store/XOTclSdbm/aclocal.m4 =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/aclocal.m4 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/XOTclSdbm/aclocal.m4 (revision 0) @@ -1,3 +0,0 @@ -builtin(include,xotcl.m4) -builtin(include,tcl.m4) - Index: xotcl/library/store/XOTclSdbm/config.log =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/config.log (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/XOTclSdbm/config.log (revision 0) @@ -1,1026 +0,0 @@ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by xotclsdbm configure 1.2, which was -generated by GNU Autoconf 2.57. Invocation command line was - - $ ./configure --prefix=/usr --enable-threads --prefix=/usr --with-all --cache-file=/dev/null --srcdir=. - -## --------- ## -## Platform. ## -## --------- ## - -hostname = localhost.localdomain -uname -m = i686 -uname -r = 2.4.22-1.2188.nptl -uname -s = Linux -uname -v = #1 Wed Apr 21 20:36:05 EDT 2004 - -/usr/bin/uname -p = unknown -/bin/uname -X = unknown - -/bin/arch = i686 -/usr/bin/arch -k = unknown -/usr/convex/getsysinfo = unknown -hostinfo = unknown -/bin/machine = unknown -/usr/bin/oslevel = unknown -/bin/universe = unknown - -PATH: . -PATH: /home/neumann/bin -PATH: . -PATH: /home/neumann/bin -PATH: /usr/local/bin -PATH: /usr/bin -PATH: /bin -PATH: /usr/X11R6/bin -PATH: /usr/X11R6/bin -PATH: /sbin -PATH: /usr/sbin -PATH: /opt/bin -PATH: /usr/X11R6/bin -PATH: /sbin -PATH: /usr/sbin -PATH: /opt/bin - - -## ----------- ## -## Core tests. ## -## ----------- ## - -configure:1294: checking for correct TEA configuration -configure:1313: result: ok -configure:1433: checking for Tcl configuration -configure:1505: result: found /usr/lib/tclConfig.sh -configure:1511: checking for existence of /usr/lib/tclConfig.sh -configure:1515: result: loading -configure:1670: checking for gcc -configure:1686: found /usr/bin/gcc -configure:1696: result: gcc -configure:1940: checking for C compiler version -configure:1943: gcc --version &5 -gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1) -Copyright (C) 2003 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -configure:1946: $? = 0 -configure:1948: gcc -v &5 -Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs -Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux -Thread model: posix -gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) -configure:1951: $? = 0 -configure:1953: gcc -V &5 -gcc: `-V' option must have argument -configure:1956: $? = 1 -configure:1980: checking for C compiler default output -configure:1983: gcc conftest.c >&5 -configure:1986: $? = 0 -configure:2032: result: a.out -configure:2037: checking whether the C compiler works -configure:2043: ./a.out -configure:2046: $? = 0 -configure:2063: result: yes -configure:2070: checking whether we are cross compiling -configure:2072: result: no -configure:2075: checking for suffix of executables -configure:2077: gcc -o conftest conftest.c >&5 -configure:2080: $? = 0 -configure:2105: result: -configure:2111: checking for suffix of object files -configure:2133: gcc -c conftest.c >&5 -configure:2136: $? = 0 -configure:2158: result: o -configure:2162: checking whether we are using the GNU C compiler -configure:2187: gcc -c conftest.c >&5 -configure:2190: $? = 0 -configure:2193: test -s conftest.o -configure:2196: $? = 0 -configure:2209: result: yes -configure:2215: checking whether gcc accepts -g -configure:2237: gcc -c -g conftest.c >&5 -configure:2240: $? = 0 -configure:2243: test -s conftest.o -configure:2246: $? = 0 -configure:2257: result: yes -configure:2274: checking for gcc option to accept ANSI C -configure:2335: gcc -c conftest.c >&5 -configure:2338: $? = 0 -configure:2341: test -s conftest.o -configure:2344: $? = 0 -configure:2362: result: none needed -configure:2380: gcc -c conftest.c >&5 -conftest.c:2: error: syntax error before "me" -configure:2383: $? = 1 -configure: failed program was: -| #ifndef __cplusplus -| choke me -| #endif -configure:2497: checking how to run the C preprocessor -configure:2533: gcc -E conftest.c -configure:2539: $? = 0 -configure:2571: gcc -E conftest.c -configure:2570:28: ac_nonexistent.h: No such file or directory -configure:2577: $? = 1 -configure: failed program was: -| #line 2562 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclsdbm" -| #define PACKAGE_TARNAME "xotclsdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclsdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| /* end confdefs.h. */ -| #include -configure:2615: result: gcc -E -configure:2640: gcc -E conftest.c -configure:2646: $? = 0 -configure:2678: gcc -E conftest.c -configure:2677:28: ac_nonexistent.h: No such file or directory -configure:2684: $? = 1 -configure: failed program was: -| #line 2669 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclsdbm" -| #define PACKAGE_TARNAME "xotclsdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclsdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| /* end confdefs.h. */ -| #include -configure:2739: checking for a BSD-compatible install -configure:2793: result: /usr/bin/install -c -configure:2809: checking whether make sets $(MAKE) -configure:2829: result: yes -configure:2884: checking for ranlib -configure:2900: found /usr/bin/ranlib -configure:2911: result: ranlib -configure:2933: checking for egrep -configure:2943: result: grep -E -configure:2948: checking for ANSI C header files -configure:2974: gcc -c conftest.c >&5 -configure:2977: $? = 0 -configure:2980: test -s conftest.o -configure:2983: $? = 0 -configure:3072: gcc -o conftest conftest.c >&5 -configure:3075: $? = 0 -configure:3077: ./conftest -configure:3080: $? = 0 -configure:3095: result: yes -configure:3119: checking for sys/types.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for sys/stat.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for stdlib.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for string.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for memory.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for strings.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for inttypes.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for stdint.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for unistd.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3178: checking if the compiler understands -pipe -configure:3199: gcc -pipe -c conftest.c >&5 -configure:3202: $? = 0 -configure:3205: test -s conftest.o -configure:3208: $? = 0 -configure:3210: result: yes -configure:3228: checking for required early compiler flags -configure:3252: gcc -pipe -c conftest.c >&5 -configure:3255: $? = 0 -configure:3258: test -s conftest.o -configure:3261: $? = 0 -configure:3338: gcc -pipe -c conftest.c >&5 -configure: In function `main': -configure:3343: error: storage size of `buf' isn't known -configure:3341: $? = 1 -configure: failed program was: -| #line 3321 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclsdbm" -| #define PACKAGE_TARNAME "xotclsdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclsdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| /* end confdefs.h. */ -| #include -| int -| main () -| { -| struct stat64 buf; int i = stat64("/", &buf); -| ; -| return 0; -| } -configure:3372: gcc -pipe -c conftest.c >&5 -configure:3375: $? = 0 -configure:3378: test -s conftest.o -configure:3381: $? = 0 -configure:3407: result: _LARGEFILE64_SOURCE -configure:3412: checking for 64-bit integer type -configure:3435: gcc -pipe -c conftest.c >&5 -configure: In function `main': -configure:3441: error: `__int64' undeclared (first use in this function) -configure:3441: error: (Each undeclared identifier is reported only once -configure:3441: error: for each function it appears in.) -configure:3441: error: syntax error before "value" -configure:3438: $? = 1 -configure: failed program was: -| #line 3418 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclsdbm" -| #define PACKAGE_TARNAME "xotclsdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclsdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| /* end confdefs.h. */ -| -| int -| main () -| { -| __int64 value = (__int64) 0; -| ; -| return 0; -| } -configure:3471: gcc -pipe -o conftest conftest.c >&5 -configure:3474: $? = 0 -configure:3476: ./conftest -configure:3479: $? = 0 -configure:3507: result: long long -configure:3511: checking for struct dirent64 -configure:3535: gcc -pipe -c conftest.c >&5 -configure:3538:24: sys/dirent.h: No such file or directory -configure: In function `main': -configure:3542: error: storage size of `p' isn't known -configure:3538: $? = 1 -configure: failed program was: -| #line 3517 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclsdbm" -| #define PACKAGE_TARNAME "xotclsdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclsdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| /* end confdefs.h. */ -| #include -| #include -| int -| main () -| { -| struct dirent64 p; -| ; -| return 0; -| } -configure:3562: result: no -configure:3565: checking for struct stat64 -configure:3589: gcc -pipe -c conftest.c >&5 -configure:3592: $? = 0 -configure:3595: test -s conftest.o -configure:3598: $? = 0 -configure:3616: result: yes -configure:3619: checking for off64_t -configure:3643: gcc -pipe -c conftest.c >&5 -configure:3646: $? = 0 -configure:3649: test -s conftest.o -configure:3652: $? = 0 -configure:3670: result: yes -configure:3674: checking whether byte ordering is bigendian -configure:3702: gcc -pipe -c conftest.c >&5 -configure:3705: $? = 0 -configure:3708: test -s conftest.o -configure:3711: $? = 0 -configure:3736: gcc -pipe -c conftest.c >&5 -configure: In function `main': -configure:3743: error: `not' undeclared (first use in this function) -configure:3743: error: (Each undeclared identifier is reported only once -configure:3743: error: for each function it appears in.) -configure:3743: error: syntax error before "big" -configure:3739: $? = 1 -configure: failed program was: -| #line 3714 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclsdbm" -| #define PACKAGE_TARNAME "xotclsdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclsdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| #include -| #include -| -| int -| main () -| { -| #if BYTE_ORDER != BIG_ENDIAN -| not big endian -| #endif -| -| ; -| return 0; -| } -configure:3859: result: no -configure:3887: checking for sin -configure:3937: gcc -pipe -o conftest conftest.c >&5 -configure:3930: warning: conflicting types for built-in function `sin' -/tmp/ccK1sUVc.o(.text+0x16): In function `main': -: undefined reference to `sin' -/tmp/ccK1sUVc.o(.data+0x0): undefined reference to `sin' -collect2: ld returned 1 exit status -configure:3940: $? = 1 -configure: failed program was: -| #line 3892 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclsdbm" -| #define PACKAGE_TARNAME "xotclsdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclsdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char sin (); below. -| Prefer to if __STDC__ is defined, since -| exists even on freestanding compilers. */ -| #ifdef __STDC__ -| # include -| #else -| # include -| #endif -| /* Override any gcc2 internal prototype to avoid an error. */ -| #ifdef __cplusplus -| extern "C" -| { -| #endif -| /* We use char because int might match the return type of a gcc2 -| builtin and then its argument prototype would still apply. */ -| char sin (); -| /* The GNU C library defines this for functions which it implements -| to always fail with ENOSYS. Some functions are actually named -| something starting with __ and the normal name is an alias. */ -| #if defined (__stub_sin) || defined (__stub___sin) -| choke me -| #else -| char (*f) () = sin; -| #endif -| #ifdef __cplusplus -| } -| #endif -| -| int -| main () -| { -| return f != sin; -| ; -| return 0; -| } -configure:3957: result: no -configure:3965: checking for main in -lieee -configure:3990: gcc -pipe -o conftest conftest.c -lieee >&5 -configure:3993: $? = 0 -configure:3996: test -s conftest -configure:3999: $? = 0 -configure:4011: result: yes -configure:4023: checking for main in -linet -configure:4048: gcc -pipe -o conftest conftest.c -linet >&5 -/usr/bin/ld: cannot find -linet -collect2: ld returned 1 exit status -configure:4051: $? = 1 -configure: failed program was: -| #line 4030 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclsdbm" -| #define PACKAGE_TARNAME "xotclsdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclsdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| -| -| int -| main () -| { -| main (); -| ; -| return 0; -| } -configure:4069: result: no -configure:4085: checking net/errno.h usability -configure:4098: gcc -pipe -c conftest.c >&5 -configure:4143:23: net/errno.h: No such file or directory -configure:4101: $? = 1 -configure: failed program was: -| #line 4087 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclsdbm" -| #define PACKAGE_TARNAME "xotclsdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclsdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| #include -| #if HAVE_SYS_TYPES_H -| # include -| #endif -| #if HAVE_SYS_STAT_H -| # include -| #endif -| #if STDC_HEADERS -| # include -| # include -| #else -| # if HAVE_STDLIB_H -| # include -| # endif -| #endif -| #if HAVE_STRING_H -| # if !STDC_HEADERS && HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #if HAVE_STRINGS_H -| # include -| #endif -| #if HAVE_INTTYPES_H -| # include -| #else -| # if HAVE_STDINT_H -| # include -| # endif -| #endif -| #if HAVE_UNISTD_H -| # include -| #endif -| #include -configure:4117: result: no -configure:4121: checking net/errno.h presence -configure:4132: gcc -E conftest.c -configure:4145:23: net/errno.h: No such file or directory -configure:4138: $? = 1 -configure: failed program was: -| #line 4123 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclsdbm" -| #define PACKAGE_TARNAME "xotclsdbm" -| #define PACKAGE_VERSION "1.2" -| #define PACKAGE_STRING "xotclsdbm 1.2" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| #include -configure:4157: result: no -configure:4193: checking for net/errno.h -configure:4200: result: no -configure:4232: checking for connect -configure:4282: gcc -pipe -o conftest conftest.c >&5 -configure:4285: $? = 0 -configure:4288: test -s conftest -configure:4291: $? = 0 -configure:4302: result: yes -configure:4531: checking for gethostbyname -configure:4581: gcc -pipe -o conftest conftest.c >&5 -configure:4584: $? = 0 -configure:4587: test -s conftest -configure:4590: $? = 0 -configure:4601: result: yes -configure:4675: checking dirent.h -configure:4713: gcc -pipe -o conftest conftest.c >&5 -configure:4716: $? = 0 -configure:4719: test -s conftest -configure:4722: $? = 0 -configure:4740: result: yes -configure:4752: checking errno.h usability -configure:4765: gcc -pipe -c conftest.c >&5 -configure:4768: $? = 0 -configure:4771: test -s conftest.o -configure:4774: $? = 0 -configure:4784: result: yes -configure:4788: checking errno.h presence -configure:4799: gcc -E conftest.c -configure:4805: $? = 0 -configure:4824: result: yes -configure:4860: checking for errno.h -configure:4867: result: yes -configure:4891: checking float.h usability -configure:4904: gcc -pipe -c conftest.c >&5 -configure:4907: $? = 0 -configure:4910: test -s conftest.o -configure:4913: $? = 0 -configure:4923: result: yes -configure:4927: checking float.h presence -configure:4938: gcc -E conftest.c -configure:4944: $? = 0 -configure:4963: result: yes -configure:4999: checking for float.h -configure:5006: result: yes -configure:5030: checking values.h usability -configure:5043: gcc -pipe -c conftest.c >&5 -configure:5046: $? = 0 -configure:5049: test -s conftest.o -configure:5052: $? = 0 -configure:5062: result: yes -configure:5066: checking values.h presence -configure:5077: gcc -E conftest.c -configure:5083: $? = 0 -configure:5102: result: yes -configure:5138: checking for values.h -configure:5145: result: yes -configure:5169: checking limits.h usability -configure:5182: gcc -pipe -c conftest.c >&5 -configure:5185: $? = 0 -configure:5188: test -s conftest.o -configure:5191: $? = 0 -configure:5201: result: yes -configure:5205: checking limits.h presence -configure:5216: gcc -E conftest.c -configure:5222: $? = 0 -configure:5241: result: yes -configure:5277: checking for limits.h -configure:5284: result: yes -configure:5299: checking for stdlib.h -configure:5304: result: yes -configure:5495: checking for string.h -configure:5500: result: yes -configure:5687: checking sys/wait.h usability -configure:5700: gcc -pipe -c conftest.c >&5 -configure:5703: $? = 0 -configure:5706: test -s conftest.o -configure:5709: $? = 0 -configure:5719: result: yes -configure:5723: checking sys/wait.h presence -configure:5734: gcc -E conftest.c -configure:5740: $? = 0 -configure:5759: result: yes -configure:5795: checking for sys/wait.h -configure:5802: result: yes -configure:5826: checking dlfcn.h usability -configure:5839: gcc -pipe -c conftest.c >&5 -configure:5842: $? = 0 -configure:5845: test -s conftest.o -configure:5848: $? = 0 -configure:5858: result: yes -configure:5862: checking dlfcn.h presence -configure:5873: gcc -E conftest.c -configure:5879: $? = 0 -configure:5898: result: yes -configure:5934: checking for dlfcn.h -configure:5941: result: yes -configure:5967: checking for limits.h -configure:5972: result: yes -configure:5967: checking for unistd.h -configure:5972: result: yes -configure:5976: checking sys/param.h usability -configure:5989: gcc -pipe -c conftest.c >&5 -configure:5992: $? = 0 -configure:5995: test -s conftest.o -configure:5998: $? = 0 -configure:6008: result: yes -configure:6012: checking sys/param.h presence -configure:6023: gcc -E conftest.c -configure:6029: $? = 0 -configure:6048: result: yes -configure:6084: checking for sys/param.h -configure:6091: result: yes -configure:6139: checking for XOTcl configuration -configure:6200: result: found /home/neumann/xotcl-1.2.1/xotclConfig.sh -configure:6206: checking for existence of /home/neumann/xotcl-1.2.1/xotclConfig.sh -configure:6210: result: loading -configure:6379: checking for Tcl public headers -configure:6434: result: /usr/include -configure:6482: checking for pthread_mutex_init in -lpthread -configure:6513: gcc -pipe -o conftest conftest.c -lpthread >&5 -configure:6516: $? = 0 -configure:6519: test -s conftest -configure:6522: $? = 0 -configure:6534: result: yes -configure:6821: checking for pthread_attr_setstacksize -configure:6871: gcc -pipe -o conftest conftest.c -lpthread >&5 -configure:6874: $? = 0 -configure:6877: test -s conftest -configure:6880: $? = 0 -configure:6891: result: yes -configure:6906: checking for readdir_r -configure:6956: gcc -pipe -o conftest conftest.c >&5 -configure:6959: $? = 0 -configure:6962: test -s conftest -configure:6965: $? = 0 -configure:6976: result: yes -configure:6991: checking for building with threads -configure:6998: result: yes -configure:7037: checking how to build libraries -configure:7055: result: shared -configure:7081: checking if 64bit support is enabled -configure:7090: result: no -configure:7095: checking if 64bit Sparc VIS support is requested -configure:7104: result: no -configure:7132: checking system version (for dynamic loading) -configure:7155: result: Linux-2.4.22-1.2188.nptl -configure:7163: checking for dlopen in -ldl -configure:7194: gcc -pipe -o conftest conftest.c -ldl >&5 -configure:7197: $? = 0 -configure:7200: test -s conftest -configure:7203: $? = 0 -configure:7215: result: yes -configure:7245: checking for ar -configure:7261: found /usr/bin/ar -configure:7271: result: ar -configure:9157: checking for build with symbols -configure:9171: result: no -configure:9306: checking for tclsh -configure:9337: result: /usr/lib/../bin/tclsh8.4 -configure:9481: creating ./config.status - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by xotclsdbm config.status 1.2, which was -generated by GNU Autoconf 2.57. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status - -on localhost.localdomain - -config.status:675: creating Makefile - -## ---------------- ## -## Cache variables. ## -## ---------------- ## - -ac_cv_c_bigendian=no -ac_cv_c_compiler_gnu=yes -ac_cv_c_tclconfig=/usr/lib -ac_cv_c_tclh=/usr/include -ac_cv_c_xotclconfig=/home/neumann/xotcl-1.2.1 -ac_cv_env_CC_set= -ac_cv_env_CC_value= -ac_cv_env_CFLAGS_set= -ac_cv_env_CFLAGS_value= -ac_cv_env_CPPFLAGS_set= -ac_cv_env_CPPFLAGS_value= -ac_cv_env_CPP_set= -ac_cv_env_CPP_value= -ac_cv_env_LDFLAGS_set= -ac_cv_env_LDFLAGS_value= -ac_cv_env_build_alias_set= -ac_cv_env_build_alias_value= -ac_cv_env_host_alias_set= -ac_cv_env_host_alias_value= -ac_cv_env_target_alias_set= -ac_cv_env_target_alias_value= -ac_cv_exeext= -ac_cv_func_connect=yes -ac_cv_func_gethostbyname=yes -ac_cv_func_pthread_attr_setstacksize=yes -ac_cv_func_readdir_r=yes -ac_cv_func_sin=no -ac_cv_header_dlfcn_h=yes -ac_cv_header_errno_h=yes -ac_cv_header_float_h=yes -ac_cv_header_inttypes_h=yes -ac_cv_header_limits_h=yes -ac_cv_header_memory_h=yes -ac_cv_header_net_errno_h=no -ac_cv_header_stdc=yes -ac_cv_header_stdint_h=yes -ac_cv_header_stdlib_h=yes -ac_cv_header_string_h=yes -ac_cv_header_strings_h=yes -ac_cv_header_sys_param_h=yes -ac_cv_header_sys_stat_h=yes -ac_cv_header_sys_types_h=yes -ac_cv_header_sys_wait_h=yes -ac_cv_header_unistd_h=yes -ac_cv_header_values_h=yes -ac_cv_lib_dl_dlopen=yes -ac_cv_lib_ieee_main=yes -ac_cv_lib_inet_main=no -ac_cv_lib_pthread_pthread_mutex_init=yes -ac_cv_objext=o -ac_cv_path_install='/usr/bin/install -c' -ac_cv_path_tclsh=/usr/lib/../bin/tclsh8.4 -ac_cv_prog_AR=ar -ac_cv_prog_CPP='gcc -E' -ac_cv_prog_ac_ct_CC=gcc -ac_cv_prog_ac_ct_RANLIB=ranlib -ac_cv_prog_cc_g=yes -ac_cv_prog_cc_stdc= -ac_cv_prog_egrep='grep -E' -ac_cv_prog_make_make_set=yes -tcl_cv_flag__isoc99_source=no -tcl_cv_flag__largefile64_source=yes -tcl_cv_struct_dirent64=no -tcl_cv_struct_stat64=yes -tcl_cv_type_64bit='long long' -tcl_cv_type_off64_t=yes - -## ----------------- ## -## Output variables. ## -## ----------------- ## - -AR='ar' -CC='gcc -pipe' -CFLAGS=' ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' -CFLAGS_DEBUG='-g' -CFLAGS_DEFAULT='-O' -CFLAGS_OPTIMIZE='-O' -CFLAGS_WARNING='-Wall -Wconversion -Wno-implicit-int' -CLEANFILES='pkgIndex.tcl' -CPP='gcc -E' -CPPFLAGS='' -CYGPATH='echo' -DEFS='-DPACKAGE_NAME=\"xotclsdbm\" -DPACKAGE_TARNAME=\"xotclsdbm\" -DPACKAGE_VERSION=\"1.2\" -DPACKAGE_STRING=\"xotclsdbm\ 1.2\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -DTCL_THREADS=1 -DUSE_TCL_STUBS=1 ' -DL_LIBS='-ldl' -ECHO_C='' -ECHO_N='-n' -ECHO_T='' -EGREP='grep -E' -EXEEXT='' -EXTRA_CFLAGS='' -INSTALL_DATA='${INSTALL} -m 644' -INSTALL_PROGRAM='${INSTALL}' -INSTALL_SCRIPT='${INSTALL}' -LDFLAGS='-rdynamic' -LDFLAGS_DEBUG='' -LDFLAGS_DEFAULT='-rdynamic' -LDFLAGS_OPTIMIZE='' -LD_LIBRARY_PATH_VAR='LD_LIBRARY_PATH' -LIBOBJS='' -LIBS='' -LTLIBOBJS='' -MAKE_LIB='${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_FLAGS} ${SHLIB_LD_LIBS} ' -MAKE_SHARED_LIB='${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_FLAGS} ${SHLIB_LD_LIBS}' -MAKE_STATIC_LIB='${STLIB_LD} $@ $(PKG_OBJECTS)' -MAKE_STUB_LIB='${STLIB_LD} $@ $(PKG_STUB_OBJECTS)' -MATH_LIBS='-lieee -lm' -OBJEXT='o' -PACKAGE_BUGREPORT='' -PACKAGE_NAME='xotclsdbm' -PACKAGE_STRING='xotclsdbm 1.2' -PACKAGE_TARNAME='xotclsdbm' -PACKAGE_VERSION='1.2' -PATH_SEPARATOR=':' -PKG_CFLAGS=' ' -PKG_HEADERS='' -PKG_INCLUDES=' -I/home/neumann/xotcl-1.2.1/generic' -PKG_LIBS=' -L/home/neumann/xotcl-1.2.1 -lxotclstub1.2.1' -PKG_LIB_FILE='libxotclsdbm1.2.so' -PKG_OBJECTS=' hash.o pair.o sdbm.o xotclsdbm.o' -PKG_SOURCES=' hash.c pair.c sdbm.c xotclsdbm.c' -PKG_STUB_LIB_FILE='libxotclsdbmstub1.2.a' -PKG_STUB_OBJECTS='' -PKG_STUB_SOURCES='' -PKG_TCL_SOURCES='' -RANLIB=':' -RANLIB_STUB='ranlib' -SET_MAKE='' -SHARED_BUILD='1' -SHELL='/bin/sh' -SHLIB_CFLAGS='-fPIC' -SHLIB_LD='gcc -pipe -shared' -SHLIB_LD_FLAGS='' -SHLIB_LD_LIBS='${LIBS} -L/usr/lib -ltclstub8.4' -STLIB_LD='${AR} cr' -TCLSH_PROG='/usr/lib/../bin/tclsh8.4' -TCL_BIN_DIR='/usr/lib' -TCL_DBGX='' -TCL_DEFS=' -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DPEEK_XCLOSEIM=1 -DHAVE_SYS_IOCTL_H=1 ' -TCL_EXTRA_CFLAGS='' -TCL_INCLUDES='-I"/usr/include"' -TCL_LD_FLAGS='-rdynamic' -TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' -TCL_LIB_FILE='libtcl8.4.so' -TCL_LIB_FLAG='-ltcl8.4' -TCL_LIB_SPEC='-L/usr/lib -ltcl8.4' -TCL_SHLIB_LD_LIBS='${LIBS}' -TCL_SRC_DIR='/home/neumann/tcl8.4.5' -TCL_STUB_LIB_FILE='libtclstub8.4.a' -TCL_STUB_LIB_FLAG='-ltclstub8.4' -TCL_STUB_LIB_SPEC='-L/usr/lib -ltclstub8.4' -TCL_THREADS='1' -TCL_VERSION='8.4' -XOTCL_BUILD_LIB_SPEC='-L/home/neumann/xotcl-1.2.1 -lxotcl1.2.1' -XOTCL_BUILD_STUB_LIB_SPEC='-L/home/neumann/xotcl-1.2.1 -lxotclstub1.2.1' -XOTCL_LIB_FILE='libxotcl1.2.1.so' -XOTCL_LIB_SPEC='-L/usr/lib -lxotcl1.2.1' -XOTCL_MAJOR_VERSION='1' -XOTCL_MINOR_VERSION='2' -XOTCL_RELEASE_LEVEL='.1' -XOTCL_SRC_DIR='/home/neumann/xotcl-1.2.1' -XOTCL_STUB_LIB_FILE='' -XOTCL_STUB_LIB_SPEC='-L/usr/lib -lxotclstub1.2.1' -XOTCL_VERSION='1.2' -ac_ct_CC='gcc' -ac_ct_RANLIB='ranlib' -bindir='${exec_prefix}/bin' -build_alias='' -datadir='${prefix}/share' -exec_prefix='/usr' -host_alias='' -includedir='${prefix}/include' -infodir='${prefix}/info' -libdir='${exec_prefix}/lib' -libexecdir='${exec_prefix}/libexec' -localstatedir='${prefix}/var' -mandir='${prefix}/man' -oldincludedir='/usr/include' -prefix='/usr' -program_transform_name='s,x,x,' -sbindir='${exec_prefix}/sbin' -sharedstatedir='${prefix}/com' -sysconfdir='${prefix}/etc' -target_alias='' - -## ----------- ## -## confdefs.h. ## -## ----------- ## - -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 -#define HAVE_READDIR_R 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRUCT_STAT64 1 -#define HAVE_SYS_PARAM_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_TYPE_OFF64_T 1 -#define HAVE_UNISTD_H 1 -#define HAVE_UNISTD_H 1 -#define PACKAGE_BUGREPORT "" -#define PACKAGE_NAME "xotclsdbm" -#define PACKAGE_STRING "xotclsdbm 1.2" -#define PACKAGE_TARNAME "xotclsdbm" -#define PACKAGE_VERSION "1.2" -#define STDC_HEADERS 1 -#define TCL_THREADS 1 -#define TCL_WIDE_INT_TYPE long long -#define USE_TCL_STUBS 1 -#define USE_THREAD_ALLOC 1 -#define _LARGEFILE64_SOURCE 1 -#define _REENTRANT 1 -#define _THREAD_SAFE 1 - -configure: exit 0 Index: xotcl/library/store/XOTclSdbm/configure =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/configure (revision caee4f272cfc744a06a7df61e2f3c73da1b6be64) +++ xotcl/library/store/XOTclSdbm/configure (revision 0) @@ -1,10946 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for xotclsdbm 1.2. -# -# Copyright (C) 2003 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_config_libobj_dir=. -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -# Identity of this package. -PACKAGE_NAME='xotclsdbm' -PACKAGE_TARNAME='xotclsdbm' -PACKAGE_VERSION='1.2' -PACKAGE_STRING='xotclsdbm 1.2' -PACKAGE_BUGREPORT='' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_STAT_H -# include -#endif -#if STDC_HEADERS -# include -# include -#else -# if HAVE_STDLIB_H -# include -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif -# include -#endif -#if HAVE_STRINGS_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif -#if HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG LTLIBOBJS' -ac_subst_files='' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures xotclsdbm 1.2 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -_ACEOF - - cat <<_ACEOF -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] -_ACEOF - - cat <<\_ACEOF -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of xotclsdbm 1.2:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-threads build with threads - --enable-shared build and link with shared libraries (default: on) - --enable-64bit enable 64bit support (default: off) - --enable-64bit-vis enable 64bit Sparc VIS support (default: off) - --enable-wince enable Win/CE support (where applicable) - --enable-load allow dynamic loading and "load" command (default: - on) - --enable-symbols build with debugging symbols (default: off) - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH - absolute path to xotclConfig.sh, - --without-xotcl disables, but this is pointless - --with-tcl directory containing tcl configuration - (tclConfig.sh) - --with-tclinclude directory containing the public Tcl header files - --with-celib=DIR use Windows/CE support library from DIR - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\_ACEOF -xotclsdbm configure 1.2 -generated by GNU Autoconf 2.59 - -Copyright (C) 2003 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit 0 -fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by xotclsdbm $as_me 1.2, which was -generated by GNU Autoconf 2.59. Invocation command line was - - $ $0 $@ - -_ACEOF -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_sep= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - sed "/^$/d" confdefs.h | sort - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#-------------------------------------------------------------------- -# 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 extensions pass this us the version of TEA they think they - # are compatible with. - TEA_VERSION="3.6" - - echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 -echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 - if test x"${PACKAGE_NAME}" = x ; then - { { echo "$as_me:$LINENO: error: -The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 -echo "$as_me: error: -The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} - { (exit 1); exit 1; }; } - fi - if test x"3.5" = x ; then - { { echo "$as_me:$LINENO: error: -TEA version not specified." >&5 -echo "$as_me: error: -TEA version not specified." >&2;} - { (exit 1); exit 1; }; } - elif test "3.5" != "${TEA_VERSION}" ; then - echo "$as_me:$LINENO: result: warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&5 -echo "${ECHO_T}warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&6 - else - echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 -echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 - fi - case "`uname -s`" in - *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) - # Extract the first word of "cygpath", so it can be a program name with args. -set dummy cygpath; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CYGPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CYGPATH"; then - ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CYGPATH="cygpath -w" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" -fi -fi -CYGPATH=$ac_cv_prog_CYGPATH -if test -n "$CYGPATH"; then - echo "$as_me:$LINENO: result: $CYGPATH" >&5 -echo "${ECHO_T}$CYGPATH" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - EXEEXT=".exe" - TEA_PLATFORM="windows" - ;; - *) - CYGPATH=echo - EXEEXT="" - TEA_PLATFORM="unix" - ;; - esac - - # Check if exec_prefix is set. If not use fall back to prefix. - # Note when adjusted, so that TEA_PREFIX can correct for this. - # This is needed for recursive configures, since autoconf propagates - # $prefix, but not $exec_prefix (doh!). - if test x$exec_prefix = xNONE ; then - exec_prefix_default=yes - exec_prefix=$prefix - fi - - - - - # This package name must be replaced statically for AC_SUBST to work - - # Substitute STUB_LIB_FILE in case package creates a stub library too. - - - # We AC_SUBST these here to ensure they are subst'ed, - # in case the user doesn't call TEA_ADD_... - - - - - - - - - -ac_aux_dir= -for ac_dir in ../../../config $srcdir/../../../config; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../../config $srcdir/../../../config" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in ../../../config $srcdir/../../../config" >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - - -#-------------------------------------------------------------------- -# specify some extra flags -#-------------------------------------------------------------------- - - -# Check whether --with-xotcl or --without-xotcl was given. -if test "${with_xotcl+set}" = set; then - withval="$with_xotcl" - with_xotcl=$withval -else - { { echo "$as_me:$LINENO: error: --with-xotcl is required" >&5 -echo "$as_me: error: --with-xotcl is required" >&2;} - { (exit 1); exit 1; }; } -fi; - -#-------------------------------------------------------------------- -# Load the tclConfig.sh file -#-------------------------------------------------------------------- - - - - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - - if test x"${no_tcl}" = x ; then - # we reset no_tcl in case something fails here - no_tcl=true - -# Check whether --with-tcl or --without-tcl was given. -if test "${with_tcl+set}" = set; then - withval="$with_tcl" - with_tclconfig=${withval} -fi; - echo "$as_me:$LINENO: checking for Tcl configuration" >&5 -echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 - if test "${ac_cv_c_tclconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - case ${with_tclconfig} in - */tclConfig.sh ) - if test -f ${with_tclconfig}; then - { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 -echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} - with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 -echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} - { (exit 1); exit 1; }; } - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tcl.framework/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - -fi - - - if test x"${ac_cv_c_tclconfig}" = x ; then - TCL_BIN_DIR="# no Tcl configs found" - { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 -echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} - exit 0 - else - no_tcl= - TCL_BIN_DIR=${ac_cv_c_tclconfig} - echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 - fi - fi - - - echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 - - if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - echo "$as_me:$LINENO: result: loading" >&5 -echo "${ECHO_T}loading" >&6 - . "${TCL_BIN_DIR}/tclConfig.sh" - else - echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tcl.framework installed in an arbitary location. - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then - for i in "`cd ${TCL_BIN_DIR}; pwd`" \ - "`cd ${TCL_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then - TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" - break - fi - done - fi - if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then - TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" - TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - - - - - - - - - - - - - - - - - - - -#-------------------------------------------------------------------- -# Load the tkConfig.sh file if necessary (Tk extension) -#-------------------------------------------------------------------- - -#TEA_PATH_TKCONFIG -#TEA_LOAD_TKCONFIG - -#----------------------------------------------------------------------- -# Handle the --prefix=... option by defaulting to what Tcl gave. -# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. -#----------------------------------------------------------------------- - - - if test "${prefix}" = "NONE"; then - prefix_default=yes - if test x"${TCL_PREFIX}" != x; then - { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 -echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} - prefix=${TCL_PREFIX} - else - { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 -echo "$as_me: --prefix defaulting to /usr/local" >&6;} - prefix=/usr/local - fi - fi - if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ - -o x"${exec_prefix_default}" = x"yes" ; then - if test x"${TCL_EXEC_PREFIX}" != x; then - { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 -echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} - exec_prefix=${TCL_EXEC_PREFIX} - else - { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 -echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} - exec_prefix=$prefix - fi - fi - - -#----------------------------------------------------------------------- -# Standard compiler checks. -# This sets up CC by using the CC env var, or looks for gcc otherwise. -# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create -# the basic setup necessary to compile executables. -#----------------------------------------------------------------------- - - - # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) - # in this macro, they need to go into TEA_SETUP_COMPILER instead. - - # If the user did not set CFLAGS, set it now to keep - # the AC_PROG_CC macro from adding "-g -O2". - if test "${CFLAGS+set}" != "set" ; then - CFLAGS="" - fi - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - # Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - - #-------------------------------------------------------------------- - # Checks to see if the make program sets the $MAKE variable. - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\_ACEOF -all: - @echo 'ac_maketemp="$(MAKE)"' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftest.make -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SET_MAKE= -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - - #-------------------------------------------------------------------- - # Find ranlib - #-------------------------------------------------------------------- - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - - - #-------------------------------------------------------------------- - # Determines the correct binary file extension (.o, .obj, .exe etc.) - #-------------------------------------------------------------------- - - - - - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. - - - #------------------------------------------------------------------------ - # If we're using GCC, see if the compiler understands -pipe. If so, use it. - # It makes compiling go faster. (This is only a performance feature.) - #------------------------------------------------------------------------ - - if test -z "$no_pipe" -a -n "$GCC"; then - echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 -echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 -if test "${tcl_cv_cc_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_pipe=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_pipe=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 -echo "${ECHO_T}$tcl_cv_cc_pipe" >&6 - if test $tcl_cv_cc_pipe = yes; then - CFLAGS="$CFLAGS -pipe" - fi - fi - - #-------------------------------------------------------------------- - # Common compiler flag setup - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_bigendian=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -# It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - - if test "${TEA_PLATFORM}" = "unix" ; then - - #-------------------------------------------------------------------- - # On a few very rare systems, all of the libm.a stuff is - # already in libc.a. Set compiler flags accordingly. - # Also, Linux requires the "ieee" library for math to work - # right (and it must appear before "-lm"). - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking for sin" >&5 -echo $ECHO_N "checking for sin... $ECHO_C" >&6 -if test "${ac_cv_func_sin+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define sin to an innocuous variant, in case declares sin. - For example, HP-UX 11i declares gettimeofday. */ -#define sin innocuous_sin - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char sin (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef sin - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char sin (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_sin) || defined (__stub___sin) -choke me -#else -char (*f) () = sin; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != sin; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_sin=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_sin=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 -echo "${ECHO_T}$ac_cv_func_sin" >&6 -if test $ac_cv_func_sin = yes; then - MATH_LIBS="" -else - MATH_LIBS="-lm" -fi - - echo "$as_me:$LINENO: checking for main in -lieee" >&5 -echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 -if test "${ac_cv_lib_ieee_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lieee $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_ieee_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_ieee_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 -echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 -if test $ac_cv_lib_ieee_main = yes; then - MATH_LIBS="-lieee $MATH_LIBS" -fi - - - #-------------------------------------------------------------------- - # Interactive UNIX requires -linet instead of -lsocket, plus it - # needs net/errno.h to define the socket-related error codes. - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking for main in -linet" >&5 -echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 -if test "${ac_cv_lib_inet_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-linet $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_inet_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_inet_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 -echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 -if test $ac_cv_lib_inet_main = yes; then - LIBS="$LIBS -linet" -fi - - if test "${ac_cv_header_net_errno_h+set}" = set; then - echo "$as_me:$LINENO: checking for net/errno.h" >&5 -echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_net_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking net/errno.h usability" >&5 -echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking net/errno.h presence" >&5 -echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclsdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for net/errno.h" >&5 -echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_net_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_net_errno_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 - -fi -if test $ac_cv_header_net_errno_h = yes; then - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_NET_ERRNO_H 1 -_ACEOF - -fi - - - - #-------------------------------------------------------------------- - # Check for the existence of the -lsocket and -lnsl libraries. - # The order here is important, so that they end up in the right - # order in the command line generated by make. Here are some - # special considerations: - # 1. Use "connect" and "accept" to check for -lsocket, and - # "gethostbyname" to check for -lnsl. - # 2. Use each function name only once: can't redo a check because - # autoconf caches the results of the last check and won't redo it. - # 3. Use -lnsl and -lsocket only if they supply procedures that - # aren't already present in the normal libraries. This is because - # IRIX 5.2 has libraries, but they aren't needed and they're - # bogus: they goof up name resolution if used. - # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. - # To get around this problem, check for both libraries together - # if -lsocket doesn't work by itself. - #-------------------------------------------------------------------- - - tcl_checkBoth=0 - echo "$as_me:$LINENO: checking for connect" >&5 -echo $ECHO_N "checking for connect... $ECHO_C" >&6 -if test "${ac_cv_func_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define connect to an innocuous variant, in case declares connect. - For example, HP-UX 11i declares gettimeofday. */ -#define connect innocuous_connect - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef connect - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_connect) || defined (__stub___connect) -choke me -#else -char (*f) () = connect; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != connect; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_connect=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_connect=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 -echo "${ECHO_T}$ac_cv_func_connect" >&6 -if test $ac_cv_func_connect = yes; then - tcl_checkSocket=0 -else - tcl_checkSocket=1 -fi - - if test "$tcl_checkSocket" = 1; then - echo "$as_me:$LINENO: checking for setsockopt" >&5 -echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 -if test "${ac_cv_func_setsockopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define setsockopt to an innocuous variant, in case declares setsockopt. - For example, HP-UX 11i declares gettimeofday. */ -#define setsockopt innocuous_setsockopt - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char setsockopt (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef setsockopt - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setsockopt (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_setsockopt) || defined (__stub___setsockopt) -choke me -#else -char (*f) () = setsockopt; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != setsockopt; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_setsockopt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_setsockopt=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 -if test $ac_cv_func_setsockopt = yes; then - : -else - echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 -echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 -if test "${ac_cv_lib_socket_setsockopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setsockopt (); -int -main () -{ -setsockopt (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_socket_setsockopt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_socket_setsockopt=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 -if test $ac_cv_lib_socket_setsockopt = yes; then - LIBS="$LIBS -lsocket" -else - tcl_checkBoth=1 -fi - -fi - - fi - if test "$tcl_checkBoth" = 1; then - tk_oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - echo "$as_me:$LINENO: checking for accept" >&5 -echo $ECHO_N "checking for accept... $ECHO_C" >&6 -if test "${ac_cv_func_accept+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define accept to an innocuous variant, in case declares accept. - For example, HP-UX 11i declares gettimeofday. */ -#define accept innocuous_accept - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char accept (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef accept - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char accept (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_accept) || defined (__stub___accept) -choke me -#else -char (*f) () = accept; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != accept; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_accept=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_accept=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 -echo "${ECHO_T}$ac_cv_func_accept" >&6 -if test $ac_cv_func_accept = yes; then - tcl_checkNsl=0 -else - LIBS=$tk_oldLibs -fi - - fi - echo "$as_me:$LINENO: checking for gethostbyname" >&5 -echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 -if test "${ac_cv_func_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. - For example, HP-UX 11i declares gettimeofday. */ -#define gethostbyname innocuous_gethostbyname - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef gethostbyname - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -char (*f) () = gethostbyname; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != gethostbyname; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_gethostbyname=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 -if test $ac_cv_func_gethostbyname = yes; then - : -else - echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 -echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 -if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -int -main () -{ -gethostbyname (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_nsl_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_nsl_gethostbyname=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 -if test $ac_cv_lib_nsl_gethostbyname = yes; then - LIBS="$LIBS -lnsl" -fi - -fi - - - # Don't perform the eval of the libraries here because DL_LIBS - # won't be set until we call TEA_CONFIG_CFLAGS - - TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' - - - - - echo "$as_me:$LINENO: checking dirent.h" >&5 -echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 -if test "${tcl_cv_dirent_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ - -#ifndef _POSIX_SOURCE -# ifdef __Lynx__ - /* - * Generate compilation error to make the test fail: Lynx headers - * are only valid if really in the POSIX environment. - */ - - missing_procedure(); -# endif -#endif -DIR *d; -struct dirent *entryPtr; -char *p; -d = opendir("foobar"); -entryPtr = readdir(d); -p = entryPtr->d_name; -closedir(d); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_dirent_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_dirent_h=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 -echo "${ECHO_T}$tcl_cv_dirent_h" >&6 - - if test $tcl_cv_dirent_h = no; then - -cat >>confdefs.h <<\_ACEOF -#define NO_DIRENT_H 1 -_ACEOF - - fi - - if test "${ac_cv_header_errno_h+set}" = set; then - echo "$as_me:$LINENO: checking for errno.h" >&5 -echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_errno_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking errno.h usability" >&5 -echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking errno.h presence" >&5 -echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclsdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for errno.h" >&5 -echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_errno_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_errno_h" >&6 - -fi -if test $ac_cv_header_errno_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_ERRNO_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_float_h+set}" = set; then - echo "$as_me:$LINENO: checking for float.h" >&5 -echo $ECHO_N "checking for float.h... $ECHO_C" >&6 -if test "${ac_cv_header_float_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 -echo "${ECHO_T}$ac_cv_header_float_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking float.h usability" >&5 -echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking float.h presence" >&5 -echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclsdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for float.h" >&5 -echo $ECHO_N "checking for float.h... $ECHO_C" >&6 -if test "${ac_cv_header_float_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_float_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 -echo "${ECHO_T}$ac_cv_header_float_h" >&6 - -fi -if test $ac_cv_header_float_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_FLOAT_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_values_h+set}" = set; then - echo "$as_me:$LINENO: checking for values.h" >&5 -echo $ECHO_N "checking for values.h... $ECHO_C" >&6 -if test "${ac_cv_header_values_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 -echo "${ECHO_T}$ac_cv_header_values_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking values.h usability" >&5 -echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking values.h presence" >&5 -echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclsdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for values.h" >&5 -echo $ECHO_N "checking for values.h... $ECHO_C" >&6 -if test "${ac_cv_header_values_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_values_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 -echo "${ECHO_T}$ac_cv_header_values_h" >&6 - -fi -if test $ac_cv_header_values_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_VALUES_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_limits_h+set}" = set; then - echo "$as_me:$LINENO: checking for limits.h" >&5 -echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 -if test "${ac_cv_header_limits_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 -echo "${ECHO_T}$ac_cv_header_limits_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking limits.h usability" >&5 -echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking limits.h presence" >&5 -echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclsdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for limits.h" >&5 -echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 -if test "${ac_cv_header_limits_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_limits_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 -echo "${ECHO_T}$ac_cv_header_limits_h" >&6 - -fi -if test $ac_cv_header_limits_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIMITS_H 1 -_ACEOF - -else - -cat >>confdefs.h <<\_ACEOF -#define NO_LIMITS_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_stdlib_h+set}" = set; then - echo "$as_me:$LINENO: checking for stdlib.h" >&5 -echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking stdlib.h usability" >&5 -echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking stdlib.h presence" >&5 -echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclsdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for stdlib.h" >&5 -echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_stdlib_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 - -fi -if test $ac_cv_header_stdlib_h = yes; then - tcl_ok=1 -else - tcl_ok=0 -fi - - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtol" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtoul" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtod" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - if test $tcl_ok = 0; then - -cat >>confdefs.h <<\_ACEOF -#define NO_STDLIB_H 1 -_ACEOF - - fi - if test "${ac_cv_header_string_h+set}" = set; then - echo "$as_me:$LINENO: checking for string.h" >&5 -echo $ECHO_N "checking for string.h... $ECHO_C" >&6 -if test "${ac_cv_header_string_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 -echo "${ECHO_T}$ac_cv_header_string_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking string.h usability" >&5 -echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking string.h presence" >&5 -echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclsdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for string.h" >&5 -echo $ECHO_N "checking for string.h... $ECHO_C" >&6 -if test "${ac_cv_header_string_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_string_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 -echo "${ECHO_T}$ac_cv_header_string_h" >&6 - -fi -if test $ac_cv_header_string_h = yes; then - tcl_ok=1 -else - tcl_ok=0 -fi - - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strstr" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strerror" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - - # See also memmove check below for a place where NO_STRING_H can be - # set and why. - - if test $tcl_ok = 0; then - -cat >>confdefs.h <<\_ACEOF -#define NO_STRING_H 1 -_ACEOF - - fi - - if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo "$as_me:$LINENO: checking for sys/wait.h" >&5 -echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 -if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 -echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 -echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclsdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for sys/wait.h" >&5 -echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 -if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_sys_wait_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 - -fi -if test $ac_cv_header_sys_wait_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_SYS_WAIT_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_dlfcn_h+set}" = set; then - echo "$as_me:$LINENO: checking for dlfcn.h" >&5 -echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 -if test "${ac_cv_header_dlfcn_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 -echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 -echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 -echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclsdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for dlfcn.h" >&5 -echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 -if test "${ac_cv_header_dlfcn_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_dlfcn_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 -echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 - -fi -if test $ac_cv_header_dlfcn_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_DLFCN_H 1 -_ACEOF - -fi - - - - # OS/390 lacks sys/param.h (and doesn't need it, by chance). - -for ac_header in sys/param.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to the xotclsdbm lists. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - # Let the user call this, because if it triggers, they will - # need a compat/strtod.c that is correct. Users can also - # use Tcl_GetDouble(FromObj) instead. - #TEA_BUGGY_STRTOD - fi - - -#-------------------------------------------------------------------- -# Load the xotclConfig.sh file -#-------------------------------------------------------------------- - -{ echo "$as_me:$LINENO: Reading file ${with_xotcl}/xotclConfig.sh" >&5 -echo "$as_me: Reading file ${with_xotcl}/xotclConfig.sh" >&6;} -source ${with_xotcl}/xotclConfig.sh - -#----------------------------------------------------------------------- -# __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. -#----------------------------------------------------------------------- - - - vars="hash.c pair.c sdbm.c xotclsdbm.c" - for i in $vars; do - case $i in - \$*) - # allow $-var names - PKG_SOURCES="$PKG_SOURCES $i" - PKG_OBJECTS="$PKG_OBJECTS $i" - ;; - *) - # check for existence - allows for generic/win/unix VPATH - # To add more dirs here (like 'src'), you have to update VPATH - # in Makefile.in as well - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 -echo "$as_me: error: could not find source file '$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_SOURCES="$PKG_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" - fi - PKG_OBJECTS="$PKG_OBJECTS $j" - ;; - esac - done - - - - - vars="" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 -echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_HEADERS="$PKG_HEADERS $i" - done - - - - vars="-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC}" - for i in $vars; do - PKG_INCLUDES="$PKG_INCLUDES $i" - done - - - - vars="$XOTCL_BUILD_STUB_LIB_SPEC $XOTCL_BUILD_LIB_SPEC" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - - - - PKG_CFLAGS="$PKG_CFLAGS " - - - - vars="" - for i in $vars; do - # check for existence - allows for generic/win/unix VPATH - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 -echo "$as_me: error: could not find stub source file '$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" - fi - PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" - done - - - - - vars="" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 -echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" - done - - - -#-------------------------------------------------------------------- -# __CHANGE__ -# A few miscellaneous platform-specific items: -# -# Define a special symbol for Windows (BUILD_sample in this case) so -# that we create the export library with the dll. -# -# 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. -# -# TEA_ADD_* any platform specific compiler/build info here. -#-------------------------------------------------------------------- - -if test "${TEA_PLATFORM}" = "windows" ; then - cat >>confdefs.h <<\_ACEOF -#define BUILD_sample 1 -_ACEOF - - CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" - #TEA_ADD_SOURCES([win/winFile.c]) - #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) -else - CLEANFILES="pkgIndex.tcl" - #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 -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking for Tcl public headers" >&5 -echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 - - -# Check whether --with-tclinclude or --without-tclinclude was given. -if test "${with_tclinclude+set}" = set; then - withval="$with_tclinclude" - with_tclinclude=${withval} -fi; - - if test "${ac_cv_c_tclh+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - # Use the value from --with-tclinclude, if it was given - - if test x"${with_tclinclude}" != x ; then - if test -f "${with_tclinclude}/tcl.h" ; then - ac_cv_c_tclh=${with_tclinclude} - else - { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 -echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} - { (exit 1); exit 1; }; } - fi - else - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers directory - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tcl is not installed, - # and in that situation, look there before installed locations. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - if test x"${TCL_INCLUDE_SPEC}" != x ; then - d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` - list="$list `ls -d ${d} 2>/dev/null`" - fi - fi - for i in $list ; do - if test -f "$i/tcl.h" ; then - ac_cv_c_tclh=$i - break - fi - done - fi - -fi - - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tclh}" = x ; then - { { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 -echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} - { (exit 1); exit 1; }; } - else - echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 -echo "${ECHO_T}${ac_cv_c_tclh}" >&6 - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` - - TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - - -#TEA_PRIVATE_TCL_HEADERS - -#TEA_PUBLIC_TK_HEADERS -#TEA_PRIVATE_TK_HEADERS -#TEA_PATH_X - -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -#-------------------------------------------------------------------- - - - # Check whether --enable-threads or --disable-threads was given. -if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval -else - tcl_ok=yes -fi; - - if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then - TCL_THREADS=1 - - if test "${TEA_PLATFORM}" != "windows" ; then - # We are always OK on Windows, so check what this platform wants: - - # USE_THREAD_ALLOC tells us to try the special thread-based - # allocator that significantly reduces lock contention - -cat >>confdefs.h <<\_ACEOF -#define USE_THREAD_ALLOC 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - if test "`uname -s`" = "SunOS" ; then - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - fi - -cat >>confdefs.h <<\_ACEOF -#define _THREAD_SAFE 1 -_ACEOF - - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 -if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthread_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthread_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 -if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "no"; then - # Check a little harder for __pthread_mutex_init in the same - # library, as some systems hide it there until pthread.h is - # defined. We could alternatively do an AC_TRY_COMPILE with - # pthread.h, but that will work with libpthread really doesn't - # exist, like AIX 4.2. [Bug: 4359] - echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 -echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 -if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char __pthread_mutex_init (); -int -main () -{ -__pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthread___pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthread___pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 -if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthread" - else - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 -if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthreads $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthreads_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthreads_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 -if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthreads" - else - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 -if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_c_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_c_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 -if test $ac_cv_lib_c_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "no"; then - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 -if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc_r $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_c_r_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_c_r_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 -if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -pthread" - else - TCL_THREADS=0 - { echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 -echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} - fi - fi - fi - fi - fi - else - TCL_THREADS=0 - fi - # Do checking message here to not mess up interleaved configure output - echo "$as_me:$LINENO: checking for building with threads" >&5 -echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 - if test "${TCL_THREADS}" = 1; then - -cat >>confdefs.h <<\_ACEOF -#define TCL_THREADS 1 -_ACEOF - - echo "$as_me:$LINENO: result: yes (default)" >&5 -echo "${ECHO_T}yes (default)" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - # TCL_THREADS sanity checking. See if our request for building with - # threads is the same as the way Tcl was built. If not, warn the user. - case ${TCL_DEFS} in - *THREADS=1*) - if test "${TCL_THREADS}" = "0"; then - { echo "$as_me:$LINENO: WARNING: - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads." >&5 -echo "$as_me: WARNING: - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads." >&2;} - fi - ;; - *) - if test "${TCL_THREADS}" = "1"; then - { echo "$as_me:$LINENO: WARNING: - --enable-threads requested, but building against a Tcl that is NOT - thread-enabled. This is an OK configuration that will also run in - a thread-enabled core." >&5 -echo "$as_me: WARNING: - --enable-threads requested, but building against a Tcl that is NOT - thread-enabled. This is an OK configuration that will also run in - a thread-enabled core." >&2;} - fi - ;; - esac - - - -#-------------------------------------------------------------------- -# The statement below defines a collection of symbols related to -# building as a shared library instead of a static library. -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking how to build libraries" >&5 -echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 - # Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval -else - tcl_ok=yes -fi; - - if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" ; then - echo "$as_me:$LINENO: result: shared" >&5 -echo "${ECHO_T}shared" >&6 - SHARED_BUILD=1 - else - echo "$as_me:$LINENO: result: static" >&5 -echo "${ECHO_T}static" >&6 - SHARED_BUILD=0 - -cat >>confdefs.h <<\_ACEOF -#define STATIC_BUILD 1 -_ACEOF - - fi - - - -#-------------------------------------------------------------------- -# 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. -#-------------------------------------------------------------------- - - - - - # Step 0.a: Enable 64 bit support? - - echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 -echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 - # Check whether --enable-64bit or --disable-64bit was given. -if test "${enable_64bit+set}" = set; then - enableval="$enable_64bit" - do64bit=$enableval -else - do64bit=no -fi; - echo "$as_me:$LINENO: result: $do64bit" >&5 -echo "${ECHO_T}$do64bit" >&6 - - # Step 0.b: Enable Solaris 64 bit VIS support? - - echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 -echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 - # Check whether --enable-64bit-vis or --disable-64bit-vis was given. -if test "${enable_64bit_vis+set}" = set; then - enableval="$enable_64bit_vis" - do64bitVIS=$enableval -else - do64bitVIS=no -fi; - echo "$as_me:$LINENO: result: $do64bitVIS" >&5 -echo "${ECHO_T}$do64bitVIS" >&6 - - if test "$do64bitVIS" = "yes"; then - # Force 64bit on with VIS - do64bit=yes - fi - - # Step 0.c: Cross-compiling options for Windows/CE builds? - - if test "${TEA_PLATFORM}" = "windows" ; then - echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 -echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 - # Check whether --enable-wince or --disable-wince was given. -if test "${enable_wince+set}" = set; then - enableval="$enable_wince" - doWince=$enableval -else - doWince=no -fi; - echo "$as_me:$LINENO: result: $doWince" >&5 -echo "${ECHO_T}$doWince" >&6 - fi - - # Step 1: set the variable "system" to hold the name and version number - # for the system. - - - echo "$as_me:$LINENO: checking system version" >&5 -echo $ECHO_N "checking system version... $ECHO_C" >&6 -if test "${tcl_cv_sys_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - if test "${TEA_PLATFORM}" = "windows" ; then - tcl_cv_sys_version=windows - elif test -f /usr/lib/NextStep/software_version; then - tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` - else - tcl_cv_sys_version=`uname -s`-`uname -r` - if test "$?" -ne 0 ; then - { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 -echo "$as_me: WARNING: can't find uname command" >&2;} - tcl_cv_sys_version=unknown - else - # Special check for weird MP-RAS system (uname returns weird - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` - fi - if test "`uname -s`" = "AIX" ; then - tcl_cv_sys_version=AIX-`uname -v`.`uname -r` - fi - fi - fi - -fi -echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 -echo "${ECHO_T}$tcl_cv_sys_version" >&6 - system=$tcl_cv_sys_version - - - # Step 2: check for existence of -ldl library. This is needed because - # Linux can use either -ldl or -ldld for dynamic loading. - - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - have_dl=yes -else - have_dl=no -fi - - - # Require ranlib early so we can override it in special cases below. - - - - # Step 3: set configuration options based on system name and version. - # This is similar to Tcl's unix/tcl.m4 except that we've added a - # "windows" case. - - do64bit_ok=no - LDFLAGS_ORIG="$LDFLAGS" - # When ld needs options to work in 64-bit mode, put them in - # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] - # is disabled by the user. [Bug 1016796] - LDFLAGS_ARCH="" - TCL_EXPORT_FILE_SUFFIX="" - UNSHARED_LIB_SUFFIX="" - TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' - ECHO_VERSION='`echo ${PACKAGE_VERSION}`' - TCL_LIB_VERSIONS_OK=ok - CFLAGS_DEBUG=-g - CFLAGS_OPTIMIZE=-O - if test "$GCC" = "yes" ; then - CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wno-implicit-int" - else - CFLAGS_WARNING="" - fi - TCL_NEEDS_EXP_FILE=0 - TCL_BUILD_EXP_FILE="" - TCL_EXP_FILE="" - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - STLIB_LD='${AR} cr' - LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" - case $system in - windows) - # This is a 2-stage check to make sure we have the 64-bit SDK - # We have to know where the SDK is installed. - # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs - # MACHINE is IX86 for LINK, but this is used by the manifest, - # which requires x86|amd64|ia64. - MACHINE="X86" - if test "$do64bit" != "no" ; then - if test "x${MSSDK}x" = "xx" ; then - MSSDK="C:/Progra~1/Microsoft Platform SDK" - fi - MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` - PATH64="" - case "$do64bit" in - amd64|x64|yes) - MACHINE="AMD64" ; # default to AMD64 64-bit build - PATH64="${MSSDK}/Bin/Win64/x86/AMD64" - ;; - ia64) - MACHINE="IA64" - PATH64="${MSSDK}/Bin/Win64" - ;; - esac - if test ! -d "${PATH64}" ; then - { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 -echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} - { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 -echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} - do64bit="no" - else - echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 -echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 - do64bit_ok="yes" - fi - fi - - if test "$doWince" != "no" ; then - if test "$do64bit" != "no" ; then - { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 -echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} - { (exit 1); exit 1; }; } - fi - if test "$GCC" = "yes" ; then - { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 -echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} - { (exit 1); exit 1; }; } - fi - - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-celib - - if test x"${no_celib}" = x ; then - # we reset no_celib in case something fails here - no_celib=true - -# Check whether --with-celib or --without-celib was given. -if test "${with_celib+set}" = set; then - withval="$with_celib" - with_celibconfig=${withval} -fi; - echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 -echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 - if test "${ac_cv_c_celibconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - # First check to see if --with-celibconfig was specified. - if test x"${with_celibconfig}" != x ; then - if test -d "${with_celibconfig}/inc" ; then - ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` - else - { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 -echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} - { (exit 1); exit 1; }; } - fi - fi - - # then check for a celib library - if test x"${ac_cv_c_celibconfig}" = x ; then - for i in \ - ../celib-palm-3.0 \ - ../celib \ - ../../celib-palm-3.0 \ - ../../celib \ - `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ - ${srcdir}/../celib-palm-3.0 \ - ${srcdir}/../celib \ - `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ - ; do - if test -d "$i/inc" ; then - ac_cv_c_celibconfig=`(cd $i; pwd)` - break - fi - done - fi - -fi - - if test x"${ac_cv_c_celibconfig}" = x ; then - { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 -echo "$as_me: error: Cannot find celib support library directory" >&2;} - { (exit 1); exit 1; }; } - else - no_celib= - CELIB_DIR=${ac_cv_c_celibconfig} - CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` - echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 -echo "${ECHO_T}found $CELIB_DIR" >&6 - fi - fi - - # Set defaults for common evc4/PPC2003 setup - # Currently Tcl requires 300+, possibly 420+ for sockets - CEVERSION=420; # could be 211 300 301 400 420 ... - TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... - ARCH=ARM; # could be ARM MIPS X86EM ... - PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" - if test "$doWince" != "yes"; then - # If !yes then the user specified something - # Reset ARCH to allow user to skip specifying it - ARCH= - eval `echo $doWince | awk -F, '{ \ - if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ - if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ - if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ - if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ - if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ - }'` - if test "x${ARCH}" = "x" ; then - ARCH=$TARGETCPU; - fi - fi - OSVERSION=WCE$CEVERSION; - if test "x${WCEROOT}" = "x" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" - if test ! -d "${WCEROOT}" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded Tools" - fi - fi - if test "x${SDKROOT}" = "x" ; then - SDKROOT="C:/Program Files/Windows CE Tools" - if test ! -d "${SDKROOT}" ; then - SDKROOT="C:/Windows CE Tools" - fi - fi - WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` - SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` - if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ - -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then - { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 -echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} - { (exit 1); exit 1; }; } - doWince="no" - else - # We could PATH_NOSPACE these, but that's not important, - # as long as we quote them when used. - CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" - if test -d "${CEINCLUDE}/${TARGETCPU}" ; then - CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" - fi - CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" - fi - fi - - if test "$GCC" != "yes" ; then - if test "${SHARED_BUILD}" = "0" ; then - runtime=-MT - else - runtime=-MD - fi - - if test "$do64bit" != "no" ; then - # All this magic is necessary for the Win64 SDK RC1 - hobbs - CC="\"${PATH64}/cl.exe\"" - CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" - RC="\"${MSSDK}/bin/rc.exe\"" - lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" - LINKBIN="\"${PATH64}/link.exe\"" - CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - # Avoid 'unresolved external symbol __security_cookie' - # errors, c.f. http://support.microsoft.com/?id=894573 - - vars="bufferoverflowU.lib" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - - - elif test "$doWince" != "no" ; then - CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" - if test "${TARGETCPU}" = "X86"; then - CC="\"${CEBINROOT}/cl.exe\"" - else - CC="\"${CEBINROOT}/cl${ARCH}.exe\"" - fi - CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" - RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" - arch=`echo ${ARCH} | awk '{print tolower($0)}'` - defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" - if test "${SHARED_BUILD}" = "1" ; then - # Static CE builds require static celib as well - defs="${defs} _DLL" - fi - for i in $defs ; do - -cat >>confdefs.h <<_ACEOF -#define $i 1 -_ACEOF - - done - -cat >>confdefs.h <<_ACEOF -#define _WIN32_WCE $CEVERSION -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define UNDER_CE $CEVERSION -_ACEOF - - CFLAGS_DEBUG="-nologo -Zi -Od" - CFLAGS_OPTIMIZE="-nologo -Ox" - lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` - lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" - LINKBIN="\"${CEBINROOT}/link.exe\"" - - else - RC="rc" - lflags="-nologo" - LINKBIN="link" - CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - fi - fi - - if test "$GCC" = "yes"; then - # mingw gcc mode - RC="windres" - CFLAGS_DEBUG="-g" - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - SHLIB_LD="$CC -shared" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" - LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" - else - SHLIB_LD="${LINKBIN} -dll ${lflags}" - # link -lib only works when -lib is the first arg - STLIB_LD="${LINKBIN} -lib ${lflags}" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' - PATHTYPE=-w - # For information on what debugtype is most useful, see: - # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp - # This essentially turns it all on. - LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" - LDFLAGS_OPTIMIZE="-release" - if test "$doWince" != "no" ; then - LDFLAGS_CONSOLE="-link ${lflags}" - LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} - else - LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" - LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" - fi - fi - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dll" - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' - - TCL_LIB_VERSIONS_OK=nodots - # Bogus to avoid getting this turned off - DL_OBJS="tclLoadNone.obj" - ;; - AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then - # AIX requires the _r compiler when gcc isn't being used - case "${CC}" in - *_r) - # ok ... - ;; - *) - CC=${CC}_r - ;; - esac - echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 -echo "${ECHO_T}Using $CC for compiling with threads" >&6 - fi - LIBS="$LIBS -lc" - SHLIB_CFLAGS="" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - DL_OBJS="tclLoadDl.o" - LD_LIBRARY_PATH_VAR="LIBPATH" - - # Check to enable 64-bit flags for compiler/linker on AIX 4+ - if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then - if test "$GCC" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} - else - do64bit_ok=yes - CFLAGS="$CFLAGS -q64" - LDFLAGS_ARCH="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi - - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - else - SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - fi - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' - fi - - # AIX v<=4.1 has some different flags than 4.2+ - if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then - case $LIBOBJS in - "tclLoadAix.$ac_objext" | \ - *" tclLoadAix.$ac_objext" | \ - "tclLoadAix.$ac_objext "* | \ - *" tclLoadAix.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; -esac - - DL_LIBS="-lld" - fi - - # On AIX <=v4 systems, libbsd.a has to be linked in to support - # non-blocking file IO. This library has to be linked in after - # the MATH_LIBS or it breaks the pow() function. The way to - # insure proper sequencing, is to add it to the tail of MATH_LIBS. - # This library also supplies gettimeofday. - # - # AIX does not have a timezone field in struct tm. When the AIX - # bsd library is used, the timezone global and the gettimeofday - # methods are to be avoided for timezone deduction instead, we - # deduce the timezone by comparing the localtime result on a - # known GMT value. - - echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 -echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 -if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbsd $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gettimeofday (); -int -main () -{ -gettimeofday (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_bsd_gettimeofday=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_bsd_gettimeofday=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 -if test $ac_cv_lib_bsd_gettimeofday = yes; then - libbsd=yes -else - libbsd=no -fi - - if test $libbsd = yes; then - MATH_LIBS="$MATH_LIBS -lbsd" - -cat >>confdefs.h <<\_ACEOF -#define USE_DELTA_FOR_TZ 1 -_ACEOF - - fi - ;; - BeOS*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC} -nostart" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - - #----------------------------------------------------------- - # Check for inet_ntoa in -lbind, for BeOS (which also needs - # -lsocket, even if the network functions are in -lnet which - # is always linked to, for compatibility. - #----------------------------------------------------------- - echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 -echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 -if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbind $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char inet_ntoa (); -int -main () -{ -inet_ntoa (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_bind_inet_ntoa=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_bind_inet_ntoa=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 -if test $ac_cv_lib_bind_inet_ntoa = yes; then - LIBS="$LIBS -lbind -lsocket" -fi - - ;; - BSD/OS-2.1*|BSD/OS-3*) - SHLIB_CFLAGS="" - SHLIB_LD="shlicc -r" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - BSD/OS-4.*) - SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="cc -shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - dgux*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - HP-UX-*.11.*) - # Use updated header definitions where possible - -cat >>confdefs.h <<\_ACEOF -#define _XOPEN_SOURCE_EXTENDED 1 -_ACEOF - - # Needed by Tcl, but not most extensions - #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) - #LIBS="$LIBS -lxnet" # Use the XOPEN network library - - if test "`uname -m`" = "ia64" ; then - SHLIB_SUFFIX=".so" - # Use newer C++ library for C++ extensions - #if test "$GCC" != "yes" ; then - # CPPFLAGS="-AA" - #fi - else - SHLIB_SUFFIX=".sl" - fi - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS='${LIBS}' - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - SHLIB_LD_LIBS='${LIBS}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - - # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc - #CFLAGS="$CFLAGS +DAportable" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - hpux_arch=`${CC} -dumpmachine` - case $hpux_arch in - hppa64*) - # 64-bit gcc in use. Fix flags for GNU ld. - do64bit_ok=yes - SHLIB_LD="${CC} -shared" - SHLIB_LD_LIBS='${LIBS}' - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ;; - *) - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} - ;; - esac - else - do64bit_ok=yes - CFLAGS="$CFLAGS +DD64" - LDFLAGS_ARCH="+DD64" - fi - fi - ;; - HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) - SHLIB_SUFFIX=".sl" - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS="" - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - ;; - IRIX-5.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - ;; - IRIX-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mabi=n32" - LDFLAGS="$LDFLAGS -mabi=n32" - else - case $system in - IRIX-6.3) - # Use to build 6.2 compatible binaries on 6.3. - CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" - ;; - *) - CFLAGS="$CFLAGS -n32" - ;; - esac - LDFLAGS="$LDFLAGS -n32" - fi - ;; - IRIX64-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - - # Check to enable 64-bit flags for compiler/linker - - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 -echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} - else - do64bit_ok=yes - SHLIB_LD="ld -64 -shared -rdata_shared" - CFLAGS="$CFLAGS -64" - LDFLAGS_ARCH="-64" - fi - fi - ;; - Linux*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings - # when you inline the string and math operations. Turn this off to - # get rid of the warnings. - #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" - - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - if test $do64bit = yes; then - echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_m64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -m64" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_m64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_m64=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 -echo "${ECHO_T}$tcl_cv_cc_m64" >&6 - if test $tcl_cv_cc_m64 = yes; then - CFLAGS="$CFLAGS -m64" - do64bit_ok=yes - fi - fi - - # The combo of gcc + glibc has a bug related - # to inlining of functions like strtod(). The - # -fno-builtin flag should address this problem - # but it does not work. The -fno-inline flag - # is kind of overkill but it works. - # Disable inlining only when one of the - # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x ; then - CFLAGS="$CFLAGS -fno-inline" - fi - - ;; - GNU*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - SHLIB_LD="${CC} -shared" - DL_OBJS="" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - ;; - Lynx*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - CFLAGS_OPTIMIZE=-02 - SHLIB_LD="${CC} -shared " - DL_OBJS="tclLoadDl.o" - DL_LIBS="-mshared -ldl" - LD_FLAGS="-Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - ;; - MP-RAS-02*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - MP-RAS-*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,-Bexport" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - NetBSD-*|FreeBSD-[1-2].*) - # NetBSD/SPARC needs -fPIC, -fpic will not do. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - echo "$as_me:$LINENO: checking for ELF" >&5 -echo $ECHO_N "checking for ELF... $ECHO_C" >&6 -if test "${tcl_cv_ld_elf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef __ELF__ - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - tcl_cv_ld_elf=yes -else - tcl_cv_ld_elf=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 -echo "${ECHO_T}$tcl_cv_ld_elf" >&6 - if test $tcl_cv_ld_elf = yes; then - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - else - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - fi - - # Ancient FreeBSD doesn't handle version numbers with dots. - - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - OpenBSD-*) - # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. - case `machine` in - sparc|sparc64) - SHLIB_CFLAGS="-fPIC";; - *) - SHLIB_CFLAGS="-fpic";; - esac - SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - echo "$as_me:$LINENO: checking for ELF" >&5 -echo $ECHO_N "checking for ELF... $ECHO_C" >&6 -if test "${tcl_cv_ld_elf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef __ELF__ - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - tcl_cv_ld_elf=yes -else - tcl_cv_ld_elf=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 -echo "${ECHO_T}$tcl_cv_ld_elf" >&6 - if test $tcl_cv_ld_elf = yes; then - LDFLAGS=-Wl,-export-dynamic - else - LDFLAGS="" - fi - - # OpenBSD doesn't do version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - FreeBSD-*) - # FreeBSD 3.* and greater have ELF. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "${TCL_THREADS}" = "1" ; then - # The -pthread needs to go in the CFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - case $system in - FreeBSD-3.*) - # FreeBSD-3 doesn't handle version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - TCL_LIB_VERSIONS_OK=nodots - ;; - esac - ;; - Darwin-*) - CFLAGS_OPTIMIZE="-Os" - SHLIB_CFLAGS="-fno-common" - # To avoid discrepancies between what headers configure sees during - # preprocessing tests and compiling tests, move any -isysroot and - # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: - CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" - CFLAGS="`echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" - if test $do64bit = yes; then - case `arch` in - ppc) - echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_arch_ppc64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_arch_ppc64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_arch_ppc64=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 -echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 - if test $tcl_cv_cc_arch_ppc64 = yes; then - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - do64bit_ok=yes - fi;; - i386) - echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_arch_x86_64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch x86_64" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_arch_x86_64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_arch_x86_64=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 -echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 - if test $tcl_cv_cc_arch_x86_64 = yes; then - CFLAGS="$CFLAGS -arch x86_64" - do64bit_ok=yes - fi;; - *) - { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 -echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; - esac - else - # Check for combined 32-bit and 64-bit fat build - echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ - echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ - fat_32_64=yes - fi - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' - echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 -echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_single_module+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_single_module=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_single_module=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 -echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 - if test $tcl_cv_ld_single_module = yes; then - SHLIB_LD="${SHLIB_LD} -Wl,-single_module" - fi - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dylib" - DL_OBJS="tclLoadDyld.o" - DL_LIBS="" - # Don't use -prebind when building for Mac OS X 10.4 or later only: - test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ - "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \ - LDFLAGS="$LDFLAGS -prebind" - LDFLAGS="$LDFLAGS -headerpad_max_install_names" - echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 -echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_search_paths_first+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_search_paths_first=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_search_paths_first=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 -echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 - if test $tcl_cv_ld_search_paths_first = yes; then - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" - - # TEA specific: for Tk extensions, remove 64-bit arch flags from - # CFLAGS et al. for combined 32 & 64 bit fat builds as neither - # TkAqua nor TkX11 can be built for 64-bit at present. - test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done - ;; - NEXTSTEP-*) - SHLIB_CFLAGS="" - SHLIB_LD="cc -nostdlib -r" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadNext.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OS/390-*) - CFLAGS_OPTIMIZE="" # Optimizer is buggy - -cat >>confdefs.h <<\_ACEOF -#define _OE_SOCKETS 1 -_ACEOF - - ;; - OSF1-1.0|OSF1-1.1|OSF1-1.2) - # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 - SHLIB_CFLAGS="" - # Hack: make package name same as library name - SHLIB_LD='ld -R -export :' - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadOSF.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-1.*) - # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - SHLIB_CFLAGS="-fPIC" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD="ld -shared" - else - SHLIB_LD="ld -non_shared" - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-V*) - # Digital OSF/1 - SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD='ld -shared -expect_unresolved "*"' - else - SHLIB_LD='ld -non_shared -expect_unresolved "*"' - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mieee" - else - CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" - fi - # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = "1" ; then - CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" - CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" - LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = "yes" ; then - LIBS="$LIBS -lpthread -lmach -lexc" - else - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - fi - - ;; - QNX-6*) - # QNX RTP - # This may work for all QNX, but it was only reported for v6. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - # dlopen is in -lc on QNX - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SCO_SV-3.2*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, - # this test works, since "uname -s" was non-standard in 3.2.4 and - # below. - if test "$GCC" = "yes" ; then - SHLIB_CFLAGS="-fPIC -melf" - LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" - else - SHLIB_CFLAGS="-Kpic -belf" - LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" - fi - SHLIB_LD="ld -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SINIX*5.4*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SunOS-4*) - SHLIB_CFLAGS="-PIC" - SHLIB_LD="ld" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - - # SunOS can't handle version numbers with dots in them in library - # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it - # requires an extra version number at the end of .so file names. - # So, the library has to have a name like libtcl75.so.1.0 - - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - SunOS-5.[0-6]) - # Careful to not let 5.10+ fall into this case - - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - - SHLIB_CFLAGS="-KPIC" - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - ;; - SunOS-5*) - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - - SHLIB_CFLAGS="-KPIC" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - arch=`isainfo` - if test "$arch" = "sparcv9 sparc" ; then - if test "$GCC" = "yes" ; then - if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} - else - do64bit_ok=yes - CFLAGS="$CFLAGS -m64 -mcpu=v9" - LDFLAGS="$LDFLAGS -m64 -mcpu=v9" - SHLIB_CFLAGS="-fPIC" - fi - else - do64bit_ok=yes - if test "$do64bitVIS" = "yes" ; then - CFLAGS="$CFLAGS -xarch=v9a" - LDFLAGS_ARCH="-xarch=v9a" - else - CFLAGS="$CFLAGS -xarch=v9" - LDFLAGS_ARCH="-xarch=v9" - fi - # Solaris 64 uses this as well - #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" - fi - elif test "$arch" = "amd64 i386" ; then - if test "$GCC" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} - else - do64bit_ok=yes - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64" - fi - else - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 -echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} - fi - fi - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = "yes" ; then - # We need to specify -static-libgcc or we need to - # add the path to the sparv9 libgcc. - # JH: static-libgcc is necessary for core Tcl, but may - # not be necessary for extensions. - SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" - # for finding sparcv9 libgcc, get the regular libgcc - # path, remove so name and append 'sparcv9' - #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." - #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" - fi - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - fi - ;; - UNIX_SV* | UnixWare-5*) - SHLIB_CFLAGS="-KPIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers - # that don't grok the -Bexport option. Test that it does. - echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 -echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_Bexport+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-Bexport" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_Bexport=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_Bexport=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 -echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 - if test $tcl_cv_ld_Bexport = yes; then - LDFLAGS="$LDFLAGS -Wl,-Bexport" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - esac - - if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then - { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 -echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} - fi - - - - # Step 4: disable dynamic loading if requested via a command-line switch. - - # Check whether --enable-load or --disable-load was given. -if test "${enable_load+set}" = set; then - enableval="$enable_load" - tcl_ok=$enableval -else - tcl_ok=yes -fi; - if test "$tcl_ok" = "no"; then - DL_OBJS="" - fi - - if test "x$DL_OBJS" != "x" ; then - BUILD_DLTEST="\$(DLTEST_TARGETS)" - else - echo "Can't figure out how to do dynamic loading or shared libraries" - echo "on this system." - SHLIB_CFLAGS="" - SHLIB_LD="" - SHLIB_SUFFIX="" - DL_OBJS="tclLoadNone.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS_ORIG" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - BUILD_DLTEST="" - fi - LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" - - # If we're running gcc, then change the C flags for compiling shared - # libraries to the right flags for gcc, instead of those for the - # standard manufacturer compiler. - - if test "$DL_OBJS" != "tclLoadNone.o" ; then - if test "$GCC" = "yes" ; then - case $system in - AIX-*) - ;; - BSD/OS*) - ;; - IRIX*) - ;; - NetBSD-*|FreeBSD-*) - ;; - Darwin-*) - ;; - SCO_SV-3.2*) - ;; - windows) - ;; - *) - SHLIB_CFLAGS="-fPIC" - ;; - esac - fi - fi - - if test "$SHARED_LIB_SUFFIX" = "" ; then - SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' - fi - if test "$UNSHARED_LIB_SUFFIX" = "" ; then - UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' - fi - - - - - - - - - - - - - - - - # These must be called after we do the basic CFLAGS checks and - # verify any possible 64-bit or similar switches are necessary - - echo "$as_me:$LINENO: checking for required early compiler flags" >&5 -echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 - tcl_flags="" - - if test "${tcl_cv_flag__isoc99_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *)strtoll; char *q = (char *)strtoull; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__isoc99_source=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _ISOC99_SOURCE 1 -#include -int -main () -{ -char *p = (char *)strtoll; char *q = (char *)strtoull; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__isoc99_source=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__isoc99_source=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define _ISOC99_SOURCE 1 -_ACEOF - - tcl_flags="$tcl_flags _ISOC99_SOURCE" - fi - - - if test "${tcl_cv_flag__largefile64_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -struct stat64 buf; int i = stat64("/", &buf); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile64_source=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGEFILE64_SOURCE 1 -#include -int -main () -{ -struct stat64 buf; int i = stat64("/", &buf); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile64_source=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__largefile64_source=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define _LARGEFILE64_SOURCE 1 -_ACEOF - - tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" - fi - - - if test "${tcl_cv_flag__largefile_source64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *)open64; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile_source64=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGEFILE_SOURCE64 1 -#include -int -main () -{ -char *p = (char *)open64; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile_source64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__largefile_source64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define _LARGEFILE_SOURCE64 1 -_ACEOF - - tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" - fi - - if test "x${tcl_flags}" = "x" ; then - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 - else - echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 -echo "${ECHO_T}${tcl_flags}" >&6 - fi - - - echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 -echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 - if test "${tcl_cv_type_64bit+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - tcl_cv_type_64bit=none - # See if the compiler knows natively about __int64 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -__int64 value = (__int64) 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_type_64bit=__int64 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_type_64bit="long long" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - # See if we should use long anyway Note that we substitute in the - # type that is our current guess for a 64-bit type inside this check - # program, so it should be modified only carefully... - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -switch (0) { - case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; - } - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_type_64bit=${tcl_type_64bit} -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "${tcl_cv_type_64bit}" = none ; then - -cat >>confdefs.h <<\_ACEOF -#define TCL_WIDE_INT_IS_LONG 1 -_ACEOF - - echo "$as_me:$LINENO: result: using long" >&5 -echo "${ECHO_T}using long" >&6 - elif test "${tcl_cv_type_64bit}" = "__int64" \ - -a "${TEA_PLATFORM}" = "windows" ; then - # We actually want to use the default tcl.h checks in this - # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* - echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 -echo "${ECHO_T}using Tcl header defaults" >&6 - else - -cat >>confdefs.h <<_ACEOF -#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} -_ACEOF - - echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 -echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 - - # Now check for auxiliary declarations - echo "$as_me:$LINENO: checking for struct dirent64" >&5 -echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 -if test "${tcl_cv_struct_dirent64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ -struct dirent64 p; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_struct_dirent64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_struct_dirent64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 -echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 - if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_DIRENT64 1 -_ACEOF - - fi - - echo "$as_me:$LINENO: checking for struct stat64" >&5 -echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 -if test "${tcl_cv_struct_stat64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -struct stat64 p; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_struct_stat64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_struct_stat64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 -echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 - if test "x${tcl_cv_struct_stat64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_STAT64 1 -_ACEOF - - fi - - - -for ac_func in open64 lseek64 -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - echo "$as_me:$LINENO: checking for off64_t" >&5 -echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 - if test "${tcl_cv_type_off64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -off64_t offset; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_type_off64_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_type_off64_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_type_off64_t}" = "xyes" && \ - test "x${ac_cv_func_lseek64}" = "xyes" && \ - test "x${ac_cv_func_open64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_TYPE_OFF64_T 1 -_ACEOF - - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - fi - - - -#-------------------------------------------------------------------- -# Set the default compiler switches based on the --enable-symbols option. -#-------------------------------------------------------------------- - - - - echo "$as_me:$LINENO: checking for build with symbols" >&5 -echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 - # Check whether --enable-symbols or --disable-symbols was given. -if test "${enable_symbols+set}" = set; then - enableval="$enable_symbols" - tcl_ok=$enableval -else - tcl_ok=no -fi; - DBGX="" - if test "$tcl_ok" = "no"; then - CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" - LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - else - CFLAGS_DEFAULT="${CFLAGS_DEBUG}" - LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" - if test "$tcl_ok" = "yes"; then - echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 -echo "${ECHO_T}yes (standard debugging)" >&6 - fi - fi - if test "${TEA_PLATFORM}" != "windows" ; then - LDFLAGS_DEFAULT="${LDFLAGS}" - fi - - - - - - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - -cat >>confdefs.h <<\_ACEOF -#define TCL_MEM_DEBUG 1 -_ACEOF - - fi - - if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then - if test "$tcl_ok" = "all"; then - echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 -echo "${ECHO_T}enabled symbols mem debugging" >&6 - else - echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 -echo "${ECHO_T}enabled $tcl_ok debugging" >&6 - fi - 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. Add Tk too if necessary. -#-------------------------------------------------------------------- - -cat >>confdefs.h <<\_ACEOF -#define USE_TCL_STUBS 1 -_ACEOF - -#AC_DEFINE(USE_TK_STUBS) - -#-------------------------------------------------------------------- -# 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. -#-------------------------------------------------------------------- - - - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then - MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" - MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" - else - MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" - MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" - fi - - if test "${SHARED_BUILD}" = "1" ; then - MAKE_LIB="${MAKE_SHARED_LIB} " - else - MAKE_LIB="${MAKE_STATIC_LIB} " - fi - - #-------------------------------------------------------------------- - # Shared libraries and static libraries have different names. - # Use the double eval to make sure any variables in the suffix is - # substituted. (@@@ Might not be necessary anymore) - #-------------------------------------------------------------------- - - if test "${TEA_PLATFORM}" = "windows" ; then - if test "${SHARED_BUILD}" = "1" ; then - # We force the unresolved linking of symbols that are really in - # the private libraries of Tcl and Tk. - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" - fi - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - else - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - if test "$GCC" = "yes"; then - PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} - fi - # These aren't needed on Windows (either MSVC or gcc) - RANLIB=: - RANLIB_STUB=: - else - RANLIB_STUB="${RANLIB}" - if test "${SHARED_BUILD}" = "1" ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" - fi - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - fi - - # These are escaped so that only CFLAGS is picked up at configure time. - # The other values will be substituted at make time. - CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" - if test "${SHARED_BUILD}" = "1" ; then - CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" - fi - - - - - - - - -#-------------------------------------------------------------------- -# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl -# file during the install process. Don't run the TCLSH_PROG through -# ${CYGPATH} because it's being used directly by make. -# Require that we use a tclsh shell version 8.2 or later since earlier -# versions have bugs in the pkg_mkIndex routine. -# Add WISH as well if this is a Tk extension. -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking for tclsh" >&5 -echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 - if test -f "${TCL_BIN_DIR}/Makefile" ; then - # tclConfig.sh is in Tcl build directory - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="${TCL_BIN_DIR}/tclsh" - fi - else - # tclConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" - fi - list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${TCLSH_PROG}" ; then - REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" - fi - echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 -echo "${ECHO_T}${TCLSH_PROG}" >&6 - - -#TEA_PROG_WISH - -#-------------------------------------------------------------------- -# Finally, substitute all of the various values into the Makefile. -# You may alternatively have a special pkgIndex.tcl.in or other files -# which require substituting th AC variables in. Include these here. -#-------------------------------------------------------------------- - - ac_config_files="$ac_config_files Makefile" -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g -t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g -t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by xotclsdbm $as_me 1.2, which was -generated by GNU Autoconf 2.59. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to ." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -xotclsdbm config.status 1.2 -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2003 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - - - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CYGPATH@,$CYGPATH,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t -s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t -s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t -s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t -s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t -s,@PKG_HEADERS@,$PKG_HEADERS,;t t -s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t -s,@PKG_LIBS@,$PKG_LIBS,;t t -s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t -s,@TCL_VERSION@,$TCL_VERSION,;t t -s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t -s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t -s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t -s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t -s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t -s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t -s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t -s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t -s,@TCL_LIBS@,$TCL_LIBS,;t t -s,@TCL_DEFS@,$TCL_DEFS,;t t -s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t -s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t -s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@EGREP@,$EGREP,;t t -s,@MATH_LIBS@,$MATH_LIBS,;t t -s,@PKG_SOURCES@,$PKG_SOURCES,;t t -s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t -s,@CLEANFILES@,$CLEANFILES,;t t -s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t -s,@TCL_THREADS@,$TCL_THREADS,;t t -s,@SHARED_BUILD@,$SHARED_BUILD,;t t -s,@AR@,$AR,;t t -s,@CELIB_DIR@,$CELIB_DIR,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@DL_LIBS@,$DL_LIBS,;t t -s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t -s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t -s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t -s,@STLIB_LD@,$STLIB_LD,;t t -s,@SHLIB_LD@,$SHLIB_LD,;t t -s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t -s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t -s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t -s,@TCL_DBGX@,$TCL_DBGX,;t t -s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t -s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t -s,@MAKE_LIB@,$MAKE_LIB,;t t -s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t -s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t -s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t -s,@RANLIB_STUB@,$RANLIB_STUB,;t t -s,@TCLSH_PROG@,$TCLSH_PROG,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: xotcl/library/store/XOTclSdbm/configure.in =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/configure.in (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/library/store/XOTclSdbm/configure.in (revision 0) @@ -1,244 +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. -# -# RCS: @(#) $Id: configure.in,v 1.20 2007/10/12 19:53:32 neumann Exp $ - -#----------------------------------------------------------------------- -# Sample configure.in for Tcl Extensions. The only places you should -# need to modify this file are marked by the string __CHANGE__ -#----------------------------------------------------------------------- - -configdir=$(srcdir)/../../../config - -#----------------------------------------------------------------------- -# __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. -#----------------------------------------------------------------------- - -AC_INIT([xotclsdbm], [1.2]) - -#-------------------------------------------------------------------- -# 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([3.5]) - -AC_CONFIG_AUX_DIR(../../../config) - -#-------------------------------------------------------------------- -# specify some extra flags -#-------------------------------------------------------------------- - -AC_ARG_WITH(xotcl, - [ --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH - absolute path to xotclConfig.sh, - --without-xotcl disables, but this is pointless], - [with_xotcl=$withval], [AC_MSG_ERROR([--with-xotcl is required])]) - -#-------------------------------------------------------------------- -# 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 - -#----------------------------------------------------------------------- -# 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, AC_PROG_INSTALL and a few others to create -# the basic setup necessary to compile executables. -#----------------------------------------------------------------------- - -TEA_SETUP_COMPILER - -#-------------------------------------------------------------------- -# Load the xotclConfig.sh file -#-------------------------------------------------------------------- - -AC_MSG_NOTICE([Reading file ${with_xotcl}/xotclConfig.sh]) -source ${with_xotcl}/xotclConfig.sh - -#----------------------------------------------------------------------- -# __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([hash.c pair.c sdbm.c xotclsdbm.c]) -TEA_ADD_HEADERS([]) -TEA_ADD_INCLUDES([-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC}]) -TEA_ADD_LIBS([$XOTCL_BUILD_STUB_LIB_SPEC $XOTCL_BUILD_LIB_SPEC]) -TEA_ADD_CFLAGS([]) -TEA_ADD_STUB_SOURCES([]) -TEA_ADD_TCL_SOURCES([]) - -#-------------------------------------------------------------------- -# __CHANGE__ -# A few miscellaneous platform-specific items: -# -# Define a special symbol for Windows (BUILD_sample in this case) so -# that we create the export library with the dll. -# -# 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. -# -# TEA_ADD_* any platform specific compiler/build info here. -#-------------------------------------------------------------------- - -if test "${TEA_PLATFORM}" = "windows" ; then - AC_DEFINE(BUILD_sample) - CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" - #TEA_ADD_SOURCES([win/winFile.c]) - #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) -else - CLEANFILES="pkgIndex.tcl" - #TEA_ADD_SOURCES([unix/unixFile.c]) - #TEA_ADD_LIBS([-lsuperfly]) -fi -AC_SUBST(CLEANFILES) - -#-------------------------------------------------------------------- -# __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 - -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -#-------------------------------------------------------------------- - -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 - -#-------------------------------------------------------------------- -# 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. Add Tk too if necessary. -#-------------------------------------------------------------------- - -AC_DEFINE(USE_TCL_STUBS) -#AC_DEFINE(USE_TK_STUBS) - -#-------------------------------------------------------------------- -# 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 - -#-------------------------------------------------------------------- -# 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. -# Add WISH as well if this is a Tk extension. -#-------------------------------------------------------------------- - -TEA_PROG_TCLSH -#TEA_PROG_WISH - -#-------------------------------------------------------------------- -# Finally, substitute all of the various values into the Makefile. -# You may alternatively have a special pkgIndex.tcl.in or other files -# which require substituting th AC variables in. Include these here. -#-------------------------------------------------------------------- - -AC_OUTPUT([Makefile]) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: xotcl/library/store/XOTclSdbm/configure.in-ok =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/configure.in-ok (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/XOTclSdbm/configure.in-ok (revision 0) @@ -1,312 +0,0 @@ -#-------------------------------------------------------------------- -# 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(./xotclsdbm.c) -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=xotclsdbm - -# do not modify the following lines manually, they are generated with changeXOTclVersion -XOTCL_MAJOR_VERSION=1 -XOTCL_MINOR_VERSION=2 -XOTCL_RELEASE_LEVEL=.1 - -MAJOR_VERSION=${XOTCL_MAJOR_VERSION} -MINOR_VERSION=${XOTCL_MINOR_VERSION} -PATCHLEVEL=${XOTCL_RELEASE_LEVEL} - -VERSION=${MAJOR_VERSION}.${MINOR_VERSION} -NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION} - -AC_SUBST(PATCHLEVEL) -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" - ;; - *) - CYGPATH=echo - ;; -esac - -AC_SUBST(CYGPATH) - -#-------------------------------------------------------------------- -# __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 before SC_PATH_TCLCONFIG/SC_LOAD_TCLCONFIG -#-------------------------------------------------------------------- - -#SC_PUBLIC_TCL_HEADERS -SC_PRIVATE_TCL_HEADERS - -if test x"${with_tclinclude}" != x ; then - if test -f "${with_tclinclude}/tcl.h" ; then - TCL_INCLUDES="-I${with_tclinclude} ${TCL_INCLUDES}" - else - AC_MSG_ERROR([${with_tclinclude} directory does not contain Tcl header file tcl.h]) - fi -fi - -#-------------------------------------------------------------------- -# Load the tclConfig.sh file -#-------------------------------------------------------------------- - -SC_PATH_TCLCONFIG -SC_LOAD_TCLCONFIG - -#-------------------------------------------------------------------- -# Load the xotclConfig.sh file -#-------------------------------------------------------------------- - -SC_PATH_XOTCLCONFIG -SC_LOAD_XOTCLCONFIG - -#-------------------------------------------------------------------- -# __CHANGE__ -# A few miscellaneous platform-specific items: -# -# Define a special symbol for Windows (BUILD_exampleA 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(BUILD_xotclsdbm) - CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch vc60.pch" - AC_SUBST(CLEANFILES) - ;; - *) - CLEANFILES= - ;; -esac - -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -# So far only Tcl responds to this one. -#-------------------------------------------------------------------- - -SC_ENABLE_THREADS - -#-------------------------------------------------------------------- -# The statement below defines a collection of symbols related to -# building as a shared library instead of a static library. -#-------------------------------------------------------------------- - -SC_ENABLE_SHARED - -#-------------------------------------------------------------------- -# This macro figures out what flags to use with the compiler/linker -# when building shared/static debug/optimized objects. This information -# is all taken from the tclConfig.sh file. -#-------------------------------------------------------------------- - -CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG} -CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE} -LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG} -LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE} -SHLIB_LD=${TCL_SHLIB_LD} -STLIB_LD=${TCL_STLIB_LD} -SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS} - -AC_SUBST(CFLAGS_DEBUG) -AC_SUBST(CFLAGS_OPTIMIZE) -AC_SUBST(STLIB_LD) -AC_SUBST(SHLIB_LD) -AC_SUBST(SHLIB_CFLAGS) -AC_SUBST(SHLIB_LDFLAGS) - -#-------------------------------------------------------------------- -# Set the default compiler switches based on the --enable-symbols -# option. -#-------------------------------------------------------------------- - -SC_ENABLE_SYMBOLS - -if test "${SHARED_BUILD}" = "1" ; then - CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' -else - CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}' -fi - -#-------------------------------------------------------------------- -# Everyone should be linking against the Tcl stub library. If you -# can't for some reason, remove this definition. If you aren't using -# stubs, you also need to modify the SHLIB_LD_LIBS setting below to -# link against the non-stubbed Tcl library. -#-------------------------------------------------------------------- - -if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then - echo "Tcl 8.0, no stubs used" - USE_TCL_STUBS="" -else - AC_DEFINE(USE_TCL_STUBS) - AC_DEFINE(USE_XOTCL_STUBS) -fi - -#-------------------------------------------------------------------- -# This macro generates a line to use when building a library. It -# depends on values set by the SC_ENABLE_SHARED, SC_ENABLE_SYMBOLS, -# and SC_LOAD_TCLCONFIG macros above. -#-------------------------------------------------------------------- - -SC_MAKE_LIB - -#-------------------------------------------------------------------- -# eval these two values to dereference the ${DBGX} variable. -#-------------------------------------------------------------------- - -#eval "SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" -#eval "UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" - -SHARED_LIB_SUFFIX=${XOTCL_SHARED_LIB_SUFFIX} -UNSHARED_LIB_SUFFIX=${XOTCL_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}`\" \"`cygpath -w ${XOTCL_BUILD_STUB_LIB_PATH}`\" ${TCL_SHLIB_LD_LIBS}" - eval "${PACKAGE}_LIB_FILE=${PACKAGE}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval "${PACKAGE}_LIB_FILE=${PACKAGE}${UNSHARED_LIB_SUFFIX}" - fi - ;; - *) - if test "${SHARED_BUILD}" = "1" ; then - #SHLIB_LD_LIBS="${TCL_BUILD_STUB_LIB_SPEC} ${XOTCL_BUILD_STUB_LIB_SPEC}" - SHLIB_LD_LIBS="${TCL_STUB_LIB_SPEC} ${XOTCL_BUILD_STUB_LIB_SPEC}" - eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${UNSHARED_LIB_SUFFIX}" - fi - ;; -esac - -#-------------------------------------------------------------------- -# __CHANGE__ -# Change the name from exampeA_LIB_FILE to match your package name. -#-------------------------------------------------------------------- - -AC_SUBST(xotclsdbm_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-sdbm.add) - - - - - - - - - - Index: xotcl/library/store/XOTclSdbm/dllEntryPoint.c =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/dllEntryPoint.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/XOTclSdbm/dllEntryPoint.c (revision 0) @@ -1,39 +0,0 @@ -/* - * dllEntryPoint.c -- - * $Id: dllEntryPoint.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ - * - * This file implements the Dll entry point as needed by Windows. - */ - -#define WIN32_LEAN_AND_MEAN -#include -#if defined(_MSC_VER) -# define DllEntryPoint DllMain -#endif - -/* - *---------------------------------------------------------------------- - * - * DllEntryPoint -- - * - * This wrapper function is used by Windows to invoke the - * initialization code for the DLL. If we are compiling - * with Visual C++, this routine will be renamed to DllMain. - * - * Results: - * Returns TRUE; - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -BOOL APIENTRY -DllEntryPoint(hInst, reason, reserved) - HINSTANCE hInst; /* Library instance handle. */ - DWORD reason; /* Reason this function is being called. */ - LPVOID reserved; /* Not used. */ -{ - return TRUE; -} Index: xotcl/library/store/XOTclSdbm/hash.c =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/hash.c (revision 638782f84b31e4ebfd00529381e280c70f9950bc) +++ xotcl/library/store/XOTclSdbm/hash.c (revision 0) @@ -1,51 +0,0 @@ -/* - * sdbm - ndbm work-alike hashed database library - * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). - * author: oz@nexus.yorku.ca - * status: public domain. keep it that way. - * - * hashing routine - */ - -#include "sdbm.h" -/* - * polynomial conversion ignoring overflows - * [this seems to work remarkably well, in fact better - * then the ndbm hash function. Replace at your own risk] - * use: 65599 nice. - * 65587 even better. - */ -long -sdbm_hash(str, len) -register char *str; -#ifdef VISUAL_CC -register int len; -#else -register size_t len; -#endif -{ - register unsigned long n = 0; - -#ifdef HAVE_DUFF - -#define HASHC n = *str++ + 65599 * n - - if (len > 0) { - register int loop = (len + 8 - 1) >> 3; - - switch(len & (8 - 1)) { - case 0: do { - HASHC; case 7: HASHC; - case 6: HASHC; case 5: HASHC; - case 4: HASHC; case 3: HASHC; - case 2: HASHC; case 1: HASHC; - } while (--loop); - } - - } -#else - while (len--) - n = *str++ + 65599 * n; -#endif - return n; -} Index: xotcl/library/store/XOTclSdbm/pair.c =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/pair.c (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/store/XOTclSdbm/pair.c (revision 0) @@ -1,308 +0,0 @@ -/* - * sdbm - ndbm work-alike hashed database library - * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). - * author: oz@nexus.yorku.ca - * status: public domain. - * - * page-level routines - */ - -#ifndef lint -static char rcsid[] = "$Id: pair.c,v 1.3 2006/09/27 08:12:40 neumann Exp $"; -#endif - -#include "sdbm.h" -#include "tune.h" -#include "pair.h" - -#include -#include - -#define exhash(item) sdbm_hash((item).dptr, (item).dsize) - -/* - * forward - */ -static int seepair proto((char *, int, char *, size_t)); - -/* - * page format: - * +------------------------------+ - * ino | n | keyoff | datoff | keyoff | - * +------------+--------+--------+ - * | datoff | - - - ----> | - * +--------+---------------------+ - * | F R E E A R E A | - * +--------------+---------------+ - * | <---- - - - | data | - * +--------+-----+----+----------+ - * | key | data | key | - * +--------+----------+----------+ - * - * calculating the offsets for free area: if the number - * of entries (ino[0]) is zero, the offset to the END of - * the free area is the block size. Otherwise, it is the - * nth (ino[ino[0]]) entry's offset. - */ - -int -fitpair(pag, need) -char *pag; -int need; -{ - register int n; - register int off; - register int free_space; - /* this cast "increases the alignment". Its not the only one, though.*/ - register short *ino = (short *) pag; - - off = ((n = ino[0]) > 0) ? ino[n] : PBLKSIZ; - free_space = off - (n + 1) * sizeof(short); - need += 2 * sizeof(short); - - debug(("free %d need %d\n", free_space, need)); - - return need <= free_space; -} - -void -putpair(pag, key, val) -char *pag; -datum key; -datum val; -{ - register int n; - register int off; - register short *ino = (short *) pag; - - off = ((n = ino[0]) > 0) ? ino[n] : PBLKSIZ; -/* - * enter the key first - */ - off -= key.dsize; - (void) memcpy(pag + off, key.dptr, key.dsize); - ino[n + 1] = off; -/* - * now the data - */ - off -= val.dsize; - (void) memcpy(pag + off, val.dptr, val.dsize); - ino[n + 2] = off; -/* - * adjust item count - */ - ino[0] += 2; -} - -datum -getpair(pag, key) -char *pag; -datum key; -{ - register int i; - register int n; - datum val; - register short *ino = (short *) pag; - - if ((n = ino[0]) == 0) - return nullitem; - - if ((i = seepair(pag, n, key.dptr, key.dsize)) == 0) - return nullitem; - - val.dptr = pag + ino[i + 1]; - val.dsize = ino[i] - ino[i + 1]; - return val; -} - -#ifdef SEEDUPS -int -duppair(pag, key) -char *pag; -datum key; -{ - register short *ino = (short *) pag; - return ino[0] > 0 && seepair(pag, ino[0], key.dptr, key.dsize) > 0; -} -#endif - -datum -getnkey(pag, num) -char *pag; -int num; -{ - datum key; - register int off; - register short *ino = (short *) pag; - - num = num * 2 - 1; - if (ino[0] == 0 || num > ino[0]) - return nullitem; - - off = (num > 1) ? ino[num - 1] : PBLKSIZ; - - key.dptr = pag + ino[num]; - key.dsize = off - ino[num]; - - return key; -} - -int -delpair(pag, key) -char *pag; -datum key; -{ - register int n; - register int i; - register short *ino = (short *) pag; - - if ((n = ino[0]) == 0) - return 0; - - if ((i = seepair(pag, n, key.dptr, key.dsize)) == 0) - return 0; -/* - * found the key. if it is the last entry - * [i.e. i == n - 1] we just adjust the entry count. - * hard case: move all data down onto the deleted pair, - * shift offsets onto deleted offsets, and adjust them. - * [note: 0 < i < n] - */ - if (i < n - 1) { - register int m; - register char *dst = pag + (i == 1 ? PBLKSIZ : ino[i - 1]); - register char *src = pag + ino[i + 1]; - register int zoo = dst - src; - - debug(("free-up %d ", zoo)); -/* - * shift data/keys down - */ - m = ino[i + 1] - ino[n]; -#ifdef DUFF -#define MOVB *--dst = *--src - - if (m > 0) { - register int loop = (m + 8 - 1) >> 3; - - switch (m & (8 - 1)) { - case 0: do { - MOVB; case 7: MOVB; - case 6: MOVB; case 5: MOVB; - case 4: MOVB; case 3: MOVB; - case 2: MOVB; case 1: MOVB; - } while (--loop); - } - } -#else -#ifdef MEMMOVE - memmove(dst, src, m); -#else - while (m--) - *--dst = *--src; -#endif -#endif -/* - * adjust offset index up - */ - while (i < n - 1) { - ino[i] = ino[i + 2] + zoo; - i++; - } - } - ino[0] -= 2; - return 1; -} - -/* - * search for the key in the page. - * return offset index in the range 0 < i < n. - * return 0 if not found. - */ -static int -seepair(pag, n, key, siz) -char *pag; -register int n; -register char *key; -register size_t siz; -{ - register int i; - register int off = PBLKSIZ; - register short *ino = (short *) pag; - - for (i = 1; i < n; i += 2) { - if ((int)siz == off - ino[i] && - memcmp(key, pag + ino[i], siz) == 0) - return i; - off = ino[i + 1]; - } - return 0; -} - -void -splpage(pag, new, sbit) -char *pag; -char *new; -long sbit; -{ - datum key; - datum val; - - register int n; - register int off = PBLKSIZ; - char cur[PBLKSIZ]; - register short *ino = (short *) cur; - - (void) memcpy(cur, pag, PBLKSIZ); - (void) memset(pag, 0, PBLKSIZ); - (void) memset(new, 0, PBLKSIZ); - - n = ino[0]; - for (ino++; n > 0; ino += 2) { - key.dptr = cur + ino[0]; - key.dsize = off - ino[0]; - val.dptr = cur + ino[1]; - val.dsize = ino[0] - ino[1]; -/* - * select the page pointer (by looking at sbit) and insert - */ - (void) putpair((exhash(key) & sbit) ? new : pag, key, val); - - off = ino[1]; - n -= 2; - } - - debug(("%d split %d/%d\n", ((short *) cur)[0] / 2, - ((short *) new)[0] / 2, - ((short *) pag)[0] / 2)); -} - -/* - * check page sanity: - * number of entries should be something - * reasonable, and all offsets in the index should be in order. - * this could be made more rigorous. - */ -int -chkpage(pag) -char *pag; -{ - register int n; - register int off; - register short *ino = (short *) pag; - - if ((n = ino[0]) < 0 || n > PBLKSIZ / sizeof(short)) - return 0; - - if (n > 0) { - off = PBLKSIZ; - for (ino++; n > 0; ino += 2) { - if (ino[0] > off || ino[1] > off || - ino[1] > ino[0]) - return 0; - off = ino[1]; - n -= 2; - } - } - return 1; -} Index: xotcl/library/store/XOTclSdbm/pair.h =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/pair.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/XOTclSdbm/pair.h (revision 0) @@ -1,10 +0,0 @@ -extern int fitpair proto((char *, int)); -extern void putpair proto((char *, datum, datum)); -extern datum getpair proto((char *, datum)); -extern int delpair proto((char *, datum)); -extern int chkpage proto((char *)); -extern datum getnkey proto((char *, int)); -extern void splpage proto((char *, char *, long)); -#ifdef SEEDUPS -extern int duppair proto((char *, datum)); -#endif Index: xotcl/library/store/XOTclSdbm/sdbm.c =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/sdbm.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/XOTclSdbm/sdbm.c (revision 0) @@ -1,544 +0,0 @@ -/* - * sdbm - ndbm work-alike hashed database library - * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). - * author: oz@nexus.yorku.ca - * status: public domain. - * - * core routines - */ - -#ifndef lint -static char rcsid[] = "$Id: sdbm.c,v 1.1 2004/05/23 22:50:39 neumann Exp $"; -#endif - -/*#include "config.h"*/ -#include "sdbm.h" -#include "tune.h" -#include "pair.h" - -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#ifdef HAVE_MEMORY_H -#include -#endif -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_FILE_H -# include -#endif -#ifdef _WIN32 -# define HAVE_FCNTL_H -# include -#endif -/* -#ifdef HAVE_FCNTL_H -*/ -# include -/* -#endif -*/ -#ifdef __STDC__ -#include -#endif - -#ifndef NULL -#define NULL 0 -#endif - -/* - * externals - */ -#ifndef _WIN32 -#ifndef HAVE_UNISTD_H -extern long lseek(); -#endif -#endif - -/* - * forward - */ -static int getdbit proto((DBM *, long)); -static int setdbit proto((DBM *, long)); -static int getpage proto((DBM *, long)); -static datum getnext proto((DBM *)); -static int makroom proto((DBM *, long, int)); - -/* - * useful macros - */ -#define bad(x) ((x).dptr == NULL || (x).dsize <= 0) -#define exhash(item) sdbm_hash((item).dptr, (item).dsize) -#define ioerr(db) ((db)->flags |= SDBM_IOERR) - -#define OFF_PAG(off) (long) (off) * PBLKSIZ -#define OFF_DIR(off) (long) (off) * DBLKSIZ - -static long masks[] = { - 000000000000, 000000000001, 000000000003, 000000000007, - 000000000017, 000000000037, 000000000077, 000000000177, - 000000000377, 000000000777, 000000001777, 000000003777, - 000000007777, 000000017777, 000000037777, 000000077777, - 000000177777, 000000377777, 000000777777, 000001777777, - 000003777777, 000007777777, 000017777777, 000037777777, - 000077777777, 000177777777, 000377777777, 000777777777, - 001777777777, 003777777777, 007777777777, 017777777777 -}; - -datum nullitem = {NULL, 0}; - -DBM * -sdbm_open(file, flags, mode) -register char *file; -register int flags; -register int mode; -{ - register DBM *db; - register char *dirname; - register char *pagname; - register int n; - - if (file == NULL || !*file) - return errno = EINVAL, (DBM *) NULL; -/* - * need space for two seperate filenames - */ - n = strlen(file) * 2 + strlen(DIRFEXT) + strlen(PAGFEXT) + 2; - - if ((dirname = malloc((unsigned) n)) == NULL) - return errno = ENOMEM, (DBM *) NULL; -/* - * build the file names - */ - dirname = strcat(strcpy(dirname, file), DIRFEXT); - pagname = strcpy(dirname + strlen(dirname) + 1, file); - pagname = strcat(pagname, PAGFEXT); - - db = sdbm_prep(dirname, pagname, flags, mode); - free((char *) dirname); - return db; -} - -DBM * -sdbm_prep(dirname, pagname, flags, mode) -char *dirname; -char *pagname; -int flags; -int mode; -{ - register DBM *db; - struct stat dstat; - - if ((db = (DBM *) malloc(sizeof(DBM))) == NULL) - return errno = ENOMEM, (DBM *) NULL; - - db->flags = 0; - db->hmask = 0; - db->blkptr = 0; - db->keyptr = 0; -/* - * adjust user flags so that WRONLY becomes RDWR, - * as required by this package. Also set our internal - * flag for RDONLY if needed. - */ - if (flags & O_WRONLY) - flags = (flags & ~O_WRONLY) | O_RDWR; - - else if ((flags & 03) == O_RDONLY) - db->flags = SDBM_RDONLY; - -#ifdef O_BINARY - /* GO32 / DOS-Braindamage */ - flags |= O_BINARY; -#endif - -/* - * open the files in sequence, and stat the dirfile. - * If we fail anywhere, undo everything, return NULL. - */ - if ((db->pagf = open(pagname, flags, mode)) > -1) { - if ((db->dirf = open(dirname, flags, mode)) > -1) { -/* - * need the dirfile size to establish max bit number. - */ - if (fstat(db->dirf, &dstat) == 0) { -/* - * zero size: either a fresh database, or one with a single, - * unsplit data page: dirpage is all zeros. - */ - db->dirbno = (!dstat.st_size) ? 0 : -1; - db->pagbno = -1; - db->maxbno = dstat.st_size * BYTESIZ; - - (void) memset(db->pagbuf, 0, PBLKSIZ); - (void) memset(db->dirbuf, 0, DBLKSIZ); - /* - * success - */ - return db; - } - (void) close(db->dirf); - } - (void) close(db->pagf); - } - free((char *) db); - return (DBM *) NULL; -} - -void -sdbm_close(db) -register DBM *db; -{ - if (db == NULL) - errno = EINVAL; - else { - (void) close(db->dirf); - (void) close(db->pagf); - free((char *) db); - } -} - -datum -sdbm_fetch(db, key) -register DBM *db; -datum key; -{ - if (db == NULL || bad(key)) - return errno = EINVAL, nullitem; - - if (getpage(db, exhash(key))) - return getpair(db->pagbuf, key); - - return ioerr(db), nullitem; -} - -int -sdbm_delete(db, key) -register DBM *db; -datum key; -{ - if (db == NULL || bad(key)) - return errno = EINVAL, -1; - if (sdbm_rdonly(db)) - return errno = EPERM, -1; - - if (getpage(db, exhash(key))) { - if (!delpair(db->pagbuf, key)) - return -1; -/* - * update the page file - */ - if (lseek(db->pagf, OFF_PAG(db->pagbno), SEEK_SET) < 0 - || write(db->pagf, db->pagbuf, PBLKSIZ) < 0) - return ioerr(db), -1; - - return 0; - } - - return ioerr(db), -1; -} - -int -sdbm_store(db, key, val, flags) -register DBM *db; -datum key; -datum val; -int flags; -{ - int need; - register long hash; - - if (db == NULL || bad(key)) - return errno = EINVAL, -1; - if (sdbm_rdonly(db)) - return errno = EPERM, -1; - - need = key.dsize + val.dsize; -/* - * is the pair too big (or too small) for this database ?? - */ - if (need < 0 || need > PAIRMAX) - return errno = EINVAL, -1; - - if (getpage(db, (hash = exhash(key)))) { -/* - * if we need to replace, delete the key/data pair - * first. If it is not there, ignore. - */ - if (flags == SDBM_REPLACE) - (void) delpair(db->pagbuf, key); -#ifdef SEEDUPS - else if (duppair(db->pagbuf, key)) - return 1; -#endif -/* - * if we do not have enough room, we have to split. - */ - if (!fitpair(db->pagbuf, need)) - if (!makroom(db, hash, need)) - return ioerr(db), -1; -/* - * we have enough room or split is successful. insert the key, - * and update the page file. - */ - (void) putpair(db->pagbuf, key, val); - - if (lseek(db->pagf, OFF_PAG(db->pagbno), SEEK_SET) < 0 - || write(db->pagf, db->pagbuf, PBLKSIZ) < 0) - return ioerr(db), -1; - /* - * success - */ - return 0; - } - - return ioerr(db), -1; -} - -/* - * makroom - make room by splitting the overfull page - * this routine will attempt to make room for SPLTMAX times before - * giving up. - */ -static int -makroom(db, hash, need) -register DBM *db; -long hash; -int need; -{ - long newp; - char twin[PBLKSIZ]; - char *pag = db->pagbuf; - char *new = twin; - register int smax = SPLTMAX; - - do { -/* - * split the current page - */ - (void) splpage(pag, new, db->hmask + 1); -/* - * address of the new page - */ - newp = (hash & db->hmask) | (db->hmask + 1); - -/* - * write delay, read avoidence/cache shuffle: - * select the page for incoming pair: if key is to go to the new page, - * write out the previous one, and copy the new one over, thus making - * it the current page. If not, simply write the new page, and we are - * still looking at the page of interest. current page is not updated - * here, as sdbm_store will do so, after it inserts the incoming pair. - */ - if (hash & (db->hmask + 1)) { - if (lseek(db->pagf, OFF_PAG(db->pagbno), SEEK_SET) < 0 - || write(db->pagf, db->pagbuf, PBLKSIZ) < 0) - return 0; - db->pagbno = newp; - (void) memcpy(pag, new, PBLKSIZ); - } - else if (lseek(db->pagf, OFF_PAG(newp), SEEK_SET) < 0 - || write(db->pagf, new, PBLKSIZ) < 0) - return 0; - - if (!setdbit(db, db->curbit)) - return 0; -/* - * see if we have enough room now - */ - if (fitpair(pag, need)) - return 1; -/* - * try again... update curbit and hmask as getpage would have - * done. because of our update of the current page, we do not - * need to read in anything. BUT we have to write the current - * [deferred] page out, as the window of failure is too great. - */ - db->curbit = 2 * db->curbit + - ((hash & (db->hmask + 1)) ? 2 : 1); - db->hmask |= db->hmask + 1; - - if (lseek(db->pagf, OFF_PAG(db->pagbno), SEEK_SET) < 0 - || write(db->pagf, db->pagbuf, PBLKSIZ) < 0) - return 0; - - } while (--smax); -/* - * if we are here, this is real bad news. After SPLTMAX splits, - * we still cannot fit the key. say goodnight. - */ -#ifdef BADMESS - (void) write(2, "sdbm: cannot insert after SPLTMAX attempts.\n", 44); -#endif - return 0; - -} - -/* - * the following two routines will break if - * deletions aren't taken into account. (ndbm bug) - */ -datum -sdbm_firstkey(db) -register DBM *db; -{ - if (db == NULL) - return errno = EINVAL, nullitem; -/* - * start at page 0 - */ - if (lseek(db->pagf, OFF_PAG(0), SEEK_SET) < 0 - || read(db->pagf, db->pagbuf, PBLKSIZ) < 0) - return ioerr(db), nullitem; - db->pagbno = 0; - db->blkptr = 0; - db->keyptr = 0; - - return getnext(db); -} - -datum -sdbm_nextkey(db) -register DBM *db; -{ - if (db == NULL) - return errno = EINVAL, nullitem; - return getnext(db); -} - -/* - * all important binary trie traversal - */ -static int -getpage(db, hash) -register DBM *db; -register long hash; -{ - register int hbit; - register long dbit; - register long pagb; - - dbit = 0; - hbit = 0; - while (dbit < db->maxbno && getdbit(db, dbit)) - dbit = 2 * dbit + ((hash & (1 << hbit++)) ? 2 : 1); - - debug(("dbit: %d...", dbit)); - - db->curbit = dbit; - db->hmask = masks[hbit]; - - pagb = hash & db->hmask; -/* - * see if the block we need is already in memory. - * note: this lookaside cache has about 10% hit rate. - */ - if (pagb != db->pagbno) { -/* - * note: here, we assume a "hole" is read as 0s. - * if not, must zero pagbuf first. - */ - if (lseek(db->pagf, OFF_PAG(pagb), SEEK_SET) < 0 - || read(db->pagf, db->pagbuf, PBLKSIZ) < 0) - return 0; - if (!chkpage(db->pagbuf)) - return 0; - db->pagbno = pagb; - - debug(("pag read: %d\n", pagb)); - } - return 1; -} - -static int -getdbit(db, dbit) -register DBM *db; -register long dbit; -{ - register long c; - register long dirb; - - c = dbit / BYTESIZ; - dirb = c / DBLKSIZ; - - if (dirb != db->dirbno) { - if (lseek(db->dirf, OFF_DIR(dirb), SEEK_SET) < 0 - || read(db->dirf, db->dirbuf, DBLKSIZ) < 0) - return 0; - db->dirbno = dirb; - - debug(("dir read: %d\n", dirb)); - } - - return db->dirbuf[c % DBLKSIZ] & (1 << dbit % BYTESIZ); -} - -static int -setdbit(db, dbit) -register DBM *db; -register long dbit; -{ - register long c; - register long dirb; - - c = dbit / BYTESIZ; - dirb = c / DBLKSIZ; - - if (dirb != db->dirbno) { - if (lseek(db->dirf, OFF_DIR(dirb), SEEK_SET) < 0 - || read(db->dirf, db->dirbuf, DBLKSIZ) < 0) - return 0; - db->dirbno = dirb; - - debug(("dir read: %d\n", dirb)); - } - - db->dirbuf[c % DBLKSIZ] |= (1 << dbit % BYTESIZ); - - if (dbit >= db->maxbno) - db->maxbno += DBLKSIZ * BYTESIZ; - - if (lseek(db->dirf, OFF_DIR(dirb), SEEK_SET) < 0 - || write(db->dirf, db->dirbuf, DBLKSIZ) < 0) - return 0; - - return 1; -} - -/* - * getnext - get the next key in the page, and if done with - * the page, try the next page in sequence - */ -static datum -getnext(db) -register DBM *db; -{ - datum key; - - for (;;) { - db->keyptr++; - key = getnkey(db->pagbuf, db->keyptr); - if (key.dptr != NULL) - return key; -/* - * we either run out, or there is nothing on this page.. - * try the next one... If we lost our position on the - * file, we will have to seek. - */ - db->keyptr = 0; - if (db->pagbno != db->blkptr++) - if (lseek(db->pagf, OFF_PAG(db->blkptr), SEEK_SET) < 0) - break; - db->pagbno = db->blkptr; - if (read(db->pagf, db->pagbuf, PBLKSIZ) <= 0) - break; - if (!chkpage(db->pagbuf)) - break; - } - - return ioerr(db), nullitem; -} Index: xotcl/library/store/XOTclSdbm/sdbm.h =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/sdbm.h (revision 3e7d71672a58cd397ff02f6a89f901eac9a6a38b) +++ xotcl/library/store/XOTclSdbm/sdbm.h (revision 0) @@ -1,96 +0,0 @@ -/* - * sdbm - ndbm work-alike hashed database library - * based on Per-Ake Larson's Dynamic Hashing algorithms. BIT 18 (1978). - * author: oz@nexus.yorku.ca - * status: public domain. - */ - -#ifndef VISUAL_CC - #include -#endif -#define DBLKSIZ 4096 -#define PBLKSIZ 1024 -#define PAIRMAX 1008 /* arbitrary on PBLKSIZ-N */ -#define SPLTMAX 10 /* maximum allowed splits */ - /* for a single insertion */ -#define DIRFEXT ".dir" -#define PAGFEXT ".pag" - -typedef struct { - int dirf; /* directory file descriptor */ - int pagf; /* page file descriptor */ - int flags; /* status/error flags, see below */ - long maxbno; /* size of dirfile in bits */ - long curbit; /* current bit number */ - long hmask; /* current hash mask */ - long blkptr; /* current block for nextkey */ - int keyptr; /* current key for nextkey */ - long blkno; /* current page to read/write */ - long pagbno; /* current page in pagbuf */ - char pagbuf[PBLKSIZ]; /* page file block buffer */ - long dirbno; /* current block in dirbuf */ - char dirbuf[DBLKSIZ]; /* directory file block buffer */ -} DBM; - -#define SDBM_RDONLY 0x1 /* data base open read-only */ -#define SDBM_IOERR 0x2 /* data base I/O error */ - -/* - * utility macros - */ -#define sdbm_rdonly(db) ((db)->flags & SDBM_RDONLY) -#define sdbm_error(db) ((db)->flags & SDBM_IOERR) - -#define sdbm_clearerr(db) ((db)->flags &= ~SDBM_IOERR) /* ouch */ - -#define sdbm_dirfno(db) ((db)->dirf) -#define sdbm_pagfno(db) ((db)->pagf) - -#ifdef VISUAL_CC -typedef struct { - char *dptr; - int dsize; -} datum; -#else -typedef struct { - char *dptr; - size_t dsize; -} datum; -#endif - - -extern datum nullitem; - -#ifdef __STDC__ -#define proto(p) p -#else -#define proto(p) () -#endif - -/* - * flags to sdbm_store - */ -#define SDBM_INSERT 0 -#define SDBM_REPLACE 1 - -/* - * ndbm interface - */ -extern DBM *sdbm_open proto((char *, int, int)); -extern void sdbm_close proto((DBM *)); -extern datum sdbm_fetch proto((DBM *, datum)); -extern int sdbm_delete proto((DBM *, datum)); -extern int sdbm_store proto((DBM *, datum, datum, int)); -extern datum sdbm_firstkey proto((DBM *)); -extern datum sdbm_nextkey proto((DBM *)); - -/* - * other - */ - -extern DBM *sdbm_prep proto((char *, char *, int, int)); -#ifdef VISUAL_CC -extern long sdbm_hash proto((char *, int)); -#else -extern long sdbm_hash proto((char *, size_t)); -#endif Index: xotcl/library/store/XOTclSdbm/tcl.m4 =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/tcl.m4 (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/library/store/XOTclSdbm/tcl.m4 (revision 0) @@ -1,4041 +0,0 @@ -# tcl.m4 -- -# -# This file provides a set of autoconf macros to help TEA-enable -# a Tcl extension. -# -# Copyright (c) 1999-2000 Ajuba Solutions. -# 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: tcl.m4,v 1.2 2007/10/12 19:53:32 neumann Exp $ - -AC_PREREQ(2.57) - -dnl TEA extensions pass us the version of TEA they think they -dnl are compatible with (must be set in TEA_INIT below) -dnl TEA_VERSION="3.6" - -# Possible values for key variables defined: -# -# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') -# TEA_PLATFORM - windows unix -# - -#------------------------------------------------------------------------ -# TEA_PATH_TCLCONFIG -- -# -# Locate the tclConfig.sh file and perform a sanity check on -# the Tcl compile flags -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-tcl=... -# -# Defines the following vars: -# TCL_BIN_DIR Full path to the directory containing -# the tclConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_TCLCONFIG], [ - dnl Make sure we are initialized - AC_REQUIRE([TEA_INIT]) - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - - if test x"${no_tcl}" = x ; then - # we reset no_tcl in case something fails here - no_tcl=true - AC_ARG_WITH(tcl, - AC_HELP_STRING([--with-tcl], - [directory containing tcl configuration (tclConfig.sh)]), - with_tclconfig=${withval}) - AC_MSG_CHECKING([for Tcl configuration]) - AC_CACHE_VAL(ac_cv_c_tclconfig,[ - - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - case ${with_tclconfig} in - */tclConfig.sh ) - if test -f ${with_tclconfig}; then - AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) - with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tcl.framework/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_tclconfig}" = x ; then - TCL_BIN_DIR="# no Tcl configs found" - AC_MSG_WARN([Can't find Tcl configuration definitions]) - exit 0 - else - no_tcl= - TCL_BIN_DIR=${ac_cv_c_tclconfig} - AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_PATH_TKCONFIG -- -# -# Locate the tkConfig.sh file -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-tk=... -# -# Defines the following vars: -# TK_BIN_DIR Full path to the directory containing -# the tkConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_TKCONFIG], [ - # - # Ok, lets find the tk configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tk - # - - if test x"${no_tk}" = x ; then - # we reset no_tk in case something fails here - no_tk=true - AC_ARG_WITH(tk, - AC_HELP_STRING([--with-tk], - [directory containing tk configuration (tkConfig.sh)]), - with_tkconfig=${withval}) - AC_MSG_CHECKING([for Tk configuration]) - AC_CACHE_VAL(ac_cv_c_tkconfig,[ - - # First check to see if --with-tkconfig was specified. - if test x"${with_tkconfig}" != x ; then - case ${with_tkconfig} in - */tkConfig.sh ) - if test -f ${with_tkconfig}; then - AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) - with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tkconfig}/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` - else - AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) - fi - fi - - # then check for a private Tk library - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in \ - ../tk \ - `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../tk \ - `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../../tk \ - `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tk.framework/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in \ - ${srcdir}/../tk \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_tkconfig}" = x ; then - TK_BIN_DIR="# no Tk configs found" - AC_MSG_WARN([Can't find Tk configuration definitions]) - exit 0 - else - no_tk= - TK_BIN_DIR=${ac_cv_c_tkconfig} - AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_TCLCONFIG -- -# -# Load the tclConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# TCL_BIN_DIR -# -# Results: -# -# Subst the following vars: -# TCL_BIN_DIR -# TCL_SRC_DIR -# TCL_LIB_FILE -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_TCLCONFIG], [ - AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) - - if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - AC_MSG_RESULT([loading]) - . "${TCL_BIN_DIR}/tclConfig.sh" - else - AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tcl.framework installed in an arbitary location. - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then - for i in "`cd ${TCL_BIN_DIR}; pwd`" \ - "`cd ${TCL_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then - TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" - break - fi - done - fi - if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then - TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" - TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - AC_SUBST(TCL_VERSION) - AC_SUBST(TCL_BIN_DIR) - AC_SUBST(TCL_SRC_DIR) - - AC_SUBST(TCL_LIB_FILE) - AC_SUBST(TCL_LIB_FLAG) - AC_SUBST(TCL_LIB_SPEC) - - AC_SUBST(TCL_STUB_LIB_FILE) - AC_SUBST(TCL_STUB_LIB_FLAG) - AC_SUBST(TCL_STUB_LIB_SPEC) - - AC_SUBST(TCL_LIBS) - AC_SUBST(TCL_DEFS) - AC_SUBST(TCL_EXTRA_CFLAGS) - AC_SUBST(TCL_LD_FLAGS) - AC_SUBST(TCL_SHLIB_LD_LIBS) -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_TKCONFIG -- -# -# Load the tkConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# TK_BIN_DIR -# -# Results: -# -# Sets the following vars that should be in tkConfig.sh: -# TK_BIN_DIR -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_TKCONFIG], [ - AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) - - if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then - AC_MSG_RESULT([loading]) - . "${TK_BIN_DIR}/tkConfig.sh" - else - AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) - fi - - # eval is required to do the TK_DBGX substitution - eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" - eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" - - # If the TK_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TK_LIB_SPEC will be set to the value - # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC - # instead of TK_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TK_BIN_DIR}/Makefile" ; then - TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} - TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} - TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tk.framework installed in an arbitary location. - case ${TK_DEFS} in - *TK_FRAMEWORK*) - if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then - for i in "`cd ${TK_BIN_DIR}; pwd`" \ - "`cd ${TK_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then - TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" - break - fi - done - fi - if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then - TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" - TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TK_DBGX substitution - eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" - eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" - eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" - eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" - - # Ensure windowingsystem is defined - if test "${TEA_PLATFORM}" = "unix" ; then - case ${TK_DEFS} in - *MAC_OSX_TK*) - AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) - TEA_WINDOWINGSYSTEM="aqua" - ;; - *) - TEA_WINDOWINGSYSTEM="x11" - ;; - esac - elif test "${TEA_PLATFORM}" = "windows" ; then - TEA_WINDOWINGSYSTEM="win32" - fi - - AC_SUBST(TK_VERSION) - AC_SUBST(TK_BIN_DIR) - AC_SUBST(TK_SRC_DIR) - - AC_SUBST(TK_LIB_FILE) - AC_SUBST(TK_LIB_FLAG) - AC_SUBST(TK_LIB_SPEC) - - AC_SUBST(TK_STUB_LIB_FILE) - AC_SUBST(TK_STUB_LIB_FLAG) - AC_SUBST(TK_STUB_LIB_SPEC) - - AC_SUBST(TK_LIBS) - AC_SUBST(TK_XINCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_SHARED -- -# -# Allows the building of shared libraries -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-shared=yes|no -# -# Defines the following vars: -# STATIC_BUILD Used for building import/export libraries -# on Windows. -# -# Sets the following vars: -# SHARED_BUILD Value of 1 or 0 -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_SHARED], [ - AC_MSG_CHECKING([how to build libraries]) - AC_ARG_ENABLE(shared, - AC_HELP_STRING([--enable-shared], - [build and link with shared libraries (default: on)]), - [tcl_ok=$enableval], [tcl_ok=yes]) - - if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" ; then - AC_MSG_RESULT([shared]) - SHARED_BUILD=1 - else - AC_MSG_RESULT([static]) - SHARED_BUILD=0 - AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) - fi - AC_SUBST(SHARED_BUILD) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_THREADS -- -# -# Specify if thread support should be enabled. If "yes" is specified -# as an arg (optional), threads are enabled by default, "no" means -# threads are disabled. "yes" is the default. -# -# TCL_THREADS is checked so that if you are compiling an extension -# against a threaded core, your extension must be compiled threaded -# as well. -# -# Note that it is legal to have a thread enabled extension run in a -# threaded or non-threaded Tcl core, but a non-threaded extension may -# only run in a non-threaded Tcl core. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-threads -# -# Sets the following vars: -# THREADS_LIBS Thread library(s) -# -# Defines the following vars: -# TCL_THREADS -# _REENTRANT -# _THREAD_SAFE -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_THREADS], [ - AC_ARG_ENABLE(threads, - AC_HELP_STRING([--enable-threads], - [build with threads]), - [tcl_ok=$enableval], [tcl_ok=yes]) - - if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then - TCL_THREADS=1 - - if test "${TEA_PLATFORM}" != "windows" ; then - # We are always OK on Windows, so check what this platform wants: - - # USE_THREAD_ALLOC tells us to try the special thread-based - # allocator that significantly reduces lock contention - AC_DEFINE(USE_THREAD_ALLOC, 1, - [Do we want to use the threaded memory allocator?]) - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - if test "`uname -s`" = "SunOS" ; then - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - fi - AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) - AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) - if test "$tcl_ok" = "no"; then - # Check a little harder for __pthread_mutex_init in the same - # library, as some systems hide it there until pthread.h is - # defined. We could alternatively do an AC_TRY_COMPILE with - # pthread.h, but that will work with libpthread really doesn't - # exist, like AIX 4.2. [Bug: 4359] - AC_CHECK_LIB(pthread, __pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthread" - else - AC_CHECK_LIB(pthreads, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthreads" - else - AC_CHECK_LIB(c, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "no"; then - AC_CHECK_LIB(c_r, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -pthread" - else - TCL_THREADS=0 - AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) - fi - fi - fi - fi - fi - else - TCL_THREADS=0 - fi - # Do checking message here to not mess up interleaved configure output - AC_MSG_CHECKING([for building with threads]) - if test "${TCL_THREADS}" = 1; then - AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) - AC_MSG_RESULT([yes (default)]) - else - AC_MSG_RESULT([no]) - fi - # TCL_THREADS sanity checking. See if our request for building with - # threads is the same as the way Tcl was built. If not, warn the user. - case ${TCL_DEFS} in - *THREADS=1*) - if test "${TCL_THREADS}" = "0"; then - AC_MSG_WARN([ - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads.]) - fi - ;; - *) - if test "${TCL_THREADS}" = "1"; then - AC_MSG_WARN([ - --enable-threads requested, but building against a Tcl that is NOT - thread-enabled. This is an OK configuration that will also run in - a thread-enabled core.]) - fi - ;; - esac - AC_SUBST(TCL_THREADS) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_SYMBOLS -- -# -# Specify if debugging symbols should be used. -# Memory (TCL_MEM_DEBUG) debugging can also be enabled. -# -# Arguments: -# none -# -# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives -# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. -# Requires the following vars to be set in the Makefile: -# CFLAGS_DEFAULT -# LDFLAGS_DEFAULT -# -# Results: -# -# Adds the following arguments to configure: -# --enable-symbols -# -# Defines the following vars: -# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true -# Sets to $(CFLAGS_OPTIMIZE) if false -# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true -# Sets to $(LDFLAGS_OPTIMIZE) if false -# DBGX Formerly used as debug library extension; -# always blank now. -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_SYMBOLS], [ - dnl Make sure we are initialized - AC_REQUIRE([TEA_CONFIG_CFLAGS]) - AC_MSG_CHECKING([for build with symbols]) - AC_ARG_ENABLE(symbols, - AC_HELP_STRING([--enable-symbols], - [build with debugging symbols (default: off)]), - [tcl_ok=$enableval], [tcl_ok=no]) - DBGX="" - if test "$tcl_ok" = "no"; then - CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" - LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" - AC_MSG_RESULT([no]) - else - CFLAGS_DEFAULT="${CFLAGS_DEBUG}" - LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" - if test "$tcl_ok" = "yes"; then - AC_MSG_RESULT([yes (standard debugging)]) - fi - fi - if test "${TEA_PLATFORM}" != "windows" ; then - LDFLAGS_DEFAULT="${LDFLAGS}" - fi - - AC_SUBST(TCL_DBGX) - AC_SUBST(CFLAGS_DEFAULT) - AC_SUBST(LDFLAGS_DEFAULT) - - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) - fi - - if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then - if test "$tcl_ok" = "all"; then - AC_MSG_RESULT([enabled symbols mem debugging]) - else - AC_MSG_RESULT([enabled $tcl_ok debugging]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_LANGINFO -- -# -# Allows use of modern nl_langinfo check for better l10n. -# This is only relevant for Unix. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-langinfo=yes|no (default is yes) -# -# Defines the following vars: -# HAVE_LANGINFO Triggers use of nl_langinfo if defined. -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_LANGINFO], [ - AC_ARG_ENABLE(langinfo, - AC_HELP_STRING([--enable-langinfo], - [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), - [langinfo_ok=$enableval], [langinfo_ok=yes]) - - HAVE_LANGINFO=0 - if test "$langinfo_ok" = "yes"; then - AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) - fi - AC_MSG_CHECKING([whether to use nl_langinfo]) - if test "$langinfo_ok" = "yes"; then - AC_CACHE_VAL(tcl_cv_langinfo_h, [ - AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], - [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) - AC_MSG_RESULT([$tcl_cv_langinfo_h]) - if test $tcl_cv_langinfo_h = yes; then - AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) - fi - else - AC_MSG_RESULT([$langinfo_ok]) - fi -]) - -#-------------------------------------------------------------------- -# TEA_CONFIG_SYSTEM -# -# Determine what the system is (some things cannot be easily checked -# on a feature-driven basis, alas). This can usually be done via the -# "uname" command, but there are a few systems, like Next, where -# this doesn't work. -# -# Arguments: -# none -# -# Results: -# Defines the following var: -# -# system - System/platform/version identification code. -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_CONFIG_SYSTEM], [ - AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ - if test "${TEA_PLATFORM}" = "windows" ; then - tcl_cv_sys_version=windows - elif test -f /usr/lib/NextStep/software_version; then - tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` - else - tcl_cv_sys_version=`uname -s`-`uname -r` - if test "$?" -ne 0 ; then - AC_MSG_WARN([can't find uname command]) - tcl_cv_sys_version=unknown - else - # Special check for weird MP-RAS system (uname returns weird - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid` - fi - if test "`uname -s`" = "AIX" ; then - tcl_cv_sys_version=AIX-`uname -v`.`uname -r` - fi - fi - fi - ]) - system=$tcl_cv_sys_version -]) - -#-------------------------------------------------------------------- -# TEA_CONFIG_CFLAGS -# -# Try to determine the proper flags to pass to the compiler -# for building shared libraries and other such nonsense. -# -# Arguments: -# none -# -# Results: -# -# Defines and substitutes the following vars: -# -# DL_OBJS - Name of the object file that implements dynamic -# loading for Tcl on this system. -# DL_LIBS - Library file(s) to include in tclsh and other base -# applications in order for the "load" command to work. -# LDFLAGS - Flags to pass to the compiler when linking object -# files into an executable application binary such -# as tclsh. -# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", -# that tell the run-time dynamic linker where to look -# for shared libraries such as libtcl.so. Depends on -# the variable LIB_RUNTIME_DIR in the Makefile. Could -# be the same as CC_SEARCH_FLAGS if ${CC} is used to link. -# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", -# that tell the run-time dynamic linker where to look -# for shared libraries such as libtcl.so. Depends on -# the variable LIB_RUNTIME_DIR in the Makefile. -# SHLIB_CFLAGS - Flags to pass to cc when compiling the components -# of a shared library (may request position-independent -# code, among other things). -# SHLIB_LD - Base command to use for combining object files -# into a shared library. -# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when -# creating shared libraries. This symbol typically -# goes at the end of the "ld" commands that build -# shared libraries. The value of the symbol is -# "${LIBS}" if all of the dependent libraries should -# be specified when creating a shared library. If -# dependent libraries should not be specified (as on -# SunOS 4.x, where they cause the link to fail, or in -# general if Tcl and Tk aren't themselves shared -# libraries), then this symbol has an empty string -# as its value. -# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable -# extensions. An empty string means we don't know how -# to use shared libraries on this platform. -# LIB_SUFFIX - Specifies everything that comes after the "libfoo" -# in a static or shared library name, using the $VERSION variable -# to put the version in the right place. This is used -# by platforms that need non-standard library names. -# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs -# to have a version after the .so, and ${VERSION}.a -# on AIX, since a shared library needs to have -# a .a extension whereas shared objects for loadable -# extensions have a .so extension. Defaults to -# ${VERSION}${SHLIB_SUFFIX}. -# TCL_NEEDS_EXP_FILE - -# 1 means that an export file is needed to link to a -# shared library. -# TCL_EXP_FILE - The name of the installed export / import file which -# should be used to link to the Tcl shared library. -# Empty if Tcl is unshared. -# TCL_BUILD_EXP_FILE - -# The name of the built export / import file which -# should be used to link to the Tcl shared library. -# Empty if Tcl is unshared. -# CFLAGS_DEBUG - -# Flags used when running the compiler in debug mode -# CFLAGS_OPTIMIZE - -# Flags used when running the compiler in optimize mode -# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_CONFIG_CFLAGS], [ - dnl Make sure we are initialized - AC_REQUIRE([TEA_INIT]) - - # Step 0.a: Enable 64 bit support? - - AC_MSG_CHECKING([if 64bit support is requested]) - AC_ARG_ENABLE(64bit, - AC_HELP_STRING([--enable-64bit], - [enable 64bit support (default: off)]), - [do64bit=$enableval], [do64bit=no]) - AC_MSG_RESULT([$do64bit]) - - # Step 0.b: Enable Solaris 64 bit VIS support? - - AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) - AC_ARG_ENABLE(64bit-vis, - AC_HELP_STRING([--enable-64bit-vis], - [enable 64bit Sparc VIS support (default: off)]), - [do64bitVIS=$enableval], [do64bitVIS=no]) - AC_MSG_RESULT([$do64bitVIS]) - - if test "$do64bitVIS" = "yes"; then - # Force 64bit on with VIS - do64bit=yes - fi - - # Step 0.c: Cross-compiling options for Windows/CE builds? - - if test "${TEA_PLATFORM}" = "windows" ; then - AC_MSG_CHECKING([if Windows/CE build is requested]) - AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) - AC_MSG_RESULT([$doWince]) - fi - - # Step 1: set the variable "system" to hold the name and version number - # for the system. - - TEA_CONFIG_SYSTEM - - # Step 2: check for existence of -ldl library. This is needed because - # Linux can use either -ldl or -ldld for dynamic loading. - - AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) - - # Require ranlib early so we can override it in special cases below. - - AC_REQUIRE([AC_PROG_RANLIB]) - - # Step 3: set configuration options based on system name and version. - # This is similar to Tcl's unix/tcl.m4 except that we've added a - # "windows" case. - - do64bit_ok=no - LDFLAGS_ORIG="$LDFLAGS" - # When ld needs options to work in 64-bit mode, put them in - # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] - # is disabled by the user. [Bug 1016796] - LDFLAGS_ARCH="" - TCL_EXPORT_FILE_SUFFIX="" - UNSHARED_LIB_SUFFIX="" - TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' - ECHO_VERSION='`echo ${PACKAGE_VERSION}`' - TCL_LIB_VERSIONS_OK=ok - CFLAGS_DEBUG=-g - CFLAGS_OPTIMIZE=-O - if test "$GCC" = "yes" ; then - CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wno-implicit-int" - else - CFLAGS_WARNING="" - fi - TCL_NEEDS_EXP_FILE=0 - TCL_BUILD_EXP_FILE="" - TCL_EXP_FILE="" -dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. -dnl AC_CHECK_TOOL(AR, ar) - AC_CHECK_PROG(AR, ar, ar) - STLIB_LD='${AR} cr' - LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" - case $system in - windows) - # This is a 2-stage check to make sure we have the 64-bit SDK - # We have to know where the SDK is installed. - # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs - # MACHINE is IX86 for LINK, but this is used by the manifest, - # which requires x86|amd64|ia64. - MACHINE="X86" - if test "$do64bit" != "no" ; then - if test "x${MSSDK}x" = "xx" ; then - MSSDK="C:/Progra~1/Microsoft Platform SDK" - fi - MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` - PATH64="" - case "$do64bit" in - amd64|x64|yes) - MACHINE="AMD64" ; # default to AMD64 64-bit build - PATH64="${MSSDK}/Bin/Win64/x86/AMD64" - ;; - ia64) - MACHINE="IA64" - PATH64="${MSSDK}/Bin/Win64" - ;; - esac - if test ! -d "${PATH64}" ; then - AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) - AC_MSG_WARN([Ensure latest Platform SDK is installed]) - do64bit="no" - else - AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) - do64bit_ok="yes" - fi - fi - - if test "$doWince" != "no" ; then - if test "$do64bit" != "no" ; then - AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) - fi - if test "$GCC" = "yes" ; then - AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) - fi - TEA_PATH_CELIB - # Set defaults for common evc4/PPC2003 setup - # Currently Tcl requires 300+, possibly 420+ for sockets - CEVERSION=420; # could be 211 300 301 400 420 ... - TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... - ARCH=ARM; # could be ARM MIPS X86EM ... - PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" - if test "$doWince" != "yes"; then - # If !yes then the user specified something - # Reset ARCH to allow user to skip specifying it - ARCH= - eval `echo $doWince | awk -F, '{ \ - if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ - if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ - if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ - if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ - if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ - }'` - if test "x${ARCH}" = "x" ; then - ARCH=$TARGETCPU; - fi - fi - OSVERSION=WCE$CEVERSION; - if test "x${WCEROOT}" = "x" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" - if test ! -d "${WCEROOT}" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded Tools" - fi - fi - if test "x${SDKROOT}" = "x" ; then - SDKROOT="C:/Program Files/Windows CE Tools" - if test ! -d "${SDKROOT}" ; then - SDKROOT="C:/Windows CE Tools" - fi - fi - WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` - SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` - if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ - -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then - AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) - doWince="no" - else - # We could PATH_NOSPACE these, but that's not important, - # as long as we quote them when used. - CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" - if test -d "${CEINCLUDE}/${TARGETCPU}" ; then - CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" - fi - CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" - fi - fi - - if test "$GCC" != "yes" ; then - if test "${SHARED_BUILD}" = "0" ; then - runtime=-MT - else - runtime=-MD - fi - - if test "$do64bit" != "no" ; then - # All this magic is necessary for the Win64 SDK RC1 - hobbs - CC="\"${PATH64}/cl.exe\"" - CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" - RC="\"${MSSDK}/bin/rc.exe\"" - lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" - LINKBIN="\"${PATH64}/link.exe\"" - CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - # Avoid 'unresolved external symbol __security_cookie' - # errors, c.f. http://support.microsoft.com/?id=894573 - TEA_ADD_LIBS([bufferoverflowU.lib]) - elif test "$doWince" != "no" ; then - CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" - if test "${TARGETCPU}" = "X86"; then - CC="\"${CEBINROOT}/cl.exe\"" - else - CC="\"${CEBINROOT}/cl${ARCH}.exe\"" - fi - CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" - RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" - arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` - defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" - if test "${SHARED_BUILD}" = "1" ; then - # Static CE builds require static celib as well - defs="${defs} _DLL" - fi - for i in $defs ; do - AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) - done - AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) - AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) - CFLAGS_DEBUG="-nologo -Zi -Od" - CFLAGS_OPTIMIZE="-nologo -Ox" - lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` - lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" - LINKBIN="\"${CEBINROOT}/link.exe\"" - AC_SUBST(CELIB_DIR) - else - RC="rc" - lflags="-nologo" - LINKBIN="link" - CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - fi - fi - - if test "$GCC" = "yes"; then - # mingw gcc mode - RC="windres" - CFLAGS_DEBUG="-g" - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - SHLIB_LD="$CC -shared" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" - LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" - else - SHLIB_LD="${LINKBIN} -dll ${lflags}" - # link -lib only works when -lib is the first arg - STLIB_LD="${LINKBIN} -lib ${lflags}" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' - PATHTYPE=-w - # For information on what debugtype is most useful, see: - # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp - # This essentially turns it all on. - LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" - LDFLAGS_OPTIMIZE="-release" - if test "$doWince" != "no" ; then - LDFLAGS_CONSOLE="-link ${lflags}" - LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} - else - LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" - LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" - fi - fi - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dll" - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' - - TCL_LIB_VERSIONS_OK=nodots - # Bogus to avoid getting this turned off - DL_OBJS="tclLoadNone.obj" - ;; - AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then - # AIX requires the _r compiler when gcc isn't being used - case "${CC}" in - *_r) - # ok ... - ;; - *) - CC=${CC}_r - ;; - esac - AC_MSG_RESULT([Using $CC for compiling with threads]) - fi - LIBS="$LIBS -lc" - SHLIB_CFLAGS="" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - DL_OBJS="tclLoadDl.o" - LD_LIBRARY_PATH_VAR="LIBPATH" - - # Check to enable 64-bit flags for compiler/linker on AIX 4+ - if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - else - do64bit_ok=yes - CFLAGS="$CFLAGS -q64" - LDFLAGS_ARCH="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi - - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - else - SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - fi - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' - fi - - # AIX v<=4.1 has some different flags than 4.2+ - if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then - AC_LIBOBJ([tclLoadAix]) - DL_LIBS="-lld" - fi - - # On AIX <=v4 systems, libbsd.a has to be linked in to support - # non-blocking file IO. This library has to be linked in after - # the MATH_LIBS or it breaks the pow() function. The way to - # insure proper sequencing, is to add it to the tail of MATH_LIBS. - # This library also supplies gettimeofday. - # - # AIX does not have a timezone field in struct tm. When the AIX - # bsd library is used, the timezone global and the gettimeofday - # methods are to be avoided for timezone deduction instead, we - # deduce the timezone by comparing the localtime result on a - # known GMT value. - - AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) - if test $libbsd = yes; then - MATH_LIBS="$MATH_LIBS -lbsd" - AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) - fi - ;; - BeOS*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC} -nostart" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - - #----------------------------------------------------------- - # Check for inet_ntoa in -lbind, for BeOS (which also needs - # -lsocket, even if the network functions are in -lnet which - # is always linked to, for compatibility. - #----------------------------------------------------------- - AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) - ;; - BSD/OS-2.1*|BSD/OS-3*) - SHLIB_CFLAGS="" - SHLIB_LD="shlicc -r" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - BSD/OS-4.*) - SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="cc -shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - dgux*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - HP-UX-*.11.*) - # Use updated header definitions where possible - AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) - # Needed by Tcl, but not most extensions - #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) - #LIBS="$LIBS -lxnet" # Use the XOPEN network library - - if test "`uname -m`" = "ia64" ; then - SHLIB_SUFFIX=".so" - # Use newer C++ library for C++ extensions - #if test "$GCC" != "yes" ; then - # CPPFLAGS="-AA" - #fi - else - SHLIB_SUFFIX=".sl" - fi - AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS='${LIBS}' - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - SHLIB_LD_LIBS='${LIBS}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - - # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc - #CFLAGS="$CFLAGS +DAportable" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - hpux_arch=`${CC} -dumpmachine` - case $hpux_arch in - hppa64*) - # 64-bit gcc in use. Fix flags for GNU ld. - do64bit_ok=yes - SHLIB_LD="${CC} -shared" - SHLIB_LD_LIBS='${LIBS}' - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ;; - *) - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - ;; - esac - else - do64bit_ok=yes - CFLAGS="$CFLAGS +DD64" - LDFLAGS_ARCH="+DD64" - fi - fi - ;; - HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) - SHLIB_SUFFIX=".sl" - AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS="" - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - ;; - IRIX-5.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - ;; - IRIX-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mabi=n32" - LDFLAGS="$LDFLAGS -mabi=n32" - else - case $system in - IRIX-6.3) - # Use to build 6.2 compatible binaries on 6.3. - CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" - ;; - *) - CFLAGS="$CFLAGS -n32" - ;; - esac - LDFLAGS="$LDFLAGS -n32" - fi - ;; - IRIX64-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - - # Check to enable 64-bit flags for compiler/linker - - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN([64bit mode not supported by gcc]) - else - do64bit_ok=yes - SHLIB_LD="ld -64 -shared -rdata_shared" - CFLAGS="$CFLAGS -64" - LDFLAGS_ARCH="-64" - fi - fi - ;; - Linux*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings - # when you inline the string and math operations. Turn this off to - # get rid of the warnings. - #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" - - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - if test $do64bit = yes; then - AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -m64" - AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_m64 = yes; then - CFLAGS="$CFLAGS -m64" - do64bit_ok=yes - fi - fi - - # The combo of gcc + glibc has a bug related - # to inlining of functions like strtod(). The - # -fno-builtin flag should address this problem - # but it does not work. The -fno-inline flag - # is kind of overkill but it works. - # Disable inlining only when one of the - # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x ; then - CFLAGS="$CFLAGS -fno-inline" - fi - - ;; - GNU*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - SHLIB_LD="${CC} -shared" - DL_OBJS="" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - ;; - Lynx*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - CFLAGS_OPTIMIZE=-02 - SHLIB_LD="${CC} -shared " - DL_OBJS="tclLoadDl.o" - DL_LIBS="-mshared -ldl" - LD_FLAGS="-Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - ;; - MP-RAS-02*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - MP-RAS-*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,-Bexport" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - NetBSD-*|FreeBSD-[[1-2]].*) - # NetBSD/SPARC needs -fPIC, -fpic will not do. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ - AC_EGREP_CPP(yes, [ -#ifdef __ELF__ - yes -#endif - ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) - if test $tcl_cv_ld_elf = yes; then - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - else - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - fi - - # Ancient FreeBSD doesn't handle version numbers with dots. - - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - OpenBSD-*) - # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. - case `machine` in - sparc|sparc64) - SHLIB_CFLAGS="-fPIC";; - *) - SHLIB_CFLAGS="-fpic";; - esac - SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ - AC_EGREP_CPP(yes, [ -#ifdef __ELF__ - yes -#endif - ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) - if test $tcl_cv_ld_elf = yes; then - LDFLAGS=-Wl,-export-dynamic - else - LDFLAGS="" - fi - - # OpenBSD doesn't do version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - FreeBSD-*) - # FreeBSD 3.* and greater have ELF. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "${TCL_THREADS}" = "1" ; then - # The -pthread needs to go in the CFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - case $system in - FreeBSD-3.*) - # FreeBSD-3 doesn't handle version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - TCL_LIB_VERSIONS_OK=nodots - ;; - esac - ;; - Darwin-*) - CFLAGS_OPTIMIZE="-Os" - SHLIB_CFLAGS="-fno-common" - # To avoid discrepancies between what headers configure sees during - # preprocessing tests and compiling tests, move any -isysroot and - # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: - CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" - CFLAGS="`echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" - if test $do64bit = yes; then - case `arch` in - ppc) - AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], - tcl_cv_cc_arch_ppc64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes, - tcl_cv_cc_arch_ppc64=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_arch_ppc64 = yes; then - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - do64bit_ok=yes - fi;; - i386) - AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], - tcl_cv_cc_arch_x86_64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch x86_64" - AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes, - tcl_cv_cc_arch_x86_64=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_arch_x86_64 = yes; then - CFLAGS="$CFLAGS -arch x86_64" - do64bit_ok=yes - fi;; - *) - AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; - esac - else - # Check for combined 32-bit and 64-bit fat build - echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ - echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ - fat_32_64=yes - fi - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' - AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) - LDFLAGS=$hold_ldflags]) - if test $tcl_cv_ld_single_module = yes; then - SHLIB_LD="${SHLIB_LD} -Wl,-single_module" - fi - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dylib" - DL_OBJS="tclLoadDyld.o" - DL_LIBS="" - # Don't use -prebind when building for Mac OS X 10.4 or later only: - test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \ - "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \ - LDFLAGS="$LDFLAGS -prebind" - LDFLAGS="$LDFLAGS -headerpad_max_install_names" - AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no) - LDFLAGS=$hold_ldflags]) - if test $tcl_cv_ld_search_paths_first = yes; then - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" - - # TEA specific: for Tk extensions, remove 64-bit arch flags from - # CFLAGS et al. for combined 32 & 64 bit fat builds as neither - # TkAqua nor TkX11 can be built for 64-bit at present. - test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done - ;; - NEXTSTEP-*) - SHLIB_CFLAGS="" - SHLIB_LD="cc -nostdlib -r" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadNext.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OS/390-*) - CFLAGS_OPTIMIZE="" # Optimizer is buggy - AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h - [Should OS/390 do the right thing with sockets?]) - ;; - OSF1-1.0|OSF1-1.1|OSF1-1.2) - # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 - SHLIB_CFLAGS="" - # Hack: make package name same as library name - SHLIB_LD='ld -R -export $@:' - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadOSF.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-1.*) - # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - SHLIB_CFLAGS="-fPIC" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD="ld -shared" - else - SHLIB_LD="ld -non_shared" - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-V*) - # Digital OSF/1 - SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD='ld -shared -expect_unresolved "*"' - else - SHLIB_LD='ld -non_shared -expect_unresolved "*"' - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mieee" - else - CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" - fi - # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = "1" ; then - CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" - CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" - LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = "yes" ; then - LIBS="$LIBS -lpthread -lmach -lexc" - else - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - fi - - ;; - QNX-6*) - # QNX RTP - # This may work for all QNX, but it was only reported for v6. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - # dlopen is in -lc on QNX - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SCO_SV-3.2*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, - # this test works, since "uname -s" was non-standard in 3.2.4 and - # below. - if test "$GCC" = "yes" ; then - SHLIB_CFLAGS="-fPIC -melf" - LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" - else - SHLIB_CFLAGS="-Kpic -belf" - LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" - fi - SHLIB_LD="ld -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SINIX*5.4*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SunOS-4*) - SHLIB_CFLAGS="-PIC" - SHLIB_LD="ld" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - - # SunOS can't handle version numbers with dots in them in library - # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it - # requires an extra version number at the end of .so file names. - # So, the library has to have a name like libtcl75.so.1.0 - - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - SunOS-5.[[0-6]]) - # Careful to not let 5.10+ fall into this case - - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - - SHLIB_CFLAGS="-KPIC" - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - ;; - SunOS-5*) - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - - SHLIB_CFLAGS="-KPIC" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - arch=`isainfo` - if test "$arch" = "sparcv9 sparc" ; then - if test "$GCC" = "yes" ; then - if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then - AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) - else - do64bit_ok=yes - CFLAGS="$CFLAGS -m64 -mcpu=v9" - LDFLAGS="$LDFLAGS -m64 -mcpu=v9" - SHLIB_CFLAGS="-fPIC" - fi - else - do64bit_ok=yes - if test "$do64bitVIS" = "yes" ; then - CFLAGS="$CFLAGS -xarch=v9a" - LDFLAGS_ARCH="-xarch=v9a" - else - CFLAGS="$CFLAGS -xarch=v9" - LDFLAGS_ARCH="-xarch=v9" - fi - # Solaris 64 uses this as well - #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" - fi - elif test "$arch" = "amd64 i386" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - else - do64bit_ok=yes - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64" - fi - else - AC_MSG_WARN([64bit mode not supported for $arch]) - fi - fi - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = "yes" ; then - # We need to specify -static-libgcc or we need to - # add the path to the sparv9 libgcc. - # JH: static-libgcc is necessary for core Tcl, but may - # not be necessary for extensions. - SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" - # for finding sparcv9 libgcc, get the regular libgcc - # path, remove so name and append 'sparcv9' - #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." - #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" - fi - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - fi - ;; - UNIX_SV* | UnixWare-5*) - SHLIB_CFLAGS="-KPIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers - # that don't grok the -Bexport option. Test that it does. - AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-Bexport" - AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) - LDFLAGS=$hold_ldflags]) - if test $tcl_cv_ld_Bexport = yes; then - LDFLAGS="$LDFLAGS -Wl,-Bexport" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - esac - - if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then - AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) - fi - -dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so -dnl # until the end of configure, as configure's compile and link tests use -dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's -dnl # preprocessing tests use only CPPFLAGS. - AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) - - # Step 4: disable dynamic loading if requested via a command-line switch. - - AC_ARG_ENABLE(load, - AC_HELP_STRING([--enable-load], - [allow dynamic loading and "load" command (default: on)]), - [tcl_ok=$enableval], [tcl_ok=yes]) - if test "$tcl_ok" = "no"; then - DL_OBJS="" - fi - - if test "x$DL_OBJS" != "x" ; then - BUILD_DLTEST="\$(DLTEST_TARGETS)" - else - echo "Can't figure out how to do dynamic loading or shared libraries" - echo "on this system." - SHLIB_CFLAGS="" - SHLIB_LD="" - SHLIB_SUFFIX="" - DL_OBJS="tclLoadNone.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS_ORIG" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - BUILD_DLTEST="" - fi - LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" - - # If we're running gcc, then change the C flags for compiling shared - # libraries to the right flags for gcc, instead of those for the - # standard manufacturer compiler. - - if test "$DL_OBJS" != "tclLoadNone.o" ; then - if test "$GCC" = "yes" ; then - case $system in - AIX-*) - ;; - BSD/OS*) - ;; - IRIX*) - ;; - NetBSD-*|FreeBSD-*) - ;; - Darwin-*) - ;; - SCO_SV-3.2*) - ;; - windows) - ;; - *) - SHLIB_CFLAGS="-fPIC" - ;; - esac - fi - fi - - if test "$SHARED_LIB_SUFFIX" = "" ; then - SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' - fi - if test "$UNSHARED_LIB_SUFFIX" = "" ; then - UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' - fi - - AC_SUBST(DL_LIBS) - - AC_SUBST(CFLAGS_DEBUG) - AC_SUBST(CFLAGS_OPTIMIZE) - AC_SUBST(CFLAGS_WARNING) - - AC_SUBST(STLIB_LD) - AC_SUBST(SHLIB_LD) - - AC_SUBST(SHLIB_LD_LIBS) - AC_SUBST(SHLIB_CFLAGS) - - AC_SUBST(LD_LIBRARY_PATH_VAR) - - # These must be called after we do the basic CFLAGS checks and - # verify any possible 64-bit or similar switches are necessary - TEA_TCL_EARLY_FLAGS - TEA_TCL_64BIT_FLAGS -]) - -#-------------------------------------------------------------------- -# TEA_SERIAL_PORT -# -# Determine which interface to use to talk to the serial port. -# Note that #include lines must begin in leftmost column for -# some compilers to recognize them as preprocessor directives, -# and some build environments have stdin not pointing at a -# pseudo-terminal (usually /dev/null instead.) -# -# Arguments: -# none -# -# Results: -# -# Defines only one of the following vars: -# HAVE_SYS_MODEM_H -# USE_TERMIOS -# USE_TERMIO -# USE_SGTTY -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_SERIAL_PORT], [ - AC_CHECK_HEADERS(sys/modem.h) - AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ - AC_TRY_RUN([ -#include - -int main() { - struct termios t; - if (tcgetattr(0, &t) == 0) { - cfsetospeed(&t, 0); - t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - if test $tcl_cv_api_serial = no ; then - AC_TRY_RUN([ -#include - -int main() { - struct termio t; - if (ioctl(0, TCGETA, &t) == 0) { - t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no ; then - AC_TRY_RUN([ -#include - -int main() { - struct sgttyb t; - if (ioctl(0, TIOCGETP, &t) == 0) { - t.sg_ospeed = 0; - t.sg_flags |= ODDP | EVENP | RAW; - return 0; - } - return 1; -}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no ; then - AC_TRY_RUN([ -#include -#include - -int main() { - struct termios t; - if (tcgetattr(0, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - cfsetospeed(&t, 0); - t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no; then - AC_TRY_RUN([ -#include -#include - -int main() { - struct termio t; - if (ioctl(0, TCGETA, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; - }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no; then - AC_TRY_RUN([ -#include -#include - -int main() { - struct sgttyb t; - if (ioctl(0, TIOCGETP, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - t.sg_ospeed = 0; - t.sg_flags |= ODDP | EVENP | RAW; - return 0; - } - return 1; -}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) - fi]) - case $tcl_cv_api_serial in - termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; - termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; - sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; - esac -]) - -#-------------------------------------------------------------------- -# TEA_MISSING_POSIX_HEADERS -# -# Supply substitutes for missing POSIX header files. Special -# notes: -# - stdlib.h doesn't define strtol, strtoul, or -# strtod insome versions of SunOS -# - some versions of string.h don't declare procedures such -# as strstr -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# NO_DIRENT_H -# NO_ERRNO_H -# NO_VALUES_H -# HAVE_LIMITS_H or NO_LIMITS_H -# NO_STDLIB_H -# NO_STRING_H -# NO_SYS_WAIT_H -# NO_DLFCN_H -# HAVE_SYS_PARAM_H -# -# HAVE_STRING_H ? -# -# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and -# CHECK on limits.h -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ - AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ - AC_TRY_LINK([#include -#include ], [ -#ifndef _POSIX_SOURCE -# ifdef __Lynx__ - /* - * Generate compilation error to make the test fail: Lynx headers - * are only valid if really in the POSIX environment. - */ - - missing_procedure(); -# endif -#endif -DIR *d; -struct dirent *entryPtr; -char *p; -d = opendir("foobar"); -entryPtr = readdir(d); -p = entryPtr->d_name; -closedir(d); -], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) - - if test $tcl_cv_dirent_h = no; then - AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) - fi - - AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(limits.h, - [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], - [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) - AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) - AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) - AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) - if test $tcl_ok = 0; then - AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) - fi - AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) - AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) - AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) - - # See also memmove check below for a place where NO_STRING_H can be - # set and why. - - if test $tcl_ok = 0; then - AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) - fi - - AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) - - # OS/390 lacks sys/param.h (and doesn't need it, by chance). - AC_HAVE_HEADERS(sys/param.h) -]) - -#-------------------------------------------------------------------- -# TEA_PATH_X -# -# Locate the X11 header files and the X11 library archive. Try -# the ac_path_x macro first, but if it doesn't find the X stuff -# (e.g. because there's no xmkmf program) then check through -# a list of possible directories. Under some conditions the -# autoconf macro will return an include directory that contains -# no include files, so double-check its result just to be safe. -# -# This should be called after TEA_CONFIG_CFLAGS as setting the -# LIBS line can confuse some configure macro magic. -# -# Arguments: -# none -# -# Results: -# -# Sets the following vars: -# XINCLUDES -# XLIBSW -# PKG_LIBS (appends to) -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_PATH_X], [ - if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then - TEA_PATH_UNIX_X - fi -]) - -AC_DEFUN([TEA_PATH_UNIX_X], [ - AC_PATH_X - not_really_there="" - if test "$no_x" = ""; then - if test "$x_includes" = ""; then - AC_TRY_CPP([#include ], , not_really_there="yes") - else - if test ! -r $x_includes/X11/Intrinsic.h; then - not_really_there="yes" - fi - fi - fi - if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then - AC_MSG_CHECKING([for X11 header files]) - found_xincludes="no" - AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") - if test "$found_xincludes" = "no"; then - dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" - for i in $dirs ; do - if test -r $i/X11/Intrinsic.h; then - AC_MSG_RESULT([$i]) - XINCLUDES=" -I$i" - found_xincludes="yes" - break - fi - done - fi - else - if test "$x_includes" != ""; then - XINCLUDES="-I$x_includes" - found_xincludes="yes" - fi - fi - if test found_xincludes = "no"; then - AC_MSG_RESULT([couldn't find any!]) - fi - - if test "$no_x" = yes; then - AC_MSG_CHECKING([for X11 libraries]) - XLIBSW=nope - dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" - for i in $dirs ; do - if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then - AC_MSG_RESULT([$i]) - XLIBSW="-L$i -lX11" - x_libraries="$i" - break - fi - done - else - if test "$x_libraries" = ""; then - XLIBSW=-lX11 - else - XLIBSW="-L$x_libraries -lX11" - fi - fi - if test "$XLIBSW" = nope ; then - AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) - fi - if test "$XLIBSW" = nope ; then - AC_MSG_RESULT([could not find any! Using -lX11.]) - XLIBSW=-lX11 - fi - if test x"${XLIBSW}" != x ; then - PKG_LIBS="${PKG_LIBS} ${XLIBSW}" - fi -]) - -#-------------------------------------------------------------------- -# TEA_BLOCKING_STYLE -# -# The statements below check for systems where POSIX-style -# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. -# On these systems (mostly older ones), use the old BSD-style -# FIONBIO approach instead. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# HAVE_SYS_IOCTL_H -# HAVE_SYS_FILIO_H -# USE_FIONBIO -# O_NONBLOCK -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_BLOCKING_STYLE], [ - AC_CHECK_HEADERS(sys/ioctl.h) - AC_CHECK_HEADERS(sys/filio.h) - TEA_CONFIG_SYSTEM - AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) - case $system in - # There used to be code here to use FIONBIO under AIX. However, it - # was reported that FIONBIO doesn't work under AIX 3.2.5. Since - # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO - # code (JO, 5/31/97). - - OSF*) - AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) - AC_MSG_RESULT([FIONBIO]) - ;; - SunOS-4*) - AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) - AC_MSG_RESULT([FIONBIO]) - ;; - *) - AC_MSG_RESULT([O_NONBLOCK]) - ;; - esac -]) - -#-------------------------------------------------------------------- -# TEA_TIME_HANLDER -# -# Checks how the system deals with time.h, what time structures -# are used on the system, and what fields the structures have. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# USE_DELTA_FOR_TZ -# HAVE_TM_GMTOFF -# HAVE_TM_TZADJ -# HAVE_TIMEZONE_VAR -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TIME_HANDLER], [ - AC_CHECK_HEADERS(sys/time.h) - AC_HEADER_TIME - AC_STRUCT_TIMEZONE - - AC_CHECK_FUNCS(gmtime_r localtime_r) - - AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ - AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], - tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) - if test $tcl_cv_member_tm_tzadj = yes ; then - AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) - fi - - AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ - AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], - tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) - if test $tcl_cv_member_tm_gmtoff = yes ; then - AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) - fi - - # - # Its important to include time.h in this check, as some systems - # (like convex) have timezone functions, etc. - # - AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ - AC_TRY_COMPILE([#include ], - [extern long timezone; - timezone += 1; - exit (0);], - tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) - if test $tcl_cv_timezone_long = yes ; then - AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) - else - # - # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. - # - AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ - AC_TRY_COMPILE([#include ], - [extern time_t timezone; - timezone += 1; - exit (0);], - tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) - if test $tcl_cv_timezone_time = yes ; then - AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) - fi - fi -]) - -#-------------------------------------------------------------------- -# TEA_BUGGY_STRTOD -# -# Under Solaris 2.4, strtod returns the wrong value for the -# terminating character under some conditions. Check for this -# and if the problem exists use a substitute procedure -# "fixstrtod" (provided by Tcl) that corrects the error. -# Also, on Compaq's Tru64 Unix 5.0, -# strtod(" ") returns 0.0 instead of a failure to convert. -# -# Arguments: -# none -# -# Results: -# -# Might defines some of the following vars: -# strtod (=fixstrtod) -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_BUGGY_STRTOD], [ - AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) - if test "$tcl_strtod" = 1; then - AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ - AC_TRY_RUN([ - extern double strtod(); - int main() { - char *infString="Inf", *nanString="NaN", *spaceString=" "; - char *term; - double value; - value = strtod(infString, &term); - if ((term != infString) && (term[-1] == 0)) { - exit(1); - } - value = strtod(nanString, &term); - if ((term != nanString) && (term[-1] == 0)) { - exit(1); - } - value = strtod(spaceString, &term); - if (term == (spaceString+1)) { - exit(1); - } - exit(0); - }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, - tcl_cv_strtod_buggy=buggy)]) - if test "$tcl_cv_strtod_buggy" = buggy; then - AC_LIBOBJ([fixstrtod]) - USE_COMPAT=1 - AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) - fi - fi -]) - -#-------------------------------------------------------------------- -# TEA_TCL_LINK_LIBS -# -# Search for the libraries needed to link the Tcl shell. -# Things like the math library (-lm) and socket stuff (-lsocket vs. -# -lnsl) are dealt with here. -# -# Arguments: -# Requires the following vars to be set in the Makefile: -# DL_LIBS -# LIBS -# MATH_LIBS -# -# Results: -# -# Subst's the following var: -# TCL_LIBS -# MATH_LIBS -# -# Might append to the following vars: -# LIBS -# -# Might define the following vars: -# HAVE_NET_ERRNO_H -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_LINK_LIBS], [ - #-------------------------------------------------------------------- - # On a few very rare systems, all of the libm.a stuff is - # already in libc.a. Set compiler flags accordingly. - # Also, Linux requires the "ieee" library for math to work - # right (and it must appear before "-lm"). - #-------------------------------------------------------------------- - - AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") - AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) - - #-------------------------------------------------------------------- - # Interactive UNIX requires -linet instead of -lsocket, plus it - # needs net/errno.h to define the socket-related error codes. - #-------------------------------------------------------------------- - - AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) - AC_CHECK_HEADER(net/errno.h, [ - AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) - - #-------------------------------------------------------------------- - # Check for the existence of the -lsocket and -lnsl libraries. - # The order here is important, so that they end up in the right - # order in the command line generated by make. Here are some - # special considerations: - # 1. Use "connect" and "accept" to check for -lsocket, and - # "gethostbyname" to check for -lnsl. - # 2. Use each function name only once: can't redo a check because - # autoconf caches the results of the last check and won't redo it. - # 3. Use -lnsl and -lsocket only if they supply procedures that - # aren't already present in the normal libraries. This is because - # IRIX 5.2 has libraries, but they aren't needed and they're - # bogus: they goof up name resolution if used. - # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. - # To get around this problem, check for both libraries together - # if -lsocket doesn't work by itself. - #-------------------------------------------------------------------- - - tcl_checkBoth=0 - AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) - if test "$tcl_checkSocket" = 1; then - AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, - LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) - fi - if test "$tcl_checkBoth" = 1; then - tk_oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) - fi - AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, - [LIBS="$LIBS -lnsl"])]) - - # Don't perform the eval of the libraries here because DL_LIBS - # won't be set until we call TEA_CONFIG_CFLAGS - - TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' - AC_SUBST(TCL_LIBS) - AC_SUBST(MATH_LIBS) -]) - -#-------------------------------------------------------------------- -# TEA_TCL_EARLY_FLAGS -# -# Check for what flags are needed to be passed so the correct OS -# features are available. -# -# Arguments: -# None -# -# Results: -# -# Might define the following vars: -# _ISOC99_SOURCE -# _LARGEFILE64_SOURCE -# _LARGEFILE_SOURCE64 -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_EARLY_FLAG],[ - AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), - AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, - AC_TRY_COMPILE([[#define ]$1[ 1 -]$2], $3, - [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, - [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) - if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then - AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) - tcl_flags="$tcl_flags $1" - fi -]) - -AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ - AC_MSG_CHECKING([for required early compiler flags]) - tcl_flags="" - TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], - [char *p = (char *)strtoll; char *q = (char *)strtoull;]) - TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], - [struct stat64 buf; int i = stat64("/", &buf);]) - TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ], - [char *p = (char *)open64;]) - if test "x${tcl_flags}" = "x" ; then - AC_MSG_RESULT([none]) - else - AC_MSG_RESULT([${tcl_flags}]) - fi -]) - -#-------------------------------------------------------------------- -# TEA_TCL_64BIT_FLAGS -# -# Check for what is defined in the way of 64-bit features. -# -# Arguments: -# None -# -# Results: -# -# Might define the following vars: -# TCL_WIDE_INT_IS_LONG -# TCL_WIDE_INT_TYPE -# HAVE_STRUCT_DIRENT64 -# HAVE_STRUCT_STAT64 -# HAVE_TYPE_OFF64_T -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ - AC_MSG_CHECKING([for 64-bit integer type]) - AC_CACHE_VAL(tcl_cv_type_64bit,[ - tcl_cv_type_64bit=none - # See if the compiler knows natively about __int64 - AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], - tcl_type_64bit=__int64, tcl_type_64bit="long long") - # See if we should use long anyway Note that we substitute in the - # type that is our current guess for a 64-bit type inside this check - # program, so it should be modified only carefully... - AC_TRY_COMPILE(,[switch (0) { - case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; - }],tcl_cv_type_64bit=${tcl_type_64bit})]) - if test "${tcl_cv_type_64bit}" = none ; then - AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) - AC_MSG_RESULT([using long]) - elif test "${tcl_cv_type_64bit}" = "__int64" \ - -a "${TEA_PLATFORM}" = "windows" ; then - # We actually want to use the default tcl.h checks in this - # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* - AC_MSG_RESULT([using Tcl header defaults]) - else - AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, - [What type should be used to define wide integers?]) - AC_MSG_RESULT([${tcl_cv_type_64bit}]) - - # Now check for auxiliary declarations - AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ - AC_TRY_COMPILE([#include -#include ],[struct dirent64 p;], - tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) - if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then - AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) - fi - - AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ - AC_TRY_COMPILE([#include ],[struct stat64 p; -], - tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) - if test "x${tcl_cv_struct_stat64}" = "xyes" ; then - AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) - fi - - AC_CHECK_FUNCS(open64 lseek64) - AC_MSG_CHECKING([for off64_t]) - AC_CACHE_VAL(tcl_cv_type_off64_t,[ - AC_TRY_COMPILE([#include ],[off64_t offset; -], - tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) - dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the - dnl functions lseek64 and open64 are defined. - if test "x${tcl_cv_type_off64_t}" = "xyes" && \ - test "x${ac_cv_func_lseek64}" = "xyes" && \ - test "x${ac_cv_func_open64}" = "xyes" ; then - AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi -]) - -## -## Here ends the standard Tcl configuration bits and starts the -## TEA specific functions -## - -#------------------------------------------------------------------------ -# TEA_INIT -- -# -# Init various Tcl Extension Architecture (TEA) variables. -# This should be the first called TEA_* macro. -# -# Arguments: -# none -# -# Results: -# -# Defines and substs the following vars: -# CYGPATH -# EXEEXT -# Defines only: -# TEA_VERSION -# TEA_INITED -# TEA_PLATFORM (windows or unix) -# -# "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. -# -# EXEEXT -# Select the executable extension based on the host type. This -# is a lightweight replacement for AC_EXEEXT that doesn't require -# a compiler. -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_INIT], [ - # TEA extensions pass this us the version of TEA they think they - # are compatible with. - TEA_VERSION="3.6" - - AC_MSG_CHECKING([for correct TEA configuration]) - if test x"${PACKAGE_NAME}" = x ; then - AC_MSG_ERROR([ -The PACKAGE_NAME variable must be defined by your TEA configure.in]) - fi - if test x"$1" = x ; then - AC_MSG_ERROR([ -TEA version not specified.]) - elif test "$1" != "${TEA_VERSION}" ; then - AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) - else - AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) - fi - case "`uname -s`" in - *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) - AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) - EXEEXT=".exe" - TEA_PLATFORM="windows" - ;; - *) - CYGPATH=echo - EXEEXT="" - TEA_PLATFORM="unix" - ;; - esac - - # Check if exec_prefix is set. If not use fall back to prefix. - # Note when adjusted, so that TEA_PREFIX can correct for this. - # This is needed for recursive configures, since autoconf propagates - # $prefix, but not $exec_prefix (doh!). - if test x$exec_prefix = xNONE ; then - exec_prefix_default=yes - exec_prefix=$prefix - fi - - AC_SUBST(EXEEXT) - AC_SUBST(CYGPATH) - - # This package name must be replaced statically for AC_SUBST to work - AC_SUBST(PKG_LIB_FILE) - # Substitute STUB_LIB_FILE in case package creates a stub library too. - AC_SUBST(PKG_STUB_LIB_FILE) - - # We AC_SUBST these here to ensure they are subst'ed, - # in case the user doesn't call TEA_ADD_... - AC_SUBST(PKG_STUB_SOURCES) - AC_SUBST(PKG_STUB_OBJECTS) - AC_SUBST(PKG_TCL_SOURCES) - AC_SUBST(PKG_HEADERS) - AC_SUBST(PKG_INCLUDES) - AC_SUBST(PKG_LIBS) - AC_SUBST(PKG_CFLAGS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_SOURCES -- -# -# Specify one or more source files. Users should check for -# the right platform before adding to their list. -# It is not important to specify the directory, as long as it is -# in the generic, win or unix subdirectory of $(srcdir). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_SOURCES -# PKG_OBJECTS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_SOURCES], [ - vars="$@" - for i in $vars; do - case $i in - [\$]*) - # allow $-var names - PKG_SOURCES="$PKG_SOURCES $i" - PKG_OBJECTS="$PKG_OBJECTS $i" - ;; - *) - # check for existence - allows for generic/win/unix VPATH - # To add more dirs here (like 'src'), you have to update VPATH - # in Makefile.in as well - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - AC_MSG_ERROR([could not find source file '$i']) - fi - PKG_SOURCES="$PKG_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" - fi - PKG_OBJECTS="$PKG_OBJECTS $j" - ;; - esac - done - AC_SUBST(PKG_SOURCES) - AC_SUBST(PKG_OBJECTS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_STUB_SOURCES -- -# -# Specify one or more source files. Users should check for -# the right platform before adding to their list. -# It is not important to specify the directory, as long as it is -# in the generic, win or unix subdirectory of $(srcdir). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_STUB_SOURCES -# PKG_STUB_OBJECTS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_STUB_SOURCES], [ - vars="$@" - for i in $vars; do - # check for existence - allows for generic/win/unix VPATH - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - AC_MSG_ERROR([could not find stub source file '$i']) - fi - PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" - fi - PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" - done - AC_SUBST(PKG_STUB_SOURCES) - AC_SUBST(PKG_STUB_OBJECTS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_TCL_SOURCES -- -# -# Specify one or more Tcl source files. These should be platform -# independent runtime files. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_TCL_SOURCES -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_TCL_SOURCES], [ - vars="$@" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) - fi - PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" - done - AC_SUBST(PKG_TCL_SOURCES) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_HEADERS -- -# -# Specify one or more source headers. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_HEADERS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_HEADERS], [ - vars="$@" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - AC_MSG_ERROR([could not find header file '${srcdir}/$i']) - fi - PKG_HEADERS="$PKG_HEADERS $i" - done - AC_SUBST(PKG_HEADERS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_INCLUDES -- -# -# Specify one or more include dirs. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_INCLUDES -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_INCLUDES], [ - vars="$@" - for i in $vars; do - PKG_INCLUDES="$PKG_INCLUDES $i" - done - AC_SUBST(PKG_INCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_LIBS -- -# -# Specify one or more libraries. Users should check for -# the right platform before adding to their list. For Windows, -# libraries provided in "foo.lib" format will be converted to -# "-lfoo" when using GCC (mingw). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_LIBS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_LIBS], [ - vars="$@" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - AC_SUBST(PKG_LIBS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_CFLAGS -- -# -# Specify one or more CFLAGS. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_CFLAGS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_CFLAGS], [ - PKG_CFLAGS="$PKG_CFLAGS $@" - AC_SUBST(PKG_CFLAGS) -]) - -#------------------------------------------------------------------------ -# TEA_PREFIX -- -# -# Handle the --prefix=... option by defaulting to what Tcl gave -# -# Arguments: -# none -# -# Results: -# -# If --prefix or --exec-prefix was not specified, $prefix and -# $exec_prefix will be set to the values given to Tcl when it was -# configured. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_PREFIX], [ - if test "${prefix}" = "NONE"; then - prefix_default=yes - if test x"${TCL_PREFIX}" != x; then - AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) - prefix=${TCL_PREFIX} - else - AC_MSG_NOTICE([--prefix defaulting to /usr/local]) - prefix=/usr/local - fi - fi - if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ - -o x"${exec_prefix_default}" = x"yes" ; then - if test x"${TCL_EXEC_PREFIX}" != x; then - AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) - exec_prefix=${TCL_EXEC_PREFIX} - else - AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) - exec_prefix=$prefix - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_SETUP_COMPILER_CC -- -# -# Do compiler checks the way we want. This is just a replacement -# for AC_PROG_CC in TEA configure.in files to make them cleaner. -# -# Arguments: -# none -# -# Results: -# -# Sets up CC var and other standard bits we need to make executables. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_SETUP_COMPILER_CC], [ - # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) - # in this macro, they need to go into TEA_SETUP_COMPILER instead. - - # If the user did not set CFLAGS, set it now to keep - # the AC_PROG_CC macro from adding "-g -O2". - if test "${CFLAGS+set}" != "set" ; then - CFLAGS="" - fi - - AC_PROG_CC - AC_PROG_CPP - - AC_PROG_INSTALL - - #-------------------------------------------------------------------- - # Checks to see if the make program sets the $MAKE variable. - #-------------------------------------------------------------------- - - AC_PROG_MAKE_SET - - #-------------------------------------------------------------------- - # Find ranlib - #-------------------------------------------------------------------- - - AC_PROG_RANLIB - - #-------------------------------------------------------------------- - # Determines the correct binary file extension (.o, .obj, .exe etc.) - #-------------------------------------------------------------------- - - AC_OBJEXT - AC_EXEEXT -]) - -#------------------------------------------------------------------------ -# TEA_SETUP_COMPILER -- -# -# Do compiler checks that use the compiler. This must go after -# TEA_SETUP_COMPILER_CC, which does the actual compiler check. -# -# Arguments: -# none -# -# Results: -# -# Sets up CC var and other standard bits we need to make executables. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_SETUP_COMPILER], [ - # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. - AC_REQUIRE([TEA_SETUP_COMPILER_CC]) - - #------------------------------------------------------------------------ - # If we're using GCC, see if the compiler understands -pipe. If so, use it. - # It makes compiling go faster. (This is only a performance feature.) - #------------------------------------------------------------------------ - - if test -z "$no_pipe" -a -n "$GCC"; then - AC_CACHE_CHECK([if the compiler understands -pipe], - tcl_cv_cc_pipe, [ - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_pipe = yes; then - CFLAGS="$CFLAGS -pipe" - fi - fi - - #-------------------------------------------------------------------- - # Common compiler flag setup - #-------------------------------------------------------------------- - - AC_C_BIGENDIAN - if test "${TEA_PLATFORM}" = "unix" ; then - TEA_TCL_LINK_LIBS - TEA_MISSING_POSIX_HEADERS - # Let the user call this, because if it triggers, they will - # need a compat/strtod.c that is correct. Users can also - # use Tcl_GetDouble(FromObj) instead. - #TEA_BUGGY_STRTOD - fi -]) - -#------------------------------------------------------------------------ -# TEA_MAKE_LIB -- -# -# Generate a line that can be used to build a shared/unshared library -# in a platform independent manner. -# -# Arguments: -# none -# -# Requires: -# -# Results: -# -# Defines the following vars: -# CFLAGS - Done late here to note disturb other AC macros -# MAKE_LIB - Command to execute to build the Tcl library; -# differs depending on whether or not Tcl is being -# compiled as a shared library. -# MAKE_SHARED_LIB Makefile rule for building a shared library -# MAKE_STATIC_LIB Makefile rule for building a static library -# MAKE_STUB_LIB Makefile rule for building a stub library -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_MAKE_LIB], [ - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then - MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" - MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" - else - MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" - MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" - fi - - if test "${SHARED_BUILD}" = "1" ; then - MAKE_LIB="${MAKE_SHARED_LIB} " - else - MAKE_LIB="${MAKE_STATIC_LIB} " - fi - - #-------------------------------------------------------------------- - # Shared libraries and static libraries have different names. - # Use the double eval to make sure any variables in the suffix is - # substituted. (@@@ Might not be necessary anymore) - #-------------------------------------------------------------------- - - if test "${TEA_PLATFORM}" = "windows" ; then - if test "${SHARED_BUILD}" = "1" ; then - # We force the unresolved linking of symbols that are really in - # the private libraries of Tcl and Tk. - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" - fi - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - else - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - if test "$GCC" = "yes"; then - PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} - fi - # These aren't needed on Windows (either MSVC or gcc) - RANLIB=: - RANLIB_STUB=: - else - RANLIB_STUB="${RANLIB}" - if test "${SHARED_BUILD}" = "1" ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" - fi - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - fi - - # These are escaped so that only CFLAGS is picked up at configure time. - # The other values will be substituted at make time. - CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" - if test "${SHARED_BUILD}" = "1" ; then - CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" - fi - - AC_SUBST(MAKE_LIB) - AC_SUBST(MAKE_SHARED_LIB) - AC_SUBST(MAKE_STATIC_LIB) - AC_SUBST(MAKE_STUB_LIB) - AC_SUBST(RANLIB_STUB) -]) - -#------------------------------------------------------------------------ -# TEA_LIB_SPEC -- -# -# Compute the name of an existing object library located in libdir -# from the given base name and produce the appropriate linker flags. -# -# Arguments: -# basename The base name of the library without version -# numbers, extensions, or "lib" prefixes. -# extra_dir Extra directory in which to search for the -# library. This location is used first, then -# $prefix/$exec-prefix, then some defaults. -# -# Requires: -# TEA_INIT and TEA_PREFIX must be called first. -# -# Results: -# -# Defines the following vars: -# ${basename}_LIB_NAME The computed library name. -# ${basename}_LIB_SPEC The computed linker flags. -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LIB_SPEC], [ - AC_MSG_CHECKING([for $1 library]) - - # Look in exec-prefix for the library (defined by TEA_PREFIX). - - tea_lib_name_dir="${exec_prefix}/lib" - - # Or in a user-specified location. - - if test x"$2" != x ; then - tea_extra_lib_dir=$2 - else - tea_extra_lib_dir=NONE - fi - - for i in \ - `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do - if test -f "$i" ; then - tea_lib_name_dir=`dirname $i` - $1_LIB_NAME=`basename $i` - $1_LIB_PATH_NAME=$i - break - fi - done - - if test "${TEA_PLATFORM}" = "windows"; then - $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" - else - # Strip off the leading "lib" and trailing ".a" or ".so" - - tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` - $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" - fi - - if test "x${$1_LIB_NAME}" = x ; then - AC_MSG_ERROR([not found]) - else - AC_MSG_RESULT([${$1_LIB_SPEC}]) - fi -]) - -#------------------------------------------------------------------------ -# TEA_PRIVATE_TCL_HEADERS -- -# -# Locate the private Tcl include files -# -# Arguments: -# -# Requires: -# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has -# already been called. -# -# Results: -# -# Substs the following vars: -# TCL_TOP_DIR_NATIVE -# TCL_GENERIC_DIR_NATIVE -# TCL_UNIX_DIR_NATIVE -# TCL_WIN_DIR_NATIVE -# TCL_BMAP_DIR_NATIVE -# TCL_TOOL_DIR_NATIVE -# TCL_PLATFORM_DIR_NATIVE -# TCL_BIN_DIR_NATIVE -# TCL_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ - AC_MSG_CHECKING([for Tcl private include files]) - - TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` - TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" - TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" - TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" - TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" - TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" - TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" - TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" - - if test "${TEA_PLATFORM}" = "windows"; then - TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} - else - TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} - fi - # We want to ensure these are substituted so as not to require - # any *_NATIVE vars be defined in the Makefile - TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers and PrivateHeaders directories - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then - TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else - TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi - ;; - esac - else - if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then - AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) - fi - fi - - - AC_SUBST(TCL_TOP_DIR_NATIVE) - AC_SUBST(TCL_GENERIC_DIR_NATIVE) - AC_SUBST(TCL_UNIX_DIR_NATIVE) - AC_SUBST(TCL_WIN_DIR_NATIVE) - AC_SUBST(TCL_BMAP_DIR_NATIVE) - AC_SUBST(TCL_TOOL_DIR_NATIVE) - AC_SUBST(TCL_PLATFORM_DIR_NATIVE) - - AC_SUBST(TCL_INCLUDES) - AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) -]) - -#------------------------------------------------------------------------ -# TEA_PUBLIC_TCL_HEADERS -- -# -# Locate the installed public Tcl header files -# -# Arguments: -# None. -# -# Requires: -# CYGPATH must be set -# -# Results: -# -# Adds a --with-tclinclude switch to configure. -# Result is cached. -# -# Substs the following vars: -# TCL_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ - AC_MSG_CHECKING([for Tcl public headers]) - - AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) - - AC_CACHE_VAL(ac_cv_c_tclh, [ - # Use the value from --with-tclinclude, if it was given - - if test x"${with_tclinclude}" != x ; then - if test -f "${with_tclinclude}/tcl.h" ; then - ac_cv_c_tclh=${with_tclinclude} - else - AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) - fi - else - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers directory - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tcl is not installed, - # and in that situation, look there before installed locations. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - if test x"${TCL_INCLUDE_SPEC}" != x ; then - d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` - list="$list `ls -d ${d} 2>/dev/null`" - fi - fi - for i in $list ; do - if test -f "$i/tcl.h" ; then - ac_cv_c_tclh=$i - break - fi - done - fi - ]) - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tclh}" = x ; then - AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) - else - AC_MSG_RESULT([${ac_cv_c_tclh}]) - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` - - TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - AC_SUBST(TCL_INCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_PRIVATE_TK_HEADERS -- -# -# Locate the private Tk include files -# -# Arguments: -# -# Requires: -# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has -# already been called. -# -# Results: -# -# Substs the following vars: -# TK_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ - AC_MSG_CHECKING([for Tk private include files]) - - TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` - TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" - TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" - TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" - TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" - TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" - if test "${TEA_PLATFORM}" = "windows"; then - TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} - else - TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} - fi - # We want to ensure these are substituted so as not to require - # any *_NATIVE vars be defined in the Makefile - TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" - # Detect and add ttk subdir - if test -d ${TK_SRC_DIR_NATIVE}/generic/ttk; then - TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" - fi - if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ - -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" - fi - if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" - fi - if test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use - # the framework's Headers and PrivateHeaders directories - case ${TK_DEFS} in - *TK_FRAMEWORK*) - if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then - TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi - ;; - esac - else - if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then - AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) - fi - fi - - AC_SUBST(TK_TOP_DIR_NATIVE) - AC_SUBST(TK_UNIX_DIR_NATIVE) - AC_SUBST(TK_WIN_DIR_NATIVE) - AC_SUBST(TK_GENERIC_DIR_NATIVE) - AC_SUBST(TK_XLIB_DIR_NATIVE) - AC_SUBST(TK_PLATFORM_DIR_NATIVE) - - AC_SUBST(TK_INCLUDES) - AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) -]) - -#------------------------------------------------------------------------ -# TEA_PUBLIC_TK_HEADERS -- -# -# Locate the installed public Tk header files -# -# Arguments: -# None. -# -# Requires: -# CYGPATH must be set -# -# Results: -# -# Adds a --with-tkinclude switch to configure. -# Result is cached. -# -# Substs the following vars: -# TK_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ - AC_MSG_CHECKING([for Tk public headers]) - - AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) - - AC_CACHE_VAL(ac_cv_c_tkh, [ - # Use the value from --with-tkinclude, if it was given - - if test x"${with_tkinclude}" != x ; then - if test -f "${with_tkinclude}/tk.h" ; then - ac_cv_c_tkh=${with_tkinclude} - else - AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) - fi - else - if test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use - # the framework's Headers directory. - case ${TK_DEFS} in - *TK_FRAMEWORK*) - list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tk is not installed, - # and in that situation, look there before installed locations. - if test -f "${TK_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tk's --prefix location, - # relative to directory of tkConfig.sh, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TK_PREFIX}/include 2>/dev/null` \ - `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - fi - for i in $list ; do - if test -f "$i/tk.h" ; then - ac_cv_c_tkh=$i - break - fi - done - fi - ]) - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tkh}" = x ; then - AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) - else - AC_MSG_RESULT([${ac_cv_c_tkh}]) - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` - - TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - AC_SUBST(TK_INCLUDES) - - if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ - -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - # On Windows and Aqua, we need the X compat headers - AC_MSG_CHECKING([for X11 header files]) - if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then - INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" - TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - AC_SUBST(TK_XINCLUDES) - fi - AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) - fi -]) - -#------------------------------------------------------------------------ -# TEA_PROG_TCLSH -# Determine the fully qualified path name of the tclsh executable -# in the Tcl build directory or the tclsh installed in a bin -# directory. This macro will correctly determine the name -# of the tclsh executable even if tclsh has not yet been -# built in the build directory. The tclsh found is always -# associated with a tclConfig.sh file. This tclsh should be used -# only for running extension test cases. It should never be -# or generation of files (like pkgIndex.tcl) at build time. -# -# Arguments -# none -# -# Results -# Subst's the following values: -# TCLSH_PROG -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PROG_TCLSH], [ - AC_MSG_CHECKING([for tclsh]) - if test -f "${TCL_BIN_DIR}/Makefile" ; then - # tclConfig.sh is in Tcl build directory - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="${TCL_BIN_DIR}/tclsh" - fi - else - # tclConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" - fi - list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${TCLSH_PROG}" ; then - REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" - fi - AC_MSG_RESULT([${TCLSH_PROG}]) - AC_SUBST(TCLSH_PROG) -]) - -#------------------------------------------------------------------------ -# TEA_PROG_WISH -# Determine the fully qualified path name of the wish executable -# in the Tk build directory or the wish installed in a bin -# directory. This macro will correctly determine the name -# of the wish executable even if wish has not yet been -# built in the build directory. The wish found is always -# associated with a tkConfig.sh file. This wish should be used -# only for running extension test cases. It should never be -# or generation of files (like pkgIndex.tcl) at build time. -# -# Arguments -# none -# -# Results -# Subst's the following values: -# WISH_PROG -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PROG_WISH], [ - AC_MSG_CHECKING([for wish]) - if test -f "${TK_BIN_DIR}/Makefile" ; then - # tkConfig.sh is in Tk build directory - if test "${TEA_PLATFORM}" = "windows"; then - WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" - else - WISH_PROG="${TK_BIN_DIR}/wish" - fi - else - # tkConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" - else - WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" - fi - list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TK_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${WISH_PROG}" ; then - REAL_TK_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" - fi - AC_MSG_RESULT([${WISH_PROG}]) - AC_SUBST(WISH_PROG) -]) - -#------------------------------------------------------------------------ -# TEA_PATH_CONFIG -- -# -# Locate the ${1}Config.sh file and perform a sanity check on -# the ${1} compile flags. These are used by packages like -# [incr Tk] that load *Config.sh files from more than Tcl and Tk. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-$1=... -# -# Defines the following vars: -# $1_BIN_DIR Full path to the directory containing -# the $1Config.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_CONFIG], [ - # - # Ok, lets find the $1 configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-$1 - # - - if test x"${no_$1}" = x ; then - # we reset no_$1 in case something fails here - no_$1=true - AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) - AC_MSG_CHECKING([for $1 configuration]) - AC_CACHE_VAL(ac_cv_c_$1config,[ - - # First check to see if --with-$1 was specified. - if test x"${with_$1config}" != x ; then - case ${with_$1config} in - */$1Config.sh ) - if test -f ${with_$1config}; then - AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) - with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` - fi;; - esac - if test -f "${with_$1config}/$1Config.sh" ; then - ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` - else - AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) - fi - fi - - # then check for a private $1 installation - if test x"${ac_cv_c_$1config}" = x ; then - for i in \ - ../$1 \ - `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ../../$1 \ - `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ../../../$1 \ - `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ${srcdir}/../$1 \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ; do - if test -f "$i/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i; pwd)` - break - fi - if test -f "$i/unix/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i/unix; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_$1config}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_$1config}" = x ; then - $1_BIN_DIR="# no $1 configs found" - AC_MSG_WARN([Cannot find $1 configuration definitions]) - exit 0 - else - no_$1= - $1_BIN_DIR=${ac_cv_c_$1config} - AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_CONFIG -- -# -# Load the $1Config.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# $1_BIN_DIR -# -# Results: -# -# Subst the following vars: -# $1_SRC_DIR -# $1_LIB_FILE -# $1_LIB_SPEC -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_CONFIG], [ - AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) - - if test -f "${$1_BIN_DIR}/$1Config.sh" ; then - AC_MSG_RESULT([loading]) - . "${$1_BIN_DIR}/$1Config.sh" - else - AC_MSG_RESULT([file not found]) - fi - - # - # If the $1_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable $1_LIB_SPEC will be set to the value - # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC - # instead of $1_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - # - - if test -f "${$1_BIN_DIR}/Makefile" ; then - AC_MSG_WARN([Found Makefile - using build library specs for $1]) - $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} - $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} - $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} - fi - - AC_SUBST($1_VERSION) - AC_SUBST($1_BIN_DIR) - AC_SUBST($1_SRC_DIR) - - AC_SUBST($1_LIB_FILE) - AC_SUBST($1_LIB_SPEC) - - AC_SUBST($1_STUB_LIB_FILE) - AC_SUBST($1_STUB_LIB_SPEC) - AC_SUBST($1_STUB_LIB_PATH) -]) - -#------------------------------------------------------------------------ -# TEA_PATH_CELIB -- -# -# Locate Keuchel's celib emulation layer for targeting Win/CE -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-celib=... -# -# Defines the following vars: -# CELIB_DIR Full path to the directory containing -# the include and platform lib files -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_CELIB], [ - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-celib - - if test x"${no_celib}" = x ; then - # we reset no_celib in case something fails here - no_celib=true - AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) - AC_MSG_CHECKING([for Windows/CE celib directory]) - AC_CACHE_VAL(ac_cv_c_celibconfig,[ - # First check to see if --with-celibconfig was specified. - if test x"${with_celibconfig}" != x ; then - if test -d "${with_celibconfig}/inc" ; then - ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` - else - AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) - fi - fi - - # then check for a celib library - if test x"${ac_cv_c_celibconfig}" = x ; then - for i in \ - ../celib-palm-3.0 \ - ../celib \ - ../../celib-palm-3.0 \ - ../../celib \ - `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ - ${srcdir}/../celib-palm-3.0 \ - ${srcdir}/../celib \ - `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ - ; do - if test -d "$i/inc" ; then - ac_cv_c_celibconfig=`(cd $i; pwd)` - break - fi - done - fi - ]) - if test x"${ac_cv_c_celibconfig}" = x ; then - AC_MSG_ERROR([Cannot find celib support library directory]) - else - no_celib= - CELIB_DIR=${ac_cv_c_celibconfig} - CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` - AC_MSG_RESULT([found $CELIB_DIR]) - fi - fi -]) - - -# Local Variables: -# mode: autoconf -# End: Index: xotcl/library/store/XOTclSdbm/tune.h =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/tune.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/XOTclSdbm/tune.h (revision 0) @@ -1,34 +0,0 @@ -/* - * sdbm - ndbm work-alike hashed database library - * tuning and portability constructs [not nearly enough] - * author: oz@nexus.yorku.ca - */ - -#define BYTESIZ 8 - -#ifdef SVID -#include -#endif - -#ifdef BSD42 -#define SEEK_SET L_SET -#define memset(s,c,n) bzero(s, n) /* only when c is zero */ -#define memcpy(s1,s2,n) bcopy(s2, s1, n) -#define memcmp(s1,s2,n) bcmp(s1,s2,n) -#endif - -/* - * important tuning parms (hah) - */ - -#define SEEDUPS /* always detect duplicates */ -#define BADMESS /* generate a message for worst case: - cannot make room after SPLTMAX splits */ -/* - * misc - */ -#ifdef DEBUG -#define debug(x) printf x -#else -#define debug(x) -#endif Index: xotcl/library/store/XOTclSdbm/util.c =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/util.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/store/XOTclSdbm/util.c (revision 0) @@ -1,189 +0,0 @@ -#include "config.h" -#include -#include -#include "sdbm.h" - -#ifdef HAVE_SYS_FILE_H -#include -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif -#include -extern int errno; - -void -oops(s1, s2) -register char *s1; -register char *s2; -{ -#ifndef HAVE_STRERROR - extern int sys_nerr; - extern char *sys_errlist[]; -#endif - extern char *progname; - - if (progname) - fprintf(stderr, "%s: ", progname); - fprintf(stderr, s1, s2); -#ifndef HAVE_STRERROR - if (errno > 0 && errno < sys_nerr) - fprintf(stderr, " (%s)", sys_errlist[errno]); -#else - if (errno > 0) - fprintf(stderr, " (%s)", strerror(errno)); -#endif - fprintf(stderr, "\n"); - exit(1); -} - -int -okpage(char *pag) -{ - register unsigned n; - register off; - register short *ino = (short *) pag; - - if ((n = ino[0]) > PBLKSIZ / sizeof(short)) - return 0; - - if (!n) - return 1; - - off = PBLKSIZ; - for (ino++; n; ino += 2) { - if (ino[0] > off || ino[1] > off || - ino[1] > ino[0]) - return 0; - off = ino[1]; - n -= 2; - } - - return 1; -} - - - -/***************************************************************************\ -** ** -** Function name: getopt() ** -** Author: Henry Spencer, UofT ** -** Coding date: 84/04/28 ** -** ** -** Description: ** -** ** -** Parses argv[] for arguments. ** -** Works with Whitesmith's C compiler. ** -** ** -** Inputs - The number of arguments ** -** - The base address of the array of arguments ** -** - A string listing the valid options (':' indicates an ** -** argument to the preceding option is required, a ';' ** -** indicates an argument to the preceding option is optional) ** -** ** -** Outputs - Returns the next option character, ** -** '?' for non '-' arguments ** -** or ':' when there is no more arguments. ** -** ** -** Side Effects + The argument to an option is pointed to by 'optarg' ** -** ** -***************************************************************************** -** ** -** REVISION HISTORY: ** -** ** -** DATE NAME DESCRIPTION ** -** YY/MM/DD ------------------ ------------------------------------ ** -** 88/10/20 Janick Bergeron Returns '?' on unamed arguments ** -** returns '!' on unknown options ** -** and 'EOF' only when exhausted. ** -** 88/11/18 Janick Bergeron Return ':' when no more arguments ** -** 89/08/11 Janick Bergeron Optional optarg when ';' in optstring ** -** ** -\***************************************************************************/ - -char *optarg; /* Global argument pointer. */ - -#ifdef VMS -#define index strchr -#endif - -#ifndef HAVE_GETOPT -char -getopt(argc, argv, optstring) -int argc; -char **argv; -char *optstring; -{ - register int c; - register char *place; - extern char *index(); - static int optind = 0; - static char *scan = NULL; - - optarg = NULL; - - if (scan == NULL || *scan == '\0') { - - if (optind == 0) - optind++; - if (optind >= argc) - return ':'; - - optarg = place = argv[optind++]; - if (place[0] != '-' || place[1] == '\0') - return '?'; - if (place[1] == '-' && place[2] == '\0') - return '?'; - scan = place + 1; - } - - c = *scan++; - place = index(optstring, c); - if (place == NULL || c == ':' || c == ';') { - - (void) fprintf(stderr, "%s: unknown option %c\n", argv[0], c); - scan = NULL; - return '!'; - } - if (*++place == ':') { - - if (*scan != '\0') { - - optarg = scan; - scan = NULL; - - } - else { - - if (optind >= argc) { - - (void) fprintf(stderr, "%s: %c requires an argument\n", - argv[0], c); - return '!'; - } - optarg = argv[optind]; - optind++; - } - } - else if (*place == ';') { - - if (*scan != '\0') { - - optarg = scan; - scan = NULL; - - } - else { - - if (optind >= argc || *argv[optind] == '-') - optarg = NULL; - else { - optarg = argv[optind]; - optind++; - } - } - } - return c; -} -#endif Index: xotcl/library/store/XOTclSdbm/xotcl.m4 =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/xotcl.m4 (revision 9620bd8d134f2f6c30fc0d32c769c8a84c6c597b) +++ xotcl/library/store/XOTclSdbm/xotcl.m4 (revision 0) @@ -1,139 +0,0 @@ -# xotcl.m4 -- -# -# This file provides a set of autoconf macros to help TEA-enable -# a Tcl extension. -# -# Copyright (c) 1999 Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. - -#------------------------------------------------------------------------ -# SC_PATH_XOTCLCONFIG -- -# -# Locate the xotclConfig.sh file and perform a sanity check on -# the Tcl compile flags -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-xotcl=... -# -# Defines the following vars: -# XOTCL_BIN_DIR Full path to the directory containing -# the xotclConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN(SC_PATH_XOTCLCONFIG, [ - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - if test x"${no_xotcl}" = x ; then - # we reset no_xotcl in case something fails here - no_xotcl=true - AC_ARG_WITH(xotcl, [ --with-xotcl directory containing xotcl configuration (xotclConfig.sh)], with_xotclconfig=${withval}) - AC_MSG_CHECKING([for XOTcl configuration]) - AC_CACHE_VAL(ac_cv_c_xotclconfig,[ - - # First check to see if --with-xotcl was specified. - if test x"${with_xotclconfig}" != x ; then - if test -f "${with_xotclconfig}/xotclConfig.sh" ; then - ac_cv_c_xotclconfig=`(cd ${with_xotclconfig}; pwd)` - else - AC_MSG_ERROR([${with_xotclconfig} directory doesn't contain xotclConfig.sh]) - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_xotclconfig}" = x ; then - for i in \ - ${srcdir}/../xotcl \ - `ls -dr ${srcdir}/../xotcl-* 2>/dev/null` \ - ${srcdir}/../../xotcl \ - `ls -dr ${srcdir}/../../xotcl-* 2>/dev/null` \ - ${srcdir}/../../../xotcl \ - `ls -dr ${srcdir}/../../../xotcl-* 2>/dev/null` \ - ${srcdir}/../../../../xotcl \ - `ls -dr ${srcdir}/../../../../xotcl-* 2>/dev/null` \ - ${srcdir}/../../../../../xotcl \ - `ls -dr ${srcdir}/../../../../../xotcl-* 2>/dev/null` ; do - if test -f "$i/xotclConfig.sh" ; then - ac_cv_c_xotclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_xotclconfig}" = x ; then - for i in `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` ; do - if test -f "$i/xotclConfig.sh" ; then - ac_cv_c_xotclconfig=`(cd $i; pwd)` - break - fi - done - fi - - ]) - - if test x"${ac_cv_c_xotclconfig}" = x ; then - XOTCL_BIN_DIR="# no XOTcl configs found" - AC_MSG_WARN(Can't find XOTcl configuration definitions) - exit 0 - else - no_xotcl= - XOTCL_BIN_DIR=${ac_cv_c_xotclconfig} - AC_MSG_RESULT(found $XOTCL_BIN_DIR/xotclConfig.sh) - fi - fi -]) - -#------------------------------------------------------------------------ -# SC_LOAD_XOTCLCONFIG -- -# -# Load the tclConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# XOTCL_BIN_DIR -# -# Results: -# -# Subst the vars: -# -#------------------------------------------------------------------------ - -AC_DEFUN(SC_LOAD_XOTCLCONFIG, [ - AC_MSG_CHECKING([for existence of $XOTCL_BIN_DIR/xotclConfig.sh]) - - if test -f "$XOTCL_BIN_DIR/xotclConfig.sh" ; then - AC_MSG_RESULT([loading]) - . $XOTCL_BIN_DIR/xotclConfig.sh - else - AC_MSG_RESULT([file not found]) - fi - - # - # The eval is required to do the TCL_DBGX substitution in the - # TCL_LIB_FILE variable - # - AC_SUBST(XOTCL_VERSION) - AC_SUBST(XOTCL_MAJOR_VERSION) - AC_SUBST(XOTCL_MINOR_VERSION) - AC_SUBST(XOTCL_RELEASE_LEVEL) - AC_SUBST(XOTCL_LIB_FILE) - AC_SUBST(XOTCL_BUILD_LIB_SPEC) - AC_SUBST(XOTCL_LIB_SPEC) - AC_SUBST(XOTCL_STUB_LIB_FILE) - AC_SUBST(XOTCL_BUILD_STUB_LIB_SPEC) - AC_SUBST(XOTCL_STUB_LIB_SPEC) - AC_SUBST(XOTCL_SRC_DIR) -]) - Index: xotcl/library/store/XOTclSdbm/xotclsdbm.c =================================================================== diff -u -N --- xotcl/library/store/XOTclSdbm/xotclsdbm.c (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/store/XOTclSdbm/xotclsdbm.c (revision 0) @@ -1,414 +0,0 @@ -/* - * xotclsdbm.c - * - * based on Tclndbm 0.5 by John Ellson (ellson@lucent.com) - */ - -#include -#include -#include "sdbm.h" -#include -#include - -#if (TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<1) -# define TclObjStr(obj) Tcl_GetStringFromObj(obj, ((int*)NULL)) -#else -# define TclObjStr(obj) Tcl_GetString(obj) -#endif - -/* - * a database .. - */ - -typedef struct db_s { - int mode; - DBM *db; -} db_t ; - -static int -XOTclSdbmOpenMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - int mode; - db_t *db; - XOTcl_Object* obj = (XOTcl_Object *) cd; -/* - int i; - fprintf(stderr, "Method=XOTclSdbmOpenMethod\n"); - for (i=0; i< objc; i++) - fprintf(stderr, " objv[%d]=%s\n",i,TclObjStr(objv[i])); -*/ - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 2) - return XOTclObjErrArgCnt(in, obj->cmdName, "open filename"); - - /* - * check mode string if given - * - mode = O_RDONLY ; - if (argc == 3) { - - if (strcmp(argv[2],"r")==0) - mode = O_RDONLY ; - else if (strcmp(argv[2],"rw")==0) - mode = O_RDWR | O_SYNC ; - else if (strcmp(argv[2],"rwc")==0) - mode = O_CREAT | O_RDWR | O_SYNC ; - else if (strcmp(argv[2],"rwn")==0) - mode = O_CREAT | O_EXCL | O_RDWR | O_SYNC ; - else { - sprintf(buf, BAD_MODE, argv[0], argv[2]); - Tcl_AppendResult (interp,buf,(char *)0); - return (TCL_ERROR); - } - } - */ - /* Storage interface at the moment assumes mode=rwc */ -#ifdef O_SYNC - mode = O_CREAT | O_RDWR | O_SYNC; -#else - mode = O_CREAT | O_RDWR; -#endif - - /* name not in hashtab - create new db */ - if (XOTclGetObjClientData(obj)) - return XOTclVarErrMsg(in, "Called open on '", TclObjStr(obj->cmdName), - "', but open database was not closed before.", 0); - - db = (db_t*) ckalloc (sizeof(db_t)); - - /* - * create new name and malloc space for it - * malloc extra space for name - db->name = (char *) malloc (strlen(buf)+1) ; - if (!db->name) { - perror ("malloc for name in db_open"); - exit (-1); - } - strcpy(db->name,buf); - */ - - db->mode = mode; - db->db = sdbm_open(TclObjStr(objv[1]), mode, 0644); - - if (!db->db) { - /* - * error occurred - * free previously allocated memory - */ - /*ckfree ((char*) db->name);*/ - ckfree ((char*) db); - db = (db_t*) NULL ; - - return XOTclVarErrMsg(in, "Open on '", TclObjStr(obj->cmdName), - "' failed with '", TclObjStr(objv[1]),"'.", 0); - } else { - /* - * success - */ - XOTclSetObjClientData(obj, (ClientData) db); - return TCL_OK; - } -} - -static int -XOTclSdbmCloseMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - db_t *db; - XOTcl_Object* obj = (XOTcl_Object *) cd; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 1) - return XOTclObjErrArgCnt(in, obj->cmdName, "close"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called close on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - sdbm_close (db->db); - - /*ckfree((char*)db->name);*/ - ckfree ((char*)db); - XOTclSetObjClientData(obj, 0); - - return TCL_OK; -} - -static int -XOTclSdbmNamesMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - XOTcl_Object* obj = (XOTcl_Object *) cd; - Tcl_Obj *list; - db_t *db; - Tcl_DString result; - datum key; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 1) - return XOTclObjErrArgCnt(in, obj->cmdName, "names"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called names on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - Tcl_DStringInit(&result); - - key = sdbm_firstkey(db->db); - if (!key.dptr) { - /* empty db */ - return TCL_OK ; - } - - /* - * copy key to result and go to next key - */ - list = Tcl_NewListObj(0, NULL); - do { - Tcl_ListObjAppendElement(in,list,Tcl_NewStringObj(key.dptr,(int)(key.dsize-1))); - key = sdbm_nextkey(db->db); - } while (key.dptr); - Tcl_SetObjResult(in, list); - - return TCL_OK; -} - -static int -XOTclSdbmSetMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - XOTcl_Object* obj = (XOTcl_Object *) cd; - db_t *db; - datum key, content; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc <2 || objc > 3) - return XOTclObjErrArgCnt(in, obj->cmdName, "set key ?value?"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called set on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - - key.dptr = TclObjStr(objv[1]); - key.dsize = objv[1]->length + 1; - - if (objc == 2) { - /* get value */ - content = sdbm_fetch(db->db,key); - if (content.dptr) { - /* found */ - Tcl_Obj *r = Tcl_NewStringObj(content.dptr, (int)(content.dsize-1)); - Tcl_SetObjResult(in, r); - } else { - /* key not found */ - return XOTclVarErrMsg(in, "no such variable '", key.dptr, - "'", 0); - } - } else { - /* set value */ - if (db->mode == O_RDONLY) { - return XOTclVarErrMsg(in, "Trying to set '", TclObjStr(obj->cmdName), - "', but database is in read mode.", 0); - } - content.dptr = TclObjStr(objv[2]); - content.dsize = objv[2]->length + 1; - if (sdbm_store(db->db, key, content, SDBM_REPLACE) == 0) { - /*fprintf(stderr,"setting %s to '%s'\n",key.dptr,content.dptr);*/ - Tcl_SetObjResult(in, objv[2]); - } else { - return XOTclVarErrMsg(in, "set of variable '", TclObjStr(obj->cmdName), - "' failed.", 0); - } - } - return TCL_OK; -} - -static int -XOTclSdbmExistsMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - XOTcl_Object* obj = (XOTcl_Object *) cd; - db_t *db; - datum key, content; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 2) - return XOTclObjErrArgCnt(in, obj->cmdName, "exists variable"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called exists on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - - key.dptr = TclObjStr(objv[1]); - key.dsize = objv[1]->length + 1; - - content = sdbm_fetch(db->db,key); - Tcl_SetIntObj(Tcl_GetObjResult(in), content.dptr != NULL); - - return TCL_OK; -} - - - -static int -XOTclSdbmUnsetMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - XOTcl_Object* obj = (XOTcl_Object *) cd; - db_t *db; - datum key; - int ret; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 2) - return XOTclObjErrArgCnt(in, obj->cmdName, "unset key"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - /* check for read mode */ - if (db->mode == O_RDONLY) { - return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), - "', but database is in read mode.", 0); - } - - key.dptr = TclObjStr(objv[1]); - key.dsize = objv[1]->length + 1; - - ret = sdbm_delete(db->db, key); - - if (ret == 0) { - return TCL_OK; - } else { - return XOTclVarErrMsg(in, "Tried to unset '", TclObjStr(objv[1]), - "' but key does not exist.", 0); - } -} - -/* - * ndbm_firstkey - */ - -static int -XOTclSdbmFirstKeyMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - XOTcl_Object* obj = (XOTcl_Object *) cd; - db_t *db; - datum key; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 1) - return XOTclObjErrArgCnt(in, obj->cmdName, "firstkey"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - - - key = sdbm_firstkey(db->db); - if (!key.dptr) { - /* - * empty db - */ - return TCL_OK; - } - - Tcl_AppendResult (in, key.dptr, (char*)0); - return TCL_OK; -} - -static int -XOTclSdbmNextKeyMethod(ClientData cd, Tcl_Interp* in, int objc, Tcl_Obj* CONST objv[]) { - XOTcl_Object* obj = (XOTcl_Object *) cd; - db_t *db; - datum newkey; - - if (!obj) return XOTclObjErrType(in, obj->cmdName, "Object"); - if (objc != 1) - return XOTclObjErrArgCnt(in, obj->cmdName, "nextkey"); - - db = (db_t*) XOTclGetObjClientData(obj); - if (!db) - return XOTclVarErrMsg(in, "Called unset on '", TclObjStr(obj->cmdName), - "', but database was not opened yet.", 0); - - newkey = sdbm_nextkey(db->db); - - if (!newkey.dptr) { - /* - * empty db - */ - return TCL_OK ; - } - - Tcl_AppendResult (in, newkey.dptr, (char*)0); - return TCL_OK ; -} - -/* - * Xotclsdbm_Init - * register commands, init data structures - */ - -/* this should be done via the stubs ... for the time being - simply export */ -#ifdef VISUAL_CC -DLLEXPORT extern int Xotclsdbm_Init(Tcl_Interp * in); -#endif - -extern int -Xotclsdbm_Init(Tcl_Interp * in) { - XOTcl_Class* cl; - int result; - -#ifdef USE_TCL_STUBS - if (Tcl_InitStubs(in, "8.1", 0) == NULL) { - return TCL_ERROR; - } -# ifdef USE_XOTCL_STUBS - if (Xotcl_InitStubs(in, "1.1", 0) == NULL) { - return TCL_ERROR; - } -# endif -#else - if (Tcl_PkgRequire(in, "Tcl", TCL_VERSION, 0) == NULL) { - return TCL_ERROR; - } -#endif - Tcl_PkgProvide(in, "xotcl::store::sdbm", PACKAGE_VERSION); - -#ifdef PACKAGE_REQUIRE_XOTCL_FROM_SLAVE_INTERP_WORKS_NOW - if (Tcl_PkgRequire(in, "XOTcl", XOTCLVERSION, 0) == NULL) { - return TCL_ERROR; - } -#endif - if (Tcl_PkgRequire(in, "xotcl::store", 0, 0) == NULL) { - return TCL_ERROR; - } - result = Tcl_VarEval (in, "::xotcl::Class create Storage=Sdbm -superclass Storage", - (char *) NULL); - if (result != TCL_OK) - return result; - /*{ - Tcl_Obj *res = Tcl_GetObjResult(in); - fprintf(stderr,"res='%s'\n", TclObjStr(res)); - cl = XOTclGetClass(in, "Storage=Sdbm"); - fprintf(stderr,"cl=%p\n",cl); - }*/ - - cl = XOTclGetClass(in, "Storage=Sdbm"); - if (!cl) { - return TCL_ERROR; - } - - XOTclAddIMethod(in, cl, "open", XOTclSdbmOpenMethod, 0, 0); - XOTclAddIMethod(in, cl, "close", XOTclSdbmCloseMethod, 0, 0); - XOTclAddIMethod(in, cl, "set", XOTclSdbmSetMethod, 0, 0); - XOTclAddIMethod(in, cl, "exists", XOTclSdbmExistsMethod, 0, 0); - XOTclAddIMethod(in, cl, "names", XOTclSdbmNamesMethod, 0, 0); - XOTclAddIMethod(in, cl, "unset", XOTclSdbmUnsetMethod, 0, 0); - XOTclAddIMethod(in, cl, "firstkey", XOTclSdbmFirstKeyMethod, 0, 0); - XOTclAddIMethod(in, cl, "nextkey", XOTclSdbmNextKeyMethod, 0, 0); - - Tcl_SetIntObj(Tcl_GetObjResult(in), 1); - return TCL_OK; -} - -extern int -Xotclsdbm_SafeInit(interp) - Tcl_Interp *interp; -{ - return Xotclsdbm_Init(interp); -} Index: xotcl/library/store/persistenceExample.xotcl =================================================================== diff -u -N --- xotcl/library/store/persistenceExample.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/library/store/persistenceExample.xotcl (revision 0) @@ -1,63 +0,0 @@ -#!../../src/xotclsh -# $Id: persistenceExample.xotcl,v 1.2 2006/02/18 22:17:33 neumann Exp $ -# -# load the persistence component -package require xotcl::store::persistence - -# Two example objects -Object o -# set two variables to default values -o set x 1 -o set y 1 - -Object p -# set two variables to default values -p set x 1 -p set y 1 - -#################################### -# now we make these vars persistent -#################################### - - -# 1. we need the PersistenceMgr (for gdbm we have to specify a file -# name). If we want to get rid of the current setting and start again -# we default values, we have to delete this file -PersistenceMgr pmgr -dirName . -fileName example-db - -# 2. we have to make the objects persistent. We register the -# persistence strategy as per-object mixin on the two objects -# -# one uses the lazy, one the eager strategy - -o mixin Persistent=Eager -p mixin Persistent=Lazy - -# 3. tell the objects, which PersistenceMgr to use - -o persistenceMgr pmgr -p persistenceMgr pmgr - -# 4. make the vars persistent - -o persistent {x y} -p persistent {x y} - -##################################### - -# now the vars are loaded from the persistence store -# -# we incr them to demonstrate the persistency; and print the results - -o incr x 2 -o append y 1 -p incr x 3 -p append y 2 - -puts "Values:" -puts " o->x: [o set x]" -puts " o->y: [o set y]" -puts " p->x: [p set x]" -puts " p->y: [p set y]" - -# now run the program several times to see the results \ No newline at end of file Index: xotcl/library/store/pkgIndex-subdir.add =================================================================== diff -u -N --- xotcl/library/store/pkgIndex-subdir.add (revision 9722a51911e1502444c173306c8c88f7f3888989) +++ xotcl/library/store/pkgIndex-subdir.add (revision 0) @@ -1,10 +0,0 @@ -set __store_dir__ $dir -foreach index [glob -nocomplain [file join $dir * pkgIndex.tcl]] { - set dir [file dirname $index] - #puts subdir=$dir,index=$index - source $index -} -set dir $__store_dir__ -unset __store_dir__ - - Index: xotcl/library/store/pkgIndex.tcl =================================================================== diff -u -N --- xotcl/library/store/pkgIndex.tcl (revision 0896d4deb00780e48b5b03269bf9c4ecca948919) +++ xotcl/library/store/pkgIndex.tcl (revision 0) @@ -1,27 +0,0 @@ -# Tcl package index file, version 1.1 -# This file is generated by the "pkg_mkIndex -direct" command -# and sourced either when an application starts up or -# by a "package unknown" script. It invokes the -# "package ifneeded" command to set up package-related -# information so that packages will be loaded automatically -# in response to "package require" commands. When this -# script is sourced, the variable $dir must contain the -# full path name of this file's directory. - -package ifneeded xotcl::store 0.84 [list source [file join $dir Storage.xotcl]] -package ifneeded xotcl::store::jufgdbm 0.81 [list source [file join $dir JufGdbmStorage.xotcl]] -package ifneeded xotcl::store::mem 0.84 [list source [file join $dir MemStorage.xotcl]] -package ifneeded xotcl::store::multi 0.9 [list source [file join $dir MultiStorage.xotcl]] -package ifneeded xotcl::store::persistence 0.8 [list source [file join $dir Persistence.xotcl]] -package ifneeded xotcl::store::tclgdbm 0.84 [list source [file join $dir TclGdbmStorage.xotcl]] -package ifneeded xotcl::store::textfile 0.84 [list source [file join $dir TextFileStorage.xotcl]] -set __store_dir__ $dir -foreach index [glob -nocomplain [file join $dir * pkgIndex.tcl]] { - set dir [file dirname $index] - #puts subdir=$dir,index=$index - source $index -} -set dir $__store_dir__ -unset __store_dir__ - - Index: xotcl/library/xml/COPYRIGHT =================================================================== diff -u -N --- xotcl/library/xml/COPYRIGHT (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/COPYRIGHT (revision 0) @@ -1,41 +0,0 @@ - * XOTcl - Extended OTcl - * - * Copyright (C) 1999-2001 Gustaf Neumann (a), Uwe Zdun (b) - * - * (a) Vienna University of Economics and Business Administration - * Dept. of Information Systems / New Media - * A-1090, Augasse 2-6 - * Vienna, Austria - * - * (b) University of Essen - * Specification of Software Systems - * Altendorferstra�e 97-101 - * D-45143 Essen, Germany - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation. We make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. - * - * - * This software is based upon MIT Object Tcl by David Wetherall and - * Christopher J. Lindblad, that contains the following copyright - * message: - * - * "Copyright 1993 Massachusetts Institute of Technology - * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this - * permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. M.I.T. makes no representations about - * the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty." - Index: xotcl/library/xml/TclExpat-1.1/Makefile =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/Makefile (revision fce8f28780c2c91fc8320c5a480eb2b6031b3b5b) +++ xotcl/library/xml/TclExpat-1.1/Makefile (revision 0) @@ -1,433 +0,0 @@ -# Makefile.in -- -# -# This file is a Makefile for Sample TEA Extension. If it has the name -# "Makefile.in" then it is a template for a Makefile; to generate the -# actual Makefile, run "./configure", which is a configuration script -# generated by the "autoconf" program (constructs like "@foo@" will get -# replaced in the actual Makefile. -# -# Copyright (c) 1999 Scriptics Corporation. -# Copyright (c) 2002-2003 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,v 1.30 2007/09/13 15:21:54 neumann 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. -#======================================================================== - -#======================================================================== -# The names of the source files is defined in the configure script. -# The object files are used for linking into the final library. -# 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 = xmltok.c unixfilemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c -PKG_OBJECTS = xmltok.o unixfilemap.o xmlrole.o xmlwf.o codepage.o xmlparse.o hashtable.o tclexpat.o - -PKG_STUB_SOURCES = -PKG_STUB_OBJECTS = - -#======================================================================== -# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with -# this package that need to be installed, if any. -#======================================================================== - -PKG_TCL_SOURCES = - -#======================================================================== -# This is a list of public header files to be installed, if any. -#======================================================================== - -PKG_HEADERS = - -#======================================================================== -# "PKG_LIB_FILE" refers to the library (dynamic or static as per -# configuration options) composed of the named objects. -#======================================================================== - -PKG_LIB_FILE = libxotclexpat0.9.dylib -PKG_STUB_LIB_FILE = libxotclexpatstub0.9.a - -lib_BINARIES = $(PKG_LIB_FILE) -BINARIES = $(lib_BINARIES) - -SHELL = /bin/sh - -srcdir = . -prefix = /usr/local/aolserver-4.5 -exec_prefix = /usr/local/aolserver-4.5 - -bindir = ${exec_prefix}/bin -libdir = ${exec_prefix}/lib -datadir = ${prefix}/share -mandir = ${prefix}/man -includedir = ${prefix}/include - -DESTDIR = - -PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) -pkgdatadir = $(datadir)/$(PKG_DIR) -pkglibdir = $(libdir)/$(PKG_DIR) -pkgincludedir = $(includedir)/$(PKG_DIR) - -top_builddir = . - -INSTALL = /usr/bin/install -c -INSTALL_PROGRAM = ${INSTALL} -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_SCRIPT = ${INSTALL} - -PACKAGE_NAME = xotclexpat -PACKAGE_VERSION = 0.9 -CC = gcc -CFLAGS_DEFAULT = -Os -CFLAGS_WARNING = -Wall -Wno-implicit-int -CLEANFILES = pkgIndex.tcl -EXEEXT = -LDFLAGS_DEFAULT = -prebind -headerpad_max_install_names -Wl,-search_paths_first -MAKE_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} -MAKE_SHARED_LIB = ${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_LIBS} -MAKE_STATIC_LIB = ${STLIB_LD} $@ $(PKG_OBJECTS) -MAKE_STUB_LIB = ${STLIB_LD} $@ $(PKG_STUB_OBJECTS) -OBJEXT = o -RANLIB = : -RANLIB_STUB = ranlib -SHLIB_CFLAGS = -fno-common -SHLIB_LD = ${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT} -Wl,-single_module -SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@ -SHLIB_LD_LIBS = ${LIBS} -L/usr/local/aolserver-4.5/lib -ltclstub8.4 -STLIB_LD = ${AR} cr -TCL_DEFS = -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DHAVE_COREFOUNDATION=1 -DMAC_OSX_TCL=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_MTSAFE_GETHOSTBYNAME=1 -DHAVE_MTSAFE_GETHOSTBYADDR=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_COPYFILE=1 -DHAVE_LIBKERN_OSATOMIC_H=1 -DHAVE_OSSPINLOCKLOCK=1 -DHAVE_PTHREAD_ATFORK=1 -DUSE_VFORK=1 -DTCL_DEFAULT_ENCODING=\"utf-8\" -DTCL_LOAD_FROM_MEMORY=1 -DHAVE_AVAILABILITYMACROS_H=1 -DHAVE_FTS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -TCL_BIN_DIR = /usr/local/aolserver-4.5/lib -TCL_SRC_DIR = /usr/local/src/tcl8.4.14 -# This is necessary for packages that use private Tcl headers -#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ -# Not used, but retained for reference of what libs Tcl required -TCL_LIBS = ${DL_LIBS} ${LIBS} ${MATH_LIBS} - -#======================================================================== -# 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). -#======================================================================== - -EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) -TCLSH_ENV = TCL_LIBRARY=`echo $(TCL_SRC_DIR)/library` \ - DYLD_LIBRARY_PATH="$(EXTRA_PATH):$(DYLD_LIBRARY_PATH)" \ - PATH="$(EXTRA_PATH):$(PATH)" \ - TCLLIBPATH="$(top_builddir)" -TCLSH_PROG = /usr/local/aolserver-4.5/bin/tclsh8.4 -TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) -SHARED_BUILD = 1 - -INCLUDES = -I/Users/neumann/src/xotcl-1.5.5/generic -I./generic -I"/usr/local/aolserver-4.5/include" - -EXTRA_CFLAGS = - -# TCL_DEFS is not strictly need here, but if you remove it, then you -# must make sure that configure.in 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) -DPACKAGE_NAME=\"xotclexpat\" -DPACKAGE_TARNAME=\"xotclexpat\" -DPACKAGE_VERSION=\"0.9\" -DPACKAGE_STRING=\"xotclexpat\ 0.9\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 $(EXTRA_CFLAGS) -DEFS = -DPACKAGE_NAME=\"xotclexpat\" -DPACKAGE_TARNAME=\"xotclexpat\" -DPACKAGE_VERSION=\"0.9\" -DPACKAGE_STRING=\"xotclexpat\ 0.9\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DTCL_WIDE_INT_TYPE=long\ long -DUSE_TCL_STUBS=1 $(EXTRA_CFLAGS) - -CONFIG_CLEAN_FILES = Makefile - -CPPFLAGS = -LIBS = -L/Users/neumann/src/xotcl-1.5.5 -lxotclstub1.5.5 -AR = ar -CFLAGS = -pipe ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - -#======================================================================== -# Start of user-definable TARGETS section -#======================================================================== - -#======================================================================== -# TEA TARGETS. Please note that the "libraries:" target refers to platform -# independent files, and the "binaries:" target inclues executable programs and -# platform-dependent libraries. Modify these targets so that they install -# the various pieces of your package. The make and install rules -# for the BINARIES that you specified above have already been done. -#======================================================================== - -all: binaries libraries doc - -#======================================================================== -# The binaries target builds executable programs, Windows .dll's, unix -# shared/static libraries, and any other platform-dependent files. -# The list of targets to build for "binaries:" is specified at the top -# of the Makefile, in the "BINARIES" variable. -#======================================================================== - -binaries: $(BINARIES) pkgIndex.tcl - -libraries: - -doc: - @echo "If you have documentation to create, place the commands to" - @echo "build the docs in the 'doc:' target. For example:" - @echo " xml2nroff sample.xml > sample.n" - @echo " xml2html sample.xml > sample.html" - -install: all install-binaries install-libraries install-doc - -install-binaries: binaries install-lib-binaries install-bin-binaries - if test "x$(SHARED_BUILD)" = "x1"; then \ - $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ - fi - -#======================================================================== -# This rule installs platform-independent files, such as header files. -#======================================================================== - -install-libraries: libraries - @mkdir -p $(DESTDIR)$(includedir) - @echo "Installing header files in $(DESTDIR)$(includedir)" - @if test -n "$(PKG_HEADERS)" ; then \ - for i in "$(PKG_HEADERS)" ; do \ - echo "Installing $(srcdir)/$$i" ; \ - $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ - done; \ - fi - -#======================================================================== -# Install documentation. Unix manpages should go in the $(mandir) -# directory. -#======================================================================== - -install-doc: doc -#install-doc: doc -# @mkdir -p $(DESTDIR)$(mandir)/mann -# @echo "Installing documentation in $(DESTDIR)$(mandir)" -# @for i in $(srcdir)/doc/*.n; do \ -# echo "Installing $$i"; \ -# rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ -# $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ -# done - -test: binaries libraries - $(TCLSH) `echo $(srcdir)/tests/all.tcl` $(TESTFLAGS) - -shell: binaries libraries - @$(TCLSH) $(SCRIPT) - -gdb: - $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) - -depend: - -#======================================================================== -# $(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". -# -# 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. -#======================================================================== - -$(PKG_LIB_FILE): $(PKG_OBJECTS) - -rm -f $(PKG_LIB_FILE) - ${MAKE_LIB} - $(RANLIB) $(PKG_LIB_FILE) - -$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) - -rm -f $(PKG_STUB_LIB_FILE) - ${MAKE_STUB_LIB} - $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# -# 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 `echo $(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:.... -#======================================================================== - -VPATH = $(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win - -.c.o: - $(COMPILE) -c `echo $<` -o $@ - -#======================================================================== -# Create the pkgIndex.tcl file. -# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but -# you may find that you need to customize the package. If so, either -# modify the -hand version, or create a pkgIndex.tcl.in file and have -# the configure script output the pkgIndex.tcl by editing configure.in. -#======================================================================== - -pkgIndex.tcl: - ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) - -pkgIndex.tcl-hand: - (echo 'package ifneeded xotcl::xml::expat $(PACKAGE_VERSION) \ - [list load [file join $$dir $(PKG_LIB_FILE)]]'\ - ) > pkgIndex.tcl - -#======================================================================== -# Distribution creation -# You may need to tweak this target to make it work correctly. -#======================================================================== - -#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar -COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) -DIST_ROOT = /tmp/dist -DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) - -dist-clean: - rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* - -dist: dist-clean - mkdir -p $(DIST_DIR) - cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ - $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ - $(DIST_DIR)/ - chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 - chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in - - cp -p $(srcdir)/*.[ch] $(DIST_DIR)/ - - mkdir $(DIST_DIR)/tclconfig - cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ - $(DIST_DIR)/tclconfig/ - chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 - chmod +x $(DIST_DIR)/tclconfig/install-sh - - list='demos doc generic library mac tests unix win'; \ - for p in $$list; do \ - if test -d $(srcdir)/$$p ; then \ - mkdir $(DIST_DIR)/$$p; \ - cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ - fi; \ - done - - (cd $(DIST_ROOT); $(COMPRESS);) - -#======================================================================== -# End of user-definable section -#======================================================================== - -#======================================================================== -# Don't modify the file to clean here. Instead, set the "CLEANFILES" -# variable in configure.in -#======================================================================== - -clean: - -test -z "$(BINARIES)" || rm -f $(BINARIES) - -rm -f *.$(OBJEXT) core *.core - -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 - -#======================================================================== -# 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) -# -# You should not have to modify this target. -#======================================================================== - -install-lib-binaries: - @mkdir -p $(DESTDIR)$(pkglibdir) - @list='$(lib_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ - stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ - if test "x$$stub" = "xstub"; then \ - echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ - else \ - echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ - fi; \ - ext=`echo $$p|sed -e "s/.*\.//"`; \ - if test "x$$ext" = "xdll"; then \ - 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; \ - fi; \ - fi; \ - 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; \ - done - -#======================================================================== -# 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. -# -# You should not have to modify this target, except to define bin_BINARIES -# above if necessary. -#======================================================================== - -install-bin-binaries: - @mkdir -p $(DESTDIR)$(bindir) - @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; \ - done - -.SUFFIXES: .c .$(OBJEXT) - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -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; \ - done - -.PHONY: all binaries clean depend distclean doc install libraries test - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Index: xotcl/library/xml/TclExpat-1.1/Makefile.in =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/Makefile.in (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/library/xml/TclExpat-1.1/Makefile.in (revision 0) @@ -1,433 +0,0 @@ -# Makefile.in -- -# -# This file is a Makefile for Sample TEA Extension. If it has the name -# "Makefile.in" then it is a template for a Makefile; to generate the -# actual Makefile, run "./configure", which is a configuration script -# generated by the "autoconf" program (constructs like "@foo@" will get -# replaced in the actual Makefile. -# -# Copyright (c) 1999 Scriptics Corporation. -# Copyright (c) 2002-2003 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.5 2007/08/14 16:38:27 neumann 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. -#======================================================================== - -#======================================================================== -# The names of the source files is defined in the configure script. -# The object files are used for linking into the final library. -# 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@ - -PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ -PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ - -#======================================================================== -# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with -# this package that need to be installed, if any. -#======================================================================== - -PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ - -#======================================================================== -# This is a list of public header files to be installed, if any. -#======================================================================== - -PKG_HEADERS = @PKG_HEADERS@ - -#======================================================================== -# "PKG_LIB_FILE" refers to the library (dynamic or static as per -# configuration options) composed of the named objects. -#======================================================================== - -PKG_LIB_FILE = @PKG_LIB_FILE@ -PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ - -lib_BINARIES = $(PKG_LIB_FILE) -BINARIES = $(lib_BINARIES) - -SHELL = @SHELL@ - -srcdir = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -libdir = @libdir@ -datadir = @datadir@ -mandir = @mandir@ -includedir = @includedir@ - -DESTDIR = - -PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) -pkgdatadir = $(datadir)/$(PKG_DIR) -pkglibdir = $(libdir)/$(PKG_DIR) -pkgincludedir = $(includedir)/$(PKG_DIR) - -top_builddir = . - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ - -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -CC = @CC@ -CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ -CFLAGS_WARNING = @CFLAGS_WARNING@ -CLEANFILES = @CLEANFILES@ -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_FLAGS = @SHLIB_LD_FLAGS@ -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@ -# This is necessary for packages that use private Tcl headers -#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ -# Not used, but retained for reference of what libs Tcl required -TCL_LIBS = @TCL_LIBS@ - -#======================================================================== -# 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). -#======================================================================== - -EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) -TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ - @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ - PATH="$(EXTRA_PATH):$(PATH)" \ - TCLLIBPATH="$(top_builddir)" -TCLSH_PROG = @TCLSH_PROG@ -TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) -SHARED_BUILD = @SHARED_BUILD@ - -INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ - -EXTRA_CFLAGS = @PKG_CFLAGS@ - -# TCL_DEFS is not strictly need here, but if you remove it, then you -# must make sure that configure.in 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@ $(EXTRA_CFLAGS) -DEFS = @DEFS@ $(EXTRA_CFLAGS) - -CONFIG_CLEAN_FILES = Makefile - -CPPFLAGS = @CPPFLAGS@ -LIBS = @PKG_LIBS@ @LIBS@ -AR = ar -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - -#======================================================================== -# Start of user-definable TARGETS section -#======================================================================== - -#======================================================================== -# TEA TARGETS. Please note that the "libraries:" target refers to platform -# independent files, and the "binaries:" target inclues executable programs and -# platform-dependent libraries. Modify these targets so that they install -# the various pieces of your package. The make and install rules -# for the BINARIES that you specified above have already been done. -#======================================================================== - -all: binaries libraries doc - -#======================================================================== -# The binaries target builds executable programs, Windows .dll's, unix -# shared/static libraries, and any other platform-dependent files. -# The list of targets to build for "binaries:" is specified at the top -# of the Makefile, in the "BINARIES" variable. -#======================================================================== - -binaries: $(BINARIES) pkgIndex.tcl - -libraries: - -doc: - @echo "If you have documentation to create, place the commands to" - @echo "build the docs in the 'doc:' target. For example:" - @echo " xml2nroff sample.xml > sample.n" - @echo " xml2html sample.xml > sample.html" - -install: all install-binaries install-libraries install-doc - -install-binaries: binaries install-lib-binaries install-bin-binaries - if test "x$(SHARED_BUILD)" = "x1"; then \ - $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ - fi - -#======================================================================== -# This rule installs platform-independent files, such as header files. -#======================================================================== - -install-libraries: libraries - @mkdir -p $(DESTDIR)$(includedir) - @echo "Installing header files in $(DESTDIR)$(includedir)" - @if test -n "$(PKG_HEADERS)" ; then \ - for i in "$(PKG_HEADERS)" ; do \ - echo "Installing $(srcdir)/$$i" ; \ - $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ - done; \ - fi - -#======================================================================== -# Install documentation. Unix manpages should go in the $(mandir) -# directory. -#======================================================================== - -install-doc: doc -#install-doc: doc -# @mkdir -p $(DESTDIR)$(mandir)/mann -# @echo "Installing documentation in $(DESTDIR)$(mandir)" -# @for i in $(srcdir)/doc/*.n; do \ -# echo "Installing $$i"; \ -# rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ -# $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ -# done - -test: binaries libraries - $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) - -shell: binaries libraries - @$(TCLSH) $(SCRIPT) - -gdb: - $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) - -depend: - -#======================================================================== -# $(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". -# -# 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. -#======================================================================== - -$(PKG_LIB_FILE): $(PKG_OBJECTS) - -rm -f $(PKG_LIB_FILE) - ${MAKE_LIB} - $(RANLIB) $(PKG_LIB_FILE) - -$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) - -rm -f $(PKG_STUB_LIB_FILE) - ${MAKE_STUB_LIB} - $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) - -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# -# 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:.... -#======================================================================== - -VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win - -.c.@OBJEXT@: - $(COMPILE) -c `@CYGPATH@ $<` -o $@ - -#======================================================================== -# Create the pkgIndex.tcl file. -# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but -# you may find that you need to customize the package. If so, either -# modify the -hand version, or create a pkgIndex.tcl.in file and have -# the configure script output the pkgIndex.tcl by editing configure.in. -#======================================================================== - -pkgIndex.tcl: - ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) - -pkgIndex.tcl-hand: - (echo 'package ifneeded xotcl::xml::expat $(PACKAGE_VERSION) \ - [list load [file join $$dir $(PKG_LIB_FILE)]]'\ - ) > pkgIndex.tcl - -#======================================================================== -# Distribution creation -# You may need to tweak this target to make it work correctly. -#======================================================================== - -#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar -COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) -DIST_ROOT = /tmp/dist -DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) - -dist-clean: - rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* - -dist: dist-clean - mkdir -p $(DIST_DIR) - cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ - $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ - $(DIST_DIR)/ - chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 - chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in - - cp -p $(srcdir)/*.[ch] $(DIST_DIR)/ - - mkdir $(DIST_DIR)/tclconfig - cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ - $(DIST_DIR)/tclconfig/ - chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 - chmod +x $(DIST_DIR)/tclconfig/install-sh - - list='demos doc generic library mac tests unix win'; \ - for p in $$list; do \ - if test -d $(srcdir)/$$p ; then \ - mkdir $(DIST_DIR)/$$p; \ - cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ - fi; \ - done - - (cd $(DIST_ROOT); $(COMPRESS);) - -#======================================================================== -# End of user-definable section -#======================================================================== - -#======================================================================== -# Don't modify the file to clean here. Instead, set the "CLEANFILES" -# variable in configure.in -#======================================================================== - -clean: - -test -z "$(BINARIES)" || rm -f $(BINARIES) - -rm -f *.$(OBJEXT) core *.core - -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 - -#======================================================================== -# 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) -# -# You should not have to modify this target. -#======================================================================== - -install-lib-binaries: - @mkdir -p $(DESTDIR)$(pkglibdir) - @list='$(lib_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ - stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ - if test "x$$stub" = "xstub"; then \ - echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ - else \ - echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ - $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ - fi; \ - ext=`echo $$p|sed -e "s/.*\.//"`; \ - if test "x$$ext" = "xdll"; then \ - 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; \ - fi; \ - fi; \ - 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; \ - done - -#======================================================================== -# 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. -# -# You should not have to modify this target, except to define bin_BINARIES -# above if necessary. -#======================================================================== - -install-bin-binaries: - @mkdir -p $(DESTDIR)$(bindir) - @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; \ - done - -.SUFFIXES: .c .$(OBJEXT) - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -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; \ - done - -.PHONY: all binaries clean depend distclean doc install libraries test - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Index: xotcl/library/xml/TclExpat-1.1/Makefile.in-ok =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/Makefile.in-ok (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/Makefile.in-ok (revision 0) @@ -1,390 +0,0 @@ -# Makefile.in -- -# -# This file is a Makefile for Sample TEA Extension. If it has the name -# "Makefile.in" then it is a template for a Makefile; to generate the -# actual Makefile, run "./configure", which is a configuration script -# generated by the "autoconf" program (constructs like "@foo@" will get -# replaced in the actual Makefile. -# -# Copyright (c) 1999 Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: Makefile.in-ok,v 1.1 2004/05/23 22:50:39 neumann Exp $ - -#======================================================================== -# Edit the following few lines when writing a new extension -#======================================================================== - -configdir=$(srcdir)/../../../config - -#======================================================================== -# 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= -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. -#======================================================================== - -#xotclexpat_SOURCES = -#SOURCES = $(xotclexpat_SOURCES) - -#======================================================================== -# Enumerate the names of the object files included in this package. -# These objects are created and linked into the final library. In -# most cases these object files will correspond to the source files -# above. -# -#======================================================================== - -FILEMAP_OBJ=unixfilemap.$(OBJEXT) -#FILEMAP_OBJ=readfilemap.$(OBJEXT) - -xotclexpat_OBJECTS = xmltok.$(OBJEXT) \ - xmlrole.$(OBJEXT) \ - xmlwf.$(OBJEXT) \ - codepage.$(OBJEXT) \ - xmlparse.$(OBJEXT) \ - hashtable.$(OBJEXT) \ - $(FILEMAP_OBJ) \ - tclexpat.$(OBJEXT) -OBJECTS = $(xotclexpat_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. -#======================================================================== - -xotclexpat_LIB_FILE = @xotclexpat_LIB_FILE@ -$(xotclexpat_LIB_FILE)_OBJECTS = $(xotclexpat_OBJECTS) - -#======================================================================== -# This is a list of header files to be installed -#======================================================================== - -GENERIC_HDRS= - -#======================================================================== -# Add additional lines to handle any additional AC_SUBST cases that -# have been added to the configure script. -#======================================================================== - -SAMPLE_NEW_VAR=@SAMPLE_NEW_VAR@ - -#======================================================================== -# Nothing of the variables below this line need to be changed. Please -# check the TARGETS section below to make sure the make targets are -# correct. -#======================================================================== - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_FLAG = -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : - -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ -CC = @CC@ -CFLAGS_DEBUG = @CFLAGS_DEBUG@ -CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ -CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ -CLEANFILES = @CLEANFILES@ -EXEEXT = @EXEEXT@ -LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ -LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ -LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ -MAKE_LIB = @MAKE_LIB@ -MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ -MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ -OBJEXT = @OBJEXT@ -RANLIB = @RANLIB@ -SHLIB_CFLAGS = @SHLIB_CFLAGS@ -SHLIB_LD = @SHLIB_LD@ -SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ -SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ -STLIB_LD = @STLIB_LD@ -TCL_BIN_DIR = @TCL_BIN_DIR@ -TCL_DEFS = @TCL_DEFS@ -TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ -TCL_LD_FLAGS = @TCL_LD_FLAGS@ -TCL_LIBS = @TCL_LIBS@ -TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ -TCL_SRC_DIR = @TCL_SRC_DIR@ -TCL_DBGX = @TCL_DBGX@ -TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ -TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ -TCL_TOOL_DIR_NATIVE = @TCL_TOOL_DIR_NATIVE@ -TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ -TCL_UNIX_DIR_NATIVE = @TCL_UNIX_DIR_NATIVE@ -TCL_WIN_DIR_NATIVE = @TCL_WIN_DIR_NATIVE@ -INCLUDE_DIR_NATIVE = @INCLUDE_DIR_NATIVE@ -TCL_BMAP_DIR_NATIVE = @TCL_BMAP_DIR_NATIVE@ -TCL_PLATFORM_DIR_NATIVE = @TCL_PLATFORM_DIR_NATIVE@ -TCL_GENERIC_DIR_NATIVE = @TCL_GENERIC_DIR_NATIVE@ -TCLSH_PROG = @TCLSH_PROG@ - -AUTOCONF = autoconf - -LDFLAGS = $(LDFLAGS_DEFAULT) - -INCLUDES = @TCL_INCLUDES@ - -EXTRA_CFLAGS = $(TCL_DEFS) $(PROTO_FLAGS) $(SECURITY_FLAGS) $(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) $(NO_DEPRECATED_FLAGS) - -DEFS = @DEFS@ $(EXTRA_CFLAGS) - -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(configdir)/mkinstalldirs -CONFIG_CLEAN_FILES = $(configdir)/mkIndex.tcl - -CPPFLAGS = @CPPFLAGS@ -LIBS = @LIBS@ -AR = ar -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -I. -I@XOTCL_SRC_DIR@/generic - -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ - -#======================================================================== -# Start of user-definable TARGETS section -#======================================================================== - -#======================================================================== -# TEA TARGETS. Please note that the "libraries:" target refers to platform -# independent files, and the "binaries:" target inclues executable programs and -# platform-dependent libraries. Modify these targets so that they install -# the various pieces of your package. The make and install rules -# for the BINARIES that you specified above have already been done. -#======================================================================== - -all: binaries libraries doc - -#======================================================================== -# The binaries target builds executable programs, Windows .dll's, unix -# shared/static libraries, and any other platform-dependent files. -# The list of targets to build for "binaries:" is specified at the top -# of the Makefile, in the "BINARIES" variable. -#======================================================================== - -binaries: - -libraries: $(srcdir)/../$(xotclexpat_LIB_FILE) - -doc: - -install: install-binaries install-libraries install-doc - -install-binaries: binaries install-lib-binaries install-bin-binaries - -#======================================================================== -# This rule installs platform-independent files, such as header files. -#======================================================================== - -install-libraries: libraries $(DESTDIR)$(includedir) - @if test ! -z $(GENERIC_HDRS) ; then \ - echo "Installing header files in $(DESTDIR)$(includedir)" ; \ - fi - @for i in $(GENERIC_HDRS) ; do \ - echo "Installing $$i" ; \ - $(INSTALL_DATA) $$i $(DESTDIR)$(includedir) ; \ - done; - -#======================================================================== -# Install documentation. Unix manpages should go in the $(mandir) -# directory. -#======================================================================== - -install-doc: - -test: - -depend: - -#======================================================================== -# Enumerate the names of the object files included in this package. -# These objects are created and linked into the final library. In -# most cases these object files will correspond to the source files -# above. -# -# $(exampleA_LIB_FILE) should be listed as part of the BINARIES variable -# at the top of the Makefile. That will ensure that this target is built -# when you run "make binaries". -# -# You shouldn't need to modify this target, except to change the package -# name from "exampleA" to your package's name. -#======================================================================== - -$(xotclexpat_LIB_FILE): $(xotclexpat_OBJECTS) - rm -f $@ - @MAKE_LIB@ - $(RANLIB) $@ - -$(srcdir)/../$(xotclexpat_LIB_FILE): $(xotclexpat_LIB_FILE) - cp $< $@ -#======================================================================== -# We need to enumerate the list of .c to .o lines here. -# Unfortunately, there does not seem to be any other way to do this -# in a Makefile-independent way. We can't use VPATH because it picks up -# object files that may be located in the source directory. -# -# In the following lines, $(srcdir) refers to the toplevel directory -# containing your extension. If your sources are in a subdirectory, -# you will have to modify the paths to reflect this: -# -# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c -# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@ -#======================================================================== - -%.o: $(srcdir)/%.c - $(COMPILE) -c `@CYGPATH@ $<` -o $@ - -#======================================================================== -# End of user-definable section -#======================================================================== - -#======================================================================== -# Don't modify the file to clean here. Instead, set the "CLEANFILES" -# variable in configure.in -#======================================================================== - -clean: - @rm -f $(xotclexpat_LIB_FILE) $(srcdir)/../$(xotclexpat_LIB_FILE) \ - *.o core *.core *.$(OBJEXT) $(CLEANFILES) expat/*/*.o expat/*/*.so \ - core so_locations gmon.out *~ \#* config.log - -distclean: clean - -rm -f *.tab.c - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -rm -f config.status - -#======================================================================== -# Install binary object libraries. On Windows this includes both .dll and -# .lib files. Because the .lib files are not explicitly listed anywhere, -# we need to deduce their existence from the .dll file of the same name. -# Additionally, the .dll files go into the bin directory, but the .lib -# files go into the lib directory. On Unix platforms, all library files -# go into the lib directory. In addition, this will generate the pkgIndex.tcl -# file in the install location (assuming it can find a usable tclsh8.2 shell) -# -# You should not have to modify this target. -#======================================================================== - -install-lib-binaries: $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) - @list='$(lib_BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - ext=`echo $$p|sed -e "s/.*\.//"`; \ - if test "x$$ext" = "xdll"; then \ - echo " $(INSTALL_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)$(libdir)/$$lib"; \ - $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \ - fi; \ - else \ - echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \ - $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \ - fi; \ - else :; fi; \ - done - @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 -# $(TCLSH_PROG) $(configdir)/mkIndex.tcl - -#======================================================================== -# Install binary executables (e.g. .exe files) -# -# You should not have to modify this target. -#======================================================================== - -install-bin-binaries: $(DESTDIR)$(bindir) - @list='$(BINARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \ - $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \ - else :; fi; \ - done - -.SUFFIXES: .c .o .obj - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - - -uninstall-binaries: - @$(NORMAL_UNINSTALL) - list='$(BINARIES)'; for p in $$list; do \ - rm -f $(DESTDIR)$(libdir)/$$p; \ - done - -$(DESTDIR)$(includedir): - $(mkinstalldirs) $@ -$(DESTDIR)$(libdir): - $(mkinstalldirs) $@ -$(DESTDIR)$(bindir): - $(mkinstalldirs) $@ - -.PHONY: all binaries clean depend distclean doc install libraries test - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: Index: xotcl/library/xml/TclExpat-1.1/Makefile.vc =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/Makefile.vc (revision 638782f84b31e4ebfd00529381e280c70f9950bc) +++ xotcl/library/xml/TclExpat-1.1/Makefile.vc (revision 0) @@ -1,239 +0,0 @@ -###################################################################### -# -# XOTclExpat Makefile for Visual C++ -# -###################################################################### - -# Be sure to adapt the "configs.vc" file in the toplevel directory -# to your system settings. -!include "..\..\..\win\configs.vc" - -BINROOT = . -ROOT = .. -NAMEPREFIX = lib -NAME = xotclexpat -XOTCL_DIR = ..\..\.. -GENERICDIR = . -WINDIR = . - -###################################################################### - -!if $(DEBUG) -TMPNAME = Debug -DBGX = d -!else -TMPNAME = Release -DBGX = -!endif - -TMP_DIR = $(BINROOT)\$(TMPNAME) -OUT_DIR = $(TMP_DIR) - -!if $(STATIC_BUILD) -OUTNAME = $(NAMEPREFIX)$(NAME)$(XOTCL_VERSION)$(DBGX) -TARGET = "$(OUT_DIR)\$(OUTNAME).lib" -!else -OUTNAME = $(NAMEPREFIX)$(NAME)$(XOTCL_VERSION)$(DBGX) -IMPLIB = "$(OUT_DIR)\$(OUTNAME).lib" -TARGET = "$(OUT_DIR)\$(OUTNAME).dll" -!endif - -TCLSTUBLIB = "$(TCLROOT)\win\Release\tclstub$(TCL_VERSION).lib" -TCLIMPLIB = "$(TCLROOT)\win\$(OUT_DIR)\tcl$(TCL_VERSION)$(DBGX).lib" -TCLSH = "$(TCLROOT)\win\$(OUT_DIR)\tclsh$(TCL_VERSION)$(DBGX).exe" - -XOTCLSTUBLIB = "$(XOTCL_DIR)\win\Release\libxotclstub$(XOTCL_VERSION).lib" -XOTCLIMPLIB = "$(XOTCL_DIR)\win\$(OUT_DIR)\libxotcl$(XOTCL_VERSION)$(DBGX).lib" - -LIB_INSTALL_DIR = $(INSTALLDIR)\lib -BIN_INSTALL_DIR = $(INSTALLDIR)\bin -SCRIPT_INSTALL_DIR = $(INSTALLDIR)\lib\xotcl$(XOTCL_VERSION) -INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include - -OBJS = $(TMP_DIR)\xmltok.obj \ - $(TMP_DIR)\xmlrole.obj \ - $(TMP_DIR)\xmlwf.obj \ - $(TMP_DIR)\codepage.obj \ - $(TMP_DIR)\xmlparse.obj \ - $(TMP_DIR)\hashtable.obj \ - $(TMP_DIR)\win32filemap.obj \ - $(TMP_DIR)\tclexpat.obj \ -!if $(STATIC_BUILD) == 0 - $(TMP_DIR)\dllEntryPoint.obj -!endif - -###################################################################### -# Link flags -###################################################################### - -!if $(DEBUG) -ldebug = -debug:full -debugtype:cv -pdb:none -!else -ldebug = -release -opt:ref -!endif - -# declarations common to all linker options -lcommon = -nologo -link50compat -machine:$(MACHINE) - -LFLAGS = $(lcommon) -subsystem:windows -dll - -!if $(USE_TCL_STUBS) == 0 -LLIBS = $(TCLIMPLIB) $(XOTCLIMPLIB) -!else -### should be: -### LLIBS = $(TCLSTUBLIB) $(XOTCLSTUBLIB) when xotcl stub lib is mature -### LLIBS = $(TCLSTUBLIB) $(XOTCLIMPLIB) -LLIBS = $(TCLSTUBLIB) $(XOTCLSTUBLIB) -!endif - -###################################################################### -# Compile flags -###################################################################### - -!IF $(DEBUG) == 0 -!IF "$(MACHINE)" == "ALPHA" -# MSVC on Alpha doesn't understand -Ot -cdebug = -O2i -!ELSE -cdebug = -Ox -!ENDIF -!ELSE -!if $(MSDEV_VER) < 6 -cdebug = -Zi -Od -WX -!else -cdebug = -ZI -Od -WX -!endif -!ENDIF - -!if $(STATIC_BUILD) -cdll = -!else -cdll = -GD -!endif - -# declarations common to all compiler options -ccommon = -nologo -c -W3 -YX \ - - -!if $(STATIC_BUILD) && $(NOMSVCRT) -crt = -MT$(DBGX) -!else -crt = -MD$(DBGX) -!endif - -INCLUDES = -I"$(TCLROOT)\generic" -I"$(XOTCL_DIR)\generic" -I"." - -DEFINES = -DBUILD_$(NAME) -DTCL_THREADS=1 \ - -DXOLIBPKG=$(INST_XOLIBPKG) \ - -DXOTCLVERSION=$(XOTCLVERSION) \ - -DPACKAGE_VERSION=$(XOTCLVERSION) \ - -DVERSION=$(XOTCLVERSION) \ - -DXOTCLPATCHLEVEL=$(XOTCLPATCHLEVEL) \ - -D__WIN32__ -DVISUAL_CC - -EXE_CFLAGS = $(ccommon) $(cdebug) $(crt) $(cdll) $(INCLUDES) $(DEFINES) - -!if $(USE_TCL_STUBS) -#CFLAGS = $(EXE_CFLAGS) -DUSE_TCL_STUBS -CFLAGS = $(EXE_CFLAGS) -DUSE_TCL_STUBS -DUSE_XOTCL_STUBS -!else -CFLAGS = $(EXE_CFLAGS) -!endif - -###################################################################### -# Project specific targets -###################################################################### - -all : libs - -libs : setup $(TARGET) - copy $(TARGET) .. - -setup : - @$(vcvars) > nul - @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) &\ - echo Created directory '$(TMP_DIR)' - @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) &\ - echo Created directory '$(OUT_DIR)' - -$(TARGET) : $(OBJS) -!if $(STATIC_BUILD) - $(lib32) -nologo -machine:$(MACHINE) -out:$@ @<< -!else - $(link32) $(LFLAGS) -base:@$(XOTCL_DIR)\win\dllBase.txt,$@ -out:$@ $(LLIBS) @<< -!endif - $(OBJS) -<< - - -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 $(TARGET) "$(SCRIPT_INSTALL_DIR)" - -###################################################################### -# Inference rules. Use batch-mode when supported. -###################################################################### - -!if $(_NMAKE_VER) < 162 -{$(WINDIR)}.c{$(TMP_DIR)}.obj : -!else -{$(WINDIR)}.c{$(TMP_DIR)}.obj :: -!endif - $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -!if $(_NMAKE_VER) < 162 -{$(GENERICDIR)}.c{$(TMP_DIR)}.obj : -!else -{$(GENERICDIR)}.c{$(TMP_DIR)}.obj :: -!endif - $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -#$(TMP_DIR)\xmltok.obj : expat\xmltok\xmltok.c -# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? -#$(TMP_DIR)\xmlrole.obj : expat\xmltok\xmlrole.c -# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? -#$(TMP_DIR)\xmlwf.obj : expat\xmlwf\xmlwf.c -# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? -#$(TMP_DIR)\readfilemap.obj : expat\xmlwf\readfilemap.c -# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? -#$(TMP_DIR)\codepage.obj : expat\xmlwf\codepage.c -# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? -#$(TMP_DIR)\xmlparse.obj : expat\xmlparse\xmlparse.c -# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? -#$(TMP_DIR)\hashtable.obj : expat\xmlparse\hashtable.c -# $(cc32) -DDLL_BUILD $(CFLAGS) -Fo$@ $? - -#{$(RCDIR)}.rc{$(TMP_DIR)}.res : -# $(rc32) -fo $@ -DDEBUG=$(DEBUG) $(XOTCL_VERSION_DEFINES) $(XOTCL_INCLUDES) $(TCL_INCLUDES) $(XOTCL_DEFINES) $< - -###################################################################### -# Clean up -###################################################################### - -tidy : - -del $(TMP_DIR)\*.pch - -del $(TMP_DIR)\*.obj - -del $(TMP_DIR)\*.res - -del .\*.pch - -del .\*.pdb - -clean : tidy - -del $(OUT_DIR)\*.exp - -del $(OUT_DIR)\*.lib - -del $(OUT_DIR)\*.dll - -del ..\*.exp - -del ..\*.lib - -del ..\*.dll - -distclean : clean - -rmdir $(OUT_DIR) - -rmdir $(TMP_DIR) - Index: xotcl/library/xml/TclExpat-1.1/aclocal.m4 =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/aclocal.m4 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/aclocal.m4 (revision 0) @@ -1,3 +0,0 @@ -builtin(include,xotcl.m4) -builtin(include,tcl.m4) - Index: xotcl/library/xml/TclExpat-1.1/asciitab.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/asciitab.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/asciitab.h (revision 0) @@ -1,52 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, -/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, -/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, -/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, -/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, -/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, -/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_NMSTRT, BT_SEMI, -/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, -/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, -/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, -/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, Index: xotcl/library/xml/TclExpat-1.1/codepage.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/codepage.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/codepage.c (revision 0) @@ -1,77 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#include "codepage.h" - -#ifdef WIN32 -#include - -int codepageMap(int cp, int *map) -{ - int i; - CPINFO info; - if (!GetCPInfo(cp, &info) || info.MaxCharSize > 2) - return 0; - for (i = 0; i < 256; i++) - map[i] = -1; - if (info.MaxCharSize > 1) { - for (i = 0; i < MAX_LEADBYTES; i++) { - int j, lim; - if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0) - break; - lim = info.LeadByte[i + 1]; - for (j = info.LeadByte[i]; j < lim; j++) - map[j] = -2; - } - } - for (i = 0; i < 256; i++) { - if (map[i] == -1) { - char c = i; - unsigned short n; - if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS, - &c, 1, &n, 1) == 1) - map[i] = n; - } - } - return 1; -} - -int codepageConvert(int cp, const char *p) -{ - unsigned short c; - if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS, - p, 2, &c, 1) == 1) - return c; - return -1; -} - -#else /* not WIN32 */ - -int codepageMap(int cp, int *map) -{ - return 0; -} - -int codepageConvert(int cp, const char *p) -{ - return -1; -} - -#endif /* not WIN32 */ Index: xotcl/library/xml/TclExpat-1.1/codepage.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/codepage.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/codepage.h (revision 0) @@ -1,22 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -int codepageMap(int cp, int *map); -int codepageConvert(int cp, const char *p); Index: xotcl/library/xml/TclExpat-1.1/config.log =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/config.log (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/config.log (revision 0) @@ -1,1026 +0,0 @@ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by xotclexpat configure 0.9, which was -generated by GNU Autoconf 2.57. Invocation command line was - - $ ./configure --prefix=/usr --enable-threads --prefix=/usr --with-all --cache-file=/dev/null --srcdir=. - -## --------- ## -## Platform. ## -## --------- ## - -hostname = localhost.localdomain -uname -m = i686 -uname -r = 2.4.22-1.2188.nptl -uname -s = Linux -uname -v = #1 Wed Apr 21 20:36:05 EDT 2004 - -/usr/bin/uname -p = unknown -/bin/uname -X = unknown - -/bin/arch = i686 -/usr/bin/arch -k = unknown -/usr/convex/getsysinfo = unknown -hostinfo = unknown -/bin/machine = unknown -/usr/bin/oslevel = unknown -/bin/universe = unknown - -PATH: . -PATH: /home/neumann/bin -PATH: . -PATH: /home/neumann/bin -PATH: /usr/local/bin -PATH: /usr/bin -PATH: /bin -PATH: /usr/X11R6/bin -PATH: /usr/X11R6/bin -PATH: /sbin -PATH: /usr/sbin -PATH: /opt/bin -PATH: /usr/X11R6/bin -PATH: /sbin -PATH: /usr/sbin -PATH: /opt/bin - - -## ----------- ## -## Core tests. ## -## ----------- ## - -configure:1294: checking for correct TEA configuration -configure:1313: result: ok -configure:1433: checking for Tcl configuration -configure:1505: result: found /usr/lib/tclConfig.sh -configure:1511: checking for existence of /usr/lib/tclConfig.sh -configure:1515: result: loading -configure:1670: checking for gcc -configure:1686: found /usr/bin/gcc -configure:1696: result: gcc -configure:1940: checking for C compiler version -configure:1943: gcc --version &5 -gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1) -Copyright (C) 2003 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -configure:1946: $? = 0 -configure:1948: gcc -v &5 -Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs -Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux -Thread model: posix -gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) -configure:1951: $? = 0 -configure:1953: gcc -V &5 -gcc: `-V' option must have argument -configure:1956: $? = 1 -configure:1980: checking for C compiler default output -configure:1983: gcc conftest.c >&5 -configure:1986: $? = 0 -configure:2032: result: a.out -configure:2037: checking whether the C compiler works -configure:2043: ./a.out -configure:2046: $? = 0 -configure:2063: result: yes -configure:2070: checking whether we are cross compiling -configure:2072: result: no -configure:2075: checking for suffix of executables -configure:2077: gcc -o conftest conftest.c >&5 -configure:2080: $? = 0 -configure:2105: result: -configure:2111: checking for suffix of object files -configure:2133: gcc -c conftest.c >&5 -configure:2136: $? = 0 -configure:2158: result: o -configure:2162: checking whether we are using the GNU C compiler -configure:2187: gcc -c conftest.c >&5 -configure:2190: $? = 0 -configure:2193: test -s conftest.o -configure:2196: $? = 0 -configure:2209: result: yes -configure:2215: checking whether gcc accepts -g -configure:2237: gcc -c -g conftest.c >&5 -configure:2240: $? = 0 -configure:2243: test -s conftest.o -configure:2246: $? = 0 -configure:2257: result: yes -configure:2274: checking for gcc option to accept ANSI C -configure:2335: gcc -c conftest.c >&5 -configure:2338: $? = 0 -configure:2341: test -s conftest.o -configure:2344: $? = 0 -configure:2362: result: none needed -configure:2380: gcc -c conftest.c >&5 -conftest.c:2: error: syntax error before "me" -configure:2383: $? = 1 -configure: failed program was: -| #ifndef __cplusplus -| choke me -| #endif -configure:2497: checking how to run the C preprocessor -configure:2533: gcc -E conftest.c -configure:2539: $? = 0 -configure:2571: gcc -E conftest.c -configure:2570:28: ac_nonexistent.h: No such file or directory -configure:2577: $? = 1 -configure: failed program was: -| #line 2562 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclexpat" -| #define PACKAGE_TARNAME "xotclexpat" -| #define PACKAGE_VERSION "0.9" -| #define PACKAGE_STRING "xotclexpat 0.9" -| #define PACKAGE_BUGREPORT "" -| /* end confdefs.h. */ -| #include -configure:2615: result: gcc -E -configure:2640: gcc -E conftest.c -configure:2646: $? = 0 -configure:2678: gcc -E conftest.c -configure:2677:28: ac_nonexistent.h: No such file or directory -configure:2684: $? = 1 -configure: failed program was: -| #line 2669 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclexpat" -| #define PACKAGE_TARNAME "xotclexpat" -| #define PACKAGE_VERSION "0.9" -| #define PACKAGE_STRING "xotclexpat 0.9" -| #define PACKAGE_BUGREPORT "" -| /* end confdefs.h. */ -| #include -configure:2739: checking for a BSD-compatible install -configure:2793: result: /usr/bin/install -c -configure:2809: checking whether make sets $(MAKE) -configure:2829: result: yes -configure:2884: checking for ranlib -configure:2900: found /usr/bin/ranlib -configure:2911: result: ranlib -configure:2933: checking for egrep -configure:2943: result: grep -E -configure:2948: checking for ANSI C header files -configure:2974: gcc -c conftest.c >&5 -configure:2977: $? = 0 -configure:2980: test -s conftest.o -configure:2983: $? = 0 -configure:3072: gcc -o conftest conftest.c >&5 -configure:3075: $? = 0 -configure:3077: ./conftest -configure:3080: $? = 0 -configure:3095: result: yes -configure:3119: checking for sys/types.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for sys/stat.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for stdlib.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for string.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for memory.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for strings.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for inttypes.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for stdint.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3119: checking for unistd.h -configure:3136: gcc -c conftest.c >&5 -configure:3139: $? = 0 -configure:3142: test -s conftest.o -configure:3145: $? = 0 -configure:3156: result: yes -configure:3178: checking if the compiler understands -pipe -configure:3199: gcc -pipe -c conftest.c >&5 -configure:3202: $? = 0 -configure:3205: test -s conftest.o -configure:3208: $? = 0 -configure:3210: result: yes -configure:3228: checking for required early compiler flags -configure:3252: gcc -pipe -c conftest.c >&5 -configure:3255: $? = 0 -configure:3258: test -s conftest.o -configure:3261: $? = 0 -configure:3338: gcc -pipe -c conftest.c >&5 -configure: In function `main': -configure:3343: error: storage size of `buf' isn't known -configure:3341: $? = 1 -configure: failed program was: -| #line 3321 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclexpat" -| #define PACKAGE_TARNAME "xotclexpat" -| #define PACKAGE_VERSION "0.9" -| #define PACKAGE_STRING "xotclexpat 0.9" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| /* end confdefs.h. */ -| #include -| int -| main () -| { -| struct stat64 buf; int i = stat64("/", &buf); -| ; -| return 0; -| } -configure:3372: gcc -pipe -c conftest.c >&5 -configure:3375: $? = 0 -configure:3378: test -s conftest.o -configure:3381: $? = 0 -configure:3407: result: _LARGEFILE64_SOURCE -configure:3412: checking for 64-bit integer type -configure:3435: gcc -pipe -c conftest.c >&5 -configure: In function `main': -configure:3441: error: `__int64' undeclared (first use in this function) -configure:3441: error: (Each undeclared identifier is reported only once -configure:3441: error: for each function it appears in.) -configure:3441: error: syntax error before "value" -configure:3438: $? = 1 -configure: failed program was: -| #line 3418 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclexpat" -| #define PACKAGE_TARNAME "xotclexpat" -| #define PACKAGE_VERSION "0.9" -| #define PACKAGE_STRING "xotclexpat 0.9" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| /* end confdefs.h. */ -| -| int -| main () -| { -| __int64 value = (__int64) 0; -| ; -| return 0; -| } -configure:3471: gcc -pipe -o conftest conftest.c >&5 -configure:3474: $? = 0 -configure:3476: ./conftest -configure:3479: $? = 0 -configure:3507: result: long long -configure:3511: checking for struct dirent64 -configure:3535: gcc -pipe -c conftest.c >&5 -configure:3538:24: sys/dirent.h: No such file or directory -configure: In function `main': -configure:3542: error: storage size of `p' isn't known -configure:3538: $? = 1 -configure: failed program was: -| #line 3517 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclexpat" -| #define PACKAGE_TARNAME "xotclexpat" -| #define PACKAGE_VERSION "0.9" -| #define PACKAGE_STRING "xotclexpat 0.9" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| /* end confdefs.h. */ -| #include -| #include -| int -| main () -| { -| struct dirent64 p; -| ; -| return 0; -| } -configure:3562: result: no -configure:3565: checking for struct stat64 -configure:3589: gcc -pipe -c conftest.c >&5 -configure:3592: $? = 0 -configure:3595: test -s conftest.o -configure:3598: $? = 0 -configure:3616: result: yes -configure:3619: checking for off64_t -configure:3643: gcc -pipe -c conftest.c >&5 -configure:3646: $? = 0 -configure:3649: test -s conftest.o -configure:3652: $? = 0 -configure:3670: result: yes -configure:3674: checking whether byte ordering is bigendian -configure:3702: gcc -pipe -c conftest.c >&5 -configure:3705: $? = 0 -configure:3708: test -s conftest.o -configure:3711: $? = 0 -configure:3736: gcc -pipe -c conftest.c >&5 -configure: In function `main': -configure:3743: error: `not' undeclared (first use in this function) -configure:3743: error: (Each undeclared identifier is reported only once -configure:3743: error: for each function it appears in.) -configure:3743: error: syntax error before "big" -configure:3739: $? = 1 -configure: failed program was: -| #line 3714 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclexpat" -| #define PACKAGE_TARNAME "xotclexpat" -| #define PACKAGE_VERSION "0.9" -| #define PACKAGE_STRING "xotclexpat 0.9" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| #include -| #include -| -| int -| main () -| { -| #if BYTE_ORDER != BIG_ENDIAN -| not big endian -| #endif -| -| ; -| return 0; -| } -configure:3859: result: no -configure:3887: checking for sin -configure:3937: gcc -pipe -o conftest conftest.c >&5 -configure:3930: warning: conflicting types for built-in function `sin' -/tmp/ccY0yOcH.o(.text+0x16): In function `main': -: undefined reference to `sin' -/tmp/ccY0yOcH.o(.data+0x0): undefined reference to `sin' -collect2: ld returned 1 exit status -configure:3940: $? = 1 -configure: failed program was: -| #line 3892 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclexpat" -| #define PACKAGE_TARNAME "xotclexpat" -| #define PACKAGE_VERSION "0.9" -| #define PACKAGE_STRING "xotclexpat 0.9" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char sin (); below. -| Prefer to if __STDC__ is defined, since -| exists even on freestanding compilers. */ -| #ifdef __STDC__ -| # include -| #else -| # include -| #endif -| /* Override any gcc2 internal prototype to avoid an error. */ -| #ifdef __cplusplus -| extern "C" -| { -| #endif -| /* We use char because int might match the return type of a gcc2 -| builtin and then its argument prototype would still apply. */ -| char sin (); -| /* The GNU C library defines this for functions which it implements -| to always fail with ENOSYS. Some functions are actually named -| something starting with __ and the normal name is an alias. */ -| #if defined (__stub_sin) || defined (__stub___sin) -| choke me -| #else -| char (*f) () = sin; -| #endif -| #ifdef __cplusplus -| } -| #endif -| -| int -| main () -| { -| return f != sin; -| ; -| return 0; -| } -configure:3957: result: no -configure:3965: checking for main in -lieee -configure:3990: gcc -pipe -o conftest conftest.c -lieee >&5 -configure:3993: $? = 0 -configure:3996: test -s conftest -configure:3999: $? = 0 -configure:4011: result: yes -configure:4023: checking for main in -linet -configure:4048: gcc -pipe -o conftest conftest.c -linet >&5 -/usr/bin/ld: cannot find -linet -collect2: ld returned 1 exit status -configure:4051: $? = 1 -configure: failed program was: -| #line 4030 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclexpat" -| #define PACKAGE_TARNAME "xotclexpat" -| #define PACKAGE_VERSION "0.9" -| #define PACKAGE_STRING "xotclexpat 0.9" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| -| -| int -| main () -| { -| main (); -| ; -| return 0; -| } -configure:4069: result: no -configure:4085: checking net/errno.h usability -configure:4098: gcc -pipe -c conftest.c >&5 -configure:4143:23: net/errno.h: No such file or directory -configure:4101: $? = 1 -configure: failed program was: -| #line 4087 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclexpat" -| #define PACKAGE_TARNAME "xotclexpat" -| #define PACKAGE_VERSION "0.9" -| #define PACKAGE_STRING "xotclexpat 0.9" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| #include -| #if HAVE_SYS_TYPES_H -| # include -| #endif -| #if HAVE_SYS_STAT_H -| # include -| #endif -| #if STDC_HEADERS -| # include -| # include -| #else -| # if HAVE_STDLIB_H -| # include -| # endif -| #endif -| #if HAVE_STRING_H -| # if !STDC_HEADERS && HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #if HAVE_STRINGS_H -| # include -| #endif -| #if HAVE_INTTYPES_H -| # include -| #else -| # if HAVE_STDINT_H -| # include -| # endif -| #endif -| #if HAVE_UNISTD_H -| # include -| #endif -| #include -configure:4117: result: no -configure:4121: checking net/errno.h presence -configure:4132: gcc -E conftest.c -configure:4145:23: net/errno.h: No such file or directory -configure:4138: $? = 1 -configure: failed program was: -| #line 4123 "configure" -| /* confdefs.h. */ -| -| #define PACKAGE_NAME "xotclexpat" -| #define PACKAGE_TARNAME "xotclexpat" -| #define PACKAGE_VERSION "0.9" -| #define PACKAGE_STRING "xotclexpat 0.9" -| #define PACKAGE_BUGREPORT "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define _LARGEFILE64_SOURCE 1 -| #define TCL_WIDE_INT_TYPE long long -| #define HAVE_STRUCT_STAT64 1 -| #define HAVE_TYPE_OFF64_T 1 -| /* end confdefs.h. */ -| #include -configure:4157: result: no -configure:4193: checking for net/errno.h -configure:4200: result: no -configure:4232: checking for connect -configure:4282: gcc -pipe -o conftest conftest.c >&5 -configure:4285: $? = 0 -configure:4288: test -s conftest -configure:4291: $? = 0 -configure:4302: result: yes -configure:4531: checking for gethostbyname -configure:4581: gcc -pipe -o conftest conftest.c >&5 -configure:4584: $? = 0 -configure:4587: test -s conftest -configure:4590: $? = 0 -configure:4601: result: yes -configure:4675: checking dirent.h -configure:4713: gcc -pipe -o conftest conftest.c >&5 -configure:4716: $? = 0 -configure:4719: test -s conftest -configure:4722: $? = 0 -configure:4740: result: yes -configure:4752: checking errno.h usability -configure:4765: gcc -pipe -c conftest.c >&5 -configure:4768: $? = 0 -configure:4771: test -s conftest.o -configure:4774: $? = 0 -configure:4784: result: yes -configure:4788: checking errno.h presence -configure:4799: gcc -E conftest.c -configure:4805: $? = 0 -configure:4824: result: yes -configure:4860: checking for errno.h -configure:4867: result: yes -configure:4891: checking float.h usability -configure:4904: gcc -pipe -c conftest.c >&5 -configure:4907: $? = 0 -configure:4910: test -s conftest.o -configure:4913: $? = 0 -configure:4923: result: yes -configure:4927: checking float.h presence -configure:4938: gcc -E conftest.c -configure:4944: $? = 0 -configure:4963: result: yes -configure:4999: checking for float.h -configure:5006: result: yes -configure:5030: checking values.h usability -configure:5043: gcc -pipe -c conftest.c >&5 -configure:5046: $? = 0 -configure:5049: test -s conftest.o -configure:5052: $? = 0 -configure:5062: result: yes -configure:5066: checking values.h presence -configure:5077: gcc -E conftest.c -configure:5083: $? = 0 -configure:5102: result: yes -configure:5138: checking for values.h -configure:5145: result: yes -configure:5169: checking limits.h usability -configure:5182: gcc -pipe -c conftest.c >&5 -configure:5185: $? = 0 -configure:5188: test -s conftest.o -configure:5191: $? = 0 -configure:5201: result: yes -configure:5205: checking limits.h presence -configure:5216: gcc -E conftest.c -configure:5222: $? = 0 -configure:5241: result: yes -configure:5277: checking for limits.h -configure:5284: result: yes -configure:5299: checking for stdlib.h -configure:5304: result: yes -configure:5495: checking for string.h -configure:5500: result: yes -configure:5687: checking sys/wait.h usability -configure:5700: gcc -pipe -c conftest.c >&5 -configure:5703: $? = 0 -configure:5706: test -s conftest.o -configure:5709: $? = 0 -configure:5719: result: yes -configure:5723: checking sys/wait.h presence -configure:5734: gcc -E conftest.c -configure:5740: $? = 0 -configure:5759: result: yes -configure:5795: checking for sys/wait.h -configure:5802: result: yes -configure:5826: checking dlfcn.h usability -configure:5839: gcc -pipe -c conftest.c >&5 -configure:5842: $? = 0 -configure:5845: test -s conftest.o -configure:5848: $? = 0 -configure:5858: result: yes -configure:5862: checking dlfcn.h presence -configure:5873: gcc -E conftest.c -configure:5879: $? = 0 -configure:5898: result: yes -configure:5934: checking for dlfcn.h -configure:5941: result: yes -configure:5967: checking for limits.h -configure:5972: result: yes -configure:5967: checking for unistd.h -configure:5972: result: yes -configure:5976: checking sys/param.h usability -configure:5989: gcc -pipe -c conftest.c >&5 -configure:5992: $? = 0 -configure:5995: test -s conftest.o -configure:5998: $? = 0 -configure:6008: result: yes -configure:6012: checking sys/param.h presence -configure:6023: gcc -E conftest.c -configure:6029: $? = 0 -configure:6048: result: yes -configure:6084: checking for sys/param.h -configure:6091: result: yes -configure:6139: checking for XOTcl configuration -configure:6200: result: found /home/neumann/xotcl-1.2.1/xotclConfig.sh -configure:6206: checking for existence of /home/neumann/xotcl-1.2.1/xotclConfig.sh -configure:6210: result: loading -configure:6379: checking for Tcl public headers -configure:6434: result: /usr/include -configure:6482: checking for pthread_mutex_init in -lpthread -configure:6513: gcc -pipe -o conftest conftest.c -lpthread >&5 -configure:6516: $? = 0 -configure:6519: test -s conftest -configure:6522: $? = 0 -configure:6534: result: yes -configure:6821: checking for pthread_attr_setstacksize -configure:6871: gcc -pipe -o conftest conftest.c -lpthread >&5 -configure:6874: $? = 0 -configure:6877: test -s conftest -configure:6880: $? = 0 -configure:6891: result: yes -configure:6906: checking for readdir_r -configure:6956: gcc -pipe -o conftest conftest.c >&5 -configure:6959: $? = 0 -configure:6962: test -s conftest -configure:6965: $? = 0 -configure:6976: result: yes -configure:6991: checking for building with threads -configure:6998: result: yes -configure:7037: checking how to build libraries -configure:7055: result: shared -configure:7081: checking if 64bit support is enabled -configure:7090: result: no -configure:7095: checking if 64bit Sparc VIS support is requested -configure:7104: result: no -configure:7132: checking system version (for dynamic loading) -configure:7155: result: Linux-2.4.22-1.2188.nptl -configure:7163: checking for dlopen in -ldl -configure:7194: gcc -pipe -o conftest conftest.c -ldl >&5 -configure:7197: $? = 0 -configure:7200: test -s conftest -configure:7203: $? = 0 -configure:7215: result: yes -configure:7245: checking for ar -configure:7261: found /usr/bin/ar -configure:7271: result: ar -configure:9157: checking for build with symbols -configure:9171: result: no -configure:9306: checking for tclsh -configure:9337: result: /usr/lib/../bin/tclsh8.4 -configure:9481: creating ./config.status - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by xotclexpat config.status 0.9, which was -generated by GNU Autoconf 2.57. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status - -on localhost.localdomain - -config.status:675: creating Makefile - -## ---------------- ## -## Cache variables. ## -## ---------------- ## - -ac_cv_c_bigendian=no -ac_cv_c_compiler_gnu=yes -ac_cv_c_tclconfig=/usr/lib -ac_cv_c_tclh=/usr/include -ac_cv_c_xotclconfig=/home/neumann/xotcl-1.2.1 -ac_cv_env_CC_set= -ac_cv_env_CC_value= -ac_cv_env_CFLAGS_set= -ac_cv_env_CFLAGS_value= -ac_cv_env_CPPFLAGS_set= -ac_cv_env_CPPFLAGS_value= -ac_cv_env_CPP_set= -ac_cv_env_CPP_value= -ac_cv_env_LDFLAGS_set= -ac_cv_env_LDFLAGS_value= -ac_cv_env_build_alias_set= -ac_cv_env_build_alias_value= -ac_cv_env_host_alias_set= -ac_cv_env_host_alias_value= -ac_cv_env_target_alias_set= -ac_cv_env_target_alias_value= -ac_cv_exeext= -ac_cv_func_connect=yes -ac_cv_func_gethostbyname=yes -ac_cv_func_pthread_attr_setstacksize=yes -ac_cv_func_readdir_r=yes -ac_cv_func_sin=no -ac_cv_header_dlfcn_h=yes -ac_cv_header_errno_h=yes -ac_cv_header_float_h=yes -ac_cv_header_inttypes_h=yes -ac_cv_header_limits_h=yes -ac_cv_header_memory_h=yes -ac_cv_header_net_errno_h=no -ac_cv_header_stdc=yes -ac_cv_header_stdint_h=yes -ac_cv_header_stdlib_h=yes -ac_cv_header_string_h=yes -ac_cv_header_strings_h=yes -ac_cv_header_sys_param_h=yes -ac_cv_header_sys_stat_h=yes -ac_cv_header_sys_types_h=yes -ac_cv_header_sys_wait_h=yes -ac_cv_header_unistd_h=yes -ac_cv_header_values_h=yes -ac_cv_lib_dl_dlopen=yes -ac_cv_lib_ieee_main=yes -ac_cv_lib_inet_main=no -ac_cv_lib_pthread_pthread_mutex_init=yes -ac_cv_objext=o -ac_cv_path_install='/usr/bin/install -c' -ac_cv_path_tclsh=/usr/lib/../bin/tclsh8.4 -ac_cv_prog_AR=ar -ac_cv_prog_CPP='gcc -E' -ac_cv_prog_ac_ct_CC=gcc -ac_cv_prog_ac_ct_RANLIB=ranlib -ac_cv_prog_cc_g=yes -ac_cv_prog_cc_stdc= -ac_cv_prog_egrep='grep -E' -ac_cv_prog_make_make_set=yes -tcl_cv_flag__isoc99_source=no -tcl_cv_flag__largefile64_source=yes -tcl_cv_struct_dirent64=no -tcl_cv_struct_stat64=yes -tcl_cv_type_64bit='long long' -tcl_cv_type_off64_t=yes - -## ----------------- ## -## Output variables. ## -## ----------------- ## - -AR='ar' -CC='gcc -pipe' -CFLAGS=' ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' -CFLAGS_DEBUG='-g' -CFLAGS_DEFAULT='-O' -CFLAGS_OPTIMIZE='-O' -CFLAGS_WARNING='-Wall -Wconversion -Wno-implicit-int' -CLEANFILES='pkgIndex.tcl' -CPP='gcc -E' -CPPFLAGS='' -CYGPATH='echo' -DEFS='-DPACKAGE_NAME=\"xotclexpat\" -DPACKAGE_TARNAME=\"xotclexpat\" -DPACKAGE_VERSION=\"0.9\" -DPACKAGE_STRING=\"xotclexpat\ 0.9\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -DTCL_THREADS=1 -DUSE_TCL_STUBS=1 ' -DL_LIBS='-ldl' -ECHO_C='' -ECHO_N='-n' -ECHO_T='' -EGREP='grep -E' -EXEEXT='' -EXTRA_CFLAGS='' -INSTALL_DATA='${INSTALL} -m 644' -INSTALL_PROGRAM='${INSTALL}' -INSTALL_SCRIPT='${INSTALL}' -LDFLAGS='-rdynamic' -LDFLAGS_DEBUG='' -LDFLAGS_DEFAULT='-rdynamic' -LDFLAGS_OPTIMIZE='' -LD_LIBRARY_PATH_VAR='LD_LIBRARY_PATH' -LIBOBJS='' -LIBS='' -LTLIBOBJS='' -MAKE_LIB='${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_FLAGS} ${SHLIB_LD_LIBS} ' -MAKE_SHARED_LIB='${SHLIB_LD} -o $@ $(PKG_OBJECTS) ${SHLIB_LD_FLAGS} ${SHLIB_LD_LIBS}' -MAKE_STATIC_LIB='${STLIB_LD} $@ $(PKG_OBJECTS)' -MAKE_STUB_LIB='${STLIB_LD} $@ $(PKG_STUB_OBJECTS)' -MATH_LIBS='-lieee -lm' -OBJEXT='o' -PACKAGE_BUGREPORT='' -PACKAGE_NAME='xotclexpat' -PACKAGE_STRING='xotclexpat 0.9' -PACKAGE_TARNAME='xotclexpat' -PACKAGE_VERSION='0.9' -PATH_SEPARATOR=':' -PKG_CFLAGS=' ' -PKG_HEADERS='' -PKG_INCLUDES=' -I/home/neumann/xotcl-1.2.1/generic' -PKG_LIBS=' -L/home/neumann/xotcl-1.2.1 -lxotclstub1.2.1' -PKG_LIB_FILE='libxotclexpat0.9.so' -PKG_OBJECTS=' xmltok.o unixfilemap.o xmlrole.o xmlwf.o codepage.o xmlparse.o hashtable.o tclexpat.o' -PKG_SOURCES=' xmltok.c unixfilemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c' -PKG_STUB_LIB_FILE='libxotclexpatstub0.9.a' -PKG_STUB_OBJECTS='' -PKG_STUB_SOURCES='' -PKG_TCL_SOURCES='' -RANLIB=':' -RANLIB_STUB='ranlib' -SET_MAKE='' -SHARED_BUILD='1' -SHELL='/bin/sh' -SHLIB_CFLAGS='-fPIC' -SHLIB_LD='gcc -pipe -shared' -SHLIB_LD_FLAGS='' -SHLIB_LD_LIBS='${LIBS} -L/usr/lib -ltclstub8.4' -STLIB_LD='${AR} cr' -TCLSH_PROG='/usr/lib/../bin/tclsh8.4' -TCL_BIN_DIR='/usr/lib' -TCL_DBGX='' -TCL_DEFS=' -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DPEEK_XCLOSEIM=1 -DHAVE_SYS_IOCTL_H=1 ' -TCL_EXTRA_CFLAGS='' -TCL_INCLUDES='-I"/usr/include"' -TCL_LD_FLAGS='-rdynamic' -TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' -TCL_LIB_FILE='libtcl8.4.so' -TCL_LIB_FLAG='-ltcl8.4' -TCL_LIB_SPEC='-L/usr/lib -ltcl8.4' -TCL_SHLIB_LD_LIBS='${LIBS}' -TCL_SRC_DIR='/home/neumann/tcl8.4.5' -TCL_STUB_LIB_FILE='libtclstub8.4.a' -TCL_STUB_LIB_FLAG='-ltclstub8.4' -TCL_STUB_LIB_SPEC='-L/usr/lib -ltclstub8.4' -TCL_THREADS='1' -TCL_VERSION='8.4' -XOTCL_BUILD_LIB_SPEC='-L/home/neumann/xotcl-1.2.1 -lxotcl1.2.1' -XOTCL_BUILD_STUB_LIB_SPEC='-L/home/neumann/xotcl-1.2.1 -lxotclstub1.2.1' -XOTCL_LIB_FILE='libxotcl1.2.1.so' -XOTCL_LIB_SPEC='-L/usr/lib -lxotcl1.2.1' -XOTCL_MAJOR_VERSION='1' -XOTCL_MINOR_VERSION='2' -XOTCL_RELEASE_LEVEL='.1' -XOTCL_SRC_DIR='/home/neumann/xotcl-1.2.1' -XOTCL_STUB_LIB_FILE='' -XOTCL_STUB_LIB_SPEC='-L/usr/lib -lxotclstub1.2.1' -XOTCL_VERSION='1.2' -ac_ct_CC='gcc' -ac_ct_RANLIB='ranlib' -bindir='${exec_prefix}/bin' -build_alias='' -datadir='${prefix}/share' -exec_prefix='/usr' -host_alias='' -includedir='${prefix}/include' -infodir='${prefix}/info' -libdir='${exec_prefix}/lib' -libexecdir='${exec_prefix}/libexec' -localstatedir='${prefix}/var' -mandir='${prefix}/man' -oldincludedir='/usr/include' -prefix='/usr' -program_transform_name='s,x,x,' -sbindir='${exec_prefix}/sbin' -sharedstatedir='${prefix}/com' -sysconfdir='${prefix}/etc' -target_alias='' - -## ----------- ## -## confdefs.h. ## -## ----------- ## - -#define HAVE_INTTYPES_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 -#define HAVE_READDIR_R 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRUCT_STAT64 1 -#define HAVE_SYS_PARAM_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_TYPE_OFF64_T 1 -#define HAVE_UNISTD_H 1 -#define HAVE_UNISTD_H 1 -#define PACKAGE_BUGREPORT "" -#define PACKAGE_NAME "xotclexpat" -#define PACKAGE_STRING "xotclexpat 0.9" -#define PACKAGE_TARNAME "xotclexpat" -#define PACKAGE_VERSION "0.9" -#define STDC_HEADERS 1 -#define TCL_THREADS 1 -#define TCL_WIDE_INT_TYPE long long -#define USE_TCL_STUBS 1 -#define USE_THREAD_ALLOC 1 -#define _LARGEFILE64_SOURCE 1 -#define _REENTRANT 1 -#define _THREAD_SAFE 1 - -configure: exit 0 Index: xotcl/library/xml/TclExpat-1.1/configure =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/configure (revision caee4f272cfc744a06a7df61e2f3c73da1b6be64) +++ xotcl/library/xml/TclExpat-1.1/configure (revision 0) @@ -1,10986 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for xotclexpat 0.9. -# -# Copyright (C) 2003 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_config_libobj_dir=. -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -# Identity of this package. -PACKAGE_NAME='xotclexpat' -PACKAGE_TARNAME='xotclexpat' -PACKAGE_VERSION='0.9' -PACKAGE_STRING='xotclexpat 0.9' -PACKAGE_BUGREPORT='' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_STAT_H -# include -#endif -#if STDC_HEADERS -# include -# include -#else -# if HAVE_STDLIB_H -# include -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif -# include -#endif -#if HAVE_STRINGS_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif -#if HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG LTLIBOBJS' -ac_subst_files='' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures xotclexpat 0.9 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -_ACEOF - - cat <<_ACEOF -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] -_ACEOF - - cat <<\_ACEOF -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of xotclexpat 0.9:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-threads build with threads - --enable-shared build and link with shared libraries (default: on) - --enable-64bit enable 64bit support (default: off) - --enable-64bit-vis enable 64bit Sparc VIS support (default: off) - --enable-wince enable Win/CE support (where applicable) - --enable-load allow dynamic loading and "load" command (default: - on) - --enable-symbols build with debugging symbols (default: off) - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH - absolute path to xotclConfig.sh, - --without-xotcl disables, but this is pointless - --with-tcl directory containing tcl configuration - (tclConfig.sh) - --with-tclinclude directory containing the public Tcl header files - --with-celib=DIR use Windows/CE support library from DIR - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\_ACEOF -xotclexpat configure 0.9 -generated by GNU Autoconf 2.59 - -Copyright (C) 2003 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit 0 -fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by xotclexpat $as_me 0.9, which was -generated by GNU Autoconf 2.59. Invocation command line was - - $ $0 $@ - -_ACEOF -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_sep= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - sed "/^$/d" confdefs.h | sort - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#-------------------------------------------------------------------- -# 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 extensions pass this us the version of TEA they think they - # are compatible with. - TEA_VERSION="3.6" - - echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 -echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 - if test x"${PACKAGE_NAME}" = x ; then - { { echo "$as_me:$LINENO: error: -The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 -echo "$as_me: error: -The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} - { (exit 1); exit 1; }; } - fi - if test x"3.5" = x ; then - { { echo "$as_me:$LINENO: error: -TEA version not specified." >&5 -echo "$as_me: error: -TEA version not specified." >&2;} - { (exit 1); exit 1; }; } - elif test "3.5" != "${TEA_VERSION}" ; then - echo "$as_me:$LINENO: result: warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&5 -echo "${ECHO_T}warning: requested TEA version \"3.5\", have \"${TEA_VERSION}\"" >&6 - else - echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 -echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 - fi - case "`uname -s`" in - *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) - # Extract the first word of "cygpath", so it can be a program name with args. -set dummy cygpath; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CYGPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CYGPATH"; then - ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CYGPATH="cygpath -w" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" -fi -fi -CYGPATH=$ac_cv_prog_CYGPATH -if test -n "$CYGPATH"; then - echo "$as_me:$LINENO: result: $CYGPATH" >&5 -echo "${ECHO_T}$CYGPATH" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - EXEEXT=".exe" - TEA_PLATFORM="windows" - ;; - *) - CYGPATH=echo - EXEEXT="" - TEA_PLATFORM="unix" - ;; - esac - - # Check if exec_prefix is set. If not use fall back to prefix. - # Note when adjusted, so that TEA_PREFIX can correct for this. - # This is needed for recursive configures, since autoconf propagates - # $prefix, but not $exec_prefix (doh!). - if test x$exec_prefix = xNONE ; then - exec_prefix_default=yes - exec_prefix=$prefix - fi - - - - - # This package name must be replaced statically for AC_SUBST to work - - # Substitute STUB_LIB_FILE in case package creates a stub library too. - - - # We AC_SUBST these here to ensure they are subst'ed, - # in case the user doesn't call TEA_ADD_... - - - - - - - - - -ac_aux_dir= -for ac_dir in ../../../config $srcdir/../../../config; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../../config $srcdir/../../../config" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in ../../../config $srcdir/../../../config" >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - - -#-------------------------------------------------------------------- -# specify some extra flags -#-------------------------------------------------------------------- - - -# Check whether --with-xotcl or --without-xotcl was given. -if test "${with_xotcl+set}" = set; then - withval="$with_xotcl" - with_xotcl=$withval -else - { { echo "$as_me:$LINENO: error: --with-xotcl is required" >&5 -echo "$as_me: error: --with-xotcl is required" >&2;} - { (exit 1); exit 1; }; } -fi; - -#-------------------------------------------------------------------- -# Load the tclConfig.sh file -#-------------------------------------------------------------------- - - - - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - - if test x"${no_tcl}" = x ; then - # we reset no_tcl in case something fails here - no_tcl=true - -# Check whether --with-tcl or --without-tcl was given. -if test "${with_tcl+set}" = set; then - withval="$with_tcl" - with_tclconfig=${withval} -fi; - echo "$as_me:$LINENO: checking for Tcl configuration" >&5 -echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 - if test "${ac_cv_c_tclconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - case ${with_tclconfig} in - */tclConfig.sh ) - if test -f ${with_tclconfig}; then - { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 -echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} - with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 -echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} - { (exit 1); exit 1; }; } - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tcl.framework/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - -fi - - - if test x"${ac_cv_c_tclconfig}" = x ; then - TCL_BIN_DIR="# no Tcl configs found" - { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 -echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} - exit 0 - else - no_tcl= - TCL_BIN_DIR=${ac_cv_c_tclconfig} - echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 - fi - fi - - - echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 - - if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - echo "$as_me:$LINENO: result: loading" >&5 -echo "${ECHO_T}loading" >&6 - . "${TCL_BIN_DIR}/tclConfig.sh" - else - echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tcl.framework installed in an arbitary location. - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then - for i in "`cd ${TCL_BIN_DIR}; pwd`" \ - "`cd ${TCL_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then - TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" - break - fi - done - fi - if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then - TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" - TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - - - - - - - - - - - - - - - - - - - -#-------------------------------------------------------------------- -# Load the tkConfig.sh file if necessary (Tk extension) -#-------------------------------------------------------------------- - -#TEA_PATH_TKCONFIG -#TEA_LOAD_TKCONFIG - -#----------------------------------------------------------------------- -# Handle the --prefix=... option by defaulting to what Tcl gave. -# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. -#----------------------------------------------------------------------- - - - if test "${prefix}" = "NONE"; then - prefix_default=yes - if test x"${TCL_PREFIX}" != x; then - { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 -echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} - prefix=${TCL_PREFIX} - else - { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 -echo "$as_me: --prefix defaulting to /usr/local" >&6;} - prefix=/usr/local - fi - fi - if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ - -o x"${exec_prefix_default}" = x"yes" ; then - if test x"${TCL_EXEC_PREFIX}" != x; then - { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 -echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} - exec_prefix=${TCL_EXEC_PREFIX} - else - { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 -echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} - exec_prefix=$prefix - fi - fi - - -#----------------------------------------------------------------------- -# Standard compiler checks. -# This sets up CC by using the CC env var, or looks for gcc otherwise. -# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create -# the basic setup necessary to compile executables. -#----------------------------------------------------------------------- - - - # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) - # in this macro, they need to go into TEA_SETUP_COMPILER instead. - - # If the user did not set CFLAGS, set it now to keep - # the AC_PROG_CC macro from adding "-g -O2". - if test "${CFLAGS+set}" != "set" ; then - CFLAGS="" - fi - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - # Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - - #-------------------------------------------------------------------- - # Checks to see if the make program sets the $MAKE variable. - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\_ACEOF -all: - @echo 'ac_maketemp="$(MAKE)"' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftest.make -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SET_MAKE= -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - - #-------------------------------------------------------------------- - # Find ranlib - #-------------------------------------------------------------------- - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - - - #-------------------------------------------------------------------- - # Determines the correct binary file extension (.o, .obj, .exe etc.) - #-------------------------------------------------------------------- - - - - - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. - - - #------------------------------------------------------------------------ - # If we're using GCC, see if the compiler understands -pipe. If so, use it. - # It makes compiling go faster. (This is only a performance feature.) - #------------------------------------------------------------------------ - - if test -z "$no_pipe" -a -n "$GCC"; then - echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 -echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 -if test "${tcl_cv_cc_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_pipe=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_pipe=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 -echo "${ECHO_T}$tcl_cv_cc_pipe" >&6 - if test $tcl_cv_cc_pipe = yes; then - CFLAGS="$CFLAGS -pipe" - fi - fi - - #-------------------------------------------------------------------- - # Common compiler flag setup - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_bigendian=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -# It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - - if test "${TEA_PLATFORM}" = "unix" ; then - - #-------------------------------------------------------------------- - # On a few very rare systems, all of the libm.a stuff is - # already in libc.a. Set compiler flags accordingly. - # Also, Linux requires the "ieee" library for math to work - # right (and it must appear before "-lm"). - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking for sin" >&5 -echo $ECHO_N "checking for sin... $ECHO_C" >&6 -if test "${ac_cv_func_sin+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define sin to an innocuous variant, in case declares sin. - For example, HP-UX 11i declares gettimeofday. */ -#define sin innocuous_sin - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char sin (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef sin - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char sin (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_sin) || defined (__stub___sin) -choke me -#else -char (*f) () = sin; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != sin; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_sin=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_sin=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 -echo "${ECHO_T}$ac_cv_func_sin" >&6 -if test $ac_cv_func_sin = yes; then - MATH_LIBS="" -else - MATH_LIBS="-lm" -fi - - echo "$as_me:$LINENO: checking for main in -lieee" >&5 -echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 -if test "${ac_cv_lib_ieee_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lieee $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_ieee_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_ieee_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 -echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 -if test $ac_cv_lib_ieee_main = yes; then - MATH_LIBS="-lieee $MATH_LIBS" -fi - - - #-------------------------------------------------------------------- - # Interactive UNIX requires -linet instead of -lsocket, plus it - # needs net/errno.h to define the socket-related error codes. - #-------------------------------------------------------------------- - - echo "$as_me:$LINENO: checking for main in -linet" >&5 -echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 -if test "${ac_cv_lib_inet_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-linet $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_inet_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_inet_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 -echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 -if test $ac_cv_lib_inet_main = yes; then - LIBS="$LIBS -linet" -fi - - if test "${ac_cv_header_net_errno_h+set}" = set; then - echo "$as_me:$LINENO: checking for net/errno.h" >&5 -echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_net_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking net/errno.h usability" >&5 -echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking net/errno.h presence" >&5 -echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------- ## -## Report this to the xotclexpat lists. ## -## ------------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for net/errno.h" >&5 -echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_net_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_net_errno_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 - -fi -if test $ac_cv_header_net_errno_h = yes; then - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_NET_ERRNO_H 1 -_ACEOF - -fi - - - - #-------------------------------------------------------------------- - # Check for the existence of the -lsocket and -lnsl libraries. - # The order here is important, so that they end up in the right - # order in the command line generated by make. Here are some - # special considerations: - # 1. Use "connect" and "accept" to check for -lsocket, and - # "gethostbyname" to check for -lnsl. - # 2. Use each function name only once: can't redo a check because - # autoconf caches the results of the last check and won't redo it. - # 3. Use -lnsl and -lsocket only if they supply procedures that - # aren't already present in the normal libraries. This is because - # IRIX 5.2 has libraries, but they aren't needed and they're - # bogus: they goof up name resolution if used. - # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. - # To get around this problem, check for both libraries together - # if -lsocket doesn't work by itself. - #-------------------------------------------------------------------- - - tcl_checkBoth=0 - echo "$as_me:$LINENO: checking for connect" >&5 -echo $ECHO_N "checking for connect... $ECHO_C" >&6 -if test "${ac_cv_func_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define connect to an innocuous variant, in case declares connect. - For example, HP-UX 11i declares gettimeofday. */ -#define connect innocuous_connect - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef connect - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_connect) || defined (__stub___connect) -choke me -#else -char (*f) () = connect; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != connect; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_connect=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_connect=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 -echo "${ECHO_T}$ac_cv_func_connect" >&6 -if test $ac_cv_func_connect = yes; then - tcl_checkSocket=0 -else - tcl_checkSocket=1 -fi - - if test "$tcl_checkSocket" = 1; then - echo "$as_me:$LINENO: checking for setsockopt" >&5 -echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 -if test "${ac_cv_func_setsockopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define setsockopt to an innocuous variant, in case declares setsockopt. - For example, HP-UX 11i declares gettimeofday. */ -#define setsockopt innocuous_setsockopt - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char setsockopt (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef setsockopt - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setsockopt (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_setsockopt) || defined (__stub___setsockopt) -choke me -#else -char (*f) () = setsockopt; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != setsockopt; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_setsockopt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_setsockopt=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 -if test $ac_cv_func_setsockopt = yes; then - : -else - echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 -echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 -if test "${ac_cv_lib_socket_setsockopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setsockopt (); -int -main () -{ -setsockopt (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_socket_setsockopt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_socket_setsockopt=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 -if test $ac_cv_lib_socket_setsockopt = yes; then - LIBS="$LIBS -lsocket" -else - tcl_checkBoth=1 -fi - -fi - - fi - if test "$tcl_checkBoth" = 1; then - tk_oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - echo "$as_me:$LINENO: checking for accept" >&5 -echo $ECHO_N "checking for accept... $ECHO_C" >&6 -if test "${ac_cv_func_accept+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define accept to an innocuous variant, in case declares accept. - For example, HP-UX 11i declares gettimeofday. */ -#define accept innocuous_accept - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char accept (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef accept - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char accept (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_accept) || defined (__stub___accept) -choke me -#else -char (*f) () = accept; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != accept; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_accept=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_accept=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 -echo "${ECHO_T}$ac_cv_func_accept" >&6 -if test $ac_cv_func_accept = yes; then - tcl_checkNsl=0 -else - LIBS=$tk_oldLibs -fi - - fi - echo "$as_me:$LINENO: checking for gethostbyname" >&5 -echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 -if test "${ac_cv_func_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. - For example, HP-UX 11i declares gettimeofday. */ -#define gethostbyname innocuous_gethostbyname - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef gethostbyname - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -char (*f) () = gethostbyname; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != gethostbyname; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_gethostbyname=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 -if test $ac_cv_func_gethostbyname = yes; then - : -else - echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 -echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 -if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -int -main () -{ -gethostbyname (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_nsl_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_nsl_gethostbyname=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 -if test $ac_cv_lib_nsl_gethostbyname = yes; then - LIBS="$LIBS -lnsl" -fi - -fi - - - # Don't perform the eval of the libraries here because DL_LIBS - # won't be set until we call TEA_CONFIG_CFLAGS - - TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' - - - - - echo "$as_me:$LINENO: checking dirent.h" >&5 -echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 -if test "${tcl_cv_dirent_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ - -#ifndef _POSIX_SOURCE -# ifdef __Lynx__ - /* - * Generate compilation error to make the test fail: Lynx headers - * are only valid if really in the POSIX environment. - */ - - missing_procedure(); -# endif -#endif -DIR *d; -struct dirent *entryPtr; -char *p; -d = opendir("foobar"); -entryPtr = readdir(d); -p = entryPtr->d_name; -closedir(d); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_dirent_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_dirent_h=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 -echo "${ECHO_T}$tcl_cv_dirent_h" >&6 - - if test $tcl_cv_dirent_h = no; then - -cat >>confdefs.h <<\_ACEOF -#define NO_DIRENT_H 1 -_ACEOF - - fi - - if test "${ac_cv_header_errno_h+set}" = set; then - echo "$as_me:$LINENO: checking for errno.h" >&5 -echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_errno_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking errno.h usability" >&5 -echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking errno.h presence" >&5 -echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------- ## -## Report this to the xotclexpat lists. ## -## ------------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for errno.h" >&5 -echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_errno_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_errno_h" >&6 - -fi -if test $ac_cv_header_errno_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_ERRNO_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_float_h+set}" = set; then - echo "$as_me:$LINENO: checking for float.h" >&5 -echo $ECHO_N "checking for float.h... $ECHO_C" >&6 -if test "${ac_cv_header_float_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 -echo "${ECHO_T}$ac_cv_header_float_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking float.h usability" >&5 -echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking float.h presence" >&5 -echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------- ## -## Report this to the xotclexpat lists. ## -## ------------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for float.h" >&5 -echo $ECHO_N "checking for float.h... $ECHO_C" >&6 -if test "${ac_cv_header_float_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_float_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 -echo "${ECHO_T}$ac_cv_header_float_h" >&6 - -fi -if test $ac_cv_header_float_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_FLOAT_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_values_h+set}" = set; then - echo "$as_me:$LINENO: checking for values.h" >&5 -echo $ECHO_N "checking for values.h... $ECHO_C" >&6 -if test "${ac_cv_header_values_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 -echo "${ECHO_T}$ac_cv_header_values_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking values.h usability" >&5 -echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking values.h presence" >&5 -echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------- ## -## Report this to the xotclexpat lists. ## -## ------------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for values.h" >&5 -echo $ECHO_N "checking for values.h... $ECHO_C" >&6 -if test "${ac_cv_header_values_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_values_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 -echo "${ECHO_T}$ac_cv_header_values_h" >&6 - -fi -if test $ac_cv_header_values_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_VALUES_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_limits_h+set}" = set; then - echo "$as_me:$LINENO: checking for limits.h" >&5 -echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 -if test "${ac_cv_header_limits_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 -echo "${ECHO_T}$ac_cv_header_limits_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking limits.h usability" >&5 -echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking limits.h presence" >&5 -echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------- ## -## Report this to the xotclexpat lists. ## -## ------------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for limits.h" >&5 -echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 -if test "${ac_cv_header_limits_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_limits_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 -echo "${ECHO_T}$ac_cv_header_limits_h" >&6 - -fi -if test $ac_cv_header_limits_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIMITS_H 1 -_ACEOF - -else - -cat >>confdefs.h <<\_ACEOF -#define NO_LIMITS_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_stdlib_h+set}" = set; then - echo "$as_me:$LINENO: checking for stdlib.h" >&5 -echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking stdlib.h usability" >&5 -echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking stdlib.h presence" >&5 -echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------- ## -## Report this to the xotclexpat lists. ## -## ------------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for stdlib.h" >&5 -echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_stdlib_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 - -fi -if test $ac_cv_header_stdlib_h = yes; then - tcl_ok=1 -else - tcl_ok=0 -fi - - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtol" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtoul" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtod" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - if test $tcl_ok = 0; then - -cat >>confdefs.h <<\_ACEOF -#define NO_STDLIB_H 1 -_ACEOF - - fi - if test "${ac_cv_header_string_h+set}" = set; then - echo "$as_me:$LINENO: checking for string.h" >&5 -echo $ECHO_N "checking for string.h... $ECHO_C" >&6 -if test "${ac_cv_header_string_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 -echo "${ECHO_T}$ac_cv_header_string_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking string.h usability" >&5 -echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking string.h presence" >&5 -echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------- ## -## Report this to the xotclexpat lists. ## -## ------------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for string.h" >&5 -echo $ECHO_N "checking for string.h... $ECHO_C" >&6 -if test "${ac_cv_header_string_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_string_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 -echo "${ECHO_T}$ac_cv_header_string_h" >&6 - -fi -if test $ac_cv_header_string_h = yes; then - tcl_ok=1 -else - tcl_ok=0 -fi - - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strstr" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strerror" >/dev/null 2>&1; then - : -else - tcl_ok=0 -fi -rm -f conftest* - - - # See also memmove check below for a place where NO_STRING_H can be - # set and why. - - if test $tcl_ok = 0; then - -cat >>confdefs.h <<\_ACEOF -#define NO_STRING_H 1 -_ACEOF - - fi - - if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo "$as_me:$LINENO: checking for sys/wait.h" >&5 -echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 -if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 -echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 -echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------- ## -## Report this to the xotclexpat lists. ## -## ------------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for sys/wait.h" >&5 -echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 -if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_sys_wait_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 - -fi -if test $ac_cv_header_sys_wait_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_SYS_WAIT_H 1 -_ACEOF - -fi - - - if test "${ac_cv_header_dlfcn_h+set}" = set; then - echo "$as_me:$LINENO: checking for dlfcn.h" >&5 -echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 -if test "${ac_cv_header_dlfcn_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 -echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 -echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 -echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------- ## -## Report this to the xotclexpat lists. ## -## ------------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for dlfcn.h" >&5 -echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 -if test "${ac_cv_header_dlfcn_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_dlfcn_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 -echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 - -fi -if test $ac_cv_header_dlfcn_h = yes; then - : -else - -cat >>confdefs.h <<\_ACEOF -#define NO_DLFCN_H 1 -_ACEOF - -fi - - - - # OS/390 lacks sys/param.h (and doesn't need it, by chance). - -for ac_header in sys/param.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------- ## -## Report this to the xotclexpat lists. ## -## ------------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - # Let the user call this, because if it triggers, they will - # need a compat/strtod.c that is correct. Users can also - # use Tcl_GetDouble(FromObj) instead. - #TEA_BUGGY_STRTOD - fi - - -#-------------------------------------------------------------------- -# Load the xotclConfig.sh file -#-------------------------------------------------------------------- - -{ echo "$as_me:$LINENO: Reading file ${with_xotcl}/xotclConfig.sh" >&5 -echo "$as_me: Reading file ${with_xotcl}/xotclConfig.sh" >&6;} -source ${with_xotcl}/xotclConfig.sh - -#----------------------------------------------------------------------- -# __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. -#----------------------------------------------------------------------- - -if test "${TEA_PLATFORM}" = "windows" ; then - - vars="xmltok.c win32filemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c" - for i in $vars; do - case $i in - \$*) - # allow $-var names - PKG_SOURCES="$PKG_SOURCES $i" - PKG_OBJECTS="$PKG_OBJECTS $i" - ;; - *) - # check for existence - allows for generic/win/unix VPATH - # To add more dirs here (like 'src'), you have to update VPATH - # in Makefile.in as well - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 -echo "$as_me: error: could not find source file '$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_SOURCES="$PKG_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" - fi - PKG_OBJECTS="$PKG_OBJECTS $j" - ;; - esac - done - - - -else - - vars="xmltok.c unixfilemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c" - for i in $vars; do - case $i in - \$*) - # allow $-var names - PKG_SOURCES="$PKG_SOURCES $i" - PKG_OBJECTS="$PKG_OBJECTS $i" - ;; - *) - # check for existence - allows for generic/win/unix VPATH - # To add more dirs here (like 'src'), you have to update VPATH - # in Makefile.in as well - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 -echo "$as_me: error: could not find source file '$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_SOURCES="$PKG_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" - fi - PKG_OBJECTS="$PKG_OBJECTS $j" - ;; - esac - done - - - -fi - - - vars="" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 -echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_HEADERS="$PKG_HEADERS $i" - done - - - - vars="-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC}" - for i in $vars; do - PKG_INCLUDES="$PKG_INCLUDES $i" - done - - - - vars="$XOTCL_BUILD_STUB_LIB_SPEC" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - - - - PKG_CFLAGS="$PKG_CFLAGS " - - - - vars="" - for i in $vars; do - # check for existence - allows for generic/win/unix VPATH - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 -echo "$as_me: error: could not find stub source file '$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" - fi - PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" - done - - - - - vars="" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 -echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} - { (exit 1); exit 1; }; } - fi - PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" - done - - - -#-------------------------------------------------------------------- -# __CHANGE__ -# A few miscellaneous platform-specific items: -# -# Define a special symbol for Windows (BUILD_sample in this case) so -# that we create the export library with the dll. -# -# 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. -# -# TEA_ADD_* any platform specific compiler/build info here. -#-------------------------------------------------------------------- - -if test "${TEA_PLATFORM}" = "windows" ; then - cat >>confdefs.h <<\_ACEOF -#define BUILD_sample 1 -_ACEOF - - CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" - #TEA_ADD_SOURCES([win/winFile.c]) - #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) -else - CLEANFILES="pkgIndex.tcl" - #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 -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking for Tcl public headers" >&5 -echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 - - -# Check whether --with-tclinclude or --without-tclinclude was given. -if test "${with_tclinclude+set}" = set; then - withval="$with_tclinclude" - with_tclinclude=${withval} -fi; - - if test "${ac_cv_c_tclh+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - # Use the value from --with-tclinclude, if it was given - - if test x"${with_tclinclude}" != x ; then - if test -f "${with_tclinclude}/tcl.h" ; then - ac_cv_c_tclh=${with_tclinclude} - else - { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 -echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} - { (exit 1); exit 1; }; } - fi - else - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers directory - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tcl is not installed, - # and in that situation, look there before installed locations. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - if test x"${TCL_INCLUDE_SPEC}" != x ; then - d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` - list="$list `ls -d ${d} 2>/dev/null`" - fi - fi - for i in $list ; do - if test -f "$i/tcl.h" ; then - ac_cv_c_tclh=$i - break - fi - done - fi - -fi - - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tclh}" = x ; then - { { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 -echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} - { (exit 1); exit 1; }; } - else - echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 -echo "${ECHO_T}${ac_cv_c_tclh}" >&6 - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` - - TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - - -#TEA_PRIVATE_TCL_HEADERS - -#TEA_PUBLIC_TK_HEADERS -#TEA_PRIVATE_TK_HEADERS -#TEA_PATH_X - -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -#-------------------------------------------------------------------- - - - # Check whether --enable-threads or --disable-threads was given. -if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval -else - tcl_ok=yes -fi; - - if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then - TCL_THREADS=1 - - if test "${TEA_PLATFORM}" != "windows" ; then - # We are always OK on Windows, so check what this platform wants: - - # USE_THREAD_ALLOC tells us to try the special thread-based - # allocator that significantly reduces lock contention - -cat >>confdefs.h <<\_ACEOF -#define USE_THREAD_ALLOC 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - if test "`uname -s`" = "SunOS" ; then - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - fi - -cat >>confdefs.h <<\_ACEOF -#define _THREAD_SAFE 1 -_ACEOF - - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 -if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthread_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthread_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 -if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "no"; then - # Check a little harder for __pthread_mutex_init in the same - # library, as some systems hide it there until pthread.h is - # defined. We could alternatively do an AC_TRY_COMPILE with - # pthread.h, but that will work with libpthread really doesn't - # exist, like AIX 4.2. [Bug: 4359] - echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 -echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 -if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char __pthread_mutex_init (); -int -main () -{ -__pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthread___pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthread___pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 -if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthread" - else - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 -if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthreads $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthreads_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthreads_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 -if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthreads" - else - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 -if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_c_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_c_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 -if test $ac_cv_lib_c_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "no"; then - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 -if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc_r $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_init (); -int -main () -{ -pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_c_r_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_c_r_pthread_mutex_init=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 -if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -pthread" - else - TCL_THREADS=0 - { echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 -echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} - fi - fi - fi - fi - fi - else - TCL_THREADS=0 - fi - # Do checking message here to not mess up interleaved configure output - echo "$as_me:$LINENO: checking for building with threads" >&5 -echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 - if test "${TCL_THREADS}" = 1; then - -cat >>confdefs.h <<\_ACEOF -#define TCL_THREADS 1 -_ACEOF - - echo "$as_me:$LINENO: result: yes (default)" >&5 -echo "${ECHO_T}yes (default)" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - # TCL_THREADS sanity checking. See if our request for building with - # threads is the same as the way Tcl was built. If not, warn the user. - case ${TCL_DEFS} in - *THREADS=1*) - if test "${TCL_THREADS}" = "0"; then - { echo "$as_me:$LINENO: WARNING: - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads." >&5 -echo "$as_me: WARNING: - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads." >&2;} - fi - ;; - *) - if test "${TCL_THREADS}" = "1"; then - { echo "$as_me:$LINENO: WARNING: - --enable-threads requested, but building against a Tcl that is NOT - thread-enabled. This is an OK configuration that will also run in - a thread-enabled core." >&5 -echo "$as_me: WARNING: - --enable-threads requested, but building against a Tcl that is NOT - thread-enabled. This is an OK configuration that will also run in - a thread-enabled core." >&2;} - fi - ;; - esac - - - -#-------------------------------------------------------------------- -# The statement below defines a collection of symbols related to -# building as a shared library instead of a static library. -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking how to build libraries" >&5 -echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 - # Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval -else - tcl_ok=yes -fi; - - if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" ; then - echo "$as_me:$LINENO: result: shared" >&5 -echo "${ECHO_T}shared" >&6 - SHARED_BUILD=1 - else - echo "$as_me:$LINENO: result: static" >&5 -echo "${ECHO_T}static" >&6 - SHARED_BUILD=0 - -cat >>confdefs.h <<\_ACEOF -#define STATIC_BUILD 1 -_ACEOF - - fi - - - -#-------------------------------------------------------------------- -# 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. -#-------------------------------------------------------------------- - - - - - # Step 0.a: Enable 64 bit support? - - echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 -echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 - # Check whether --enable-64bit or --disable-64bit was given. -if test "${enable_64bit+set}" = set; then - enableval="$enable_64bit" - do64bit=$enableval -else - do64bit=no -fi; - echo "$as_me:$LINENO: result: $do64bit" >&5 -echo "${ECHO_T}$do64bit" >&6 - - # Step 0.b: Enable Solaris 64 bit VIS support? - - echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 -echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 - # Check whether --enable-64bit-vis or --disable-64bit-vis was given. -if test "${enable_64bit_vis+set}" = set; then - enableval="$enable_64bit_vis" - do64bitVIS=$enableval -else - do64bitVIS=no -fi; - echo "$as_me:$LINENO: result: $do64bitVIS" >&5 -echo "${ECHO_T}$do64bitVIS" >&6 - - if test "$do64bitVIS" = "yes"; then - # Force 64bit on with VIS - do64bit=yes - fi - - # Step 0.c: Cross-compiling options for Windows/CE builds? - - if test "${TEA_PLATFORM}" = "windows" ; then - echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 -echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 - # Check whether --enable-wince or --disable-wince was given. -if test "${enable_wince+set}" = set; then - enableval="$enable_wince" - doWince=$enableval -else - doWince=no -fi; - echo "$as_me:$LINENO: result: $doWince" >&5 -echo "${ECHO_T}$doWince" >&6 - fi - - # Step 1: set the variable "system" to hold the name and version number - # for the system. - - - echo "$as_me:$LINENO: checking system version" >&5 -echo $ECHO_N "checking system version... $ECHO_C" >&6 -if test "${tcl_cv_sys_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - if test "${TEA_PLATFORM}" = "windows" ; then - tcl_cv_sys_version=windows - elif test -f /usr/lib/NextStep/software_version; then - tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` - else - tcl_cv_sys_version=`uname -s`-`uname -r` - if test "$?" -ne 0 ; then - { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 -echo "$as_me: WARNING: can't find uname command" >&2;} - tcl_cv_sys_version=unknown - else - # Special check for weird MP-RAS system (uname returns weird - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` - fi - if test "`uname -s`" = "AIX" ; then - tcl_cv_sys_version=AIX-`uname -v`.`uname -r` - fi - fi - fi - -fi -echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 -echo "${ECHO_T}$tcl_cv_sys_version" >&6 - system=$tcl_cv_sys_version - - - # Step 2: check for existence of -ldl library. This is needed because - # Linux can use either -ldl or -ldld for dynamic loading. - - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - have_dl=yes -else - have_dl=no -fi - - - # Require ranlib early so we can override it in special cases below. - - - - # Step 3: set configuration options based on system name and version. - # This is similar to Tcl's unix/tcl.m4 except that we've added a - # "windows" case. - - do64bit_ok=no - LDFLAGS_ORIG="$LDFLAGS" - # When ld needs options to work in 64-bit mode, put them in - # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] - # is disabled by the user. [Bug 1016796] - LDFLAGS_ARCH="" - TCL_EXPORT_FILE_SUFFIX="" - UNSHARED_LIB_SUFFIX="" - TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' - ECHO_VERSION='`echo ${PACKAGE_VERSION}`' - TCL_LIB_VERSIONS_OK=ok - CFLAGS_DEBUG=-g - CFLAGS_OPTIMIZE=-O - if test "$GCC" = "yes" ; then - CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wno-implicit-int" - else - CFLAGS_WARNING="" - fi - TCL_NEEDS_EXP_FILE=0 - TCL_BUILD_EXP_FILE="" - TCL_EXP_FILE="" - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - STLIB_LD='${AR} cr' - LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" - case $system in - windows) - # This is a 2-stage check to make sure we have the 64-bit SDK - # We have to know where the SDK is installed. - # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs - # MACHINE is IX86 for LINK, but this is used by the manifest, - # which requires x86|amd64|ia64. - MACHINE="X86" - if test "$do64bit" != "no" ; then - if test "x${MSSDK}x" = "xx" ; then - MSSDK="C:/Progra~1/Microsoft Platform SDK" - fi - MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` - PATH64="" - case "$do64bit" in - amd64|x64|yes) - MACHINE="AMD64" ; # default to AMD64 64-bit build - PATH64="${MSSDK}/Bin/Win64/x86/AMD64" - ;; - ia64) - MACHINE="IA64" - PATH64="${MSSDK}/Bin/Win64" - ;; - esac - if test ! -d "${PATH64}" ; then - { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 -echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} - { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 -echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} - do64bit="no" - else - echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 -echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 - do64bit_ok="yes" - fi - fi - - if test "$doWince" != "no" ; then - if test "$do64bit" != "no" ; then - { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 -echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} - { (exit 1); exit 1; }; } - fi - if test "$GCC" = "yes" ; then - { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 -echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} - { (exit 1); exit 1; }; } - fi - - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-celib - - if test x"${no_celib}" = x ; then - # we reset no_celib in case something fails here - no_celib=true - -# Check whether --with-celib or --without-celib was given. -if test "${with_celib+set}" = set; then - withval="$with_celib" - with_celibconfig=${withval} -fi; - echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 -echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 - if test "${ac_cv_c_celibconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - # First check to see if --with-celibconfig was specified. - if test x"${with_celibconfig}" != x ; then - if test -d "${with_celibconfig}/inc" ; then - ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` - else - { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 -echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} - { (exit 1); exit 1; }; } - fi - fi - - # then check for a celib library - if test x"${ac_cv_c_celibconfig}" = x ; then - for i in \ - ../celib-palm-3.0 \ - ../celib \ - ../../celib-palm-3.0 \ - ../../celib \ - `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ - ${srcdir}/../celib-palm-3.0 \ - ${srcdir}/../celib \ - `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ - ; do - if test -d "$i/inc" ; then - ac_cv_c_celibconfig=`(cd $i; pwd)` - break - fi - done - fi - -fi - - if test x"${ac_cv_c_celibconfig}" = x ; then - { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 -echo "$as_me: error: Cannot find celib support library directory" >&2;} - { (exit 1); exit 1; }; } - else - no_celib= - CELIB_DIR=${ac_cv_c_celibconfig} - CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` - echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 -echo "${ECHO_T}found $CELIB_DIR" >&6 - fi - fi - - # Set defaults for common evc4/PPC2003 setup - # Currently Tcl requires 300+, possibly 420+ for sockets - CEVERSION=420; # could be 211 300 301 400 420 ... - TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... - ARCH=ARM; # could be ARM MIPS X86EM ... - PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" - if test "$doWince" != "yes"; then - # If !yes then the user specified something - # Reset ARCH to allow user to skip specifying it - ARCH= - eval `echo $doWince | awk -F, '{ \ - if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ - if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ - if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ - if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ - if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ - }'` - if test "x${ARCH}" = "x" ; then - ARCH=$TARGETCPU; - fi - fi - OSVERSION=WCE$CEVERSION; - if test "x${WCEROOT}" = "x" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" - if test ! -d "${WCEROOT}" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded Tools" - fi - fi - if test "x${SDKROOT}" = "x" ; then - SDKROOT="C:/Program Files/Windows CE Tools" - if test ! -d "${SDKROOT}" ; then - SDKROOT="C:/Windows CE Tools" - fi - fi - WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` - SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` - if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ - -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then - { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 -echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} - { (exit 1); exit 1; }; } - doWince="no" - else - # We could PATH_NOSPACE these, but that's not important, - # as long as we quote them when used. - CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" - if test -d "${CEINCLUDE}/${TARGETCPU}" ; then - CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" - fi - CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" - fi - fi - - if test "$GCC" != "yes" ; then - if test "${SHARED_BUILD}" = "0" ; then - runtime=-MT - else - runtime=-MD - fi - - if test "$do64bit" != "no" ; then - # All this magic is necessary for the Win64 SDK RC1 - hobbs - CC="\"${PATH64}/cl.exe\"" - CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" - RC="\"${MSSDK}/bin/rc.exe\"" - lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" - LINKBIN="\"${PATH64}/link.exe\"" - CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - # Avoid 'unresolved external symbol __security_cookie' - # errors, c.f. http://support.microsoft.com/?id=894573 - - vars="bufferoverflowU.lib" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - - - elif test "$doWince" != "no" ; then - CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" - if test "${TARGETCPU}" = "X86"; then - CC="\"${CEBINROOT}/cl.exe\"" - else - CC="\"${CEBINROOT}/cl${ARCH}.exe\"" - fi - CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" - RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" - arch=`echo ${ARCH} | awk '{print tolower($0)}'` - defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" - if test "${SHARED_BUILD}" = "1" ; then - # Static CE builds require static celib as well - defs="${defs} _DLL" - fi - for i in $defs ; do - -cat >>confdefs.h <<_ACEOF -#define $i 1 -_ACEOF - - done - -cat >>confdefs.h <<_ACEOF -#define _WIN32_WCE $CEVERSION -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define UNDER_CE $CEVERSION -_ACEOF - - CFLAGS_DEBUG="-nologo -Zi -Od" - CFLAGS_OPTIMIZE="-nologo -Ox" - lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` - lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" - LINKBIN="\"${CEBINROOT}/link.exe\"" - - else - RC="rc" - lflags="-nologo" - LINKBIN="link" - CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - fi - fi - - if test "$GCC" = "yes"; then - # mingw gcc mode - RC="windres" - CFLAGS_DEBUG="-g" - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - SHLIB_LD="$CC -shared" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" - LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" - else - SHLIB_LD="${LINKBIN} -dll ${lflags}" - # link -lib only works when -lib is the first arg - STLIB_LD="${LINKBIN} -lib ${lflags}" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' - PATHTYPE=-w - # For information on what debugtype is most useful, see: - # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp - # This essentially turns it all on. - LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" - LDFLAGS_OPTIMIZE="-release" - if test "$doWince" != "no" ; then - LDFLAGS_CONSOLE="-link ${lflags}" - LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} - else - LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" - LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" - fi - fi - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dll" - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' - - TCL_LIB_VERSIONS_OK=nodots - # Bogus to avoid getting this turned off - DL_OBJS="tclLoadNone.obj" - ;; - AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then - # AIX requires the _r compiler when gcc isn't being used - case "${CC}" in - *_r) - # ok ... - ;; - *) - CC=${CC}_r - ;; - esac - echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 -echo "${ECHO_T}Using $CC for compiling with threads" >&6 - fi - LIBS="$LIBS -lc" - SHLIB_CFLAGS="" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - DL_OBJS="tclLoadDl.o" - LD_LIBRARY_PATH_VAR="LIBPATH" - - # Check to enable 64-bit flags for compiler/linker on AIX 4+ - if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then - if test "$GCC" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} - else - do64bit_ok=yes - CFLAGS="$CFLAGS -q64" - LDFLAGS_ARCH="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi - - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - else - SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - fi - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' - fi - - # AIX v<=4.1 has some different flags than 4.2+ - if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then - case $LIBOBJS in - "tclLoadAix.$ac_objext" | \ - *" tclLoadAix.$ac_objext" | \ - "tclLoadAix.$ac_objext "* | \ - *" tclLoadAix.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; -esac - - DL_LIBS="-lld" - fi - - # On AIX <=v4 systems, libbsd.a has to be linked in to support - # non-blocking file IO. This library has to be linked in after - # the MATH_LIBS or it breaks the pow() function. The way to - # insure proper sequencing, is to add it to the tail of MATH_LIBS. - # This library also supplies gettimeofday. - # - # AIX does not have a timezone field in struct tm. When the AIX - # bsd library is used, the timezone global and the gettimeofday - # methods are to be avoided for timezone deduction instead, we - # deduce the timezone by comparing the localtime result on a - # known GMT value. - - echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 -echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 -if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbsd $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gettimeofday (); -int -main () -{ -gettimeofday (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_bsd_gettimeofday=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_bsd_gettimeofday=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 -if test $ac_cv_lib_bsd_gettimeofday = yes; then - libbsd=yes -else - libbsd=no -fi - - if test $libbsd = yes; then - MATH_LIBS="$MATH_LIBS -lbsd" - -cat >>confdefs.h <<\_ACEOF -#define USE_DELTA_FOR_TZ 1 -_ACEOF - - fi - ;; - BeOS*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC} -nostart" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - - #----------------------------------------------------------- - # Check for inet_ntoa in -lbind, for BeOS (which also needs - # -lsocket, even if the network functions are in -lnet which - # is always linked to, for compatibility. - #----------------------------------------------------------- - echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 -echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 -if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbind $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char inet_ntoa (); -int -main () -{ -inet_ntoa (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_bind_inet_ntoa=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_bind_inet_ntoa=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 -if test $ac_cv_lib_bind_inet_ntoa = yes; then - LIBS="$LIBS -lbind -lsocket" -fi - - ;; - BSD/OS-2.1*|BSD/OS-3*) - SHLIB_CFLAGS="" - SHLIB_LD="shlicc -r" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - BSD/OS-4.*) - SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="cc -shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - dgux*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - HP-UX-*.11.*) - # Use updated header definitions where possible - -cat >>confdefs.h <<\_ACEOF -#define _XOPEN_SOURCE_EXTENDED 1 -_ACEOF - - # Needed by Tcl, but not most extensions - #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) - #LIBS="$LIBS -lxnet" # Use the XOPEN network library - - if test "`uname -m`" = "ia64" ; then - SHLIB_SUFFIX=".so" - # Use newer C++ library for C++ extensions - #if test "$GCC" != "yes" ; then - # CPPFLAGS="-AA" - #fi - else - SHLIB_SUFFIX=".sl" - fi - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS='${LIBS}' - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - SHLIB_LD_LIBS='${LIBS}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - - # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc - #CFLAGS="$CFLAGS +DAportable" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - hpux_arch=`${CC} -dumpmachine` - case $hpux_arch in - hppa64*) - # 64-bit gcc in use. Fix flags for GNU ld. - do64bit_ok=yes - SHLIB_LD="${CC} -shared" - SHLIB_LD_LIBS='${LIBS}' - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ;; - *) - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} - ;; - esac - else - do64bit_ok=yes - CFLAGS="$CFLAGS +DD64" - LDFLAGS_ARCH="+DD64" - fi - fi - ;; - HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) - SHLIB_SUFFIX=".sl" - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - tcl_ok=yes -else - tcl_ok=no -fi - - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS="" - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - ;; - IRIX-5.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - ;; - IRIX-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mabi=n32" - LDFLAGS="$LDFLAGS -mabi=n32" - else - case $system in - IRIX-6.3) - # Use to build 6.2 compatible binaries on 6.3. - CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" - ;; - *) - CFLAGS="$CFLAGS -n32" - ;; - esac - LDFLAGS="$LDFLAGS -n32" - fi - ;; - IRIX64-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - - # Check to enable 64-bit flags for compiler/linker - - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 -echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} - else - do64bit_ok=yes - SHLIB_LD="ld -64 -shared -rdata_shared" - CFLAGS="$CFLAGS -64" - LDFLAGS_ARCH="-64" - fi - fi - ;; - Linux*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings - # when you inline the string and math operations. Turn this off to - # get rid of the warnings. - #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" - - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - if test $do64bit = yes; then - echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_m64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -m64" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_m64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_m64=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 -echo "${ECHO_T}$tcl_cv_cc_m64" >&6 - if test $tcl_cv_cc_m64 = yes; then - CFLAGS="$CFLAGS -m64" - do64bit_ok=yes - fi - fi - - # The combo of gcc + glibc has a bug related - # to inlining of functions like strtod(). The - # -fno-builtin flag should address this problem - # but it does not work. The -fno-inline flag - # is kind of overkill but it works. - # Disable inlining only when one of the - # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x ; then - CFLAGS="$CFLAGS -fno-inline" - fi - - ;; - GNU*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - SHLIB_LD="${CC} -shared" - DL_OBJS="" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - ;; - Lynx*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - CFLAGS_OPTIMIZE=-02 - SHLIB_LD="${CC} -shared " - DL_OBJS="tclLoadDl.o" - DL_LIBS="-mshared -ldl" - LD_FLAGS="-Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - ;; - MP-RAS-02*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - MP-RAS-*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,-Bexport" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - NetBSD-*|FreeBSD-[1-2].*) - # NetBSD/SPARC needs -fPIC, -fpic will not do. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - echo "$as_me:$LINENO: checking for ELF" >&5 -echo $ECHO_N "checking for ELF... $ECHO_C" >&6 -if test "${tcl_cv_ld_elf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef __ELF__ - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - tcl_cv_ld_elf=yes -else - tcl_cv_ld_elf=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 -echo "${ECHO_T}$tcl_cv_ld_elf" >&6 - if test $tcl_cv_ld_elf = yes; then - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - else - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - fi - - # Ancient FreeBSD doesn't handle version numbers with dots. - - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - OpenBSD-*) - # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. - case `machine` in - sparc|sparc64) - SHLIB_CFLAGS="-fPIC";; - *) - SHLIB_CFLAGS="-fpic";; - esac - SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - echo "$as_me:$LINENO: checking for ELF" >&5 -echo $ECHO_N "checking for ELF... $ECHO_C" >&6 -if test "${tcl_cv_ld_elf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef __ELF__ - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - tcl_cv_ld_elf=yes -else - tcl_cv_ld_elf=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 -echo "${ECHO_T}$tcl_cv_ld_elf" >&6 - if test $tcl_cv_ld_elf = yes; then - LDFLAGS=-Wl,-export-dynamic - else - LDFLAGS="" - fi - - # OpenBSD doesn't do version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - FreeBSD-*) - # FreeBSD 3.* and greater have ELF. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "${TCL_THREADS}" = "1" ; then - # The -pthread needs to go in the CFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - case $system in - FreeBSD-3.*) - # FreeBSD-3 doesn't handle version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - TCL_LIB_VERSIONS_OK=nodots - ;; - esac - ;; - Darwin-*) - CFLAGS_OPTIMIZE="-Os" - SHLIB_CFLAGS="-fno-common" - # To avoid discrepancies between what headers configure sees during - # preprocessing tests and compiling tests, move any -isysroot and - # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: - CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" - CFLAGS="`echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" - if test $do64bit = yes; then - case `arch` in - ppc) - echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_arch_ppc64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_arch_ppc64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_arch_ppc64=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 -echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 - if test $tcl_cv_cc_arch_ppc64 = yes; then - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - do64bit_ok=yes - fi;; - i386) - echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_arch_x86_64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch x86_64" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_cc_arch_x86_64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_arch_x86_64=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 -echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 - if test $tcl_cv_cc_arch_x86_64 = yes; then - CFLAGS="$CFLAGS -arch x86_64" - do64bit_ok=yes - fi;; - *) - { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 -echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; - esac - else - # Check for combined 32-bit and 64-bit fat build - echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ - echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ - fat_32_64=yes - fi - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' - echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 -echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_single_module+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_single_module=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_single_module=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 -echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 - if test $tcl_cv_ld_single_module = yes; then - SHLIB_LD="${SHLIB_LD} -Wl,-single_module" - fi - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dylib" - DL_OBJS="tclLoadDyld.o" - DL_LIBS="" - # Don't use -prebind when building for Mac OS X 10.4 or later only: - test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ - "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \ - LDFLAGS="$LDFLAGS -prebind" - LDFLAGS="$LDFLAGS -headerpad_max_install_names" - echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 -echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_search_paths_first+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_search_paths_first=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_search_paths_first=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 -echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 - if test $tcl_cv_ld_search_paths_first = yes; then - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" - - # TEA specific: for Tk extensions, remove 64-bit arch flags from - # CFLAGS et al. for combined 32 & 64 bit fat builds as neither - # TkAqua nor TkX11 can be built for 64-bit at present. - test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done - ;; - NEXTSTEP-*) - SHLIB_CFLAGS="" - SHLIB_LD="cc -nostdlib -r" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadNext.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OS/390-*) - CFLAGS_OPTIMIZE="" # Optimizer is buggy - -cat >>confdefs.h <<\_ACEOF -#define _OE_SOCKETS 1 -_ACEOF - - ;; - OSF1-1.0|OSF1-1.1|OSF1-1.2) - # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 - SHLIB_CFLAGS="" - # Hack: make package name same as library name - SHLIB_LD='ld -R -export :' - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadOSF.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-1.*) - # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - SHLIB_CFLAGS="-fPIC" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD="ld -shared" - else - SHLIB_LD="ld -non_shared" - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-V*) - # Digital OSF/1 - SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD='ld -shared -expect_unresolved "*"' - else - SHLIB_LD='ld -non_shared -expect_unresolved "*"' - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mieee" - else - CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" - fi - # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = "1" ; then - CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" - CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" - LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = "yes" ; then - LIBS="$LIBS -lpthread -lmach -lexc" - else - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - fi - - ;; - QNX-6*) - # QNX RTP - # This may work for all QNX, but it was only reported for v6. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - # dlopen is in -lc on QNX - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SCO_SV-3.2*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, - # this test works, since "uname -s" was non-standard in 3.2.4 and - # below. - if test "$GCC" = "yes" ; then - SHLIB_CFLAGS="-fPIC -melf" - LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" - else - SHLIB_CFLAGS="-Kpic -belf" - LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" - fi - SHLIB_LD="ld -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SINIX*5.4*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SunOS-4*) - SHLIB_CFLAGS="-PIC" - SHLIB_LD="ld" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - - # SunOS can't handle version numbers with dots in them in library - # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it - # requires an extra version number at the end of .so file names. - # So, the library has to have a name like libtcl75.so.1.0 - - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - SunOS-5.[0-6]) - # Careful to not let 5.10+ fall into this case - - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - - SHLIB_CFLAGS="-KPIC" - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - ;; - SunOS-5*) - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - - SHLIB_CFLAGS="-KPIC" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - arch=`isainfo` - if test "$arch" = "sparcv9 sparc" ; then - if test "$GCC" = "yes" ; then - if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} - else - do64bit_ok=yes - CFLAGS="$CFLAGS -m64 -mcpu=v9" - LDFLAGS="$LDFLAGS -m64 -mcpu=v9" - SHLIB_CFLAGS="-fPIC" - fi - else - do64bit_ok=yes - if test "$do64bitVIS" = "yes" ; then - CFLAGS="$CFLAGS -xarch=v9a" - LDFLAGS_ARCH="-xarch=v9a" - else - CFLAGS="$CFLAGS -xarch=v9" - LDFLAGS_ARCH="-xarch=v9" - fi - # Solaris 64 uses this as well - #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" - fi - elif test "$arch" = "amd64 i386" ; then - if test "$GCC" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} - else - do64bit_ok=yes - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64" - fi - else - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 -echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} - fi - fi - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = "yes" ; then - # We need to specify -static-libgcc or we need to - # add the path to the sparv9 libgcc. - # JH: static-libgcc is necessary for core Tcl, but may - # not be necessary for extensions. - SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" - # for finding sparcv9 libgcc, get the regular libgcc - # path, remove so name and append 'sparcv9' - #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." - #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" - fi - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - fi - ;; - UNIX_SV* | UnixWare-5*) - SHLIB_CFLAGS="-KPIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers - # that don't grok the -Bexport option. Test that it does. - echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 -echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_Bexport+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-Bexport" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_ld_Bexport=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_Bexport=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$hold_ldflags -fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 -echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 - if test $tcl_cv_ld_Bexport = yes; then - LDFLAGS="$LDFLAGS -Wl,-Bexport" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - esac - - if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then - { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 -echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} - fi - - - - # Step 4: disable dynamic loading if requested via a command-line switch. - - # Check whether --enable-load or --disable-load was given. -if test "${enable_load+set}" = set; then - enableval="$enable_load" - tcl_ok=$enableval -else - tcl_ok=yes -fi; - if test "$tcl_ok" = "no"; then - DL_OBJS="" - fi - - if test "x$DL_OBJS" != "x" ; then - BUILD_DLTEST="\$(DLTEST_TARGETS)" - else - echo "Can't figure out how to do dynamic loading or shared libraries" - echo "on this system." - SHLIB_CFLAGS="" - SHLIB_LD="" - SHLIB_SUFFIX="" - DL_OBJS="tclLoadNone.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS_ORIG" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - BUILD_DLTEST="" - fi - LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" - - # If we're running gcc, then change the C flags for compiling shared - # libraries to the right flags for gcc, instead of those for the - # standard manufacturer compiler. - - if test "$DL_OBJS" != "tclLoadNone.o" ; then - if test "$GCC" = "yes" ; then - case $system in - AIX-*) - ;; - BSD/OS*) - ;; - IRIX*) - ;; - NetBSD-*|FreeBSD-*) - ;; - Darwin-*) - ;; - SCO_SV-3.2*) - ;; - windows) - ;; - *) - SHLIB_CFLAGS="-fPIC" - ;; - esac - fi - fi - - if test "$SHARED_LIB_SUFFIX" = "" ; then - SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' - fi - if test "$UNSHARED_LIB_SUFFIX" = "" ; then - UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' - fi - - - - - - - - - - - - - - - - # These must be called after we do the basic CFLAGS checks and - # verify any possible 64-bit or similar switches are necessary - - echo "$as_me:$LINENO: checking for required early compiler flags" >&5 -echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 - tcl_flags="" - - if test "${tcl_cv_flag__isoc99_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *)strtoll; char *q = (char *)strtoull; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__isoc99_source=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _ISOC99_SOURCE 1 -#include -int -main () -{ -char *p = (char *)strtoll; char *q = (char *)strtoull; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__isoc99_source=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__isoc99_source=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define _ISOC99_SOURCE 1 -_ACEOF - - tcl_flags="$tcl_flags _ISOC99_SOURCE" - fi - - - if test "${tcl_cv_flag__largefile64_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -struct stat64 buf; int i = stat64("/", &buf); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile64_source=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGEFILE64_SOURCE 1 -#include -int -main () -{ -struct stat64 buf; int i = stat64("/", &buf); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile64_source=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__largefile64_source=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define _LARGEFILE64_SOURCE 1 -_ACEOF - - tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" - fi - - - if test "${tcl_cv_flag__largefile_source64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *)open64; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile_source64=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGEFILE_SOURCE64 1 -#include -int -main () -{ -char *p = (char *)open64; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_flag__largefile_source64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__largefile_source64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define _LARGEFILE_SOURCE64 1 -_ACEOF - - tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" - fi - - if test "x${tcl_flags}" = "x" ; then - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 - else - echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 -echo "${ECHO_T}${tcl_flags}" >&6 - fi - - - echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 -echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 - if test "${tcl_cv_type_64bit+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - tcl_cv_type_64bit=none - # See if the compiler knows natively about __int64 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -__int64 value = (__int64) 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_type_64bit=__int64 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_type_64bit="long long" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - # See if we should use long anyway Note that we substitute in the - # type that is our current guess for a 64-bit type inside this check - # program, so it should be modified only carefully... - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -switch (0) { - case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; - } - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_type_64bit=${tcl_type_64bit} -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "${tcl_cv_type_64bit}" = none ; then - -cat >>confdefs.h <<\_ACEOF -#define TCL_WIDE_INT_IS_LONG 1 -_ACEOF - - echo "$as_me:$LINENO: result: using long" >&5 -echo "${ECHO_T}using long" >&6 - elif test "${tcl_cv_type_64bit}" = "__int64" \ - -a "${TEA_PLATFORM}" = "windows" ; then - # We actually want to use the default tcl.h checks in this - # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* - echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 -echo "${ECHO_T}using Tcl header defaults" >&6 - else - -cat >>confdefs.h <<_ACEOF -#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} -_ACEOF - - echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 -echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 - - # Now check for auxiliary declarations - echo "$as_me:$LINENO: checking for struct dirent64" >&5 -echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 -if test "${tcl_cv_struct_dirent64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ -struct dirent64 p; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_struct_dirent64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_struct_dirent64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 -echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 - if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_DIRENT64 1 -_ACEOF - - fi - - echo "$as_me:$LINENO: checking for struct stat64" >&5 -echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 -if test "${tcl_cv_struct_stat64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -struct stat64 p; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_struct_stat64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_struct_stat64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 -echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 - if test "x${tcl_cv_struct_stat64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_STAT64 1 -_ACEOF - - fi - - - -for ac_func in open64 lseek64 -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - echo "$as_me:$LINENO: checking for off64_t" >&5 -echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 - if test "${tcl_cv_type_off64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -off64_t offset; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - tcl_cv_type_off64_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_type_off64_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_type_off64_t}" = "xyes" && \ - test "x${ac_cv_func_lseek64}" = "xyes" && \ - test "x${ac_cv_func_open64}" = "xyes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_TYPE_OFF64_T 1 -_ACEOF - - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - fi - - - -#-------------------------------------------------------------------- -# Set the default compiler switches based on the --enable-symbols option. -#-------------------------------------------------------------------- - - - - echo "$as_me:$LINENO: checking for build with symbols" >&5 -echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 - # Check whether --enable-symbols or --disable-symbols was given. -if test "${enable_symbols+set}" = set; then - enableval="$enable_symbols" - tcl_ok=$enableval -else - tcl_ok=no -fi; - DBGX="" - if test "$tcl_ok" = "no"; then - CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" - LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - else - CFLAGS_DEFAULT="${CFLAGS_DEBUG}" - LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" - if test "$tcl_ok" = "yes"; then - echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 -echo "${ECHO_T}yes (standard debugging)" >&6 - fi - fi - if test "${TEA_PLATFORM}" != "windows" ; then - LDFLAGS_DEFAULT="${LDFLAGS}" - fi - - - - - - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - -cat >>confdefs.h <<\_ACEOF -#define TCL_MEM_DEBUG 1 -_ACEOF - - fi - - if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then - if test "$tcl_ok" = "all"; then - echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 -echo "${ECHO_T}enabled symbols mem debugging" >&6 - else - echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 -echo "${ECHO_T}enabled $tcl_ok debugging" >&6 - fi - 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. Add Tk too if necessary. -#-------------------------------------------------------------------- - -cat >>confdefs.h <<\_ACEOF -#define USE_TCL_STUBS 1 -_ACEOF - -#AC_DEFINE(USE_TK_STUBS) - -#-------------------------------------------------------------------- -# 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. -#-------------------------------------------------------------------- - - - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then - MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" - MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" - else - MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" - MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" - fi - - if test "${SHARED_BUILD}" = "1" ; then - MAKE_LIB="${MAKE_SHARED_LIB} " - else - MAKE_LIB="${MAKE_STATIC_LIB} " - fi - - #-------------------------------------------------------------------- - # Shared libraries and static libraries have different names. - # Use the double eval to make sure any variables in the suffix is - # substituted. (@@@ Might not be necessary anymore) - #-------------------------------------------------------------------- - - if test "${TEA_PLATFORM}" = "windows" ; then - if test "${SHARED_BUILD}" = "1" ; then - # We force the unresolved linking of symbols that are really in - # the private libraries of Tcl and Tk. - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" - fi - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - else - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - if test "$GCC" = "yes"; then - PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} - fi - # These aren't needed on Windows (either MSVC or gcc) - RANLIB=: - RANLIB_STUB=: - else - RANLIB_STUB="${RANLIB}" - if test "${SHARED_BUILD}" = "1" ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" - fi - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - fi - - # These are escaped so that only CFLAGS is picked up at configure time. - # The other values will be substituted at make time. - CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" - if test "${SHARED_BUILD}" = "1" ; then - CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" - fi - - - - - - - - -#-------------------------------------------------------------------- -# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl -# file during the install process. Don't run the TCLSH_PROG through -# ${CYGPATH} because it's being used directly by make. -# Require that we use a tclsh shell version 8.2 or later since earlier -# versions have bugs in the pkg_mkIndex routine. -# Add WISH as well if this is a Tk extension. -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking for tclsh" >&5 -echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 - if test -f "${TCL_BIN_DIR}/Makefile" ; then - # tclConfig.sh is in Tcl build directory - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="${TCL_BIN_DIR}/tclsh" - fi - else - # tclConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" - fi - list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${TCLSH_PROG}" ; then - REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" - fi - echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 -echo "${ECHO_T}${TCLSH_PROG}" >&6 - - -#TEA_PROG_WISH - -#-------------------------------------------------------------------- -# Finally, substitute all of the various values into the Makefile. -# You may alternatively have a special pkgIndex.tcl.in or other files -# which require substituting th AC variables in. Include these here. -#-------------------------------------------------------------------- - - ac_config_files="$ac_config_files Makefile" -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g -t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g -t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by xotclexpat $as_me 0.9, which was -generated by GNU Autoconf 2.59. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to ." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -xotclexpat config.status 0.9 -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2003 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - - - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CYGPATH@,$CYGPATH,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t -s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t -s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t -s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t -s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t -s,@PKG_HEADERS@,$PKG_HEADERS,;t t -s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t -s,@PKG_LIBS@,$PKG_LIBS,;t t -s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t -s,@TCL_VERSION@,$TCL_VERSION,;t t -s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t -s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t -s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t -s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t -s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t -s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t -s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t -s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t -s,@TCL_LIBS@,$TCL_LIBS,;t t -s,@TCL_DEFS@,$TCL_DEFS,;t t -s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t -s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t -s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@EGREP@,$EGREP,;t t -s,@MATH_LIBS@,$MATH_LIBS,;t t -s,@PKG_SOURCES@,$PKG_SOURCES,;t t -s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t -s,@CLEANFILES@,$CLEANFILES,;t t -s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t -s,@TCL_THREADS@,$TCL_THREADS,;t t -s,@SHARED_BUILD@,$SHARED_BUILD,;t t -s,@AR@,$AR,;t t -s,@CELIB_DIR@,$CELIB_DIR,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@DL_LIBS@,$DL_LIBS,;t t -s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t -s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t -s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t -s,@STLIB_LD@,$STLIB_LD,;t t -s,@SHLIB_LD@,$SHLIB_LD,;t t -s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t -s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t -s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t -s,@TCL_DBGX@,$TCL_DBGX,;t t -s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t -s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t -s,@MAKE_LIB@,$MAKE_LIB,;t t -s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t -s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t -s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t -s,@RANLIB_STUB@,$RANLIB_STUB,;t t -s,@TCLSH_PROG@,$TCLSH_PROG,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: xotcl/library/xml/TclExpat-1.1/configure.in =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/configure.in (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/library/xml/TclExpat-1.1/configure.in (revision 0) @@ -1,249 +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. -# -# RCS: @(#) $Id: configure.in,v 1.20 2007/10/12 19:53:32 neumann Exp $ - -#----------------------------------------------------------------------- -# Sample configure.in for Tcl Extensions. The only places you should -# need to modify this file are marked by the string __CHANGE__ -#----------------------------------------------------------------------- - -configdir=$(srcdir)/../../../config - -#----------------------------------------------------------------------- -# __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. -#----------------------------------------------------------------------- - -AC_INIT([xotclexpat], [0.9]) - -#-------------------------------------------------------------------- -# 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([3.5]) - -AC_CONFIG_AUX_DIR(../../../config) - -#-------------------------------------------------------------------- -# specify some extra flags -#-------------------------------------------------------------------- - -AC_ARG_WITH(xotcl, - [ --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH - absolute path to xotclConfig.sh, - --without-xotcl disables, but this is pointless], - [with_xotcl=$withval], [AC_MSG_ERROR([--with-xotcl is required])]) - -#-------------------------------------------------------------------- -# 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 - -#----------------------------------------------------------------------- -# 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, AC_PROG_INSTALL and a few others to create -# the basic setup necessary to compile executables. -#----------------------------------------------------------------------- - -TEA_SETUP_COMPILER - -#-------------------------------------------------------------------- -# Load the xotclConfig.sh file -#-------------------------------------------------------------------- - -AC_MSG_NOTICE([Reading file ${with_xotcl}/xotclConfig.sh]) -source ${with_xotcl}/xotclConfig.sh - -#----------------------------------------------------------------------- -# __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. -#----------------------------------------------------------------------- - -if test "${TEA_PLATFORM}" = "windows" ; then - TEA_ADD_SOURCES([xmltok.c win32filemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c]) -else - TEA_ADD_SOURCES([xmltok.c unixfilemap.c xmlrole.c xmlwf.c codepage.c xmlparse.c hashtable.c tclexpat.c]) -fi - -TEA_ADD_HEADERS([]) -TEA_ADD_INCLUDES([-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC}]) -TEA_ADD_LIBS([$XOTCL_BUILD_STUB_LIB_SPEC]) -TEA_ADD_CFLAGS([]) -TEA_ADD_STUB_SOURCES([]) -TEA_ADD_TCL_SOURCES([]) - -#-------------------------------------------------------------------- -# __CHANGE__ -# A few miscellaneous platform-specific items: -# -# Define a special symbol for Windows (BUILD_sample in this case) so -# that we create the export library with the dll. -# -# 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. -# -# TEA_ADD_* any platform specific compiler/build info here. -#-------------------------------------------------------------------- - -if test "${TEA_PLATFORM}" = "windows" ; then - AC_DEFINE(BUILD_sample) - CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" - #TEA_ADD_SOURCES([win/winFile.c]) - #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) -else - CLEANFILES="pkgIndex.tcl" - #TEA_ADD_SOURCES([unix/unixFile.c]) - #TEA_ADD_LIBS([-lsuperfly]) -fi -AC_SUBST(CLEANFILES) - -#-------------------------------------------------------------------- -# __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 - -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -#-------------------------------------------------------------------- - -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 - -#-------------------------------------------------------------------- -# 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. Add Tk too if necessary. -#-------------------------------------------------------------------- - -AC_DEFINE(USE_TCL_STUBS) -#AC_DEFINE(USE_TK_STUBS) - -#-------------------------------------------------------------------- -# 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 - -#-------------------------------------------------------------------- -# 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. -# Add WISH as well if this is a Tk extension. -#-------------------------------------------------------------------- - -TEA_PROG_TCLSH -#TEA_PROG_WISH - -#-------------------------------------------------------------------- -# Finally, substitute all of the various values into the Makefile. -# You may alternatively have a special pkgIndex.tcl.in or other files -# which require substituting th AC variables in. Include these here. -#-------------------------------------------------------------------- - -AC_OUTPUT([Makefile]) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: xotcl/library/xml/TclExpat-1.1/configure.in-ok =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/configure.in-ok (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/configure.in-ok (revision 0) @@ -1,312 +0,0 @@ -#-------------------------------------------------------------------- -# 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(./tclexpat.c) -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=xotclexpat - -# do not modify the following lines manually, they are generated with changeXOTclVersion -XOTCL_MAJOR_VERSION=1 -XOTCL_MINOR_VERSION=2 -XOTCL_RELEASE_LEVEL=.1 - -MAJOR_VERSION=${XOTCL_MAJOR_VERSION} -MINOR_VERSION=${XOTCL_MINOR_VERSION} -PATCHLEVEL=${XOTCL_RELEASE_LEVEL} - -VERSION=${MAJOR_VERSION}.${MINOR_VERSION} -NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION} - -AC_SUBST(PATCHLEVEL) -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" - ;; - *) - CYGPATH=echo - ;; -esac - -AC_SUBST(CYGPATH) - -#-------------------------------------------------------------------- -# __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 before SC_PATH_TCLCONFIG/SC_LOAD_TCLCONFIG -#-------------------------------------------------------------------- - -#SC_PUBLIC_TCL_HEADERS -SC_PRIVATE_TCL_HEADERS - -if test x"${with_tclinclude}" != x ; then - if test -f "${with_tclinclude}/tcl.h" ; then - TCL_INCLUDES="-I${with_tclinclude} ${TCL_INCLUDES}" - else - AC_MSG_ERROR([${with_tclinclude} directory does not contain Tcl header file tcl.h]) - fi -fi - -#-------------------------------------------------------------------- -# Load the tclConfig.sh file -#-------------------------------------------------------------------- - -SC_PATH_TCLCONFIG -SC_LOAD_TCLCONFIG - -#-------------------------------------------------------------------- -# Load the xotclConfig.sh file -#-------------------------------------------------------------------- - -SC_PATH_XOTCLCONFIG -SC_LOAD_XOTCLCONFIG - -#-------------------------------------------------------------------- -# __CHANGE__ -# A few miscellaneous platform-specific items: -# -# Define a special symbol for Windows (BUILD_exampleA 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(BUILD_xotclexpat) - CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch vc60.pch" - AC_SUBST(CLEANFILES) - ;; - *) - CLEANFILES= - ;; -esac - -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -# So far only Tcl responds to this one. -#-------------------------------------------------------------------- - -SC_ENABLE_THREADS - -#-------------------------------------------------------------------- -# The statement below defines a collection of symbols related to -# building as a shared library instead of a static library. -#-------------------------------------------------------------------- - -SC_ENABLE_SHARED - -#-------------------------------------------------------------------- -# This macro figures out what flags to use with the compiler/linker -# when building shared/static debug/optimized objects. This information -# is all taken from the tclConfig.sh file. -#-------------------------------------------------------------------- - -CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG} -CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE} -LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG} -LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE} -SHLIB_LD=${TCL_SHLIB_LD} -STLIB_LD=${TCL_STLIB_LD} -SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS} - -AC_SUBST(CFLAGS_DEBUG) -AC_SUBST(CFLAGS_OPTIMIZE) -AC_SUBST(STLIB_LD) -AC_SUBST(SHLIB_LD) -AC_SUBST(SHLIB_CFLAGS) -AC_SUBST(SHLIB_LDFLAGS) - -#-------------------------------------------------------------------- -# Set the default compiler switches based on the --enable-symbols -# option. -#-------------------------------------------------------------------- - -SC_ENABLE_SYMBOLS - -if test "${SHARED_BUILD}" = "1" ; then - CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' -else - CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}' -fi - -#-------------------------------------------------------------------- -# Everyone should be linking against the Tcl stub library. If you -# can't for some reason, remove this definition. If you aren't using -# stubs, you also need to modify the SHLIB_LD_LIBS setting below to -# link against the non-stubbed Tcl library. -#-------------------------------------------------------------------- - -if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then - echo "Tcl 8.0, no stubs used" - USE_TCL_STUBS="" -else - AC_DEFINE(USE_TCL_STUBS) - AC_DEFINE(USE_XOTCL_STUBS) -fi - -#-------------------------------------------------------------------- -# This macro generates a line to use when building a library. It -# depends on values set by the SC_ENABLE_SHARED, SC_ENABLE_SYMBOLS, -# and SC_LOAD_TCLCONFIG macros above. -#-------------------------------------------------------------------- - -SC_MAKE_LIB - -#-------------------------------------------------------------------- -# eval these two values to dereference the ${DBGX} variable. -#-------------------------------------------------------------------- - -#eval "SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" -#eval "UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" - -SHARED_LIB_SUFFIX=${XOTCL_SHARED_LIB_SUFFIX} -UNSHARED_LIB_SUFFIX=${XOTCL_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}`\" \"`cygpath -w ${XOTCL_BUILD_STUB_LIB_PATH}`\" ${TCL_SHLIB_LD_LIBS}" - eval "${PACKAGE}_LIB_FILE=${PACKAGE}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval "${PACKAGE}_LIB_FILE=${PACKAGE}${UNSHARED_LIB_SUFFIX}" - fi - ;; - *) - if test "${SHARED_BUILD}" = "1" ; then - #SHLIB_LD_LIBS="${TCL_BUILD_STUB_LIB_SPEC} ${XOTCL_BUILD_STUB_LIB_SPEC}" - SHLIB_LD_LIBS="${TCL_STUB_LIB_SPEC} ${XOTCL_BUILD_STUB_LIB_SPEC}" - eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${UNSHARED_LIB_SUFFIX}" - fi - ;; -esac - -#-------------------------------------------------------------------- -# __CHANGE__ -# Change the name from exampeA_LIB_FILE to match your package name. -#-------------------------------------------------------------------- - -AC_SUBST(xotclexpat_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) - - - - - - - - - - Index: xotcl/library/xml/TclExpat-1.1/dllEntryPoint.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/dllEntryPoint.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/dllEntryPoint.c (revision 0) @@ -1,39 +0,0 @@ -/* - * dllEntryPoint.c -- - * $Id: dllEntryPoint.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ - * - * This file implements the Dll entry point as needed by Windows. - */ - -#define WIN32_LEAN_AND_MEAN -#include -#if defined(_MSC_VER) -# define DllEntryPoint DllMain -#endif - -/* - *---------------------------------------------------------------------- - * - * DllEntryPoint -- - * - * This wrapper function is used by Windows to invoke the - * initialization code for the DLL. If we are compiling - * with Visual C++, this routine will be renamed to DllMain. - * - * Results: - * Returns TRUE; - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -BOOL APIENTRY -DllEntryPoint(hInst, reason, reserved) - HINSTANCE hInst; /* Library instance handle. */ - DWORD reason; /* Reason this function is being called. */ - LPVOID reserved; /* Not used. */ -{ - return TRUE; -} Index: xotcl/library/xml/TclExpat-1.1/dllmain.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/dllmain.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/dllmain.c (revision 0) @@ -1,27 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#include - -BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) -{ - return TRUE; -} - Index: xotcl/library/xml/TclExpat-1.1/filemap.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/filemap.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/filemap.h (revision 0) @@ -1,32 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - - -#include - -#ifdef XML_UNICODE -int filemap(const wchar_t *name, - void (*processor)(const void *, size_t, const wchar_t *, void *arg), - void *arg); -#else -int filemap(const char *name, - void (*processor)(const void *, size_t, const char *, void *arg), - void *arg); -#endif Index: xotcl/library/xml/TclExpat-1.1/hashtable.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/hashtable.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/hashtable.c (revision 0) @@ -1,134 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -csompliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#include -#include - -#include "xmldef.h" -#include "hashtable.h" - -#ifdef XML_UNICODE -#define keycmp wcscmp -#else -#define keycmp strcmp -#endif - -#define INIT_SIZE 64 - -static -unsigned long hash(KEY s) -{ - unsigned long h = 0; - while (*s) - h = (h << 5) + h + (unsigned char)*s++; - return h; -} - -NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize) -{ - size_t i; - if (table->size == 0) { - if (!createSize) - return 0; - table->v = calloc(INIT_SIZE, sizeof(NAMED *)); - if (!table->v) - return 0; - table->size = INIT_SIZE; - table->usedLim = INIT_SIZE / 2; - i = hash(name) & (table->size - 1); - } - else { - unsigned long h = hash(name); - for (i = h & (table->size - 1); - table->v[i]; - i == 0 ? i = table->size - 1 : --i) { - if (keycmp(name, table->v[i]->name) == 0) - return table->v[i]; - } - if (!createSize) - return 0; - if (table->used == table->usedLim) { - /* check for overflow */ - size_t newSize = table->size * 2; - NAMED **newV = calloc(newSize, sizeof(NAMED *)); - if (!newV) - return 0; - for (i = 0; i < table->size; i++) - if (table->v[i]) { - size_t j; - for (j = hash(table->v[i]->name) & (newSize - 1); - newV[j]; - j == 0 ? j = newSize - 1 : --j) - ; - newV[j] = table->v[i]; - } - free(table->v); - table->v = newV; - table->size = newSize; - table->usedLim = newSize/2; - for (i = h & (table->size - 1); - table->v[i]; - i == 0 ? i = table->size - 1 : --i) - ; - } - } - table->v[i] = calloc(1, createSize); - if (!table->v[i]) - return 0; - table->v[i]->name = name; - (table->used)++; - return table->v[i]; -} - -void hashTableDestroy(HASH_TABLE *table) -{ - size_t i; - for (i = 0; i < table->size; i++) { - NAMED *p = table->v[i]; - if (p) - free(p); - } - free(table->v); -} - -void hashTableInit(HASH_TABLE *p) -{ - p->size = 0; - p->usedLim = 0; - p->used = 0; - p->v = 0; -} - -void hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table) -{ - iter->p = table->v; - iter->end = iter->p + table->size; -} - -NAMED *hashTableIterNext(HASH_TABLE_ITER *iter) -{ - while (iter->p != iter->end) { - NAMED *tem = *(iter->p)++; - if (tem) - return tem; - } - return 0; -} - Index: xotcl/library/xml/TclExpat-1.1/hashtable.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/hashtable.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/hashtable.h (revision 0) @@ -1,51 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - - -#include - -#ifdef XML_UNICODE -typedef const wchar_t *KEY; -#else -typedef const char *KEY; -#endif - -typedef struct { - KEY name; -} NAMED; - -typedef struct { - NAMED **v; - size_t size; - size_t used; - size_t usedLim; -} HASH_TABLE; - -NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize); -void hashTableInit(HASH_TABLE *); -void hashTableDestroy(HASH_TABLE *); - -typedef struct { - NAMED **p; - NAMED **end; -} HASH_TABLE_ITER; - -void hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *); -NAMED *hashTableIterNext(HASH_TABLE_ITER *); Index: xotcl/library/xml/TclExpat-1.1/iasciitab.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/iasciitab.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/iasciitab.h (revision 0) @@ -1,53 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ -/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, -/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, -/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, -/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, -/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, -/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, -/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_NMSTRT, BT_SEMI, -/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, -/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, -/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, -/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, Index: xotcl/library/xml/TclExpat-1.1/latin1tab.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/latin1tab.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/latin1tab.h (revision 0) @@ -1,52 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, -/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, -/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, -/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, Index: xotcl/library/xml/TclExpat-1.1/nametab.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/nametab.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/nametab.h (revision 0) @@ -1,150 +0,0 @@ -static const unsigned namingBitmap[] = { -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE, -0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF, -0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF, -0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, -0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, -0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, -0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, -0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, -0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF, -0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000, -0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060, -0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003, -0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003, -0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000, -0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001, -0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003, -0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000, -0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003, -0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003, -0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000, -0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000, -0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF, -0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB, -0x40000000, 0xF580C900, 0x00000007, 0x02010800, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF, -0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF, -0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, -0x00000000, 0x00004C40, 0x00000000, 0x00000000, -0x00000007, 0x00000000, 0x00000000, 0x00000000, -0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF, -0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF, -0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000, -0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE, -0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF, -0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, -0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003, -0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, -0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, -0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, -0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, -0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF, -0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF, -0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF, -0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF, -0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF, -0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0, -0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1, -0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3, -0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80, -0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3, -0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3, -0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000, -0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000, -0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF, -0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x1FFF0000, 0x00000002, -0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF, -0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF, -}; -static const unsigned char nmstrtPages[] = { -0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, -0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, -0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, -0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const unsigned char namePages[] = { -0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00, -0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, -0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, -0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; Index: xotcl/library/xml/TclExpat-1.1/readfilemap.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/readfilemap.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/readfilemap.c (revision 0) @@ -1,89 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#include -#include -#include -#include -#include - -#ifndef S_ISREG -#ifndef S_IFREG -#define S_IFREG _S_IFREG -#endif -#ifndef S_IFMT -#define S_IFMT _S_IFMT -#endif -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif /* not S_ISREG */ - -#ifndef O_BINARY -#ifdef _O_BINARY -#define O_BINARY _O_BINARY -#else -#define O_BINARY 0 -#endif -#endif - -int filemap(const char *name, - void (*processor)(const void *, size_t, const char *, void *arg), - void *arg) -{ - size_t nbytes; - int fd; - int n; - struct stat sb; - void *p; - - fd = open(name, O_RDONLY|O_BINARY); - if (fd < 0) { - perror(name); - return 0; - } - if (fstat(fd, &sb) < 0) { - perror(name); - return 0; - } - if (!S_ISREG(sb.st_mode)) { - fprintf(stderr, "%s: not a regular file\n", name); - return 0; - } - nbytes = sb.st_size; - p = malloc(nbytes); - if (!p) { - fprintf(stderr, "%s: out of memory\n", name); - return 0; - } - n = read(fd, p, nbytes); - if (n < 0) { - perror(name); - close(fd); - return 0; - } - if (n != nbytes) { - fprintf(stderr, "%s: read unexpected number of bytes\n", name); - close(fd); - return 0; - } - processor(p, nbytes, name, arg); - free(p); - close(fd); - return 1; -} Index: xotcl/library/xml/TclExpat-1.1/readme =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/readme (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/readme (revision 0) @@ -1,174 +0,0 @@ - A Tcl interface to expat. - - Steve Ball, Zveno Pty Ltd. - -This package provides a Tcl interface to James Clark's expat library. -It creates a Tcl package, called "expat", which defines a single -new Tcl command "expat". - -See for more information -on XML support for Tcl. - -INSTALLATION -============ - -Unix/Linux ----------- - -You must have Tcl/Tk version 8.0p2 or 8.1a2 installed on your system. -TclExpat has been setup to use Tcl's configuration to make compilation -easy. Simply point TclExpat's Makefile at the Tcl configuration file: - - /bin/sh '. /usr/local/tcl/lib/tclConfig.sh ; make -e' - -where "/usr/local/tcl" is the installation path for Tcl. - -To install the package in the first available directory in the Tcl package -path use the command below. You may need to be root to do this. - - /bin/sh '. /usr/local/tcl/lib/tclConfig.sh ; make -e install' - -Macintosh ---------- - -The source must be compiled against the Tcl/Tk version 8.0p2 release. -A pre-compiled shareware distribution is available from Zveno, see below. - -Windows -------- - -The source must be compiled against the Tcl/Tk version 8.0p2 release. -A pre-compiled shareware distribution is available from Zveno, see below. - -SHAREWARE -========= - -Binary distributions for the Macintosh and Windows platforms are available -from Zveno. See - -USAGE -===== - -The package is loaded using: - - package require expat 1.0 - -This package defines the "expat" command which is used to create a -parser. It accepts the following arguments: - - expat parserName ?option value...? - -If no "parserName" argument is given then a unique name is chosen. -The name of the newly created parser is returned and a new Tcl command -of the same name is created to manipulate the parser. - -The parser command accepts the following methods: - - $parser cget -option - Returns the current value of an option. - - $parser configure -option value ?-option value...? - Sets configuration options. - - $parser parse xml - Parses the XML data given by "xml". This will - cause Tcl callback scripts to be invoked, if they - have been configured. - - If the document is not well-formed then the command - returns an error. - - $parser reset - Resets the parser. Call this method before parsing - a new document. - -The following options are accepted: - - -elementstartcommand command - Defines a callback script which is invoked - when the start of an element is found in the - document. The following arguments are appended - to the string before it is evaluated: - - command name attributelist - - "name" is the name of the element. - "attributelist" is the attribute list for the element. - - -elementendcommand command - Defines a callback script which is invoked - whenever an element is closed in the document. - The following arguments are appended to the string - before it is evaluated: - - command name - - "name" is the name of the element. - - -characterdatacommand command - Defines a callback script which is invoked whenever - character data is encountered in the document. - The following arguments are appended to the string - before it is evaluated: - - command data - - "data" is the character data found in the document. - - -processinginstructioncommand command - Defines a callback script which is invoked whenever - a processing instruction is encountered in the document. - The following arguments are appended to the string - before it is evaluated: - - command target data - - "target" is the target of the PI. - "data" is additional data found in the PI. - - -externalentitycommand command - Defines a callback script which is invoked whenever - an externally parsed general entity is encountered - in the document. The following arguments are appended - to the string before it is evaluated: - - command names base systemid publicid - - "names" is a list of the open entity names. - "base" is a URL to be used for resolving relative URLs. - "systemid" is the system identifier specified in the entity declaration - "publicid" is the public identifier specified in the entity declaration - - -defaultcommand command - Invoked when no other callback has been defined for a - document feature which has been encountered. - - -unparsedentitydeclcommand command - Invoked when an unparsed entity declaration is encountered. - - -notationdeclcommand command - Invoked when a notation declaration is encountered. - - -unknownencodingcommand command - Invoked when a character is encountered which has an - unknown encoding. - - -baseurl URL - Specifies a base URL to use for resolving relative URLs. - - -final boolean - Specifies whether more data is to be parsed. - -Callback scripts - -Tcl callback scripts may use the "break", "continue" and "error" commands -to alter the flow of control. - - break - Suppresses invocation of further callback scripts. - continue - Suppresses invocation of further callback scripts - until the current element has finished. - error - Suppresses invocation of further callback scripts. - The parser also returns an error condition. \ No newline at end of file Index: xotcl/library/xml/TclExpat-1.1/tcl.m4 =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/tcl.m4 (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/library/xml/TclExpat-1.1/tcl.m4 (revision 0) @@ -1,4041 +0,0 @@ -# tcl.m4 -- -# -# This file provides a set of autoconf macros to help TEA-enable -# a Tcl extension. -# -# Copyright (c) 1999-2000 Ajuba Solutions. -# 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: tcl.m4,v 1.2 2007/10/12 19:53:32 neumann Exp $ - -AC_PREREQ(2.57) - -dnl TEA extensions pass us the version of TEA they think they -dnl are compatible with (must be set in TEA_INIT below) -dnl TEA_VERSION="3.6" - -# Possible values for key variables defined: -# -# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') -# TEA_PLATFORM - windows unix -# - -#------------------------------------------------------------------------ -# TEA_PATH_TCLCONFIG -- -# -# Locate the tclConfig.sh file and perform a sanity check on -# the Tcl compile flags -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-tcl=... -# -# Defines the following vars: -# TCL_BIN_DIR Full path to the directory containing -# the tclConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_TCLCONFIG], [ - dnl Make sure we are initialized - AC_REQUIRE([TEA_INIT]) - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - - if test x"${no_tcl}" = x ; then - # we reset no_tcl in case something fails here - no_tcl=true - AC_ARG_WITH(tcl, - AC_HELP_STRING([--with-tcl], - [directory containing tcl configuration (tclConfig.sh)]), - with_tclconfig=${withval}) - AC_MSG_CHECKING([for Tcl configuration]) - AC_CACHE_VAL(ac_cv_c_tclconfig,[ - - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - case ${with_tclconfig} in - */tclConfig.sh ) - if test -f ${with_tclconfig}; then - AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) - with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tcl.framework/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_tclconfig}" = x ; then - TCL_BIN_DIR="# no Tcl configs found" - AC_MSG_WARN([Can't find Tcl configuration definitions]) - exit 0 - else - no_tcl= - TCL_BIN_DIR=${ac_cv_c_tclconfig} - AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_PATH_TKCONFIG -- -# -# Locate the tkConfig.sh file -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-tk=... -# -# Defines the following vars: -# TK_BIN_DIR Full path to the directory containing -# the tkConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_TKCONFIG], [ - # - # Ok, lets find the tk configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tk - # - - if test x"${no_tk}" = x ; then - # we reset no_tk in case something fails here - no_tk=true - AC_ARG_WITH(tk, - AC_HELP_STRING([--with-tk], - [directory containing tk configuration (tkConfig.sh)]), - with_tkconfig=${withval}) - AC_MSG_CHECKING([for Tk configuration]) - AC_CACHE_VAL(ac_cv_c_tkconfig,[ - - # First check to see if --with-tkconfig was specified. - if test x"${with_tkconfig}" != x ; then - case ${with_tkconfig} in - */tkConfig.sh ) - if test -f ${with_tkconfig}; then - AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) - with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tkconfig}/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` - else - AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) - fi - fi - - # then check for a private Tk library - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in \ - ../tk \ - `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../tk \ - `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../../tk \ - `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tk.framework/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in \ - ${srcdir}/../tk \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_tkconfig}" = x ; then - TK_BIN_DIR="# no Tk configs found" - AC_MSG_WARN([Can't find Tk configuration definitions]) - exit 0 - else - no_tk= - TK_BIN_DIR=${ac_cv_c_tkconfig} - AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_TCLCONFIG -- -# -# Load the tclConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# TCL_BIN_DIR -# -# Results: -# -# Subst the following vars: -# TCL_BIN_DIR -# TCL_SRC_DIR -# TCL_LIB_FILE -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_TCLCONFIG], [ - AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) - - if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - AC_MSG_RESULT([loading]) - . "${TCL_BIN_DIR}/tclConfig.sh" - else - AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tcl.framework installed in an arbitary location. - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then - for i in "`cd ${TCL_BIN_DIR}; pwd`" \ - "`cd ${TCL_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then - TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" - break - fi - done - fi - if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then - TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" - TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - AC_SUBST(TCL_VERSION) - AC_SUBST(TCL_BIN_DIR) - AC_SUBST(TCL_SRC_DIR) - - AC_SUBST(TCL_LIB_FILE) - AC_SUBST(TCL_LIB_FLAG) - AC_SUBST(TCL_LIB_SPEC) - - AC_SUBST(TCL_STUB_LIB_FILE) - AC_SUBST(TCL_STUB_LIB_FLAG) - AC_SUBST(TCL_STUB_LIB_SPEC) - - AC_SUBST(TCL_LIBS) - AC_SUBST(TCL_DEFS) - AC_SUBST(TCL_EXTRA_CFLAGS) - AC_SUBST(TCL_LD_FLAGS) - AC_SUBST(TCL_SHLIB_LD_LIBS) -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_TKCONFIG -- -# -# Load the tkConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# TK_BIN_DIR -# -# Results: -# -# Sets the following vars that should be in tkConfig.sh: -# TK_BIN_DIR -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_TKCONFIG], [ - AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) - - if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then - AC_MSG_RESULT([loading]) - . "${TK_BIN_DIR}/tkConfig.sh" - else - AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) - fi - - # eval is required to do the TK_DBGX substitution - eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" - eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" - - # If the TK_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TK_LIB_SPEC will be set to the value - # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC - # instead of TK_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TK_BIN_DIR}/Makefile" ; then - TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} - TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} - TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tk.framework installed in an arbitary location. - case ${TK_DEFS} in - *TK_FRAMEWORK*) - if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then - for i in "`cd ${TK_BIN_DIR}; pwd`" \ - "`cd ${TK_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then - TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" - break - fi - done - fi - if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then - TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" - TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TK_DBGX substitution - eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" - eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" - eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" - eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" - - # Ensure windowingsystem is defined - if test "${TEA_PLATFORM}" = "unix" ; then - case ${TK_DEFS} in - *MAC_OSX_TK*) - AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) - TEA_WINDOWINGSYSTEM="aqua" - ;; - *) - TEA_WINDOWINGSYSTEM="x11" - ;; - esac - elif test "${TEA_PLATFORM}" = "windows" ; then - TEA_WINDOWINGSYSTEM="win32" - fi - - AC_SUBST(TK_VERSION) - AC_SUBST(TK_BIN_DIR) - AC_SUBST(TK_SRC_DIR) - - AC_SUBST(TK_LIB_FILE) - AC_SUBST(TK_LIB_FLAG) - AC_SUBST(TK_LIB_SPEC) - - AC_SUBST(TK_STUB_LIB_FILE) - AC_SUBST(TK_STUB_LIB_FLAG) - AC_SUBST(TK_STUB_LIB_SPEC) - - AC_SUBST(TK_LIBS) - AC_SUBST(TK_XINCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_SHARED -- -# -# Allows the building of shared libraries -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-shared=yes|no -# -# Defines the following vars: -# STATIC_BUILD Used for building import/export libraries -# on Windows. -# -# Sets the following vars: -# SHARED_BUILD Value of 1 or 0 -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_SHARED], [ - AC_MSG_CHECKING([how to build libraries]) - AC_ARG_ENABLE(shared, - AC_HELP_STRING([--enable-shared], - [build and link with shared libraries (default: on)]), - [tcl_ok=$enableval], [tcl_ok=yes]) - - if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" ; then - AC_MSG_RESULT([shared]) - SHARED_BUILD=1 - else - AC_MSG_RESULT([static]) - SHARED_BUILD=0 - AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) - fi - AC_SUBST(SHARED_BUILD) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_THREADS -- -# -# Specify if thread support should be enabled. If "yes" is specified -# as an arg (optional), threads are enabled by default, "no" means -# threads are disabled. "yes" is the default. -# -# TCL_THREADS is checked so that if you are compiling an extension -# against a threaded core, your extension must be compiled threaded -# as well. -# -# Note that it is legal to have a thread enabled extension run in a -# threaded or non-threaded Tcl core, but a non-threaded extension may -# only run in a non-threaded Tcl core. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-threads -# -# Sets the following vars: -# THREADS_LIBS Thread library(s) -# -# Defines the following vars: -# TCL_THREADS -# _REENTRANT -# _THREAD_SAFE -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_THREADS], [ - AC_ARG_ENABLE(threads, - AC_HELP_STRING([--enable-threads], - [build with threads]), - [tcl_ok=$enableval], [tcl_ok=yes]) - - if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then - TCL_THREADS=1 - - if test "${TEA_PLATFORM}" != "windows" ; then - # We are always OK on Windows, so check what this platform wants: - - # USE_THREAD_ALLOC tells us to try the special thread-based - # allocator that significantly reduces lock contention - AC_DEFINE(USE_THREAD_ALLOC, 1, - [Do we want to use the threaded memory allocator?]) - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - if test "`uname -s`" = "SunOS" ; then - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - fi - AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) - AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) - if test "$tcl_ok" = "no"; then - # Check a little harder for __pthread_mutex_init in the same - # library, as some systems hide it there until pthread.h is - # defined. We could alternatively do an AC_TRY_COMPILE with - # pthread.h, but that will work with libpthread really doesn't - # exist, like AIX 4.2. [Bug: 4359] - AC_CHECK_LIB(pthread, __pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthread" - else - AC_CHECK_LIB(pthreads, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthreads" - else - AC_CHECK_LIB(c, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "no"; then - AC_CHECK_LIB(c_r, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -pthread" - else - TCL_THREADS=0 - AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) - fi - fi - fi - fi - fi - else - TCL_THREADS=0 - fi - # Do checking message here to not mess up interleaved configure output - AC_MSG_CHECKING([for building with threads]) - if test "${TCL_THREADS}" = 1; then - AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) - AC_MSG_RESULT([yes (default)]) - else - AC_MSG_RESULT([no]) - fi - # TCL_THREADS sanity checking. See if our request for building with - # threads is the same as the way Tcl was built. If not, warn the user. - case ${TCL_DEFS} in - *THREADS=1*) - if test "${TCL_THREADS}" = "0"; then - AC_MSG_WARN([ - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads.]) - fi - ;; - *) - if test "${TCL_THREADS}" = "1"; then - AC_MSG_WARN([ - --enable-threads requested, but building against a Tcl that is NOT - thread-enabled. This is an OK configuration that will also run in - a thread-enabled core.]) - fi - ;; - esac - AC_SUBST(TCL_THREADS) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_SYMBOLS -- -# -# Specify if debugging symbols should be used. -# Memory (TCL_MEM_DEBUG) debugging can also be enabled. -# -# Arguments: -# none -# -# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives -# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. -# Requires the following vars to be set in the Makefile: -# CFLAGS_DEFAULT -# LDFLAGS_DEFAULT -# -# Results: -# -# Adds the following arguments to configure: -# --enable-symbols -# -# Defines the following vars: -# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true -# Sets to $(CFLAGS_OPTIMIZE) if false -# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true -# Sets to $(LDFLAGS_OPTIMIZE) if false -# DBGX Formerly used as debug library extension; -# always blank now. -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_SYMBOLS], [ - dnl Make sure we are initialized - AC_REQUIRE([TEA_CONFIG_CFLAGS]) - AC_MSG_CHECKING([for build with symbols]) - AC_ARG_ENABLE(symbols, - AC_HELP_STRING([--enable-symbols], - [build with debugging symbols (default: off)]), - [tcl_ok=$enableval], [tcl_ok=no]) - DBGX="" - if test "$tcl_ok" = "no"; then - CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" - LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" - AC_MSG_RESULT([no]) - else - CFLAGS_DEFAULT="${CFLAGS_DEBUG}" - LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" - if test "$tcl_ok" = "yes"; then - AC_MSG_RESULT([yes (standard debugging)]) - fi - fi - if test "${TEA_PLATFORM}" != "windows" ; then - LDFLAGS_DEFAULT="${LDFLAGS}" - fi - - AC_SUBST(TCL_DBGX) - AC_SUBST(CFLAGS_DEFAULT) - AC_SUBST(LDFLAGS_DEFAULT) - - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) - fi - - if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then - if test "$tcl_ok" = "all"; then - AC_MSG_RESULT([enabled symbols mem debugging]) - else - AC_MSG_RESULT([enabled $tcl_ok debugging]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_LANGINFO -- -# -# Allows use of modern nl_langinfo check for better l10n. -# This is only relevant for Unix. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-langinfo=yes|no (default is yes) -# -# Defines the following vars: -# HAVE_LANGINFO Triggers use of nl_langinfo if defined. -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_LANGINFO], [ - AC_ARG_ENABLE(langinfo, - AC_HELP_STRING([--enable-langinfo], - [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), - [langinfo_ok=$enableval], [langinfo_ok=yes]) - - HAVE_LANGINFO=0 - if test "$langinfo_ok" = "yes"; then - AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) - fi - AC_MSG_CHECKING([whether to use nl_langinfo]) - if test "$langinfo_ok" = "yes"; then - AC_CACHE_VAL(tcl_cv_langinfo_h, [ - AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], - [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) - AC_MSG_RESULT([$tcl_cv_langinfo_h]) - if test $tcl_cv_langinfo_h = yes; then - AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) - fi - else - AC_MSG_RESULT([$langinfo_ok]) - fi -]) - -#-------------------------------------------------------------------- -# TEA_CONFIG_SYSTEM -# -# Determine what the system is (some things cannot be easily checked -# on a feature-driven basis, alas). This can usually be done via the -# "uname" command, but there are a few systems, like Next, where -# this doesn't work. -# -# Arguments: -# none -# -# Results: -# Defines the following var: -# -# system - System/platform/version identification code. -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_CONFIG_SYSTEM], [ - AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ - if test "${TEA_PLATFORM}" = "windows" ; then - tcl_cv_sys_version=windows - elif test -f /usr/lib/NextStep/software_version; then - tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` - else - tcl_cv_sys_version=`uname -s`-`uname -r` - if test "$?" -ne 0 ; then - AC_MSG_WARN([can't find uname command]) - tcl_cv_sys_version=unknown - else - # Special check for weird MP-RAS system (uname returns weird - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid` - fi - if test "`uname -s`" = "AIX" ; then - tcl_cv_sys_version=AIX-`uname -v`.`uname -r` - fi - fi - fi - ]) - system=$tcl_cv_sys_version -]) - -#-------------------------------------------------------------------- -# TEA_CONFIG_CFLAGS -# -# Try to determine the proper flags to pass to the compiler -# for building shared libraries and other such nonsense. -# -# Arguments: -# none -# -# Results: -# -# Defines and substitutes the following vars: -# -# DL_OBJS - Name of the object file that implements dynamic -# loading for Tcl on this system. -# DL_LIBS - Library file(s) to include in tclsh and other base -# applications in order for the "load" command to work. -# LDFLAGS - Flags to pass to the compiler when linking object -# files into an executable application binary such -# as tclsh. -# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", -# that tell the run-time dynamic linker where to look -# for shared libraries such as libtcl.so. Depends on -# the variable LIB_RUNTIME_DIR in the Makefile. Could -# be the same as CC_SEARCH_FLAGS if ${CC} is used to link. -# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", -# that tell the run-time dynamic linker where to look -# for shared libraries such as libtcl.so. Depends on -# the variable LIB_RUNTIME_DIR in the Makefile. -# SHLIB_CFLAGS - Flags to pass to cc when compiling the components -# of a shared library (may request position-independent -# code, among other things). -# SHLIB_LD - Base command to use for combining object files -# into a shared library. -# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when -# creating shared libraries. This symbol typically -# goes at the end of the "ld" commands that build -# shared libraries. The value of the symbol is -# "${LIBS}" if all of the dependent libraries should -# be specified when creating a shared library. If -# dependent libraries should not be specified (as on -# SunOS 4.x, where they cause the link to fail, or in -# general if Tcl and Tk aren't themselves shared -# libraries), then this symbol has an empty string -# as its value. -# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable -# extensions. An empty string means we don't know how -# to use shared libraries on this platform. -# LIB_SUFFIX - Specifies everything that comes after the "libfoo" -# in a static or shared library name, using the $VERSION variable -# to put the version in the right place. This is used -# by platforms that need non-standard library names. -# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs -# to have a version after the .so, and ${VERSION}.a -# on AIX, since a shared library needs to have -# a .a extension whereas shared objects for loadable -# extensions have a .so extension. Defaults to -# ${VERSION}${SHLIB_SUFFIX}. -# TCL_NEEDS_EXP_FILE - -# 1 means that an export file is needed to link to a -# shared library. -# TCL_EXP_FILE - The name of the installed export / import file which -# should be used to link to the Tcl shared library. -# Empty if Tcl is unshared. -# TCL_BUILD_EXP_FILE - -# The name of the built export / import file which -# should be used to link to the Tcl shared library. -# Empty if Tcl is unshared. -# CFLAGS_DEBUG - -# Flags used when running the compiler in debug mode -# CFLAGS_OPTIMIZE - -# Flags used when running the compiler in optimize mode -# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_CONFIG_CFLAGS], [ - dnl Make sure we are initialized - AC_REQUIRE([TEA_INIT]) - - # Step 0.a: Enable 64 bit support? - - AC_MSG_CHECKING([if 64bit support is requested]) - AC_ARG_ENABLE(64bit, - AC_HELP_STRING([--enable-64bit], - [enable 64bit support (default: off)]), - [do64bit=$enableval], [do64bit=no]) - AC_MSG_RESULT([$do64bit]) - - # Step 0.b: Enable Solaris 64 bit VIS support? - - AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) - AC_ARG_ENABLE(64bit-vis, - AC_HELP_STRING([--enable-64bit-vis], - [enable 64bit Sparc VIS support (default: off)]), - [do64bitVIS=$enableval], [do64bitVIS=no]) - AC_MSG_RESULT([$do64bitVIS]) - - if test "$do64bitVIS" = "yes"; then - # Force 64bit on with VIS - do64bit=yes - fi - - # Step 0.c: Cross-compiling options for Windows/CE builds? - - if test "${TEA_PLATFORM}" = "windows" ; then - AC_MSG_CHECKING([if Windows/CE build is requested]) - AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) - AC_MSG_RESULT([$doWince]) - fi - - # Step 1: set the variable "system" to hold the name and version number - # for the system. - - TEA_CONFIG_SYSTEM - - # Step 2: check for existence of -ldl library. This is needed because - # Linux can use either -ldl or -ldld for dynamic loading. - - AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) - - # Require ranlib early so we can override it in special cases below. - - AC_REQUIRE([AC_PROG_RANLIB]) - - # Step 3: set configuration options based on system name and version. - # This is similar to Tcl's unix/tcl.m4 except that we've added a - # "windows" case. - - do64bit_ok=no - LDFLAGS_ORIG="$LDFLAGS" - # When ld needs options to work in 64-bit mode, put them in - # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] - # is disabled by the user. [Bug 1016796] - LDFLAGS_ARCH="" - TCL_EXPORT_FILE_SUFFIX="" - UNSHARED_LIB_SUFFIX="" - TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' - ECHO_VERSION='`echo ${PACKAGE_VERSION}`' - TCL_LIB_VERSIONS_OK=ok - CFLAGS_DEBUG=-g - CFLAGS_OPTIMIZE=-O - if test "$GCC" = "yes" ; then - CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wno-implicit-int" - else - CFLAGS_WARNING="" - fi - TCL_NEEDS_EXP_FILE=0 - TCL_BUILD_EXP_FILE="" - TCL_EXP_FILE="" -dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. -dnl AC_CHECK_TOOL(AR, ar) - AC_CHECK_PROG(AR, ar, ar) - STLIB_LD='${AR} cr' - LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" - case $system in - windows) - # This is a 2-stage check to make sure we have the 64-bit SDK - # We have to know where the SDK is installed. - # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs - # MACHINE is IX86 for LINK, but this is used by the manifest, - # which requires x86|amd64|ia64. - MACHINE="X86" - if test "$do64bit" != "no" ; then - if test "x${MSSDK}x" = "xx" ; then - MSSDK="C:/Progra~1/Microsoft Platform SDK" - fi - MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` - PATH64="" - case "$do64bit" in - amd64|x64|yes) - MACHINE="AMD64" ; # default to AMD64 64-bit build - PATH64="${MSSDK}/Bin/Win64/x86/AMD64" - ;; - ia64) - MACHINE="IA64" - PATH64="${MSSDK}/Bin/Win64" - ;; - esac - if test ! -d "${PATH64}" ; then - AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) - AC_MSG_WARN([Ensure latest Platform SDK is installed]) - do64bit="no" - else - AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) - do64bit_ok="yes" - fi - fi - - if test "$doWince" != "no" ; then - if test "$do64bit" != "no" ; then - AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) - fi - if test "$GCC" = "yes" ; then - AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) - fi - TEA_PATH_CELIB - # Set defaults for common evc4/PPC2003 setup - # Currently Tcl requires 300+, possibly 420+ for sockets - CEVERSION=420; # could be 211 300 301 400 420 ... - TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... - ARCH=ARM; # could be ARM MIPS X86EM ... - PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" - if test "$doWince" != "yes"; then - # If !yes then the user specified something - # Reset ARCH to allow user to skip specifying it - ARCH= - eval `echo $doWince | awk -F, '{ \ - if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ - if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ - if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ - if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ - if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ - }'` - if test "x${ARCH}" = "x" ; then - ARCH=$TARGETCPU; - fi - fi - OSVERSION=WCE$CEVERSION; - if test "x${WCEROOT}" = "x" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" - if test ! -d "${WCEROOT}" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded Tools" - fi - fi - if test "x${SDKROOT}" = "x" ; then - SDKROOT="C:/Program Files/Windows CE Tools" - if test ! -d "${SDKROOT}" ; then - SDKROOT="C:/Windows CE Tools" - fi - fi - WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` - SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` - if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ - -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then - AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) - doWince="no" - else - # We could PATH_NOSPACE these, but that's not important, - # as long as we quote them when used. - CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" - if test -d "${CEINCLUDE}/${TARGETCPU}" ; then - CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" - fi - CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" - fi - fi - - if test "$GCC" != "yes" ; then - if test "${SHARED_BUILD}" = "0" ; then - runtime=-MT - else - runtime=-MD - fi - - if test "$do64bit" != "no" ; then - # All this magic is necessary for the Win64 SDK RC1 - hobbs - CC="\"${PATH64}/cl.exe\"" - CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" - RC="\"${MSSDK}/bin/rc.exe\"" - lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" - LINKBIN="\"${PATH64}/link.exe\"" - CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - # Avoid 'unresolved external symbol __security_cookie' - # errors, c.f. http://support.microsoft.com/?id=894573 - TEA_ADD_LIBS([bufferoverflowU.lib]) - elif test "$doWince" != "no" ; then - CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" - if test "${TARGETCPU}" = "X86"; then - CC="\"${CEBINROOT}/cl.exe\"" - else - CC="\"${CEBINROOT}/cl${ARCH}.exe\"" - fi - CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" - RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" - arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` - defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" - if test "${SHARED_BUILD}" = "1" ; then - # Static CE builds require static celib as well - defs="${defs} _DLL" - fi - for i in $defs ; do - AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) - done - AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) - AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) - CFLAGS_DEBUG="-nologo -Zi -Od" - CFLAGS_OPTIMIZE="-nologo -Ox" - lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` - lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" - LINKBIN="\"${CEBINROOT}/link.exe\"" - AC_SUBST(CELIB_DIR) - else - RC="rc" - lflags="-nologo" - LINKBIN="link" - CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - fi - fi - - if test "$GCC" = "yes"; then - # mingw gcc mode - RC="windres" - CFLAGS_DEBUG="-g" - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - SHLIB_LD="$CC -shared" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" - LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" - else - SHLIB_LD="${LINKBIN} -dll ${lflags}" - # link -lib only works when -lib is the first arg - STLIB_LD="${LINKBIN} -lib ${lflags}" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' - PATHTYPE=-w - # For information on what debugtype is most useful, see: - # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp - # This essentially turns it all on. - LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" - LDFLAGS_OPTIMIZE="-release" - if test "$doWince" != "no" ; then - LDFLAGS_CONSOLE="-link ${lflags}" - LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} - else - LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" - LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" - fi - fi - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dll" - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' - - TCL_LIB_VERSIONS_OK=nodots - # Bogus to avoid getting this turned off - DL_OBJS="tclLoadNone.obj" - ;; - AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then - # AIX requires the _r compiler when gcc isn't being used - case "${CC}" in - *_r) - # ok ... - ;; - *) - CC=${CC}_r - ;; - esac - AC_MSG_RESULT([Using $CC for compiling with threads]) - fi - LIBS="$LIBS -lc" - SHLIB_CFLAGS="" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - DL_OBJS="tclLoadDl.o" - LD_LIBRARY_PATH_VAR="LIBPATH" - - # Check to enable 64-bit flags for compiler/linker on AIX 4+ - if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - else - do64bit_ok=yes - CFLAGS="$CFLAGS -q64" - LDFLAGS_ARCH="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi - - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - else - SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - fi - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' - fi - - # AIX v<=4.1 has some different flags than 4.2+ - if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then - AC_LIBOBJ([tclLoadAix]) - DL_LIBS="-lld" - fi - - # On AIX <=v4 systems, libbsd.a has to be linked in to support - # non-blocking file IO. This library has to be linked in after - # the MATH_LIBS or it breaks the pow() function. The way to - # insure proper sequencing, is to add it to the tail of MATH_LIBS. - # This library also supplies gettimeofday. - # - # AIX does not have a timezone field in struct tm. When the AIX - # bsd library is used, the timezone global and the gettimeofday - # methods are to be avoided for timezone deduction instead, we - # deduce the timezone by comparing the localtime result on a - # known GMT value. - - AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) - if test $libbsd = yes; then - MATH_LIBS="$MATH_LIBS -lbsd" - AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) - fi - ;; - BeOS*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC} -nostart" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - - #----------------------------------------------------------- - # Check for inet_ntoa in -lbind, for BeOS (which also needs - # -lsocket, even if the network functions are in -lnet which - # is always linked to, for compatibility. - #----------------------------------------------------------- - AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) - ;; - BSD/OS-2.1*|BSD/OS-3*) - SHLIB_CFLAGS="" - SHLIB_LD="shlicc -r" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - BSD/OS-4.*) - SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="cc -shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - dgux*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - HP-UX-*.11.*) - # Use updated header definitions where possible - AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) - # Needed by Tcl, but not most extensions - #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) - #LIBS="$LIBS -lxnet" # Use the XOPEN network library - - if test "`uname -m`" = "ia64" ; then - SHLIB_SUFFIX=".so" - # Use newer C++ library for C++ extensions - #if test "$GCC" != "yes" ; then - # CPPFLAGS="-AA" - #fi - else - SHLIB_SUFFIX=".sl" - fi - AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS='${LIBS}' - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - SHLIB_LD_LIBS='${LIBS}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - - # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc - #CFLAGS="$CFLAGS +DAportable" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - hpux_arch=`${CC} -dumpmachine` - case $hpux_arch in - hppa64*) - # 64-bit gcc in use. Fix flags for GNU ld. - do64bit_ok=yes - SHLIB_LD="${CC} -shared" - SHLIB_LD_LIBS='${LIBS}' - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ;; - *) - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - ;; - esac - else - do64bit_ok=yes - CFLAGS="$CFLAGS +DD64" - LDFLAGS_ARCH="+DD64" - fi - fi - ;; - HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) - SHLIB_SUFFIX=".sl" - AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS="" - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - ;; - IRIX-5.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - ;; - IRIX-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mabi=n32" - LDFLAGS="$LDFLAGS -mabi=n32" - else - case $system in - IRIX-6.3) - # Use to build 6.2 compatible binaries on 6.3. - CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" - ;; - *) - CFLAGS="$CFLAGS -n32" - ;; - esac - LDFLAGS="$LDFLAGS -n32" - fi - ;; - IRIX64-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - - # Check to enable 64-bit flags for compiler/linker - - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN([64bit mode not supported by gcc]) - else - do64bit_ok=yes - SHLIB_LD="ld -64 -shared -rdata_shared" - CFLAGS="$CFLAGS -64" - LDFLAGS_ARCH="-64" - fi - fi - ;; - Linux*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings - # when you inline the string and math operations. Turn this off to - # get rid of the warnings. - #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" - - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - if test $do64bit = yes; then - AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -m64" - AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_m64 = yes; then - CFLAGS="$CFLAGS -m64" - do64bit_ok=yes - fi - fi - - # The combo of gcc + glibc has a bug related - # to inlining of functions like strtod(). The - # -fno-builtin flag should address this problem - # but it does not work. The -fno-inline flag - # is kind of overkill but it works. - # Disable inlining only when one of the - # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x ; then - CFLAGS="$CFLAGS -fno-inline" - fi - - ;; - GNU*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - SHLIB_LD="${CC} -shared" - DL_OBJS="" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - ;; - Lynx*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - CFLAGS_OPTIMIZE=-02 - SHLIB_LD="${CC} -shared " - DL_OBJS="tclLoadDl.o" - DL_LIBS="-mshared -ldl" - LD_FLAGS="-Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - ;; - MP-RAS-02*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - MP-RAS-*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,-Bexport" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - NetBSD-*|FreeBSD-[[1-2]].*) - # NetBSD/SPARC needs -fPIC, -fpic will not do. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ - AC_EGREP_CPP(yes, [ -#ifdef __ELF__ - yes -#endif - ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) - if test $tcl_cv_ld_elf = yes; then - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - else - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - fi - - # Ancient FreeBSD doesn't handle version numbers with dots. - - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - OpenBSD-*) - # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. - case `machine` in - sparc|sparc64) - SHLIB_CFLAGS="-fPIC";; - *) - SHLIB_CFLAGS="-fpic";; - esac - SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ - AC_EGREP_CPP(yes, [ -#ifdef __ELF__ - yes -#endif - ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) - if test $tcl_cv_ld_elf = yes; then - LDFLAGS=-Wl,-export-dynamic - else - LDFLAGS="" - fi - - # OpenBSD doesn't do version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - FreeBSD-*) - # FreeBSD 3.* and greater have ELF. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "${TCL_THREADS}" = "1" ; then - # The -pthread needs to go in the CFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - case $system in - FreeBSD-3.*) - # FreeBSD-3 doesn't handle version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - TCL_LIB_VERSIONS_OK=nodots - ;; - esac - ;; - Darwin-*) - CFLAGS_OPTIMIZE="-Os" - SHLIB_CFLAGS="-fno-common" - # To avoid discrepancies between what headers configure sees during - # preprocessing tests and compiling tests, move any -isysroot and - # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: - CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" - CFLAGS="`echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" - if test $do64bit = yes; then - case `arch` in - ppc) - AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], - tcl_cv_cc_arch_ppc64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes, - tcl_cv_cc_arch_ppc64=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_arch_ppc64 = yes; then - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - do64bit_ok=yes - fi;; - i386) - AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], - tcl_cv_cc_arch_x86_64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch x86_64" - AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes, - tcl_cv_cc_arch_x86_64=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_arch_x86_64 = yes; then - CFLAGS="$CFLAGS -arch x86_64" - do64bit_ok=yes - fi;; - *) - AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; - esac - else - # Check for combined 32-bit and 64-bit fat build - echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ - echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ - fat_32_64=yes - fi - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' - AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) - LDFLAGS=$hold_ldflags]) - if test $tcl_cv_ld_single_module = yes; then - SHLIB_LD="${SHLIB_LD} -Wl,-single_module" - fi - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dylib" - DL_OBJS="tclLoadDyld.o" - DL_LIBS="" - # Don't use -prebind when building for Mac OS X 10.4 or later only: - test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \ - "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \ - LDFLAGS="$LDFLAGS -prebind" - LDFLAGS="$LDFLAGS -headerpad_max_install_names" - AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no) - LDFLAGS=$hold_ldflags]) - if test $tcl_cv_ld_search_paths_first = yes; then - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" - - # TEA specific: for Tk extensions, remove 64-bit arch flags from - # CFLAGS et al. for combined 32 & 64 bit fat builds as neither - # TkAqua nor TkX11 can be built for 64-bit at present. - test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done - ;; - NEXTSTEP-*) - SHLIB_CFLAGS="" - SHLIB_LD="cc -nostdlib -r" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadNext.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OS/390-*) - CFLAGS_OPTIMIZE="" # Optimizer is buggy - AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h - [Should OS/390 do the right thing with sockets?]) - ;; - OSF1-1.0|OSF1-1.1|OSF1-1.2) - # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 - SHLIB_CFLAGS="" - # Hack: make package name same as library name - SHLIB_LD='ld -R -export $@:' - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadOSF.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-1.*) - # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - SHLIB_CFLAGS="-fPIC" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD="ld -shared" - else - SHLIB_LD="ld -non_shared" - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-V*) - # Digital OSF/1 - SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD='ld -shared -expect_unresolved "*"' - else - SHLIB_LD='ld -non_shared -expect_unresolved "*"' - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mieee" - else - CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" - fi - # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = "1" ; then - CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" - CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" - LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = "yes" ; then - LIBS="$LIBS -lpthread -lmach -lexc" - else - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - fi - - ;; - QNX-6*) - # QNX RTP - # This may work for all QNX, but it was only reported for v6. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - # dlopen is in -lc on QNX - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SCO_SV-3.2*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, - # this test works, since "uname -s" was non-standard in 3.2.4 and - # below. - if test "$GCC" = "yes" ; then - SHLIB_CFLAGS="-fPIC -melf" - LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" - else - SHLIB_CFLAGS="-Kpic -belf" - LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" - fi - SHLIB_LD="ld -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SINIX*5.4*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SunOS-4*) - SHLIB_CFLAGS="-PIC" - SHLIB_LD="ld" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - - # SunOS can't handle version numbers with dots in them in library - # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it - # requires an extra version number at the end of .so file names. - # So, the library has to have a name like libtcl75.so.1.0 - - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - SunOS-5.[[0-6]]) - # Careful to not let 5.10+ fall into this case - - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - - SHLIB_CFLAGS="-KPIC" - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - ;; - SunOS-5*) - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - - SHLIB_CFLAGS="-KPIC" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - arch=`isainfo` - if test "$arch" = "sparcv9 sparc" ; then - if test "$GCC" = "yes" ; then - if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then - AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) - else - do64bit_ok=yes - CFLAGS="$CFLAGS -m64 -mcpu=v9" - LDFLAGS="$LDFLAGS -m64 -mcpu=v9" - SHLIB_CFLAGS="-fPIC" - fi - else - do64bit_ok=yes - if test "$do64bitVIS" = "yes" ; then - CFLAGS="$CFLAGS -xarch=v9a" - LDFLAGS_ARCH="-xarch=v9a" - else - CFLAGS="$CFLAGS -xarch=v9" - LDFLAGS_ARCH="-xarch=v9" - fi - # Solaris 64 uses this as well - #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" - fi - elif test "$arch" = "amd64 i386" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - else - do64bit_ok=yes - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64" - fi - else - AC_MSG_WARN([64bit mode not supported for $arch]) - fi - fi - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = "yes" ; then - # We need to specify -static-libgcc or we need to - # add the path to the sparv9 libgcc. - # JH: static-libgcc is necessary for core Tcl, but may - # not be necessary for extensions. - SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" - # for finding sparcv9 libgcc, get the regular libgcc - # path, remove so name and append 'sparcv9' - #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." - #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" - fi - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - fi - ;; - UNIX_SV* | UnixWare-5*) - SHLIB_CFLAGS="-KPIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers - # that don't grok the -Bexport option. Test that it does. - AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-Bexport" - AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) - LDFLAGS=$hold_ldflags]) - if test $tcl_cv_ld_Bexport = yes; then - LDFLAGS="$LDFLAGS -Wl,-Bexport" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - esac - - if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then - AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) - fi - -dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so -dnl # until the end of configure, as configure's compile and link tests use -dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's -dnl # preprocessing tests use only CPPFLAGS. - AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) - - # Step 4: disable dynamic loading if requested via a command-line switch. - - AC_ARG_ENABLE(load, - AC_HELP_STRING([--enable-load], - [allow dynamic loading and "load" command (default: on)]), - [tcl_ok=$enableval], [tcl_ok=yes]) - if test "$tcl_ok" = "no"; then - DL_OBJS="" - fi - - if test "x$DL_OBJS" != "x" ; then - BUILD_DLTEST="\$(DLTEST_TARGETS)" - else - echo "Can't figure out how to do dynamic loading or shared libraries" - echo "on this system." - SHLIB_CFLAGS="" - SHLIB_LD="" - SHLIB_SUFFIX="" - DL_OBJS="tclLoadNone.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS_ORIG" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - BUILD_DLTEST="" - fi - LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" - - # If we're running gcc, then change the C flags for compiling shared - # libraries to the right flags for gcc, instead of those for the - # standard manufacturer compiler. - - if test "$DL_OBJS" != "tclLoadNone.o" ; then - if test "$GCC" = "yes" ; then - case $system in - AIX-*) - ;; - BSD/OS*) - ;; - IRIX*) - ;; - NetBSD-*|FreeBSD-*) - ;; - Darwin-*) - ;; - SCO_SV-3.2*) - ;; - windows) - ;; - *) - SHLIB_CFLAGS="-fPIC" - ;; - esac - fi - fi - - if test "$SHARED_LIB_SUFFIX" = "" ; then - SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' - fi - if test "$UNSHARED_LIB_SUFFIX" = "" ; then - UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' - fi - - AC_SUBST(DL_LIBS) - - AC_SUBST(CFLAGS_DEBUG) - AC_SUBST(CFLAGS_OPTIMIZE) - AC_SUBST(CFLAGS_WARNING) - - AC_SUBST(STLIB_LD) - AC_SUBST(SHLIB_LD) - - AC_SUBST(SHLIB_LD_LIBS) - AC_SUBST(SHLIB_CFLAGS) - - AC_SUBST(LD_LIBRARY_PATH_VAR) - - # These must be called after we do the basic CFLAGS checks and - # verify any possible 64-bit or similar switches are necessary - TEA_TCL_EARLY_FLAGS - TEA_TCL_64BIT_FLAGS -]) - -#-------------------------------------------------------------------- -# TEA_SERIAL_PORT -# -# Determine which interface to use to talk to the serial port. -# Note that #include lines must begin in leftmost column for -# some compilers to recognize them as preprocessor directives, -# and some build environments have stdin not pointing at a -# pseudo-terminal (usually /dev/null instead.) -# -# Arguments: -# none -# -# Results: -# -# Defines only one of the following vars: -# HAVE_SYS_MODEM_H -# USE_TERMIOS -# USE_TERMIO -# USE_SGTTY -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_SERIAL_PORT], [ - AC_CHECK_HEADERS(sys/modem.h) - AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ - AC_TRY_RUN([ -#include - -int main() { - struct termios t; - if (tcgetattr(0, &t) == 0) { - cfsetospeed(&t, 0); - t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - if test $tcl_cv_api_serial = no ; then - AC_TRY_RUN([ -#include - -int main() { - struct termio t; - if (ioctl(0, TCGETA, &t) == 0) { - t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no ; then - AC_TRY_RUN([ -#include - -int main() { - struct sgttyb t; - if (ioctl(0, TIOCGETP, &t) == 0) { - t.sg_ospeed = 0; - t.sg_flags |= ODDP | EVENP | RAW; - return 0; - } - return 1; -}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no ; then - AC_TRY_RUN([ -#include -#include - -int main() { - struct termios t; - if (tcgetattr(0, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - cfsetospeed(&t, 0); - t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no; then - AC_TRY_RUN([ -#include -#include - -int main() { - struct termio t; - if (ioctl(0, TCGETA, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; - }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no; then - AC_TRY_RUN([ -#include -#include - -int main() { - struct sgttyb t; - if (ioctl(0, TIOCGETP, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - t.sg_ospeed = 0; - t.sg_flags |= ODDP | EVENP | RAW; - return 0; - } - return 1; -}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) - fi]) - case $tcl_cv_api_serial in - termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; - termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; - sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; - esac -]) - -#-------------------------------------------------------------------- -# TEA_MISSING_POSIX_HEADERS -# -# Supply substitutes for missing POSIX header files. Special -# notes: -# - stdlib.h doesn't define strtol, strtoul, or -# strtod insome versions of SunOS -# - some versions of string.h don't declare procedures such -# as strstr -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# NO_DIRENT_H -# NO_ERRNO_H -# NO_VALUES_H -# HAVE_LIMITS_H or NO_LIMITS_H -# NO_STDLIB_H -# NO_STRING_H -# NO_SYS_WAIT_H -# NO_DLFCN_H -# HAVE_SYS_PARAM_H -# -# HAVE_STRING_H ? -# -# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and -# CHECK on limits.h -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ - AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ - AC_TRY_LINK([#include -#include ], [ -#ifndef _POSIX_SOURCE -# ifdef __Lynx__ - /* - * Generate compilation error to make the test fail: Lynx headers - * are only valid if really in the POSIX environment. - */ - - missing_procedure(); -# endif -#endif -DIR *d; -struct dirent *entryPtr; -char *p; -d = opendir("foobar"); -entryPtr = readdir(d); -p = entryPtr->d_name; -closedir(d); -], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) - - if test $tcl_cv_dirent_h = no; then - AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) - fi - - AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(limits.h, - [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], - [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) - AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) - AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) - AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) - if test $tcl_ok = 0; then - AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) - fi - AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) - AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) - AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) - - # See also memmove check below for a place where NO_STRING_H can be - # set and why. - - if test $tcl_ok = 0; then - AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) - fi - - AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) - - # OS/390 lacks sys/param.h (and doesn't need it, by chance). - AC_HAVE_HEADERS(sys/param.h) -]) - -#-------------------------------------------------------------------- -# TEA_PATH_X -# -# Locate the X11 header files and the X11 library archive. Try -# the ac_path_x macro first, but if it doesn't find the X stuff -# (e.g. because there's no xmkmf program) then check through -# a list of possible directories. Under some conditions the -# autoconf macro will return an include directory that contains -# no include files, so double-check its result just to be safe. -# -# This should be called after TEA_CONFIG_CFLAGS as setting the -# LIBS line can confuse some configure macro magic. -# -# Arguments: -# none -# -# Results: -# -# Sets the following vars: -# XINCLUDES -# XLIBSW -# PKG_LIBS (appends to) -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_PATH_X], [ - if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then - TEA_PATH_UNIX_X - fi -]) - -AC_DEFUN([TEA_PATH_UNIX_X], [ - AC_PATH_X - not_really_there="" - if test "$no_x" = ""; then - if test "$x_includes" = ""; then - AC_TRY_CPP([#include ], , not_really_there="yes") - else - if test ! -r $x_includes/X11/Intrinsic.h; then - not_really_there="yes" - fi - fi - fi - if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then - AC_MSG_CHECKING([for X11 header files]) - found_xincludes="no" - AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") - if test "$found_xincludes" = "no"; then - dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" - for i in $dirs ; do - if test -r $i/X11/Intrinsic.h; then - AC_MSG_RESULT([$i]) - XINCLUDES=" -I$i" - found_xincludes="yes" - break - fi - done - fi - else - if test "$x_includes" != ""; then - XINCLUDES="-I$x_includes" - found_xincludes="yes" - fi - fi - if test found_xincludes = "no"; then - AC_MSG_RESULT([couldn't find any!]) - fi - - if test "$no_x" = yes; then - AC_MSG_CHECKING([for X11 libraries]) - XLIBSW=nope - dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" - for i in $dirs ; do - if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then - AC_MSG_RESULT([$i]) - XLIBSW="-L$i -lX11" - x_libraries="$i" - break - fi - done - else - if test "$x_libraries" = ""; then - XLIBSW=-lX11 - else - XLIBSW="-L$x_libraries -lX11" - fi - fi - if test "$XLIBSW" = nope ; then - AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) - fi - if test "$XLIBSW" = nope ; then - AC_MSG_RESULT([could not find any! Using -lX11.]) - XLIBSW=-lX11 - fi - if test x"${XLIBSW}" != x ; then - PKG_LIBS="${PKG_LIBS} ${XLIBSW}" - fi -]) - -#-------------------------------------------------------------------- -# TEA_BLOCKING_STYLE -# -# The statements below check for systems where POSIX-style -# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. -# On these systems (mostly older ones), use the old BSD-style -# FIONBIO approach instead. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# HAVE_SYS_IOCTL_H -# HAVE_SYS_FILIO_H -# USE_FIONBIO -# O_NONBLOCK -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_BLOCKING_STYLE], [ - AC_CHECK_HEADERS(sys/ioctl.h) - AC_CHECK_HEADERS(sys/filio.h) - TEA_CONFIG_SYSTEM - AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) - case $system in - # There used to be code here to use FIONBIO under AIX. However, it - # was reported that FIONBIO doesn't work under AIX 3.2.5. Since - # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO - # code (JO, 5/31/97). - - OSF*) - AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) - AC_MSG_RESULT([FIONBIO]) - ;; - SunOS-4*) - AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) - AC_MSG_RESULT([FIONBIO]) - ;; - *) - AC_MSG_RESULT([O_NONBLOCK]) - ;; - esac -]) - -#-------------------------------------------------------------------- -# TEA_TIME_HANLDER -# -# Checks how the system deals with time.h, what time structures -# are used on the system, and what fields the structures have. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# USE_DELTA_FOR_TZ -# HAVE_TM_GMTOFF -# HAVE_TM_TZADJ -# HAVE_TIMEZONE_VAR -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TIME_HANDLER], [ - AC_CHECK_HEADERS(sys/time.h) - AC_HEADER_TIME - AC_STRUCT_TIMEZONE - - AC_CHECK_FUNCS(gmtime_r localtime_r) - - AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ - AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], - tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) - if test $tcl_cv_member_tm_tzadj = yes ; then - AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) - fi - - AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ - AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], - tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) - if test $tcl_cv_member_tm_gmtoff = yes ; then - AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) - fi - - # - # Its important to include time.h in this check, as some systems - # (like convex) have timezone functions, etc. - # - AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ - AC_TRY_COMPILE([#include ], - [extern long timezone; - timezone += 1; - exit (0);], - tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) - if test $tcl_cv_timezone_long = yes ; then - AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) - else - # - # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. - # - AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ - AC_TRY_COMPILE([#include ], - [extern time_t timezone; - timezone += 1; - exit (0);], - tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) - if test $tcl_cv_timezone_time = yes ; then - AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) - fi - fi -]) - -#-------------------------------------------------------------------- -# TEA_BUGGY_STRTOD -# -# Under Solaris 2.4, strtod returns the wrong value for the -# terminating character under some conditions. Check for this -# and if the problem exists use a substitute procedure -# "fixstrtod" (provided by Tcl) that corrects the error. -# Also, on Compaq's Tru64 Unix 5.0, -# strtod(" ") returns 0.0 instead of a failure to convert. -# -# Arguments: -# none -# -# Results: -# -# Might defines some of the following vars: -# strtod (=fixstrtod) -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_BUGGY_STRTOD], [ - AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) - if test "$tcl_strtod" = 1; then - AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ - AC_TRY_RUN([ - extern double strtod(); - int main() { - char *infString="Inf", *nanString="NaN", *spaceString=" "; - char *term; - double value; - value = strtod(infString, &term); - if ((term != infString) && (term[-1] == 0)) { - exit(1); - } - value = strtod(nanString, &term); - if ((term != nanString) && (term[-1] == 0)) { - exit(1); - } - value = strtod(spaceString, &term); - if (term == (spaceString+1)) { - exit(1); - } - exit(0); - }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, - tcl_cv_strtod_buggy=buggy)]) - if test "$tcl_cv_strtod_buggy" = buggy; then - AC_LIBOBJ([fixstrtod]) - USE_COMPAT=1 - AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) - fi - fi -]) - -#-------------------------------------------------------------------- -# TEA_TCL_LINK_LIBS -# -# Search for the libraries needed to link the Tcl shell. -# Things like the math library (-lm) and socket stuff (-lsocket vs. -# -lnsl) are dealt with here. -# -# Arguments: -# Requires the following vars to be set in the Makefile: -# DL_LIBS -# LIBS -# MATH_LIBS -# -# Results: -# -# Subst's the following var: -# TCL_LIBS -# MATH_LIBS -# -# Might append to the following vars: -# LIBS -# -# Might define the following vars: -# HAVE_NET_ERRNO_H -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_LINK_LIBS], [ - #-------------------------------------------------------------------- - # On a few very rare systems, all of the libm.a stuff is - # already in libc.a. Set compiler flags accordingly. - # Also, Linux requires the "ieee" library for math to work - # right (and it must appear before "-lm"). - #-------------------------------------------------------------------- - - AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") - AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) - - #-------------------------------------------------------------------- - # Interactive UNIX requires -linet instead of -lsocket, plus it - # needs net/errno.h to define the socket-related error codes. - #-------------------------------------------------------------------- - - AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) - AC_CHECK_HEADER(net/errno.h, [ - AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) - - #-------------------------------------------------------------------- - # Check for the existence of the -lsocket and -lnsl libraries. - # The order here is important, so that they end up in the right - # order in the command line generated by make. Here are some - # special considerations: - # 1. Use "connect" and "accept" to check for -lsocket, and - # "gethostbyname" to check for -lnsl. - # 2. Use each function name only once: can't redo a check because - # autoconf caches the results of the last check and won't redo it. - # 3. Use -lnsl and -lsocket only if they supply procedures that - # aren't already present in the normal libraries. This is because - # IRIX 5.2 has libraries, but they aren't needed and they're - # bogus: they goof up name resolution if used. - # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. - # To get around this problem, check for both libraries together - # if -lsocket doesn't work by itself. - #-------------------------------------------------------------------- - - tcl_checkBoth=0 - AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) - if test "$tcl_checkSocket" = 1; then - AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, - LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) - fi - if test "$tcl_checkBoth" = 1; then - tk_oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) - fi - AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, - [LIBS="$LIBS -lnsl"])]) - - # Don't perform the eval of the libraries here because DL_LIBS - # won't be set until we call TEA_CONFIG_CFLAGS - - TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' - AC_SUBST(TCL_LIBS) - AC_SUBST(MATH_LIBS) -]) - -#-------------------------------------------------------------------- -# TEA_TCL_EARLY_FLAGS -# -# Check for what flags are needed to be passed so the correct OS -# features are available. -# -# Arguments: -# None -# -# Results: -# -# Might define the following vars: -# _ISOC99_SOURCE -# _LARGEFILE64_SOURCE -# _LARGEFILE_SOURCE64 -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_EARLY_FLAG],[ - AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), - AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, - AC_TRY_COMPILE([[#define ]$1[ 1 -]$2], $3, - [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, - [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) - if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then - AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) - tcl_flags="$tcl_flags $1" - fi -]) - -AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ - AC_MSG_CHECKING([for required early compiler flags]) - tcl_flags="" - TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], - [char *p = (char *)strtoll; char *q = (char *)strtoull;]) - TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], - [struct stat64 buf; int i = stat64("/", &buf);]) - TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ], - [char *p = (char *)open64;]) - if test "x${tcl_flags}" = "x" ; then - AC_MSG_RESULT([none]) - else - AC_MSG_RESULT([${tcl_flags}]) - fi -]) - -#-------------------------------------------------------------------- -# TEA_TCL_64BIT_FLAGS -# -# Check for what is defined in the way of 64-bit features. -# -# Arguments: -# None -# -# Results: -# -# Might define the following vars: -# TCL_WIDE_INT_IS_LONG -# TCL_WIDE_INT_TYPE -# HAVE_STRUCT_DIRENT64 -# HAVE_STRUCT_STAT64 -# HAVE_TYPE_OFF64_T -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ - AC_MSG_CHECKING([for 64-bit integer type]) - AC_CACHE_VAL(tcl_cv_type_64bit,[ - tcl_cv_type_64bit=none - # See if the compiler knows natively about __int64 - AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], - tcl_type_64bit=__int64, tcl_type_64bit="long long") - # See if we should use long anyway Note that we substitute in the - # type that is our current guess for a 64-bit type inside this check - # program, so it should be modified only carefully... - AC_TRY_COMPILE(,[switch (0) { - case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; - }],tcl_cv_type_64bit=${tcl_type_64bit})]) - if test "${tcl_cv_type_64bit}" = none ; then - AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) - AC_MSG_RESULT([using long]) - elif test "${tcl_cv_type_64bit}" = "__int64" \ - -a "${TEA_PLATFORM}" = "windows" ; then - # We actually want to use the default tcl.h checks in this - # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* - AC_MSG_RESULT([using Tcl header defaults]) - else - AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, - [What type should be used to define wide integers?]) - AC_MSG_RESULT([${tcl_cv_type_64bit}]) - - # Now check for auxiliary declarations - AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ - AC_TRY_COMPILE([#include -#include ],[struct dirent64 p;], - tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) - if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then - AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) - fi - - AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ - AC_TRY_COMPILE([#include ],[struct stat64 p; -], - tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) - if test "x${tcl_cv_struct_stat64}" = "xyes" ; then - AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) - fi - - AC_CHECK_FUNCS(open64 lseek64) - AC_MSG_CHECKING([for off64_t]) - AC_CACHE_VAL(tcl_cv_type_off64_t,[ - AC_TRY_COMPILE([#include ],[off64_t offset; -], - tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) - dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the - dnl functions lseek64 and open64 are defined. - if test "x${tcl_cv_type_off64_t}" = "xyes" && \ - test "x${ac_cv_func_lseek64}" = "xyes" && \ - test "x${ac_cv_func_open64}" = "xyes" ; then - AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi -]) - -## -## Here ends the standard Tcl configuration bits and starts the -## TEA specific functions -## - -#------------------------------------------------------------------------ -# TEA_INIT -- -# -# Init various Tcl Extension Architecture (TEA) variables. -# This should be the first called TEA_* macro. -# -# Arguments: -# none -# -# Results: -# -# Defines and substs the following vars: -# CYGPATH -# EXEEXT -# Defines only: -# TEA_VERSION -# TEA_INITED -# TEA_PLATFORM (windows or unix) -# -# "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. -# -# EXEEXT -# Select the executable extension based on the host type. This -# is a lightweight replacement for AC_EXEEXT that doesn't require -# a compiler. -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_INIT], [ - # TEA extensions pass this us the version of TEA they think they - # are compatible with. - TEA_VERSION="3.6" - - AC_MSG_CHECKING([for correct TEA configuration]) - if test x"${PACKAGE_NAME}" = x ; then - AC_MSG_ERROR([ -The PACKAGE_NAME variable must be defined by your TEA configure.in]) - fi - if test x"$1" = x ; then - AC_MSG_ERROR([ -TEA version not specified.]) - elif test "$1" != "${TEA_VERSION}" ; then - AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) - else - AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) - fi - case "`uname -s`" in - *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) - AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) - EXEEXT=".exe" - TEA_PLATFORM="windows" - ;; - *) - CYGPATH=echo - EXEEXT="" - TEA_PLATFORM="unix" - ;; - esac - - # Check if exec_prefix is set. If not use fall back to prefix. - # Note when adjusted, so that TEA_PREFIX can correct for this. - # This is needed for recursive configures, since autoconf propagates - # $prefix, but not $exec_prefix (doh!). - if test x$exec_prefix = xNONE ; then - exec_prefix_default=yes - exec_prefix=$prefix - fi - - AC_SUBST(EXEEXT) - AC_SUBST(CYGPATH) - - # This package name must be replaced statically for AC_SUBST to work - AC_SUBST(PKG_LIB_FILE) - # Substitute STUB_LIB_FILE in case package creates a stub library too. - AC_SUBST(PKG_STUB_LIB_FILE) - - # We AC_SUBST these here to ensure they are subst'ed, - # in case the user doesn't call TEA_ADD_... - AC_SUBST(PKG_STUB_SOURCES) - AC_SUBST(PKG_STUB_OBJECTS) - AC_SUBST(PKG_TCL_SOURCES) - AC_SUBST(PKG_HEADERS) - AC_SUBST(PKG_INCLUDES) - AC_SUBST(PKG_LIBS) - AC_SUBST(PKG_CFLAGS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_SOURCES -- -# -# Specify one or more source files. Users should check for -# the right platform before adding to their list. -# It is not important to specify the directory, as long as it is -# in the generic, win or unix subdirectory of $(srcdir). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_SOURCES -# PKG_OBJECTS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_SOURCES], [ - vars="$@" - for i in $vars; do - case $i in - [\$]*) - # allow $-var names - PKG_SOURCES="$PKG_SOURCES $i" - PKG_OBJECTS="$PKG_OBJECTS $i" - ;; - *) - # check for existence - allows for generic/win/unix VPATH - # To add more dirs here (like 'src'), you have to update VPATH - # in Makefile.in as well - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - AC_MSG_ERROR([could not find source file '$i']) - fi - PKG_SOURCES="$PKG_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" - fi - PKG_OBJECTS="$PKG_OBJECTS $j" - ;; - esac - done - AC_SUBST(PKG_SOURCES) - AC_SUBST(PKG_OBJECTS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_STUB_SOURCES -- -# -# Specify one or more source files. Users should check for -# the right platform before adding to their list. -# It is not important to specify the directory, as long as it is -# in the generic, win or unix subdirectory of $(srcdir). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_STUB_SOURCES -# PKG_STUB_OBJECTS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_STUB_SOURCES], [ - vars="$@" - for i in $vars; do - # check for existence - allows for generic/win/unix VPATH - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - AC_MSG_ERROR([could not find stub source file '$i']) - fi - PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" - fi - PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" - done - AC_SUBST(PKG_STUB_SOURCES) - AC_SUBST(PKG_STUB_OBJECTS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_TCL_SOURCES -- -# -# Specify one or more Tcl source files. These should be platform -# independent runtime files. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_TCL_SOURCES -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_TCL_SOURCES], [ - vars="$@" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) - fi - PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" - done - AC_SUBST(PKG_TCL_SOURCES) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_HEADERS -- -# -# Specify one or more source headers. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_HEADERS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_HEADERS], [ - vars="$@" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - AC_MSG_ERROR([could not find header file '${srcdir}/$i']) - fi - PKG_HEADERS="$PKG_HEADERS $i" - done - AC_SUBST(PKG_HEADERS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_INCLUDES -- -# -# Specify one or more include dirs. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_INCLUDES -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_INCLUDES], [ - vars="$@" - for i in $vars; do - PKG_INCLUDES="$PKG_INCLUDES $i" - done - AC_SUBST(PKG_INCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_LIBS -- -# -# Specify one or more libraries. Users should check for -# the right platform before adding to their list. For Windows, -# libraries provided in "foo.lib" format will be converted to -# "-lfoo" when using GCC (mingw). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_LIBS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_LIBS], [ - vars="$@" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - AC_SUBST(PKG_LIBS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_CFLAGS -- -# -# Specify one or more CFLAGS. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_CFLAGS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_CFLAGS], [ - PKG_CFLAGS="$PKG_CFLAGS $@" - AC_SUBST(PKG_CFLAGS) -]) - -#------------------------------------------------------------------------ -# TEA_PREFIX -- -# -# Handle the --prefix=... option by defaulting to what Tcl gave -# -# Arguments: -# none -# -# Results: -# -# If --prefix or --exec-prefix was not specified, $prefix and -# $exec_prefix will be set to the values given to Tcl when it was -# configured. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_PREFIX], [ - if test "${prefix}" = "NONE"; then - prefix_default=yes - if test x"${TCL_PREFIX}" != x; then - AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) - prefix=${TCL_PREFIX} - else - AC_MSG_NOTICE([--prefix defaulting to /usr/local]) - prefix=/usr/local - fi - fi - if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ - -o x"${exec_prefix_default}" = x"yes" ; then - if test x"${TCL_EXEC_PREFIX}" != x; then - AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) - exec_prefix=${TCL_EXEC_PREFIX} - else - AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) - exec_prefix=$prefix - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_SETUP_COMPILER_CC -- -# -# Do compiler checks the way we want. This is just a replacement -# for AC_PROG_CC in TEA configure.in files to make them cleaner. -# -# Arguments: -# none -# -# Results: -# -# Sets up CC var and other standard bits we need to make executables. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_SETUP_COMPILER_CC], [ - # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) - # in this macro, they need to go into TEA_SETUP_COMPILER instead. - - # If the user did not set CFLAGS, set it now to keep - # the AC_PROG_CC macro from adding "-g -O2". - if test "${CFLAGS+set}" != "set" ; then - CFLAGS="" - fi - - AC_PROG_CC - AC_PROG_CPP - - AC_PROG_INSTALL - - #-------------------------------------------------------------------- - # Checks to see if the make program sets the $MAKE variable. - #-------------------------------------------------------------------- - - AC_PROG_MAKE_SET - - #-------------------------------------------------------------------- - # Find ranlib - #-------------------------------------------------------------------- - - AC_PROG_RANLIB - - #-------------------------------------------------------------------- - # Determines the correct binary file extension (.o, .obj, .exe etc.) - #-------------------------------------------------------------------- - - AC_OBJEXT - AC_EXEEXT -]) - -#------------------------------------------------------------------------ -# TEA_SETUP_COMPILER -- -# -# Do compiler checks that use the compiler. This must go after -# TEA_SETUP_COMPILER_CC, which does the actual compiler check. -# -# Arguments: -# none -# -# Results: -# -# Sets up CC var and other standard bits we need to make executables. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_SETUP_COMPILER], [ - # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. - AC_REQUIRE([TEA_SETUP_COMPILER_CC]) - - #------------------------------------------------------------------------ - # If we're using GCC, see if the compiler understands -pipe. If so, use it. - # It makes compiling go faster. (This is only a performance feature.) - #------------------------------------------------------------------------ - - if test -z "$no_pipe" -a -n "$GCC"; then - AC_CACHE_CHECK([if the compiler understands -pipe], - tcl_cv_cc_pipe, [ - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_pipe = yes; then - CFLAGS="$CFLAGS -pipe" - fi - fi - - #-------------------------------------------------------------------- - # Common compiler flag setup - #-------------------------------------------------------------------- - - AC_C_BIGENDIAN - if test "${TEA_PLATFORM}" = "unix" ; then - TEA_TCL_LINK_LIBS - TEA_MISSING_POSIX_HEADERS - # Let the user call this, because if it triggers, they will - # need a compat/strtod.c that is correct. Users can also - # use Tcl_GetDouble(FromObj) instead. - #TEA_BUGGY_STRTOD - fi -]) - -#------------------------------------------------------------------------ -# TEA_MAKE_LIB -- -# -# Generate a line that can be used to build a shared/unshared library -# in a platform independent manner. -# -# Arguments: -# none -# -# Requires: -# -# Results: -# -# Defines the following vars: -# CFLAGS - Done late here to note disturb other AC macros -# MAKE_LIB - Command to execute to build the Tcl library; -# differs depending on whether or not Tcl is being -# compiled as a shared library. -# MAKE_SHARED_LIB Makefile rule for building a shared library -# MAKE_STATIC_LIB Makefile rule for building a static library -# MAKE_STUB_LIB Makefile rule for building a stub library -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_MAKE_LIB], [ - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then - MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" - MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" - else - MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" - MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" - fi - - if test "${SHARED_BUILD}" = "1" ; then - MAKE_LIB="${MAKE_SHARED_LIB} " - else - MAKE_LIB="${MAKE_STATIC_LIB} " - fi - - #-------------------------------------------------------------------- - # Shared libraries and static libraries have different names. - # Use the double eval to make sure any variables in the suffix is - # substituted. (@@@ Might not be necessary anymore) - #-------------------------------------------------------------------- - - if test "${TEA_PLATFORM}" = "windows" ; then - if test "${SHARED_BUILD}" = "1" ; then - # We force the unresolved linking of symbols that are really in - # the private libraries of Tcl and Tk. - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" - fi - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - else - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - if test "$GCC" = "yes"; then - PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} - fi - # These aren't needed on Windows (either MSVC or gcc) - RANLIB=: - RANLIB_STUB=: - else - RANLIB_STUB="${RANLIB}" - if test "${SHARED_BUILD}" = "1" ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" - fi - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - fi - - # These are escaped so that only CFLAGS is picked up at configure time. - # The other values will be substituted at make time. - CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" - if test "${SHARED_BUILD}" = "1" ; then - CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" - fi - - AC_SUBST(MAKE_LIB) - AC_SUBST(MAKE_SHARED_LIB) - AC_SUBST(MAKE_STATIC_LIB) - AC_SUBST(MAKE_STUB_LIB) - AC_SUBST(RANLIB_STUB) -]) - -#------------------------------------------------------------------------ -# TEA_LIB_SPEC -- -# -# Compute the name of an existing object library located in libdir -# from the given base name and produce the appropriate linker flags. -# -# Arguments: -# basename The base name of the library without version -# numbers, extensions, or "lib" prefixes. -# extra_dir Extra directory in which to search for the -# library. This location is used first, then -# $prefix/$exec-prefix, then some defaults. -# -# Requires: -# TEA_INIT and TEA_PREFIX must be called first. -# -# Results: -# -# Defines the following vars: -# ${basename}_LIB_NAME The computed library name. -# ${basename}_LIB_SPEC The computed linker flags. -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LIB_SPEC], [ - AC_MSG_CHECKING([for $1 library]) - - # Look in exec-prefix for the library (defined by TEA_PREFIX). - - tea_lib_name_dir="${exec_prefix}/lib" - - # Or in a user-specified location. - - if test x"$2" != x ; then - tea_extra_lib_dir=$2 - else - tea_extra_lib_dir=NONE - fi - - for i in \ - `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do - if test -f "$i" ; then - tea_lib_name_dir=`dirname $i` - $1_LIB_NAME=`basename $i` - $1_LIB_PATH_NAME=$i - break - fi - done - - if test "${TEA_PLATFORM}" = "windows"; then - $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" - else - # Strip off the leading "lib" and trailing ".a" or ".so" - - tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` - $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" - fi - - if test "x${$1_LIB_NAME}" = x ; then - AC_MSG_ERROR([not found]) - else - AC_MSG_RESULT([${$1_LIB_SPEC}]) - fi -]) - -#------------------------------------------------------------------------ -# TEA_PRIVATE_TCL_HEADERS -- -# -# Locate the private Tcl include files -# -# Arguments: -# -# Requires: -# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has -# already been called. -# -# Results: -# -# Substs the following vars: -# TCL_TOP_DIR_NATIVE -# TCL_GENERIC_DIR_NATIVE -# TCL_UNIX_DIR_NATIVE -# TCL_WIN_DIR_NATIVE -# TCL_BMAP_DIR_NATIVE -# TCL_TOOL_DIR_NATIVE -# TCL_PLATFORM_DIR_NATIVE -# TCL_BIN_DIR_NATIVE -# TCL_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ - AC_MSG_CHECKING([for Tcl private include files]) - - TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` - TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" - TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" - TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" - TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" - TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" - TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" - TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" - - if test "${TEA_PLATFORM}" = "windows"; then - TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} - else - TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} - fi - # We want to ensure these are substituted so as not to require - # any *_NATIVE vars be defined in the Makefile - TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers and PrivateHeaders directories - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then - TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else - TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi - ;; - esac - else - if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then - AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) - fi - fi - - - AC_SUBST(TCL_TOP_DIR_NATIVE) - AC_SUBST(TCL_GENERIC_DIR_NATIVE) - AC_SUBST(TCL_UNIX_DIR_NATIVE) - AC_SUBST(TCL_WIN_DIR_NATIVE) - AC_SUBST(TCL_BMAP_DIR_NATIVE) - AC_SUBST(TCL_TOOL_DIR_NATIVE) - AC_SUBST(TCL_PLATFORM_DIR_NATIVE) - - AC_SUBST(TCL_INCLUDES) - AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) -]) - -#------------------------------------------------------------------------ -# TEA_PUBLIC_TCL_HEADERS -- -# -# Locate the installed public Tcl header files -# -# Arguments: -# None. -# -# Requires: -# CYGPATH must be set -# -# Results: -# -# Adds a --with-tclinclude switch to configure. -# Result is cached. -# -# Substs the following vars: -# TCL_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ - AC_MSG_CHECKING([for Tcl public headers]) - - AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) - - AC_CACHE_VAL(ac_cv_c_tclh, [ - # Use the value from --with-tclinclude, if it was given - - if test x"${with_tclinclude}" != x ; then - if test -f "${with_tclinclude}/tcl.h" ; then - ac_cv_c_tclh=${with_tclinclude} - else - AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) - fi - else - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers directory - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tcl is not installed, - # and in that situation, look there before installed locations. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - if test x"${TCL_INCLUDE_SPEC}" != x ; then - d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` - list="$list `ls -d ${d} 2>/dev/null`" - fi - fi - for i in $list ; do - if test -f "$i/tcl.h" ; then - ac_cv_c_tclh=$i - break - fi - done - fi - ]) - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tclh}" = x ; then - AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) - else - AC_MSG_RESULT([${ac_cv_c_tclh}]) - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` - - TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - AC_SUBST(TCL_INCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_PRIVATE_TK_HEADERS -- -# -# Locate the private Tk include files -# -# Arguments: -# -# Requires: -# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has -# already been called. -# -# Results: -# -# Substs the following vars: -# TK_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ - AC_MSG_CHECKING([for Tk private include files]) - - TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` - TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" - TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" - TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" - TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" - TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" - if test "${TEA_PLATFORM}" = "windows"; then - TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} - else - TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} - fi - # We want to ensure these are substituted so as not to require - # any *_NATIVE vars be defined in the Makefile - TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" - # Detect and add ttk subdir - if test -d ${TK_SRC_DIR_NATIVE}/generic/ttk; then - TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" - fi - if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ - -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" - fi - if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" - fi - if test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use - # the framework's Headers and PrivateHeaders directories - case ${TK_DEFS} in - *TK_FRAMEWORK*) - if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then - TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi - ;; - esac - else - if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then - AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) - fi - fi - - AC_SUBST(TK_TOP_DIR_NATIVE) - AC_SUBST(TK_UNIX_DIR_NATIVE) - AC_SUBST(TK_WIN_DIR_NATIVE) - AC_SUBST(TK_GENERIC_DIR_NATIVE) - AC_SUBST(TK_XLIB_DIR_NATIVE) - AC_SUBST(TK_PLATFORM_DIR_NATIVE) - - AC_SUBST(TK_INCLUDES) - AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) -]) - -#------------------------------------------------------------------------ -# TEA_PUBLIC_TK_HEADERS -- -# -# Locate the installed public Tk header files -# -# Arguments: -# None. -# -# Requires: -# CYGPATH must be set -# -# Results: -# -# Adds a --with-tkinclude switch to configure. -# Result is cached. -# -# Substs the following vars: -# TK_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ - AC_MSG_CHECKING([for Tk public headers]) - - AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) - - AC_CACHE_VAL(ac_cv_c_tkh, [ - # Use the value from --with-tkinclude, if it was given - - if test x"${with_tkinclude}" != x ; then - if test -f "${with_tkinclude}/tk.h" ; then - ac_cv_c_tkh=${with_tkinclude} - else - AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) - fi - else - if test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use - # the framework's Headers directory. - case ${TK_DEFS} in - *TK_FRAMEWORK*) - list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tk is not installed, - # and in that situation, look there before installed locations. - if test -f "${TK_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tk's --prefix location, - # relative to directory of tkConfig.sh, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TK_PREFIX}/include 2>/dev/null` \ - `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - fi - for i in $list ; do - if test -f "$i/tk.h" ; then - ac_cv_c_tkh=$i - break - fi - done - fi - ]) - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tkh}" = x ; then - AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) - else - AC_MSG_RESULT([${ac_cv_c_tkh}]) - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` - - TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - AC_SUBST(TK_INCLUDES) - - if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ - -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - # On Windows and Aqua, we need the X compat headers - AC_MSG_CHECKING([for X11 header files]) - if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then - INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" - TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - AC_SUBST(TK_XINCLUDES) - fi - AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) - fi -]) - -#------------------------------------------------------------------------ -# TEA_PROG_TCLSH -# Determine the fully qualified path name of the tclsh executable -# in the Tcl build directory or the tclsh installed in a bin -# directory. This macro will correctly determine the name -# of the tclsh executable even if tclsh has not yet been -# built in the build directory. The tclsh found is always -# associated with a tclConfig.sh file. This tclsh should be used -# only for running extension test cases. It should never be -# or generation of files (like pkgIndex.tcl) at build time. -# -# Arguments -# none -# -# Results -# Subst's the following values: -# TCLSH_PROG -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PROG_TCLSH], [ - AC_MSG_CHECKING([for tclsh]) - if test -f "${TCL_BIN_DIR}/Makefile" ; then - # tclConfig.sh is in Tcl build directory - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="${TCL_BIN_DIR}/tclsh" - fi - else - # tclConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" - fi - list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${TCLSH_PROG}" ; then - REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" - fi - AC_MSG_RESULT([${TCLSH_PROG}]) - AC_SUBST(TCLSH_PROG) -]) - -#------------------------------------------------------------------------ -# TEA_PROG_WISH -# Determine the fully qualified path name of the wish executable -# in the Tk build directory or the wish installed in a bin -# directory. This macro will correctly determine the name -# of the wish executable even if wish has not yet been -# built in the build directory. The wish found is always -# associated with a tkConfig.sh file. This wish should be used -# only for running extension test cases. It should never be -# or generation of files (like pkgIndex.tcl) at build time. -# -# Arguments -# none -# -# Results -# Subst's the following values: -# WISH_PROG -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PROG_WISH], [ - AC_MSG_CHECKING([for wish]) - if test -f "${TK_BIN_DIR}/Makefile" ; then - # tkConfig.sh is in Tk build directory - if test "${TEA_PLATFORM}" = "windows"; then - WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" - else - WISH_PROG="${TK_BIN_DIR}/wish" - fi - else - # tkConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" - else - WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" - fi - list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TK_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${WISH_PROG}" ; then - REAL_TK_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" - fi - AC_MSG_RESULT([${WISH_PROG}]) - AC_SUBST(WISH_PROG) -]) - -#------------------------------------------------------------------------ -# TEA_PATH_CONFIG -- -# -# Locate the ${1}Config.sh file and perform a sanity check on -# the ${1} compile flags. These are used by packages like -# [incr Tk] that load *Config.sh files from more than Tcl and Tk. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-$1=... -# -# Defines the following vars: -# $1_BIN_DIR Full path to the directory containing -# the $1Config.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_CONFIG], [ - # - # Ok, lets find the $1 configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-$1 - # - - if test x"${no_$1}" = x ; then - # we reset no_$1 in case something fails here - no_$1=true - AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) - AC_MSG_CHECKING([for $1 configuration]) - AC_CACHE_VAL(ac_cv_c_$1config,[ - - # First check to see if --with-$1 was specified. - if test x"${with_$1config}" != x ; then - case ${with_$1config} in - */$1Config.sh ) - if test -f ${with_$1config}; then - AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) - with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` - fi;; - esac - if test -f "${with_$1config}/$1Config.sh" ; then - ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` - else - AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) - fi - fi - - # then check for a private $1 installation - if test x"${ac_cv_c_$1config}" = x ; then - for i in \ - ../$1 \ - `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ../../$1 \ - `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ../../../$1 \ - `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ${srcdir}/../$1 \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ; do - if test -f "$i/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i; pwd)` - break - fi - if test -f "$i/unix/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i/unix; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_$1config}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_$1config}" = x ; then - $1_BIN_DIR="# no $1 configs found" - AC_MSG_WARN([Cannot find $1 configuration definitions]) - exit 0 - else - no_$1= - $1_BIN_DIR=${ac_cv_c_$1config} - AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_CONFIG -- -# -# Load the $1Config.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# $1_BIN_DIR -# -# Results: -# -# Subst the following vars: -# $1_SRC_DIR -# $1_LIB_FILE -# $1_LIB_SPEC -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_CONFIG], [ - AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) - - if test -f "${$1_BIN_DIR}/$1Config.sh" ; then - AC_MSG_RESULT([loading]) - . "${$1_BIN_DIR}/$1Config.sh" - else - AC_MSG_RESULT([file not found]) - fi - - # - # If the $1_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable $1_LIB_SPEC will be set to the value - # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC - # instead of $1_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - # - - if test -f "${$1_BIN_DIR}/Makefile" ; then - AC_MSG_WARN([Found Makefile - using build library specs for $1]) - $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} - $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} - $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} - fi - - AC_SUBST($1_VERSION) - AC_SUBST($1_BIN_DIR) - AC_SUBST($1_SRC_DIR) - - AC_SUBST($1_LIB_FILE) - AC_SUBST($1_LIB_SPEC) - - AC_SUBST($1_STUB_LIB_FILE) - AC_SUBST($1_STUB_LIB_SPEC) - AC_SUBST($1_STUB_LIB_PATH) -]) - -#------------------------------------------------------------------------ -# TEA_PATH_CELIB -- -# -# Locate Keuchel's celib emulation layer for targeting Win/CE -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-celib=... -# -# Defines the following vars: -# CELIB_DIR Full path to the directory containing -# the include and platform lib files -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_CELIB], [ - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-celib - - if test x"${no_celib}" = x ; then - # we reset no_celib in case something fails here - no_celib=true - AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) - AC_MSG_CHECKING([for Windows/CE celib directory]) - AC_CACHE_VAL(ac_cv_c_celibconfig,[ - # First check to see if --with-celibconfig was specified. - if test x"${with_celibconfig}" != x ; then - if test -d "${with_celibconfig}/inc" ; then - ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` - else - AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) - fi - fi - - # then check for a celib library - if test x"${ac_cv_c_celibconfig}" = x ; then - for i in \ - ../celib-palm-3.0 \ - ../celib \ - ../../celib-palm-3.0 \ - ../../celib \ - `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ - ${srcdir}/../celib-palm-3.0 \ - ${srcdir}/../celib \ - `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ - ; do - if test -d "$i/inc" ; then - ac_cv_c_celibconfig=`(cd $i; pwd)` - break - fi - done - fi - ]) - if test x"${ac_cv_c_celibconfig}" = x ; then - AC_MSG_ERROR([Cannot find celib support library directory]) - else - no_celib= - CELIB_DIR=${ac_cv_c_celibconfig} - CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` - AC_MSG_RESULT([found $CELIB_DIR]) - fi - fi -]) - - -# Local Variables: -# mode: autoconf -# End: Index: xotcl/library/xml/TclExpat-1.1/tclexpat.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/tclexpat.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/tclexpat.c (revision 0) @@ -1,1478 +0,0 @@ -/* - * tclexpat.c -- - * - * A Tcl interface to James Clark's expat XML parser - * - * Copyright (c) 1998 Steve Ball, Zveno Pty Ltd - * - * Zveno Pty Ltd makes this software and associated documentation - * available free of charge for any purpose. You may make copies - * of the software but you must include all of this notice on any copy. - * - * Zveno Pty Ltd does not warrant that this software is error free - * or fit for any purpose. Zveno Pty Ltd disclaims any liability for - * all claims, expenses, losses, damages and costs any user may incur - * as a result of using, copying or modifying the software. - * - * $Id: tclexpat.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ - * - */ - -#include -#include -#include -#include "xmlparse.h" - - -/* - * The structure below is used to refer to an expat parser object. - */ - -typedef struct TclExpatInfo { - XML_Parser parser; /* The expat parser structure */ - Tcl_Interp *interp; /* Interpreter for this instance */ - Tcl_Obj *name; /* name of this instance */ - - int final; /* input data complete? */ - - int status; /* application status */ - Tcl_Obj *result; /* application return result */ - - int continueCount; /* reference count for continue */ - - Tcl_Obj *elementstartcommand; /* Script for element start */ - Tcl_Obj *elementendcommand; /* Script for element end */ - Tcl_Obj *datacommand; /* Script for character data */ - Tcl_Obj *picommand; /* Script for processing instruction */ - Tcl_Obj *defaultcommand; /* Script for default data */ - Tcl_Obj *unparsedcommand; /* Script for unparsed entity declaration */ - Tcl_Obj *notationcommand; /* Script for notation declaration */ - Tcl_Obj *externalentitycommand; /* Script for external entity */ - Tcl_Obj *unknownencodingcommand; /* Script for unknown character encoding */ - -} TclExpatInfo; - -/* - * Prototypes for procedures defined later in this file: - */ - -static Tcl_ObjCmdProc TclExpatObjCmd; -static Tcl_ObjCmdProc TclExpatInstanceCmd; -static Tcl_CmdDeleteProc TclExpatDeleteCmd; -static int (TclExpatCreateParser) _ANSI_ARGS_((Tcl_Interp *interp, - TclExpatInfo *expat)); -static void (TclExpatFreeParser) _ANSI_ARGS_((TclExpatInfo *expat)); -static int (TclExpatParse) _ANSI_ARGS_((Tcl_Interp *interp, - TclExpatInfo *expat, - char *data, - size_t len)); -static int (TclExpatConfigure) _ANSI_ARGS_((Tcl_Interp *interp, - TclExpatInfo *expat, - int objc, - Tcl_Obj *CONST objv[])); -static int (TclExpatCget) _ANSI_ARGS_((Tcl_Interp *interp, - TclExpatInfo *expat, - int objc, - Tcl_Obj *CONST objv[])); - -static void * (TclExpatElementStartHandler) _ANSI_ARGS_((void *userdata, - const XML_Char *name, - const XML_Char **atts)); -static void * (TclExpatElementEndHandler) _ANSI_ARGS_((void *userData, - const XML_Char *name)); -static void * (TclExpatCharacterDataHandler) _ANSI_ARGS_((void *userData, - const XML_Char *s, - int len)); -static void * (TclExpatProcessingInstructionHandler) _ANSI_ARGS_((void *userData, - const XML_Char *target, - const XML_Char *data)); -static void * (TclExpatExternalEntityRefHandler) _ANSI_ARGS_((XML_Parser parser, - const XML_Char *openEntityNames, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId)); -static void * (TclExpatDefaultHandler) _ANSI_ARGS_ ((void *userData, - const XML_Char *s, - int len)); -static void * (TclExpatUnparsedDeclHandler) _ANSI_ARGS_ ((void *userData, - const XML_Char *entityname, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName)); -static void * (TclExpatNotationDeclHandler) _ANSI_ARGS_ ((void *userData, - const XML_Char *notationName, - const XML_Char *base, - const XML_Char *systemId, const XML_Char *publicId)); -static int (TclExpatUnknownEncodingHandler) _ANSI_ARGS_ ((void *encodingHandlerData, - const XML_Char *name, - XML_Encoding *info)); - -#if defined(PRE81) - -/* - *---------------------------------------------------------------------------- - * - * Tcl_GetString -- - * - * Compatibility routine for Tcl 8.0 - * - * Results: - * String representation of object.. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -char * -Tcl_GetString (obj) - Tcl_Obj *obj; /* Object to retrieve string from. */ -{ - char *s; - int i; - - s = Tcl_GetStringFromObj(obj, &i); - return s; -} -#endif - -/* - *---------------------------------------------------------------------------- - * - * TclExpat_Init -- - * - * Initialisation routine for loadable module - * - * Results: - * None. - * - * Side effects: - * Defines "expat" command in the interpreter. - * - *---------------------------------------------------------------------------- - */ - -/* this should be done via the stubs ... for the time being - simply export */ -#ifdef VISUAL_CC -DLLEXPORT extern int Xotclexpat_Init(Tcl_Interp * interp); -# define CONST_XOTCL_EXPAT -#else -# if defined(PRE84) -# define CONST_XOTCL_EXPAT -# else -# define CONST_XOTCL_EXPAT CONST84 -# endif -#endif - -extern int -Xotclexpat_Init (interp) - Tcl_Interp *interp; /* Interpreter to initialise. */ -{ -#ifdef USE_TCL_STUBS - if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { - return TCL_ERROR; - } -#ifdef USE_XOTCL_STUBS - if (Xotcl_InitStubs(interp, "1.1", 0) == NULL) { - return TCL_ERROR; - } -#endif -#else - if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) { - return TCL_ERROR; - } -#endif - - - Tcl_PkgProvide(interp, "xotcl::xml::expat", PACKAGE_VERSION); - - Tcl_CreateObjCommand(interp, "expat", TclExpatObjCmd, NULL, NULL); - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatObjCmd -- - * - * Creation command for expat class. - * - * Results: - * The name of the newly created parser instance. - * - * Side effects: - * This creates an expat parser. - * - *---------------------------------------------------------------------------- - */ - -int -TclExpatObjCmd(dummy, interp, objc, objv) - ClientData dummy; - Tcl_Interp *interp; - int objc; - Tcl_Obj *CONST objv[]; -{ - TclExpatInfo *expat; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "name ?args?"); - return TCL_ERROR; - } - - /* - * Create the data structures for this parser. - */ - - if (!(expat = (TclExpatInfo *) ckalloc(sizeof(TclExpatInfo)))) { - ckfree((char*)expat); - Tcl_SetResult(interp, "unable to create parser", NULL); - return TCL_ERROR; - } - expat->interp = interp; - Tcl_IncrRefCount(objv[1]); - expat->name = objv[1]; - - expat->elementstartcommand = NULL; - expat->elementendcommand = NULL; - expat->datacommand = NULL; - expat->picommand = NULL; - expat->defaultcommand = NULL; - expat->unparsedcommand = NULL; - expat->notationcommand = NULL; - expat->externalentitycommand = NULL; - expat->unknownencodingcommand = NULL; - - if (TclExpatCreateParser(interp, expat) != TCL_OK) { - ckfree((char*)expat); - return TCL_ERROR; - } - - /* - * Register a Tcl command for this parser instance. - */ - - Tcl_CreateObjCommand(interp, Tcl_GetString(expat->name), TclExpatInstanceCmd, (ClientData) expat, TclExpatDeleteCmd); - - /* - * Handle configuration options - */ - - if (objc > 2) { - TclExpatConfigure(interp, expat, objc - 2, objv + 2); - } - - Tcl_SetObjResult(interp, expat->name); - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatCreateParser -- - * - * Create the expat parser and initialise (some of) the TclExpatInfo - * structure. - * - * Note that callback commands are not affected by this routine, - * to allow a reset to leave these intact. - * - * Results: - * New parser instance created and initialised. - * - * Side effects: - * Creates an expat parser. - * Modifies TclExpatInfo fields. - * - *---------------------------------------------------------------------------- - */ - -int -TclExpatCreateParser(interp, expat) - Tcl_Interp *interp; - TclExpatInfo *expat; -{ - if (!(expat->parser = XML_ParserCreate(NULL))) { - Tcl_SetResult(interp, "unable to create expat parser", NULL); - return TCL_ERROR; - } - - expat->final = 1; - expat->status = TCL_OK; - expat->result = NULL; - expat->continueCount = 0; - - /* - * Set handlers for the parser to routines in this module. - */ - - XML_SetElementHandler(expat->parser, - (XML_StartElementHandler) TclExpatElementStartHandler, - (XML_EndElementHandler) TclExpatElementEndHandler); - XML_SetCharacterDataHandler(expat->parser, - (XML_CharacterDataHandler) TclExpatCharacterDataHandler); - XML_SetProcessingInstructionHandler(expat->parser, - (XML_ProcessingInstructionHandler) TclExpatProcessingInstructionHandler); - XML_SetDefaultHandler(expat->parser, - (XML_DefaultHandler) TclExpatDefaultHandler); - XML_SetUnparsedEntityDeclHandler(expat->parser, - (XML_UnparsedEntityDeclHandler) TclExpatUnparsedDeclHandler); - XML_SetNotationDeclHandler(expat->parser, - (XML_NotationDeclHandler) TclExpatNotationDeclHandler); - XML_SetExternalEntityRefHandler(expat->parser, - (XML_ExternalEntityRefHandler) TclExpatExternalEntityRefHandler); - XML_SetUnknownEncodingHandler(expat->parser, - (XML_UnknownEncodingHandler) TclExpatUnknownEncodingHandler, - (void *) expat); - XML_SetUserData(expat->parser, - (void *) expat); - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatFreeParser -- - * - * Destroy the expat parser structure. - * - * Results: - * None. - * - * Side effects: - * Frees any memory allocated for the XML parser. - * - *---------------------------------------------------------------------------- - */ - -void -TclExpatFreeParser(expat) - TclExpatInfo *expat; -{ - XML_ParserFree(expat->parser); - expat->parser = NULL; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatInstanceCmd -- - * - * Implements instance command for expat class objects. - * - * Results: - * Depends on the method. - * - * Side effects: - * Depends on the method. - * - *---------------------------------------------------------------------------- - */ - -int -TclExpatInstanceCmd (clientData, interp, objc, objv) - ClientData clientData; - Tcl_Interp *interp; - int objc; - Tcl_Obj *CONST objv[]; -{ - TclExpatInfo *expat = (TclExpatInfo *) clientData; - char *data; - size_t len; - int index, result = TCL_OK; - static char CONST_XOTCL_EXPAT *options[] = { - "configure", "cget", "parse", "reset", NULL - }; - enum options { - EXPAT_CONFIGURE, EXPAT_CGET, EXPAT_PARSE, EXPAT_RESET - }; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "method ?args?"); - return TCL_ERROR; - } - - if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - - switch ((enum options) index) { - case EXPAT_CONFIGURE: - - result = TclExpatConfigure(interp, (TclExpatInfo *) clientData, objc - 2, objv + 2); - break; - - case EXPAT_CGET: - - result = TclExpatCget(interp, (TclExpatInfo *) clientData, objc - 2, objv + 2); - break; - - case EXPAT_PARSE: - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "data"); - return TCL_ERROR; - } - - data = Tcl_GetStringFromObj(objv[2], &len); - - result = TclExpatParse(interp, expat, data, len); - - break; - - case EXPAT_RESET: - - if (objc > 2) { - Tcl_WrongNumArgs(interp, 1, objv, ""); - return TCL_ERROR; - } - - /* - * Destroy the parser and create a fresh one. - */ - - TclExpatFreeParser(expat); - TclExpatCreateParser(interp, expat); - - break; - - default: - - Tcl_SetResult(interp, "unknown method", NULL); - return TCL_ERROR; - - } - - return result; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatParse -- - * - * Wrapper to invoke expat parser and check return result. - * - * Results: - * TCL_OK if no errors, TCL_ERROR otherwise. - * - * Side effects: - * Sets interpreter result as appropriate. - * - *---------------------------------------------------------------------------- - */ - -int -TclExpatParse (interp, expat, data, len) - Tcl_Interp *interp; - TclExpatInfo *expat; - char *data; - size_t len; -{ - int result; - char s[255]; - - expat->status = TCL_OK; - if (expat->result != NULL) { - Tcl_DecrRefCount(expat->result); - } - expat->result = NULL; - - result = XML_Parse(expat->parser, - data, len, - expat->final); - - if (!result) { - Tcl_ResetResult(interp); - sprintf(s, "%d", XML_GetCurrentLineNumber(expat->parser)); - Tcl_AppendResult(interp, "error \"", - XML_ErrorString(XML_GetErrorCode(expat->parser)), - "\" at line ", s, " character ", NULL); - sprintf(s, "%d", XML_GetCurrentColumnNumber(expat->parser)); - Tcl_AppendResult(interp, s, NULL); - - return TCL_ERROR; - } - - switch (expat->status) { - case TCL_OK: - case TCL_BREAK: - case TCL_CONTINUE: - Tcl_ResetResult(interp); - return TCL_OK; - - case TCL_ERROR: - Tcl_SetObjResult(interp, expat->result); - return TCL_ERROR; - - default: - Tcl_SetResult(interp, "unknown parsing status", NULL); - return TCL_ERROR; - } - -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatConfigure -- - * - * Implements instance command for expat class objects. - * - * Results: - * Depends on the method. - * - * Side effects: - * Depends on the method. - * - *---------------------------------------------------------------------------- - */ - -int -TclExpatConfigure (interp, expat, objc, objv) - Tcl_Interp *interp; - TclExpatInfo *expat; - int objc; - Tcl_Obj *CONST objv[]; -{ - static CONST_XOTCL_EXPAT char *switchTable[] = { - "-final", - "-baseurl", - "-elementstartcommand", - "-elementendcommand", - "-characterdatacommand", - "-processinginstructioncommand", - "-defaultcommand", - "-unparsedentitydeclcommand", - "-notationdeclcommand", - "-externalentitycommand", - "-unknownencodingcommand", - (char *) NULL - }; - enum switches { - EXPAT_FINAL, EXPAT_BASE, - EXPAT_ELEMENTSTARTCMD, EXPAT_ELEMENTENDCMD, - EXPAT_DATACMD, EXPAT_PICMD, - EXPAT_DEFAULTCMD, - EXPAT_UNPARSEDENTITYCMD, EXPAT_NOTATIONCMD, - EXPAT_EXTERNALENTITYCMD, EXPAT_UNKNOWNENCODINGCMD - }; - int index, bool, doParse = 0; - Tcl_Obj *CONST *objPtr = objv; - - while (objc > 1) { - if (Tcl_GetIndexFromObj(interp, objPtr[0], switchTable, - "switch", 0, &index) != TCL_OK) { - return TCL_ERROR; - } - switch ((enum switches) index) { - case EXPAT_FINAL: /* -final */ - - if (Tcl_GetBooleanFromObj(interp, objPtr[1], &bool) != TCL_OK) { - return TCL_ERROR; - } - - if (bool && !expat->final) { - - expat->final = bool; - doParse = 1; - - } else if (!bool && expat->final) { - - /* - * Reset the parser for new input - */ - - TclExpatFreeParser(expat); - TclExpatCreateParser(interp, expat); - doParse = 0; - - } - - break; - - case EXPAT_BASE: /* -base */ - - if (XML_SetBase(expat->parser, Tcl_GetString(objPtr[1])) == 0) { - Tcl_SetResult(interp, "unable to set base URL", NULL); - return TCL_ERROR; - } - break; - - case EXPAT_ELEMENTSTARTCMD: /* -elementstartcommand */ - - if (expat->elementstartcommand != NULL) { - Tcl_DecrRefCount(expat->elementstartcommand); - } - - expat->elementstartcommand = objPtr[1]; - Tcl_IncrRefCount(expat->elementstartcommand); - - break; - - case EXPAT_ELEMENTENDCMD: /* -elementendcommand */ - - if (expat->elementendcommand != NULL) { - Tcl_DecrRefCount(expat->elementendcommand); - } - - expat->elementendcommand = objPtr[1]; - Tcl_IncrRefCount(expat->elementendcommand); - - break; - - case EXPAT_DATACMD: /* -characterdatacommand */ - - if (expat->datacommand != NULL) { - Tcl_DecrRefCount(expat->datacommand); - } - - expat->datacommand = objPtr[1]; - Tcl_IncrRefCount(expat->datacommand); - - break; - - case EXPAT_PICMD: /* -processinginstructioncommand */ - - if (expat->picommand != NULL) { - Tcl_DecrRefCount(expat->picommand); - } - - expat->picommand = objPtr[1]; - Tcl_IncrRefCount(expat->picommand); - - break; - - case EXPAT_DEFAULTCMD: /* -defaultcommand */ - - if (expat->defaultcommand != NULL) { - Tcl_DecrRefCount(expat->defaultcommand); - } - - expat->defaultcommand = objPtr[1]; - Tcl_IncrRefCount(expat->defaultcommand); - - break; - - case EXPAT_UNPARSEDENTITYCMD: /* -unparsedentitydeclcommand */ - - if (expat->unparsedcommand != NULL) { - Tcl_DecrRefCount(expat->unparsedcommand); - } - - expat->unparsedcommand = objPtr[1]; - Tcl_IncrRefCount(expat->unparsedcommand); - - break; - - case EXPAT_NOTATIONCMD: /* -notationdeclcommand */ - - if (expat->notationcommand != NULL) { - Tcl_DecrRefCount(expat->notationcommand); - } - - expat->notationcommand = objPtr[1]; - Tcl_IncrRefCount(expat->notationcommand); - - break; - - case EXPAT_EXTERNALENTITYCMD: /* -externalentitycommand */ - - if (expat->externalentitycommand != NULL) { - Tcl_DecrRefCount(expat->externalentitycommand); - } - - expat->externalentitycommand = objPtr[1]; - Tcl_IncrRefCount(expat->externalentitycommand); - - break; - - case EXPAT_UNKNOWNENCODINGCMD: /* -unknownencodingcommand */ - - /* Not implemented */ - break; - - if (expat->unknownencodingcommand != NULL) { - Tcl_DecrRefCount(expat->unknownencodingcommand); - } - - expat->unknownencodingcommand = objPtr[1]; - Tcl_IncrRefCount(expat->unknownencodingcommand); - - break; - - } - - objPtr += 2; - objc -= 2; - - } - - if (doParse) { - return TclExpatParse(interp, expat->parser, "", 0); - } else { - return TCL_OK; - } - -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatCget -- - * - * Returns setting of configuration option. - * Not yet implemented. - * - * Results: - * Option value. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -int -TclExpatCget (interp, expat, objc, objv) - Tcl_Interp *interp; - TclExpatInfo *expat; - int objc; - Tcl_Obj *CONST objv[]; -{ - Tcl_SetResult(interp, "method not implemented", NULL); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatHandlerResult -- - * - * Manage the result of the application callback. - * - * Results: - * None. - * - * Side Effects: - * Further invocation of callback scripts may be inhibited. - * - *---------------------------------------------------------------------------- - */ - -void -TclExpatHandlerResult(expat, result) - TclExpatInfo *expat; - int result; -{ - switch (result) { - case TCL_OK: - expat->status = TCL_OK; - break; - - case TCL_CONTINUE: - /* - * Skip callbacks until the matching end element event - * occurs for the currently open element. - * Keep a reference count to handle nested - * elements. - */ - expat->status = TCL_CONTINUE; - expat->continueCount = 1; - break; - - case TCL_BREAK: - /* - * Skip all further callbacks, but return OK. - */ - expat->status = TCL_BREAK; - break; - - case TCL_ERROR: - /* - * Skip all further callbacks, and return error. - */ - default: - expat->status = TCL_ERROR; - expat->result = Tcl_GetObjResult(expat->interp); - Tcl_IncrRefCount(expat->result); - break; - } -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatElementStartHandler -- - * - * Called by expat for each start tag. - * - * Results: - * None. - * - * Side Effects: - * Callback script is invoked. - * - *---------------------------------------------------------------------------- - */ - -static void * -TclExpatElementStartHandler(userData, name, atts) - void *userData; - const char *name; - const char **atts; -{ - TclExpatInfo *expat = (TclExpatInfo *) userData; - Tcl_Obj *atList, *cmdPtr; - const char **atPtr; - int result; - - if (expat->status == TCL_CONTINUE) { - - /* - * We're currently skipping elements looking for the - * close of the continued element. - */ - - expat->continueCount++; - return NULL; - } - - if (expat->elementstartcommand == NULL || - expat->status != TCL_OK) { - return NULL; - } - - /* - * Convert the attribute list into a Tcl key-value paired list. - */ - - atList = Tcl_NewListObj(0, NULL); - for (atPtr = atts; atPtr[0] && atPtr[1]; atPtr += 2) { - Tcl_ListObjAppendElement(expat->interp, atList, Tcl_NewStringObj((char *)atPtr[0], strlen(atPtr[0]))); - Tcl_ListObjAppendElement(expat->interp, atList, Tcl_NewStringObj((char *)atPtr[1], strlen(atPtr[1]))); - } - - /* - * Take a copy of the callback script so that arguments may be appended. - */ - - cmdPtr = Tcl_DuplicateObj(expat->elementstartcommand); - Tcl_IncrRefCount(cmdPtr); - Tcl_Preserve((ClientData) expat->interp); - - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)name, strlen(name))); - Tcl_ListObjAppendElement(expat->interp, cmdPtr, atList); - - /* - * It would be desirable to be able to terminate parsing - * if the return result is TCL_ERROR or TCL_BREAK. - */ -#if defined(PRE81) - result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); -#elif defined(PRE82) - result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#else - result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif - - Tcl_DecrRefCount(cmdPtr); - Tcl_Release((ClientData) expat->interp); - - TclExpatHandlerResult(expat, result); - - return NULL; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatElementEndHandler -- - * - * Called by expat for each end tag. - * - * Results: - * None. - * - * Side Effects: - * Callback script is invoked. - * - *---------------------------------------------------------------------------- - */ - -static void * -TclExpatElementEndHandler(userData, name) - void *userData; - CONST char *name; -{ - TclExpatInfo *expat = (TclExpatInfo *) userData; - Tcl_Obj *cmdPtr; - int result; - - if (expat->status == TCL_CONTINUE) { - /* - * We're currently skipping elements looking for the - * end of the currently open element. - */ - - if (!--(expat->continueCount)) { - expat->status = TCL_OK; - return NULL; - } - } - - if (expat->elementendcommand == NULL || - expat->status != TCL_OK) { - return NULL; - } - - /* - * Take a copy of the callback script so that arguments may be appended. - */ - - cmdPtr = Tcl_DuplicateObj(expat->elementendcommand); - Tcl_IncrRefCount(cmdPtr); - Tcl_Preserve((ClientData) expat->interp); - - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)name, strlen(name))); - - /* - * It would be desirable to be able to terminate parsing - * if the return result is TCL_ERROR or TCL_BREAK. - */ -#if defined(PRE81) - result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); -#elif defined(PRE82) - result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#else - result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif - - Tcl_DecrRefCount(cmdPtr); - Tcl_Release((ClientData) expat->interp); - - TclExpatHandlerResult(expat, result); - - return NULL; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatCharacterDataHandler -- - * - * Called by expat for character data. - * - * Results: - * None. - * - * Side Effects: - * Callback script is invoked. - * - *---------------------------------------------------------------------------- - */ - -static void * -TclExpatCharacterDataHandler(userData, s, len) - void *userData; - CONST char *s; - int len; -{ - TclExpatInfo *expat = (TclExpatInfo *) userData; - Tcl_Obj *cmdPtr; - int result; - - if (expat->datacommand == NULL || - expat->status != TCL_OK) { - return NULL; - } - - /* - * Take a copy of the callback script so that arguments may be appended. - */ - - cmdPtr = Tcl_DuplicateObj(expat->datacommand); - Tcl_IncrRefCount(cmdPtr); - Tcl_Preserve((ClientData) expat->interp); - - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)s, len)); - - /* - * It would be desirable to be able to terminate parsing - * if the return result is TCL_ERROR or TCL_BREAK. - */ -#if defined(PRE81) - result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); -#elif defined(PRE82) - result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#else - result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif - - Tcl_DecrRefCount(cmdPtr); - Tcl_Release((ClientData) expat->interp); - - TclExpatHandlerResult(expat, result); - - return NULL; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatProcessingInstructionHandler -- - * - * Called by expat for processing instructions. - * - * Results: - * None. - * - * Side Effects: - * Callback script is invoked. - * - *---------------------------------------------------------------------------- - */ - -static void * -TclExpatProcessingInstructionHandler(userData, target, data) - void *userData; - CONST char *target; - CONST char *data; -{ - TclExpatInfo *expat = (TclExpatInfo *) userData; - Tcl_Obj *cmdPtr; - int result; - - if (expat->picommand == NULL || - expat->status != TCL_OK) { - return NULL; - } - - /* - * Take a copy of the callback script so that arguments may be appended. - */ - - cmdPtr = Tcl_DuplicateObj(expat->picommand); - Tcl_IncrRefCount(cmdPtr); - Tcl_Preserve((ClientData) expat->interp); - - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)target, strlen(target))); - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)data, strlen(data))); - - /* - * It would be desirable to be able to terminate parsing - * if the return result is TCL_ERROR or TCL_BREAK. - */ -#if defined(PRE81) - result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); -#elif defined(PRE82) - result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#else - result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif - - Tcl_DecrRefCount(cmdPtr); - Tcl_Release((ClientData) expat->interp); - - TclExpatHandlerResult(expat, result); - - return NULL; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatDefaultHandler -- - * - * Called by expat for processing data which has no other handler. - * - * Results: - * None. - * - * Side Effects: - * Callback script is invoked. - * - *---------------------------------------------------------------------------- - */ - -static void * -TclExpatDefaultHandler(userData, s, len) - void *userData; - CONST char *s; - int len; -{ - TclExpatInfo *expat = (TclExpatInfo *) userData; - Tcl_Obj *cmdPtr; - int result; - - if (expat->defaultcommand == NULL || - expat->status != TCL_OK) { - return NULL; - } - - /* - * Take a copy of the callback script so that arguments may be appended. - */ - - cmdPtr = Tcl_DuplicateObj(expat->defaultcommand); - Tcl_IncrRefCount(cmdPtr); - Tcl_Preserve((ClientData) expat->interp); - - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)s, len)); - - /* - * It would be desirable to be able to terminate parsing - * if the return result is TCL_ERROR or TCL_BREAK. - */ -#if defined(PRE81) - result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); -#elif defined(PRE82) - result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#else - result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif - - Tcl_DecrRefCount(cmdPtr); - Tcl_Release((ClientData) expat->interp); - - TclExpatHandlerResult(expat, result); - - return NULL; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatUnparsedDeclHandler -- - * - * Called by expat for processing an unparsed entity references. - * - * Results: - * None. - * - * Side Effects: - * Callback script is invoked. - * - *---------------------------------------------------------------------------- - */ - -static void * -TclExpatUnparsedDeclHandler(userData, entityname, base, systemId, publicId, notationName) - void *userData; - CONST char *entityname; - CONST char *base; - CONST char *systemId; - CONST char *publicId; - CONST char *notationName; -{ - TclExpatInfo *expat = (TclExpatInfo *) userData; - Tcl_Obj *cmdPtr; - int result; - - if (expat->unparsedcommand == NULL || - expat->status != TCL_OK) { - return NULL; - } - - /* - * Take a copy of the callback script so that arguments may be appended. - */ - - cmdPtr = Tcl_DuplicateObj(expat->unparsedcommand); - Tcl_IncrRefCount(cmdPtr); - Tcl_Preserve((ClientData) expat->interp); - - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)entityname, strlen(entityname))); - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)base, strlen(base))); - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)systemId, strlen(systemId))); - if (publicId == NULL) { - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewListObj(0, NULL)); - } else { - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)publicId, strlen(publicId))); - } - if (notationName == NULL) { - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewListObj(0, NULL)); - } else { - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)notationName, strlen(notationName))); - } - - /* - * It would be desirable to be able to terminate parsing - * if the return result is TCL_ERROR or TCL_BREAK. - */ -#if defined(PRE81) - result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); -#elif defined(PRE82) - result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#else - result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif - - Tcl_DecrRefCount(cmdPtr); - Tcl_Release((ClientData) expat->interp); - - TclExpatHandlerResult(expat, result); - - return NULL; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatNotationDeclHandler -- - * - * Called by expat for processing a notation declaration. - * - * Results: - * None. - * - * Side Effects: - * Callback script is invoked. - * - *---------------------------------------------------------------------------- - */ - -static void * -TclExpatNotationDeclHandler(userData, notationName, base, systemId, publicId) - void *userData; - CONST char *notationName; - CONST char *base; - CONST char *systemId; - CONST char *publicId; -{ - TclExpatInfo *expat = (TclExpatInfo *) userData; - Tcl_Obj *cmdPtr; - int result; - - if (expat->notationcommand == NULL || - expat->status != TCL_OK) { - return NULL; - } - - /* - * Take a copy of the callback script so that arguments may be appended. - */ - - cmdPtr = Tcl_DuplicateObj(expat->notationcommand); - Tcl_IncrRefCount(cmdPtr); - Tcl_Preserve((ClientData) expat->interp); - - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)notationName, strlen(notationName))); - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)base, strlen(base))); - if (systemId == NULL) { - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewListObj(0, NULL)); - } else { - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)systemId, strlen(systemId))); - } - if (publicId == NULL) { - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewListObj(0, NULL)); - } else { - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)publicId, strlen(publicId))); - } - - /* - * It would be desirable to be able to terminate parsing - * if the return result is TCL_ERROR or TCL_BREAK. - */ -#if defined(PRE81) - result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); -#elif defined(PRE82) - result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#else - result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif - - Tcl_DecrRefCount(cmdPtr); - Tcl_Release((ClientData) expat->interp); - - TclExpatHandlerResult(expat, result); - - return NULL; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatUnknownEncodingHandler -- - * - * Called by expat for processing a reference to a character in an - * unknown encoding. - * - * Results: - * None. - * - * Side Effects: - * Callback script is invoked. - * - *---------------------------------------------------------------------------- - */ - -static int -TclExpatUnknownEncodingHandler(encodingHandlerData, name, info) - void *encodingHandlerData; - CONST char *name; - XML_Encoding *info; -{ - TclExpatInfo *expat = (TclExpatInfo *) encodingHandlerData; - Tcl_Obj *cmdPtr; - int result; - - Tcl_SetResult(expat->interp, "not implemented", NULL); - return 0; - - if (expat->unknownencodingcommand == NULL || - expat->status != TCL_OK) { - return 0; - } - - /* - * Take a copy of the callback script so that arguments may be appended. - */ - - cmdPtr = Tcl_DuplicateObj(expat->unknownencodingcommand); - Tcl_IncrRefCount(cmdPtr); - Tcl_Preserve((ClientData) expat->interp); - - /* - * Setup the arguments - */ - - /* - * It would be desirable to be able to terminate parsing - * if the return result is TCL_ERROR or TCL_BREAK. - */ -#if defined(PRE81) - result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); -#elif defined(PRE82) - result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#else - result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif - - Tcl_DecrRefCount(cmdPtr); - Tcl_Release((ClientData) expat->interp); - - TclExpatHandlerResult(expat, result); - - /* - * NOTE: have to decide whether to return 0 or 1 here, - * since Expat is waiting for an answer. - */ - return 0; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatExternalEntityRefHandler -- - * - * Called by expat for processing external entity references. - * - * Results: - * None. - * - * Side Effects: - * Callback script is invoked. - * - *---------------------------------------------------------------------------- - */ - -static void * -TclExpatExternalEntityRefHandler(parser, openEntityNames, base, systemId, publicId) - XML_Parser parser; - CONST char *openEntityNames; - CONST char *base; - CONST char *systemId; - CONST char *publicId; -{ - TclExpatInfo *expat = (TclExpatInfo *) XML_GetUserData(parser); - Tcl_Obj *cmdPtr; - int result; - - if (expat->externalentitycommand == NULL || - expat->status != TCL_OK) { - return NULL; - } - - /* - * Take a copy of the callback script so that arguments may be appended. - */ - - cmdPtr = Tcl_DuplicateObj(expat->externalentitycommand); - Tcl_IncrRefCount(cmdPtr); - Tcl_Preserve((ClientData) expat->interp); - - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)openEntityNames, strlen(openEntityNames))); - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)base, strlen(base))); - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)systemId, strlen(systemId))); - Tcl_ListObjAppendElement(expat->interp, cmdPtr, Tcl_NewStringObj((char *)publicId, strlen(publicId))); - - /* - * It would be desirable to be able to terminate parsing - * if the return result is TCL_ERROR or TCL_BREAK. - */ -#if defined(PRE81) - result = Tcl_GlobalEvalObj(expat->interp, cmdPtr); -#elif defined(PRE82) - result = Tcl_EvalObj(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#else - result = Tcl_EvalObjEx(expat->interp, cmdPtr, TCL_EVAL_GLOBAL); -#endif - - Tcl_DecrRefCount(cmdPtr); - Tcl_Release((ClientData) expat->interp); - - TclExpatHandlerResult(expat, result); - - return NULL; -} - -/* - *---------------------------------------------------------------------------- - * - * TclExpatDeleteCmd -- - * - * Called when a expat parser is deleted. - * - * Results: - * None. - * - * Side Effects: - * Memory structures are freed. - * - *---------------------------------------------------------------------------- - */ - -static void -TclExpatDeleteCmd(clientData) - ClientData clientData; -{ - TclExpatInfo *expat = (TclExpatInfo *) clientData; - - TclExpatFreeParser(expat); - - Tcl_DecrRefCount(expat->name); - - if (expat->elementstartcommand) { - Tcl_DecrRefCount(expat->elementstartcommand); - } - if (expat->elementendcommand) { - Tcl_DecrRefCount(expat->elementendcommand); - } - if (expat->datacommand) { - Tcl_DecrRefCount(expat->datacommand); - } - if (expat->picommand) { - Tcl_DecrRefCount(expat->picommand); - } - if (expat->externalentitycommand) { - Tcl_DecrRefCount(expat->externalentitycommand); - } -} Index: xotcl/library/xml/TclExpat-1.1/test-break.tcl =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/test-break.tcl (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) +++ xotcl/library/xml/TclExpat-1.1/test-break.tcl (revision 0) @@ -1,80 +0,0 @@ -#!/bin/sh -#\ -exec tclsh8.1 "$0" "$@" - -# This tests the function of the break facility - -lappend auto_path [file dirname [info script]] -package require expat - -proc element {tag name {attrs {}}} { - array set at $attrs - if {[info exists at(class)]} { - switch $at(class) { - continue { - return -code continue - } - break { - return -code break - } - error { - return -code error "error condition in XML" - } - } - } -} -proc pi {name args} { - if {$name eq "break"} { - return -code break - } -} -proc pcdata pcdata { - if {[string length [string trim $pcdata]]} { - puts $pcdata - } -} - -set data(test1) { - - -Should see this data -Should not see this data -Should not see this data -} -set data(test2) { - - -Should see this data -Should see this data - Should not see this data - -Should not see this data -} -set data(test3) { - - -Should see this data -Should see this data - -Should not see this data -} - -set parser [expat xmlparser \ - -elementstartcommand {element start} \ - -elementendcommand {element end} \ - -characterdatacommand pcdata \ - -processinginstructioncommand pi \ - -final yes \ -] - -foreach {testName testData} [array get data] { - puts "*** $testName" - $parser reset - if {[catch {$parser parse $testData} err]} { - puts [list test failed due to $err] - } else { - puts [list test passed] - } -} - -exit 0 \ No newline at end of file Index: xotcl/library/xml/TclExpat-1.1/test-continue.tcl =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/test-continue.tcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/test-continue.tcl (revision 0) @@ -1,85 +0,0 @@ -#!/bin/sh -#\ -exec tclsh8.1 "$0" "$@" - -# This tests the function of the continue facility - -lappend auto_path [file dirname [info script]] -package require expat - -proc element {tag name {attrs {}}} { - array set at $attrs - if {[info exists at(class)]} { - switch $at(class) { - continue { - return -code continue - } - break { - return -code break - } - error { - return -code error "error condition in XML" - } - } - } -} -proc pi {name args} { - if {[regexp {continue|break|error} $name]} { - return -code $name - } -} -proc pcdata pcdata { - if {[string length [string trim $pcdata]]} { - puts $pcdata - } -} - -set data(test1) { - - -Should see this data -Should not see this data -Should see this data -} -set data(test2) { - - -Should see this data -Should see this data - Should not see this data -Should see this data - -Should see this data -} -set data(test3) { - - -Should see this data -Should not see this data - Should not see this data - - Should not see this data - - Should not see this data - -Should see this data -} - -set parser [expat xmlparser \ - -elementstartcommand {element start} \ - -elementendcommand {element end} \ - -characterdatacommand pcdata \ - -final yes \ -] - -foreach {testName testData} [array get data] { - puts "*** $testName" - $parser reset - if {[catch {$parser parse $testData} err]} { - puts [list test failed due to $err] - } else { - puts [list test passed] - } -} - -exit 0 \ No newline at end of file Index: xotcl/library/xml/TclExpat-1.1/test-error.tcl =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/test-error.tcl (revision bb3c756fb47517596b9dbcb4e580aa1212827b41) +++ xotcl/library/xml/TclExpat-1.1/test-error.tcl (revision 0) @@ -1,58 +0,0 @@ -#!/bin/sh -#\ -exec tclsh8.1 "$0" "$@" - -# This tests the function of the error facility - -lappend auto_path [file dirname [info script]] -package require expat - -proc element {tag name {attrs {}}} { - array set at $attrs - if {[info exists at(class)]} { - switch $at(class) { - continue { - return -code continue - } - break { - return -code break - } - error { - return -code error "error condition in XML" - } - } - } -} -proc pcdata pcdata { - if {[string length [string trim $pcdata]]} { - puts $pcdata - } -} - -set data(error) { - - -Should see this data -Should not see this data -Should not see this data -} - -set parser [expat xmlparser \ - -elementstartcommand {element start} \ - -elementendcommand {element end} \ - -characterdatacommand pcdata \ - -final yes \ -] - -puts {*** Test error} -if {[catch {$parser parse $data(error)} err]} { - if {$err ne "error condition in XML" } { - puts [list test failed, incorrect error message: $err] - } else { - puts [list test passed] - } -} else { - puts [list test failed, no error returned] -} - -exit 0 \ No newline at end of file Index: xotcl/library/xml/TclExpat-1.1/tester =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/tester (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/tester (revision 0) @@ -1,34 +0,0 @@ -#!/bin/sh -#\ -exec tclsh8.1 "$0" "$@" - -#load ./tclexpat.sl Tclexpat -#load ./tclexpat.so Tclexpat -lappend auto_path [file dirname [info script]] -package require expat - -proc element {tag name {attrs {}}} { - puts [list Element $tag $name $attrs] -} -proc pcdata pcdata { - puts [list Character data: $pcdata] -} - -set ch [open [lindex $argv 0]] -set data [read $ch] -close $ch - -puts stderr [list creating parser] - -set parser [expat xmlparser \ - -elementstartcommand {element start} \ - -elementendcommand {element end} \ - -characterdatacommand pcdata \ - -final yes \ -] - -puts stderr [list parsing document] - -$parser parse $data - -exit 0 \ No newline at end of file Index: xotcl/library/xml/TclExpat-1.1/unixfilemap.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/unixfilemap.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/unixfilemap.c (revision 0) @@ -1,72 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#include -#include -#include -#include -#include -#include -#include - -#ifndef MAP_FILE -#define MAP_FILE 0 -#endif - -#include "filemap.h" - -int filemap(const char *name, - void (*processor)(const void *, size_t, const char *, void *arg), - void *arg) -{ - int fd; - size_t nbytes; - struct stat sb; - void *p; - - fd = open(name, O_RDONLY); - if (fd < 0) { - perror(name); - return 0; - } - if (fstat(fd, &sb) < 0) { - perror(name); - close(fd); - return 0; - } - if (!S_ISREG(sb.st_mode)) { - close(fd); - fprintf(stderr, "%s: not a regular file\n", name); - return 0; - } - - nbytes = sb.st_size; - p = (void *)mmap((caddr_t)0, (size_t)nbytes, PROT_READ, - MAP_FILE|MAP_PRIVATE, fd, (off_t)0); - if (p == (void *)-1) { - perror(name); - close(fd); - return 0; - } - processor(p, nbytes, name, arg); - munmap((caddr_t)p, nbytes); - close(fd); - return 1; -} Index: xotcl/library/xml/TclExpat-1.1/utf8tab.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/utf8tab.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/utf8tab.h (revision 0) @@ -1,53 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - - -/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, -/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, Index: xotcl/library/xml/TclExpat-1.1/win32filemap.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/win32filemap.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/win32filemap.c (revision 0) @@ -1,102 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#define STRICT 1 -#ifdef XML_UNICODE -#define UNICODE -#define _UNICODE -#endif /* XML_UNICODE */ -#include -#include -#include -#include "filemap.h" - -static void win32perror(const TCHAR *); - -int filemap(const TCHAR *name, - void (*processor)(const void *, size_t, const TCHAR *, void *arg), - void *arg) -{ - HANDLE f; - HANDLE m; - DWORD size; - DWORD sizeHi; - void *p; - - f = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, - FILE_FLAG_SEQUENTIAL_SCAN, NULL); - if (f == INVALID_HANDLE_VALUE) { - win32perror(name); - return 0; - } - size = GetFileSize(f, &sizeHi); - if (size == (DWORD)-1) { - win32perror(name); - return 0; - } - if (sizeHi) { - _ftprintf(stderr, _T("%s: bigger than 2Gb\n"), name); - return 0; - } - /* CreateFileMapping barfs on zero length files */ - if (size == 0) { - static const char c = '\0'; - processor(&c, 0, name, arg); - CloseHandle(f); - return 1; - } - m = CreateFileMapping(f, NULL, PAGE_READONLY, 0, 0, NULL); - if (m == NULL) { - win32perror(name); - CloseHandle(f); - return 0; - } - p = MapViewOfFile(m, FILE_MAP_READ, 0, 0, 0); - if (p == NULL) { - win32perror(name); - CloseHandle(m); - CloseHandle(f); - return 0; - } - processor(p, size, name, arg); - UnmapViewOfFile(p); - CloseHandle(m); - CloseHandle(f); - return 1; -} - -static -void win32perror(const TCHAR *s) -{ - LPVOID buf; - if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &buf, - 0, - NULL)) { - _ftprintf(stderr, _T("%s: %s"), s, buf); - fflush(stderr); - LocalFree(buf); - } - else - _ftprintf(stderr, _T("%s: unknown Windows error\n"), s); -} Index: xotcl/library/xml/TclExpat-1.1/xmldef.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/xmldef.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/xmldef.h (revision 0) @@ -1,32 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -/* This file can be used for any definitions needed in -particular environments. */ - -#ifdef MOZILLA - -#include "nspr.h" -#define malloc(x) PR_Calloc(1,(x)) -#define calloc(x, y) PR_Calloc((x),(y)) -#define free(x) PR_Free(x) -#define int int32 - -#endif /* MOZILLA */ Index: xotcl/library/xml/TclExpat-1.1/xmlparse.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/xmlparse.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/xmlparse.c (revision 0) @@ -1,2572 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#include -#include -#include - -#include "xmldef.h" - -#ifdef XML_UNICODE -#define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX -#define XmlConvert XmlUtf16Convert -#define XmlGetInternalEncoding XmlGetUtf16InternalEncoding -#define XmlEncode XmlUtf16Encode -#define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((unsigned long)s) & 1)) -typedef unsigned short ICHAR; -#else -#define XML_ENCODE_MAX XML_UTF8_ENCODE_MAX -#define XmlConvert XmlUtf8Convert -#define XmlGetInternalEncoding XmlGetUtf8InternalEncoding -#define XmlEncode XmlUtf8Encode -#define MUST_CONVERT(enc, s) (!(enc)->isUtf8) -typedef char ICHAR; -#endif - -#ifdef XML_UNICODE_WCHAR_T -#define XML_T(x) L ## x -#else -#define XML_T(x) x -#endif - -/* Round up n to be a multiple of sz, where sz is a power of 2. */ -#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1)) - -#include "xmlparse.h" -#include "xmltok.h" -#include "xmlrole.h" -#include "hashtable.h" - -#define INIT_TAG_BUF_SIZE 32 /* must be a multiple of sizeof(XML_Char) */ -#define INIT_DATA_BUF_SIZE 1024 -#define INIT_ATTS_SIZE 16 -#define INIT_BLOCK_SIZE 1024 -#define INIT_BUFFER_SIZE 1024 - -typedef struct tag { - struct tag *parent; - const char *rawName; - size_t rawNameLength; - const XML_Char *name; - char *buf; - char *bufEnd; -} TAG; - -typedef struct { - const XML_Char *name; - const XML_Char *textPtr; - int textLen; - const XML_Char *systemId; - const XML_Char *base; - const XML_Char *publicId; - const XML_Char *notation; - char open; -} ENTITY; - -typedef struct block { - struct block *next; - int size; - XML_Char s[1]; -} BLOCK; - -typedef struct { - BLOCK *blocks; - BLOCK *freeBlocks; - const XML_Char *end; - XML_Char *ptr; - XML_Char *start; -} STRING_POOL; - -/* The XML_Char before the name is used to determine whether -an attribute has been specified. */ -typedef struct { - XML_Char *name; - char maybeTokenized; -} ATTRIBUTE_ID; - -typedef struct { - const ATTRIBUTE_ID *id; - char isCdata; - const XML_Char *value; -} DEFAULT_ATTRIBUTE; - -typedef struct { - const XML_Char *name; - int nDefaultAtts; - int allocDefaultAtts; - DEFAULT_ATTRIBUTE *defaultAtts; -} ELEMENT_TYPE; - -typedef struct { - HASH_TABLE generalEntities; - HASH_TABLE elementTypes; - HASH_TABLE attributeIds; - STRING_POOL pool; - int complete; - int standalone; - const XML_Char *base; -} DTD; - -typedef enum XML_Error Processor(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr); - -static Processor prologProcessor; -static Processor prologInitProcessor; -static Processor contentProcessor; -static Processor cdataSectionProcessor; -static Processor epilogProcessor; -static Processor errorProcessor; -static Processor externalEntityInitProcessor; -static Processor externalEntityInitProcessor2; -static Processor externalEntityInitProcessor3; -static Processor externalEntityContentProcessor; - -static enum XML_Error -handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName); -static enum XML_Error -processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *, const char *); -static enum XML_Error -initializeEncoding(XML_Parser parser); -static enum XML_Error -doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, - const char *start, const char *end, const char **endPtr); -static enum XML_Error -doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr); -static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *, const XML_Char *tagName, const char *s); -static int -defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, int isCdata, const XML_Char *dfltValue); -static enum XML_Error -storeAttributeValue(XML_Parser parser, const ENCODING *, int isCdata, const char *, const char *, - STRING_POOL *); -static enum XML_Error -appendAttributeValue(XML_Parser parser, const ENCODING *, int isCdata, const char *, const char *, - STRING_POOL *); -static ATTRIBUTE_ID * -getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); -static enum XML_Error -storeEntityValue(XML_Parser parser, const char *start, const char *end); -static int -reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); -static void -reportDefault(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); - -static const XML_Char *getOpenEntityNames(XML_Parser parser); -static int setOpenEntityNames(XML_Parser parser, const XML_Char *openEntityNames); -static void normalizePublicId(XML_Char *s); -static int dtdInit(DTD *); -static void dtdDestroy(DTD *); -static int dtdCopy(DTD *newDtd, const DTD *oldDtd); -static void poolInit(STRING_POOL *); -static void poolClear(STRING_POOL *); -static void poolDestroy(STRING_POOL *); -static XML_Char *poolAppend(STRING_POOL *pool, const ENCODING *enc, - const char *ptr, const char *end); -static XML_Char *poolStoreString(STRING_POOL *pool, const ENCODING *enc, - const char *ptr, const char *end); -static int poolGrow(STRING_POOL *pool); -static const XML_Char *poolCopyString(STRING_POOL *pool, const XML_Char *s); -static const XML_Char *poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n); - -#define poolStart(pool) ((pool)->start) -#define poolEnd(pool) ((pool)->ptr) -#define poolLength(pool) ((pool)->ptr - (pool)->start) -#define poolChop(pool) ((void)--(pool->ptr)) -#define poolLastChar(pool) (((pool)->ptr)[-1]) -#define poolDiscard(pool) ((pool)->ptr = (pool)->start) -#define poolFinish(pool) ((pool)->start = (pool)->ptr) -#define poolAppendChar(pool, c) \ - (((pool)->ptr == (pool)->end && !poolGrow(pool)) \ - ? 0 \ - : ((*((pool)->ptr)++ = c), 1)) - -typedef struct { - /* The first member must be userData so that the XML_GetUserData macro works. */ - void *userData; - void *handlerArg; - char *buffer; - /* first character to be parsed */ - const char *bufferPtr; - /* past last character to be parsed */ - char *bufferEnd; - /* allocated end of buffer */ - const char *bufferLim; - long parseEndByteIndex; - const char *parseEndPtr; - XML_Char *dataBuf; - XML_Char *dataBufEnd; - XML_StartElementHandler startElementHandler; - XML_EndElementHandler endElementHandler; - XML_CharacterDataHandler characterDataHandler; - XML_ProcessingInstructionHandler processingInstructionHandler; - XML_DefaultHandler defaultHandler; - XML_UnparsedEntityDeclHandler unparsedEntityDeclHandler; - XML_NotationDeclHandler notationDeclHandler; - XML_ExternalEntityRefHandler externalEntityRefHandler; - XML_UnknownEncodingHandler unknownEncodingHandler; - const ENCODING *encoding; - INIT_ENCODING initEncoding; - const XML_Char *protocolEncodingName; - void *unknownEncodingMem; - void *unknownEncodingData; - void *unknownEncodingHandlerData; - void (*unknownEncodingRelease)(void *); - PROLOG_STATE prologState; - Processor *processor; - enum XML_Error errorCode; - const char *eventPtr; - const char *eventEndPtr; - const char *positionPtr; - int tagLevel; - ENTITY *declEntity; - const XML_Char *declNotationName; - const XML_Char *declNotationPublicId; - ELEMENT_TYPE *declElementType; - ATTRIBUTE_ID *declAttributeId; - char declAttributeIsCdata; - DTD dtd; - TAG *tagStack; - TAG *freeTagList; - int attsSize; - ATTRIBUTE *atts; - POSITION position; - STRING_POOL tempPool; - STRING_POOL temp2Pool; - char *groupConnector; - unsigned groupSize; - int hadExternalDoctype; -} Parser; - -#define userData (((Parser *)parser)->userData) -#define handlerArg (((Parser *)parser)->handlerArg) -#define startElementHandler (((Parser *)parser)->startElementHandler) -#define endElementHandler (((Parser *)parser)->endElementHandler) -#define characterDataHandler (((Parser *)parser)->characterDataHandler) -#define processingInstructionHandler (((Parser *)parser)->processingInstructionHandler) -#define defaultHandler (((Parser *)parser)->defaultHandler) -#define unparsedEntityDeclHandler (((Parser *)parser)->unparsedEntityDeclHandler) -#define notationDeclHandler (((Parser *)parser)->notationDeclHandler) -#define externalEntityRefHandler (((Parser *)parser)->externalEntityRefHandler) -#define unknownEncodingHandler (((Parser *)parser)->unknownEncodingHandler) -#define encoding (((Parser *)parser)->encoding) -#define initEncoding (((Parser *)parser)->initEncoding) -#define unknownEncodingMem (((Parser *)parser)->unknownEncodingMem) -#define unknownEncodingData (((Parser *)parser)->unknownEncodingData) -#define unknownEncodingHandlerData \ - (((Parser *)parser)->unknownEncodingHandlerData) -#define unknownEncodingRelease (((Parser *)parser)->unknownEncodingRelease) -#define protocolEncodingName (((Parser *)parser)->protocolEncodingName) -#define prologState (((Parser *)parser)->prologState) -#define processor (((Parser *)parser)->processor) -#define errorCode (((Parser *)parser)->errorCode) -#define eventPtr (((Parser *)parser)->eventPtr) -#define eventEndPtr (((Parser *)parser)->eventEndPtr) -#define positionPtr (((Parser *)parser)->positionPtr) -#define position (((Parser *)parser)->position) -#define tagLevel (((Parser *)parser)->tagLevel) -#define buffer (((Parser *)parser)->buffer) -#define bufferPtr (((Parser *)parser)->bufferPtr) -#define bufferEnd (((Parser *)parser)->bufferEnd) -#define parseEndByteIndex (((Parser *)parser)->parseEndByteIndex) -#define parseEndPtr (((Parser *)parser)->parseEndPtr) -#define bufferLim (((Parser *)parser)->bufferLim) -#define dataBuf (((Parser *)parser)->dataBuf) -#define dataBufEnd (((Parser *)parser)->dataBufEnd) -#define dtd (((Parser *)parser)->dtd) -#define declEntity (((Parser *)parser)->declEntity) -#define declNotationName (((Parser *)parser)->declNotationName) -#define declNotationPublicId (((Parser *)parser)->declNotationPublicId) -#define declElementType (((Parser *)parser)->declElementType) -#define declAttributeId (((Parser *)parser)->declAttributeId) -#define declAttributeIsCdata (((Parser *)parser)->declAttributeIsCdata) -#define freeTagList (((Parser *)parser)->freeTagList) -#define tagStack (((Parser *)parser)->tagStack) -#define atts (((Parser *)parser)->atts) -#define attsSize (((Parser *)parser)->attsSize) -#define tempPool (((Parser *)parser)->tempPool) -#define temp2Pool (((Parser *)parser)->temp2Pool) -#define groupConnector (((Parser *)parser)->groupConnector) -#define groupSize (((Parser *)parser)->groupSize) -#define hadExternalDoctype (((Parser *)parser)->hadExternalDoctype) - -XML_Parser XML_ParserCreate(const XML_Char *encodingName) -{ - XML_Parser parser = malloc(sizeof(Parser)); - if (!parser) - return parser; - processor = prologInitProcessor; - XmlPrologStateInit(&prologState); - userData = 0; - handlerArg = 0; - startElementHandler = 0; - endElementHandler = 0; - characterDataHandler = 0; - processingInstructionHandler = 0; - defaultHandler = 0; - unparsedEntityDeclHandler = 0; - notationDeclHandler = 0; - externalEntityRefHandler = 0; - unknownEncodingHandler = 0; - buffer = 0; - bufferPtr = 0; - bufferEnd = 0; - parseEndByteIndex = 0; - parseEndPtr = 0; - bufferLim = 0; - declElementType = 0; - declAttributeId = 0; - declEntity = 0; - declNotationName = 0; - declNotationPublicId = 0; - memset(&position, 0, sizeof(POSITION)); - errorCode = XML_ERROR_NONE; - eventPtr = 0; - eventEndPtr = 0; - positionPtr = 0; - tagLevel = 0; - tagStack = 0; - freeTagList = 0; - attsSize = INIT_ATTS_SIZE; - atts = malloc(attsSize * sizeof(ATTRIBUTE)); - dataBuf = malloc(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); - groupSize = 0; - groupConnector = 0; - hadExternalDoctype = 0; - unknownEncodingMem = 0; - unknownEncodingRelease = 0; - unknownEncodingData = 0; - unknownEncodingHandlerData = 0; - poolInit(&tempPool); - poolInit(&temp2Pool); - protocolEncodingName = encodingName ? poolCopyString(&tempPool, encodingName) : 0; - if (!dtdInit(&dtd) || !atts || !dataBuf - || (encodingName && !protocolEncodingName)) { - XML_ParserFree(parser); - return 0; - } - dataBufEnd = dataBuf + INIT_DATA_BUF_SIZE; - XmlInitEncoding(&initEncoding, &encoding, 0); - return parser; -} - -XML_Parser XML_ExternalEntityParserCreate(XML_Parser oldParser, - const XML_Char *openEntityNames, - const XML_Char *encodingName) -{ - XML_Parser parser = oldParser; - DTD *oldDtd = &dtd; - XML_StartElementHandler oldStartElementHandler = startElementHandler; - XML_EndElementHandler oldEndElementHandler = endElementHandler; - XML_CharacterDataHandler oldCharacterDataHandler = characterDataHandler; - XML_ProcessingInstructionHandler oldProcessingInstructionHandler = processingInstructionHandler; - XML_DefaultHandler oldDefaultHandler = defaultHandler; - XML_ExternalEntityRefHandler oldExternalEntityRefHandler = externalEntityRefHandler; - XML_UnknownEncodingHandler oldUnknownEncodingHandler = unknownEncodingHandler; - void *oldUserData = userData; - void *oldHandlerArg = handlerArg; - - parser = XML_ParserCreate(encodingName); - if (!parser) - return 0; - startElementHandler = oldStartElementHandler; - endElementHandler = oldEndElementHandler; - characterDataHandler = oldCharacterDataHandler; - processingInstructionHandler = oldProcessingInstructionHandler; - defaultHandler = oldDefaultHandler; - externalEntityRefHandler = oldExternalEntityRefHandler; - unknownEncodingHandler = oldUnknownEncodingHandler; - userData = oldUserData; - if (oldUserData == oldHandlerArg) - handlerArg = userData; - else - handlerArg = parser; - if (!dtdCopy(&dtd, oldDtd) || !setOpenEntityNames(parser, openEntityNames)) { - XML_ParserFree(parser); - return 0; - } - processor = externalEntityInitProcessor; - return parser; -} - -void XML_ParserFree(XML_Parser parser) -{ - for (;;) { - TAG *p; - if (tagStack == 0) { - if (freeTagList == 0) - break; - tagStack = freeTagList; - freeTagList = 0; - } - p = tagStack; - tagStack = tagStack->parent; - free(p->buf); - free(p); - } - poolDestroy(&tempPool); - poolDestroy(&temp2Pool); - dtdDestroy(&dtd); - free((void *)atts); - free(groupConnector); - free(buffer); - free(dataBuf); - free(unknownEncodingMem); - if (unknownEncodingRelease) - unknownEncodingRelease(unknownEncodingData); - free(parser); -} - -void XML_UseParserAsHandlerArg(XML_Parser parser) -{ - handlerArg = parser; -} - -void XML_SetUserData(XML_Parser parser, void *p) -{ - if (handlerArg == userData) - handlerArg = userData = p; - else - userData = p; -} - -int XML_SetBase(XML_Parser parser, const XML_Char *p) -{ - if (p) { - p = poolCopyString(&dtd.pool, p); - if (!p) - return 0; - dtd.base = p; - } - else - dtd.base = 0; - return 1; -} - -const XML_Char *XML_GetBase(XML_Parser parser) -{ - return dtd.base; -} - -void XML_SetElementHandler(XML_Parser parser, - XML_StartElementHandler start, - XML_EndElementHandler end) -{ - startElementHandler = start; - endElementHandler = end; -} - -void XML_SetCharacterDataHandler(XML_Parser parser, - XML_CharacterDataHandler handler) -{ - characterDataHandler = handler; -} - -void XML_SetProcessingInstructionHandler(XML_Parser parser, - XML_ProcessingInstructionHandler handler) -{ - processingInstructionHandler = handler; -} - -void XML_SetDefaultHandler(XML_Parser parser, - XML_DefaultHandler handler) -{ - defaultHandler = handler; -} - -void XML_SetUnparsedEntityDeclHandler(XML_Parser parser, - XML_UnparsedEntityDeclHandler handler) -{ - unparsedEntityDeclHandler = handler; -} - -void XML_SetNotationDeclHandler(XML_Parser parser, - XML_NotationDeclHandler handler) -{ - notationDeclHandler = handler; -} - -void XML_SetExternalEntityRefHandler(XML_Parser parser, - XML_ExternalEntityRefHandler handler) -{ - externalEntityRefHandler = handler; -} - -void XML_SetUnknownEncodingHandler(XML_Parser parser, - XML_UnknownEncodingHandler handler, - void *data) -{ - unknownEncodingHandler = handler; - unknownEncodingHandlerData = data; -} - -int XML_Parse(XML_Parser parser, const char *s, size_t len, int isFinal) -{ - if (len == 0) { - if (!isFinal) - return 1; - errorCode = processor(parser, bufferPtr, parseEndPtr = bufferEnd, 0); - if (errorCode == XML_ERROR_NONE) - return 1; - eventEndPtr = eventPtr; - return 0; - } - else if (bufferPtr == bufferEnd) { - const char *end; - size_t nLeftOver; - parseEndByteIndex += len; - positionPtr = s; - if (isFinal) { - errorCode = processor(parser, s, parseEndPtr = s + len, 0); - if (errorCode == XML_ERROR_NONE) - return 1; - eventEndPtr = eventPtr; - return 0; - } - errorCode = processor(parser, s, parseEndPtr = s + len, &end); - if (errorCode != XML_ERROR_NONE) { - eventEndPtr = eventPtr; - return 0; - } - XmlUpdatePosition(encoding, positionPtr, end, &position); - nLeftOver = s + len - end; - if (nLeftOver) { - if (buffer == 0 || nLeftOver > bufferLim - buffer) { - /* FIXME avoid integer overflow */ - buffer = buffer == 0 ? malloc(len * 2) : realloc(buffer, len * 2); - if (!buffer) { - errorCode = XML_ERROR_NO_MEMORY; - eventPtr = eventEndPtr = 0; - return 0; - } - bufferLim = buffer + len * 2; - } - memcpy(buffer, end, nLeftOver); - bufferPtr = buffer; - bufferEnd = buffer + nLeftOver; - } - return 1; - } - else { - memcpy(XML_GetBuffer(parser, len), s, len); - return XML_ParseBuffer(parser, len, isFinal); - } -} - -int XML_ParseBuffer(XML_Parser parser, size_t len, int isFinal) -{ - const char *start = bufferPtr; - positionPtr = start; - bufferEnd += len; - parseEndByteIndex += len; - errorCode = processor(parser, start, parseEndPtr = bufferEnd, - isFinal ? (const char **)0 : &bufferPtr); - if (errorCode == XML_ERROR_NONE) { - if (!isFinal) - XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position); - return 1; - } - else { - eventEndPtr = eventPtr; - return 0; - } -} - -void *XML_GetBuffer(XML_Parser parser, size_t len) -{ - if (len > bufferLim - bufferEnd) { - /* FIXME avoid integer overflow */ - size_t neededSize = len + (bufferEnd - bufferPtr); - if (neededSize <= bufferLim - buffer) { - memmove(buffer, bufferPtr, (size_t)(bufferEnd - bufferPtr)); - bufferEnd = buffer + (bufferEnd - bufferPtr); - bufferPtr = buffer; - } - else { - char *newBuf; - size_t bufferSize = bufferLim - bufferPtr; - if (bufferSize == 0) - bufferSize = INIT_BUFFER_SIZE; - do { - bufferSize *= 2; - } while (bufferSize < neededSize); - newBuf = malloc(bufferSize); - if (newBuf == 0) { - errorCode = XML_ERROR_NO_MEMORY; - return 0; - } - bufferLim = newBuf + bufferSize; - if (bufferPtr) { - memcpy(newBuf, bufferPtr, (size_t)(bufferEnd - bufferPtr)); - free(buffer); - } - bufferEnd = newBuf + (bufferEnd - bufferPtr); - bufferPtr = buffer = newBuf; - } - } - return bufferEnd; -} - -enum XML_Error XML_GetErrorCode(XML_Parser parser) -{ - return errorCode; -} - -long XML_GetCurrentByteIndex(XML_Parser parser) -{ - if (eventPtr) - return parseEndByteIndex - (parseEndPtr - eventPtr); - return -1; -} - -int XML_GetCurrentLineNumber(XML_Parser parser) -{ - if (eventPtr) { - XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); - positionPtr = eventPtr; - } - return position.lineNumber + 1; -} - -int XML_GetCurrentColumnNumber(XML_Parser parser) -{ - if (eventPtr) { - XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); - positionPtr = eventPtr; - } - return position.columnNumber; -} - -void XML_DefaultCurrent(XML_Parser parser) -{ - if (defaultHandler) - reportDefault(parser, encoding, eventPtr, eventEndPtr); -} - -const XML_LChar *XML_ErrorString(enum XML_Error code) -{ - static const XML_LChar *message[] = { - 0, - XML_T("out of memory"), - XML_T("syntax error"), - XML_T("no element found"), - XML_T("not well-formed"), - XML_T("unclosed token"), - XML_T("unclosed token"), - XML_T("mismatched tag"), - XML_T("duplicate attribute"), - XML_T("junk after document element"), - XML_T("illegal parameter entity reference"), - XML_T("undefined entity"), - XML_T("recursive entity reference"), - XML_T("asynchronous entity"), - XML_T("reference to invalid character number"), - XML_T("reference to binary entity"), - XML_T("reference to external entity in attribute"), - XML_T("xml processing instruction not at start of external entity"), - XML_T("unknown encoding"), - XML_T("encoding specified in XML declaration is incorrect"), - XML_T("unclosed CDATA section"), - XML_T("error in processing external entity reference") - }; - if (code > 0 && code < sizeof(message)/sizeof(message[0])) - return message[code]; - return 0; -} - -static -enum XML_Error contentProcessor(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - return doContent(parser, 0, encoding, start, end, endPtr); -} - -static -enum XML_Error externalEntityInitProcessor(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - enum XML_Error result = initializeEncoding(parser); - if (result != XML_ERROR_NONE) - return result; - processor = externalEntityInitProcessor2; - return externalEntityInitProcessor2(parser, start, end, endPtr); -} - -static -enum XML_Error externalEntityInitProcessor2(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - const char *next; - int tok = XmlContentTok(encoding, start, end, &next); - switch (tok) { - case XML_TOK_BOM: - start = next; - break; - case XML_TOK_PARTIAL: - if (endPtr) { - *endPtr = start; - return XML_ERROR_NONE; - } - eventPtr = start; - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - if (endPtr) { - *endPtr = start; - return XML_ERROR_NONE; - } - eventPtr = start; - return XML_ERROR_PARTIAL_CHAR; - } - processor = externalEntityInitProcessor3; - return externalEntityInitProcessor3(parser, start, end, endPtr); -} - -static -enum XML_Error externalEntityInitProcessor3(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - const char *next; - int tok = XmlContentTok(encoding, start, end, &next); - switch (tok) { - case XML_TOK_XML_DECL: - { - enum XML_Error result = processXmlDecl(parser, 1, start, next); - if (result != XML_ERROR_NONE) - return result; - start = next; - } - break; - case XML_TOK_PARTIAL: - if (endPtr) { - *endPtr = start; - return XML_ERROR_NONE; - } - eventPtr = start; - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - if (endPtr) { - *endPtr = start; - return XML_ERROR_NONE; - } - eventPtr = start; - return XML_ERROR_PARTIAL_CHAR; - } - processor = externalEntityContentProcessor; - tagLevel = 1; - return doContent(parser, 1, encoding, start, end, endPtr); -} - -static -enum XML_Error externalEntityContentProcessor(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - return doContent(parser, 1, encoding, start, end, endPtr); -} - -static enum XML_Error -doContent(XML_Parser parser, - int startTagLevel, - const ENCODING *enc, - const char *s, - const char *end, - const char **nextPtr) -{ - const ENCODING *internalEnc = XmlGetInternalEncoding(); - const char *dummy; - const char **eventPP; - const char **eventEndPP; - if (enc == encoding) { - eventPP = &eventPtr; - *eventPP = s; - eventEndPP = &eventEndPtr; - } - else - eventPP = eventEndPP = &dummy; - for (;;) { - const char *next; - int tok = XmlContentTok(enc, s, end, &next); - *eventEndPP = next; - switch (tok) { - case XML_TOK_TRAILING_CR: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - *eventEndPP = end; - if (characterDataHandler) { - XML_Char c = XML_T('\n'); - characterDataHandler(handlerArg, &c, 1); - } - else if (defaultHandler) - reportDefault(parser, enc, s, end); - if (startTagLevel == 0) - return XML_ERROR_NO_ELEMENTS; - if (tagLevel != startTagLevel) - return XML_ERROR_ASYNC_ENTITY; - return XML_ERROR_NONE; - case XML_TOK_NONE: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - if (startTagLevel > 0) { - if (tagLevel != startTagLevel) - return XML_ERROR_ASYNC_ENTITY; - return XML_ERROR_NONE; - } - return XML_ERROR_NO_ELEMENTS; - case XML_TOK_INVALID: - *eventPP = next; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_PARTIAL_CHAR; - case XML_TOK_ENTITY_REF: - { - const XML_Char *name; - ENTITY *entity; - XML_Char ch = XmlPredefinedEntityName(enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (ch) { - if (characterDataHandler) - characterDataHandler(handlerArg, &ch, 1); - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - } - name = poolStoreString(&dtd.pool, enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (!name) - return XML_ERROR_NO_MEMORY; - entity = (ENTITY *)lookup(&dtd.generalEntities, name, 0); - poolDiscard(&dtd.pool); - if (!entity) { - if (dtd.complete || dtd.standalone) - return XML_ERROR_UNDEFINED_ENTITY; - if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - } - if (entity->open) - return XML_ERROR_RECURSIVE_ENTITY_REF; - if (entity->notation) - return XML_ERROR_BINARY_ENTITY_REF; - if (entity) { - if (entity->textPtr) { - enum XML_Error result; - if (defaultHandler) { - reportDefault(parser, enc, s, next); - break; - } - /* Protect against the possibility that somebody sets - the defaultHandler from inside another handler. */ - *eventEndPP = *eventPP; - entity->open = 1; - result = doContent(parser, - tagLevel, - internalEnc, - (char *)entity->textPtr, - (char *)(entity->textPtr + entity->textLen), - 0); - entity->open = 0; - if (result) - return result; - } - else if (externalEntityRefHandler) { - const XML_Char *openEntityNames; - entity->open = 1; - openEntityNames = getOpenEntityNames(parser); - entity->open = 0; - if (!openEntityNames) - return XML_ERROR_NO_MEMORY; - if (!externalEntityRefHandler(parser, openEntityNames, dtd.base, entity->systemId, entity->publicId)) - return XML_ERROR_EXTERNAL_ENTITY_HANDLING; - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - } - break; - } - case XML_TOK_START_TAG_WITH_ATTS: - if (!startElementHandler) { - enum XML_Error result = storeAtts(parser, enc, 0, s); - if (result) - return result; - } - /* fall through */ - case XML_TOK_START_TAG_NO_ATTS: - { - TAG *tag; - if (freeTagList) { - tag = freeTagList; - freeTagList = freeTagList->parent; - } - else { - tag = malloc(sizeof(TAG)); - if (!tag) - return XML_ERROR_NO_MEMORY; - tag->buf = malloc(INIT_TAG_BUF_SIZE); - if (!tag->buf) - return XML_ERROR_NO_MEMORY; - tag->bufEnd = tag->buf + INIT_TAG_BUF_SIZE; - } - tag->parent = tagStack; - tagStack = tag; - tag->rawName = s + enc->minBytesPerChar; - tag->rawNameLength = XmlNameLength(enc, tag->rawName); - if (nextPtr) { - if (tag->rawNameLength > tag->bufEnd - tag->buf) { - size_t bufSize = tag->rawNameLength * 4; - bufSize = ROUND_UP(bufSize, sizeof(XML_Char)); - tag->buf = realloc(tag->buf, bufSize); - if (!tag->buf) - return XML_ERROR_NO_MEMORY; - tag->bufEnd = tag->buf + bufSize; - } - memcpy(tag->buf, tag->rawName, tag->rawNameLength); - tag->rawName = tag->buf; - } - ++tagLevel; - if (startElementHandler) { - enum XML_Error result; - XML_Char *toPtr; - for (;;) { - const char *rawNameEnd = tag->rawName + tag->rawNameLength; - const char *fromPtr = tag->rawName; - size_t bufSize; - if (nextPtr) - toPtr = (XML_Char *)(tag->buf + ROUND_UP(tag->rawNameLength, sizeof(XML_Char))); - else - toPtr = (XML_Char *)tag->buf; - tag->name = toPtr; - XmlConvert(enc, - &fromPtr, rawNameEnd, - (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1); - if (fromPtr == rawNameEnd) - break; - bufSize = (tag->bufEnd - tag->buf) << 1; - tag->buf = realloc(tag->buf, bufSize); - if (!tag->buf) - return XML_ERROR_NO_MEMORY; - tag->bufEnd = tag->buf + bufSize; - if (nextPtr) - tag->rawName = tag->buf; - } - *toPtr = XML_T('\0'); - result = storeAtts(parser, enc, tag->name, s); - if (result) - return result; - startElementHandler(handlerArg, tag->name, (const XML_Char **)atts); - poolClear(&tempPool); - } - else { - tag->name = 0; - if (defaultHandler) - reportDefault(parser, enc, s, next); - } - break; - } - case XML_TOK_EMPTY_ELEMENT_WITH_ATTS: - if (!startElementHandler) { - enum XML_Error result = storeAtts(parser, enc, 0, s); - if (result) - return result; - } - /* fall through */ - case XML_TOK_EMPTY_ELEMENT_NO_ATTS: - if (startElementHandler || endElementHandler) { - const char *rawName = s + enc->minBytesPerChar; - const XML_Char *name = poolStoreString(&tempPool, enc, rawName, - rawName - + XmlNameLength(enc, rawName)); - if (!name) - return XML_ERROR_NO_MEMORY; - poolFinish(&tempPool); - if (startElementHandler) { - enum XML_Error result = storeAtts(parser, enc, name, s); - if (result) - return result; - startElementHandler(handlerArg, name, (const XML_Char **)atts); - } - if (endElementHandler) { - if (startElementHandler) - *eventEndPP = *eventPP; - endElementHandler(handlerArg, name); - } - poolClear(&tempPool); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - if (tagLevel == 0) - return epilogProcessor(parser, next, end, nextPtr); - break; - case XML_TOK_END_TAG: - if (tagLevel == startTagLevel) - return XML_ERROR_ASYNC_ENTITY; - else { - size_t len; - const char *rawName; - TAG *tag = tagStack; - tagStack = tag->parent; - tag->parent = freeTagList; - freeTagList = tag; - rawName = s + enc->minBytesPerChar*2; - len = XmlNameLength(enc, rawName); - if (len != tag->rawNameLength - || memcmp(tag->rawName, rawName, len) != 0) { - *eventPP = rawName; - return XML_ERROR_TAG_MISMATCH; - } - --tagLevel; - if (endElementHandler) { - if (tag->name) - endElementHandler(handlerArg, tag->name); - else { - const XML_Char *name = poolStoreString(&tempPool, enc, rawName, - rawName + len); - if (!name) - return XML_ERROR_NO_MEMORY; - endElementHandler(handlerArg, name); - poolClear(&tempPool); - } - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - if (tagLevel == 0) - return epilogProcessor(parser, next, end, nextPtr); - } - break; - case XML_TOK_CHAR_REF: - { - int n = XmlCharRefNumber(enc, s); - if (n < 0) - return XML_ERROR_BAD_CHAR_REF; - if (characterDataHandler) { - XML_Char buf[XML_ENCODE_MAX]; - characterDataHandler(handlerArg, buf, XmlEncode(n, (ICHAR *)buf)); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - } - break; - case XML_TOK_XML_DECL: - return XML_ERROR_MISPLACED_XML_PI; - case XML_TOK_DATA_NEWLINE: - if (characterDataHandler) { - XML_Char c = XML_T('\n'); - characterDataHandler(handlerArg, &c, 1); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - case XML_TOK_CDATA_SECT_OPEN: - { - enum XML_Error result; - if (characterDataHandler) - characterDataHandler(handlerArg, dataBuf, 0); - else if (defaultHandler) - reportDefault(parser, enc, s, next); - result = doCdataSection(parser, enc, &next, end, nextPtr); - if (!next) { - processor = cdataSectionProcessor; - return result; - } - } - break; - case XML_TOK_TRAILING_RSQB: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - if (characterDataHandler) { - if (MUST_CONVERT(enc, s)) { - ICHAR *dataPtr = (ICHAR *)dataBuf; - XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); - characterDataHandler(handlerArg, dataBuf, - (size_t)(dataPtr - (ICHAR *)dataBuf)); - } - else - characterDataHandler(handlerArg, - (XML_Char *)s, - (size_t)((XML_Char *)end - (XML_Char *)s)); - } - else if (defaultHandler) - reportDefault(parser, enc, s, end); - if (startTagLevel == 0) { - *eventPP = end; - return XML_ERROR_NO_ELEMENTS; - } - if (tagLevel != startTagLevel) { - *eventPP = end; - return XML_ERROR_ASYNC_ENTITY; - } - return XML_ERROR_NONE; - case XML_TOK_DATA_CHARS: - if (characterDataHandler) { - if (MUST_CONVERT(enc, s)) { - for (;;) { - ICHAR *dataPtr = (ICHAR *)dataBuf; - XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); - *eventEndPP = s; - characterDataHandler(handlerArg, dataBuf, (size_t)(dataPtr - (ICHAR *)dataBuf)); - if (s == next) - break; - *eventPP = s; - } - } - else - characterDataHandler(handlerArg, - (XML_Char *)s, - (size_t)((XML_Char *)next - (XML_Char *)s)); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - case XML_TOK_PI: - if (!reportProcessingInstruction(parser, enc, s, next)) - return XML_ERROR_NO_MEMORY; - break; - default: - if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - } - *eventPP = s = next; - } - /* not reached */ -} - -/* If tagName is non-null, build a real list of attributes, -otherwise just check the attributes for well-formedness. */ - -static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc, - const XML_Char *tagName, const char *s) -{ - ELEMENT_TYPE *elementType = 0; - int nDefaultAtts = 0; - const XML_Char **appAtts; - int i; - int n; - - if (tagName) { - elementType = (ELEMENT_TYPE *)lookup(&dtd.elementTypes, tagName, 0); - if (elementType) - nDefaultAtts = elementType->nDefaultAtts; - } - - n = XmlGetAttributes(enc, s, attsSize, atts); - if (n + nDefaultAtts > attsSize) { - int oldAttsSize = attsSize; - attsSize = n + nDefaultAtts + INIT_ATTS_SIZE; - atts = realloc((void *)atts, attsSize * sizeof(ATTRIBUTE)); - if (!atts) - return XML_ERROR_NO_MEMORY; - if (n > oldAttsSize) - XmlGetAttributes(enc, s, n, atts); - } - appAtts = (const XML_Char **)atts; - for (i = 0; i < n; i++) { - ATTRIBUTE_ID *attId = getAttributeId(parser, enc, atts[i].name, - atts[i].name - + XmlNameLength(enc, atts[i].name)); - if (!attId) - return XML_ERROR_NO_MEMORY; - if ((attId->name)[-1]) { - if (enc == encoding) - eventPtr = atts[i].name; - return XML_ERROR_DUPLICATE_ATTRIBUTE; - } - (attId->name)[-1] = 1; - appAtts[i << 1] = attId->name; - if (!atts[i].normalized) { - enum XML_Error result; - int isCdata = 1; - - if (attId->maybeTokenized) { - int j; - for (j = 0; j < nDefaultAtts; j++) { - if (attId == elementType->defaultAtts[j].id) { - isCdata = elementType->defaultAtts[j].isCdata; - break; - } - } - } - - result = storeAttributeValue(parser, enc, isCdata, - atts[i].valuePtr, atts[i].valueEnd, - &tempPool); - if (result) - return result; - if (tagName) { - appAtts[(i << 1) + 1] = poolStart(&tempPool); - poolFinish(&tempPool); - } - else - poolDiscard(&tempPool); - } - else if (tagName) { - appAtts[(i << 1) + 1] = poolStoreString(&tempPool, enc, atts[i].valuePtr, atts[i].valueEnd); - if (appAtts[(i << 1) + 1] == 0) - return XML_ERROR_NO_MEMORY; - poolFinish(&tempPool); - } - } - if (tagName) { - int j; - for (j = 0; j < nDefaultAtts; j++) { - const DEFAULT_ATTRIBUTE *da = elementType->defaultAtts + j; - if (!(da->id->name)[-1] && da->value) { - (da->id->name)[-1] = 1; - appAtts[i << 1] = da->id->name; - appAtts[(i << 1) + 1] = da->value; - i++; - } - } - appAtts[i << 1] = 0; - } - while (i-- > 0) - ((XML_Char *)appAtts[i << 1])[-1] = 0; - return XML_ERROR_NONE; -} - -/* The idea here is to avoid using stack for each CDATA section when -the whole file is parsed with one call. */ - -static -enum XML_Error cdataSectionProcessor(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - enum XML_Error result = doCdataSection(parser, encoding, &start, end, endPtr); - if (start) { - processor = contentProcessor; - return contentProcessor(parser, start, end, endPtr); - } - return result; -} - -/* startPtr gets set to non-null is the section is closed, and to null if -the section is not yet closed. */ - -static -enum XML_Error doCdataSection(XML_Parser parser, - const ENCODING *enc, - const char **startPtr, - const char *end, - const char **nextPtr) -{ - const char *s = *startPtr; - const char *dummy; - const char **eventPP; - const char **eventEndPP; - if (enc == encoding) { - eventPP = &eventPtr; - *eventPP = s; - eventEndPP = &eventEndPtr; - } - else - eventPP = eventEndPP = &dummy; - *startPtr = 0; - for (;;) { - const char *next; - int tok = XmlCdataSectionTok(enc, s, end, &next); - *eventEndPP = next; - switch (tok) { - case XML_TOK_CDATA_SECT_CLOSE: - if (characterDataHandler) - characterDataHandler(handlerArg, dataBuf, 0); - else if (defaultHandler) - reportDefault(parser, enc, s, next); - *startPtr = next; - return XML_ERROR_NONE; - case XML_TOK_DATA_NEWLINE: - if (characterDataHandler) { - XML_Char c = XML_T('\n'); - characterDataHandler(handlerArg, &c, 1); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - case XML_TOK_DATA_CHARS: - if (characterDataHandler) { - if (MUST_CONVERT(enc, s)) { - for (;;) { - ICHAR *dataPtr = (ICHAR *)dataBuf; - XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); - *eventEndPP = next; - characterDataHandler(handlerArg, dataBuf, (size_t)(dataPtr - (ICHAR *)dataBuf)); - if (s == next) - break; - *eventPP = s; - } - } - else - characterDataHandler(handlerArg, - (XML_Char *)s, - (size_t)((XML_Char *)next - (XML_Char *)s)); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - case XML_TOK_INVALID: - *eventPP = next; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL_CHAR: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_PARTIAL_CHAR; - case XML_TOK_PARTIAL: - case XML_TOK_NONE: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_UNCLOSED_CDATA_SECTION; - default: - abort(); - } - *eventPP = s = next; - } - /* not reached */ -} - -static enum XML_Error -initializeEncoding(XML_Parser parser) -{ - const char *s; -#ifdef XML_UNICODE - char encodingBuf[128]; - if (!protocolEncodingName) - s = 0; - else { - int i; - for (i = 0; protocolEncodingName[i]; i++) { - if (i == sizeof(encodingBuf) - 1 - || protocolEncodingName[i] >= 0x80 - || protocolEncodingName[i] < 0) { - encodingBuf[0] = '\0'; - break; - } - encodingBuf[i] = (char)protocolEncodingName[i]; - } - encodingBuf[i] = '\0'; - s = encodingBuf; - } -#else - s = protocolEncodingName; -#endif - if (XmlInitEncoding(&initEncoding, &encoding, s)) - return XML_ERROR_NONE; - return handleUnknownEncoding(parser, protocolEncodingName); -} - -static enum XML_Error -processXmlDecl(XML_Parser parser, int isGeneralTextEntity, - const char *s, const char *next) -{ - const char *encodingName = 0; - const ENCODING *newEncoding = 0; - const char *version; - int standalone = -1; - if (!XmlParseXmlDecl(isGeneralTextEntity, - encoding, - s, - next, - &eventPtr, - &version, - &encodingName, - &newEncoding, - &standalone)) - return XML_ERROR_SYNTAX; - if (defaultHandler) - reportDefault(parser, encoding, s, next); - if (!protocolEncodingName) { - if (newEncoding) { - if (newEncoding->minBytesPerChar != encoding->minBytesPerChar) { - eventPtr = encodingName; - return XML_ERROR_INCORRECT_ENCODING; - } - encoding = newEncoding; - } - else if (encodingName) { - enum XML_Error result; - const XML_Char *s = poolStoreString(&tempPool, - encoding, - encodingName, - encodingName - + XmlNameLength(encoding, encodingName)); - if (!s) - return XML_ERROR_NO_MEMORY; - result = handleUnknownEncoding(parser, s); - poolDiscard(&tempPool); - if (result == XML_ERROR_UNKNOWN_ENCODING) - eventPtr = encodingName; - return result; - } - } - if (!isGeneralTextEntity && standalone == 1) - dtd.standalone = 1; - return XML_ERROR_NONE; -} - -static enum XML_Error -handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName) -{ - if (unknownEncodingHandler) { - XML_Encoding info; - int i; - for (i = 0; i < 256; i++) - info.map[i] = -1; - info.convert = 0; - info.data = 0; - info.release = 0; - if (unknownEncodingHandler(unknownEncodingHandlerData, encodingName, &info)) { - ENCODING *enc; - unknownEncodingMem = malloc((size_t)XmlSizeOfUnknownEncoding()); - if (!unknownEncodingMem) { - if (info.release) - info.release(info.data); - return XML_ERROR_NO_MEMORY; - } - enc = XmlInitUnknownEncoding(unknownEncodingMem, - info.map, - info.convert, - info.data); - if (enc) { - unknownEncodingData = info.data; - unknownEncodingRelease = info.release; - encoding = enc; - return XML_ERROR_NONE; - } - } - if (info.release) - info.release(info.data); - } - return XML_ERROR_UNKNOWN_ENCODING; -} - -static enum XML_Error -prologInitProcessor(XML_Parser parser, - const char *s, - const char *end, - const char **nextPtr) -{ - enum XML_Error result = initializeEncoding(parser); - if (result != XML_ERROR_NONE) - return result; - processor = prologProcessor; - return prologProcessor(parser, s, end, nextPtr); -} - -static enum XML_Error -prologProcessor(XML_Parser parser, - const char *s, - const char *end, - const char **nextPtr) -{ - for (;;) { - const char *next; - int tok = XmlPrologTok(encoding, s, end, &next); - if (tok <= 0) { - if (nextPtr != 0 && tok != XML_TOK_INVALID) { - *nextPtr = s; - return XML_ERROR_NONE; - } - switch (tok) { - case XML_TOK_INVALID: - eventPtr = next; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_NONE: - return XML_ERROR_NO_ELEMENTS; - case XML_TOK_PARTIAL: - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - return XML_ERROR_PARTIAL_CHAR; - case XML_TOK_TRAILING_CR: - eventPtr = s + encoding->minBytesPerChar; - return XML_ERROR_NO_ELEMENTS; - default: - abort(); - } - } - switch (XmlTokenRole(&prologState, tok, s, next, encoding)) { - case XML_ROLE_XML_DECL: - { - enum XML_Error result = processXmlDecl(parser, 0, s, next); - if (result != XML_ERROR_NONE) - return result; - } - break; - case XML_ROLE_DOCTYPE_SYSTEM_ID: - hadExternalDoctype = 1; - break; - case XML_ROLE_DOCTYPE_PUBLIC_ID: - case XML_ROLE_ENTITY_PUBLIC_ID: - if (!XmlIsPublicId(encoding, s, next, &eventPtr)) - return XML_ERROR_SYNTAX; - if (declEntity) { - XML_Char *tem = poolStoreString(&dtd.pool, - encoding, - s + encoding->minBytesPerChar, - next - encoding->minBytesPerChar); - if (!tem) - return XML_ERROR_NO_MEMORY; - normalizePublicId(tem); - declEntity->publicId = tem; - poolFinish(&dtd.pool); - } - break; - case XML_ROLE_INSTANCE_START: - processor = contentProcessor; - if (hadExternalDoctype) - dtd.complete = 0; - return contentProcessor(parser, s, end, nextPtr); - case XML_ROLE_ATTLIST_ELEMENT_NAME: - { - const XML_Char *name = poolStoreString(&dtd.pool, encoding, s, next); - if (!name) - return XML_ERROR_NO_MEMORY; - declElementType = (ELEMENT_TYPE *)lookup(&dtd.elementTypes, name, sizeof(ELEMENT_TYPE)); - if (!declElementType) - return XML_ERROR_NO_MEMORY; - if (declElementType->name != name) - poolDiscard(&dtd.pool); - else - poolFinish(&dtd.pool); - break; - } - case XML_ROLE_ATTRIBUTE_NAME: - declAttributeId = getAttributeId(parser, encoding, s, next); - if (!declAttributeId) - return XML_ERROR_NO_MEMORY; - declAttributeIsCdata = 0; - break; - case XML_ROLE_ATTRIBUTE_TYPE_CDATA: - declAttributeIsCdata = 1; - break; - case XML_ROLE_IMPLIED_ATTRIBUTE_VALUE: - case XML_ROLE_REQUIRED_ATTRIBUTE_VALUE: - if (dtd.complete - && !defineAttribute(declElementType, declAttributeId, declAttributeIsCdata, 0)) - return XML_ERROR_NO_MEMORY; - break; - case XML_ROLE_DEFAULT_ATTRIBUTE_VALUE: - case XML_ROLE_FIXED_ATTRIBUTE_VALUE: - { - const XML_Char *attVal; - enum XML_Error result - = storeAttributeValue(parser, encoding, declAttributeIsCdata, - s + encoding->minBytesPerChar, - next - encoding->minBytesPerChar, - &dtd.pool); - if (result) - return result; - attVal = poolStart(&dtd.pool); - poolFinish(&dtd.pool); - if (dtd.complete - && !defineAttribute(declElementType, declAttributeId, declAttributeIsCdata, attVal)) - return XML_ERROR_NO_MEMORY; - break; - } - case XML_ROLE_ENTITY_VALUE: - { - enum XML_Error result = storeEntityValue(parser, s, next); - if (result != XML_ERROR_NONE) - return result; - } - break; - case XML_ROLE_ENTITY_SYSTEM_ID: - if (declEntity) { - declEntity->systemId = poolStoreString(&dtd.pool, encoding, - s + encoding->minBytesPerChar, - next - encoding->minBytesPerChar); - if (!declEntity->systemId) - return XML_ERROR_NO_MEMORY; - declEntity->base = dtd.base; - poolFinish(&dtd.pool); - } - break; - case XML_ROLE_ENTITY_NOTATION_NAME: - if (declEntity) { - declEntity->notation = poolStoreString(&dtd.pool, encoding, s, next); - if (!declEntity->notation) - return XML_ERROR_NO_MEMORY; - poolFinish(&dtd.pool); - if (unparsedEntityDeclHandler) { - eventPtr = eventEndPtr = s; - unparsedEntityDeclHandler(handlerArg, - declEntity->name, - declEntity->base, - declEntity->systemId, - declEntity->publicId, - declEntity->notation); - } - - } - break; - case XML_ROLE_GENERAL_ENTITY_NAME: - { - const XML_Char *name; - if (XmlPredefinedEntityName(encoding, s, next)) { - declEntity = 0; - break; - } - name = poolStoreString(&dtd.pool, encoding, s, next); - if (!name) - return XML_ERROR_NO_MEMORY; - if (dtd.complete) { - declEntity = (ENTITY *)lookup(&dtd.generalEntities, name, sizeof(ENTITY)); - if (!declEntity) - return XML_ERROR_NO_MEMORY; - if (declEntity->name != name) { - poolDiscard(&dtd.pool); - declEntity = 0; - } - else - poolFinish(&dtd.pool); - } - else { - poolDiscard(&dtd.pool); - declEntity = 0; - } - } - break; - case XML_ROLE_PARAM_ENTITY_NAME: - declEntity = 0; - break; - case XML_ROLE_NOTATION_NAME: - declNotationPublicId = 0; - declNotationName = 0; - if (notationDeclHandler) { - declNotationName = poolStoreString(&tempPool, encoding, s, next); - if (!declNotationName) - return XML_ERROR_NO_MEMORY; - poolFinish(&tempPool); - } - break; - case XML_ROLE_NOTATION_PUBLIC_ID: - if (!XmlIsPublicId(encoding, s, next, &eventPtr)) - return XML_ERROR_SYNTAX; - if (declNotationName) { - XML_Char *tem = poolStoreString(&tempPool, - encoding, - s + encoding->minBytesPerChar, - next - encoding->minBytesPerChar); - if (!tem) - return XML_ERROR_NO_MEMORY; - normalizePublicId(tem); - declNotationPublicId = tem; - poolFinish(&tempPool); - } - break; - case XML_ROLE_NOTATION_SYSTEM_ID: - if (declNotationName && notationDeclHandler) { - const XML_Char *systemId - = poolStoreString(&tempPool, encoding, - s + encoding->minBytesPerChar, - next - encoding->minBytesPerChar); - if (!systemId) - return XML_ERROR_NO_MEMORY; - eventPtr = eventEndPtr = s; - notationDeclHandler(handlerArg, - declNotationName, - dtd.base, - systemId, - declNotationPublicId); - } - poolClear(&tempPool); - break; - case XML_ROLE_NOTATION_NO_SYSTEM_ID: - if (declNotationPublicId && notationDeclHandler) { - eventPtr = eventEndPtr = s; - notationDeclHandler(handlerArg, - declNotationName, - dtd.base, - 0, - declNotationPublicId); - } - poolClear(&tempPool); - break; - case XML_ROLE_ERROR: - eventPtr = s; - switch (tok) { - case XML_TOK_PARAM_ENTITY_REF: - return XML_ERROR_PARAM_ENTITY_REF; - case XML_TOK_XML_DECL: - return XML_ERROR_MISPLACED_XML_PI; - default: - return XML_ERROR_SYNTAX; - } - case XML_ROLE_GROUP_OPEN: - if (prologState.level >= groupSize) { - if (groupSize) - groupConnector = realloc(groupConnector, groupSize *= 2); - else - groupConnector = malloc(groupSize = 32); - if (!groupConnector) - return XML_ERROR_NO_MEMORY; - } - groupConnector[prologState.level] = 0; - break; - case XML_ROLE_GROUP_SEQUENCE: - if (groupConnector[prologState.level] == '|') { - eventPtr = s; - return XML_ERROR_SYNTAX; - } - groupConnector[prologState.level] = ','; - break; - case XML_ROLE_GROUP_CHOICE: - if (groupConnector[prologState.level] == ',') { - eventPtr = s; - return XML_ERROR_SYNTAX; - } - groupConnector[prologState.level] = '|'; - break; - case XML_ROLE_PARAM_ENTITY_REF: - dtd.complete = 0; - break; - case XML_ROLE_NONE: - switch (tok) { - case XML_TOK_PI: - eventPtr = s; - eventEndPtr = next; - if (!reportProcessingInstruction(parser, encoding, s, next)) - return XML_ERROR_NO_MEMORY; - break; - } - break; - } - if (defaultHandler) { - switch (tok) { - case XML_TOK_PI: - case XML_TOK_BOM: - case XML_TOK_XML_DECL: - break; - default: - eventPtr = s; - eventEndPtr = next; - reportDefault(parser, encoding, s, next); - } - } - s = next; - } - /* not reached */ -} - -static -enum XML_Error epilogProcessor(XML_Parser parser, - const char *s, - const char *end, - const char **nextPtr) -{ - processor = epilogProcessor; - eventPtr = s; - for (;;) { - const char *next; - int tok = XmlPrologTok(encoding, s, end, &next); - eventEndPtr = next; - switch (tok) { - case XML_TOK_TRAILING_CR: - if (defaultHandler) { - eventEndPtr = end; - reportDefault(parser, encoding, s, end); - } - /* fall through */ - case XML_TOK_NONE: - if (nextPtr) - *nextPtr = end; - return XML_ERROR_NONE; - case XML_TOK_PROLOG_S: - case XML_TOK_COMMENT: - if (defaultHandler) - reportDefault(parser, encoding, s, next); - break; - case XML_TOK_PI: - if (!reportProcessingInstruction(parser, encoding, s, next)) - return XML_ERROR_NO_MEMORY; - break; - case XML_TOK_INVALID: - eventPtr = next; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_PARTIAL_CHAR; - default: - return XML_ERROR_JUNK_AFTER_DOC_ELEMENT; - } - eventPtr = s = next; - } -} - -static -enum XML_Error errorProcessor(XML_Parser parser, - const char *s, - const char *end, - const char **nextPtr) -{ - return errorCode; -} - -static enum XML_Error -storeAttributeValue(XML_Parser parser, const ENCODING *enc, int isCdata, - const char *ptr, const char *end, - STRING_POOL *pool) -{ - enum XML_Error result = appendAttributeValue(parser, enc, isCdata, ptr, end, pool); - if (result) - return result; - if (!isCdata && poolLength(pool) && poolLastChar(pool) == XML_T(' ')) - poolChop(pool); - if (!poolAppendChar(pool, XML_T('\0'))) - return XML_ERROR_NO_MEMORY; - return XML_ERROR_NONE; -} - -static enum XML_Error -appendAttributeValue(XML_Parser parser, const ENCODING *enc, int isCdata, - const char *ptr, const char *end, - STRING_POOL *pool) -{ - const ENCODING *internalEnc = XmlGetInternalEncoding(); - for (;;) { - const char *next; - int tok = XmlAttributeValueTok(enc, ptr, end, &next); - switch (tok) { - case XML_TOK_NONE: - return XML_ERROR_NONE; - case XML_TOK_INVALID: - if (enc == encoding) - eventPtr = next; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL: - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_CHAR_REF: - { - XML_Char buf[XML_ENCODE_MAX]; - int i; - int n = XmlCharRefNumber(enc, ptr); - if (n < 0) { - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_BAD_CHAR_REF; - } - if (!isCdata - && n == 0x20 /* space */ - && (poolLength(pool) == 0 || poolLastChar(pool) == XML_T(' '))) - break; - n = XmlEncode(n, (ICHAR *)buf); - if (!n) { - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_BAD_CHAR_REF; - } - for (i = 0; i < n; i++) { - if (!poolAppendChar(pool, buf[i])) - return XML_ERROR_NO_MEMORY; - } - } - break; - case XML_TOK_DATA_CHARS: - if (!poolAppend(pool, enc, ptr, next)) - return XML_ERROR_NO_MEMORY; - break; - break; - case XML_TOK_TRAILING_CR: - next = ptr + enc->minBytesPerChar; - /* fall through */ - case XML_TOK_ATTRIBUTE_VALUE_S: - case XML_TOK_DATA_NEWLINE: - if (!isCdata && (poolLength(pool) == 0 || poolLastChar(pool) == XML_T(' '))) - break; - if (!poolAppendChar(pool, XML_T(' '))) - return XML_ERROR_NO_MEMORY; - break; - case XML_TOK_ENTITY_REF: - { - const XML_Char *name; - ENTITY *entity; - XML_Char ch = XmlPredefinedEntityName(enc, - ptr + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (ch) { - if (!poolAppendChar(pool, ch)) - return XML_ERROR_NO_MEMORY; - break; - } - name = poolStoreString(&temp2Pool, enc, - ptr + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (!name) - return XML_ERROR_NO_MEMORY; - entity = (ENTITY *)lookup(&dtd.generalEntities, name, 0); - poolDiscard(&temp2Pool); - if (!entity) { - if (dtd.complete) { - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_UNDEFINED_ENTITY; - } - } - else if (entity->open) { - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_RECURSIVE_ENTITY_REF; - } - else if (entity->notation) { - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_BINARY_ENTITY_REF; - } - else if (!entity->textPtr) { - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF; - } - else { - enum XML_Error result; - const XML_Char *textEnd = entity->textPtr + entity->textLen; - entity->open = 1; - result = appendAttributeValue(parser, internalEnc, isCdata, (char *)entity->textPtr, (char *)textEnd, pool); - entity->open = 0; - if (result) - return result; - } - } - break; - default: - abort(); - } - ptr = next; - } - /* not reached */ -} - -static -enum XML_Error storeEntityValue(XML_Parser parser, - const char *entityTextPtr, - const char *entityTextEnd) -{ - /*const ENCODING *internalEnc = XmlGetInternalEncoding();*/ - STRING_POOL *pool = &(dtd.pool); - entityTextPtr += encoding->minBytesPerChar; - entityTextEnd -= encoding->minBytesPerChar; - for (;;) { - const char *next; - int tok = XmlEntityValueTok(encoding, entityTextPtr, entityTextEnd, &next); - switch (tok) { - case XML_TOK_PARAM_ENTITY_REF: - eventPtr = entityTextPtr; - return XML_ERROR_SYNTAX; - case XML_TOK_NONE: - if (declEntity) { - declEntity->textPtr = pool->start; - declEntity->textLen = pool->ptr - pool->start; - poolFinish(pool); - } - else - poolDiscard(pool); - return XML_ERROR_NONE; - case XML_TOK_ENTITY_REF: - case XML_TOK_DATA_CHARS: - if (!poolAppend(pool, encoding, entityTextPtr, next)) - return XML_ERROR_NO_MEMORY; - break; - case XML_TOK_TRAILING_CR: - next = entityTextPtr + encoding->minBytesPerChar; - /* fall through */ - case XML_TOK_DATA_NEWLINE: - if (pool->end == pool->ptr && !poolGrow(pool)) - return XML_ERROR_NO_MEMORY; - *(pool->ptr)++ = XML_T('\n'); - break; - case XML_TOK_CHAR_REF: - { - XML_Char buf[XML_ENCODE_MAX]; - int i; - int n = XmlCharRefNumber(encoding, entityTextPtr); - if (n < 0) { - eventPtr = entityTextPtr; - return XML_ERROR_BAD_CHAR_REF; - } - n = XmlEncode(n, (ICHAR *)buf); - if (!n) { - eventPtr = entityTextPtr; - return XML_ERROR_BAD_CHAR_REF; - } - for (i = 0; i < n; i++) { - if (pool->end == pool->ptr && !poolGrow(pool)) - return XML_ERROR_NO_MEMORY; - *(pool->ptr)++ = buf[i]; - } - } - break; - case XML_TOK_PARTIAL: - eventPtr = entityTextPtr; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_INVALID: - eventPtr = next; - return XML_ERROR_INVALID_TOKEN; - default: - abort(); - } - entityTextPtr = next; - } - /* not reached */ -} - -static void -normalizeLines(XML_Char *s) -{ - XML_Char *p; - for (;; s++) { - if (*s == XML_T('\0')) - return; - if (*s == XML_T('\r')) - break; - } - p = s; - do { - if (*s == XML_T('\r')) { - *p++ = XML_T('\n'); - if (*++s == XML_T('\n')) - s++; - } - else - *p++ = *s++; - } while (*s); - *p = XML_T('\0'); -} - -static int -reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) -{ - const XML_Char *target; - XML_Char *data; - const char *tem; - if (!processingInstructionHandler) { - if (defaultHandler) - reportDefault(parser, enc, start, end); - return 1; - } - start += enc->minBytesPerChar * 2; - tem = start + XmlNameLength(enc, start); - target = poolStoreString(&tempPool, enc, start, tem); - if (!target) - return 0; - poolFinish(&tempPool); - data = poolStoreString(&tempPool, enc, - XmlSkipS(enc, tem), - end - enc->minBytesPerChar*2); - if (!data) - return 0; - normalizeLines(data); - processingInstructionHandler(handlerArg, target, data); - poolClear(&tempPool); - return 1; -} - -static void -reportDefault(XML_Parser parser, const ENCODING *enc, const char *s, const char *end) -{ - if (MUST_CONVERT(enc, s)) { - for (;;) { - ICHAR *dataPtr = (ICHAR *)dataBuf; - XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); - if (s == end) { - defaultHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); - break; - } - if (enc == encoding) { - eventEndPtr = s; - defaultHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); - eventPtr = s; - } - else - defaultHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); - } - } - else - defaultHandler(handlerArg, (XML_Char *)s, (XML_Char *)end - (XML_Char *)s); -} - - -static int -defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, int isCdata, const XML_Char *value) -{ - DEFAULT_ATTRIBUTE *att; - if (type->nDefaultAtts == type->allocDefaultAtts) { - if (type->allocDefaultAtts == 0) { - type->allocDefaultAtts = 8; - type->defaultAtts = malloc(type->allocDefaultAtts*sizeof(DEFAULT_ATTRIBUTE)); - } - else { - type->allocDefaultAtts *= 2; - type->defaultAtts = realloc(type->defaultAtts, - type->allocDefaultAtts*sizeof(DEFAULT_ATTRIBUTE)); - } - if (!type->defaultAtts) - return 0; - } - att = type->defaultAtts + type->nDefaultAtts; - att->id = attId; - att->value = value; - att->isCdata = isCdata; - if (!isCdata) - attId->maybeTokenized = 1; - type->nDefaultAtts += 1; - return 1; -} - -static ATTRIBUTE_ID * -getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) -{ - ATTRIBUTE_ID *id; - const XML_Char *name; - if (!poolAppendChar(&dtd.pool, XML_T('\0'))) - return 0; - name = poolStoreString(&dtd.pool, enc, start, end); - if (!name) - return 0; - ++name; - id = (ATTRIBUTE_ID *)lookup(&dtd.attributeIds, name, sizeof(ATTRIBUTE_ID)); - if (!id) - return 0; - if (id->name != name) - poolDiscard(&dtd.pool); - else - poolFinish(&dtd.pool); - return id; -} - -static -const XML_Char *getOpenEntityNames(XML_Parser parser) -{ - HASH_TABLE_ITER iter; - - hashTableIterInit(&iter, &(dtd.generalEntities)); - for (;;) { - const XML_Char *s; - ENTITY *e = (ENTITY *)hashTableIterNext(&iter); - if (!e) - break; - if (!e->open) - continue; - if (poolLength(&tempPool) > 0 && !poolAppendChar(&tempPool, XML_T(' '))) - return 0; - for (s = e->name; *s; s++) - if (!poolAppendChar(&tempPool, *s)) - return 0; - } - - if (!poolAppendChar(&tempPool, XML_T('\0'))) - return 0; - return tempPool.start; -} - -static -int setOpenEntityNames(XML_Parser parser, const XML_Char *openEntityNames) -{ - const XML_Char *s = openEntityNames; - while (*openEntityNames != XML_T('\0')) { - if (*s == XML_T(' ') || *s == XML_T('\0')) { - ENTITY *e; - if (!poolAppendChar(&tempPool, XML_T('\0'))) - return 0; - e = (ENTITY *)lookup(&dtd.generalEntities, poolStart(&tempPool), 0); - if (e) - e->open = 1; - if (*s == XML_T(' ')) - s++; - openEntityNames = s; - poolDiscard(&tempPool); - } - else { - if (!poolAppendChar(&tempPool, *s)) - return 0; - s++; - } - } - return 1; -} - - -static -void normalizePublicId(XML_Char *publicId) -{ - XML_Char *p = publicId; - XML_Char *s; - for (s = publicId; *s; s++) { - switch (*s) { - case XML_T(' '): - case XML_T('\r'): - case XML_T('\n'): - if (p != publicId && p[-1] != XML_T(' ')) - *p++ = XML_T(' '); - break; - default: - *p++ = *s; - } - } - if (p != publicId && p[-1] == XML_T(' ')) - --p; - *p = XML_T('\0'); -} - -static int dtdInit(DTD *p) -{ - poolInit(&(p->pool)); - hashTableInit(&(p->generalEntities)); - hashTableInit(&(p->elementTypes)); - hashTableInit(&(p->attributeIds)); - p->complete = 1; - p->base = 0; - return 1; -} - -static void dtdDestroy(DTD *p) -{ - HASH_TABLE_ITER iter; - hashTableIterInit(&iter, &(p->elementTypes)); - for (;;) { - ELEMENT_TYPE *e = (ELEMENT_TYPE *)hashTableIterNext(&iter); - if (!e) - break; - if (e->allocDefaultAtts != 0) - free(e->defaultAtts); - } - hashTableDestroy(&(p->generalEntities)); - hashTableDestroy(&(p->elementTypes)); - hashTableDestroy(&(p->attributeIds)); - poolDestroy(&(p->pool)); -} - -/* Do a deep copy of the DTD. Return 0 for out of memory; non-zero otherwise. -The new DTD has already been initialized. */ - -static int dtdCopy(DTD *newDtd, const DTD *oldDtd) -{ - HASH_TABLE_ITER iter; - - if (oldDtd->base) { - const XML_Char *tem = poolCopyString(&(newDtd->pool), oldDtd->base); - if (!tem) - return 0; - newDtd->base = tem; - } - - hashTableIterInit(&iter, &(oldDtd->attributeIds)); - - /* Copy the attribute id table. */ - - for (;;) { - ATTRIBUTE_ID *newA; - const XML_Char *name; - const ATTRIBUTE_ID *oldA = (ATTRIBUTE_ID *)hashTableIterNext(&iter); - - if (!oldA) - break; - /* Remember to allocate the scratch byte before the name. */ - if (!poolAppendChar(&(newDtd->pool), XML_T('\0'))) - return 0; - name = poolCopyString(&(newDtd->pool), oldA->name); - if (!name) - return 0; - ++name; - newA = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), name, sizeof(ATTRIBUTE_ID)); - if (!newA) - return 0; - newA->maybeTokenized = oldA->maybeTokenized; - } - - /* Copy the element type table. */ - - hashTableIterInit(&iter, &(oldDtd->elementTypes)); - - for (;;) { - int i; - ELEMENT_TYPE *newE; - const XML_Char *name; - const ELEMENT_TYPE *oldE = (ELEMENT_TYPE *)hashTableIterNext(&iter); - if (!oldE) - break; - name = poolCopyString(&(newDtd->pool), oldE->name); - if (!name) - return 0; - newE = (ELEMENT_TYPE *)lookup(&(newDtd->elementTypes), name, sizeof(ELEMENT_TYPE)); - if (!newE) - return 0; - newE->defaultAtts = (DEFAULT_ATTRIBUTE *)malloc(oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); - if (!newE->defaultAtts) - return 0; - newE->allocDefaultAtts = newE->nDefaultAtts = oldE->nDefaultAtts; - for (i = 0; i < newE->nDefaultAtts; i++) { - newE->defaultAtts[i].id = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), oldE->defaultAtts[i].id->name, 0); - newE->defaultAtts[i].isCdata = oldE->defaultAtts[i].isCdata; - newE->defaultAtts[i].value = poolCopyString(&(newDtd->pool), oldE->defaultAtts[i].value); - if (!newE->defaultAtts[i].value) - return 0; - } - } - - /* Copy the entity table. */ - - hashTableIterInit(&iter, &(oldDtd->generalEntities)); - - for (;;) { - ENTITY *newE; - const XML_Char *name; - const ENTITY *oldE = (ENTITY *)hashTableIterNext(&iter); - if (!oldE) - break; - name = poolCopyString(&(newDtd->pool), oldE->name); - if (!name) - return 0; - newE = (ENTITY *)lookup(&(newDtd->generalEntities), name, sizeof(ENTITY)); - if (!newE) - return 0; - if (oldE->systemId) { - const XML_Char *tem = poolCopyString(&(newDtd->pool), oldE->systemId); - if (!tem) - return 0; - newE->systemId = tem; - if (oldE->base) { - if (oldE->base == oldDtd->base) - newE->base = newDtd->base; - tem = poolCopyString(&(newDtd->pool), oldE->base); - if (!tem) - return 0; - newE->base = tem; - } - } - else { - const XML_Char *tem = poolCopyStringN(&(newDtd->pool), oldE->textPtr, oldE->textLen); - if (!tem) - return 0; - newE->textPtr = tem; - newE->textLen = oldE->textLen; - } - if (oldE->notation) { - const XML_Char *tem = poolCopyString(&(newDtd->pool), oldE->notation); - if (!tem) - return 0; - newE->notation = tem; - } - } - - newDtd->complete = oldDtd->complete; - newDtd->standalone = oldDtd->standalone; - return 1; -} - -static -void poolInit(STRING_POOL *pool) -{ - pool->blocks = 0; - pool->freeBlocks = 0; - pool->start = 0; - pool->ptr = 0; - pool->end = 0; -} - -static -void poolClear(STRING_POOL *pool) -{ - if (!pool->freeBlocks) - pool->freeBlocks = pool->blocks; - else { - BLOCK *p = pool->blocks; - while (p) { - BLOCK *tem = p->next; - p->next = pool->freeBlocks; - pool->freeBlocks = p; - p = tem; - } - } - pool->blocks = 0; - pool->start = 0; - pool->ptr = 0; - pool->end = 0; -} - -static -void poolDestroy(STRING_POOL *pool) -{ - BLOCK *p = pool->blocks; - while (p) { - BLOCK *tem = p->next; - free(p); - p = tem; - } - pool->blocks = 0; - p = pool->freeBlocks; - while (p) { - BLOCK *tem = p->next; - free(p); - p = tem; - } - pool->freeBlocks = 0; - pool->ptr = 0; - pool->start = 0; - pool->end = 0; -} - -static -XML_Char *poolAppend(STRING_POOL *pool, const ENCODING *enc, - const char *ptr, const char *end) -{ - if (!pool->ptr && !poolGrow(pool)) - return 0; - for (;;) { - XmlConvert(enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end); - if (ptr == end) - break; - if (!poolGrow(pool)) - return 0; - } - return pool->start; -} - -static const XML_Char *poolCopyString(STRING_POOL *pool, const XML_Char *s) -{ - do { - if (!poolAppendChar(pool, *s)) - return 0; - } while (*s++); - s = pool->start; - poolFinish(pool); - return s; -} - -static const XML_Char *poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n) -{ - if (!pool->ptr && !poolGrow(pool)) - return 0; - for (; n > 0; --n, s++) { - if (!poolAppendChar(pool, *s)) - return 0; - - } - s = pool->start; - poolFinish(pool); - return s; -} - -static -XML_Char *poolStoreString(STRING_POOL *pool, const ENCODING *enc, - const char *ptr, const char *end) -{ - if (!poolAppend(pool, enc, ptr, end)) - return 0; - if (pool->ptr == pool->end && !poolGrow(pool)) - return 0; - *(pool->ptr)++ = 0; - return pool->start; -} - -static -int poolGrow(STRING_POOL *pool) -{ - if (pool->freeBlocks) { - if (pool->start == 0) { - pool->blocks = pool->freeBlocks; - pool->freeBlocks = pool->freeBlocks->next; - pool->blocks->next = 0; - pool->start = pool->blocks->s; - pool->end = pool->start + pool->blocks->size; - pool->ptr = pool->start; - return 1; - } - if (pool->end - pool->start < pool->freeBlocks->size) { - BLOCK *tem = pool->freeBlocks->next; - pool->freeBlocks->next = pool->blocks; - pool->blocks = pool->freeBlocks; - pool->freeBlocks = tem; - memcpy(pool->blocks->s, pool->start, (pool->end - pool->start) * sizeof(XML_Char)); - pool->ptr = pool->blocks->s + (pool->ptr - pool->start); - pool->start = pool->blocks->s; - pool->end = pool->start + pool->blocks->size; - return 1; - } - } - if (pool->blocks && pool->start == pool->blocks->s) { - int blockSize = (pool->end - pool->start)*2; - pool->blocks = realloc(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); - if (!pool->blocks) - return 0; - pool->blocks->size = blockSize; - pool->ptr = pool->blocks->s + (pool->ptr - pool->start); - pool->start = pool->blocks->s; - pool->end = pool->start + blockSize; - } - else { - BLOCK *tem; - int blockSize = pool->end - pool->start; - if (blockSize < INIT_BLOCK_SIZE) - blockSize = INIT_BLOCK_SIZE; - else - blockSize *= 2; - tem = malloc(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); - if (!tem) - return 0; - tem->size = blockSize; - tem->next = pool->blocks; - pool->blocks = tem; - memcpy(tem->s, pool->start, (pool->ptr - pool->start) * sizeof(XML_Char)); - pool->ptr = tem->s + (pool->ptr - pool->start); - pool->start = tem->s; - pool->end = tem->s + blockSize; - } - return 1; -} Index: xotcl/library/xml/TclExpat-1.1/xmlparse.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/xmlparse.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/xmlparse.h (revision 0) @@ -1,382 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#ifndef XmlParse_INCLUDED -#define XmlParse_INCLUDED 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef XMLPARSEAPI -#define XMLPARSEAPI /* as nothing */ -#endif - -typedef void *XML_Parser; - -#ifdef XML_UNICODE_WCHAR_T - -/* XML_UNICODE_WCHAR_T will work only if sizeof(wchar_t) == 2 and wchar_t -uses Unicode. */ -/* Information is UTF-16 encoded as wchar_ts */ - -#ifndef XML_UNICODE -#define XML_UNICODE -#endif - -#include -typedef wchar_t XML_Char; -typedef wchar_t XML_LChar; - -#else /* not XML_UNICODE_WCHAR_T */ - -#ifdef XML_UNICODE - -/* Information is UTF-16 encoded as unsigned shorts */ -typedef unsigned short XML_Char; -typedef char XML_LChar; - -#else /* not XML_UNICODE */ - -/* Information is UTF-8 encoded. */ -typedef char XML_Char; -typedef char XML_LChar; - -#endif /* not XML_UNICODE */ - -#endif /* not XML_UNICODE_WCHAR_T */ - - -/* Constructs a new parser; encoding is the encoding specified by the external -protocol or null if there is none specified. */ - -XML_Parser XMLPARSEAPI -XML_ParserCreate(const XML_Char *encoding); - - -/* atts is array of name/value pairs, terminated by 0; - names and values are 0 terminated. */ - -typedef void (*XML_StartElementHandler)(void *userData, - const XML_Char *name, - const XML_Char **atts); - -typedef void (*XML_EndElementHandler)(void *userData, - const XML_Char *name); - -/* s is not 0 terminated. */ -typedef void (*XML_CharacterDataHandler)(void *userData, - const XML_Char *s, - size_t len); - -/* target and data are 0 terminated */ -typedef void (*XML_ProcessingInstructionHandler)(void *userData, - const XML_Char *target, - const XML_Char *data); - -/* This is called for any characters in the XML document for -which there is no applicable handler. This includes both -characters that are part of markup which is of a kind that is -not reported (comments, markup declarations), or characters -that are part of a construct which could be reported but -for which no handler has been supplied. The characters are passed -exactly as they were in the XML document except that -they will be encoded in UTF-8. Line boundaries are not normalized. -Note that a byte order mark character is not passed to the default handler. -If a default handler is set, internal entity references -are not expanded. There are no guarantees about -how characters are divided between calls to the default handler: -for example, a comment might be split between multiple calls. */ - -typedef void (*XML_DefaultHandler)(void *userData, - const XML_Char *s, - int len); - -/* This is called for a declaration of an unparsed (NDATA) -entity. The base argument is whatever was set by XML_SetBase. -The entityName, systemId and notationName arguments will never be null. -The other arguments may be. */ - -typedef void (*XML_UnparsedEntityDeclHandler)(void *userData, - const XML_Char *entityName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName); - -/* This is called for a declaration of notation. -The base argument is whatever was set by XML_SetBase. -The notationName will never be null. The other arguments can be. */ - -typedef void (*XML_NotationDeclHandler)(void *userData, - const XML_Char *notationName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); - -/* This is called for a reference to an external parsed general entity. -The referenced entity is not automatically parsed. -The application can parse it immediately or later using -XML_ExternalEntityParserCreate. -The parser argument is the parser parsing the entity containing the reference; -it can be passed as the parser argument to XML_ExternalEntityParserCreate. -The systemId argument is the system identifier as specified in the entity declaration; -it will not be null. -The base argument is the system identifier that should be used as the base for -resolving systemId if systemId was relative; this is set by XML_SetBase; -it may be null. -The publicId argument is the public identifier as specified in the entity declaration, -or null if none was specified; the whitespace in the public identifier -will have been normalized as required by the XML spec. -The openEntityNames argument is a space-separated list of the names of the entities -that are open for the parse of this entity (including the name of the referenced -entity); this can be passed as the openEntityNames argument to -XML_ExternalEntityParserCreate; openEntityNames is valid only until the handler -returns, so if the referenced entity is to be parsed later, it must be copied. -The handler should return 0 if processing should not continue because of -a fatal error in the handling of the external entity. -In this case the calling parser will return an XML_ERROR_EXTERNAL_ENTITY_HANDLING -error. -Note that unlike other handlers the first argument is the parser, not userData. */ - -typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser, - const XML_Char *openEntityNames, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); - -/* This structure is filled in by the XML_UnknownEncodingHandler -to provide information to the parser about encodings that are unknown -to the parser. -The map[b] member gives information about byte sequences -whose first byte is b. -If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar value c. -If map[b] is -1, then the byte sequence is malformed. -If map[b] is -n, where n >= 2, then b is the first byte of an n-byte -sequence that encodes a single Unicode scalar value. -The data member will be passed as the first argument to the convert function. -The convert function is used to convert multibyte sequences; -s will point to a n-byte sequence where map[(unsigned char)*s] == -n. -The convert function must return the Unicode scalar value -represented by this byte sequence or -1 if the byte sequence is malformed. -The convert function may be null if the encoding is a single-byte encoding, -that is if map[b] >= -1 for all bytes b. -When the parser is finished with the encoding, then if release is not null, -it will call release passing it the data member; -once release has been called, the convert function will not be called again. - -Expat places certain restrictions on the encodings that are supported -using this mechanism. - -1. Every ASCII character that can appear in a well-formed XML document, -other than the characters - - $@\^`{}~ - -must be represented by a single byte, and that byte must be the -same byte that represents that character in ASCII. - -2. No character may require more than 4 bytes to encode. - -3. All characters encoded must have Unicode scalar values <= 0xFFFF, -(ie characters that would be encoded by surrogates in UTF-16 -are not allowed). Note that this restriction doesn't apply to -the built-in support for UTF-8 and UTF-16. - -4. No Unicode character may be encoded by more than one distinct sequence -of bytes. */ - -typedef struct { - int map[256]; - void *data; - int (*convert)(void *data, const char *s); - void (*release)(void *data); -} XML_Encoding; - -/* This is called for an encoding that is unknown to the parser. -The encodingHandlerData argument is that which was passed as the -second argument to XML_SetUnknownEncodingHandler. -The name argument gives the name of the encoding as specified in -the encoding declaration. -If the callback can provide information about the encoding, -it must fill in the XML_Encoding structure, and return 1. -Otherwise it must return 0. -If info does not describe a suitable encoding, -then the parser will return an XML_UNKNOWN_ENCODING error. */ - -typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData, - const XML_Char *name, - XML_Encoding *info); - -void XMLPARSEAPI -XML_SetElementHandler(XML_Parser parser, - XML_StartElementHandler start, - XML_EndElementHandler end); - -void XMLPARSEAPI -XML_SetCharacterDataHandler(XML_Parser parser, - XML_CharacterDataHandler handler); - -void XMLPARSEAPI -XML_SetProcessingInstructionHandler(XML_Parser parser, - XML_ProcessingInstructionHandler handler); - -void XMLPARSEAPI -XML_SetDefaultHandler(XML_Parser parser, - XML_DefaultHandler handler); - -void XMLPARSEAPI -XML_SetUnparsedEntityDeclHandler(XML_Parser parser, - XML_UnparsedEntityDeclHandler handler); - -void XMLPARSEAPI -XML_SetNotationDeclHandler(XML_Parser parser, - XML_NotationDeclHandler handler); - -void XMLPARSEAPI -XML_SetExternalEntityRefHandler(XML_Parser parser, - XML_ExternalEntityRefHandler handler); - -void XMLPARSEAPI -XML_SetUnknownEncodingHandler(XML_Parser parser, - XML_UnknownEncodingHandler handler, - void *encodingHandlerData); - -/* This can be called within a handler for a start element, end element, -processing instruction or character data. It causes the corresponding -markup to be passed to the default handler. -Within the expansion of an internal entity, nothing will be passed -to the default handler, although this usually will not happen since -setting a default handler inhibits expansion of internal entities. */ -void XMLPARSEAPI XML_DefaultCurrent(XML_Parser parser); - -/* This value is passed as the userData argument to callbacks. */ -void XMLPARSEAPI -XML_SetUserData(XML_Parser parser, void *userData); - -/* Returns the last value set by XML_SetUserData or null. */ -#define XML_GetUserData(parser) (*(void **)(parser)) - -/* If this function is called, then the parser will be passed -as the first argument to callbacks instead of userData. -The userData will still be accessible using XML_GetUserData. */ - -void XMLPARSEAPI -XML_UseParserAsHandlerArg(XML_Parser parser); - -/* Sets the base to be used for resolving relative URIs in system identifiers in -declarations. Resolving relative identifiers is left to the application: -this value will be passed through as the base argument to the -XML_ExternalEntityRefHandler, XML_NotationDeclHandler -and XML_UnparsedEntityDeclHandler. The base argument will be copied. -Returns zero if out of memory, non-zero otherwise. */ - -int XMLPARSEAPI -XML_SetBase(XML_Parser parser, const XML_Char *base); - -const XML_Char XMLPARSEAPI * -XML_GetBase(XML_Parser parser); - -/* Parses some input. Returns 0 if a fatal error is detected. -The last call to XML_Parse must have isFinal true; -len may be zero for this call (or any other). */ -int XMLPARSEAPI -XML_Parse(XML_Parser parser, const char *s, size_t len, int isFinal); - -void XMLPARSEAPI * -XML_GetBuffer(XML_Parser parser, size_t len); - -int XMLPARSEAPI -XML_ParseBuffer(XML_Parser parser, size_t len, int isFinal); - -/* Creates an XML_Parser object that can parse an external general entity; -openEntityNames is a space-separated list of the names of the entities that are open -for the parse of this entity (including the name of this one); -encoding is the externally specified encoding, -or null if there is no externally specified encoding. -This can be called at any point after the first call to an ExternalEntityRefHandler -so longer as the parser has not yet been freed. -The new parser is completely independent and may safely be used in a separate thread. -The handlers and userData are initialized from the parser argument. -Returns 0 if out of memory. Otherwise returns a new XML_Parser object. */ -XML_Parser XMLPARSEAPI -XML_ExternalEntityParserCreate(XML_Parser parser, - const XML_Char *openEntityNames, - const XML_Char *encoding); - -enum XML_Error { - XML_ERROR_NONE, - XML_ERROR_NO_MEMORY, - XML_ERROR_SYNTAX, - XML_ERROR_NO_ELEMENTS, - XML_ERROR_INVALID_TOKEN, - XML_ERROR_UNCLOSED_TOKEN, - XML_ERROR_PARTIAL_CHAR, - XML_ERROR_TAG_MISMATCH, - XML_ERROR_DUPLICATE_ATTRIBUTE, - XML_ERROR_JUNK_AFTER_DOC_ELEMENT, - XML_ERROR_PARAM_ENTITY_REF, - XML_ERROR_UNDEFINED_ENTITY, - XML_ERROR_RECURSIVE_ENTITY_REF, - XML_ERROR_ASYNC_ENTITY, - XML_ERROR_BAD_CHAR_REF, - XML_ERROR_BINARY_ENTITY_REF, - XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, - XML_ERROR_MISPLACED_XML_PI, - XML_ERROR_UNKNOWN_ENCODING, - XML_ERROR_INCORRECT_ENCODING, - XML_ERROR_UNCLOSED_CDATA_SECTION, - XML_ERROR_EXTERNAL_ENTITY_HANDLING -}; - -/* If XML_Parse or XML_ParseBuffer have returned 0, then XML_GetErrorCode -returns information about the error. */ - -enum XML_Error XMLPARSEAPI XML_GetErrorCode(XML_Parser parser); - -/* These functions return information about the current parse location. -They may be called when XML_Parse or XML_ParseBuffer return 0; -in this case the location is the location of the character at which -the error was detected. -They may also be called from any other callback called to report -some parse event; in this the location is the location of the first -of the sequence of characters that generated the event. */ - -int XMLPARSEAPI XML_GetCurrentLineNumber(XML_Parser parser); -int XMLPARSEAPI XML_GetCurrentColumnNumber(XML_Parser parser); -long XMLPARSEAPI XML_GetCurrentByteIndex(XML_Parser parser); - -/* For backwards compatibility with previous versions. */ -#define XML_GetErrorLineNumber XML_GetCurrentLineNumber -#define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber -#define XML_GetErrorByteIndex XML_GetCurrentByteIndex - -/* Frees memory used by the parser. */ -void XMLPARSEAPI -XML_ParserFree(XML_Parser parser); - -/* Returns a string describing the error. */ -const XML_LChar XMLPARSEAPI *XML_ErrorString(enum XML_Error code); - -#ifdef __cplusplus -} -#endif - -#endif /* not XmlParse_INCLUDED */ Index: xotcl/library/xml/TclExpat-1.1/xmlrole.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/xmlrole.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/xmlrole.c (revision 0) @@ -1,1096 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ -#include /* for time_t */ - -#include "xmldef.h" -#include "xmlrole.h" - -/* Doesn't check: - - that ,| are not mixed in a model group - content of literals - -*/ - -#ifndef MIN_BYTES_PER_CHAR -#define MIN_BYTES_PER_CHAR(enc) ((enc)->minBytesPerChar) -#endif - -typedef int PROLOG_HANDLER(struct prolog_state *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc); - -static PROLOG_HANDLER - prolog0, prolog1, prolog2, - doctype0, doctype1, doctype2, doctype3, doctype4, doctype5, - internalSubset, - entity0, entity1, entity2, entity3, entity4, entity5, entity6, - entity7, entity8, entity9, - notation0, notation1, notation2, notation3, notation4, - attlist0, attlist1, attlist2, attlist3, attlist4, attlist5, attlist6, - attlist7, attlist8, attlist9, - element0, element1, element2, element3, element4, element5, element6, - element7, - declClose, - error; - -static -int syntaxError(PROLOG_STATE *); - -static -int prolog0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - state->handler = prolog1; - return XML_ROLE_NONE; - case XML_TOK_XML_DECL: - state->handler = prolog1; - return XML_ROLE_XML_DECL; - case XML_TOK_PI: - state->handler = prolog1; - return XML_ROLE_NONE; - case XML_TOK_COMMENT: - state->handler = prolog1; - case XML_TOK_BOM: - return XML_ROLE_NONE; - case XML_TOK_DECL_OPEN: - if (!XmlNameMatchesAscii(enc, - ptr + 2 * MIN_BYTES_PER_CHAR(enc), - "DOCTYPE")) - break; - state->handler = doctype0; - return XML_ROLE_NONE; - case XML_TOK_INSTANCE_START: - state->handler = error; - return XML_ROLE_INSTANCE_START; - } - return syntaxError(state); -} - -static -int prolog1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_PI: - case XML_TOK_COMMENT: - case XML_TOK_BOM: - return XML_ROLE_NONE; - case XML_TOK_DECL_OPEN: - if (!XmlNameMatchesAscii(enc, - ptr + 2 * MIN_BYTES_PER_CHAR(enc), - "DOCTYPE")) - break; - state->handler = doctype0; - return XML_ROLE_NONE; - case XML_TOK_INSTANCE_START: - state->handler = error; - return XML_ROLE_INSTANCE_START; - } - return syntaxError(state); -} - -static -int prolog2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_PI: - case XML_TOK_COMMENT: - return XML_ROLE_NONE; - case XML_TOK_INSTANCE_START: - state->handler = error; - return XML_ROLE_INSTANCE_START; - } - return syntaxError(state); -} - -static -int doctype0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - state->handler = doctype1; - return XML_ROLE_DOCTYPE_NAME; - } - return syntaxError(state); -} - -static -int doctype1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_OPEN_BRACKET: - state->handler = internalSubset; - return XML_ROLE_NONE; - case XML_TOK_DECL_CLOSE: - state->handler = prolog2; - return XML_ROLE_DOCTYPE_CLOSE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, "SYSTEM")) { - state->handler = doctype3; - return XML_ROLE_NONE; - } - if (XmlNameMatchesAscii(enc, ptr, "PUBLIC")) { - state->handler = doctype2; - return XML_ROLE_NONE; - } - break; - } - return syntaxError(state); -} - -static -int doctype2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_LITERAL: - state->handler = doctype3; - return XML_ROLE_DOCTYPE_PUBLIC_ID; - } - return syntaxError(state); -} - -static -int doctype3(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_LITERAL: - state->handler = doctype4; - return XML_ROLE_DOCTYPE_SYSTEM_ID; - } - return syntaxError(state); -} - -static -int doctype4(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_OPEN_BRACKET: - state->handler = internalSubset; - return XML_ROLE_NONE; - case XML_TOK_DECL_CLOSE: - state->handler = prolog2; - return XML_ROLE_DOCTYPE_CLOSE; - } - return syntaxError(state); -} - -static -int doctype5(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_DECL_CLOSE: - state->handler = prolog2; - return XML_ROLE_DOCTYPE_CLOSE; - } - return syntaxError(state); -} - -static -int internalSubset(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_DECL_OPEN: - if (XmlNameMatchesAscii(enc, - ptr + 2 * MIN_BYTES_PER_CHAR(enc), - "ENTITY")) { - state->handler = entity0; - return XML_ROLE_NONE; - } - if (XmlNameMatchesAscii(enc, - ptr + 2 * MIN_BYTES_PER_CHAR(enc), - "ATTLIST")) { - state->handler = attlist0; - return XML_ROLE_NONE; - } - if (XmlNameMatchesAscii(enc, - ptr + 2 * MIN_BYTES_PER_CHAR(enc), - "ELEMENT")) { - state->handler = element0; - return XML_ROLE_NONE; - } - if (XmlNameMatchesAscii(enc, - ptr + 2 * MIN_BYTES_PER_CHAR(enc), - "NOTATION")) { - state->handler = notation0; - return XML_ROLE_NONE; - } - break; - case XML_TOK_PI: - case XML_TOK_COMMENT: - return XML_ROLE_NONE; - case XML_TOK_PARAM_ENTITY_REF: - return XML_ROLE_PARAM_ENTITY_REF; - case XML_TOK_CLOSE_BRACKET: - state->handler = doctype5; - return XML_ROLE_NONE; - } - return syntaxError(state); -} - -static -int entity0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_PERCENT: - state->handler = entity1; - return XML_ROLE_NONE; - case XML_TOK_NAME: - state->handler = entity2; - return XML_ROLE_GENERAL_ENTITY_NAME; - } - return syntaxError(state); -} - -static -int entity1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - state->handler = entity7; - return XML_ROLE_PARAM_ENTITY_NAME; - } - return syntaxError(state); -} - -static -int entity2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, "SYSTEM")) { - state->handler = entity4; - return XML_ROLE_NONE; - } - if (XmlNameMatchesAscii(enc, ptr, "PUBLIC")) { - state->handler = entity3; - return XML_ROLE_NONE; - } - break; - case XML_TOK_LITERAL: - state->handler = declClose; - return XML_ROLE_ENTITY_VALUE; - } - return syntaxError(state); -} - -static -int entity3(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_LITERAL: - state->handler = entity4; - return XML_ROLE_ENTITY_PUBLIC_ID; - } - return syntaxError(state); -} - - -static -int entity4(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_LITERAL: - state->handler = entity5; - return XML_ROLE_ENTITY_SYSTEM_ID; - } - return syntaxError(state); -} - -static -int entity5(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_DECL_CLOSE: - state->handler = internalSubset; - return XML_ROLE_NONE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, "NDATA")) { - state->handler = entity6; - return XML_ROLE_NONE; - } - break; - } - return syntaxError(state); -} - -static -int entity6(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - state->handler = declClose; - return XML_ROLE_ENTITY_NOTATION_NAME; - } - return syntaxError(state); -} - -static -int entity7(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, "SYSTEM")) { - state->handler = entity9; - return XML_ROLE_NONE; - } - if (XmlNameMatchesAscii(enc, ptr, "PUBLIC")) { - state->handler = entity8; - return XML_ROLE_NONE; - } - break; - case XML_TOK_LITERAL: - state->handler = declClose; - return XML_ROLE_ENTITY_VALUE; - } - return syntaxError(state); -} - -static -int entity8(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_LITERAL: - state->handler = entity9; - return XML_ROLE_ENTITY_PUBLIC_ID; - } - return syntaxError(state); -} - -static -int entity9(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_LITERAL: - state->handler = declClose; - return XML_ROLE_ENTITY_SYSTEM_ID; - } - return syntaxError(state); -} - -static -int notation0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - state->handler = notation1; - return XML_ROLE_NOTATION_NAME; - } - return syntaxError(state); -} - -static -int notation1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, "SYSTEM")) { - state->handler = notation3; - return XML_ROLE_NONE; - } - if (XmlNameMatchesAscii(enc, ptr, "PUBLIC")) { - state->handler = notation2; - return XML_ROLE_NONE; - } - break; - } - return syntaxError(state); -} - -static -int notation2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_LITERAL: - state->handler = notation4; - return XML_ROLE_NOTATION_PUBLIC_ID; - } - return syntaxError(state); -} - -static -int notation3(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_LITERAL: - state->handler = declClose; - return XML_ROLE_NOTATION_SYSTEM_ID; - } - return syntaxError(state); -} - -static -int notation4(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_LITERAL: - state->handler = declClose; - return XML_ROLE_NOTATION_SYSTEM_ID; - case XML_TOK_DECL_CLOSE: - state->handler = internalSubset; - return XML_ROLE_NOTATION_NO_SYSTEM_ID; - } - return syntaxError(state); -} - -static -int attlist0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - state->handler = attlist1; - return XML_ROLE_ATTLIST_ELEMENT_NAME; - } - return syntaxError(state); -} - -static -int attlist1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_DECL_CLOSE: - state->handler = internalSubset; - return XML_ROLE_NONE; - case XML_TOK_NAME: - state->handler = attlist2; - return XML_ROLE_ATTRIBUTE_NAME; - } - return syntaxError(state); -} - -static -int attlist2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - { - static const char *types[] = { - "CDATA", - "ID", - "IDREF", - "IDREFS", - "ENTITY", - "ENTITIES", - "NMTOKEN", - "NMTOKENS", - }; - int i; - for (i = 0; i < (int)(sizeof(types)/sizeof(types[0])); i++) - if (XmlNameMatchesAscii(enc, ptr, types[i])) { - state->handler = attlist8; - return XML_ROLE_ATTRIBUTE_TYPE_CDATA + i; - } - } - if (XmlNameMatchesAscii(enc, ptr, "NOTATION")) { - state->handler = attlist5; - return XML_ROLE_NONE; - } - break; - case XML_TOK_OPEN_PAREN: - state->handler = attlist3; - return XML_ROLE_NONE; - } - return syntaxError(state); -} - -static -int attlist3(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NMTOKEN: - case XML_TOK_NAME: - state->handler = attlist4; - return XML_ROLE_ATTRIBUTE_ENUM_VALUE; - } - return syntaxError(state); -} - -static -int attlist4(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_CLOSE_PAREN: - state->handler = attlist8; - return XML_ROLE_NONE; - case XML_TOK_OR: - state->handler = attlist3; - return XML_ROLE_NONE; - } - return syntaxError(state); -} - -static -int attlist5(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_OPEN_PAREN: - state->handler = attlist6; - return XML_ROLE_NONE; - } - return syntaxError(state); -} - - -static -int attlist6(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - state->handler = attlist7; - return XML_ROLE_ATTRIBUTE_NOTATION_VALUE; - } - return syntaxError(state); -} - -static -int attlist7(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_CLOSE_PAREN: - state->handler = attlist8; - return XML_ROLE_NONE; - case XML_TOK_OR: - state->handler = attlist6; - return XML_ROLE_NONE; - } - return syntaxError(state); -} - -/* default value */ -static -int attlist8(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_POUND_NAME: - if (XmlNameMatchesAscii(enc, - ptr + MIN_BYTES_PER_CHAR(enc), - "IMPLIED")) { - state->handler = attlist1; - return XML_ROLE_IMPLIED_ATTRIBUTE_VALUE; - } - if (XmlNameMatchesAscii(enc, - ptr + MIN_BYTES_PER_CHAR(enc), - "REQUIRED")) { - state->handler = attlist1; - return XML_ROLE_REQUIRED_ATTRIBUTE_VALUE; - } - if (XmlNameMatchesAscii(enc, - ptr + MIN_BYTES_PER_CHAR(enc), - "FIXED")) { - state->handler = attlist9; - return XML_ROLE_NONE; - } - break; - case XML_TOK_LITERAL: - state->handler = attlist1; - return XML_ROLE_DEFAULT_ATTRIBUTE_VALUE; - } - return syntaxError(state); -} - -static -int attlist9(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_LITERAL: - state->handler = attlist1; - return XML_ROLE_FIXED_ATTRIBUTE_VALUE; - } - return syntaxError(state); -} - -static -int element0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - state->handler = element1; - return XML_ROLE_ELEMENT_NAME; - } - return syntaxError(state); -} - -static -int element1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, "EMPTY")) { - state->handler = declClose; - return XML_ROLE_CONTENT_EMPTY; - } - if (XmlNameMatchesAscii(enc, ptr, "ANY")) { - state->handler = declClose; - return XML_ROLE_CONTENT_ANY; - } - break; - case XML_TOK_OPEN_PAREN: - state->handler = element2; - state->level = 1; - return XML_ROLE_GROUP_OPEN; - } - return syntaxError(state); -} - -static -int element2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_POUND_NAME: - if (XmlNameMatchesAscii(enc, - ptr + MIN_BYTES_PER_CHAR(enc), - "PCDATA")) { - state->handler = element3; - return XML_ROLE_CONTENT_PCDATA; - } - break; - case XML_TOK_OPEN_PAREN: - state->level = 2; - state->handler = element6; - return XML_ROLE_GROUP_OPEN; - case XML_TOK_NAME: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT; - case XML_TOK_NAME_QUESTION: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT_OPT; - case XML_TOK_NAME_ASTERISK: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT_REP; - case XML_TOK_NAME_PLUS: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT_PLUS; - } - return syntaxError(state); -} - -static -int element3(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_CLOSE_PAREN: - case XML_TOK_CLOSE_PAREN_ASTERISK: - state->handler = declClose; - return XML_ROLE_GROUP_CLOSE_REP; - case XML_TOK_OR: - state->handler = element4; - return XML_ROLE_NONE; - } - return syntaxError(state); -} - -static -int element4(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - state->handler = element5; - return XML_ROLE_CONTENT_ELEMENT; - } - return syntaxError(state); -} - -static -int element5(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_CLOSE_PAREN_ASTERISK: - state->handler = declClose; - return XML_ROLE_GROUP_CLOSE_REP; - case XML_TOK_OR: - state->handler = element4; - return XML_ROLE_NONE; - } - return syntaxError(state); -} - -static -int element6(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_OPEN_PAREN: - state->level += 1; - return XML_ROLE_GROUP_OPEN; - case XML_TOK_NAME: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT; - case XML_TOK_NAME_QUESTION: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT_OPT; - case XML_TOK_NAME_ASTERISK: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT_REP; - case XML_TOK_NAME_PLUS: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT_PLUS; - } - return syntaxError(state); -} - -static -int element7(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_CLOSE_PAREN: - state->level -= 1; - if (state->level == 0) - state->handler = declClose; - return XML_ROLE_GROUP_CLOSE; - case XML_TOK_CLOSE_PAREN_ASTERISK: - state->level -= 1; - if (state->level == 0) - state->handler = declClose; - return XML_ROLE_GROUP_CLOSE_REP; - case XML_TOK_CLOSE_PAREN_QUESTION: - state->level -= 1; - if (state->level == 0) - state->handler = declClose; - return XML_ROLE_GROUP_CLOSE_OPT; - case XML_TOK_CLOSE_PAREN_PLUS: - state->level -= 1; - if (state->level == 0) - state->handler = declClose; - return XML_ROLE_GROUP_CLOSE_PLUS; - case XML_TOK_COMMA: - state->handler = element6; - return XML_ROLE_GROUP_SEQUENCE; - case XML_TOK_OR: - state->handler = element6; - return XML_ROLE_GROUP_CHOICE; - } - return syntaxError(state); -} - -static -int declClose(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_DECL_CLOSE: - state->handler = internalSubset; - return XML_ROLE_NONE; - } - return syntaxError(state); -} - -#if 0 - -static -int ignore(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_DECL_CLOSE: - state->handler = internalSubset; - return 0; - default: - return XML_ROLE_NONE; - } - return syntaxError(state); -} -#endif - -static -int error(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - return XML_ROLE_NONE; -} - -static -int syntaxError(PROLOG_STATE *state) -{ - state->handler = error; - return XML_ROLE_ERROR; -} - -void XmlPrologStateInit(PROLOG_STATE *state) -{ - state->handler = prolog0; -} Index: xotcl/library/xml/TclExpat-1.1/xmlrole.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/xmlrole.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/xmlrole.h (revision 0) @@ -1,101 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#ifndef XmlRole_INCLUDED -#define XmlRole_INCLUDED 1 - -#include "xmltok.h" - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - XML_ROLE_ERROR = -1, - XML_ROLE_NONE = 0, - XML_ROLE_XML_DECL, - XML_ROLE_INSTANCE_START, - XML_ROLE_DOCTYPE_NAME, - XML_ROLE_DOCTYPE_SYSTEM_ID, - XML_ROLE_DOCTYPE_PUBLIC_ID, - XML_ROLE_DOCTYPE_CLOSE, - XML_ROLE_GENERAL_ENTITY_NAME, - XML_ROLE_PARAM_ENTITY_NAME, - XML_ROLE_ENTITY_VALUE, - XML_ROLE_ENTITY_SYSTEM_ID, - XML_ROLE_ENTITY_PUBLIC_ID, - XML_ROLE_ENTITY_NOTATION_NAME, - XML_ROLE_NOTATION_NAME, - XML_ROLE_NOTATION_SYSTEM_ID, - XML_ROLE_NOTATION_NO_SYSTEM_ID, - XML_ROLE_NOTATION_PUBLIC_ID, - XML_ROLE_ATTRIBUTE_NAME, - XML_ROLE_ATTRIBUTE_TYPE_CDATA, - XML_ROLE_ATTRIBUTE_TYPE_ID, - XML_ROLE_ATTRIBUTE_TYPE_IDREF, - XML_ROLE_ATTRIBUTE_TYPE_IDREFS, - XML_ROLE_ATTRIBUTE_TYPE_ENTITY, - XML_ROLE_ATTRIBUTE_TYPE_ENTITIES, - XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN, - XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS, - XML_ROLE_ATTRIBUTE_ENUM_VALUE, - XML_ROLE_ATTRIBUTE_NOTATION_VALUE, - XML_ROLE_ATTLIST_ELEMENT_NAME, - XML_ROLE_IMPLIED_ATTRIBUTE_VALUE, - XML_ROLE_REQUIRED_ATTRIBUTE_VALUE, - XML_ROLE_DEFAULT_ATTRIBUTE_VALUE, - XML_ROLE_FIXED_ATTRIBUTE_VALUE, - XML_ROLE_ELEMENT_NAME, - XML_ROLE_CONTENT_ANY, - XML_ROLE_CONTENT_EMPTY, - XML_ROLE_CONTENT_PCDATA, - XML_ROLE_GROUP_OPEN, - XML_ROLE_GROUP_CLOSE, - XML_ROLE_GROUP_CLOSE_REP, - XML_ROLE_GROUP_CLOSE_OPT, - XML_ROLE_GROUP_CLOSE_PLUS, - XML_ROLE_GROUP_CHOICE, - XML_ROLE_GROUP_SEQUENCE, - XML_ROLE_CONTENT_ELEMENT, - XML_ROLE_CONTENT_ELEMENT_REP, - XML_ROLE_CONTENT_ELEMENT_OPT, - XML_ROLE_CONTENT_ELEMENT_PLUS, - XML_ROLE_PARAM_ENTITY_REF -}; - -typedef struct prolog_state { - int (*handler)(struct prolog_state *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc); - unsigned level; -} PROLOG_STATE; - -void XMLTOKAPI XmlPrologStateInit(PROLOG_STATE *); - -#define XmlTokenRole(state, tok, ptr, end, enc) \ - (((state)->handler)(state, tok, ptr, end, enc)) - -#ifdef __cplusplus -} -#endif - -#endif /* not XmlRole_INCLUDED */ Index: xotcl/library/xml/TclExpat-1.1/xmltok.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/xmltok.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/xmltok.c (revision 0) @@ -1,1135 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#include /*for size_t */ -#include "xmldef.h" -#include "xmltok.h" -#include "nametab.h" - -#define VTABLE1 \ - { PREFIX(prologTok), PREFIX(contentTok), PREFIX(cdataSectionTok) }, \ - { PREFIX(attributeValueTok), PREFIX(entityValueTok) }, \ - PREFIX(sameName), \ - PREFIX(nameMatchesAscii), \ - PREFIX(nameLength), \ - PREFIX(skipS), \ - PREFIX(getAtts), \ - PREFIX(charRefNumber), \ - PREFIX(predefinedEntityName), \ - PREFIX(updatePosition), \ - PREFIX(isPublicId) - -#define VTABLE VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16) - -#define UCS2_GET_NAMING(pages, hi, lo) \ - (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1 << ((lo) & 0x1F))) - -/* A 2 byte UTF-8 representation splits the characters 11 bits -between the bottom 5 and 6 bits of the bytes. -We need 8 bits to index into pages, 3 bits to add to that index and -5 bits to generate the mask. */ -#define UTF8_GET_NAMING2(pages, byte) \ - (namingBitmap[((pages)[(((byte)[0]) >> 2) & 7] << 3) \ - + ((((byte)[0]) & 3) << 1) \ - + ((((byte)[1]) >> 5) & 1)] \ - & (1 << (((byte)[1]) & 0x1F))) - -/* A 3 byte UTF-8 representation splits the characters 16 bits -between the bottom 4, 6 and 6 bits of the bytes. -We need 8 bits to index into pages, 3 bits to add to that index and -5 bits to generate the mask. */ -#define UTF8_GET_NAMING3(pages, byte) \ - (namingBitmap[((pages)[((((byte)[0]) & 0xF) << 4) \ - + ((((byte)[1]) >> 2) & 0xF)] \ - << 3) \ - + ((((byte)[1]) & 3) << 1) \ - + ((((byte)[2]) >> 5) & 1)] \ - & (1 << (((byte)[2]) & 0x1F))) - -#define UTF8_GET_NAMING(pages, p, n) \ - ((n) == 2 \ - ? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \ - : ((n) == 3 \ - ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) \ - : 0)) - -#define UTF8_INVALID3(p) \ - ((*p) == 0xED \ - ? (((p)[1] & 0x20) != 0) \ - : ((*p) == 0xEF \ - ? ((p)[1] == 0xBF && ((p)[2] == 0xBF || (p)[2] == 0xBE)) \ - : 0)) - -#define UTF8_INVALID4(p) ((*p) == 0xF4 && ((p)[1] & 0x30) != 0) - -static -int isNever(const ENCODING *enc, const char *p) -{ - return 0; -} - -static -int utf8_isName2(const ENCODING *enc, const char *p) -{ - return UTF8_GET_NAMING2(namePages, (const unsigned char *)p); -} - -static -int utf8_isName3(const ENCODING *enc, const char *p) -{ - return UTF8_GET_NAMING3(namePages, (const unsigned char *)p); -} - -#define utf8_isName4 isNever - -static -int utf8_isNmstrt2(const ENCODING *enc, const char *p) -{ - return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p); -} - -static -int utf8_isNmstrt3(const ENCODING *enc, const char *p) -{ - return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p); -} - -#define utf8_isNmstrt4 isNever - -#define utf8_isInvalid2 isNever - -static -int utf8_isInvalid3(const ENCODING *enc, const char *p) -{ - return UTF8_INVALID3((const unsigned char *)p); -} - -static -int utf8_isInvalid4(const ENCODING *enc, const char *p) -{ - return UTF8_INVALID4((const unsigned char *)p); -} - -struct normal_encoding { - ENCODING enc; - unsigned char type[256]; - int (*isName2)(const ENCODING *, const char *); - int (*isName3)(const ENCODING *, const char *); - int (*isName4)(const ENCODING *, const char *); - int (*isNmstrt2)(const ENCODING *, const char *); - int (*isNmstrt3)(const ENCODING *, const char *); - int (*isNmstrt4)(const ENCODING *, const char *); - int (*isInvalid2)(const ENCODING *, const char *); - int (*isInvalid3)(const ENCODING *, const char *); - int (*isInvalid4)(const ENCODING *, const char *); -}; - -#define NORMAL_VTABLE(E) \ - E ## isName2, \ - E ## isName3, \ - E ## isName4, \ - E ## isNmstrt2, \ - E ## isNmstrt3, \ - E ## isNmstrt4, \ - E ## isInvalid2, \ - E ## isInvalid3, \ - E ## isInvalid4 - -static int checkCharRefNumber(int); - -#include "xmltok_impl.h" - -/* minimum bytes per character */ -#define MINBPC 1 -#define BYTE_TYPE(enc, p) \ - (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)]) -#define BYTE_TO_ASCII(enc, p) (*p) - -#define IS_NAME_CHAR(enc, p, n) \ - (((const struct normal_encoding *)(enc))->isName ## n(enc, p)) -#define IS_NMSTRT_CHAR(enc, p, n) \ - (((const struct normal_encoding *)(enc))->isNmstrt ## n(enc, p)) -#define IS_INVALID_CHAR(enc, p, n) \ - (((const struct normal_encoding *)(enc))->isInvalid ## n(enc, p)) - -#define IS_NAME_CHAR_MINBPC(enc, p) (0) -#define IS_NMSTRT_CHAR_MINBPC(enc, p) (0) - -/* c is an ASCII character */ -#define CHAR_MATCHES(enc, p, c) (*(p) == c) - -#define PREFIX(ident) normal_ ## ident -#include "xmltok_impl.c" - -#undef MINBPC -#undef BYTE_TYPE -#undef BYTE_TO_ASCII -#undef CHAR_MATCHES -#undef IS_NAME_CHAR -#undef IS_NAME_CHAR_MINBPC -#undef IS_NMSTRT_CHAR -#undef IS_NMSTRT_CHAR_MINBPC -#undef IS_INVALID_CHAR - -enum { /* UTF8_cvalN is value of masked first byte of N byte sequence */ - UTF8_cval1 = 0x00, - UTF8_cval2 = 0xc0, - UTF8_cval3 = 0xe0, - UTF8_cval4 = 0xf0 -}; - -static -void utf8_toUtf8(const ENCODING *enc, - const char **fromP, const char *fromLim, - char **toP, const char *toLim) -{ - char *to; - const char *from; - if (fromLim - *fromP > toLim - *toP) { - /* Avoid copying partial characters. */ - for (fromLim = *fromP + (toLim - *toP); fromLim > *fromP; fromLim--) - if (((unsigned char)fromLim[-1] & 0xc0) != 0x80) - break; - } - for (to = *toP, from = *fromP; from != fromLim; from++, to++) - *to = *from; - *fromP = from; - *toP = to; -} - -static -void utf8_toUtf16(const ENCODING *enc, - const char **fromP, const char *fromLim, - unsigned short **toP, const unsigned short *toLim) -{ - unsigned short *to = *toP; - const char *from = *fromP; - while (from != fromLim && to != toLim) { - switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) { - case BT_LEAD2: - *to++ = ((from[0] & 0x1f) << 6) | (from[1] & 0x3f); - from += 2; - break; - case BT_LEAD3: - *to++ = ((from[0] & 0xf) << 12) | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f); - from += 3; - break; - case BT_LEAD4: - { - unsigned long n; - if (to + 1 == toLim) - break; - n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12) | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f); - n -= 0x10000; - to[0] = (unsigned short)((n >> 10) | 0xD800); - to[1] = (unsigned short)((n & 0x3FF) | 0xDC00); - to += 2; - from += 4; - } - break; - default: - *to++ = *from++; - break; - } - } - *fromP = from; - *toP = to; -} - -static const struct normal_encoding utf8_encoding = { - { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, - { -#include "asciitab.h" -#include "utf8tab.h" - }, - NORMAL_VTABLE(utf8_) -}; - -static const struct normal_encoding internal_utf8_encoding = { - { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, - { -#include "iasciitab.h" -#include "utf8tab.h" - }, - NORMAL_VTABLE(utf8_) -}; - -static -void latin1_toUtf8(const ENCODING *enc, - const char **fromP, const char *fromLim, - char **toP, const char *toLim) -{ - for (;;) { - unsigned char c; - if (*fromP == fromLim) - break; - c = (unsigned char)**fromP; - if (c & 0x80) { - if (toLim - *toP < 2) - break; - *(*toP)++ = ((c >> 6) | UTF8_cval2); - *(*toP)++ = ((c & 0x3f) | 0x80); - (*fromP)++; - } - else { - if (*toP == toLim) - break; - *(*toP)++ = *(*fromP)++; - } - } -} - -static -void latin1_toUtf16(const ENCODING *enc, - const char **fromP, const char *fromLim, - unsigned short **toP, const unsigned short *toLim) -{ - while (*fromP != fromLim && *toP != toLim) - *(*toP)++ = (unsigned char)*(*fromP)++; -} - -static const struct normal_encoding latin1_encoding = { - { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 }, - { -#include "asciitab.h" -#include "latin1tab.h" - } -}; - -static -void ascii_toUtf8(const ENCODING *enc, - const char **fromP, const char *fromLim, - char **toP, const char *toLim) -{ - while (*fromP != fromLim && *toP != toLim) - *(*toP)++ = *(*fromP)++; -} - -static const struct normal_encoding ascii_encoding = { - { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 }, - { -#include "asciitab.h" -/* BT_NONXML == 0 */ - } -}; - -#undef PREFIX - -static int unicode_byte_type(char hi, char lo) -{ - switch ((unsigned char)hi) { - case 0xD8: case 0xD9: case 0xDA: case 0xDB: - return BT_LEAD4; - case 0xDC: case 0xDD: case 0xDE: case 0xDF: - return BT_TRAIL; - case 0xFF: - switch ((unsigned char)lo) { - case 0xFF: - case 0xFE: - return BT_NONXML; - } - break; - } - return BT_NONASCII; -} - -#define DEFINE_UTF16_TO_UTF8 \ -static \ -void PREFIX(toUtf8)(const ENCODING *enc, \ - const char **fromP, const char *fromLim, \ - char **toP, const char *toLim) \ -{ \ - const char *from; \ - for (from = *fromP; from != fromLim; from += 2) { \ - int plane; \ - unsigned char lo2; \ - unsigned char lo = GET_LO(from); \ - unsigned char hi = GET_HI(from); \ - switch (hi) { \ - case 0: \ - if (lo < 0x80) { \ - if (*toP == toLim) { \ - *fromP = from; \ - return; \ - } \ - *(*toP)++ = lo; \ - break; \ - } \ - /* fall through */ \ - case 0x1: case 0x2: case 0x3: \ - case 0x4: case 0x5: case 0x6: case 0x7: \ - if (toLim - *toP < 2) { \ - *fromP = from; \ - return; \ - } \ - *(*toP)++ = ((lo >> 6) | (hi << 2) | UTF8_cval2); \ - *(*toP)++ = ((lo & 0x3f) | 0x80); \ - break; \ - default: \ - if (toLim - *toP < 3) { \ - *fromP = from; \ - return; \ - } \ - /* 16 bits divided 4, 6, 6 amongst 3 bytes */ \ - *(*toP)++ = ((hi >> 4) | UTF8_cval3); \ - *(*toP)++ = (((hi & 0xf) << 2) | (lo >> 6) | 0x80); \ - *(*toP)++ = ((lo & 0x3f) | 0x80); \ - break; \ - case 0xD8: case 0xD9: case 0xDA: case 0xDB: \ - if (toLim - *toP < 4) { \ - *fromP = from; \ - return; \ - } \ - plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \ - *(*toP)++ = ((plane >> 2) | UTF8_cval4); \ - *(*toP)++ = (((lo >> 2) & 0xF) | ((plane & 0x3) << 4) | 0x80); \ - from += 2; \ - lo2 = GET_LO(from); \ - *(*toP)++ = (((lo & 0x3) << 4) \ - | ((GET_HI(from) & 0x3) << 2) \ - | (lo2 >> 6) \ - | 0x80); \ - *(*toP)++ = ((lo2 & 0x3f) | 0x80); \ - break; \ - } \ - } \ - *fromP = from; \ -} - -#define DEFINE_UTF16_TO_UTF16 \ -static \ -void PREFIX(toUtf16)(const ENCODING *enc, \ - const char **fromP, const char *fromLim, \ - unsigned short **toP, const unsigned short *toLim) \ -{ \ - /* Avoid copying first half only of surrogate */ \ - if (fromLim - *fromP > ((toLim - *toP) << 1) \ - && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) \ - fromLim -= 2; \ - for (; *fromP != fromLim && *toP != toLim; *fromP += 2) \ - *(*toP)++ = (GET_HI(*fromP) << 8) | GET_LO(*fromP); \ -} - -#define PREFIX(ident) little2_ ## ident -#define MINBPC 2 -#define BYTE_TYPE(enc, p) \ - ((p)[1] == 0 \ - ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \ - : unicode_byte_type((p)[1], (p)[0])) -#define BYTE_TO_ASCII(enc, p) ((p)[1] == 0 ? (p)[0] : -1) -#define CHAR_MATCHES(enc, p, c) ((p)[1] == 0 && (p)[0] == c) -#define IS_NAME_CHAR(enc, p, n) (0) -#define IS_NAME_CHAR_MINBPC(enc, p) \ - UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0]) -#define IS_NMSTRT_CHAR(enc, p, n) (0) -#define IS_NMSTRT_CHAR_MINBPC(enc, p) \ - UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[1], (unsigned char)p[0]) - -#include "xmltok_impl.c" - -#define SET2(ptr, ch) \ - (((ptr)[0] = ((ch) & 0xff)), ((ptr)[1] = ((ch) >> 8))) -#define GET_LO(ptr) ((unsigned char)(ptr)[0]) -#define GET_HI(ptr) ((unsigned char)(ptr)[1]) - -DEFINE_UTF16_TO_UTF8 -DEFINE_UTF16_TO_UTF16 - -#undef SET2 -#undef GET_LO -#undef GET_HI -#undef MINBPC -#undef BYTE_TYPE -#undef BYTE_TO_ASCII -#undef CHAR_MATCHES -#undef IS_NAME_CHAR -#undef IS_NAME_CHAR_MINBPC -#undef IS_NMSTRT_CHAR -#undef IS_NMSTRT_CHAR_MINBPC -#undef IS_INVALID_CHAR - -static const struct normal_encoding little2_encoding = { - { VTABLE, 2, 0, -#if BYTE_ORDER == 12 - 1 -#else - 0 -#endif - }, -#include "asciitab.h" -#include "latin1tab.h" -}; - -#if BYTE_ORDER != 21 - -static const struct normal_encoding internal_little2_encoding = { - { VTABLE, 2, 0, 1 }, -#include "iasciitab.h" -#include "latin1tab.h" -}; - -#endif - -#undef PREFIX - -#define PREFIX(ident) big2_ ## ident -#define MINBPC 2 -/* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ -#define BYTE_TYPE(enc, p) \ - ((p)[0] == 0 \ - ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \ - : unicode_byte_type((p)[0], (p)[1])) -#define BYTE_TO_ASCII(enc, p) ((p)[0] == 0 ? (p)[1] : -1) -#define CHAR_MATCHES(enc, p, c) ((p)[0] == 0 && (p)[1] == c) -#define IS_NAME_CHAR(enc, p, n) 0 -#define IS_NAME_CHAR_MINBPC(enc, p) \ - UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1]) -#define IS_NMSTRT_CHAR(enc, p, n) (0) -#define IS_NMSTRT_CHAR_MINBPC(enc, p) \ - UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[0], (unsigned char)p[1]) - -#include "xmltok_impl.c" - -#define SET2(ptr, ch) \ - (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch) & 0xFF))) -#define GET_LO(ptr) ((unsigned char)(ptr)[1]) -#define GET_HI(ptr) ((unsigned char)(ptr)[0]) - -DEFINE_UTF16_TO_UTF8 -DEFINE_UTF16_TO_UTF16 - -#undef SET2 -#undef GET_LO -#undef GET_HI -#undef MINBPC -#undef BYTE_TYPE -#undef BYTE_TO_ASCII -#undef CHAR_MATCHES -#undef IS_NAME_CHAR -#undef IS_NAME_CHAR_MINBPC -#undef IS_NMSTRT_CHAR -#undef IS_NMSTRT_CHAR_MINBPC -#undef IS_INVALID_CHAR - -static const struct normal_encoding big2_encoding = { - { VTABLE, 2, 0, -#if BYTE_ORDER == 21 - 1 -#else - 0 -#endif - }, -#include "asciitab.h" -#include "latin1tab.h" -}; - -#if BYTE_ORDER != 12 - -static const struct normal_encoding internal_big2_encoding = { - { VTABLE, 2, 0, 1 }, -#include "iasciitab.h" -#include "latin1tab.h" -}; - -#endif - -#undef PREFIX - -static -int streqci(const char *s1, const char *s2) -{ - for (;;) { - char c1 = *s1++; - char c2 = *s2++; - if ('a' <= c1 && c1 <= 'z') - c1 += 'A' - 'a'; - if ('a' <= c2 && c2 <= 'z') - c2 += 'A' - 'a'; - if (c1 != c2) - return 0; - if (!c1) - break; - } - return 1; -} - -static -int initScan(const ENCODING *enc, int state, const char *ptr, const char *end, - const char **nextTokPtr) -{ - const ENCODING **encPtr; - - if (ptr == end) - return XML_TOK_NONE; - encPtr = ((const INIT_ENCODING *)enc)->encPtr; - if (ptr + 1 == end) { - switch ((unsigned char)*ptr) { - case 0xFE: - case 0xFF: - case 0x00: - case 0x3C: - return XML_TOK_PARTIAL; - } - } - else { - switch (((unsigned char)ptr[0] << 8) | (unsigned char)ptr[1]) { - case 0x003C: - *encPtr = &big2_encoding.enc; - return XmlTok(*encPtr, state, ptr, end, nextTokPtr); - case 0xFEFF: - *nextTokPtr = ptr + 2; - *encPtr = &big2_encoding.enc; - return XML_TOK_BOM; - case 0x3C00: - *encPtr = &little2_encoding.enc; - return XmlTok(*encPtr, state, ptr, end, nextTokPtr); - case 0xFFFE: - *nextTokPtr = ptr + 2; - *encPtr = &little2_encoding.enc; - return XML_TOK_BOM; - } - } - *encPtr = &utf8_encoding.enc; - return XmlTok(*encPtr, state, ptr, end, nextTokPtr); -} - -static -int initScanProlog(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - return initScan(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr); -} - -static -int initScanContent(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - return initScan(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr); -} - -static -void initUpdatePosition(const ENCODING *enc, const char *ptr, - const char *end, POSITION *pos) -{ - normal_updatePosition(&utf8_encoding.enc, ptr, end, pos); -} - -const ENCODING *XmlGetUtf8InternalEncoding() -{ - return &internal_utf8_encoding.enc; -} - -const ENCODING *XmlGetUtf16InternalEncoding() -{ -#if BYTE_ORDER == 12 - return &internal_little2_encoding.enc; -#elif BYTE_ORDER == 21 - return &internal_big2_encoding.enc; -#else - const short n = 1; - return *(const char *)&n ? &internal_little2_encoding.enc : &internal_big2_encoding.enc; -#endif -} - -int XmlInitEncoding(INIT_ENCODING *p, const ENCODING **encPtr, const char *name) -{ - if (name) { - if (streqci(name, "ISO-8859-1")) { - *encPtr = &latin1_encoding.enc; - return 1; - } - if (streqci(name, "UTF-8")) { - *encPtr = &utf8_encoding.enc; - return 1; - } - if (streqci(name, "US-ASCII")) { - *encPtr = &ascii_encoding.enc; - return 1; - } - if (!streqci(name, "UTF-16")) - return 0; - } - p->initEnc.scanners[XML_PROLOG_STATE] = initScanProlog; - p->initEnc.scanners[XML_CONTENT_STATE] = initScanContent; - p->initEnc.updatePosition = initUpdatePosition; - p->initEnc.minBytesPerChar = 1; - p->encPtr = encPtr; - *encPtr = &(p->initEnc); - return 1; -} - -static -int toAscii(const ENCODING *enc, const char *ptr, const char *end) -{ - char buf[1]; - char *p = buf; - XmlUtf8Convert(enc, &ptr, end, &p, p + 1); - if (p == buf) - return -1; - else - return buf[0]; -} - -static -int isSpace(int c) -{ - switch (c) { - case ' ': - case '\r': - case '\n': - case '\t': - return 1; - } - return 0; -} - -/* Return 1 if there's just optional white space -or there's an S followed by name=val. */ -static -int parsePseudoAttribute(const ENCODING *enc, - const char *ptr, - const char *end, - const char **namePtr, - const char **valPtr, - const char **nextTokPtr) -{ - int c; - char open; - if (ptr == end) { - *namePtr = 0; - return 1; - } - if (!isSpace(toAscii(enc, ptr, end))) { - *nextTokPtr = ptr; - return 0; - } - do { - ptr += enc->minBytesPerChar; - } while (isSpace(toAscii(enc, ptr, end))); - if (ptr == end) { - *namePtr = 0; - return 1; - } - *namePtr = ptr; - for (;;) { - c = toAscii(enc, ptr, end); - if (c == -1) { - *nextTokPtr = ptr; - return 0; - } - if (c == '=') - break; - if (isSpace(c)) { - do { - ptr += enc->minBytesPerChar; - } while (isSpace(c = toAscii(enc, ptr, end))); - if (c != '=') { - *nextTokPtr = ptr; - return 0; - } - break; - } - ptr += enc->minBytesPerChar; - } - if (ptr == *namePtr) { - *nextTokPtr = ptr; - return 0; - } - ptr += enc->minBytesPerChar; - c = toAscii(enc, ptr, end); - while (isSpace(c)) { - ptr += enc->minBytesPerChar; - c = toAscii(enc, ptr, end); - } - if (c != '"' && c != '\'') { - *nextTokPtr = ptr; - return 0; - } - open = c; - ptr += enc->minBytesPerChar; - *valPtr = ptr; - for (;; ptr += enc->minBytesPerChar) { - c = toAscii(enc, ptr, end); - if (c == open) - break; - if (!('a' <= c && c <= 'z') - && !('A' <= c && c <= 'Z') - && !('0' <= c && c <= '9') - && c != '.' - && c != '-' - && c != '_') { - *nextTokPtr = ptr; - return 0; - } - } - *nextTokPtr = ptr + enc->minBytesPerChar; - return 1; -} - -static -const ENCODING *findEncoding(const ENCODING *enc, const char *ptr, const char *end) -{ -#define ENCODING_MAX 128 - char buf[ENCODING_MAX]; - char *p = buf; - int i; - XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); - if (ptr != end) - return 0; - *p = 0; - for (i = 0; buf[i]; i++) { - if ('a' <= buf[i] && buf[i] <= 'z') - buf[i] += 'A' - 'a'; - } - if (streqci(buf, "UTF-8")) - return &utf8_encoding.enc; - if (streqci(buf, "ISO-8859-1")) - return &latin1_encoding.enc; - if (streqci(buf, "US-ASCII")) - return &ascii_encoding.enc; - if (streqci(buf, "UTF-16")) { - if (enc->minBytesPerChar == 2) - return enc; - return &big2_encoding.enc; - } - return 0; -} - -int XmlParseXmlDecl(int isGeneralTextEntity, - const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr, - const char **versionPtr, - const char **encodingName, - const ENCODING **encoding, - int *standalone) -{ - const char *val = 0; - const char *name = 0; - ptr += 5 * enc->minBytesPerChar; - end -= 2 * enc->minBytesPerChar; - if (!parsePseudoAttribute(enc, ptr, end, &name, &val, &ptr) || !name) { - *badPtr = ptr; - return 0; - } - if (!XmlNameMatchesAscii(enc, name, "version")) { - if (!isGeneralTextEntity) { - *badPtr = name; - return 0; - } - } - else { - if (versionPtr) - *versionPtr = val; - if (!parsePseudoAttribute(enc, ptr, end, &name, &val, &ptr)) { - *badPtr = ptr; - return 0; - } - if (!name) - return 1; - } - if (XmlNameMatchesAscii(enc, name, "encoding")) { - int c = toAscii(enc, val, end); - if (!('a' <= c && c <= 'z') && !('A' <= c && c <= 'Z')) { - *badPtr = val; - return 0; - } - if (encodingName) - *encodingName = val; - if (encoding) - *encoding = findEncoding(enc, val, ptr - enc->minBytesPerChar); - if (!parsePseudoAttribute(enc, ptr, end, &name, &val, &ptr)) { - *badPtr = ptr; - return 0; - } - if (!name) - return 1; - } - if (!XmlNameMatchesAscii(enc, name, "standalone") || isGeneralTextEntity) { - *badPtr = name; - return 0; - } - if (XmlNameMatchesAscii(enc, val, "yes")) { - if (standalone) - *standalone = 1; - } - else if (XmlNameMatchesAscii(enc, val, "no")) { - if (standalone) - *standalone = 0; - } - else { - *badPtr = val; - return 0; - } - while (isSpace(toAscii(enc, ptr, end))) - ptr += enc->minBytesPerChar; - if (ptr != end) { - *badPtr = ptr; - return 0; - } - return 1; -} - -static -int checkCharRefNumber(int result) -{ - switch (result >> 8) { - case 0xD8: case 0xD9: case 0xDA: case 0xDB: - case 0xDC: case 0xDD: case 0xDE: case 0xDF: - return -1; - case 0: - if (latin1_encoding.type[result] == BT_NONXML) - return -1; - break; - case 0xFF: - if (result == 0xFFFE || result == 0xFFFF) - return -1; - break; - } - return result; -} - -size_t XmlUtf8Encode(int c, char *buf) -{ - enum { - /* minN is minimum legal resulting value for N byte sequence */ - min2 = 0x80, - min3 = 0x800, - min4 = 0x10000 - }; - - if (c < 0) - return 0; - if (c < min2) { - buf[0] = (c | UTF8_cval1); - return 1; - } - if (c < min3) { - buf[0] = ((c >> 6) | UTF8_cval2); - buf[1] = ((c & 0x3f) | 0x80); - return 2; - } - if (c < min4) { - buf[0] = ((c >> 12) | UTF8_cval3); - buf[1] = (((c >> 6) & 0x3f) | 0x80); - buf[2] = ((c & 0x3f) | 0x80); - return 3; - } - if (c < 0x110000) { - buf[0] = ((c >> 18) | UTF8_cval4); - buf[1] = (((c >> 12) & 0x3f) | 0x80); - buf[2] = (((c >> 6) & 0x3f) | 0x80); - buf[3] = ((c & 0x3f) | 0x80); - return 4; - } - return 0; -} - -size_t XmlUtf16Encode(int charNum, unsigned short *buf) -{ - if (charNum < 0) - return 0; - if (charNum < 0x10000) { - buf[0] = charNum; - return 1; - } - if (charNum < 0x110000) { - charNum -= 0x10000; - buf[0] = (charNum >> 10) + 0xD800; - buf[1] = (charNum & 0x3FF) + 0xDC00; - return 2; - } - return 0; -} - -struct unknown_encoding { - struct normal_encoding normal; - int (*convert)(void *userData, const char *p); - void *userData; - unsigned short utf16[256]; - char utf8[256][4]; -}; - -int XmlSizeOfUnknownEncoding() -{ - return sizeof(struct unknown_encoding); -} - -static -int unknown_isName(const ENCODING *enc, const char *p) -{ - int c = ((const struct unknown_encoding *)enc) - ->convert(((const struct unknown_encoding *)enc)->userData, p); - if (c & ~0xFFFF) - return 0; - return UCS2_GET_NAMING(namePages, c >> 8, c & 0xFF); -} - -static -int unknown_isNmstrt(const ENCODING *enc, const char *p) -{ - int c = ((const struct unknown_encoding *)enc) - ->convert(((const struct unknown_encoding *)enc)->userData, p); - if (c & ~0xFFFF) - return 0; - return UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xFF); -} - -static -int unknown_isInvalid(const ENCODING *enc, const char *p) -{ - int c = ((const struct unknown_encoding *)enc) - ->convert(((const struct unknown_encoding *)enc)->userData, p); - return (c & ~0xFFFF) || checkCharRefNumber(c) < 0; -} - -static -void unknown_toUtf8(const ENCODING *enc, - const char **fromP, const char *fromLim, - char **toP, const char *toLim) -{ - char buf[XML_UTF8_ENCODE_MAX]; - for (;;) { - const char *utf8; - int n; - if (*fromP == fromLim) - break; - utf8 = ((const struct unknown_encoding *)enc)->utf8[(unsigned char)**fromP]; - n = *utf8++; - if (n == 0) { - int c = ((const struct unknown_encoding *)enc) - ->convert(((const struct unknown_encoding *)enc)->userData, *fromP); - n = XmlUtf8Encode(c, buf); - if (n > toLim - *toP) - break; - utf8 = buf; - *fromP += ((const struct normal_encoding *)enc)->type[(unsigned char)**fromP] - - (BT_LEAD2 - 2); - } - else { - if (n > toLim - *toP) - break; - (*fromP)++; - } - do { - *(*toP)++ = *utf8++; - } while (--n != 0); - } -} - -static -void unknown_toUtf16(const ENCODING *enc, - const char **fromP, const char *fromLim, - unsigned short **toP, const unsigned short *toLim) -{ - while (*fromP != fromLim && *toP != toLim) { - unsigned short c - = ((const struct unknown_encoding *)enc)->utf16[(unsigned char)**fromP]; - if (c == 0) { - c = (unsigned short)((const struct unknown_encoding *)enc) - ->convert(((const struct unknown_encoding *)enc)->userData, *fromP); - *fromP += ((const struct normal_encoding *)enc)->type[(unsigned char)**fromP] - - (BT_LEAD2 - 2); - } - else - (*fromP)++; - *(*toP)++ = c; - } -} - -ENCODING * -XmlInitUnknownEncoding(void *mem, - int *table, - int (*convert)(void *userData, const char *p), - void *userData) -{ - int i; - struct unknown_encoding *e = mem; - for (i = 0; i < sizeof(struct normal_encoding); i++) - ((char *)mem)[i] = ((char *)&latin1_encoding)[i]; - for (i = 0; i < 128; i++) - if (latin1_encoding.type[i] != BT_OTHER - && latin1_encoding.type[i] != BT_NONXML - && table[i] != i) - return 0; - for (i = 0; i < 256; i++) { - int c = table[i]; - if (c == -1) { - e->normal.type[i] = BT_MALFORM; - /* This shouldn't really get used. */ - e->utf16[i] = 0xFFFF; - e->utf8[i][0] = 1; - e->utf8[i][1] = 0; - } - else if (c < 0) { - if (c < -4) - return 0; - e->normal.type[i] = BT_LEAD2 - (c + 2); - e->utf8[i][0] = 0; - e->utf16[i] = 0; - } - else if (c < 0x80) { - if (latin1_encoding.type[c] != BT_OTHER - && latin1_encoding.type[c] != BT_NONXML - && c != i) - return 0; - e->normal.type[i] = latin1_encoding.type[c]; - e->utf8[i][0] = 1; - e->utf8[i][1] = (char)c; - e->utf16[i] = c == 0 ? 0xFFFF : c; - } - else if (checkCharRefNumber(c) < 0) { - e->normal.type[i] = BT_NONXML; - /* This shouldn't really get used. */ - e->utf16[i] = 0xFFFF; - e->utf8[i][0] = 1; - e->utf8[i][1] = 0; - } - else { - if (c > 0xFFFF) - return 0; - if (UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xff)) - e->normal.type[i] = BT_NMSTRT; - else if (UCS2_GET_NAMING(namePages, c >> 8, c & 0xff)) - e->normal.type[i] = BT_NAME; - else - e->normal.type[i] = BT_OTHER; - e->utf8[i][0] = (char)XmlUtf8Encode(c, e->utf8[i] + 1); - e->utf16[i] = c; - } - } - e->userData = userData; - e->convert = convert; - if (convert) { - e->normal.isName2 = unknown_isName; - e->normal.isName3 = unknown_isName; - e->normal.isName4 = unknown_isName; - e->normal.isNmstrt2 = unknown_isNmstrt; - e->normal.isNmstrt3 = unknown_isNmstrt; - e->normal.isNmstrt4 = unknown_isNmstrt; - e->normal.isInvalid2 = unknown_isInvalid; - e->normal.isInvalid3 = unknown_isInvalid; - e->normal.isInvalid4 = unknown_isInvalid; - } - e->normal.enc.utf8Convert = unknown_toUtf8; - e->normal.enc.utf16Convert = unknown_toUtf16; - return &(e->normal.enc); -} Index: xotcl/library/xml/TclExpat-1.1/xmltok.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/xmltok.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/xmltok.h (revision 0) @@ -1,276 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#ifndef XmlTok_INCLUDED -#define XmlTok_INCLUDED 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef XMLTOKAPI -#define XMLTOKAPI /* as nothing */ -#endif - -/* The following token may be returned by XmlContentTok */ -#define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be start of - illegal ]]> sequence */ -/* The following tokens may be returned by both XmlPrologTok and XmlContentTok */ -#define XML_TOK_NONE -4 /* The string to be scanned is empty */ -#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; - might be part of CRLF sequence */ -#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ -#define XML_TOK_PARTIAL -1 /* only part of a token */ -#define XML_TOK_INVALID 0 - -/* The following tokens are returned by XmlContentTok; some are also - returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok */ - -#define XML_TOK_START_TAG_WITH_ATTS 1 -#define XML_TOK_START_TAG_NO_ATTS 2 -#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag */ -#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4 -#define XML_TOK_END_TAG 5 -#define XML_TOK_DATA_CHARS 6 -#define XML_TOK_DATA_NEWLINE 7 -#define XML_TOK_CDATA_SECT_OPEN 8 -#define XML_TOK_ENTITY_REF 9 -#define XML_TOK_CHAR_REF 10 /* numeric character reference */ - -/* The following tokens may be returned by both XmlPrologTok and XmlContentTok */ -#define XML_TOK_PI 11 /* processing instruction */ -#define XML_TOK_XML_DECL 12 /* XML decl or text decl */ -#define XML_TOK_COMMENT 13 -#define XML_TOK_BOM 14 /* Byte order mark */ - -/* The following tokens are returned only by XmlPrologTok */ -#define XML_TOK_PROLOG_S 15 -#define XML_TOK_DECL_OPEN 16 /* */ -#define XML_TOK_NAME 18 -#define XML_TOK_NMTOKEN 19 -#define XML_TOK_POUND_NAME 20 /* #name */ -#define XML_TOK_OR 21 /* | */ -#define XML_TOK_PERCENT 22 -#define XML_TOK_OPEN_PAREN 23 -#define XML_TOK_CLOSE_PAREN 24 -#define XML_TOK_OPEN_BRACKET 25 -#define XML_TOK_CLOSE_BRACKET 26 -#define XML_TOK_LITERAL 27 -#define XML_TOK_PARAM_ENTITY_REF 28 -#define XML_TOK_INSTANCE_START 29 - -/* The following occur only in element type declarations */ -#define XML_TOK_NAME_QUESTION 30 /* name? */ -#define XML_TOK_NAME_ASTERISK 31 /* name* */ -#define XML_TOK_NAME_PLUS 32 /* name+ */ -#define XML_TOK_COND_SECT_OPEN 33 /* */ -#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */ -#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */ -#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */ -#define XML_TOK_COMMA 38 - -/* The following token is returned only by XmlAttributeValueTok */ -#define XML_TOK_ATTRIBUTE_VALUE_S 39 - -/* The following token is returned only by XmlCdataSectionTok */ -#define XML_TOK_CDATA_SECT_CLOSE 40 - -#define XML_N_STATES 3 -#define XML_PROLOG_STATE 0 -#define XML_CONTENT_STATE 1 -#define XML_CDATA_SECTION_STATE 2 - -#define XML_N_LITERAL_TYPES 2 -#define XML_ATTRIBUTE_VALUE_LITERAL 0 -#define XML_ENTITY_VALUE_LITERAL 1 - -/* The size of the buffer passed to XmlUtf8Encode must be at least this. */ -#define XML_UTF8_ENCODE_MAX 4 -/* The size of the buffer passed to XmlUtf16Encode must be at least this. */ -#define XML_UTF16_ENCODE_MAX 2 - -typedef struct position { - /* first line and first column are 0 not 1 */ - unsigned long lineNumber; - unsigned long columnNumber; -} POSITION; - -typedef struct { - const char *name; - const char *valuePtr; - const char *valueEnd; - char normalized; -} ATTRIBUTE; - -struct encoding; -typedef struct encoding ENCODING; - -struct encoding { - int (*scanners[XML_N_STATES])(const ENCODING *, - const char *, - const char *, - const char **); - int (*literalScanners[XML_N_LITERAL_TYPES])(const ENCODING *, - const char *, - const char *, - const char **); - int (*sameName)(const ENCODING *, - const char *, const char *); - int (*nameMatchesAscii)(const ENCODING *, - const char *, const char *); - int (*nameLength)(const ENCODING *, const char *); - const char *(*skipS)(const ENCODING *, const char *); - int (*getAtts)(const ENCODING *enc, const char *ptr, - int attsMax, ATTRIBUTE *atts); - int (*charRefNumber)(const ENCODING *enc, const char *ptr); - int (*predefinedEntityName)(const ENCODING *, const char *, const char *); - void (*updatePosition)(const ENCODING *, - const char *ptr, - const char *end, - POSITION *); - int (*isPublicId)(const ENCODING *enc, const char *ptr, const char *end, - const char **badPtr); - void (*utf8Convert)(const ENCODING *enc, - const char **fromP, - const char *fromLim, - char **toP, - const char *toLim); - void (*utf16Convert)(const ENCODING *enc, - const char **fromP, - const char *fromLim, - unsigned short **toP, - const unsigned short *toLim); - int minBytesPerChar; - char isUtf8; - char isUtf16; -}; - -/* -Scan the string starting at ptr until the end of the next complete token, -but do not scan past eptr. Return an integer giving the type of token. - -Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set. - -Return XML_TOK_PARTIAL when the string does not contain a complete token; -nextTokPtr will not be set. - -Return XML_TOK_INVALID when the string does not start a valid token; nextTokPtr -will be set to point to the character which made the token invalid. - -Otherwise the string starts with a valid token; nextTokPtr will be set to point -to the character following the end of that token. - -Each data character counts as a single token, but adjacent data characters -may be returned together. Similarly for characters in the prolog outside -literals, comments and processing instructions. -*/ - - -#define XmlTok(enc, state, ptr, end, nextTokPtr) \ - (((enc)->scanners[state])(enc, ptr, end, nextTokPtr)) - -#define XmlPrologTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr) - -#define XmlContentTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr) - -#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr) - -/* This is used for performing a 2nd-level tokenization on -the content of a literal that has already been returned by XmlTok. */ - -#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \ - (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr)) - -#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \ - XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr) - -#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \ - XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr) - -#define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2)) - -#define XmlNameMatchesAscii(enc, ptr1, ptr2) \ - (((enc)->nameMatchesAscii)(enc, ptr1, ptr2)) - -#define XmlNameLength(enc, ptr) \ - (((enc)->nameLength)(enc, ptr)) - -#define XmlSkipS(enc, ptr) \ - (((enc)->skipS)(enc, ptr)) - -#define XmlGetAttributes(enc, ptr, attsMax, atts) \ - (((enc)->getAtts)(enc, ptr, attsMax, atts)) - -#define XmlCharRefNumber(enc, ptr) \ - (((enc)->charRefNumber)(enc, ptr)) - -#define XmlPredefinedEntityName(enc, ptr, end) \ - (((enc)->predefinedEntityName)(enc, ptr, end)) - -#define XmlUpdatePosition(enc, ptr, end, pos) \ - (((enc)->updatePosition)(enc, ptr, end, pos)) - -#define XmlIsPublicId(enc, ptr, end, badPtr) \ - (((enc)->isPublicId)(enc, ptr, end, badPtr)) - -#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \ - (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) - -#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \ - (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim)) - -typedef struct { - ENCODING initEnc; - const ENCODING **encPtr; -} INIT_ENCODING; - -int XMLTOKAPI XmlParseXmlDecl(int isGeneralTextEntity, - const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr, - const char **versionPtr, - const char **encodingNamePtr, - const ENCODING **namedEncodingPtr, - int *standalonePtr); - -int XMLTOKAPI XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); -const ENCODING XMLTOKAPI *XmlGetUtf8InternalEncoding(); -const ENCODING XMLTOKAPI *XmlGetUtf16InternalEncoding(); -size_t XMLTOKAPI XmlUtf8Encode(int charNumber, char *buf); -size_t XMLTOKAPI XmlUtf16Encode(int charNumber, unsigned short *buf); - -int XMLTOKAPI XmlSizeOfUnknownEncoding(); -ENCODING XMLTOKAPI * -XmlInitUnknownEncoding(void *mem, - int *table, - int (*convert)(void *userData, const char *p), - void *userData); - -#ifdef __cplusplus -} -#endif - -#endif /* not XmlTok_INCLUDED */ Index: xotcl/library/xml/TclExpat-1.1/xmltok_impl.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/xmltok_impl.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/xmltok_impl.c (revision 0) @@ -1,1643 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#ifndef IS_INVALID_CHAR -#define IS_INVALID_CHAR(enc, ptr, n) (0) -#endif - -#define INVALID_LEAD_CASE(n, ptr, nextTokPtr) \ - case BT_LEAD ## n: \ - if (end - ptr < n) \ - return XML_TOK_PARTIAL_CHAR; \ - if (IS_INVALID_CHAR(enc, ptr, n)) { \ - *(nextTokPtr) = (ptr); \ - return XML_TOK_INVALID; \ - } \ - ptr += n; \ - break; - -#define INVALID_CASES(ptr, nextTokPtr) \ - INVALID_LEAD_CASE(2, ptr, nextTokPtr) \ - INVALID_LEAD_CASE(3, ptr, nextTokPtr) \ - INVALID_LEAD_CASE(4, ptr, nextTokPtr) \ - case BT_NONXML: \ - case BT_MALFORM: \ - case BT_TRAIL: \ - *(nextTokPtr) = (ptr); \ - return XML_TOK_INVALID; - -#define CHECK_NAME_CASE(n, enc, ptr, end, nextTokPtr) \ - case BT_LEAD ## n: \ - if (end - ptr < n) \ - return XML_TOK_PARTIAL_CHAR; \ - if (!IS_NAME_CHAR(enc, ptr, n)) { \ - *nextTokPtr = ptr; \ - return XML_TOK_INVALID; \ - } \ - ptr += n; \ - break; - -#define CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) \ - case BT_NONASCII: \ - if (!IS_NAME_CHAR_MINBPC(enc, ptr)) { \ - *nextTokPtr = ptr; \ - return XML_TOK_INVALID; \ - } \ - case BT_NMSTRT: \ - case BT_HEX: \ - case BT_DIGIT: \ - case BT_NAME: \ - case BT_MINUS: \ - ptr += MINBPC; \ - break; \ - CHECK_NAME_CASE(2, enc, ptr, end, nextTokPtr) \ - CHECK_NAME_CASE(3, enc, ptr, end, nextTokPtr) \ - CHECK_NAME_CASE(4, enc, ptr, end, nextTokPtr) - -#define CHECK_NMSTRT_CASE(n, enc, ptr, end, nextTokPtr) \ - case BT_LEAD ## n: \ - if (end - ptr < n) \ - return XML_TOK_PARTIAL_CHAR; \ - if (!IS_NMSTRT_CHAR(enc, ptr, n)) { \ - *nextTokPtr = ptr; \ - return XML_TOK_INVALID; \ - } \ - ptr += n; \ - break; - -#define CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) \ - case BT_NONASCII: \ - if (!IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { \ - *nextTokPtr = ptr; \ - return XML_TOK_INVALID; \ - } \ - case BT_NMSTRT: \ - case BT_HEX: \ - ptr += MINBPC; \ - break; \ - CHECK_NMSTRT_CASE(2, enc, ptr, end, nextTokPtr) \ - CHECK_NMSTRT_CASE(3, enc, ptr, end, nextTokPtr) \ - CHECK_NMSTRT_CASE(4, enc, ptr, end, nextTokPtr) - -#ifndef PREFIX -#define PREFIX(ident) ident -#endif - -/* ptr points to character following "')) { - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - *nextTokPtr = ptr + MINBPC; - return XML_TOK_COMMENT; - } - /* fall through */ - default: - ptr += MINBPC; - break; - } - } - } - return XML_TOK_PARTIAL; -} - -/* ptr points to character following " */ - switch (BYTE_TYPE(enc, ptr + MINBPC)) { - case BT_S: case BT_CR: case BT_LF: case BT_PERCNT: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - /* fall through */ - case BT_S: case BT_CR: case BT_LF: - *nextTokPtr = ptr; - return XML_TOK_DECL_OPEN; - case BT_NMSTRT: - case BT_HEX: - ptr += MINBPC; - break; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - } - return XML_TOK_PARTIAL; -} - -static -int PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, int *tokPtr) -{ - int upper = 0; - *tokPtr = XML_TOK_PI; - if (end - ptr != MINBPC*3) - return 1; - switch (BYTE_TO_ASCII(enc, ptr)) { - case 'x': - break; - case 'X': - upper = 1; - break; - default: - return 1; - } - ptr += MINBPC; - switch (BYTE_TO_ASCII(enc, ptr)) { - case 'm': - break; - case 'M': - upper = 1; - break; - default: - return 1; - } - ptr += MINBPC; - switch (BYTE_TO_ASCII(enc, ptr)) { - case 'l': - break; - case 'L': - upper = 1; - break; - default: - return 1; - } - if (upper) - return 0; - *tokPtr = XML_TOK_XML_DECL; - return 1; -} - -/* ptr points to character following "')) { - *nextTokPtr = ptr + MINBPC; - return tok; - } - break; - default: - ptr += MINBPC; - break; - } - } - return XML_TOK_PARTIAL; - case BT_QUEST: - if (!PREFIX(checkPiTarget)(enc, target, ptr, &tok)) { - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - ptr += MINBPC; - if (ptr == end) - return XML_TOK_PARTIAL; - if (CHAR_MATCHES(enc, ptr, '>')) { - *nextTokPtr = ptr + MINBPC; - return tok; - } - /* fall through */ - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - } - return XML_TOK_PARTIAL; -} - - -static -int PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - int i; - /* CDATA[ */ - if (end - ptr < 6 * MINBPC) - return XML_TOK_PARTIAL; - for (i = 0; i < 6; i++, ptr += MINBPC) { - if (!CHAR_MATCHES(enc, ptr, "CDATA["[i])) { - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - } - *nextTokPtr = ptr; - return XML_TOK_CDATA_SECT_OPEN; -} - -static -int PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - if (ptr == end) - return XML_TOK_NONE; -#if MINBPC > 1 - { - size_t n = end - ptr; - if (n & (MINBPC - 1)) { - n &= ~(MINBPC - 1); - if (n == 0) - return XML_TOK_PARTIAL; - end = ptr + n; - } - } -#endif - switch (BYTE_TYPE(enc, ptr)) { - case BT_RSQB: - ptr += MINBPC; - if (ptr == end) - return XML_TOK_PARTIAL; - if (!CHAR_MATCHES(enc, ptr, ']')) - break; - ptr += MINBPC; - if (ptr == end) - return XML_TOK_PARTIAL; - if (!CHAR_MATCHES(enc, ptr, '>')) { - ptr -= MINBPC; - break; - } - *nextTokPtr = ptr + MINBPC; - return XML_TOK_CDATA_SECT_CLOSE; - case BT_CR: - ptr += MINBPC; - if (ptr == end) - return XML_TOK_PARTIAL; - if (BYTE_TYPE(enc, ptr) == BT_LF) - ptr += MINBPC; - *nextTokPtr = ptr; - return XML_TOK_DATA_NEWLINE; - case BT_LF: - *nextTokPtr = ptr + MINBPC; - return XML_TOK_DATA_NEWLINE; - INVALID_CASES(ptr, nextTokPtr) - default: - ptr += MINBPC; - break; - } - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: \ - if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ - *nextTokPtr = ptr; \ - return XML_TOK_DATA_CHARS; \ - } \ - ptr += n; \ - break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_NONXML: - case BT_MALFORM: - case BT_TRAIL: - case BT_CR: - case BT_LF: - case BT_RSQB: - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - default: - ptr += MINBPC; - break; - } - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; -} - -/* ptr points to character following "')) { - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - *nextTokPtr = ptr + MINBPC; - return XML_TOK_EMPTY_ELEMENT_WITH_ATTS; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - break; - } - break; - } - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - } - return XML_TOK_PARTIAL; -} - -/* ptr points to character following "<" */ - -static -int PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - if (ptr == end) - return XML_TOK_PARTIAL; - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) - case BT_EXCL: - if ((ptr += MINBPC) == end) - return XML_TOK_PARTIAL; - switch (BYTE_TYPE(enc, ptr)) { - case BT_MINUS: - return PREFIX(scanComment)(enc, ptr + MINBPC, end, nextTokPtr); - case BT_LSQB: - return PREFIX(scanCdataSection)(enc, ptr + MINBPC, end, nextTokPtr); - } - *nextTokPtr = ptr; - return XML_TOK_INVALID; - case BT_QUEST: - return PREFIX(scanPi)(enc, ptr + MINBPC, end, nextTokPtr); - case BT_SOL: - return PREFIX(scanEndTag)(enc, ptr + MINBPC, end, nextTokPtr); - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - /* we have a start-tag */ - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) - case BT_S: case BT_CR: case BT_LF: - { - ptr += MINBPC; - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) - case BT_GT: - goto gt; - case BT_SOL: - goto sol; - case BT_S: case BT_CR: case BT_LF: - ptr += MINBPC; - continue; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - return PREFIX(scanAtts)(enc, ptr, end, nextTokPtr); - } - return XML_TOK_PARTIAL; - } - case BT_GT: - gt: - *nextTokPtr = ptr + MINBPC; - return XML_TOK_START_TAG_NO_ATTS; - case BT_SOL: - sol: - ptr += MINBPC; - if (ptr == end) - return XML_TOK_PARTIAL; - if (!CHAR_MATCHES(enc, ptr, '>')) { - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - *nextTokPtr = ptr + MINBPC; - return XML_TOK_EMPTY_ELEMENT_NO_ATTS; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - } - return XML_TOK_PARTIAL; -} - -static -int PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - if (ptr == end) - return XML_TOK_NONE; -#if MINBPC > 1 - { - size_t n = end - ptr; - if (n & (MINBPC - 1)) { - n &= ~(MINBPC - 1); - if (n == 0) - return XML_TOK_PARTIAL; - end = ptr + n; - } - } -#endif - switch (BYTE_TYPE(enc, ptr)) { - case BT_LT: - return PREFIX(scanLt)(enc, ptr + MINBPC, end, nextTokPtr); - case BT_AMP: - return PREFIX(scanRef)(enc, ptr + MINBPC, end, nextTokPtr); - case BT_CR: - ptr += MINBPC; - if (ptr == end) - return XML_TOK_TRAILING_CR; - if (BYTE_TYPE(enc, ptr) == BT_LF) - ptr += MINBPC; - *nextTokPtr = ptr; - return XML_TOK_DATA_NEWLINE; - case BT_LF: - *nextTokPtr = ptr + MINBPC; - return XML_TOK_DATA_NEWLINE; - case BT_RSQB: - ptr += MINBPC; - if (ptr == end) - return XML_TOK_TRAILING_RSQB; - if (!CHAR_MATCHES(enc, ptr, ']')) - break; - ptr += MINBPC; - if (ptr == end) - return XML_TOK_TRAILING_RSQB; - if (!CHAR_MATCHES(enc, ptr, '>')) { - ptr -= MINBPC; - break; - } - *nextTokPtr = ptr; - return XML_TOK_INVALID; - INVALID_CASES(ptr, nextTokPtr) - default: - ptr += MINBPC; - break; - } - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: \ - if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ - *nextTokPtr = ptr; \ - return XML_TOK_DATA_CHARS; \ - } \ - ptr += n; \ - break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_RSQB: - if (ptr + MINBPC != end) { - if (!CHAR_MATCHES(enc, ptr + MINBPC, ']')) { - ptr += MINBPC; - break; - } - if (ptr + 2*MINBPC != end) { - if (!CHAR_MATCHES(enc, ptr + 2*MINBPC, '>')) { - ptr += MINBPC; - break; - } - *nextTokPtr = ptr + 2*MINBPC; - return XML_TOK_INVALID; - } - } - /* fall through */ - case BT_AMP: - case BT_LT: - case BT_NONXML: - case BT_MALFORM: - case BT_TRAIL: - case BT_CR: - case BT_LF: - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - default: - ptr += MINBPC; - break; - } - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; -} - -/* ptr points to character following "%" */ - -static -int PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - if (ptr == end) - return XML_TOK_PARTIAL; - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) - case BT_S: case BT_LF: case BT_CR: case BT_PERCNT: - *nextTokPtr = ptr; - return XML_TOK_PERCENT; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) - case BT_SEMI: - *nextTokPtr = ptr + MINBPC; - return XML_TOK_PARAM_ENTITY_REF; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - } - return XML_TOK_PARTIAL; -} - -static -int PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - if (ptr == end) - return XML_TOK_PARTIAL; - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) - case BT_CR: case BT_LF: case BT_S: - case BT_RPAR: case BT_GT: case BT_PERCNT: case BT_VERBAR: - *nextTokPtr = ptr; - return XML_TOK_POUND_NAME; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - } - return XML_TOK_PARTIAL; -} - -static -int PREFIX(scanLit)(int open, const ENCODING *enc, - const char *ptr, const char *end, - const char **nextTokPtr) -{ - while (ptr != end) { - int t = BYTE_TYPE(enc, ptr); - switch (t) { - INVALID_CASES(ptr, nextTokPtr) - case BT_QUOT: - case BT_APOS: - ptr += MINBPC; - if (t != open) - break; - if (ptr == end) - return XML_TOK_PARTIAL; - *nextTokPtr = ptr; - switch (BYTE_TYPE(enc, ptr)) { - case BT_S: case BT_CR: case BT_LF: - case BT_GT: case BT_PERCNT: case BT_LSQB: - return XML_TOK_LITERAL; - default: - return XML_TOK_INVALID; - } - default: - ptr += MINBPC; - break; - } - } - return XML_TOK_PARTIAL; -} - -static -int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - int tok; - if (ptr == end) - return XML_TOK_NONE; -#if MINBPC > 1 - { - size_t n = end - ptr; - if (n & (MINBPC - 1)) { - n &= ~(MINBPC - 1); - if (n == 0) - return XML_TOK_PARTIAL; - end = ptr + n; - } - } -#endif - switch (BYTE_TYPE(enc, ptr)) { - case BT_QUOT: - return PREFIX(scanLit)(BT_QUOT, enc, ptr + MINBPC, end, nextTokPtr); - case BT_APOS: - return PREFIX(scanLit)(BT_APOS, enc, ptr + MINBPC, end, nextTokPtr); - case BT_LT: - { - ptr += MINBPC; - if (ptr == end) - return XML_TOK_PARTIAL; - switch (BYTE_TYPE(enc, ptr)) { - case BT_EXCL: - return PREFIX(scanDecl)(enc, ptr + MINBPC, end, nextTokPtr); - case BT_QUEST: - return PREFIX(scanPi)(enc, ptr + MINBPC, end, nextTokPtr); - case BT_NMSTRT: - case BT_HEX: - case BT_NONASCII: - case BT_LEAD2: - case BT_LEAD3: - case BT_LEAD4: - *nextTokPtr = ptr - MINBPC; - return XML_TOK_INSTANCE_START; - } - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - case BT_CR: - if (ptr + MINBPC == end) - return XML_TOK_TRAILING_CR; - /* fall through */ - case BT_S: case BT_LF: - for (;;) { - ptr += MINBPC; - if (ptr == end) - break; - switch (BYTE_TYPE(enc, ptr)) { - case BT_S: case BT_LF: - break; - case BT_CR: - /* don't split CR/LF pair */ - if (ptr + MINBPC != end) - break; - /* fall through */ - default: - *nextTokPtr = ptr; - return XML_TOK_PROLOG_S; - } - } - *nextTokPtr = ptr; - return XML_TOK_PROLOG_S; - case BT_PERCNT: - return PREFIX(scanPercent)(enc, ptr + MINBPC, end, nextTokPtr); - case BT_COMMA: - *nextTokPtr = ptr + MINBPC; - return XML_TOK_COMMA; - case BT_LSQB: - *nextTokPtr = ptr + MINBPC; - return XML_TOK_OPEN_BRACKET; - case BT_RSQB: - ptr += MINBPC; - if (ptr == end) - return XML_TOK_PARTIAL; - if (CHAR_MATCHES(enc, ptr, ']')) { - if (ptr + MINBPC == end) - return XML_TOK_PARTIAL; - if (CHAR_MATCHES(enc, ptr + MINBPC, '>')) { - *nextTokPtr = ptr + 2*MINBPC; - return XML_TOK_COND_SECT_CLOSE; - } - } - *nextTokPtr = ptr; - return XML_TOK_CLOSE_BRACKET; - case BT_LPAR: - *nextTokPtr = ptr + MINBPC; - return XML_TOK_OPEN_PAREN; - case BT_RPAR: - ptr += MINBPC; - if (ptr == end) - return XML_TOK_PARTIAL; - switch (BYTE_TYPE(enc, ptr)) { - case BT_AST: - *nextTokPtr = ptr + MINBPC; - return XML_TOK_CLOSE_PAREN_ASTERISK; - case BT_QUEST: - *nextTokPtr = ptr + MINBPC; - return XML_TOK_CLOSE_PAREN_QUESTION; - case BT_PLUS: - *nextTokPtr = ptr + MINBPC; - return XML_TOK_CLOSE_PAREN_PLUS; - case BT_CR: case BT_LF: case BT_S: - case BT_GT: case BT_COMMA: case BT_VERBAR: - case BT_RPAR: - *nextTokPtr = ptr; - return XML_TOK_CLOSE_PAREN; - } - *nextTokPtr = ptr; - return XML_TOK_INVALID; - case BT_VERBAR: - *nextTokPtr = ptr + MINBPC; - return XML_TOK_OR; - case BT_GT: - *nextTokPtr = ptr + MINBPC; - return XML_TOK_DECL_CLOSE; - case BT_NUM: - return PREFIX(scanPoundName)(enc, ptr + MINBPC, end, nextTokPtr); -#define LEAD_CASE(n) \ - case BT_LEAD ## n: \ - if (end - ptr < n) \ - return XML_TOK_PARTIAL_CHAR; \ - if (IS_NMSTRT_CHAR(enc, ptr, n)) { \ - ptr += n; \ - tok = XML_TOK_NAME; \ - break; \ - } \ - if (IS_NAME_CHAR(enc, ptr, n)) { \ - ptr += n; \ - tok = XML_TOK_NMTOKEN; \ - break; \ - } \ - *nextTokPtr = ptr; \ - return XML_TOK_INVALID; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_NMSTRT: - case BT_HEX: - tok = XML_TOK_NAME; - ptr += MINBPC; - break; - case BT_DIGIT: - case BT_NAME: - case BT_MINUS: - tok = XML_TOK_NMTOKEN; - ptr += MINBPC; - break; - case BT_NONASCII: - if (IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { - ptr += MINBPC; - tok = XML_TOK_NAME; - break; - } - if (IS_NAME_CHAR_MINBPC(enc, ptr)) { - ptr += MINBPC; - tok = XML_TOK_NMTOKEN; - break; - } - /* fall through */ - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) - case BT_GT: case BT_RPAR: case BT_COMMA: - case BT_VERBAR: case BT_LSQB: case BT_PERCNT: - case BT_S: case BT_CR: case BT_LF: - *nextTokPtr = ptr; - return tok; - case BT_PLUS: - if (tok != XML_TOK_NAME) { - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - *nextTokPtr = ptr + MINBPC; - return XML_TOK_NAME_PLUS; - case BT_AST: - if (tok != XML_TOK_NAME) { - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - *nextTokPtr = ptr + MINBPC; - return XML_TOK_NAME_ASTERISK; - case BT_QUEST: - if (tok != XML_TOK_NAME) { - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - *nextTokPtr = ptr + MINBPC; - return XML_TOK_NAME_QUESTION; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - } - return XML_TOK_PARTIAL; -} - -static -int PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - const char *start; - if (ptr == end) - return XML_TOK_NONE; - start = ptr; - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: ptr += n; break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_AMP: - if (ptr == start) - return PREFIX(scanRef)(enc, ptr + MINBPC, end, nextTokPtr); - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - case BT_LT: - /* this is for inside entity references */ - *nextTokPtr = ptr; - return XML_TOK_INVALID; - case BT_LF: - if (ptr == start) { - *nextTokPtr = ptr + MINBPC; - return XML_TOK_DATA_NEWLINE; - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - case BT_CR: - if (ptr == start) { - ptr += MINBPC; - if (ptr == end) - return XML_TOK_TRAILING_CR; - if (BYTE_TYPE(enc, ptr) == BT_LF) - ptr += MINBPC; - *nextTokPtr = ptr; - return XML_TOK_DATA_NEWLINE; - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - case BT_S: - if (ptr == start) { - *nextTokPtr = ptr + MINBPC; - return XML_TOK_ATTRIBUTE_VALUE_S; - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - default: - ptr += MINBPC; - break; - } - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; -} - -static -int PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - const char *start; - if (ptr == end) - return XML_TOK_NONE; - start = ptr; - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: ptr += n; break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_AMP: - if (ptr == start) - return PREFIX(scanRef)(enc, ptr + MINBPC, end, nextTokPtr); - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - case BT_PERCNT: - if (ptr == start) - return PREFIX(scanPercent)(enc, ptr + MINBPC, end, nextTokPtr); - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - case BT_LF: - if (ptr == start) { - *nextTokPtr = ptr + MINBPC; - return XML_TOK_DATA_NEWLINE; - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - case BT_CR: - if (ptr == start) { - ptr += MINBPC; - if (ptr == end) - return XML_TOK_TRAILING_CR; - if (BYTE_TYPE(enc, ptr) == BT_LF) - ptr += MINBPC; - *nextTokPtr = ptr; - return XML_TOK_DATA_NEWLINE; - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - default: - ptr += MINBPC; - break; - } - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; -} - -static -int PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, - const char **badPtr) -{ - ptr += MINBPC; - end -= MINBPC; - for (; ptr != end; ptr += MINBPC) { - switch (BYTE_TYPE(enc, ptr)) { - case BT_DIGIT: - case BT_HEX: - case BT_MINUS: - case BT_APOS: - case BT_LPAR: - case BT_RPAR: - case BT_PLUS: - case BT_COMMA: - case BT_SOL: - case BT_EQUALS: - case BT_QUEST: - case BT_CR: - case BT_LF: - case BT_SEMI: - case BT_EXCL: - case BT_AST: - case BT_PERCNT: - case BT_NUM: - break; - case BT_S: - if (CHAR_MATCHES(enc, ptr, '\t')) { - *badPtr = ptr; - return 0; - } - break; - case BT_NAME: - case BT_NMSTRT: - if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f)) - break; - default: - switch (BYTE_TO_ASCII(enc, ptr)) { - case 0x24: /* $ */ - case 0x40: /* @ */ - break; - default: - *badPtr = ptr; - return 0; - } - break; - } - } - return 1; -} - -/* This must only be called for a well-formed start-tag or empty element tag. -Returns the number of attributes. Pointers to the first attsMax attributes -are stored in atts. */ - -static -int PREFIX(getAtts)(const ENCODING *enc, const char *ptr, - int attsMax, ATTRIBUTE *atts) -{ - enum { other, inName, inValue } state = inName; - int nAtts = 0; - int open = 0; - - for (ptr += MINBPC;; ptr += MINBPC) { - switch (BYTE_TYPE(enc, ptr)) { -#define START_NAME \ - if (state == other) { \ - if (nAtts < attsMax) { \ - atts[nAtts].name = ptr; \ - atts[nAtts].normalized = 1; \ - } \ - state = inName; \ - } -#define LEAD_CASE(n) \ - case BT_LEAD ## n: START_NAME ptr += (n - MINBPC); break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_NONASCII: - case BT_NMSTRT: - case BT_HEX: - START_NAME - break; -#undef START_NAME - case BT_QUOT: - if (state != inValue) { - atts[nAtts].valuePtr = ptr + MINBPC; - state = inValue; - open = BT_QUOT; - } - else if (open == BT_QUOT) { - state = other; - atts[nAtts++].valueEnd = ptr; - } - break; - case BT_APOS: - if (state != inValue) { - atts[nAtts].valuePtr = ptr + MINBPC; - state = inValue; - open = BT_APOS; - } - else if (open == BT_APOS) { - state = other; - atts[nAtts++].valueEnd = ptr; - } - break; - case BT_AMP: - atts[nAtts].normalized = 0; - break; - case BT_S: - if (state == inName) - state = other; - else if (state == inValue - && atts[nAtts].normalized - && (ptr == atts[nAtts].valuePtr - || BYTE_TO_ASCII(enc, ptr) != ' ' - || BYTE_TO_ASCII(enc, ptr + MINBPC) == ' ' - || BYTE_TYPE(enc, ptr + MINBPC) == open)) - atts[nAtts].normalized = 0; - break; - case BT_CR: case BT_LF: - /* This case ensures that the first attribute name is counted - Apart from that we could just change state on the quote. */ - if (state == inName) - state = other; - else if (state == inValue) - atts[nAtts].normalized = 0; - break; - case BT_GT: - case BT_SOL: - if (state != inValue) - return nAtts; - break; - default: - break; - } - } - /* not reached */ -} - -static -int PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) -{ - int result = 0; - /* skip &# */ - ptr += 2*MINBPC; - if (CHAR_MATCHES(enc, ptr, 'x')) { - for (ptr += MINBPC; !CHAR_MATCHES(enc, ptr, ';'); ptr += MINBPC) { - int c = BYTE_TO_ASCII(enc, ptr); - switch (c) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - result <<= 4; - result |= (c - '0'); - break; - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - result <<= 4; - result += 10 + (c - 'A'); - break; - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - result <<= 4; - result += 10 + (c - 'a'); - break; - } - if (result >= 0x110000) - return -1; - } - } - else { - for (; !CHAR_MATCHES(enc, ptr, ';'); ptr += MINBPC) { - int c = BYTE_TO_ASCII(enc, ptr); - result *= 10; - result += (c - '0'); - if (result >= 0x110000) - return -1; - } - } - return checkCharRefNumber(result); -} - -static -int PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, const char *end) -{ - switch (end - ptr) { - case 2 * MINBPC: - if (CHAR_MATCHES(enc, ptr + MINBPC, 't')) { - switch (BYTE_TO_ASCII(enc, ptr)) { - case 'l': - return '<'; - case 'g': - return '>'; - } - } - break; - case 3 * MINBPC: - if (CHAR_MATCHES(enc, ptr, 'a')) { - ptr += MINBPC; - if (CHAR_MATCHES(enc, ptr, 'm')) { - ptr += MINBPC; - if (CHAR_MATCHES(enc, ptr, 'p')) - return '&'; - } - } - break; - case 4 * MINBPC: - switch (BYTE_TO_ASCII(enc, ptr)) { - case 'q': - ptr += MINBPC; - if (CHAR_MATCHES(enc, ptr, 'u')) { - ptr += MINBPC; - if (CHAR_MATCHES(enc, ptr, 'o')) { - ptr += MINBPC; - if (CHAR_MATCHES(enc, ptr, 't')) - return '"'; - } - } - break; - case 'a': - ptr += MINBPC; - if (CHAR_MATCHES(enc, ptr, 'p')) { - ptr += MINBPC; - if (CHAR_MATCHES(enc, ptr, 'o')) { - ptr += MINBPC; - if (CHAR_MATCHES(enc, ptr, 's')) - return '\''; - } - } - break; - } - } - return 0; -} - -static -int PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2) -{ - for (;;) { - switch (BYTE_TYPE(enc, ptr1)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: \ - if (*ptr1++ != *ptr2++) \ - return 0; - LEAD_CASE(4) LEAD_CASE(3) LEAD_CASE(2) -#undef LEAD_CASE - /* fall through */ - if (*ptr1++ != *ptr2++) - return 0; - break; - case BT_NONASCII: - case BT_NMSTRT: - case BT_HEX: - case BT_DIGIT: - case BT_NAME: - case BT_MINUS: - if (*ptr2++ != *ptr1++) - return 0; -#if MINBPC > 1 - if (*ptr2++ != *ptr1++) - return 0; -#if MINBPC > 2 - if (*ptr2++ != *ptr1++) - return 0; -#if MINBPC > 3 - if (*ptr2++ != *ptr1++) - return 0; -#endif -#endif -#endif - break; - default: -#if MINBPC == 1 - if (*ptr1 == *ptr2) - return 1; -#endif - switch (BYTE_TYPE(enc, ptr2)) { - case BT_LEAD2: - case BT_LEAD3: - case BT_LEAD4: - case BT_NONASCII: - case BT_NMSTRT: - case BT_HEX: - case BT_DIGIT: - case BT_NAME: - case BT_MINUS: - return 0; - default: - return 1; - } - } - } - /* not reached */ -} - -static -int PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1, const char *ptr2) -{ - for (; *ptr2; ptr1 += MINBPC, ptr2++) { - if (!CHAR_MATCHES(end, ptr1, *ptr2)) - return 0; - } - switch (BYTE_TYPE(enc, ptr1)) { - case BT_LEAD2: - case BT_LEAD3: - case BT_LEAD4: - case BT_NONASCII: - case BT_NMSTRT: - case BT_HEX: - case BT_DIGIT: - case BT_NAME: - case BT_MINUS: - return 0; - default: - return 1; - } -} - -static -int PREFIX(nameLength)(const ENCODING *enc, const char *ptr) -{ - const char *start = ptr; - for (;;) { - switch (BYTE_TYPE(enc, ptr)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: ptr += n; break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_NONASCII: - case BT_NMSTRT: - case BT_HEX: - case BT_DIGIT: - case BT_NAME: - case BT_MINUS: - ptr += MINBPC; - break; - default: - return ptr - start; - } - } -} - -static -const char *PREFIX(skipS)(const ENCODING *enc, const char *ptr) -{ - for (;;) { - switch (BYTE_TYPE(enc, ptr)) { - case BT_LF: - case BT_CR: - case BT_S: - ptr += MINBPC; - break; - default: - return ptr; - } - } -} - -static -void PREFIX(updatePosition)(const ENCODING *enc, - const char *ptr, - const char *end, - POSITION *pos) -{ - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: \ - ptr += n; \ - break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_LF: - pos->columnNumber = (unsigned)-1; - pos->lineNumber++; - ptr += MINBPC; - break; - case BT_CR: - pos->lineNumber++; - ptr += MINBPC; - if (ptr != end && BYTE_TYPE(enc, ptr) == BT_LF) - ptr += MINBPC; - pos->columnNumber = (unsigned)-1; - break; - default: - ptr += MINBPC; - break; - } - pos->columnNumber++; - } -} - -#undef DO_LEAD_CASE -#undef MULTIBYTE_CASES -#undef INVALID_CASES -#undef CHECK_NAME_CASE -#undef CHECK_NAME_CASES -#undef CHECK_NMSTRT_CASE -#undef CHECK_NMSTRT_CASES Index: xotcl/library/xml/TclExpat-1.1/xmltok_impl.h =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/xmltok_impl.h (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/xmltok_impl.h (revision 0) @@ -1,60 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -enum { - BT_NONXML, - BT_MALFORM, - BT_LT, - BT_AMP, - BT_RSQB, - BT_LEAD2, - BT_LEAD3, - BT_LEAD4, - BT_TRAIL, - BT_CR, - BT_LF, - BT_GT, - BT_QUOT, - BT_APOS, - BT_EQUALS, - BT_QUEST, - BT_EXCL, - BT_SOL, - BT_SEMI, - BT_NUM, - BT_LSQB, - BT_S, - BT_NMSTRT, - BT_HEX, - BT_DIGIT, - BT_NAME, - BT_MINUS, - BT_OTHER, /* known not to be a name or name start character */ - BT_NONASCII, /* might be a name or name start character */ - BT_PERCNT, - BT_LPAR, - BT_RPAR, - BT_AST, - BT_PLUS, - BT_COMMA, - BT_VERBAR -}; - -#include Index: xotcl/library/xml/TclExpat-1.1/xmlwf.c =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/xmlwf.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/TclExpat-1.1/xmlwf.c (revision 0) @@ -1,654 +0,0 @@ -/* -The contents of this file are subject to the Mozilla Public License -Version 1.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL/ - -Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -License for the specific language governing rights and limitations -under the License. - -The Original Code is expat. - -The Initial Developer of the Original Code is James Clark. -Portions created by James Clark are Copyright (C) 1998 -James Clark. All Rights Reserved. - -Contributor(s): -*/ - -#include -#include "xmlparse.h" -#include "filemap.h" -#include "codepage.h" - -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -#include -#endif - -#ifdef _POSIX_SOURCE -#include -#endif - -#ifndef O_BINARY -#ifdef _O_BINARY -#define O_BINARY _O_BINARY -#else -#define O_BINARY 0 -#endif -#endif - -#ifdef _MSC_VER -#include -#endif - -#ifdef _DEBUG -#define READ_SIZE 16 -#else -#define READ_SIZE (1024*8) -#endif - -#ifdef XML_UNICODE -#ifndef XML_UNICODE_WCHAR_T -#error xmlwf requires a 16-bit Unicode-compatible wchar_t -#endif -#define T(x) L ## x -#define ftprintf fwprintf -#define tfopen _wfopen -#define fputts fputws -#define puttc putwc -#define tcscmp wcscmp -#define tcscpy wcscpy -#define tcscat wcscat -#define tcschr wcschr -#define tcsrchr wcsrchr -#define tcslen wcslen -#define tperror _wperror -#define topen _wopen -#define tmain wmain -#define tremove _wremove -#else /* not XML_UNICODE */ -#define T(x) x -#define ftprintf fprintf -#define tfopen fopen -#define fputts fputs -#define puttc putc -#define tcscmp strcmp -#define tcscpy strcpy -#define tcscat strcat -#define tcschr strchr -#define tcsrchr strrchr -#define tcslen strlen -#define tperror perror -#define topen open -#define tmain main -#define tremove remove -#endif /* not XML_UNICODE */ - -static void characterData(void *userData, const XML_Char *s, size_t len) -{ - FILE *fp = userData; - for (; len > 0; --len, ++s) { - switch (*s) { - case T('&'): - fputts(T("&"), fp); - break; - case T('<'): - fputts(T("<"), fp); - break; - case T('>'): - fputts(T(">"), fp); - break; - case T('"'): - fputts(T("""), fp); - break; - case 9: - case 10: - case 13: - ftprintf(fp, T("&#%d;"), *s); - break; - default: - puttc(*s, fp); - break; - } - } -} - -/* Lexicographically comparing UTF-8 encoded attribute values, -is equivalent to lexicographically comparing based on the character number. */ - -static int attcmp(const void *att1, const void *att2) -{ - return tcscmp(*(const XML_Char **)att1, *(const XML_Char **)att2); -} - -static void startElement(void *userData, const XML_Char *name, const XML_Char **atts) -{ - size_t nAtts; - const XML_Char **p; - FILE *fp = userData; - puttc(T('<'), fp); - fputts(name, fp); - - p = atts; - while (*p) - ++p; - nAtts = (p - atts) >> 1; - if (nAtts > 1) - qsort((void *)atts, nAtts, sizeof(XML_Char *) * 2, attcmp); - while (*atts) { - puttc(T(' '), fp); - fputts(*atts++, fp); - puttc(T('='), fp); - puttc(T('"'), fp); - characterData(userData, *atts, tcslen(*atts)); - puttc(T('"'), fp); - atts++; - } - puttc(T('>'), fp); -} - -static void endElement(void *userData, const XML_Char *name) -{ - FILE *fp = userData; - puttc(T('<'), fp); - puttc(T('/'), fp); - fputts(name, fp); - puttc(T('>'), fp); -} - -static void processingInstruction(void *userData, const XML_Char *target, const XML_Char *data) -{ - FILE *fp = userData; - puttc(T('<'), fp); - puttc(T('?'), fp); - fputts(target, fp); - puttc(T(' '), fp); - fputts(data, fp); - puttc(T('?'), fp); - puttc(T('>'), fp); -} - -static void defaultCharacterData(XML_Parser parser, const XML_Char *s, size_t len) -{ - XML_DefaultCurrent(parser); -} - -static void defaultStartElement(XML_Parser parser, const XML_Char *name, const XML_Char **atts) -{ - XML_DefaultCurrent(parser); -} - -static void defaultEndElement(XML_Parser parser, const XML_Char *name) -{ - XML_DefaultCurrent(parser); -} - -static void defaultProcessingInstruction(XML_Parser parser, const XML_Char *target, const XML_Char *data) -{ - XML_DefaultCurrent(parser); -} - -static void markup(XML_Parser parser, const XML_Char *s, int len) -{ - FILE *fp = XML_GetUserData(parser); - for (; len > 0; --len, ++s) - puttc(*s, fp); -} - -static -void metaLocation(XML_Parser parser) -{ - const XML_Char *uri = XML_GetBase(parser); - if (uri) - ftprintf(XML_GetUserData(parser), T(" uri=\"%s\""), uri); - ftprintf(XML_GetUserData(parser), - T(" byte=\"%ld\" line=\"%d\" col=\"%d\""), - XML_GetCurrentByteIndex(parser), - XML_GetCurrentLineNumber(parser), - XML_GetCurrentColumnNumber(parser)); -} - -static -void metaStartElement(XML_Parser parser, const XML_Char *name, const XML_Char **atts) -{ - FILE *fp = XML_GetUserData(parser); - ftprintf(fp, T("\n"), fp); - do { - ftprintf(fp, T("\n"), fp); - } while (*(atts += 2)); - fputts(T("\n"), fp); - } - else - fputts(T("/>\n"), fp); -} - -static -void metaEndElement(XML_Parser parser, const XML_Char *name) -{ - FILE *fp = XML_GetUserData(parser); - ftprintf(fp, T("\n"), fp); -} - -static -void metaProcessingInstruction(XML_Parser parser, const XML_Char *target, const XML_Char *data) -{ - FILE *fp = XML_GetUserData(parser); - ftprintf(fp, T("\n"), fp); -} - -static -void metaCharacterData(XML_Parser parser, const XML_Char *s, size_t len) -{ - FILE *fp = XML_GetUserData(parser); - fputts(T("\n"), fp); -} - -static -void metaUnparsedEntityDecl(XML_Parser parser, - const XML_Char *entityName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName) -{ - FILE *fp = XML_GetUserData(parser); - ftprintf(fp, T("\n"), fp); -} - -static -void metaNotationDecl(XML_Parser parser, - const XML_Char *notationName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId) -{ - FILE *fp = XML_GetUserData(parser); - ftprintf(fp, T("\n"), fp); -} - -typedef struct { - XML_Parser parser; - int *retPtr; -} PROCESS_ARGS; - -static -void reportError(XML_Parser parser, const XML_Char *filename) -{ - int code = XML_GetErrorCode(parser); - const XML_Char *message = XML_ErrorString(code); - if (message) - ftprintf(stdout, T("%s:%d:%d: %s\n"), - filename, - XML_GetErrorLineNumber(parser), - XML_GetErrorColumnNumber(parser), - message); - else - ftprintf(stderr, T("%s: (unknown message %d)\n"), filename, code); -} - -static -void processFile(const void *data, size_t size, const XML_Char *filename, void *args) -{ - XML_Parser parser = ((PROCESS_ARGS *)args)->parser; - int *retPtr = ((PROCESS_ARGS *)args)->retPtr; - if (!XML_Parse(parser, data, size, 1)) { - reportError(parser, filename); - *retPtr = 0; - } - else - *retPtr = 1; -} - -static -int isAsciiLetter(XML_Char c) -{ - return (T('a') <= c && c <= T('z')) || (T('A') <= c && c <= T('Z')); -} - -static -const XML_Char *resolveSystemId(const XML_Char *base, const XML_Char *systemId, XML_Char **toFree) -{ - XML_Char *s; - *toFree = 0; - if (!base - || *systemId == T('/') -#ifdef WIN32 - || *systemId == T('\\') - || (isAsciiLetter(systemId[0]) && systemId[1] == T(':')) -#endif - ) - return systemId; - *toFree = (XML_Char *)malloc((tcslen(base) + tcslen(systemId) + 2)*sizeof(XML_Char)); - if (!*toFree) - return systemId; - tcscpy(*toFree, base); - s = *toFree; - if (tcsrchr(s, T('/'))) - s = tcsrchr(s, T('/')) + 1; -#ifdef WIN32 - if (tcsrchr(s, T('\\'))) - s = tcsrchr(s, T('\\')) + 1; -#endif - tcscpy(s, systemId); - return *toFree; -} - -static -int externalEntityRefFilemap(XML_Parser parser, - const XML_Char *openEntityNames, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId) -{ - int result; - XML_Char *s; - const XML_Char *filename; - XML_Parser entParser = XML_ExternalEntityParserCreate(parser, openEntityNames, 0); - PROCESS_ARGS args; - args.retPtr = &result; - args.parser = entParser; - filename = resolveSystemId(base, systemId, &s); - XML_SetBase(entParser, filename); - if (!filemap(filename, processFile, &args)) - result = 0; - free(s); - XML_ParserFree(entParser); - return result; -} - -static -int processStream(const XML_Char *filename, XML_Parser parser) -{ - int fd = topen(filename, O_BINARY|O_RDONLY); - if (fd < 0) { - tperror(filename); - return 0; - } - for (;;) { - size_t nread; - char *buf = XML_GetBuffer(parser, READ_SIZE); - if (!buf) { - close(fd); - ftprintf(stderr, T("%s: out of memory\n"), filename); - return 0; - } - nread = read(fd, buf, READ_SIZE); - if (nread < 0) { - tperror(filename); - close(fd); - return 0; - } - if (!XML_ParseBuffer(parser, nread, nread == 0)) { - reportError(parser, filename); - close(fd); - return 0; - } - if (nread == 0) { - close(fd); - break;; - } - } - return 1; -} - -static -int externalEntityRefStream(XML_Parser parser, - const XML_Char *openEntityNames, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId) -{ - XML_Char *s; - const XML_Char *filename; - int ret; - XML_Parser entParser = XML_ExternalEntityParserCreate(parser, openEntityNames, 0); - filename = resolveSystemId(base, systemId, &s); - XML_SetBase(entParser, filename); - ret = processStream(filename, entParser); - free(s); - XML_ParserFree(entParser); - return ret; -} - -static -int unknownEncodingConvert(void *data, const char *p) -{ - return codepageConvert(*(int *)data, p); -} - -static -int unknownEncoding(void *userData, - const XML_Char *name, - XML_Encoding *info) -{ - int cp; - static const XML_Char prefixL[] = T("windows-"); - static const XML_Char prefixU[] = T("WINDOWS-"); - int i; - - for (i = 0; prefixU[i]; i++) - if (name[i] != prefixU[i] && name[i] != prefixL[i]) - return 0; - - cp = 0; - for (; name[i]; i++) { - static const XML_Char digits[] = T("0123456789"); - const XML_Char *s = tcschr(digits, name[i]); - if (!s) - return 0; - cp *= 10; - cp += s - digits; - if (cp >= 0x10000) - return 0; - } - if (!codepageMap(cp, info->map)) - return 0; - info->convert = unknownEncodingConvert; - /* We could just cast the code page integer to a void *, - and avoid the use of release. */ - info->release = free; - info->data = malloc(sizeof(int)); - if (!info->data) - return 0; - *(int *)info->data = cp; - return 1; -} - -static -void usage(const XML_Char *prog) -{ - ftprintf(stderr, T("usage: %s [-r] [-w] [-x] [-d output-dir] [-e encoding] file ...\n"), prog); - exit(1); -} - -int tmain(int argc, XML_Char **argv) -{ - int i; - const XML_Char *outputDir = 0; - const XML_Char *encoding = 0; - int useFilemap = 1; - int processExternalEntities = 0; - int windowsCodePages = 0; - int outputType = 0; - -#ifdef _MSC_VER - _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF); -#endif - - i = 1; - while (i < argc && argv[i][0] == T('-')) { - int j; - if (argv[i][1] == T('-') && argv[i][2] == T('\0')) { - i++; - break; - } - j = 1; - if (argv[i][j] == T('r')) { - useFilemap = 0; - j++; - } - if (argv[i][j] == T('x')) { - processExternalEntities = 1; - j++; - } - if (argv[i][j] == T('w')) { - windowsCodePages = 1; - j++; - } - if (argv[i][j] == T('m')) { - outputType = 'm'; - j++; - } - if (argv[i][j] == T('c')) { - outputType = 'c'; - j++; - } - if (argv[i][j] == T('d')) { - if (argv[i][j + 1] == T('\0')) { - if (++i == argc) - usage(argv[0]); - outputDir = argv[i]; - } - else - outputDir = argv[i] + j + 1; - i++; - } - else if (argv[i][j] == T('e')) { - if (argv[i][j + 1] == T('\0')) { - if (++i == argc) - usage(argv[0]); - encoding = argv[i]; - } - else - encoding = argv[i] + j + 1; - i++; - } - else if (argv[i][j] == T('\0') && j > 1) - i++; - else - usage(argv[0]); - } - if (i == argc) - usage(argv[0]); - for (; i < argc; i++) { - FILE *fp = 0; - XML_Char *outName = 0; - int result; - XML_Parser parser = XML_ParserCreate(encoding); - if (outputDir) { - const XML_Char *file = argv[i]; - if (tcsrchr(file, T('/'))) - file = tcsrchr(file, T('/')) + 1; -#ifdef WIN32 - if (tcsrchr(file, T('\\'))) - file = tcsrchr(file, T('\\')) + 1; -#endif - outName = malloc((tcslen(outputDir) + tcslen(file) + 2) * sizeof(XML_Char)); - tcscpy(outName, outputDir); - tcscat(outName, T("/")); - tcscat(outName, file); - fp = tfopen(outName, T("wb")); - if (!fp) { - tperror(outName); - exit(1); - } -#ifdef XML_UNICODE - puttc(0xFEFF, fp); -#endif - XML_SetUserData(parser, fp); - switch (outputType) { - case 'm': - XML_UseParserAsHandlerArg(parser); - fputts(T("\n"), fp); - XML_SetElementHandler(parser, metaStartElement, metaEndElement); - XML_SetProcessingInstructionHandler(parser, metaProcessingInstruction); - XML_SetCharacterDataHandler(parser, metaCharacterData); - XML_SetUnparsedEntityDeclHandler(parser, metaUnparsedEntityDecl); - XML_SetNotationDeclHandler(parser, metaNotationDecl); - break; - case 'c': - XML_UseParserAsHandlerArg(parser); - XML_SetDefaultHandler(parser, markup); - XML_SetElementHandler(parser, defaultStartElement, defaultEndElement); - XML_SetCharacterDataHandler(parser, defaultCharacterData); - XML_SetProcessingInstructionHandler(parser, defaultProcessingInstruction); - break; - default: - XML_SetElementHandler(parser, startElement, endElement); - XML_SetCharacterDataHandler(parser, characterData); - XML_SetProcessingInstructionHandler(parser, processingInstruction); - break; - } - } - if (windowsCodePages) - XML_SetUnknownEncodingHandler(parser, unknownEncoding, 0); - if (!XML_SetBase(parser, argv[i])) { - ftprintf(stderr, T("%s: out of memory"), argv[0]); - exit(1); - } - if (processExternalEntities) - XML_SetExternalEntityRefHandler(parser, - useFilemap - ? externalEntityRefFilemap - : externalEntityRefStream); - if (useFilemap) { - PROCESS_ARGS args; - args.retPtr = &result; - args.parser = parser; - if (!filemap(argv[i], processFile, &args)) - result = 0; - } - else - result = processStream(argv[i], parser); - if (outputDir) { - if (outputType == 'm') - fputts(T("\n"), fp); - fclose(fp); - if (!result) - tremove(outName); - free(outName); - } - XML_ParserFree(parser); - } - return 0; -} Index: xotcl/library/xml/TclExpat-1.1/xotcl.m4 =================================================================== diff -u -N --- xotcl/library/xml/TclExpat-1.1/xotcl.m4 (revision 9620bd8d134f2f6c30fc0d32c769c8a84c6c597b) +++ xotcl/library/xml/TclExpat-1.1/xotcl.m4 (revision 0) @@ -1,139 +0,0 @@ -# xotcl.m4 -- -# -# This file provides a set of autoconf macros to help TEA-enable -# a Tcl extension. -# -# Copyright (c) 1999 Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. - -#------------------------------------------------------------------------ -# SC_PATH_XOTCLCONFIG -- -# -# Locate the xotclConfig.sh file and perform a sanity check on -# the Tcl compile flags -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-xotcl=... -# -# Defines the following vars: -# XOTCL_BIN_DIR Full path to the directory containing -# the xotclConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN(SC_PATH_XOTCLCONFIG, [ - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - if test x"${no_xotcl}" = x ; then - # we reset no_xotcl in case something fails here - no_xotcl=true - AC_ARG_WITH(xotcl, [ --with-xotcl directory containing xotcl configuration (xotclConfig.sh)], with_xotclconfig=${withval}) - AC_MSG_CHECKING([for XOTcl configuration]) - AC_CACHE_VAL(ac_cv_c_xotclconfig,[ - - # First check to see if --with-xotcl was specified. - if test x"${with_xotclconfig}" != x ; then - if test -f "${with_xotclconfig}/xotclConfig.sh" ; then - ac_cv_c_xotclconfig=`(cd ${with_xotclconfig}; pwd)` - else - AC_MSG_ERROR([${with_xotclconfig} directory doesn't contain xotclConfig.sh]) - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_xotclconfig}" = x ; then - for i in \ - ${srcdir}/../xotcl \ - `ls -dr ${srcdir}/../xotcl-* 2>/dev/null` \ - ${srcdir}/../../xotcl \ - `ls -dr ${srcdir}/../../xotcl-* 2>/dev/null` \ - ${srcdir}/../../../xotcl \ - `ls -dr ${srcdir}/../../../xotcl-* 2>/dev/null` \ - ${srcdir}/../../../../xotcl \ - `ls -dr ${srcdir}/../../../../xotcl-* 2>/dev/null` \ - ${srcdir}/../../../../../xotcl \ - `ls -dr ${srcdir}/../../../../../xotcl-* 2>/dev/null` ; do - if test -f "$i/xotclConfig.sh" ; then - ac_cv_c_xotclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_xotclconfig}" = x ; then - for i in `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` ; do - if test -f "$i/xotclConfig.sh" ; then - ac_cv_c_xotclconfig=`(cd $i; pwd)` - break - fi - done - fi - - ]) - - if test x"${ac_cv_c_xotclconfig}" = x ; then - XOTCL_BIN_DIR="# no XOTcl configs found" - AC_MSG_WARN(Can't find XOTcl configuration definitions) - exit 0 - else - no_xotcl= - XOTCL_BIN_DIR=${ac_cv_c_xotclconfig} - AC_MSG_RESULT(found $XOTCL_BIN_DIR/xotclConfig.sh) - fi - fi -]) - -#------------------------------------------------------------------------ -# SC_LOAD_XOTCLCONFIG -- -# -# Load the tclConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# XOTCL_BIN_DIR -# -# Results: -# -# Subst the vars: -# -#------------------------------------------------------------------------ - -AC_DEFUN(SC_LOAD_XOTCLCONFIG, [ - AC_MSG_CHECKING([for existence of $XOTCL_BIN_DIR/xotclConfig.sh]) - - if test -f "$XOTCL_BIN_DIR/xotclConfig.sh" ; then - AC_MSG_RESULT([loading]) - . $XOTCL_BIN_DIR/xotclConfig.sh - else - AC_MSG_RESULT([file not found]) - fi - - # - # The eval is required to do the TCL_DBGX substitution in the - # TCL_LIB_FILE variable - # - AC_SUBST(XOTCL_VERSION) - AC_SUBST(XOTCL_MAJOR_VERSION) - AC_SUBST(XOTCL_MINOR_VERSION) - AC_SUBST(XOTCL_RELEASE_LEVEL) - AC_SUBST(XOTCL_LIB_FILE) - AC_SUBST(XOTCL_BUILD_LIB_SPEC) - AC_SUBST(XOTCL_LIB_SPEC) - AC_SUBST(XOTCL_STUB_LIB_FILE) - AC_SUBST(XOTCL_BUILD_STUB_LIB_SPEC) - AC_SUBST(XOTCL_STUB_LIB_SPEC) - AC_SUBST(XOTCL_SRC_DIR) -]) - Index: xotcl/library/xml/pkgIndex.tcl =================================================================== diff -u -N --- xotcl/library/xml/pkgIndex.tcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/xml/pkgIndex.tcl (revision 0) @@ -1,15 +0,0 @@ -# Tcl package index file, version 1.1 -# This file is generated by the "pkg_mkIndex -direct" command -# and sourced either when an application starts up or -# by a "package unknown" script. It invokes the -# "package ifneeded" command to set up package-related -# information so that packages will be loaded automatically -# in response to "package require" commands. When this -# script is sourced, the variable $dir must contain the -# full path name of this file's directory. - -package ifneeded sgml 1.6 [list source [file join $dir sgml.tcl]] -package ifneeded xml 1.8 [list source [file join $dir xml.tcl]] -package ifneeded xotcl::xml::parser 0.94 [list source [file join $dir xoXML.xotcl]] -package ifneeded xotcl::xml::printVisitor 0.9 [list source [file join $dir printVisitor.xotcl]] -package ifneeded xotcl::xml::recreatorVisitor 0.9 [list source [file join $dir xmlRecreatorVisitor.xotcl]] Index: xotcl/library/xml/printVisitor.xotcl =================================================================== diff -u -N --- xotcl/library/xml/printVisitor.xotcl (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/library/xml/printVisitor.xotcl (revision 0) @@ -1,28 +0,0 @@ -# $Id: printVisitor.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $ - -package provide xotcl::xml::printVisitor 0.9 -package require xotcl::xml::parser -package require XOTcl - -namespace eval ::xotcl::xml::printVisitor { - namespace import ::xotcl::* - - ############################################################################## - # - # Small debugging visitor that just uses node's print method to print the - # node tree - # - ############################################################################## - - Class PrintVisitor -superclass NodeTreeVisitor -parameter parser - PrintVisitor instproc visit objName { - puts [$objName print] - } - PrintVisitor instproc interpretNodeTree node { - $node accept [self] - } - - namespace export PrintVisitor -} - -namespace import ::xotcl::xml::printVisitor::* Index: xotcl/library/xml/sgml.tcl =================================================================== diff -u -N --- xotcl/library/xml/sgml.tcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/xml/sgml.tcl (revision 0) @@ -1,1653 +0,0 @@ -# sgml.tcl -- -# -# This file provides generic parsing services for SGML-based -# languages, namely HTML and XML. -# -# NB. It is a misnomer. There is no support for parsing -# arbitrary SGML as such. -# -# Copyright (c) 1998,1999 Zveno Pty Ltd -# http://www.zveno.com/ -# -# Zveno makes this software available free of charge for any purpose. -# Copies may be made of this software but all of this notice must be included -# on any copy. -# -# The software was developed for research purposes only and Zveno does not -# warrant that it is error free or fit for any purpose. Zveno disclaims any -# liability for all claims, expenses, losses, damages and costs any user may -# incur as a result of using, copying or modifying this software. -# -# Copyright (c) 1997 ANU and CSIRO on behalf of the -# participants in the CRC for Advanced Computational Systems ('ACSys'). -# -# ACSys makes this software and all associated data and documentation -# ('Software') available free of charge for any purpose. You may make copies -# of the Software but you must include all of this notice on any copy. -# -# The Software was developed for research purposes and ACSys does not warrant -# that it is error free or fit for any purpose. ACSys disclaims any -# liability for all claims, expenses, losses, damages and costs any user may -# incur as a result of using, copying or modifying the Software. -# -# $Id: sgml.tcl,v 1.4 2006/09/27 08:12:40 neumann Exp $ - -package provide sgml 1.6 - -namespace eval sgml { - namespace export tokenise parseEvent - - namespace export parseDTD - - # Convenience routine - proc cl x { - return "\[$x\]" - } - - # Define various regular expressions - # white space - variable Wsp " \t\r\n" - variable noWsp [cl ^$Wsp] - - # Various XML names - variable nmtoken [cl -a-zA-Z0-9._]+ - variable name [cl a-zA-Z_][cl -a-zA-Z0-9._]* - - # Other - variable ParseEventNum - if {![info exists ParseEventNum]} { - set ParseEventNum 0 - } - variable ParseDTDnum - if {![info exists ParseDTDNum]} { - set ParseDTDNum 0 - } - - # table of predefined entities for XML - - variable EntityPredef - array set EntityPredef { - lt < gt > amp & quot \" apos ' - } - -} - -# sgml::tokenise -- -# -# Transform the given HTML/XML text into a Tcl list. -# -# Arguments: -# sgml text to tokenize -# elemExpr RE to recognise tags -# elemSub transform for matched tags -# args options -# -# Valid Options: -# -final boolean True if no more data is to be supplied -# -statevariable varName Name of a variable used to store info -# -# Results: -# Returns a Tcl list representing the document. - -proc sgml::tokenise {sgml elemExpr elemSub args} { - array set options {-final 1} - catch {array set options $args} - set options(-final) [Boolean $options(-final)] - - # If the data is not final then there must be a variable to store - # unused data. - if {!$options(-final) && ![info exists options(-statevariable)]} { - return -code error {option "-statevariable" required if not final} - } - - # Pre-process stage - # - # Extract the internal DTD subset, if any - - catch {upvar #0 $options(-internaldtdvariable) dtd} - if {[regexp {]*$)} [lindex $sgml end] x text unused]} { - set sgml [lreplace $sgml end end $text] - } - - } else { - - # Performance note (Tcl 8.0): - # In this case, no conversion to list object is performed - - regsub -all $elemExpr $sgml $elemSub sgml - set sgml "{} {} {} {} \{$sgml\}" - } - - return $sgml - -} - -# sgml::parseEvent -- -# -# Produces an event stream for a XML/HTML document, -# given the Tcl list format returned by tokenise. -# -# This procedure checks that the document is well-formed, -# and throws an error if the document is found to be not -# well formed. Warnings are passed via the -warningcommand script. -# -# The procedure only check for well-formedness, -# no DTD is required. However, facilities are provided for entity expansion. -# -# Arguments: -# sgml Instance data, as a Tcl list. -# args option/value pairs -# -# Valid Options: -# -final Indicates end of document data -# -elementstartcommand Called when an element starts -# -elementendcommand Called when an element ends -# -characterdatacommand Called when character data occurs -# -entityreferencecommand Called when an entity reference occurs -# -processinginstructioncommand Called when a PI occurs -# -externalentityrefcommand Called for an external entity reference -# -# (Not compatible with expat) -# -xmldeclcommand Called when the XML declaration occurs -# -doctypecommand Called when the document type declaration occurs -# -commentcommand Called when a comment occurs -# -# -errorcommand Script to evaluate for a fatal error -# -warningcommand Script to evaluate for a reportable warning -# -statevariable global state variable -# -normalize whether to normalize names -# -reportempty whether to include an indication of empty elements -# -# Results: -# The various callback scripts are invoked. -# Returns empty string. -# -# BUGS: -# If command options are set to empty string then they should not be invoked. - -proc sgml::parseEvent {sgml args} { - variable Wsp - variable noWsp - variable nmtoken - variable name - variable ParseEventNum - - array set options [list \ - -elementstartcommand [namespace current]::noop \ - -elementendcommand [namespace current]::noop \ - -characterdatacommand [namespace current]::noop \ - -processinginstructioncommand [namespace current]::noop \ - -externalentityrefcommand [namespace current]::noop \ - -xmldeclcommand [namespace current]::noop \ - -doctypecommand [namespace current]::noop \ - -commentcommand [namespace current]::noop \ - -entityreferencecommand {} \ - -warningcommand [namespace current]::noop \ - -errorcommand [namespace current]::Error \ - -final 1 \ - -emptyelement [namespace current]::EmptyElement \ - -parseattributelistcommand [namespace current]::noop \ - -normalize 1 \ - -internaldtd {} \ - -reportempty 0 \ - -entityvariable [namespace current]::EntityPredef \ - ] - catch {array set options $args} - - if {![info exists options(-statevariable)]} { - set options(-statevariable) [namespace current]::ParseEvent[incr ParseEventNum] - } - - upvar #0 $options(-statevariable) state - upvar #0 $options(-entityvariable) entities - - if {![info exists state]} { - # Initialise the state variable - array set state { - mode normal - haveXMLDecl 0 - haveDocElement 0 - context {} - stack {} - line 0 - } - } - - foreach {tag close empty param text} $sgml { - - # Keep track of lines in the input - incr state(line) [regsub -all \n $param {} discard] - incr state(line) [regsub -all \n $text {} discard] - - # If the current mode is cdata or comment then we must undo what the - # regsub has done to reconstitute the data - - switch $state(mode) { - comment { - # This had "[string length $param] && " as a guard - - # can't remember why :-( - if {[regexp ([cl ^-]*)--\$ $tag discard comm1]} { - # end of comment (in tag) - set tag {} - set close {} - set empty {} - set state(mode) normal - uplevel #0 $options(-commentcommand) [list $state(commentdata)<$comm1] - unset state(commentdata) - } elseif {[regexp ([cl ^-]*)--\$ $param discard comm1]} { - # end of comment (in attributes) - uplevel #0 $options(-commentcommand) [list $state(commentdata)<$close$tag$empty>$comm1] - unset state(commentdata) - set tag {} - set param {} - set close {} - set empty {} - set state(mode) normal - } elseif {[regexp ([cl ^-]*)-->(.*) $text discard comm1 text]} { - # end of comment (in text) - uplevel #0 $options(-commentcommand) [list $state(commentdata)<$close$tag$param$empty>$comm1] - unset state(commentdata) - set tag {} - set param {} - set close {} - set empty {} - set state(mode) normal - } else { - # comment continues - append state(commentdata) <$close$tag$param$empty>$text - continue - } - } - cdata { - if {[string length $param] && [regexp ([cl ^\]]*)\]\][cl $Wsp]*\$ $tag discard cdata1]} { - # end of CDATA (in tag) - uplevel #0 $options(-characterdatacommand) [list $state(cdata)<$close$cdata1$text] - set text {} - set tag {} - unset state(cdata) - set state(mode) normal - } elseif {[regexp ([cl ^\]]*)\]\][cl $Wsp]*\$ $param discard cdata1]} { - # end of CDATA (in attributes) - uplevel #0 $options(-characterdatacommand) [list $state(cdata)<$close$tag$cdata1$text] - set text {} - set tag {} - set param {} - unset state(cdata) - set state(mode) normal - } elseif {[regexp ([cl ^\]]*)\]\][cl $Wsp]*>(.*) $text discard cdata1 text]} { - # end of CDATA (in text) - uplevel #0 $options(-characterdatacommand) [list $state(cdata)<$close$tag$param$empty>$cdata1$text] - set text {} - set tag {} - set param {} - set close {} - set empty {} - unset state(cdata) - set state(mode) normal - } else { - # CDATA continues - append state(cdata) <$close$tag$param$empty>$text - continue - } - } - } - - # default: normal mode - - # Bug: if the attribute list has a right angle bracket then the empty - # element marker will not be seen - - set isEmpty [uplevel #0 $options(-emptyelement) [list $tag $param $empty]] - if {[llength $isEmpty]} { - foreach {empty tag param} $isEmpty break - } - - switch -glob -- [string length $tag],[regexp {^\?|!.*} $tag],$close,$empty { - - 0,0,, { - # Ignore empty tag - dealt with non-normal mode above - } - *,0,, { - - # Start tag for an element. - - # Check for a right angle bracket in an attribute value - # This manifests itself by terminating the value before - # the delimiter is seen, and the delimiter appearing - # in the text - - # BUG: If two or more attribute values have right angle - # brackets then this will fail on the second one. - - if {[regexp [format {=[%s]*"[^"]*$} $Wsp] $param] && \ - [regexp {([^"]*"[^>]*)>(.*)} $text discard attrListRemainder text]} { - append param >$attrListRemainder - } elseif {[regexp [format {=[%s]*'[^']*$} $Wsp] $param] && \ - [regexp {([^']*'[^>]*)>(.*)} $text discard attrListRemainder text]} { - append param >$attrListRemainder - } - - # Check if the internal DTD entity is in an attribute - # value - regsub -all &xml:intdtd\; $param \[$options(-internaldtd)\] param - - ParseEvent:ElementOpen $tag $param options - set state(haveDocElement) 1 - - } - - *,0,/, { - - # End tag for an element. - - ParseEvent:ElementClose $tag options - - } - - *,0,,/ { - - # Empty element - - ParseEvent:ElementOpen $tag $param options -empty 1 - ParseEvent:ElementClose $tag options -empty 1 - - } - - *,1,* { - # Processing instructions or XML declaration - switch -glob -- $tag { - - {\?xml} { - # XML Declaration - if {$state(haveXMLDecl)} { - uplevel #0 $options(-errorcommand) "unexpected characters \"<$tag\" around line $state(line)" - } elseif {![regexp {\?$} $param]} { - uplevel #0 $options(-errorcommand) "XML Declaration missing characters \"?>\" around line $state(line)" - } else { - - # Get the version number - if {[regexp {[ ]*version="(-+|[a-zA-Z0-9_.:]+)"[ ]*} $param discard version] || [regexp {[ ]*version='(-+|[a-zA-Z0-9_.:]+)'[ ]*} $param discard version]} { - if {$version ne "1.0" } { - # Should we support future versions? - # At least 1.X? - uplevel #0 $options(-errorcommand) "document XML version \"$version\" is incompatible with XML version 1.0" - } - } else { - uplevel #0 $options(-errorcommand) "XML Declaration missing version information around line $state(line)" - } - - # Get the encoding declaration - set encoding {} - regexp {[ ]*encoding="([A-Za-z]([A-Za-z0-9._]|-)*)"[ ]*} $param discard encoding - regexp {[ ]*encoding='([A-Za-z]([A-Za-z0-9._]|-)*)'[ ]*} $param discard encoding - - # Get the standalone declaration - set standalone {} - regexp {[ ]*standalone="(yes|no)"[ ]*} $param discard standalone - regexp {[ ]*standalone='(yes|no)'[ ]*} $param discard standalone - - # Invoke the callback - uplevel #0 $options(-xmldeclcommand) [list $version $encoding $standalone] - - } - - } - - {\?*} { - # Processing instruction - if {![regsub {\?$} $param {} param]} { - uplevel #0 $options(-errorcommand) "PI: expected '?' character around line $state(line)" - } else { - uplevel #0 $options(-processinginstructioncommand) [list [string range $tag 1 end] [string trimleft $param]] - } - } - - !DOCTYPE { - # External entity reference - # This should move into xml.tcl - # Parse the params supplied. Looking for Name, ExternalID and MarkupDecl - regexp ^[cl $Wsp]*($name)(.*) $param x state(doc_name) param - set state(doc_name) [Normalize $state(doc_name) $options(-normalize)] - set externalID {} - set pubidlit {} - set systemlit {} - set externalID {} - if {[regexp -nocase ^[cl $Wsp]*(SYSTEM|PUBLIC)(.*) $param x id param]} { - switch [string toupper $id] { - SYSTEM { - if {[regexp ^[cl $Wsp]+"([cl ^"]*)"(.*) $param x systemlit param] || [regexp ^[cl $Wsp]+'([cl ^']*)'(.*) $param x systemlit param]} { - set externalID [list SYSTEM $systemlit] ;# " - } else { - uplevel #0 $options(-errorcommand) {{syntax error: SYSTEM identifier not followed by literal}} - } - } - PUBLIC { - if {[regexp ^[cl $Wsp]+"([cl ^"]*)"(.*) $param x pubidlit param] || [regexp ^[cl $Wsp]+'([cl ^']*)'(.*) $param x pubidlit param]} { - if {[regexp ^[cl $Wsp]+"([cl ^"]*)"(.*) $param x systemlit param] || [regexp ^[cl $Wsp]+'([cl ^']*)'(.*) $param x systemlit param]} { - set externalID [list PUBLIC $pubidlit $systemlit] - } else { - uplevel #0 $options(-errorcommand) "syntax error: PUBLIC identifier not followed by system literal around line $state(line)" - } - } else { - uplevel #0 $options(-errorcommand) "syntax error: PUBLIC identifier not followed by literal around line $state(line)" - } - } - } - if {[regexp -nocase ^[cl $Wsp]+NDATA[cl $Wsp]+($name)(.*) $param x notation param]} { - lappend externalID $notation - } - } - - uplevel #0 $options(-doctypecommand) $state(doc_name) [list $pubidlit $systemlit $options(-internaldtd)] - - } - - !--* { - - # Start of a comment - # See if it ends in the same tag, otherwise change the - # parsing mode - - regexp {!--(.*)} $tag discard comm1 - if {[regexp ([cl ^-]*)--[cl $Wsp]*\$ $comm1 discard comm1_1]} { - # processed comment (end in tag) - uplevel #0 $options(-commentcommand) [list $comm1_1] - } elseif {[regexp ([cl ^-]*)--[cl $Wsp]*\$ $param discard comm2]} { - # processed comment (end in attributes) - uplevel #0 $options(-commentcommand) [list $comm1$comm2] - } elseif {[regexp ([cl ^-]*)-->(.*) $text discard comm2 text]} { - # processed comment (end in text) - uplevel #0 $options(-commentcommand) [list $comm1$param>$comm2] - } else { - # start of comment - set state(mode) comment - set state(commentdata) "$comm1$param>$text" - continue - } - } - - {!\[CDATA\[*} { - - regexp {!\[CDATA\[(.*)} $tag discard cdata1 - if {[regexp {(.*)]]$} $param discard cdata2]} { - # processed CDATA (end in attribute) - uplevel #0 $options(-characterdatacommand) [list $cdata1$cdata2$text] - set text {} - } elseif {[regexp {(.*)]]>(.*)} $text discard cdata2 text]} { - # processed CDATA (end in text) - uplevel #0 $options(-characterdatacommand) [list $cdata1$param$empty>$cdata2$text] - set text {} - } else { - # start CDATA - set state(cdata) "$cdata1$param>$text" - set state(mode) cdata - continue - } - - } - - !ELEMENT { - # Internal DTD declaration - } - !ATTLIST { - } - !ENTITY { - } - !NOTATION { - } - - - !* { - uplevel #0 $options(-processinginstructioncommand) [list $tag $param] - } - default { - uplevel #0 $options(-errorcommand) [list "unknown processing instruction \"<$tag>\" around line $state(line)"] - } - } - } - *,1,* - - *,0,/,/ { - # Syntax error - uplevel #0 $options(-errorcommand) [list [list syntax error: closed/empty tag: tag $tag param $param empty $empty close $close around line $state(line)]] - } - } - - # Process character data - - if {$state(haveDocElement) && [llength $state(stack)]} { - - # Check if the internal DTD entity is in the text - regsub -all &xml:intdtd\; $text \[$options(-internaldtd)\] text - - # Look for entity references - if {([array size entities] || [string length $options(-entityreferencecommand)]) && \ - [regexp {&[^;]+;} $text]} { - - # protect Tcl specials - regsub -all {([][$\\])} $text {\\\1} text - # Mark entity references - regsub -all {&([^;]+);} $text [format {%s; %s {\1} ; %s %s} \}\} [namespace code [list Entity options $options(-entityreferencecommand) $options(-characterdatacommand) $options(-entityvariable)]] [list uplevel #0 $options(-characterdatacommand)] \{\{] text - set text "uplevel #0 $options(-characterdatacommand) {{$text}}" - eval $text - } else { - # Restore protected special characters - regsub -all {\\([{}\\])} $text {\1} text - uplevel #0 $options(-characterdatacommand) [list $text] - } - } elseif {[string length [string trim $text]]} { - uplevel #0 $options(-errorcommand) "unexpected text \"$text\" in document prolog around line $state(line)" - } - - } - - # If this is the end of the document, close all open containers - if {$options(-final) && [llength $state(stack)]} { - eval $options(-errorcommand) [list [list element [lindex $state(stack) end] remains unclosed around line $state(line)]] - } - - return {} -} - -# sgml::ParseEvent:ElementOpen -- -# -# Start of an element. -# -# Arguments: -# tag Element name -# attr Attribute list -# opts Option variable in caller -# args further configuration options -# -# Options: -# -empty boolean -# indicates whether the element was an empty element -# -# Results: -# Modify state and invoke callback - -proc sgml::ParseEvent:ElementOpen {tag attr opts args} { - upvar $opts options - upvar #0 $options(-statevariable) state - array set cfg {-empty 0} - array set cfg $args - - if {$options(-normalize)} { - set tag [string toupper $tag] - } - - # Update state - lappend state(stack) $tag - - # Parse attribute list into a key-value representation - if {[string compare $options(-parseattributelistcommand) {}]} { - if {[catch {uplevel #0 $options(-parseattributelistcommand) [list $attr]} attr]} { - uplevel #0 $options(-errorcommand) [list $attr around line $state(line)] - set attr {} - } - } - - set empty {} - if {$cfg(-empty) && $options(-reportempty)} { - set empty {-empty 1} - } - - # Invoke callback - uplevel #0 $options(-elementstartcommand) [list $tag $attr] $empty - - return {} -} - -# sgml::ParseEvent:ElementClose -- -# -# End of an element. -# -# Arguments: -# tag Element name -# opts Option variable in caller -# args further configuration options -# -# Options: -# -empty boolean -# indicates whether the element as an empty element -# -# Results: -# Modify state and invoke callback - -proc sgml::ParseEvent:ElementClose {tag opts args} { - upvar $opts options - upvar #0 $options(-statevariable) state - array set cfg {-empty 0} - array set cfg $args - - # WF check - if {$tag ne [lindex $state(stack) end] } { - uplevel #0 $options(-errorcommand) [list "end tag \"$tag\" does not match open element \"[lindex $state(stack) end]\" around line $state(line)"] - return - } - - # Update state - set state(stack) [lreplace $state(stack) end end] - - set empty {} - if {$cfg(-empty) && $options(-reportempty)} { - set empty {-empty 1} - } - - # Invoke callback - uplevel #0 $options(-elementendcommand) [list $tag] $empty - - return {} -} - -# sgml::Normalize -- -# -# Perform name normalization if required -# -# Arguments: -# name name to normalize -# req normalization required -# -# Results: -# Name returned as upper-case if normalization required - -proc sgml::Normalize {name req} { - if {$req} { - return [string toupper $name] - } else { - return $name - } -} - -# sgml::Entity -- -# -# Resolve XML entity references (syntax: &xxx;). -# -# Arguments: -# opts options array variable in caller -# entityrefcmd application callback for entity references -# pcdatacmd application callback for character data -# entities name of array containing entity definitions. -# ref entity reference (the "xxx" bit) -# -# Results: -# Returns substitution text for given entity. - -proc sgml::Entity {opts entityrefcmd pcdatacmd entities ref} { - upvar 2 $opts options - upvar #0 $options(-statevariable) state - - if {![string length $entities]} { - set entities [namespace current EntityPredef] - } - - switch -glob -- $ref { - %* { - # Parameter entity - not recognised outside of a DTD - } - #x* { - # Character entity - hex - if {[catch {format %c [scan [string range $ref 2 end] %x tmp; set tmp]} char]} { - return -code error "malformed character entity \"$ref\"" - } - uplevel #0 $pcdatacmd [list $char] - - return {} - - } - #* { - # Character entity - decimal - if {[catch {format %c [scan [string range $ref 1 end] %d tmp; set tmp]} char]} { - return -code error "malformed character entity \"$ref\"" - } - uplevel #0 $pcdatacmd [list $char] - - return {} - - } - default { - # General entity - upvar #0 $entities map - if {[info exists map($ref)]} { - - if {![regexp {<|&} $map($ref)]} { - - # Simple text replacement - optimise - - uplevel #0 $pcdatacmd [list $map($ref)] - - return {} - - } - - # Otherwise an additional round of parsing is required. - # This only applies to XML, since HTML doesn't have general entities - - # Must parse the replacement text for start & end tags, etc - # This text must be self-contained: balanced closing tags, and so on - - set tokenised [tokenise $map($ref) $::xml::tokExpr $::xml::substExpr] - set final $options(-final) - unset options(-final) - eval parseEvent [list $tokenised] [array get options] -final 0 - set options(-final) $final - - return {} - - } elseif {[string length $entityrefcmd]} { - - uplevel #0 $entityrefcmd [list $ref] - - return {} - - } - } - } - - # If all else fails leave the entity reference untouched - uplevel #0 $pcdatacmd [list &$ref\;] - - return {} -} - -#################################### -# -# DTD parser for SGML (XML). -# -# This DTD actually only handles XML DTDs. Other language's -# DTD's, such as HTML, must be written in terms of a XML DTD. -# -# A DTD is represented as a three element Tcl list. -# The first element contains the content models for elements, -# the second contains the attribute lists for elements and -# the last element contains the entities for the document. -# -#################################### - -# sgml::parseDTD -- -# -# Entry point to the SGML DTD parser. -# -# Arguments: -# dtd data defining the DTD to be parsed -# args configuration options -# -# Results: -# Returns a three element list, first element is the content model -# for each element, second element are the attribute lists of the -# elements and the third element is the entity map. - -proc sgml::parseDTD {dtd args} { - variable Wsp - variable ParseDTDnum - - array set opts [list \ - -errorcommand [namespace current]::noop \ - state [namespace current]::parseDTD[incr ParseDTDnum] - ] - array set opts $args - - set exp ]+)[cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^>]*)> - set sub {{\1} {\2} {\3} } - regsub -all $exp $dtd $sub dtd - - foreach {decl id value} $dtd { - catch {DTD:[string toupper $decl] $id $value} err - } - - return [list [array get contentmodel] [array get attributes] [array get entities]] -} - -# Procedures for handling the various declarative elements in a DTD. -# New elements may be added by creating a procedure of the form -# parse:DTD:_element_ - -# For each of these procedures, the various regular expressions they use -# are created outside of the proc to avoid overhead at runtime - -# sgml::DTD:ELEMENT -- -# -# defines an element. -# -# The content model for the element is stored in the contentmodel array, -# indexed by the element name. The content model is parsed into the -# following list form: -# -# {} Content model is EMPTY. -# Indicated by an empty list. -# * Content model is ANY. -# Indicated by an asterix. -# {ELEMENT ...} -# Content model is element-only. -# {MIXED {element1 element2 ...}} -# Content model is mixed (PCDATA and elements). -# The second element of the list contains the -# elements that may occur. #PCDATA is assumed -# (ie. the list is normalised). -# -# Arguments: -# id identifier for the element. -# value other information in the PI - -proc sgml::DTD:ELEMENT {id value} { - dbgputs DTD_parse [list DTD:ELEMENT $id $value] - variable Wsp - upvar opts state - upvar contentmodel cm - - if {[info exists cm($id)]} { - eval $state(-errorcommand) element [list "element \"$id\" already declared"] - } else { - switch -- $value { - EMPTY { - set cm($id) {} - } - ANY { - set cm($id) * - } - default { - if {[regexp [format {^\([%s]*#PCDATA[%s]*(\|([^)]+))?[%s]*\)*[%s]*$} $Wsp $Wsp $Wsp $Wsp] discard discard mtoks]} { - set cm($id) [list MIXED [split $mtoks |]] - } else { - if {[catch {CModelParse $state(state) $value} result]} { - eval $state(-errorcommand) element [list $result] - } else { - set cm($id) [list ELEMENT $result] - } - } - } - } - } -} - -# sgml::CModelParse -- -# -# Parse an element content model (non-mixed). -# A syntax tree is constructed. -# A transition table is built next. -# -# This is going to need alot of work! -# -# Arguments: -# state state array variable -# value the content model data -# -# Results: -# A Tcl list representing the content model. - -proc sgml::CModelParse {state value} { - upvar #0 $state var - - # First build syntax tree - set syntaxTree [CModelMakeSyntaxTree $state $value] - - # Build transition table - set transitionTable [CModelMakeTransitionTable $state $syntaxTree] - - return [list $syntaxTree $transitionTable] -} - -# sgml::CModelMakeSyntaxTree -- -# -# Construct a syntax tree for the regular expression. -# -# Syntax tree is represented as a Tcl list: -# rep {:choice|:seq {{rep list1} {rep list2} ...}} -# where: rep is repetition character, *, + or ?. {} for no repetition -# listN is nested expression or Name -# -# Arguments: -# spec Element specification -# -# Results: -# Syntax tree for element spec as nested Tcl list. -# -# Examples: -# (memo) -# {} {:seq {{} memo}} -# (front, body, back?) -# {} {:seq {{} front} {{} body} {? back}} -# (head, (p | list | note)*, div2*) -# {} {:seq {{} head} {* {:choice {{} p} {{} list} {{} note}}} {* div2}} -# (p | a | ul)+ -# + {:choice {{} p} {{} a} {{} ul}} - -proc sgml::CModelMakeSyntaxTree {state spec} { - upvar #0 $state var - variable Wsp - variable name - - # Translate the spec into a Tcl list. - - # None of the Tcl special characters are allowed in a content model spec. - if {[regexp {\$|\[|\]|\{|\}} $spec]} { - return -code error "illegal characters in specification" - } - - regsub -all [format {(%s)[%s]*(\?|\*|\+)?[%s]*(,|\|)?} $name $Wsp $Wsp] $spec [format {%sCModelSTname %s {\1} {\2} {\3}} \n $state] spec - regsub -all {\(} $spec "\nCModelSTopenParen $state " spec - regsub -all [format {\)[%s]*(\?|\*|\+)?[%s]*(,|\|)?} $Wsp $Wsp] $spec [format {%sCModelSTcloseParen %s {\1} {\2}} \n $state] spec - - array set var {stack {} state start} - eval $spec - - # Peel off the outer seq, its redundant - return [lindex [lindex $var(stack) 1] 0] -} - -# sgml::CModelSTname -- -# -# Processes a name in a content model spec. -# -# Arguments: -# state state array variable -# name name specified -# rep repetition operator -# cs choice or sequence delimiter -# -# Results: -# See CModelSTcp. - -proc sgml::CModelSTname {state name rep cs args} { - if {[llength $args]} { - return -code error "syntax error in specification: \"$args\"" - } - - CModelSTcp $state $name $rep $cs -} - -# sgml::CModelSTcp -- -# -# Process a content particle. -# -# Arguments: -# state state array variable -# name name specified -# rep repetition operator -# cs choice or sequence delimiter -# -# Results: -# The content particle is added to the current group. - -proc sgml::CModelSTcp {state cp rep cs} { - upvar #0 $state var - - switch -glob -- [lindex $var(state) end]=$cs { - start= { - set var(state) [lreplace $var(state) end end end] - # Add (dummy) grouping, either choice or sequence will do - CModelSTcsSet $state , - CModelSTcpAdd $state $cp $rep - } - :choice= - - :seq= { - set var(state) [lreplace $var(state) end end end] - CModelSTcpAdd $state $cp $rep - } - start=| - - start=, { - set var(state) [lreplace $var(state) end end [expr {$cs eq "," ? ":seq" : ":choice"}]] - CModelSTcsSet $state $cs - CModelSTcpAdd $state $cp $rep - } - :choice=| - - :seq=, { - CModelSTcpAdd $state $cp $rep - } - :choice=, - - :seq=| { - return -code error "syntax error in specification: incorrect delimiter after \"$cp\", should be \"[expr {$cs eq "," ? "|" : ","}]\"" - } - end=* { - return -code error "syntax error in specification: no delimiter before \"$cp\"" - } - default { - return -code error "syntax error" - } - } - -} - -# sgml::CModelSTcsSet -- -# -# Start a choice or sequence on the stack. -# -# Arguments: -# state state array -# cs choice oir sequence -# -# Results: -# state is modified: end element of state is appended. - -proc sgml::CModelSTcsSet {state cs} { - upvar #0 $state var - - set cs [expr {$cs eq "," ? ":seq" : ":choice"}] - - if {[llength $var(stack)]} { - set var(stack) [lreplace $var(stack) end end $cs] - } else { - set var(stack) [list $cs {}] - } -} - -# sgml::CModelSTcpAdd -- -# -# Append a content particle to the top of the stack. -# -# Arguments: -# state state array -# cp content particle -# rep repetition -# -# Results: -# state is modified: end element of state is appended. - -proc sgml::CModelSTcpAdd {state cp rep} { - upvar #0 $state var - - if {[llength $var(stack)]} { - set top [lindex $var(stack) end] - lappend top [list $rep $cp] - set var(stack) [lreplace $var(stack) end end $top] - } else { - set var(stack) [list $rep $cp] - } -} - -# sgml::CModelSTopenParen -- -# -# Processes a '(' in a content model spec. -# -# Arguments: -# state state array -# -# Results: -# Pushes stack in state array. - -proc sgml::CModelSTopenParen {state args} { - upvar #0 $state var - - if {[llength $args]} { - return -code error "syntax error in specification: \"$args\"" - } - - lappend var(state) start - lappend var(stack) [list {} {}] -} - -# sgml::CModelSTcloseParen -- -# -# Processes a ')' in a content model spec. -# -# Arguments: -# state state array -# rep repetition -# cs choice or sequence delimiter -# -# Results: -# Stack is popped, and former top of stack is appended to previous element. - -proc sgml::CModelSTcloseParen {state rep cs args} { - upvar #0 $state var - - if {[llength $args]} { - return -code error "syntax error in specification: \"$args\"" - } - - set cp [lindex $var(stack) end] - set var(stack) [lreplace $var(stack) end end] - set var(state) [lreplace $var(state) end end] - CModelSTcp $state $cp $rep $cs -} - -# sgml::CModelMakeTransitionTable -- -# -# Given a content model's syntax tree, constructs -# the transition table for the regular expression. -# -# See "Compilers, Principles, Techniques, and Tools", -# Aho, Sethi and Ullman. Section 3.9, algorithm 3.5. -# -# Arguments: -# state state array variable -# st syntax tree -# -# Results: -# The transition table is returned, as a key/value Tcl list. - -proc sgml::CModelMakeTransitionTable {state st} { - upvar #0 $state var - - # Construct nullable, firstpos and lastpos functions - array set var {number 0} - foreach {nullable firstpos lastpos} [ \ - TraverseDepth1st $state $st { - # Evaluated for leaf nodes - # Compute nullable(n) - # Compute firstpos(n) - # Compute lastpos(n) - set nullable [nullable leaf $rep $name] - set firstpos [list {} $var(number)] - set lastpos [list {} $var(number)] - set var(pos:$var(number)) $name - } { - # Evaluated for nonterminal nodes - # Compute nullable, firstpos, lastpos - set firstpos [firstpos $cs $firstpos $nullable] - set lastpos [lastpos $cs $lastpos $nullable] - set nullable [nullable nonterm $rep $cs $nullable] - } \ - ] break - - set accepting [incr var(number)] - set var(pos:$accepting) # - - # var(pos:N) maps from position to symbol. - # Construct reverse map for convenience. - # NB. A symbol may appear in more than one position. - # var is about to be reset, so use different arrays. - - foreach {pos symbol} [array get var pos:*] { - set pos [lindex [split $pos :] 1] - set pos2symbol($pos) $symbol - lappend sym2pos($symbol) $pos - } - - # Construct the followpos functions - catch {unset var} - followpos $state $st $firstpos $lastpos - - # Construct transition table - # Dstates is [union $marked $unmarked] - set unmarked [list [lindex $firstpos 1]] - while {[llength $unmarked]} { - set T [lindex $unmarked 0] - lappend marked $T - set unmarked [lrange $unmarked 1 end] - - # Find which input symbols occur in T - set symbols {} - foreach pos $T { - if {$pos != $accepting && [lsearch $symbols $pos2symbol($pos)] < 0} { - lappend symbols $pos2symbol($pos) - } - } - foreach a $symbols { - set U {} - foreach pos $sym2pos($a) { - if {[lsearch $T $pos] >= 0} { - # add followpos($pos) - if {$var($pos) == {}} { - lappend U $accepting - } else { - eval lappend U $var($pos) - } - } - } - set U [makeSet $U] - if {[llength $U] && [lsearch $marked $U] < 0 && [lsearch $unmarked $U] < 0} { - lappend unmarked $U - } - set Dtran($T,$a) $U - } - - } - - return [list [array get Dtran] [array get sym2pos] $accepting] -} - -# sgml::followpos -- -# -# Compute the followpos function, using the already computed -# firstpos and lastpos. -# -# Arguments: -# state array variable to store followpos functions -# st syntax tree -# firstpos firstpos functions for the syntax tree -# lastpos lastpos functions -# -# Results: -# followpos functions for each leaf node, in name/value format - -proc sgml::followpos {state st firstpos lastpos} { - upvar #0 $state var - - switch -- [lindex [lindex $st 1] 0] { - :seq { - for {set i 1} {$i < [llength [lindex $st 1]]} {incr i} { - followpos $state [lindex [lindex $st 1] $i] \ - [lindex [lindex $firstpos 0] [expr {$i - 1}]] \ - [lindex [lindex $lastpos 0] [expr {$i - 1}]] - foreach pos [lindex [lindex [lindex $lastpos 0] [expr {$i - 1}]] 1] { - eval lappend var($pos) [lindex [lindex [lindex $firstpos 0] $i] 1] - set var($pos) [makeSet $var($pos)] - } - } - } - :choice { - for {set i 1} {$i < [llength [lindex $st 1]]} {incr i} { - followpos $state [lindex [lindex $st 1] $i] \ - [lindex [lindex $firstpos 0] [expr {$i - 1}]] \ - [lindex [lindex $lastpos 0] [expr {$i - 1}]] - } - } - default { - # No action at leaf nodes - } - } - - switch -- [lindex $st 0] { - ? { - # We having nothing to do here ! Doing the same as - # for * effectively converts this qualifier into the other. - } - * { - foreach pos [lindex $lastpos 1] { - eval lappend var($pos) [lindex $firstpos 1] - set var($pos) [makeSet $var($pos)] - } - } - } - -} - -# sgml::TraverseDepth1st -- -# -# Perform depth-first traversal of a tree. -# A new tree is constructed, with each node computed by f. -# -# Arguments: -# state state array variable -# t The tree to traverse, a Tcl list -# leaf Evaluated at a leaf node -# nonTerm Evaluated at a nonterminal node -# -# Results: -# A new tree is returned. - -proc sgml::TraverseDepth1st {state t leaf nonTerm} { - upvar #0 $state var - - set nullable {} - set firstpos {} - set lastpos {} - - switch -- [lindex [lindex $t 1] 0] { - :seq - - :choice { - set rep [lindex $t 0] - set cs [lindex [lindex $t 1] 0] - - foreach child [lrange [lindex $t 1] 1 end] { - foreach {childNullable childFirstpos childLastpos} \ - [TraverseDepth1st $state $child $leaf $nonTerm] break - lappend nullable $childNullable - lappend firstpos $childFirstpos - lappend lastpos $childLastpos - } - - eval $nonTerm - } - default { - incr var(number) - set rep [lindex [lindex $t 0] 0] - set name [lindex [lindex $t 1] 0] - eval $leaf - } - } - - return [list $nullable $firstpos $lastpos] -} - -# sgml::firstpos -- -# -# Computes the firstpos function for a nonterminal node. -# -# Arguments: -# cs node type, choice or sequence -# firstpos firstpos functions for the subtree -# nullable nullable functions for the subtree -# -# Results: -# firstpos function for this node is returned. - -proc sgml::firstpos {cs firstpos nullable} { - switch -- $cs { - :seq { - set result [lindex [lindex $firstpos 0] 1] - for {set i 0} {$i < [llength $nullable]} {incr i} { - if {[lindex [lindex $nullable $i] 1]} { - eval lappend result [lindex [lindex $firstpos [expr {$i + 1}]] 1] - } else { - break - } - } - } - :choice { - foreach child $firstpos { - eval lappend result $child - } - } - } - - return [list $firstpos [makeSet $result]] -} - -# sgml::lastpos -- -# -# Computes the lastpos function for a nonterminal node. -# Same as firstpos, only logic is reversed -# -# Arguments: -# cs node type, choice or sequence -# lastpos lastpos functions for the subtree -# nullable nullable functions forthe subtree -# -# Results: -# lastpos function for this node is returned. - -proc sgml::lastpos {cs lastpos nullable} { - switch -- $cs { - :seq { - set result [lindex [lindex $lastpos end] 1] - for {set i [expr {[llength $nullable] - 1}]} {$i >= 0} {incr i -1} { - if {[lindex [lindex $nullable $i] 1]} { - eval lappend result [lindex [lindex $lastpos $i] 1] - } else { - break - } - } - } - :choice { - foreach child $lastpos { - eval lappend result $child - } - } - } - - return [list $lastpos [makeSet $result]] -} - -# sgml::makeSet -- -# -# Turn a list into a set, ie. remove duplicates. -# -# Arguments: -# s a list -# -# Results: -# A set is returned, which is a list with duplicates removed. - -proc sgml::makeSet s { - foreach r $s { - if {[llength $r]} { - set unique($r) {} - } - } - return [array names unique] -} - -# sgml::nullable -- -# -# Compute the nullable function for a node. -# -# Arguments: -# nodeType leaf or nonterminal -# rep repetition applying to this node -# name leaf node: symbol for this node, nonterm node: choice or seq node -# subtree nonterm node: nullable functions for the subtree -# -# Results: -# Returns nullable function for this branch of the tree. - -proc sgml::nullable {nodeType rep name {subtree {}}} { - switch -glob -- $rep:$nodeType { - :leaf - - +:leaf { - return [list {} 0] - } - \\*:leaf - - \\?:leaf { - return [list {} 1] - } - \\*:nonterm - - \\?:nonterm { - return [list $subtree 1] - } - :nonterm - - +:nonterm { - switch -- $name { - :choice { - set result 0 - foreach child $subtree { - set result [expr {$result || [lindex $child 1]}] - } - } - :seq { - set result 1 - foreach child $subtree { - set result [expr {$result && [lindex $child 1]}] - } - } - } - return [list $subtree $result] - } - } -} - -# These regular expressions are defined here once for better performance - -namespace eval sgml { - variable Wsp - - # Watch out for case-sensitivity - - set attlist_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*(#REQUIRED|#IMPLIED) - set attlist_enum_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*\\(([cl ^)]*)\\)[cl $Wsp]*("([cl ^")])")? ;# " - set attlist_fixed_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*(#FIXED)[cl $Wsp]*([cl ^$Wsp]+) - - set param_entity_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*([cl ^"$Wsp]*)[cl $Wsp]*"([cl ^"]*)" - - set notation_exp [cl $Wsp]*([cl ^$Wsp]+)[cl $Wsp]*(.*) - -} - -# sgml::DTD:ATTLIST -- -# -# defines an attribute list. -# -# Arguments: -# id Element an attribute list is being defined for. -# value data from the PI. -# -# Results: -# Attribute list variables are modified. - -proc sgml::DTD:ATTLIST {id value} { - variable attlist_exp - variable attlist_enum_exp - variable attlist_fixed_exp - dbgputs DTD_parse [list DTD:ATTLIST $id $value] - upvar opts state - upvar attributes am - - if {[info exists am($id)]} { - eval $state(-errorcommand) attlist [list "attribute list for element \"$id\" already declared"] - } else { - # Parse the attribute list. If it were regular, could just use foreach, - # but some attributes may have values. - regsub -all {([][$\\])} $value {\\\1} value - regsub -all $attlist_exp $value {[DTDAttribute {\1} {\2} {\3}]} value - regsub -all $attlist_enum_exp $value {[DTDAttribute {\1} {\2} {\3}]} value - regsub -all $attlist_fixed_exp $value {[DTDAttribute {\1} {\2} {\3} {\4}]} value - subst $value - set am($id) [array get attlist] - } -} - -# sgml::DTDAttribute -- -# -# Parse definition of a single attribute. -# -# Arguments: -# name attribute name -# type type of this attribute -# default default value of the attribute -# value other information - -proc sgml::DTDAttribute {name type default {value {}}} { - upvar attlist al - # This needs further work - set al($name) [list $default $value] -} - -# sgml::DTD:ENTITY -- -# -# PI -# -# Arguments: -# id identifier for the entity -# value data -# -# Results: -# Modifies the caller's entities array variable - -proc sgml::DTD:ENTITY {id value} { - variable param_entity_exp - dbgputs DTD_parse [list DTD:ENTITY $id $value] - upvar opts state - upvar entities ents - - if {"%" ne $id } { - # Entity declaration - if {[info exists ents($id)]} { - eval $state(-errorcommand) entity [list "entity \"$id\" already declared"] - } else { - if {![regexp {"([^"]*)"} $value x entvalue] && ![regexp {'([^']*)'} $value x entvalue]} { - eval $state(-errorcommand) entityvalue [list "entity value \"$value\" not correctly specified"] - } ;# " - set ents($id) $entvalue - } - } else { - # Parameter entity declaration - switch -glob [regexp $param_entity_exp $value x name scheme data],[string compare {} $scheme] { - 0,* { - eval $state(-errorcommand) entityvalue [list "parameter entity \"$value\" not correctly specified"] - } - *,0 { - # SYSTEM or PUBLIC declaration - } - default { - set ents($id) $data - } - } - } -} - -# sgml::DTD:NOTATION -- - -proc sgml::DTD:NOTATION {id value} { - variable notation_exp - upvar opts state - - if {[regexp $notation_exp $value x scheme data] == 2} { - } else { - eval $state(-errorcommand) notationvalue [list "notation value \"$value\" incorrectly specified"] - } -} - -### Utility procedures - -# sgml::noop -- -# -# A do-nothing proc -# -# Arguments: -# args arguments -# -# Results: -# Nothing. - -proc sgml::noop args { - return 0 -} - -# sgml::identity -- -# -# Identity function. -# -# Arguments: -# a arbitrary argument -# -# Results: -# $a - -proc sgml::identity a { - return $a -} - -# sgml::Error -- -# -# Throw an error -# -# Arguments: -# args arguments -# -# Results: -# Error return condition. - -proc sgml::Error args { - uplevel return -code error [list $args] -} - -### Following procedures are based on html_library - -# sgml::zapWhite -- -# -# Convert multiple white space into a single space. -# -# Arguments: -# data plain text -# -# Results: -# As above - -proc sgml::zapWhite data { - regsub -all "\[ \t\r\n\]+" $data { } data - return $data -} - -proc sgml::Boolean value { - regsub {1|true|yes|on} $value 1 value - regsub {0|false|no|off} $value 0 value - return $value -} - -proc sgml::dbgputs {where text} { - variable dbg - - catch {if {$dbg} {puts stdout "DBG: $where ($text)"}} -} Index: xotcl/library/xml/xml.tcl =================================================================== diff -u -N --- xotcl/library/xml/xml.tcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/xml/xml.tcl (revision 0) @@ -1,504 +0,0 @@ -# xml.tcl -- -# -# This file provides XML services. -# These services include a XML document instance and DTD parser, -# as well as support for generating XML. -# -# Copyright (c) 1998,1999 Zveno Pty Ltd -# http://www.zveno.com/ -# -# Zveno makes this software and all associated data and documentation -# ('Software') available free of charge for non-commercial purposes only. You -# may make copies of the Software but you must include all of this notice on -# any copy. -# -# The Software was developed for research purposes and Zveno does not warrant -# that it is error free or fit for any purpose. Zveno disclaims any -# liability for all claims, expenses, losses, damages and costs any user may -# incur as a result of using, copying or modifying the Software. -# -# Copyright (c) 1997 Australian National University (ANU). -# -# ANU makes this software and all associated data and documentation -# ('Software') available free of charge for non-commercial purposes only. You -# may make copies of the Software but you must include all of this notice on -# any copy. -# -# The Software was developed for research purposes and ANU does not warrant -# that it is error free or fit for any purpose. ANU disclaims any -# liability for all claims, expenses, losses, damages and costs any user may -# incur as a result of using, copying or modifying the Software. -# -# $Id: xml.tcl,v 1.4 2006/09/27 08:12:40 neumann Exp $ - -package provide xml 1.8 - -package require sgml 1.6 - -namespace eval xml { - - # Procedures for parsing XML documents - namespace export parser - # Procedures for parsing XML DTDs - namespace export DTDparser - - # Counter for creating unique parser objects - variable ParserCounter 0 - - # Convenience routine - proc cl x { - return "\[$x\]" - } - - # Define various regular expressions - # white space - variable Wsp " \t\r\n" - variable noWsp [cl ^$Wsp] - - # Various XML names and tokens - - # BUG: NameChar does not include CombiningChar or Extender - variable NameChar [cl -a-zA-Z0-9._:] - variable Name [cl a-zA-Z_:]$NameChar* - variable Nmtoken $NameChar+ - - # Tokenising expressions - - variable tokExpr <(/?)([cl ^$Wsp>]+)([cl $Wsp]*[cl ^>]*)> - variable substExpr "\}\n{\\2} {\\1} {} {\\3} \{" - - # table of predefined entities - - variable EntityPredef - array set EntityPredef { - lt < gt > amp & quot \" apos ' - } - -} - - -# xml::parser -- -# -# Creates XML parser object. -# -# Arguments: -# args Unique name for parser object -# plus option/value pairs -# -# Recognised Options: -# -final Indicates end of document data -# -elementstartcommand Called when an element starts -# -elementendcommand Called when an element ends -# -characterdatacommand Called when character data occurs -# -processinginstructioncommand Called when a PI occurs -# -externalentityrefcommand Called for an external entity reference -# -# (Not compatible with expat) -# -xmldeclcommand Called when the XML declaration occurs -# -doctypecommand Called when the document type declaration occurs -# -# -errorcommand Script to evaluate for a fatal error -# -warningcommand Script to evaluate for a reportable warning -# -statevariable global state variable -# -reportempty whether to provide empty element indication -# -# Results: -# The state variable is initialised. - -proc xml::parser {args} { - variable ParserCounter - - if {[llength $args] > 0} { - set name [lindex $args 0] - set args [lreplace $args 0 0] - } else { - set name parser[incr ParserCounter] - } - - if {[info command [namespace current]::$name] != {}} { - return -code error "unable to create parser object \"[namespace current]::$name\" command" - } - - # Initialise state variable and object command - upvar \#0 [namespace current]::$name parser - set sgml_ns [namespace parent]::sgml - array set parser [list name $name \ - -final 1 \ - -elementstartcommand ${sgml_ns}::noop \ - -elementendcommand ${sgml_ns}::noop \ - -characterdatacommand ${sgml_ns}::noop \ - -processinginstructioncommand ${sgml_ns}::noop \ - -externalentityrefcommand ${sgml_ns}::noop \ - -xmldeclcommand ${sgml_ns}::noop \ - -doctypecommand ${sgml_ns}::noop \ - -warningcommand ${sgml_ns}::noop \ - -statevariable [namespace current]::$name \ - -reportempty 0 \ - internaldtd {} \ - ] - - proc [namespace current]::$name {method args} \ - "eval ParseCommand $name \$method \$args" - - eval ParseCommand [list $name] configure $args - - return [namespace current]::$name -} - -# xml::ParseCommand -- -# -# Handles parse object command invocations -# -# Valid Methods: -# cget -# configure -# parse -# reset -# -# Arguments: -# parser parser object -# method minor command -# args other arguments -# -# Results: -# Depends on method - -proc xml::ParseCommand {parser method args} { - upvar \#0 [namespace current]::$parser state - - switch -- $method { - cget { - return $state([lindex $args 0]) - } - configure { - foreach {opt value} $args { - set state($opt) $value - } - } - parse { - ParseCommand_parse $parser [lindex $args 0] - } - reset { - if {[llength $args]} { - return -code error "too many arguments" - } - ParseCommand_reset $parser - } - default { - return -code error "unknown method \"$method\"" - } - } - - return {} -} - -# xml::ParseCommand_parse -- -# -# Parses document instance data -# -# Arguments: -# object parser object -# xml data -# -# Results: -# Callbacks are invoked, if any are defined - -proc xml::ParseCommand_parse {object xml} { - upvar \#0 [namespace current]::$object parser - variable Wsp - variable tokExpr - variable substExpr - - set parent [namespace parent] - if {"::" eq $parent } { - set parent {} - } - - set tokenised [lrange \ - [${parent}::sgml::tokenise $xml \ - $tokExpr \ - $substExpr \ - -internaldtdvariable [namespace current]::${object}(internaldtd)] \ - 5 end] - - eval ${parent}::sgml::parseEvent \ - [list $tokenised \ - -emptyelement [namespace code ParseEmpty] \ - -parseattributelistcommand [namespace code ParseAttrs]] \ - [array get parser -*command] \ - [array get parser -entityvariable] \ - [array get parser -reportempty] \ - -normalize 0 \ - -internaldtd [list $parser(internaldtd)] - - return {} -} - -# xml::ParseEmpty -- -# -# Used by parser to determine whether an element is empty. -# This should be dead easy in XML. The only complication is -# that the RE above can't catch the trailing slash, so we have -# to dig it out of the tag name or attribute list. -# -# Tcl 8.1 REs should fix this. -# -# Arguments: -# tag element name -# attr attribute list (raw) -# e End tag delimiter. -# -# Results: -# "/" if the trailing slash is found. Optionally, return a list -# containing new values for the tag name and/or attribute list. - -proc xml::ParseEmpty {tag attr e} { - - if {[string match */ [string trimright $tag]] && \ - ![string length $attr]} { - regsub {/$} $tag {} tag - return [list / $tag $attr] - } elseif {[string match */ [string trimright $attr]]} { - regsub {/$} [string trimright $attr] {} attr - return [list / $tag $attr] - } else { - return {} - } - -} - -# xml::ParseAttrs -- -# -# Parse element attributes. -# -# There are two forms for name-value pairs: -# -# name="value" -# name='value' -# -# Watch out for the trailing slash on empty elements. -# -# Arguments: -# attrs attribute string given in a tag -# -# Results: -# Returns a Tcl list representing the name-value pairs in the -# attribute string - -proc xml::ParseAttrs attrs { - variable Wsp - variable Name - - # First check whether there's any work to do - if {{} eq [string trim $attrs] } { - return {} - } - - # Strip the trailing slash on empty elements - regsub [format {/[%s]*$} " \t\n\r"] $attrs {} atList - - set mode name - set result {} - foreach component [split $atList =] { - switch $mode { - name { - set component [string trim $component] - if {[regexp $Name $component]} { - lappend result $component - } else { - return -code error "invalid attribute name \"$component\"" - } - set mode value:start - } - value:start { - set component [string trimleft $component] - set delimiter [string index $component 0] - set value {} - switch -- $delimiter { - \" - - ' { - if {[regexp [format {%s([^%s]*)%s(.*)} $delimiter $delimiter $delimiter] $component discard value remainder]} { - lappend result $value - set remainder [string trim $remainder] - if {[string length $remainder]} { - if {[regexp $Name $remainder]} { - lappend result $remainder - set mode value:start - } else { - return -code error "invalid attribute name \"$remainder\"" - } - } else { - set mode end - } - } else { - set value [string range $component 1 end] - set mode value:continue - } - } - default { - return -code error "invalid value for attribute \"[lindex $result end]\"" - } - } - } - value:continue { - if {[regexp [format {([^%s]*)%s(.*)} $delimiter $delimiter] $component discard valuepart remainder]} { - append value = $valuepart - lappend result $value - set remainder [string trim $remainder] - if {[string length $remainder]} { - if {[regexp $Name $remainder]} { - lappend result $remainder - set mode value:start - } else { - return -code error "invalid attribute name \"$remainder\"" - } - } else { - set mode end - } - } else { - append value = $component - } - } - end { - return -code error "unexpected data found after end of attribute list" - } - } - } - - switch $mode { - name - - end { - # This is normal - } - default { - return -code error "unexpected end of attribute list" - } - } - - return $result -} - -proc xml::OLDParseAttrs {attrs} { - variable Wsp - variable Name - - # First check whether there's any work to do - if {{} eq [string trim $attrs] } { - return {} - } - - # Strip the trailing slash on empty elements - regsub [format {/[%s]*$} " \t\n\r"] $attrs {} atList - - # Protect Tcl special characters - #regsub -all {([[\$\\])} $atList {\\\1} atList - regsub -all & $atList {\&} atList - regsub -all {\[} $atList {\&ob;} atList - regsub -all {\]} $atList {\&cb;} atlist - # NB. sgml package delivers braces and backslashes quoted - regsub -all {\\\{} $atList {\&oc;} atList - regsub -all {\\\}} $atList {\&cc;} atlist - regsub -all {\$} $atList {\$} atList - regsub -all {\\\\} $atList {\&bs;} atList - - regsub -all [format {(%s)[%s]*=[%s]*"([^"]*)"} $Name $Wsp $Wsp] \ - $atList {[set parsed(\1) {\2}; set dummy {}] } atList ;# " - regsub -all [format {(%s)[%s]*=[%s]*'([^']*)'} $Name $Wsp $Wsp] \ - $atList {[set parsed(\1) {\2}; set dummy {}] } atList - - set leftovers [subst $atList] - - if {[string length [string trim $leftovers]]} { - return -code error "syntax error in attribute list \"$attrs\"" - } - - return [ParseAttrs:Deprotect [array get parsed]] -} - -# xml::ParseAttrs:Deprotect -- -# -# Reverse map Tcl special characters previously protected -# -# Arguments: -# attrs attribute list -# -# Results: -# Characters substituted - -proc xml::ParseAttrs:Deprotect attrs { - - regsub -all &\; $attrs \\& attrs - regsub -all &ob\; $attrs \[ attrs - regsub -all &cb\; $attrs \] attrs - regsub -all &oc\; $attrs \{ attrs - regsub -all &cc\; $attrs \} attrs - regsub -all &dollar\; $attrs \$ attrs - regsub -all &bs\; $attrs \\\\ attrs - - return $attrs - -} - -# xml::ParseCommand_reset -- -# -# Initialize parser data -# -# Arguments: -# object parser object -# -# Results: -# Parser data structure initialised - -proc xml::ParseCommand_reset object { - upvar \#0 [namespace current]::$object parser - - array set parser [list \ - -final 1 \ - internaldtd {} \ - ] -} - -# xml::noop -- -# -# A do-nothing proc - -proc xml::noop args {} - -### Following procedures are based on html_library - -# xml::zapWhite -- -# -# Convert multiple white space into a single space. -# -# Arguments: -# data plain text -# -# Results: -# As above - -proc xml::zapWhite data { - regsub -all "\[ \t\r\n\]+" $data { } data - return $data -} - -# -# DTD parser for XML is wholly contained within the sgml.tcl package -# - -# xml::parseDTD -- -# -# Entry point to the XML DTD parser. -# -# Arguments: -# dtd XML data defining the DTD to be parsed -# args configuration options -# -# Results: -# Returns a three element list, first element is the content model -# for each element, second element are the attribute lists of the -# elements and the third element is the entity map. - -proc xml::parseDTD {dtd args} { - return [eval [expr {[namespace parent] == {::} ? {} : [namespace parent]}]::sgml::parseDTD [list $dtd] $args] -} - Index: xotcl/library/xml/xml.xotcl =================================================================== diff -u -N --- xotcl/library/xml/xml.xotcl (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/library/xml/xml.xotcl (revision 0) @@ -1,141 +0,0 @@ -#!../../src/xotclsh -# $Id: xml.xotcl,v 1.2 2006/02/18 22:17:33 neumann Exp $ -# -# smaller implementation of an XML parser wrapper, similar to xoXML -# example from the XOTcl paper -# -# not used in ActiWeb -# -package require xml - -# -# Xml Parser Connection Class (wrapper facade to TclXML and expat interface like parsers) -# -Class XMLParser -XMLParser instproc init args { - my set PC [xml::parser [my autoname [namespace tail [self]]]] - my config \ - -characterdatacommand "[self] pcdata" \ - -elementstartcommand "[self] start" \ - -elementendcommand "[self] end" - my set currentElement [Node create [self]::T] - next -} - -# Create Forwarding methods to the parser == -# abstact interface for xml parser acces -XMLParser instproc cget option {[my set PC] cget $option} -XMLParser instproc config args {eval "[my set PC] configure $args"} -XMLParser instproc parse data {[my set PC] parse $data} -XMLParser instproc reset {} {[my set PC] reset; [self]::T reset} -XMLParser instproc pcdata text { - my instvar currentElement - $currentElement insertText $text -} -XMLParser instproc start {name attrList} { - my instvar currentElement - set currentElement [$currentElement insertElement $name $attrList] -} -XMLParser instproc end {name} { - my instvar currentElement - set currentElement [$currentElement info parent] -} -XMLParser instproc print {} { - ::x::T print - puts "" -} - -############################################################################### -# Simple Node tree -# General Nodes -Class Node -Node instproc reset {} { - foreach c [my info children] {$c destroy} - my set children "" -} -Node instproc print {} { - if {[my exists children]} { - foreach c [my set children] { $c print} - } -} -Node instproc insert {xoclass elementclass args} { - set new [eval $xoclass new -childof [self] $args] - my lappend children $new - return $new -} -Node instproc insertElement {tag args} { - return [eval my insert Element $tag -attributes $args -tag $tag] -} -Node instproc insertText {text} { - return [my insert Text text -content $text] -} - -# Element Nodes -Class Element -superclass Node -parameter { - {attributes ""} - tag -} -Element instproc print {} { - my instvar tag attributes - if {[llength $attributes]>0} { - foreach {n v} $attributes {append string " " $n = '$v'} - } else { - set string "" - } - puts -nonewline <$tag$string> - next - puts -nonewline -} - -# Text Nodes -Class Text -superclass Node -parameter { - {content ""} -} -Text instproc print {} { - puts -nonewline [my set content] -} - -################################################################################# -### Examples -################################################################################# -XMLParser x -x parse { - - - - Mary Andrew - Jacky Crystal - - - - - - - - - - - - - The Coolest Web Page - Il Pagio di Web Fuba - - - - } - -::x print -puts ============================================================ -x reset -x parse { - - a - b - c - def - g - -} -x print Index: xotcl/library/xml/xmlExample.xotcl =================================================================== diff -u -N --- xotcl/library/xml/xmlExample.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/library/xml/xmlExample.xotcl (revision 0) @@ -1,115 +0,0 @@ -#!../../src/xotclsh -# -# small Example for usage of xoXML -package require xotcl::package -package require xotcl::trace -package require xotcl::xml::parser -package require xotcl::xml::recreatorVisitor -package require xotcl::xml::printVisitor - -# -# instantiate parser and parser an example text into a node tree -# -XMLParser x -#x parse { -# - -x parse { - - - a - b - c - - - b - c - - - a - b - c - b - d - - - - - - Mary Andrew - Jacky Crystal - - - - - - - - - - - - - The Coolest Web Page - Il Pagio di Web Fuba - - - - - some text - - - - -} - -proc run {} { - # - # print the node treee to the std output - # - puts ************************************************************************ - puts "Node Tree:" - puts ************************************************************************ - PrintVisitor pv - pv interpretAll x - - # - # recreate xml text and print it to the std output - # - puts \n - puts ************************************************************************ - puts "Recreated XML Text:" - puts ************************************************************************ - XMLRecreatorVisitor rv - puts [rv interpretAll x] - -} -run - -XMLParser y -y parse { - - - - - - - - - - - - - olla - - - - - hallo - - -} -XMLRecreatorVisitor rv -puts [rv interpretAll y] Index: xotcl/library/xml/xmlRecreatorVisitor.xotcl =================================================================== diff -u -N --- xotcl/library/xml/xmlRecreatorVisitor.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/xml/xmlRecreatorVisitor.xotcl (revision 0) @@ -1,160 +0,0 @@ -# $Id: xmlRecreatorVisitor.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ - -package provide xotcl::xml::recreatorVisitor 0.9 -package require xotcl::xml::parser -package require XOTcl - -namespace eval ::xotcl::xml::recreatorVisitor { - namespace import ::xotcl::* - - ############################################################################## - # - # a visitor that recreates an XML representation from a - # node tree - # - ############################################################################# - Class XMLRecreatorVisitor -superclass NodeTreeVisitor -parameter useCDATA - - # - # determine nesting depth of an object if the aggregation tree - # - XMLRecreatorVisitor instproc nestingDepth {obj} { - for {set d 0;set s [$obj info parent]} {$s ne "::"} {set s [$s info parent]} { - incr d - } - return $d - } - - # - # insert appropriate number of spaces for indentation -> return space string - # - XMLRecreatorVisitor instproc indent chars { - set spaces " " - for {set l 9} {$l<$chars} {incr l $l} {append spaces $spaces} - return [string range $spaces 1 $chars] - } - XMLRecreatorVisitor instproc insertIndent {obj} { - my instvar nestingStart - return [my indent [expr {([my nestingDepth $obj] - $nestingStart)*2} - 2]] - } - - XMLRecreatorVisitor instproc attrIndent {objName fa} { - upvar [self callinglevel] $fa firstAttr - if {$firstAttr} { - set firstAttr 0 - return " " - } else { - return "\n[my insertIndent $objName] " - } - } - - XMLRecreatorVisitor instproc getContent objName { - return [$objName content] - } - XMLRecreatorVisitor instproc hasOnlyAttrs {obj} { - if {[$obj exists pcdata]} {return 0} - foreach c [$obj info children] { - if {[$c istype XMLNode]} {return 0} - } - return 1 - } - - # - # hook to append line feed dependent on the object - # default is to append one \n - # - XMLRecreatorVisitor instproc appendLineFeed obj { - return "\n" - } - - # - # evaluate node objName - # - XMLRecreatorVisitor instproc visit objName { - my instvar result - set c [my getContent $objName] - if {$c ne ""} { - $objName instvar attributes pcdata - set ns [$objName resolveNS] - set firstAttr 1 - set attrStr "" - if {[string first $objName $ns] != -1} { - # append xmlns attributes, xmlns=... first - if {[$ns exists nsArray(xmlns)]} { - append attrStr [my attrIndent $objName firstAttr] - append attrStr "xmlns = \"[$ns set nsArray(xmlns)]\"" - } - foreach a [$ns array names nsArray] { - if {$a ne "xmlns"} { - append attrStr [my attrIndent $objName firstAttr] - append attrStr "xmlns:${a} = \"[$ns set nsArray($a)]\"" - } - } - } - foreach a [array names attributes] { - append attrStr [my attrIndent $objName firstAttr] - append attrStr "$a = \"$attributes($a)\"" - } - append result "[my insertIndent $objName]<${c}$attrStr" - - if {[my hasOnlyAttrs $objName]} { - append result "/>" - } else { - append result ">" - } - - if {[info exists pcdata] && [llength $pcdata]>1 && - [lindex $pcdata 0] eq ""} { - append result " " [my pcdataString [lindex $pcdata 1]] - } - append result [my appendLineFeed $objName] - } - return $result - } - XMLRecreatorVisitor instproc pcdataString text { - if {[my exists useCDATA] && [regexp < $text]} { - return "" - } - return $text - } - - # - # evaluate end of a node - # - XMLRecreatorVisitor instproc visitEnd objName { - my instvar result - set c [$objName content] - if {$c ne ""} { - if {![my hasOnlyAttrs $objName]} { - append result [my insertIndent $objName] \n - } - } - # a child is responsible for the "mixed content" data elements - # that have a location after the child - set p [$objName info parent] - if {[$p istype XMLElement] && [$p mixedContent]} { - foreach {location data} [$p set pcdata] { - if {$location == $objName} { - append result [my insertIndent $objName] \ - [my pcdataString $data] \n - } - } - } - } - - - # - # public method to be called on top node -> returns XML text as result - # - XMLRecreatorVisitor instproc interpretNodeTree node { - my instvar result - set result "" - my set nestingStart [my nestingDepth $node] - $node accept [self] - return $result - } - - namespace export XMLRecreatorVisitor -} - -namespace import ::xotcl::xml::recreatorVisitor::* Index: xotcl/library/xml/xoXML.xotcl =================================================================== diff -u -N --- xotcl/library/xml/xoXML.xotcl (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/library/xml/xoXML.xotcl (revision 0) @@ -1,641 +0,0 @@ -# $Id: xoXML.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $ -package provide xotcl::xml::parser 0.94 - -package require XOTcl -package require xotcl::pattern::chainOfResponsibility -package require xotcl::pattern::sortedCompositeWithAfter -#package require xotcl::pattern::link -package require xotcl::trace -#package require xml -#package require expat - -namespace eval ::xotcl::xml::parser { - namespace import ::xotcl::* - - ############################################################################## - # - # XML Namespace Handling - # - ############################################################################## - @ ChainOfResponsibility XMLNamespace { - description { - A Chain of Responsiblity Class that handles the XML - XMLNamespace facility for an object tree - - especially for internal usage of the xoXML component - } - } - ChainOfResponsibility XMLNamespace - - - XMLNamespace instproc init args { - # Per default: New NS is end of a namespace chain - # indicated by "" - my successor "" - my array set nsArray {} - next - } - - # - # add two operations searchPrefix and searchFullName as chained -> calls are - # automatically forwarded in the chain, if the failure value (here: "") - # is returned by the chained object - # - XMLNamespace addChainedOperation searchPrefix "" - XMLNamespace addChainedOperation searchFullName "" - XMLNamespace addChainedOperation searchNamespaceByPrefix "" - # - # namespaces are added by value pairs of prefix and full namespace - # name (ns) - # - XMLNamespace instproc add {prefix ns} { - #puts stderr "adding ns: $prefix $ns" - my set nsArray($prefix) $ns - } - - # - # search the chain for a prefix -> return full name, if found - # - XMLNamespace instproc searchPrefix {prefix} { - #puts stderr "[self proc]: Searching for $prefix in [self]" - #puts stderr "[self proc]: There are: [my array names nsArray]" - if {[my exists nsArray($prefix)]} { - return [my set nsArray($prefix)] - } else { - return "" - } - } - - # - # search the chain for a prefix -> return the responisble namespace name - # - XMLNamespace instproc searchNamespaceByPrefix {prefix} { - if {[my exists nsArray($prefix)]} { - return [self] - } else { - return "" - } - } - - # - # search the chain for the full name -> return prefix, if found - # - XMLNamespace instproc searchFullName {fname} { - foreach n [my array names nsArray] { - if {[string match [my set nsArray($n)] $fname]} { - return $n - } - } - return "" - } - - # - # construct the full name from either a expression "prefix:name" - # or just "name" (then construct with "xmlns" as default namespace prefix) - # - XMLNamespace instproc getFullName {fname} { - #puts stderr "Getting FullName for $fname in [self]" - if {[regexp "^(.*):(.*)$" $fname _ prefix name]} { - if {[set pre [my searchPrefix $prefix]] != ""} { - return [set pre]$name - } - } else { - # no colon -> use xmlns - return [my searchPrefix "xmlns"]$fname - } - return $fname - } - - ############################################################################## - # - # Abstract Node Class - # - ############################################################################## - - SortedComposite AbstractXMLNode - - @ SortedComposite AbstractXMLNode { description { - Abstract interface for all node classes. Nodes have an event based - parsing interface to build up a node tree, from an event based parsing - stream - } - } - - # - # called if node start event occurs -> - # start parsing node "name" and intpretation hook for the attribute list - # - AbstractXMLNode abstract instproc parseStart {name attrList} - - # - # called if "character data" is reached - # - AbstractXMLNode abstract instproc parseData {text} - - # - # called if node end is reached - # - AbstractXMLNode abstract instproc parseEnd {name} - - # - # convinience method for printing nodes to output stream (e.g. for debugging) - # - AbstractXMLNode abstract instproc print {} - - # - # Visitor acceptance methods -> call visit and visitEnd of the given - # "visitor" with my as argument - # - AbstractXMLNode abstract instproc accept {visitor} - AbstractXMLNode abstract instproc acceptEnd {visitor} - - # make 'accept' and 'acceptEnd' composite operations - AbstractXMLNode addOperations {accept accept} - AbstractXMLNode addAfterOperations {accept acceptEnd} - - ############################################################################## - # - # XMLNode Node Class - # - ############################################################################## - - # - # the pcdata variable stores the data elements in form of a tuple list - # . - # - Class XMLNode -superclass AbstractXMLNode -parameter { - {content ""} - {namespace} - {parser ""} - pcdata - } - @ Class XMLNode { - description { - general superclass for XML nodes - } - } - - XMLNode instproc init args { - my array set attributes {} - next - } - - XMLNode instproc nextChild {name} { - set child [my autoname $name] - my set lastChild $child - my appendChildren $child - return $child - } - - # - # placeholder methods for the event interface - # - XMLNode instproc parseStart {name attrList} { - #puts "parsed start: [my info class]: $name $attrList" - } - - # - # chracter data is stored in a pcdata variable. - # - XMLNode instproc mixedContent {} { - expr {[my exists children] && [my exists pcdata]} - } - XMLNode instproc parseData {text} { - #my showCall - my instvar pcdata - - set childBeforePCData "" - # if pcdata exists seek the last XMLElement child - #if {[my exists children]} { - # foreach c [my set children] { - # if {[[self]::$c istype XMLElement]} { - # set childBeforePCData [self]::$c - # } - # } - # } - if {[my exists lastChild]} { - set childBeforePCData [self]::[my set lastChild] - } - #my showMsg childBeforePCData=$childBeforePCData - #my showMsg old-pcdata=$pcdata - if {[my exists pcdata]} { - foreach {e d} $pcdata { } - #puts stderr "//$e//$d// [expr {$e == $childBeforePCData}]" - if {$e == $childBeforePCData} { - set pcdata [lreplace $pcdata [expr {[llength $pcdata]-2}] end] - set text $d$text - } - lappend pcdata $childBeforePCData $text - #puts stderr *append****new-pcdata=$pcdata - } else { - set pcdata [list $childBeforePCData $text] - #puts stderr *set*******new-pcdata=$pcdata - } - } - - # - # this method just returns the data elt in the first pcdata - # - XMLNode instproc getFirstPCData {} { - if {[my exists pcdata]} { - return [lindex [my set pcdata] 1] - } - return "" - } - - # - # returns a list of all pcdata elememts, without location information - # stored in the pcdata instance variable - # - XMLNode instproc getPCdataList {} { - set result "" - foreach {l data} [my set pcdata] { - lappend result $data - } - return $result - } - - # - #my set pcdata $text - - XMLNode instproc parseEnd {name} { - #puts "parsed end: [my info class]: $name" - } - - XMLNode instproc print {} { - set c "[my info class]-[self] --- [my content]" - foreach a [my array names attributes] { - append c "\nATTR: $a = [my set attributes($a)]" - } - if {[my exists pcdata]} { - foreach d [my getPCdataList] { - append c "\nPCDATA:\n$d" - } - } - return $c - } - - # - # composite accept operation for visiting the node tree - # through visitors - # - # -> interpretation of the interpreter pattern - # - XMLNode instproc accept {visitor} { - $visitor visit [self] - } - - # - # composite operation called at termination of computation of - # a level == end node - # - XMLNode instproc acceptEnd {visitor} { - $visitor visitEnd [self] - } - - # - # error message, if child can't be parsed - # - XMLNode instproc errorChild {c} { - error "[self] unexpected content $c" - } - - # - # find the namespace object that is currently responsible - # for the [self] node - # - XMLNode instproc resolveNS {} { - set parser [my set parser] - if {[my exists namespace]} { - return [my set namespace] - } else { - set p [my info parent] - if {$p ne "" && $p != $parser} { - return [$p resolveNS] - } else { - #puts stderr "No parent namespace !! Using Parser's topNs ..." - return "" - } - } - } - - # - # add a new namespace entry to the object's NS entry, if it exists - # otherwise: act as a factory method for NS objects and create an - # NS object for the [self] node - # - XMLNode instproc makeIndividualNSEntry {prefix entry} { - set ns [my resolveNS] - if {[string first [self] $ns] == -1} { - #puts stderr "new namespace for [self]" - set newNS [XMLNamespace create [self]::[my autoname ns]] - $newNS set successor $ns - my namespace $newNS - set ns $newNS - } - $ns add $prefix $entry - } - - # - # check for xmlns attribute in the name/value pair "n v" - # return 1 on success, otherwise 0 - # - XMLNode instproc checkForXmlNS {n v} { - #puts "checking to build NS in [self] with $n == $v" - if {[regexp {^xmlns:?(.*)$} $n _ prefix]} { - if {$prefix eq ""} { - set prefix "xmlns" - } - my makeIndividualNSEntry $prefix $v - return 1 - } - return 0 - } - - # small helper proc to extract the namespace prefix from content - XMLNode instproc getContentPrefix {} { - if {[regexp {^([^:]*):} [my set content] _ prefix]} { - return $prefix - } - return "" - } - - ############################################################################## - # - # XMLNode _Class_ Factory for creating XML style node - # node classes - # - ############################################################################## - - Class XMLNodeClassFactory -superclass Class - - XMLNodeClassFactory create XMLElement -superclass XMLNode - - ############################################################################## - # - # Add some methods to the created XMLElement class - # - ############################################################################## - - XMLElement instproc parseAttributes {name attrList} { - my set content $name - foreach {n v} $attrList { - if {[my checkForXmlNS $n $v]} {continue} - my set attributes($n) $v - } - } - - # - # build a child corresponding to the node start event and - # check attribute list -> set content (attr name) and value (attr value) - # on created attr children objects of the XMLElement child - # return the new XMLElement child - # - XMLElement instproc parseStart {name attrList} { - set parser [my set parser] - set nf [$parser set nodeFactory] - set r [$nf getNode XMLElement [self]::[my nextChild elt] $parser] - $r parseAttributes $name $attrList - return $r - } - - # no action of parse end -> just return [self] for convinience - XMLElement instproc parseEnd content { - self - } - - ############################################################################## - # - # Abstract interface for factories that create node objects; - # - ############################################################################## - Class AbstractXMLNodeFactory - - # - # get a node with the specifies key (normally the classname) and name - # the node "objName" -> without flyweights an object "objName" or type "key" - # is created - # - AbstractXMLNodeFactory abstract instproc getNode {key objName parser} - - # - # clean up the node factory - # - AbstractXMLNodeFactory abstract instproc reset {} - - ############################################################################## - # - # Special Node Factory as used in xoXML and xoRDF - # for shared classes the factory acts as a flyweight factory - # - ############################################################################## - Class XMLNodeFactory -superclass AbstractXMLNodeFactory -parameter { - {sharedNodes ""} - } - - XMLNodeFactory instproc getNode {class objName parser} { - $class create $objName -parser $parser ;# returns object ID - } - - XMLNodeFactory instproc reset {} { - #my array set flyweights {} - } - - ############################################################################## - # - # XML Factory for creating node objects - # - ############################################################################## - XMLNodeFactory xmlNodeFactory - - ############################################################################## - # - # Xml Parser Connection Class (wrapper facade to TclXML, expat - # interface like parsers) - # - ############################################################################## - Class XMLParser -parameter { - {topLevelNodeHandler ""} - {nodeFactory "xmlNodeFactory"} - {xmlTextParser expat_fallback_tclxml} - } - - # - # normally all toplevel start events are handled with XML-Elements - # here we can define regexp patterns for other toplevel handlers - # - XMLParser instproc topLevelHandlerPattern {regexp handlerClass} { - my lappend topLevelNodeHandler $regexp $handlerClass - } - # - # if regexp matches -> handler class is used (see start instproc) - # if none matches -> use XMLElement; "name" is name given by the - # start method - # - XMLParser instproc createTopLevelNode {name attrList} { - set nf [my set nodeFactory] - set tnName [my autoname topNode] - foreach {regexpPattern class} [my set topLevelNodeHandler] { - if {[regexp $regexpPattern $name]} { - set tn [$nf getNode $class [self]::$tnName [self]] - my set currentTopNode $tn - return $tn - } - } - set tn [$nf getNode XMLElement [self]::$tnName [self]] - my set currentTopNode $tn - $tn parseAttributes $name $attrList - return $tn - } - - # - # determine the current node -> either the end of node list or topNode - # - XMLParser instproc currentNode {} { - set nodeList [my set nodeList] - if {$nodeList eq ""} { - if {[my exists currentTopNode]} { - return [my set currentTopNode] - } - error "No current top node" - } else { - return [lindex $nodeList end] - } - } - # - # instatiate parser and register event callback methods with parser - # - XMLParser instproc init args { - #my set xmlTextParser expat - switch -- [my set xmlTextParser] { - tclxml { - package require xml - my set PC \ - [xml::parser [[self class] autoname [namespace tail [self]]]] - } - expat { - package require xotcl::xml::expat - my set PC \ - [expat [[self class] autoname [namespace tail [self]]]] - } - expat_fallback_tclxml { - if {[catch {package require xotcl::xml::expat}]} { - package require xml - my set PC \ - [xml::parser [[self class] autoname [namespace tail [self]]]] - #puts "using tclxml" - } else { - my set PC \ - [expat [[self class] autoname [namespace tail [self]]]] - #puts "using expat" - } - } - } - my configure \ - -characterdatacommand [list [self] pcdata] \ - -elementstartcommand [list [self] start] \ - -elementendcommand [list [self] end] - my set nodeList "" - next - } - XMLParser instproc characterdatacommand cmd { - [my set PC] configure -[self proc] $cmd - } - XMLParser instproc elementstartcommand cmd { - [my set PC] configure -[self proc] $cmd - } - XMLParser instproc elementendcommand cmd { - [my set PC] configure -[self proc] $cmd - } - - # - # Create Forwarding methods to the parser == - # abstact interface for xml parser acces - # - XMLParser instproc cget option {[my set PC] cget $option} - XMLParser instproc parse data {[my set PC] parse $data} - XMLParser instproc parseFile filename { - set F [open $filename r]; set c [read $F]; close $F - return [my parse $c] - } - XMLParser instproc reset {} { - [my set PC] reset - foreach c [my info children] { - $c destroy - } - my autoname -reset topNode - my set nodeList "" - [my set nodeFactory] reset - } - XMLParser instproc pcdata text { - #my showCall - set t [string trim $text] - if {$t ne ""} { - #puts stderr "[self]->[self proc] '$text'" - [my currentNode] parseData $t - } - } - XMLParser instproc start {name {attrList ""}} { - #puts "[self]->[self proc] $name $attrList" - my instvar nodeList - if {$nodeList eq ""} { - # no currentNode -> we have to create one - set newStartNode [my createTopLevelNode $name $attrList] - } else { - set newStartNode [[my currentNode] parseStart $name $attrList] - } - lappend nodeList $newStartNode - } - XMLParser instproc end {name} { - #puts "[self]->[self proc] $name" - my instvar nodeList - set currentNode [my currentNode] - $currentNode parseEnd $name - set nodeList [lreplace $nodeList end end] - } - XMLParser instproc destroy args { - if {[my exists PC]} { - rename [my set PC] "" - } - next - } - ############################################################################## - # - # Abstract class for visiting Parser Node Trees - # - ############################################################################## - Class NodeTreeVisitor - - # - # visit a given node "objName" -> called by accept method of objName - # visit encapsulates the interpretation algorithm for a node - # - NodeTreeVisitor abstract instproc visit objName - - # - # interpret the whole node tree strating with top node "node" - # - NodeTreeVisitor abstract instproc interpretNodeTree node - - # - # visit end may stay unspecified in concrete visitors - # - NodeTreeVisitor instproc visitEnd objName {;} - # - # template method that interprets all topnodes of a parser - # in original order - # - NodeTreeVisitor instproc interpretAll {parser} { - set result "" - foreach tn [lsort [$parser info children topNode*]] { - append result [my interpretNodeTree $tn] - } - return $result - } - - namespace export XMLNamespace AbstractXMLNode XMLNode \ - XMLNodeClassFactory XMLElement AbstractXMLNodeFactory \ - XMLNodeFactory XMLParser NodeTreeVisitor -} - -namespace import ::xotcl::xml::parser::* Index: xotcl/man/man.macros =================================================================== diff -u -N --- xotcl/man/man.macros (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/man/man.macros (revision 0) @@ -1,236 +0,0 @@ -'\" 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. -'\" -'\" RCS: @(#) $Id: man.macros,v 1.1 2004/05/23 22:50:39 neumann Exp $ -'\" -'\" # 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 -.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) -.\".b -.\} -.el \{\ -.br -.ie !"\\$2"" \{\ -\&\\$1 \\fI\\$2\\fP -.\} -.el \{\ -\&\\fI\\$1\\fP -.\} -.\} -.. -'\" # define tabbing values for .AP -.de AS -.nr )A 10n -.if !"\\$1"" .nr )A \\w'\\$1'u+3n -.nr )B \\n()Au+15n -.\" -.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n -.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 -.de BS -.br -.mk ^y -.nr ^b 1u -.if n .nf -.if n .ti 0 -.if n \l'\\n(.lu\(ul' -.if n .fi -.. -'\" # BE - end boxed text (draw box now) -.de BE -.nf -.ti 0 -.mk ^t -.ie n \l'\\n(^lu\(ul' -.el \{\ -.\" Draw four-sided box normally, but don't draw top of -.\" box if the box started on an earlier page. -.ie !\\n(^b-1 \{\ -\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' -.\} -.el \}\ -\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' -.\} -.\} -.fi -.br -.nr ^b 0 -.. -'\" # 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 -.de VE -.ie n 'mc -.el \{\ -.ev 2 -.nf -.ti 0 -.mk ^t -\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' -.sp -1 -.fi -.ev -.\} -.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. -.de ^B -.ev 2 -'ti 0 -'nf -.mk ^t -.if \\n(^b \{\ -.\" Draw three-sided box if this is the box's first page, -.\" draw two sides but no top otherwise. -.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c -.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c -.\} -.if \\n(^v \{\ -.nr ^x \\n(^tu+1v-\\n(^Yu -\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c -.\} -.bp -'fi -.ev -.if \\n(^b \{\ -.mk ^y -.nr ^b 2 -.\} -.if \\n(^v \{\ -.mk ^Y -.\} -.. -'\" # DS - begin display -.de DS -.RS -.nf -.sp -.. -'\" # DE - end display -.de DE -.fi -.RE -.sp -.. -'\" # SO - start of list of standard options -.de SO -.SH "STANDARD OPTIONS" -.LP -.nf -.ta 4c 8c 12c -.ft B -.. -'\" # SE - end of list of standard options -.de SE -.fi -.ft R -.LP -See the \\fBoptions\\fR manual entry for details on the standard options. -.. -'\" # OP - start of full description for a single option -.de OP -.LP -.nf -.ta 4c -Command-Line Name: \\fB\\$1\\fR -Database Name: \\fB\\$2\\fR -Database Class: \\fB\\$3\\fR -.fi -.IP -.. -'\" # CS - begin code excerpt -.de CS -.RS -.nf -.ta .25i .5i .75i 1i -.. -'\" # CE - end code excerpt -.de CE -.fi -.RE -.. -.de UL -\\$1\l'|0\(ul'\\$2 -.. Index: xotcl/man/xotclsh.1 =================================================================== diff -u -N --- xotcl/man/xotclsh.1 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/man/xotclsh.1 (revision 0) @@ -1,93 +0,0 @@ -'\" -'\" XOTcl - Extended OTcl -'\" Copyright (C) 1999-2001 Gustaf Neumann, Uwe Zdun -'\" -'\" -.so man.macros -.TH xotclsh 1 "" XOTcl "XOTcl Applications" -.BS -.SH NAME -xotclsh \- Tcl Shell containing object-oriented scripting language XOTcl -.SH SYNOPSIS -\fBxotclsh\fR \fI?filename arg arg ...?\fR -.BE -.SH DESCRIPTION -.PP -\fBxotclsh\fR is a shell-like application that reads XOTcl commands -from its standard input or from a file and evaluates them. -Similarly as the relation between \fBtclsh\fR and \fBwish\fR, -\fBxowish\fR -provides all functionality of xotclsh and provides as well predefined -support for TK widgets. -.PP -XOTcl (XOTcl, pronounced exotickle) is an object-oriented scripting -language based on MIT's OTcl. It is intended as a value added -replacement of OTcl. -.PP -Scripting languages, such as Tcl, are designed for glueing components -together, provide features such as dynamic extensibility and dynamic -typing with automatic conversion, that make them well suited for rapid -application development. -.PP -The object system of XOTcl enables a user to to define objects, -classes, and meta-classes. Classes are special objects with the -purpose of managing -other objects. ``Managing'' means that a class controls the creation -and destruction of its instances and that it contains a repository of -methods accessible for the instances. Every object may be enhanced -with object-specific methods. XOTcl supports single and multiple -inheritance. All object-class and class-class relationships in XOTcl -are introspectable and can be dynamically changed at arbitrary times. -Ambiguities in name resolution of methods are avoided -through method chaining through "next", which does not require -explicit method naming. -.PP -XOTcl combines the ideas of scripting and object-orientation in a way -that preserves the benefits of both of them. It is equipped with -several new language constructs that help building and managing -complex systems. We added the following support: - -.PP -\fIDynamic Object Aggregations\fR, -to provide dynamic aggregations through nested namespaces (objects). -.PP -\fINested Classes\fR, to reduce the interference -of independently developed program structures. -.PP -\fIAssertions\fR, to reduce -the interface and the reliability problems caused by dynamic typing -and, therefore, to ease the combination of many components. -.PP -\fIMeta-data\fR, to enhance self-documentation of objects and -classes. -.PP -\fIPer-object mixins\fR, as a means to give an object -dynamically access to the methods of one or several supplemental classes. -.PP -\fIPer-class mixins\fR, as a means to give all instances of -an class dynamically access to the methods of one or several -supplemental classes. -.PP -\fIFilters\fR as a means of -abstractions over method invocations to implement large program -structures, like design patterns. - -XOTcl provides a value-added replacement of Tcl -package loading providing integration with object-oriented constructs and -tracking/tracing of component loading. -.SH VARIABLES -.PP -\fBxotclsh\fR sets all variables that \fBtclsh\fR sets, -and additionally the following variables: - -.TP 15 -\fB::xotcl::version\fR XOTcl version number. -.TP 15 -\fB::xotcl::confdir\fR Directory for XOTcl configuration. -.TP 15 -\fB::xotcl::logdir\fR Directory where logfiles are placed. - -.PP -.SH KEYWORDS -argument, interpreter, prompt, script file, shell - Index: xotcl/man/xowish.1 =================================================================== diff -u -N --- xotcl/man/xowish.1 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/man/xowish.1 (revision 0) @@ -1,84 +0,0 @@ -'\" -'\" XOTcl - Extended OTcl -'\" Copyright (C) 1999-2001 Gustaf Neumann, Uwe Zdun -'\" -'\" -.so man.macros -.TH xowish 1 "" XOWish "XOTcl Applications" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -xowish \- Graphical shell containing object-oriented scripting language XOTcl -.SH SYNOPSIS -\fBxowish\fR ?\fIfileName arg arg ...\fR? -.BE - -.SH DESCRIPTION -.PP -\fBxowish\fR is a shell-like application that reads XOTcl commands -from its standard input or from a file and evaluates them. In addition -to \fBxotclsh\fR it provides graphical user interface support for TK -widgets. -.PP -XOTcl (XOTcl, pronounced exotickle) is an object-oriented scripting -language based on MIT's OTcl. It is intended as a value added -replacement for OTcl. -.PP -Scripting languages, like Tcl, are designed for glueing components -together, provide features like dynamic extensibility and dynamic -typing with automatic conversion, that make them well suited for rapid -application development. -.PP -The basic object system of XOTcl is adopted from OTcl. The object -system enables us to define objects, classes, and -meta-classes. Classes are special objects with the purpose of managing -other objects. ``Managing'' means that a class controls the creation -and destruction of its instances and that it contains a repository of -methods accessible for the instances. Every object may be enhanced -with object-specific methods. XOTcl supports single and multiple -inheritance. All relationships in XOTcl, including class and -superclass relationships, are completely dynamic and can be -introspected. Through method chaining without explicit naming of the -intended method, ambiguities in name resolution of methods are -avoided. This way a shadowed method can be ``mixed into'' the -execution of the current method. -.PP -XOTcl combines the ideas of scripting and object-orientation in a way -that preserves the benefits of both of them. It is equipped with -several new language functionalities that help building and managing -complex systems. We added the following support: -.PP -Dynamic Object Aggregations, to provide dynamic aggregations through -nested namespaces (objects). -.PP -Nested Classes, to reduce the interference -of independently developed program structures. -.PP -Assertions, to reduce -the interface and the reliability problems caused by dynamic typing -and, therefore, to ease the combination of many components. -.PP -Meta-data, -to enhance self-documentation of objects and classes. -.PP -Per-object -mixins, as a means to improve flexibility of mixin methods by giving -an object access to several different supplemental classes, which may -be changed dynamically. -.PP -Per-class mixins, as a means to improve -flexibility of mixin methods to a class, all instances of the class -have access to the mixed in methods like for multiple inheritance, but -without the need of intersection classes. -.PP -Filters as a means of -abstractions over method invocations to implement large program -structures, like design patterns. -.PP -Dynamic Component Loading XOTcl -integrates the Tcl package loading with architectrual support for -integration with object-oriented constructs. Moreover, it provides -tracking/tracing of component loading. -.PP -.SH KEYWORDS -argument, interpreter, prompt, script file, shell Index: xotcl/speed-1.4.1.xls =================================================================== diff -u -N -r2c98844f5e9a46a8ecb2c8aa8d714592a07b311d -rc72f9f638677608fab1502cd696c8f2d6b2952f9 Binary files differ Index: xotcl/tcl.m4 =================================================================== diff -u -N --- xotcl/tcl.m4 (revision fce8f28780c2c91fc8320c5a480eb2b6031b3b5b) +++ xotcl/tcl.m4 (revision 0) @@ -1,4041 +0,0 @@ -# tcl.m4 -- -# -# This file provides a set of autoconf macros to help TEA-enable -# a Tcl extension. -# -# Copyright (c) 1999-2000 Ajuba Solutions. -# 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: tcl.m4,v 1.8 2007/09/13 15:21:54 neumann Exp $ - -AC_PREREQ(2.57) - -dnl TEA extensions pass us the version of TEA they think they -dnl are compatible with (must be set in TEA_INIT below) -dnl TEA_VERSION="3.6" - -# Possible values for key variables defined: -# -# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') -# TEA_PLATFORM - windows unix -# - -#------------------------------------------------------------------------ -# TEA_PATH_TCLCONFIG -- -# -# Locate the tclConfig.sh file and perform a sanity check on -# the Tcl compile flags -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-tcl=... -# -# Defines the following vars: -# TCL_BIN_DIR Full path to the directory containing -# the tclConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_TCLCONFIG], [ - dnl Make sure we are initialized - AC_REQUIRE([TEA_INIT]) - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - - if test x"${no_tcl}" = x ; then - # we reset no_tcl in case something fails here - no_tcl=true - AC_ARG_WITH(tcl, - AC_HELP_STRING([--with-tcl], - [directory containing tcl configuration (tclConfig.sh)]), - with_tclconfig=${withval}) - AC_MSG_CHECKING([for Tcl configuration]) - AC_CACHE_VAL(ac_cv_c_tclconfig,[ - - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - case ${with_tclconfig} in - */tclConfig.sh ) - if test -f ${with_tclconfig}; then - AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) - with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tcl.framework/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_tclconfig}" = x ; then - TCL_BIN_DIR="# no Tcl configs found" - AC_MSG_WARN([Can't find Tcl configuration definitions]) - exit 0 - else - no_tcl= - TCL_BIN_DIR=${ac_cv_c_tclconfig} - AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_PATH_TKCONFIG -- -# -# Locate the tkConfig.sh file -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-tk=... -# -# Defines the following vars: -# TK_BIN_DIR Full path to the directory containing -# the tkConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_TKCONFIG], [ - # - # Ok, lets find the tk configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tk - # - - if test x"${no_tk}" = x ; then - # we reset no_tk in case something fails here - no_tk=true - AC_ARG_WITH(tk, - AC_HELP_STRING([--with-tk], - [directory containing tk configuration (tkConfig.sh)]), - with_tkconfig=${withval}) - AC_MSG_CHECKING([for Tk configuration]) - AC_CACHE_VAL(ac_cv_c_tkconfig,[ - - # First check to see if --with-tkconfig was specified. - if test x"${with_tkconfig}" != x ; then - case ${with_tkconfig} in - */tkConfig.sh ) - if test -f ${with_tkconfig}; then - AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) - with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` - fi ;; - esac - if test -f "${with_tkconfig}/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` - else - AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) - fi - fi - - # then check for a private Tk library - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in \ - ../tk \ - `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../tk \ - `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../../tk \ - `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # on Darwin, check in Framework installation locations - if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ - `ls -d /Library/Frameworks 2>/dev/null` \ - `ls -d /Network/Library/Frameworks 2>/dev/null` \ - `ls -d /System/Library/Frameworks 2>/dev/null` \ - ; do - if test -f "$i/Tk.framework/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i; pwd)` - break - fi - done - fi - - # on Windows, check in common installation locations - if test "${TEA_PLATFORM}" = "windows" \ - -a x"${ac_cv_c_tkconfig}" = x ; then - for i in `ls -d C:/Tcl/lib 2>/dev/null` \ - `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ - ; do - if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tkconfig}" = x ; then - for i in \ - ${srcdir}/../tk \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do - if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_tkconfig}" = x ; then - TK_BIN_DIR="# no Tk configs found" - AC_MSG_WARN([Can't find Tk configuration definitions]) - exit 0 - else - no_tk= - TK_BIN_DIR=${ac_cv_c_tkconfig} - AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_TCLCONFIG -- -# -# Load the tclConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# TCL_BIN_DIR -# -# Results: -# -# Subst the following vars: -# TCL_BIN_DIR -# TCL_SRC_DIR -# TCL_LIB_FILE -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_TCLCONFIG], [ - AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) - - if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - AC_MSG_RESULT([loading]) - . "${TCL_BIN_DIR}/tclConfig.sh" - else - AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tcl.framework installed in an arbitary location. - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then - for i in "`cd ${TCL_BIN_DIR}; pwd`" \ - "`cd ${TCL_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then - TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" - break - fi - done - fi - if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then - TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" - TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TCL_DBGX substitution - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - AC_SUBST(TCL_VERSION) - AC_SUBST(TCL_BIN_DIR) - AC_SUBST(TCL_SRC_DIR) - - AC_SUBST(TCL_LIB_FILE) - AC_SUBST(TCL_LIB_FLAG) - AC_SUBST(TCL_LIB_SPEC) - - AC_SUBST(TCL_STUB_LIB_FILE) - AC_SUBST(TCL_STUB_LIB_FLAG) - AC_SUBST(TCL_STUB_LIB_SPEC) - - AC_SUBST(TCL_LIBS) - AC_SUBST(TCL_DEFS) - AC_SUBST(TCL_EXTRA_CFLAGS) - AC_SUBST(TCL_LD_FLAGS) - AC_SUBST(TCL_SHLIB_LD_LIBS) -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_TKCONFIG -- -# -# Load the tkConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# TK_BIN_DIR -# -# Results: -# -# Sets the following vars that should be in tkConfig.sh: -# TK_BIN_DIR -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_TKCONFIG], [ - AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) - - if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then - AC_MSG_RESULT([loading]) - . "${TK_BIN_DIR}/tkConfig.sh" - else - AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) - fi - - # eval is required to do the TK_DBGX substitution - eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" - eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" - - # If the TK_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TK_LIB_SPEC will be set to the value - # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC - # instead of TK_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - if test -f "${TK_BIN_DIR}/Makefile" ; then - TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} - TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} - TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} - elif test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use the libraries - # from the framework at the given location so that linking works - # against Tk.framework installed in an arbitary location. - case ${TK_DEFS} in - *TK_FRAMEWORK*) - if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then - for i in "`cd ${TK_BIN_DIR}; pwd`" \ - "`cd ${TK_BIN_DIR}/../..; pwd`"; do - if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then - TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" - break - fi - done - fi - if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then - TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" - TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" - fi - ;; - esac - fi - - # eval is required to do the TK_DBGX substitution - eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" - eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" - eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" - eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" - - # Ensure windowingsystem is defined - if test "${TEA_PLATFORM}" = "unix" ; then - case ${TK_DEFS} in - *MAC_OSX_TK*) - AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) - TEA_WINDOWINGSYSTEM="aqua" - ;; - *) - TEA_WINDOWINGSYSTEM="x11" - ;; - esac - elif test "${TEA_PLATFORM}" = "windows" ; then - TEA_WINDOWINGSYSTEM="win32" - fi - - AC_SUBST(TK_VERSION) - AC_SUBST(TK_BIN_DIR) - AC_SUBST(TK_SRC_DIR) - - AC_SUBST(TK_LIB_FILE) - AC_SUBST(TK_LIB_FLAG) - AC_SUBST(TK_LIB_SPEC) - - AC_SUBST(TK_STUB_LIB_FILE) - AC_SUBST(TK_STUB_LIB_FLAG) - AC_SUBST(TK_STUB_LIB_SPEC) - - AC_SUBST(TK_LIBS) - AC_SUBST(TK_XINCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_SHARED -- -# -# Allows the building of shared libraries -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-shared=yes|no -# -# Defines the following vars: -# STATIC_BUILD Used for building import/export libraries -# on Windows. -# -# Sets the following vars: -# SHARED_BUILD Value of 1 or 0 -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_SHARED], [ - AC_MSG_CHECKING([how to build libraries]) - AC_ARG_ENABLE(shared, - AC_HELP_STRING([--enable-shared], - [build and link with shared libraries (default: on)]), - [tcl_ok=$enableval], [tcl_ok=yes]) - - if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" ; then - AC_MSG_RESULT([shared]) - SHARED_BUILD=1 - else - AC_MSG_RESULT([static]) - SHARED_BUILD=0 - AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) - fi - AC_SUBST(SHARED_BUILD) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_THREADS -- -# -# Specify if thread support should be enabled. If "yes" is specified -# as an arg (optional), threads are enabled by default, "no" means -# threads are disabled. "yes" is the default. -# -# TCL_THREADS is checked so that if you are compiling an extension -# against a threaded core, your extension must be compiled threaded -# as well. -# -# Note that it is legal to have a thread enabled extension run in a -# threaded or non-threaded Tcl core, but a non-threaded extension may -# only run in a non-threaded Tcl core. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-threads -# -# Sets the following vars: -# THREADS_LIBS Thread library(s) -# -# Defines the following vars: -# TCL_THREADS -# _REENTRANT -# _THREAD_SAFE -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_THREADS], [ - AC_ARG_ENABLE(threads, - AC_HELP_STRING([--enable-threads], - [build with threads]), - [tcl_ok=$enableval], [tcl_ok=yes]) - - if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval - else - tcl_ok=yes - fi - - if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then - TCL_THREADS=1 - - if test "${TEA_PLATFORM}" != "windows" ; then - # We are always OK on Windows, so check what this platform wants: - - # USE_THREAD_ALLOC tells us to try the special thread-based - # allocator that significantly reduces lock contention - AC_DEFINE(USE_THREAD_ALLOC, 1, - [Do we want to use the threaded memory allocator?]) - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - if test "`uname -s`" = "SunOS" ; then - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - fi - AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) - AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) - if test "$tcl_ok" = "no"; then - # Check a little harder for __pthread_mutex_init in the same - # library, as some systems hide it there until pthread.h is - # defined. We could alternatively do an AC_TRY_COMPILE with - # pthread.h, but that will work with libpthread really doesn't - # exist, like AIX 4.2. [Bug: 4359] - AC_CHECK_LIB(pthread, __pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - fi - - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthread" - else - AC_CHECK_LIB(pthreads, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthreads" - else - AC_CHECK_LIB(c, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "no"; then - AC_CHECK_LIB(c_r, pthread_mutex_init, - tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -pthread" - else - TCL_THREADS=0 - AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) - fi - fi - fi - fi - fi - else - TCL_THREADS=0 - fi - # Do checking message here to not mess up interleaved configure output - AC_MSG_CHECKING([for building with threads]) - if test "${TCL_THREADS}" = 1; then - AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) - AC_MSG_RESULT([yes (default)]) - else - AC_MSG_RESULT([no]) - fi - # TCL_THREADS sanity checking. See if our request for building with - # threads is the same as the way Tcl was built. If not, warn the user. - case ${TCL_DEFS} in - *THREADS=1*) - if test "${TCL_THREADS}" = "0"; then - AC_MSG_WARN([ - Building ${PACKAGE_NAME} without threads enabled, but building against Tcl - that IS thread-enabled. It is recommended to use --enable-threads.]) - fi - ;; - *) - if test "${TCL_THREADS}" = "1"; then - AC_MSG_WARN([ - --enable-threads requested, but building against a Tcl that is NOT - thread-enabled. This is an OK configuration that will also run in - a thread-enabled core.]) - fi - ;; - esac - AC_SUBST(TCL_THREADS) -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_SYMBOLS -- -# -# Specify if debugging symbols should be used. -# Memory (TCL_MEM_DEBUG) debugging can also be enabled. -# -# Arguments: -# none -# -# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives -# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. -# Requires the following vars to be set in the Makefile: -# CFLAGS_DEFAULT -# LDFLAGS_DEFAULT -# -# Results: -# -# Adds the following arguments to configure: -# --enable-symbols -# -# Defines the following vars: -# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true -# Sets to $(CFLAGS_OPTIMIZE) if false -# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true -# Sets to $(LDFLAGS_OPTIMIZE) if false -# DBGX Formerly used as debug library extension; -# always blank now. -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_SYMBOLS], [ - dnl Make sure we are initialized - AC_REQUIRE([TEA_CONFIG_CFLAGS]) - AC_MSG_CHECKING([for build with symbols]) - AC_ARG_ENABLE(symbols, - AC_HELP_STRING([--enable-symbols], - [build with debugging symbols (default: off)]), - [tcl_ok=$enableval], [tcl_ok=no]) - DBGX="" - if test "$tcl_ok" = "no"; then - CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" - LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" - AC_MSG_RESULT([no]) - else - CFLAGS_DEFAULT="${CFLAGS_DEBUG}" - LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" - if test "$tcl_ok" = "yes"; then - AC_MSG_RESULT([yes (standard debugging)]) - fi - fi - if test "${TEA_PLATFORM}" != "windows" ; then - LDFLAGS_DEFAULT="${LDFLAGS}" - fi - - AC_SUBST(TCL_DBGX) - AC_SUBST(CFLAGS_DEFAULT) - AC_SUBST(LDFLAGS_DEFAULT) - - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) - fi - - if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then - if test "$tcl_ok" = "all"; then - AC_MSG_RESULT([enabled symbols mem debugging]) - else - AC_MSG_RESULT([enabled $tcl_ok debugging]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_ENABLE_LANGINFO -- -# -# Allows use of modern nl_langinfo check for better l10n. -# This is only relevant for Unix. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --enable-langinfo=yes|no (default is yes) -# -# Defines the following vars: -# HAVE_LANGINFO Triggers use of nl_langinfo if defined. -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_ENABLE_LANGINFO], [ - AC_ARG_ENABLE(langinfo, - AC_HELP_STRING([--enable-langinfo], - [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), - [langinfo_ok=$enableval], [langinfo_ok=yes]) - - HAVE_LANGINFO=0 - if test "$langinfo_ok" = "yes"; then - AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) - fi - AC_MSG_CHECKING([whether to use nl_langinfo]) - if test "$langinfo_ok" = "yes"; then - AC_CACHE_VAL(tcl_cv_langinfo_h, [ - AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], - [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) - AC_MSG_RESULT([$tcl_cv_langinfo_h]) - if test $tcl_cv_langinfo_h = yes; then - AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) - fi - else - AC_MSG_RESULT([$langinfo_ok]) - fi -]) - -#-------------------------------------------------------------------- -# TEA_CONFIG_SYSTEM -# -# Determine what the system is (some things cannot be easily checked -# on a feature-driven basis, alas). This can usually be done via the -# "uname" command, but there are a few systems, like Next, where -# this doesn't work. -# -# Arguments: -# none -# -# Results: -# Defines the following var: -# -# system - System/platform/version identification code. -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_CONFIG_SYSTEM], [ - AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ - if test "${TEA_PLATFORM}" = "windows" ; then - tcl_cv_sys_version=windows - elif test -f /usr/lib/NextStep/software_version; then - tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` - else - tcl_cv_sys_version=`uname -s`-`uname -r` - if test "$?" -ne 0 ; then - AC_MSG_WARN([can't find uname command]) - tcl_cv_sys_version=unknown - else - # Special check for weird MP-RAS system (uname returns weird - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid` - fi - if test "`uname -s`" = "AIX" ; then - tcl_cv_sys_version=AIX-`uname -v`.`uname -r` - fi - fi - fi - ]) - system=$tcl_cv_sys_version -]) - -#-------------------------------------------------------------------- -# TEA_CONFIG_CFLAGS -# -# Try to determine the proper flags to pass to the compiler -# for building shared libraries and other such nonsense. -# -# Arguments: -# none -# -# Results: -# -# Defines and substitutes the following vars: -# -# DL_OBJS - Name of the object file that implements dynamic -# loading for Tcl on this system. -# DL_LIBS - Library file(s) to include in tclsh and other base -# applications in order for the "load" command to work. -# LDFLAGS - Flags to pass to the compiler when linking object -# files into an executable application binary such -# as tclsh. -# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", -# that tell the run-time dynamic linker where to look -# for shared libraries such as libtcl.so. Depends on -# the variable LIB_RUNTIME_DIR in the Makefile. Could -# be the same as CC_SEARCH_FLAGS if ${CC} is used to link. -# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", -# that tell the run-time dynamic linker where to look -# for shared libraries such as libtcl.so. Depends on -# the variable LIB_RUNTIME_DIR in the Makefile. -# SHLIB_CFLAGS - Flags to pass to cc when compiling the components -# of a shared library (may request position-independent -# code, among other things). -# SHLIB_LD - Base command to use for combining object files -# into a shared library. -# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when -# creating shared libraries. This symbol typically -# goes at the end of the "ld" commands that build -# shared libraries. The value of the symbol is -# "${LIBS}" if all of the dependent libraries should -# be specified when creating a shared library. If -# dependent libraries should not be specified (as on -# SunOS 4.x, where they cause the link to fail, or in -# general if Tcl and Tk aren't themselves shared -# libraries), then this symbol has an empty string -# as its value. -# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable -# extensions. An empty string means we don't know how -# to use shared libraries on this platform. -# LIB_SUFFIX - Specifies everything that comes after the "libfoo" -# in a static or shared library name, using the $VERSION variable -# to put the version in the right place. This is used -# by platforms that need non-standard library names. -# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs -# to have a version after the .so, and ${VERSION}.a -# on AIX, since a shared library needs to have -# a .a extension whereas shared objects for loadable -# extensions have a .so extension. Defaults to -# ${VERSION}${SHLIB_SUFFIX}. -# TCL_NEEDS_EXP_FILE - -# 1 means that an export file is needed to link to a -# shared library. -# TCL_EXP_FILE - The name of the installed export / import file which -# should be used to link to the Tcl shared library. -# Empty if Tcl is unshared. -# TCL_BUILD_EXP_FILE - -# The name of the built export / import file which -# should be used to link to the Tcl shared library. -# Empty if Tcl is unshared. -# CFLAGS_DEBUG - -# Flags used when running the compiler in debug mode -# CFLAGS_OPTIMIZE - -# Flags used when running the compiler in optimize mode -# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_CONFIG_CFLAGS], [ - dnl Make sure we are initialized - AC_REQUIRE([TEA_INIT]) - - # Step 0.a: Enable 64 bit support? - - AC_MSG_CHECKING([if 64bit support is requested]) - AC_ARG_ENABLE(64bit, - AC_HELP_STRING([--enable-64bit], - [enable 64bit support (default: off)]), - [do64bit=$enableval], [do64bit=no]) - AC_MSG_RESULT([$do64bit]) - - # Step 0.b: Enable Solaris 64 bit VIS support? - - AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) - AC_ARG_ENABLE(64bit-vis, - AC_HELP_STRING([--enable-64bit-vis], - [enable 64bit Sparc VIS support (default: off)]), - [do64bitVIS=$enableval], [do64bitVIS=no]) - AC_MSG_RESULT([$do64bitVIS]) - - if test "$do64bitVIS" = "yes"; then - # Force 64bit on with VIS - do64bit=yes - fi - - # Step 0.c: Cross-compiling options for Windows/CE builds? - - if test "${TEA_PLATFORM}" = "windows" ; then - AC_MSG_CHECKING([if Windows/CE build is requested]) - AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) - AC_MSG_RESULT([$doWince]) - fi - - # Step 1: set the variable "system" to hold the name and version number - # for the system. - - TEA_CONFIG_SYSTEM - - # Step 2: check for existence of -ldl library. This is needed because - # Linux can use either -ldl or -ldld for dynamic loading. - - AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) - - # Require ranlib early so we can override it in special cases below. - - AC_REQUIRE([AC_PROG_RANLIB]) - - # Step 3: set configuration options based on system name and version. - # This is similar to Tcl's unix/tcl.m4 except that we've added a - # "windows" case. - - do64bit_ok=no - LDFLAGS_ORIG="$LDFLAGS" - # When ld needs options to work in 64-bit mode, put them in - # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] - # is disabled by the user. [Bug 1016796] - LDFLAGS_ARCH="" - TCL_EXPORT_FILE_SUFFIX="" - UNSHARED_LIB_SUFFIX="" - TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' - ECHO_VERSION='`echo ${PACKAGE_VERSION}`' - TCL_LIB_VERSIONS_OK=ok - CFLAGS_DEBUG=-g - CFLAGS_OPTIMIZE=-O - if test "$GCC" = "yes" ; then - CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wno-implicit-int" - else - CFLAGS_WARNING="" - fi - TCL_NEEDS_EXP_FILE=0 - TCL_BUILD_EXP_FILE="" - TCL_EXP_FILE="" -dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. -dnl AC_CHECK_TOOL(AR, ar) - AC_CHECK_PROG(AR, ar, ar) - STLIB_LD='${AR} cr' - LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" - case $system in - windows) - # This is a 2-stage check to make sure we have the 64-bit SDK - # We have to know where the SDK is installed. - # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs - # MACHINE is IX86 for LINK, but this is used by the manifest, - # which requires x86|amd64|ia64. - MACHINE="X86" - if test "$do64bit" != "no" ; then - if test "x${MSSDK}x" = "xx" ; then - MSSDK="C:/Progra~1/Microsoft Platform SDK" - fi - MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` - PATH64="" - case "$do64bit" in - amd64|x64|yes) - MACHINE="AMD64" ; # default to AMD64 64-bit build - PATH64="${MSSDK}/Bin/Win64/x86/AMD64" - ;; - ia64) - MACHINE="IA64" - PATH64="${MSSDK}/Bin/Win64" - ;; - esac - if test ! -d "${PATH64}" ; then - AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) - AC_MSG_WARN([Ensure latest Platform SDK is installed]) - do64bit="no" - else - AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) - do64bit_ok="yes" - fi - fi - - if test "$doWince" != "no" ; then - if test "$do64bit" != "no" ; then - AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) - fi - if test "$GCC" = "yes" ; then - AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) - fi - TEA_PATH_CELIB - # Set defaults for common evc4/PPC2003 setup - # Currently Tcl requires 300+, possibly 420+ for sockets - CEVERSION=420; # could be 211 300 301 400 420 ... - TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... - ARCH=ARM; # could be ARM MIPS X86EM ... - PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" - if test "$doWince" != "yes"; then - # If !yes then the user specified something - # Reset ARCH to allow user to skip specifying it - ARCH= - eval `echo $doWince | awk -F, '{ \ - if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ - if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ - if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ - if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ - if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ - }'` - if test "x${ARCH}" = "x" ; then - ARCH=$TARGETCPU; - fi - fi - OSVERSION=WCE$CEVERSION; - if test "x${WCEROOT}" = "x" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" - if test ! -d "${WCEROOT}" ; then - WCEROOT="C:/Program Files/Microsoft eMbedded Tools" - fi - fi - if test "x${SDKROOT}" = "x" ; then - SDKROOT="C:/Program Files/Windows CE Tools" - if test ! -d "${SDKROOT}" ; then - SDKROOT="C:/Windows CE Tools" - fi - fi - WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` - SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` - if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ - -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then - AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) - doWince="no" - else - # We could PATH_NOSPACE these, but that's not important, - # as long as we quote them when used. - CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" - if test -d "${CEINCLUDE}/${TARGETCPU}" ; then - CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" - fi - CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" - fi - fi - - if test "$GCC" != "yes" ; then - if test "${SHARED_BUILD}" = "0" ; then - runtime=-MT - else - runtime=-MD - fi - - if test "$do64bit" != "no" ; then - # All this magic is necessary for the Win64 SDK RC1 - hobbs - CC="\"${PATH64}/cl.exe\"" - CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" - RC="\"${MSSDK}/bin/rc.exe\"" - lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" - LINKBIN="\"${PATH64}/link.exe\"" - CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - # Avoid 'unresolved external symbol __security_cookie' - # errors, c.f. http://support.microsoft.com/?id=894573 - TEA_ADD_LIBS([bufferoverflowU.lib]) - elif test "$doWince" != "no" ; then - CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" - if test "${TARGETCPU}" = "X86"; then - CC="\"${CEBINROOT}/cl.exe\"" - else - CC="\"${CEBINROOT}/cl${ARCH}.exe\"" - fi - CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" - RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" - arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` - defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" - if test "${SHARED_BUILD}" = "1" ; then - # Static CE builds require static celib as well - defs="${defs} _DLL" - fi - for i in $defs ; do - AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) - done - AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) - AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) - CFLAGS_DEBUG="-nologo -Zi -Od" - CFLAGS_OPTIMIZE="-nologo -Ox" - lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` - lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" - LINKBIN="\"${CEBINROOT}/link.exe\"" - AC_SUBST(CELIB_DIR) - else - RC="rc" - lflags="-nologo" - LINKBIN="link" - CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" - CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" - fi - fi - - if test "$GCC" = "yes"; then - # mingw gcc mode - RC="windres" - CFLAGS_DEBUG="-g" - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - SHLIB_LD="$CC -shared" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" - LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" - else - SHLIB_LD="${LINKBIN} -dll ${lflags}" - # link -lib only works when -lib is the first arg - STLIB_LD="${LINKBIN} -lib ${lflags}" - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' - PATHTYPE=-w - # For information on what debugtype is most useful, see: - # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp - # This essentially turns it all on. - LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" - LDFLAGS_OPTIMIZE="-release" - if test "$doWince" != "no" ; then - LDFLAGS_CONSOLE="-link ${lflags}" - LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} - else - LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" - LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" - fi - fi - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dll" - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' - - TCL_LIB_VERSIONS_OK=nodots - # Bogus to avoid getting this turned off - DL_OBJS="tclLoadNone.obj" - ;; - AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then - # AIX requires the _r compiler when gcc isn't being used - case "${CC}" in - *_r) - # ok ... - ;; - *) - CC=${CC}_r - ;; - esac - AC_MSG_RESULT([Using $CC for compiling with threads]) - fi - LIBS="$LIBS -lc" - SHLIB_CFLAGS="" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - DL_OBJS="tclLoadDl.o" - LD_LIBRARY_PATH_VAR="LIBPATH" - - # Check to enable 64-bit flags for compiler/linker on AIX 4+ - if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - else - do64bit_ok=yes - CFLAGS="$CFLAGS -q64" - LDFLAGS_ARCH="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi - - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - else - SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - fi - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' - fi - - # AIX v<=4.1 has some different flags than 4.2+ - if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then - AC_LIBOBJ([tclLoadAix]) - DL_LIBS="-lld" - fi - - # On AIX <=v4 systems, libbsd.a has to be linked in to support - # non-blocking file IO. This library has to be linked in after - # the MATH_LIBS or it breaks the pow() function. The way to - # insure proper sequencing, is to add it to the tail of MATH_LIBS. - # This library also supplies gettimeofday. - # - # AIX does not have a timezone field in struct tm. When the AIX - # bsd library is used, the timezone global and the gettimeofday - # methods are to be avoided for timezone deduction instead, we - # deduce the timezone by comparing the localtime result on a - # known GMT value. - - AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) - if test $libbsd = yes; then - MATH_LIBS="$MATH_LIBS -lbsd" - AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) - fi - ;; - BeOS*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC} -nostart" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - - #----------------------------------------------------------- - # Check for inet_ntoa in -lbind, for BeOS (which also needs - # -lsocket, even if the network functions are in -lnet which - # is always linked to, for compatibility. - #----------------------------------------------------------- - AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) - ;; - BSD/OS-2.1*|BSD/OS-3*) - SHLIB_CFLAGS="" - SHLIB_LD="shlicc -r" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - BSD/OS-4.*) - SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="cc -shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - dgux*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - HP-UX-*.11.*) - # Use updated header definitions where possible - AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) - # Needed by Tcl, but not most extensions - #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) - #LIBS="$LIBS -lxnet" # Use the XOPEN network library - - if test "`uname -m`" = "ia64" ; then - SHLIB_SUFFIX=".so" - # Use newer C++ library for C++ extensions - #if test "$GCC" != "yes" ; then - # CPPFLAGS="-AA" - #fi - else - SHLIB_SUFFIX=".sl" - fi - AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS='${LIBS}' - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" - SHLIB_LD_LIBS='${LIBS}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - - # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc - #CFLAGS="$CFLAGS +DAportable" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - hpux_arch=`${CC} -dumpmachine` - case $hpux_arch in - hppa64*) - # 64-bit gcc in use. Fix flags for GNU ld. - do64bit_ok=yes - SHLIB_LD="${CC} -shared" - SHLIB_LD_LIBS='${LIBS}' - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - ;; - *) - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - ;; - esac - else - do64bit_ok=yes - CFLAGS="$CFLAGS +DD64" - LDFLAGS_ARCH="+DD64" - fi - fi - ;; - HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) - SHLIB_SUFFIX=".sl" - AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) - if test "$tcl_ok" = yes; then - SHLIB_CFLAGS="+z" - SHLIB_LD="ld -b" - SHLIB_LD_LIBS="" - DL_OBJS="tclLoadShl.o" - DL_LIBS="-ldld" - LDFLAGS="$LDFLAGS -Wl,-E" - CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' - LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' - LD_LIBRARY_PATH_VAR="SHLIB_PATH" - fi - ;; - IRIX-5.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - ;; - IRIX-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mabi=n32" - LDFLAGS="$LDFLAGS -mabi=n32" - else - case $system in - IRIX-6.3) - # Use to build 6.2 compatible binaries on 6.3. - CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" - ;; - *) - CFLAGS="$CFLAGS -n32" - ;; - esac - LDFLAGS="$LDFLAGS -n32" - fi - ;; - IRIX64-6.*) - SHLIB_CFLAGS="" - SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - - # Check to enable 64-bit flags for compiler/linker - - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN([64bit mode not supported by gcc]) - else - do64bit_ok=yes - SHLIB_LD="ld -64 -shared -rdata_shared" - CFLAGS="$CFLAGS -64" - LDFLAGS_ARCH="-64" - fi - fi - ;; - Linux*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings - # when you inline the string and math operations. Turn this off to - # get rid of the warnings. - #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" - - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - if test $do64bit = yes; then - AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -m64" - AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_m64 = yes; then - CFLAGS="$CFLAGS -m64" - do64bit_ok=yes - fi - fi - - # The combo of gcc + glibc has a bug related - # to inlining of functions like strtod(). The - # -fno-builtin flag should address this problem - # but it does not work. The -fno-inline flag - # is kind of overkill but it works. - # Disable inlining only when one of the - # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x ; then - CFLAGS="$CFLAGS -fno-inline" - fi - - ;; - GNU*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - - SHLIB_LD="${CC} -shared" - DL_OBJS="" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - if test "`uname -m`" = "alpha" ; then - CFLAGS="$CFLAGS -mieee" - fi - ;; - Lynx*) - SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - CFLAGS_OPTIMIZE=-02 - SHLIB_LD="${CC} -shared " - DL_OBJS="tclLoadDl.o" - DL_LIBS="-mshared -ldl" - LD_FLAGS="-Wl,--export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - ;; - MP-RAS-02*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - MP-RAS-*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - LDFLAGS="$LDFLAGS -Wl,-Bexport" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - NetBSD-*|FreeBSD-[[1-2]].*) - # NetBSD/SPARC needs -fPIC, -fpic will not do. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ - AC_EGREP_CPP(yes, [ -#ifdef __ELF__ - yes -#endif - ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) - if test $tcl_cv_ld_elf = yes; then - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - else - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - fi - - # Ancient FreeBSD doesn't handle version numbers with dots. - - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - OpenBSD-*) - # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do. - case `machine` in - sparc|sparc64) - SHLIB_CFLAGS="-fPIC";; - *) - SHLIB_CFLAGS="-fpic";; - esac - SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ - AC_EGREP_CPP(yes, [ -#ifdef __ELF__ - yes -#endif - ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) - if test $tcl_cv_ld_elf = yes; then - LDFLAGS=-Wl,-export-dynamic - else - LDFLAGS="" - fi - - # OpenBSD doesn't do version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - FreeBSD-*) - # FreeBSD 3.* and greater have ELF. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS -export-dynamic" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "${TCL_THREADS}" = "1" ; then - # The -pthread needs to go in the CFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - case $system in - FreeBSD-3.*) - # FreeBSD-3 doesn't handle version numbers with dots. - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' - TCL_LIB_VERSIONS_OK=nodots - ;; - esac - ;; - Darwin-*) - CFLAGS_OPTIMIZE="-Os" - SHLIB_CFLAGS="-fno-common" - # To avoid discrepancies between what headers configure sees during - # preprocessing tests and compiling tests, move any -isysroot and - # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: - CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" - CFLAGS="`echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ - if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" - if test $do64bit = yes; then - case `arch` in - ppc) - AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], - tcl_cv_cc_arch_ppc64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes, - tcl_cv_cc_arch_ppc64=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_arch_ppc64 = yes; then - CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - do64bit_ok=yes - fi;; - i386) - AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], - tcl_cv_cc_arch_x86_64, [ - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch x86_64" - AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes, - tcl_cv_cc_arch_x86_64=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_arch_x86_64 = yes; then - CFLAGS="$CFLAGS -arch x86_64" - do64bit_ok=yes - fi;; - *) - AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; - esac - else - # Check for combined 32-bit and 64-bit fat build - echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \ - echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \ - fat_32_64=yes - fi - # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here: - SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' - AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) - LDFLAGS=$hold_ldflags]) - if test $tcl_cv_ld_single_module = yes; then - SHLIB_LD="${SHLIB_LD} -Wl,-single_module" - fi - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".dylib" - DL_OBJS="tclLoadDyld.o" - DL_LIBS="" - # Don't use -prebind when building for Mac OS X 10.4 or later only: - test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \ - "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \ - LDFLAGS="$LDFLAGS -prebind" - LDFLAGS="$LDFLAGS -headerpad_max_install_names" - AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no) - LDFLAGS=$hold_ldflags]) - if test $tcl_cv_ld_search_paths_first = yes; then - LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" - - # TEA specific: for Tk extensions, remove 64-bit arch flags from - # CFLAGS et al. for combined 32 & 64 bit fat builds as neither - # TkAqua nor TkX11 can be built for 64-bit at present. - test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && for v in CFLAGS CPPFLAGS LDFLAGS; do - eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'; done - ;; - NEXTSTEP-*) - SHLIB_CFLAGS="" - SHLIB_LD="cc -nostdlib -r" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadNext.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OS/390-*) - CFLAGS_OPTIMIZE="" # Optimizer is buggy - AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h - [Should OS/390 do the right thing with sockets?]) - ;; - OSF1-1.0|OSF1-1.1|OSF1-1.2) - # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 - SHLIB_CFLAGS="" - # Hack: make package name same as library name - SHLIB_LD='ld -R -export $@:' - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadOSF.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-1.*) - # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - SHLIB_CFLAGS="-fPIC" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD="ld -shared" - else - SHLIB_LD="ld -non_shared" - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - OSF1-V*) - # Digital OSF/1 - SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = "1" ; then - SHLIB_LD='ld -shared -expect_unresolved "*"' - else - SHLIB_LD='ld -non_shared -expect_unresolved "*"' - fi - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" = "yes" ; then - CFLAGS="$CFLAGS -mieee" - else - CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" - fi - # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = "1" ; then - CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" - CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" - LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = "yes" ; then - LIBS="$LIBS -lpthread -lmach -lexc" - else - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - fi - fi - - ;; - QNX-6*) - # QNX RTP - # This may work for all QNX, but it was only reported for v6. - SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - # dlopen is in -lc on QNX - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SCO_SV-3.2*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, - # this test works, since "uname -s" was non-standard in 3.2.4 and - # below. - if test "$GCC" = "yes" ; then - SHLIB_CFLAGS="-fPIC -melf" - LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" - else - SHLIB_CFLAGS="-Kpic -belf" - LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" - fi - SHLIB_LD="ld -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SINIX*5.4*) - SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - SunOS-4*) - SHLIB_CFLAGS="-PIC" - SHLIB_LD="ld" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - - # SunOS can't handle version numbers with dots in them in library - # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it - # requires an extra version number at the end of .so file names. - # So, the library has to have a name like libtcl75.so.1.0 - - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' - UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' - TCL_LIB_VERSIONS_OK=nodots - ;; - SunOS-5.[[0-6]]) - # Careful to not let 5.10+ fall into this case - - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - - SHLIB_CFLAGS="-KPIC" - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - fi - ;; - SunOS-5*) - # Note: If _REENTRANT isn't defined, then Solaris - # won't define thread-safe library routines. - - AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) - AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, - [Do we really want to follow the standard? Yes we do!]) - - SHLIB_CFLAGS="-KPIC" - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - arch=`isainfo` - if test "$arch" = "sparcv9 sparc" ; then - if test "$GCC" = "yes" ; then - if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then - AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) - else - do64bit_ok=yes - CFLAGS="$CFLAGS -m64 -mcpu=v9" - LDFLAGS="$LDFLAGS -m64 -mcpu=v9" - SHLIB_CFLAGS="-fPIC" - fi - else - do64bit_ok=yes - if test "$do64bitVIS" = "yes" ; then - CFLAGS="$CFLAGS -xarch=v9a" - LDFLAGS_ARCH="-xarch=v9a" - else - CFLAGS="$CFLAGS -xarch=v9" - LDFLAGS_ARCH="-xarch=v9" - fi - # Solaris 64 uses this as well - #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" - fi - elif test "$arch" = "amd64 i386" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN([64bit mode not supported with GCC on $system]) - else - do64bit_ok=yes - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64" - fi - else - AC_MSG_WARN([64bit mode not supported for $arch]) - fi - fi - - # Note: need the LIBS below, otherwise Tk won't find Tcl's - # symbols when dynamically loaded into tclsh. - - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = "yes" ; then - # We need to specify -static-libgcc or we need to - # add the path to the sparv9 libgcc. - # JH: static-libgcc is necessary for core Tcl, but may - # not be necessary for extensions. - SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" - # for finding sparcv9 libgcc, get the regular libgcc - # path, remove so name and append 'sparcv9' - #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." - #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" - fi - else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - fi - ;; - UNIX_SV* | UnixWare-5*) - SHLIB_CFLAGS="-KPIC" - SHLIB_LD="cc -G" - SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="tclLoadDl.o" - DL_LIBS="-ldl" - # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers - # that don't grok the -Bexport option. Test that it does. - AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ - hold_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS -Wl,-Bexport" - AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) - LDFLAGS=$hold_ldflags]) - if test $tcl_cv_ld_Bexport = yes; then - LDFLAGS="$LDFLAGS -Wl,-Bexport" - fi - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - ;; - esac - - if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then - AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) - fi - -dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so -dnl # until the end of configure, as configure's compile and link tests use -dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's -dnl # preprocessing tests use only CPPFLAGS. - AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) - - # Step 4: disable dynamic loading if requested via a command-line switch. - - AC_ARG_ENABLE(load, - AC_HELP_STRING([--enable-load], - [allow dynamic loading and "load" command (default: on)]), - [tcl_ok=$enableval], [tcl_ok=yes]) - if test "$tcl_ok" = "no"; then - DL_OBJS="" - fi - - if test "x$DL_OBJS" != "x" ; then - BUILD_DLTEST="\$(DLTEST_TARGETS)" - else - echo "Can't figure out how to do dynamic loading or shared libraries" - echo "on this system." - SHLIB_CFLAGS="" - SHLIB_LD="" - SHLIB_SUFFIX="" - DL_OBJS="tclLoadNone.o" - DL_LIBS="" - LDFLAGS="$LDFLAGS_ORIG" - CC_SEARCH_FLAGS="" - LD_SEARCH_FLAGS="" - BUILD_DLTEST="" - fi - LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" - - # If we're running gcc, then change the C flags for compiling shared - # libraries to the right flags for gcc, instead of those for the - # standard manufacturer compiler. - - if test "$DL_OBJS" != "tclLoadNone.o" ; then - if test "$GCC" = "yes" ; then - case $system in - AIX-*) - ;; - BSD/OS*) - ;; - IRIX*) - ;; - NetBSD-*|FreeBSD-*) - ;; - Darwin-*) - ;; - SCO_SV-3.2*) - ;; - windows) - ;; - *) - SHLIB_CFLAGS="-fPIC" - ;; - esac - fi - fi - - if test "$SHARED_LIB_SUFFIX" = "" ; then - SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' - fi - if test "$UNSHARED_LIB_SUFFIX" = "" ; then - UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' - fi - - AC_SUBST(DL_LIBS) - - AC_SUBST(CFLAGS_DEBUG) - AC_SUBST(CFLAGS_OPTIMIZE) - AC_SUBST(CFLAGS_WARNING) - - AC_SUBST(STLIB_LD) - AC_SUBST(SHLIB_LD) - - AC_SUBST(SHLIB_LD_LIBS) - AC_SUBST(SHLIB_CFLAGS) - - AC_SUBST(LD_LIBRARY_PATH_VAR) - - # These must be called after we do the basic CFLAGS checks and - # verify any possible 64-bit or similar switches are necessary - TEA_TCL_EARLY_FLAGS - TEA_TCL_64BIT_FLAGS -]) - -#-------------------------------------------------------------------- -# TEA_SERIAL_PORT -# -# Determine which interface to use to talk to the serial port. -# Note that #include lines must begin in leftmost column for -# some compilers to recognize them as preprocessor directives, -# and some build environments have stdin not pointing at a -# pseudo-terminal (usually /dev/null instead.) -# -# Arguments: -# none -# -# Results: -# -# Defines only one of the following vars: -# HAVE_SYS_MODEM_H -# USE_TERMIOS -# USE_TERMIO -# USE_SGTTY -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_SERIAL_PORT], [ - AC_CHECK_HEADERS(sys/modem.h) - AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ - AC_TRY_RUN([ -#include - -int main() { - struct termios t; - if (tcgetattr(0, &t) == 0) { - cfsetospeed(&t, 0); - t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - if test $tcl_cv_api_serial = no ; then - AC_TRY_RUN([ -#include - -int main() { - struct termio t; - if (ioctl(0, TCGETA, &t) == 0) { - t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no ; then - AC_TRY_RUN([ -#include - -int main() { - struct sgttyb t; - if (ioctl(0, TIOCGETP, &t) == 0) { - t.sg_ospeed = 0; - t.sg_flags |= ODDP | EVENP | RAW; - return 0; - } - return 1; -}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no ; then - AC_TRY_RUN([ -#include -#include - -int main() { - struct termios t; - if (tcgetattr(0, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - cfsetospeed(&t, 0); - t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; -}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no; then - AC_TRY_RUN([ -#include -#include - -int main() { - struct termio t; - if (ioctl(0, TCGETA, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; - return 0; - } - return 1; - }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) - fi - if test $tcl_cv_api_serial = no; then - AC_TRY_RUN([ -#include -#include - -int main() { - struct sgttyb t; - if (ioctl(0, TIOCGETP, &t) == 0 - || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { - t.sg_ospeed = 0; - t.sg_flags |= ODDP | EVENP | RAW; - return 0; - } - return 1; -}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) - fi]) - case $tcl_cv_api_serial in - termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; - termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; - sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; - esac -]) - -#-------------------------------------------------------------------- -# TEA_MISSING_POSIX_HEADERS -# -# Supply substitutes for missing POSIX header files. Special -# notes: -# - stdlib.h doesn't define strtol, strtoul, or -# strtod insome versions of SunOS -# - some versions of string.h don't declare procedures such -# as strstr -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# NO_DIRENT_H -# NO_ERRNO_H -# NO_VALUES_H -# HAVE_LIMITS_H or NO_LIMITS_H -# NO_STDLIB_H -# NO_STRING_H -# NO_SYS_WAIT_H -# NO_DLFCN_H -# HAVE_SYS_PARAM_H -# -# HAVE_STRING_H ? -# -# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and -# CHECK on limits.h -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ - AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ - AC_TRY_LINK([#include -#include ], [ -#ifndef _POSIX_SOURCE -# ifdef __Lynx__ - /* - * Generate compilation error to make the test fail: Lynx headers - * are only valid if really in the POSIX environment. - */ - - missing_procedure(); -# endif -#endif -DIR *d; -struct dirent *entryPtr; -char *p; -d = opendir("foobar"); -entryPtr = readdir(d); -p = entryPtr->d_name; -closedir(d); -], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) - - if test $tcl_cv_dirent_h = no; then - AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) - fi - - AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(limits.h, - [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], - [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) - AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) - AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) - AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) - if test $tcl_ok = 0; then - AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) - fi - AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) - AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) - AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) - - # See also memmove check below for a place where NO_STRING_H can be - # set and why. - - if test $tcl_ok = 0; then - AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) - fi - - AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) - - # OS/390 lacks sys/param.h (and doesn't need it, by chance). - AC_HAVE_HEADERS(sys/param.h) -]) - -#-------------------------------------------------------------------- -# TEA_PATH_X -# -# Locate the X11 header files and the X11 library archive. Try -# the ac_path_x macro first, but if it doesn't find the X stuff -# (e.g. because there's no xmkmf program) then check through -# a list of possible directories. Under some conditions the -# autoconf macro will return an include directory that contains -# no include files, so double-check its result just to be safe. -# -# This should be called after TEA_CONFIG_CFLAGS as setting the -# LIBS line can confuse some configure macro magic. -# -# Arguments: -# none -# -# Results: -# -# Sets the following vars: -# XINCLUDES -# XLIBSW -# PKG_LIBS (appends to) -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_PATH_X], [ - if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then - TEA_PATH_UNIX_X - fi -]) - -AC_DEFUN([TEA_PATH_UNIX_X], [ - AC_PATH_X - not_really_there="" - if test "$no_x" = ""; then - if test "$x_includes" = ""; then - AC_TRY_CPP([#include ], , not_really_there="yes") - else - if test ! -r $x_includes/X11/Intrinsic.h; then - not_really_there="yes" - fi - fi - fi - if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then - AC_MSG_CHECKING([for X11 header files]) - found_xincludes="no" - AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") - if test "$found_xincludes" = "no"; then - dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" - for i in $dirs ; do - if test -r $i/X11/Intrinsic.h; then - AC_MSG_RESULT([$i]) - XINCLUDES=" -I$i" - found_xincludes="yes" - break - fi - done - fi - else - if test "$x_includes" != ""; then - XINCLUDES="-I$x_includes" - found_xincludes="yes" - fi - fi - if test found_xincludes = "no"; then - AC_MSG_RESULT([couldn't find any!]) - fi - - if test "$no_x" = yes; then - AC_MSG_CHECKING([for X11 libraries]) - XLIBSW=nope - dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" - for i in $dirs ; do - if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then - AC_MSG_RESULT([$i]) - XLIBSW="-L$i -lX11" - x_libraries="$i" - break - fi - done - else - if test "$x_libraries" = ""; then - XLIBSW=-lX11 - else - XLIBSW="-L$x_libraries -lX11" - fi - fi - if test "$XLIBSW" = nope ; then - AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) - fi - if test "$XLIBSW" = nope ; then - AC_MSG_RESULT([could not find any! Using -lX11.]) - XLIBSW=-lX11 - fi - if test x"${XLIBSW}" != x ; then - PKG_LIBS="${PKG_LIBS} ${XLIBSW}" - fi -]) - -#-------------------------------------------------------------------- -# TEA_BLOCKING_STYLE -# -# The statements below check for systems where POSIX-style -# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. -# On these systems (mostly older ones), use the old BSD-style -# FIONBIO approach instead. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# HAVE_SYS_IOCTL_H -# HAVE_SYS_FILIO_H -# USE_FIONBIO -# O_NONBLOCK -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_BLOCKING_STYLE], [ - AC_CHECK_HEADERS(sys/ioctl.h) - AC_CHECK_HEADERS(sys/filio.h) - TEA_CONFIG_SYSTEM - AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) - case $system in - # There used to be code here to use FIONBIO under AIX. However, it - # was reported that FIONBIO doesn't work under AIX 3.2.5. Since - # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO - # code (JO, 5/31/97). - - OSF*) - AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) - AC_MSG_RESULT([FIONBIO]) - ;; - SunOS-4*) - AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) - AC_MSG_RESULT([FIONBIO]) - ;; - *) - AC_MSG_RESULT([O_NONBLOCK]) - ;; - esac -]) - -#-------------------------------------------------------------------- -# TEA_TIME_HANLDER -# -# Checks how the system deals with time.h, what time structures -# are used on the system, and what fields the structures have. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# USE_DELTA_FOR_TZ -# HAVE_TM_GMTOFF -# HAVE_TM_TZADJ -# HAVE_TIMEZONE_VAR -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TIME_HANDLER], [ - AC_CHECK_HEADERS(sys/time.h) - AC_HEADER_TIME - AC_STRUCT_TIMEZONE - - AC_CHECK_FUNCS(gmtime_r localtime_r) - - AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ - AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], - tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) - if test $tcl_cv_member_tm_tzadj = yes ; then - AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) - fi - - AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ - AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], - tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) - if test $tcl_cv_member_tm_gmtoff = yes ; then - AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) - fi - - # - # Its important to include time.h in this check, as some systems - # (like convex) have timezone functions, etc. - # - AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ - AC_TRY_COMPILE([#include ], - [extern long timezone; - timezone += 1; - exit (0);], - tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) - if test $tcl_cv_timezone_long = yes ; then - AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) - else - # - # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. - # - AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ - AC_TRY_COMPILE([#include ], - [extern time_t timezone; - timezone += 1; - exit (0);], - tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) - if test $tcl_cv_timezone_time = yes ; then - AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) - fi - fi -]) - -#-------------------------------------------------------------------- -# TEA_BUGGY_STRTOD -# -# Under Solaris 2.4, strtod returns the wrong value for the -# terminating character under some conditions. Check for this -# and if the problem exists use a substitute procedure -# "fixstrtod" (provided by Tcl) that corrects the error. -# Also, on Compaq's Tru64 Unix 5.0, -# strtod(" ") returns 0.0 instead of a failure to convert. -# -# Arguments: -# none -# -# Results: -# -# Might defines some of the following vars: -# strtod (=fixstrtod) -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_BUGGY_STRTOD], [ - AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) - if test "$tcl_strtod" = 1; then - AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ - AC_TRY_RUN([ - extern double strtod(); - int main() { - char *infString="Inf", *nanString="NaN", *spaceString=" "; - char *term; - double value; - value = strtod(infString, &term); - if ((term != infString) && (term[-1] == 0)) { - exit(1); - } - value = strtod(nanString, &term); - if ((term != nanString) && (term[-1] == 0)) { - exit(1); - } - value = strtod(spaceString, &term); - if (term == (spaceString+1)) { - exit(1); - } - exit(0); - }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, - tcl_cv_strtod_buggy=buggy)]) - if test "$tcl_cv_strtod_buggy" = buggy; then - AC_LIBOBJ([fixstrtod]) - USE_COMPAT=1 - AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) - fi - fi -]) - -#-------------------------------------------------------------------- -# TEA_TCL_LINK_LIBS -# -# Search for the libraries needed to link the Tcl shell. -# Things like the math library (-lm) and socket stuff (-lsocket vs. -# -lnsl) are dealt with here. -# -# Arguments: -# Requires the following vars to be set in the Makefile: -# DL_LIBS -# LIBS -# MATH_LIBS -# -# Results: -# -# Subst's the following var: -# TCL_LIBS -# MATH_LIBS -# -# Might append to the following vars: -# LIBS -# -# Might define the following vars: -# HAVE_NET_ERRNO_H -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_LINK_LIBS], [ - #-------------------------------------------------------------------- - # On a few very rare systems, all of the libm.a stuff is - # already in libc.a. Set compiler flags accordingly. - # Also, Linux requires the "ieee" library for math to work - # right (and it must appear before "-lm"). - #-------------------------------------------------------------------- - - AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") - AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) - - #-------------------------------------------------------------------- - # Interactive UNIX requires -linet instead of -lsocket, plus it - # needs net/errno.h to define the socket-related error codes. - #-------------------------------------------------------------------- - - AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) - AC_CHECK_HEADER(net/errno.h, [ - AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) - - #-------------------------------------------------------------------- - # Check for the existence of the -lsocket and -lnsl libraries. - # The order here is important, so that they end up in the right - # order in the command line generated by make. Here are some - # special considerations: - # 1. Use "connect" and "accept" to check for -lsocket, and - # "gethostbyname" to check for -lnsl. - # 2. Use each function name only once: can't redo a check because - # autoconf caches the results of the last check and won't redo it. - # 3. Use -lnsl and -lsocket only if they supply procedures that - # aren't already present in the normal libraries. This is because - # IRIX 5.2 has libraries, but they aren't needed and they're - # bogus: they goof up name resolution if used. - # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. - # To get around this problem, check for both libraries together - # if -lsocket doesn't work by itself. - #-------------------------------------------------------------------- - - tcl_checkBoth=0 - AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) - if test "$tcl_checkSocket" = 1; then - AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, - LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) - fi - if test "$tcl_checkBoth" = 1; then - tk_oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) - fi - AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, - [LIBS="$LIBS -lnsl"])]) - - # Don't perform the eval of the libraries here because DL_LIBS - # won't be set until we call TEA_CONFIG_CFLAGS - - TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' - AC_SUBST(TCL_LIBS) - AC_SUBST(MATH_LIBS) -]) - -#-------------------------------------------------------------------- -# TEA_TCL_EARLY_FLAGS -# -# Check for what flags are needed to be passed so the correct OS -# features are available. -# -# Arguments: -# None -# -# Results: -# -# Might define the following vars: -# _ISOC99_SOURCE -# _LARGEFILE64_SOURCE -# _LARGEFILE_SOURCE64 -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_EARLY_FLAG],[ - AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), - AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, - AC_TRY_COMPILE([[#define ]$1[ 1 -]$2], $3, - [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, - [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) - if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then - AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) - tcl_flags="$tcl_flags $1" - fi -]) - -AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ - AC_MSG_CHECKING([for required early compiler flags]) - tcl_flags="" - TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], - [char *p = (char *)strtoll; char *q = (char *)strtoull;]) - TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], - [struct stat64 buf; int i = stat64("/", &buf);]) - TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ], - [char *p = (char *)open64;]) - if test "x${tcl_flags}" = "x" ; then - AC_MSG_RESULT([none]) - else - AC_MSG_RESULT([${tcl_flags}]) - fi -]) - -#-------------------------------------------------------------------- -# TEA_TCL_64BIT_FLAGS -# -# Check for what is defined in the way of 64-bit features. -# -# Arguments: -# None -# -# Results: -# -# Might define the following vars: -# TCL_WIDE_INT_IS_LONG -# TCL_WIDE_INT_TYPE -# HAVE_STRUCT_DIRENT64 -# HAVE_STRUCT_STAT64 -# HAVE_TYPE_OFF64_T -# -#-------------------------------------------------------------------- - -AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ - AC_MSG_CHECKING([for 64-bit integer type]) - AC_CACHE_VAL(tcl_cv_type_64bit,[ - tcl_cv_type_64bit=none - # See if the compiler knows natively about __int64 - AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], - tcl_type_64bit=__int64, tcl_type_64bit="long long") - # See if we should use long anyway Note that we substitute in the - # type that is our current guess for a 64-bit type inside this check - # program, so it should be modified only carefully... - AC_TRY_COMPILE(,[switch (0) { - case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; - }],tcl_cv_type_64bit=${tcl_type_64bit})]) - if test "${tcl_cv_type_64bit}" = none ; then - AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) - AC_MSG_RESULT([using long]) - elif test "${tcl_cv_type_64bit}" = "__int64" \ - -a "${TEA_PLATFORM}" = "windows" ; then - # We actually want to use the default tcl.h checks in this - # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* - AC_MSG_RESULT([using Tcl header defaults]) - else - AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, - [What type should be used to define wide integers?]) - AC_MSG_RESULT([${tcl_cv_type_64bit}]) - - # Now check for auxiliary declarations - AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ - AC_TRY_COMPILE([#include -#include ],[struct dirent64 p;], - tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) - if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then - AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) - fi - - AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ - AC_TRY_COMPILE([#include ],[struct stat64 p; -], - tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) - if test "x${tcl_cv_struct_stat64}" = "xyes" ; then - AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) - fi - - AC_CHECK_FUNCS(open64 lseek64) - AC_MSG_CHECKING([for off64_t]) - AC_CACHE_VAL(tcl_cv_type_off64_t,[ - AC_TRY_COMPILE([#include ],[off64_t offset; -], - tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) - dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the - dnl functions lseek64 and open64 are defined. - if test "x${tcl_cv_type_off64_t}" = "xyes" && \ - test "x${ac_cv_func_lseek64}" = "xyes" && \ - test "x${ac_cv_func_open64}" = "xyes" ; then - AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi -]) - -## -## Here ends the standard Tcl configuration bits and starts the -## TEA specific functions -## - -#------------------------------------------------------------------------ -# TEA_INIT -- -# -# Init various Tcl Extension Architecture (TEA) variables. -# This should be the first called TEA_* macro. -# -# Arguments: -# none -# -# Results: -# -# Defines and substs the following vars: -# CYGPATH -# EXEEXT -# Defines only: -# TEA_VERSION -# TEA_INITED -# TEA_PLATFORM (windows or unix) -# -# "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. -# -# EXEEXT -# Select the executable extension based on the host type. This -# is a lightweight replacement for AC_EXEEXT that doesn't require -# a compiler. -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_INIT], [ - # TEA extensions pass this us the version of TEA they think they - # are compatible with. - TEA_VERSION="3.6" - - AC_MSG_CHECKING([for correct TEA configuration]) - if test x"${PACKAGE_NAME}" = x ; then - AC_MSG_ERROR([ -The PACKAGE_NAME variable must be defined by your TEA configure.in]) - fi - if test x"$1" = x ; then - AC_MSG_ERROR([ -TEA version not specified.]) - elif test "$1" != "${TEA_VERSION}" ; then - AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) - else - AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) - fi - case "`uname -s`" in - *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) - AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) - EXEEXT=".exe" - TEA_PLATFORM="windows" - ;; - *) - CYGPATH=echo - EXEEXT="" - TEA_PLATFORM="unix" - ;; - esac - - # Check if exec_prefix is set. If not use fall back to prefix. - # Note when adjusted, so that TEA_PREFIX can correct for this. - # This is needed for recursive configures, since autoconf propagates - # $prefix, but not $exec_prefix (doh!). - if test x$exec_prefix = xNONE ; then - exec_prefix_default=yes - exec_prefix=$prefix - fi - - AC_SUBST(EXEEXT) - AC_SUBST(CYGPATH) - - # This package name must be replaced statically for AC_SUBST to work - AC_SUBST(PKG_LIB_FILE) - # Substitute STUB_LIB_FILE in case package creates a stub library too. - AC_SUBST(PKG_STUB_LIB_FILE) - - # We AC_SUBST these here to ensure they are subst'ed, - # in case the user doesn't call TEA_ADD_... - AC_SUBST(PKG_STUB_SOURCES) - AC_SUBST(PKG_STUB_OBJECTS) - AC_SUBST(PKG_TCL_SOURCES) - AC_SUBST(PKG_HEADERS) - AC_SUBST(PKG_INCLUDES) - AC_SUBST(PKG_LIBS) - AC_SUBST(PKG_CFLAGS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_SOURCES -- -# -# Specify one or more source files. Users should check for -# the right platform before adding to their list. -# It is not important to specify the directory, as long as it is -# in the generic, win or unix subdirectory of $(srcdir). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_SOURCES -# PKG_OBJECTS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_SOURCES], [ - vars="$@" - for i in $vars; do - case $i in - [\$]*) - # allow $-var names - PKG_SOURCES="$PKG_SOURCES $i" - PKG_OBJECTS="$PKG_OBJECTS $i" - ;; - *) - # check for existence - allows for generic/win/unix VPATH - # To add more dirs here (like 'src'), you have to update VPATH - # in Makefile.in as well - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - AC_MSG_ERROR([could not find source file '$i']) - fi - PKG_SOURCES="$PKG_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" - fi - PKG_OBJECTS="$PKG_OBJECTS $j" - ;; - esac - done - AC_SUBST(PKG_SOURCES) - AC_SUBST(PKG_OBJECTS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_STUB_SOURCES -- -# -# Specify one or more source files. Users should check for -# the right platform before adding to their list. -# It is not important to specify the directory, as long as it is -# in the generic, win or unix subdirectory of $(srcdir). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_STUB_SOURCES -# PKG_STUB_OBJECTS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_STUB_SOURCES], [ - vars="$@" - for i in $vars; do - # check for existence - allows for generic/win/unix VPATH - if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ - -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ - ; then - AC_MSG_ERROR([could not find stub source file '$i']) - fi - PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" - # this assumes it is in a VPATH dir - i=`basename $i` - # handle user calling this before or after TEA_SETUP_COMPILER - if test x"${OBJEXT}" != x ; then - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" - else - j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" - fi - PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" - done - AC_SUBST(PKG_STUB_SOURCES) - AC_SUBST(PKG_STUB_OBJECTS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_TCL_SOURCES -- -# -# Specify one or more Tcl source files. These should be platform -# independent runtime files. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_TCL_SOURCES -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_TCL_SOURCES], [ - vars="$@" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) - fi - PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" - done - AC_SUBST(PKG_TCL_SOURCES) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_HEADERS -- -# -# Specify one or more source headers. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_HEADERS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_HEADERS], [ - vars="$@" - for i in $vars; do - # check for existence, be strict because it is installed - if test ! -f "${srcdir}/$i" ; then - AC_MSG_ERROR([could not find header file '${srcdir}/$i']) - fi - PKG_HEADERS="$PKG_HEADERS $i" - done - AC_SUBST(PKG_HEADERS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_INCLUDES -- -# -# Specify one or more include dirs. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_INCLUDES -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_INCLUDES], [ - vars="$@" - for i in $vars; do - PKG_INCLUDES="$PKG_INCLUDES $i" - done - AC_SUBST(PKG_INCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_LIBS -- -# -# Specify one or more libraries. Users should check for -# the right platform before adding to their list. For Windows, -# libraries provided in "foo.lib" format will be converted to -# "-lfoo" when using GCC (mingw). -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_LIBS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_LIBS], [ - vars="$@" - for i in $vars; do - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then - # Convert foo.lib to -lfoo for GCC. No-op if not *.lib - i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` - fi - PKG_LIBS="$PKG_LIBS $i" - done - AC_SUBST(PKG_LIBS) -]) - -#------------------------------------------------------------------------ -# TEA_ADD_CFLAGS -- -# -# Specify one or more CFLAGS. Users should check for -# the right platform before adding to their list. -# -# Arguments: -# one or more file names -# -# Results: -# -# Defines and substs the following vars: -# PKG_CFLAGS -#------------------------------------------------------------------------ -AC_DEFUN([TEA_ADD_CFLAGS], [ - PKG_CFLAGS="$PKG_CFLAGS $@" - AC_SUBST(PKG_CFLAGS) -]) - -#------------------------------------------------------------------------ -# TEA_PREFIX -- -# -# Handle the --prefix=... option by defaulting to what Tcl gave -# -# Arguments: -# none -# -# Results: -# -# If --prefix or --exec-prefix was not specified, $prefix and -# $exec_prefix will be set to the values given to Tcl when it was -# configured. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_PREFIX], [ - if test "${prefix}" = "NONE"; then - prefix_default=yes - if test x"${TCL_PREFIX}" != x; then - AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) - prefix=${TCL_PREFIX} - else - AC_MSG_NOTICE([--prefix defaulting to /usr/local]) - prefix=/usr/local - fi - fi - if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ - -o x"${exec_prefix_default}" = x"yes" ; then - if test x"${TCL_EXEC_PREFIX}" != x; then - AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) - exec_prefix=${TCL_EXEC_PREFIX} - else - AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) - exec_prefix=$prefix - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_SETUP_COMPILER_CC -- -# -# Do compiler checks the way we want. This is just a replacement -# for AC_PROG_CC in TEA configure.in files to make them cleaner. -# -# Arguments: -# none -# -# Results: -# -# Sets up CC var and other standard bits we need to make executables. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_SETUP_COMPILER_CC], [ - # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) - # in this macro, they need to go into TEA_SETUP_COMPILER instead. - - # If the user did not set CFLAGS, set it now to keep - # the AC_PROG_CC macro from adding "-g -O2". - if test "${CFLAGS+set}" != "set" ; then - CFLAGS="" - fi - - AC_PROG_CC - AC_PROG_CPP - - AC_PROG_INSTALL - - #-------------------------------------------------------------------- - # Checks to see if the make program sets the $MAKE variable. - #-------------------------------------------------------------------- - - AC_PROG_MAKE_SET - - #-------------------------------------------------------------------- - # Find ranlib - #-------------------------------------------------------------------- - - AC_PROG_RANLIB - - #-------------------------------------------------------------------- - # Determines the correct binary file extension (.o, .obj, .exe etc.) - #-------------------------------------------------------------------- - - AC_OBJEXT - AC_EXEEXT -]) - -#------------------------------------------------------------------------ -# TEA_SETUP_COMPILER -- -# -# Do compiler checks that use the compiler. This must go after -# TEA_SETUP_COMPILER_CC, which does the actual compiler check. -# -# Arguments: -# none -# -# Results: -# -# Sets up CC var and other standard bits we need to make executables. -#------------------------------------------------------------------------ -AC_DEFUN([TEA_SETUP_COMPILER], [ - # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. - AC_REQUIRE([TEA_SETUP_COMPILER_CC]) - - #------------------------------------------------------------------------ - # If we're using GCC, see if the compiler understands -pipe. If so, use it. - # It makes compiling go faster. (This is only a performance feature.) - #------------------------------------------------------------------------ - - if test -z "$no_pipe" -a -n "$GCC"; then - AC_CACHE_CHECK([if the compiler understands -pipe], - tcl_cv_cc_pipe, [ - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_pipe = yes; then - CFLAGS="$CFLAGS -pipe" - fi - fi - - #-------------------------------------------------------------------- - # Common compiler flag setup - #-------------------------------------------------------------------- - - AC_C_BIGENDIAN - if test "${TEA_PLATFORM}" = "unix" ; then - TEA_TCL_LINK_LIBS - TEA_MISSING_POSIX_HEADERS - # Let the user call this, because if it triggers, they will - # need a compat/strtod.c that is correct. Users can also - # use Tcl_GetDouble(FromObj) instead. - #TEA_BUGGY_STRTOD - fi -]) - -#------------------------------------------------------------------------ -# TEA_MAKE_LIB -- -# -# Generate a line that can be used to build a shared/unshared library -# in a platform independent manner. -# -# Arguments: -# none -# -# Requires: -# -# Results: -# -# Defines the following vars: -# CFLAGS - Done late here to note disturb other AC macros -# MAKE_LIB - Command to execute to build the Tcl library; -# differs depending on whether or not Tcl is being -# compiled as a shared library. -# MAKE_SHARED_LIB Makefile rule for building a shared library -# MAKE_STATIC_LIB Makefile rule for building a static library -# MAKE_STUB_LIB Makefile rule for building a stub library -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_MAKE_LIB], [ - if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then - MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" - MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" - else - MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" - MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" - MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" - fi - - if test "${SHARED_BUILD}" = "1" ; then - MAKE_LIB="${MAKE_SHARED_LIB} " - else - MAKE_LIB="${MAKE_STATIC_LIB} " - fi - - #-------------------------------------------------------------------- - # Shared libraries and static libraries have different names. - # Use the double eval to make sure any variables in the suffix is - # substituted. (@@@ Might not be necessary anymore) - #-------------------------------------------------------------------- - - if test "${TEA_PLATFORM}" = "windows" ; then - if test "${SHARED_BUILD}" = "1" ; then - # We force the unresolved linking of symbols that are really in - # the private libraries of Tcl and Tk. - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" - fi - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - else - eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - if test "$GCC" = "yes"; then - PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} - fi - # These aren't needed on Windows (either MSVC or gcc) - RANLIB=: - RANLIB_STUB=: - else - RANLIB_STUB="${RANLIB}" - if test "${SHARED_BUILD}" = "1" ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" - if test x"${TK_BIN_DIR}" != x ; then - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" - fi - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" - RANLIB=: - else - eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" - fi - # Some packages build their own stubs libraries - eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" - fi - - # These are escaped so that only CFLAGS is picked up at configure time. - # The other values will be substituted at make time. - CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" - if test "${SHARED_BUILD}" = "1" ; then - CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" - fi - - AC_SUBST(MAKE_LIB) - AC_SUBST(MAKE_SHARED_LIB) - AC_SUBST(MAKE_STATIC_LIB) - AC_SUBST(MAKE_STUB_LIB) - AC_SUBST(RANLIB_STUB) -]) - -#------------------------------------------------------------------------ -# TEA_LIB_SPEC -- -# -# Compute the name of an existing object library located in libdir -# from the given base name and produce the appropriate linker flags. -# -# Arguments: -# basename The base name of the library without version -# numbers, extensions, or "lib" prefixes. -# extra_dir Extra directory in which to search for the -# library. This location is used first, then -# $prefix/$exec-prefix, then some defaults. -# -# Requires: -# TEA_INIT and TEA_PREFIX must be called first. -# -# Results: -# -# Defines the following vars: -# ${basename}_LIB_NAME The computed library name. -# ${basename}_LIB_SPEC The computed linker flags. -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LIB_SPEC], [ - AC_MSG_CHECKING([for $1 library]) - - # Look in exec-prefix for the library (defined by TEA_PREFIX). - - tea_lib_name_dir="${exec_prefix}/lib" - - # Or in a user-specified location. - - if test x"$2" != x ; then - tea_extra_lib_dir=$2 - else - tea_extra_lib_dir=NONE - fi - - for i in \ - `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ - `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ - `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do - if test -f "$i" ; then - tea_lib_name_dir=`dirname $i` - $1_LIB_NAME=`basename $i` - $1_LIB_PATH_NAME=$i - break - fi - done - - if test "${TEA_PLATFORM}" = "windows"; then - $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" - else - # Strip off the leading "lib" and trailing ".a" or ".so" - - tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` - $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" - fi - - if test "x${$1_LIB_NAME}" = x ; then - AC_MSG_ERROR([not found]) - else - AC_MSG_RESULT([${$1_LIB_SPEC}]) - fi -]) - -#------------------------------------------------------------------------ -# TEA_PRIVATE_TCL_HEADERS -- -# -# Locate the private Tcl include files -# -# Arguments: -# -# Requires: -# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has -# already been called. -# -# Results: -# -# Substs the following vars: -# TCL_TOP_DIR_NATIVE -# TCL_GENERIC_DIR_NATIVE -# TCL_UNIX_DIR_NATIVE -# TCL_WIN_DIR_NATIVE -# TCL_BMAP_DIR_NATIVE -# TCL_TOOL_DIR_NATIVE -# TCL_PLATFORM_DIR_NATIVE -# TCL_BIN_DIR_NATIVE -# TCL_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ - AC_MSG_CHECKING([for Tcl private include files]) - - TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` - TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" - TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" - TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" - TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" - TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" - TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" - TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" - - if test "${TEA_PLATFORM}" = "windows"; then - TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} - else - TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} - fi - # We want to ensure these are substituted so as not to require - # any *_NATIVE vars be defined in the Makefile - TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers and PrivateHeaders directories - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then - TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else - TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi - ;; - esac - else - if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then - AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) - fi - fi - - - AC_SUBST(TCL_TOP_DIR_NATIVE) - AC_SUBST(TCL_GENERIC_DIR_NATIVE) - AC_SUBST(TCL_UNIX_DIR_NATIVE) - AC_SUBST(TCL_WIN_DIR_NATIVE) - AC_SUBST(TCL_BMAP_DIR_NATIVE) - AC_SUBST(TCL_TOOL_DIR_NATIVE) - AC_SUBST(TCL_PLATFORM_DIR_NATIVE) - - AC_SUBST(TCL_INCLUDES) - AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) -]) - -#------------------------------------------------------------------------ -# TEA_PUBLIC_TCL_HEADERS -- -# -# Locate the installed public Tcl header files -# -# Arguments: -# None. -# -# Requires: -# CYGPATH must be set -# -# Results: -# -# Adds a --with-tclinclude switch to configure. -# Result is cached. -# -# Substs the following vars: -# TCL_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ - AC_MSG_CHECKING([for Tcl public headers]) - - AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) - - AC_CACHE_VAL(ac_cv_c_tclh, [ - # Use the value from --with-tclinclude, if it was given - - if test x"${with_tclinclude}" != x ; then - if test -f "${with_tclinclude}/tcl.h" ; then - ac_cv_c_tclh=${with_tclinclude} - else - AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) - fi - else - if test "`uname -s`" = "Darwin"; then - # If Tcl was built as a framework, attempt to use - # the framework's Headers directory - case ${TCL_DEFS} in - *TCL_FRAMEWORK*) - list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tcl is not installed, - # and in that situation, look there before installed locations. - if test -f "${TCL_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - if test x"${TCL_INCLUDE_SPEC}" != x ; then - d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` - list="$list `ls -d ${d} 2>/dev/null`" - fi - fi - for i in $list ; do - if test -f "$i/tcl.h" ; then - ac_cv_c_tclh=$i - break - fi - done - fi - ]) - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tclh}" = x ; then - AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) - else - AC_MSG_RESULT([${ac_cv_c_tclh}]) - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` - - TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - AC_SUBST(TCL_INCLUDES) -]) - -#------------------------------------------------------------------------ -# TEA_PRIVATE_TK_HEADERS -- -# -# Locate the private Tk include files -# -# Arguments: -# -# Requires: -# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has -# already been called. -# -# Results: -# -# Substs the following vars: -# TK_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ - AC_MSG_CHECKING([for Tk private include files]) - - TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` - TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" - TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" - TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" - TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" - TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" - if test "${TEA_PLATFORM}" = "windows"; then - TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} - else - TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} - fi - # We want to ensure these are substituted so as not to require - # any *_NATIVE vars be defined in the Makefile - TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" - # Detect and add ttk subdir - if test -d ${TK_SRC_DIR_NATIVE}/generic/ttk; then - TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" - fi - if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ - -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" - fi - if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" - fi - if test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use - # the framework's Headers and PrivateHeaders directories - case ${TK_DEFS} in - *TK_FRAMEWORK*) - if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then - TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi - ;; - esac - else - if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then - AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) - fi - fi - - AC_SUBST(TK_TOP_DIR_NATIVE) - AC_SUBST(TK_UNIX_DIR_NATIVE) - AC_SUBST(TK_WIN_DIR_NATIVE) - AC_SUBST(TK_GENERIC_DIR_NATIVE) - AC_SUBST(TK_XLIB_DIR_NATIVE) - AC_SUBST(TK_PLATFORM_DIR_NATIVE) - - AC_SUBST(TK_INCLUDES) - AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) -]) - -#------------------------------------------------------------------------ -# TEA_PUBLIC_TK_HEADERS -- -# -# Locate the installed public Tk header files -# -# Arguments: -# None. -# -# Requires: -# CYGPATH must be set -# -# Results: -# -# Adds a --with-tkinclude switch to configure. -# Result is cached. -# -# Substs the following vars: -# TK_INCLUDES -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ - AC_MSG_CHECKING([for Tk public headers]) - - AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) - - AC_CACHE_VAL(ac_cv_c_tkh, [ - # Use the value from --with-tkinclude, if it was given - - if test x"${with_tkinclude}" != x ; then - if test -f "${with_tkinclude}/tk.h" ; then - ac_cv_c_tkh=${with_tkinclude} - else - AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) - fi - else - if test "`uname -s`" = "Darwin"; then - # If Tk was built as a framework, attempt to use - # the framework's Headers directory. - case ${TK_DEFS} in - *TK_FRAMEWORK*) - list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" - ;; - esac - fi - - # Look in the source dir only if Tk is not installed, - # and in that situation, look there before installed locations. - if test -f "${TK_BIN_DIR}/Makefile" ; then - list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" - fi - - # Check order: pkg --prefix location, Tk's --prefix location, - # relative to directory of tkConfig.sh, Tcl's --prefix location, - # relative to directory of tclConfig.sh. - - eval "temp_includedir=${includedir}" - list="$list \ - `ls -d ${temp_includedir} 2>/dev/null` \ - `ls -d ${TK_PREFIX}/include 2>/dev/null` \ - `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" - if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then - list="$list /usr/local/include /usr/include" - fi - for i in $list ; do - if test -f "$i/tk.h" ; then - ac_cv_c_tkh=$i - break - fi - done - fi - ]) - - # Print a message based on how we determined the include path - - if test x"${ac_cv_c_tkh}" = x ; then - AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) - else - AC_MSG_RESULT([${ac_cv_c_tkh}]) - fi - - # Convert to a native path and substitute into the output files. - - INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` - - TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - - AC_SUBST(TK_INCLUDES) - - if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ - -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then - # On Windows and Aqua, we need the X compat headers - AC_MSG_CHECKING([for X11 header files]) - if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then - INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" - TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" - AC_SUBST(TK_XINCLUDES) - fi - AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) - fi -]) - -#------------------------------------------------------------------------ -# TEA_PROG_TCLSH -# Determine the fully qualified path name of the tclsh executable -# in the Tcl build directory or the tclsh installed in a bin -# directory. This macro will correctly determine the name -# of the tclsh executable even if tclsh has not yet been -# built in the build directory. The tclsh found is always -# associated with a tclConfig.sh file. This tclsh should be used -# only for running extension test cases. It should never be -# or generation of files (like pkgIndex.tcl) at build time. -# -# Arguments -# none -# -# Results -# Subst's the following values: -# TCLSH_PROG -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PROG_TCLSH], [ - AC_MSG_CHECKING([for tclsh]) - if test -f "${TCL_BIN_DIR}/Makefile" ; then - # tclConfig.sh is in Tcl build directory - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="${TCL_BIN_DIR}/tclsh" - fi - else - # tclConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" - else - TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" - fi - list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${TCLSH_PROG}" ; then - REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" - fi - AC_MSG_RESULT([${TCLSH_PROG}]) - AC_SUBST(TCLSH_PROG) -]) - -#------------------------------------------------------------------------ -# TEA_PROG_WISH -# Determine the fully qualified path name of the wish executable -# in the Tk build directory or the wish installed in a bin -# directory. This macro will correctly determine the name -# of the wish executable even if wish has not yet been -# built in the build directory. The wish found is always -# associated with a tkConfig.sh file. This wish should be used -# only for running extension test cases. It should never be -# or generation of files (like pkgIndex.tcl) at build time. -# -# Arguments -# none -# -# Results -# Subst's the following values: -# WISH_PROG -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PROG_WISH], [ - AC_MSG_CHECKING([for wish]) - if test -f "${TK_BIN_DIR}/Makefile" ; then - # tkConfig.sh is in Tk build directory - if test "${TEA_PLATFORM}" = "windows"; then - WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" - else - WISH_PROG="${TK_BIN_DIR}/wish" - fi - else - # tkConfig.sh is in install location - if test "${TEA_PLATFORM}" = "windows"; then - WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" - else - WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" - fi - list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ - `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ - `ls -d ${TK_PREFIX}/bin 2>/dev/null`" - for i in $list ; do - if test -f "$i/${WISH_PROG}" ; then - REAL_TK_BIN_DIR="`cd "$i"; pwd`/" - break - fi - done - WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" - fi - AC_MSG_RESULT([${WISH_PROG}]) - AC_SUBST(WISH_PROG) -]) - -#------------------------------------------------------------------------ -# TEA_PATH_CONFIG -- -# -# Locate the ${1}Config.sh file and perform a sanity check on -# the ${1} compile flags. These are used by packages like -# [incr Tk] that load *Config.sh files from more than Tcl and Tk. -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-$1=... -# -# Defines the following vars: -# $1_BIN_DIR Full path to the directory containing -# the $1Config.sh file -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_CONFIG], [ - # - # Ok, lets find the $1 configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-$1 - # - - if test x"${no_$1}" = x ; then - # we reset no_$1 in case something fails here - no_$1=true - AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) - AC_MSG_CHECKING([for $1 configuration]) - AC_CACHE_VAL(ac_cv_c_$1config,[ - - # First check to see if --with-$1 was specified. - if test x"${with_$1config}" != x ; then - case ${with_$1config} in - */$1Config.sh ) - if test -f ${with_$1config}; then - AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) - with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` - fi;; - esac - if test -f "${with_$1config}/$1Config.sh" ; then - ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` - else - AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) - fi - fi - - # then check for a private $1 installation - if test x"${ac_cv_c_$1config}" = x ; then - for i in \ - ../$1 \ - `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ../../$1 \ - `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ../../../$1 \ - `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ${srcdir}/../$1 \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ - ; do - if test -f "$i/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i; pwd)` - break - fi - if test -f "$i/unix/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i/unix; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_$1config}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d ${exec_prefix}/lib 2>/dev/null` \ - `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/$1Config.sh" ; then - ac_cv_c_$1config=`(cd $i; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_$1config}" = x ; then - $1_BIN_DIR="# no $1 configs found" - AC_MSG_WARN([Cannot find $1 configuration definitions]) - exit 0 - else - no_$1= - $1_BIN_DIR=${ac_cv_c_$1config} - AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) - fi - fi -]) - -#------------------------------------------------------------------------ -# TEA_LOAD_CONFIG -- -# -# Load the $1Config.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# $1_BIN_DIR -# -# Results: -# -# Subst the following vars: -# $1_SRC_DIR -# $1_LIB_FILE -# $1_LIB_SPEC -# -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_LOAD_CONFIG], [ - AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) - - if test -f "${$1_BIN_DIR}/$1Config.sh" ; then - AC_MSG_RESULT([loading]) - . "${$1_BIN_DIR}/$1Config.sh" - else - AC_MSG_RESULT([file not found]) - fi - - # - # If the $1_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable $1_LIB_SPEC will be set to the value - # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC - # instead of $1_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - # - - if test -f "${$1_BIN_DIR}/Makefile" ; then - AC_MSG_WARN([Found Makefile - using build library specs for $1]) - $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} - $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} - $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} - fi - - AC_SUBST($1_VERSION) - AC_SUBST($1_BIN_DIR) - AC_SUBST($1_SRC_DIR) - - AC_SUBST($1_LIB_FILE) - AC_SUBST($1_LIB_SPEC) - - AC_SUBST($1_STUB_LIB_FILE) - AC_SUBST($1_STUB_LIB_SPEC) - AC_SUBST($1_STUB_LIB_PATH) -]) - -#------------------------------------------------------------------------ -# TEA_PATH_CELIB -- -# -# Locate Keuchel's celib emulation layer for targeting Win/CE -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-celib=... -# -# Defines the following vars: -# CELIB_DIR Full path to the directory containing -# the include and platform lib files -#------------------------------------------------------------------------ - -AC_DEFUN([TEA_PATH_CELIB], [ - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-celib - - if test x"${no_celib}" = x ; then - # we reset no_celib in case something fails here - no_celib=true - AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) - AC_MSG_CHECKING([for Windows/CE celib directory]) - AC_CACHE_VAL(ac_cv_c_celibconfig,[ - # First check to see if --with-celibconfig was specified. - if test x"${with_celibconfig}" != x ; then - if test -d "${with_celibconfig}/inc" ; then - ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` - else - AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) - fi - fi - - # then check for a celib library - if test x"${ac_cv_c_celibconfig}" = x ; then - for i in \ - ../celib-palm-3.0 \ - ../celib \ - ../../celib-palm-3.0 \ - ../../celib \ - `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ - ${srcdir}/../celib-palm-3.0 \ - ${srcdir}/../celib \ - `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ - ; do - if test -d "$i/inc" ; then - ac_cv_c_celibconfig=`(cd $i; pwd)` - break - fi - done - fi - ]) - if test x"${ac_cv_c_celibconfig}" = x ; then - AC_MSG_ERROR([Cannot find celib support library directory]) - else - no_celib= - CELIB_DIR=${ac_cv_c_celibconfig} - CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` - AC_MSG_RESULT([found $CELIB_DIR]) - fi - fi -]) - - -# Local Variables: -# mode: autoconf -# End: Index: xotcl/tests/UNIVERSAL.test =================================================================== diff -u -N --- xotcl/tests/UNIVERSAL.test (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/tests/UNIVERSAL.test (revision 0) @@ -1,48 +0,0 @@ -# $Id $ -#if {[set ::tcl_platform(platform)] == "windows"} {lappend auto_path .} - -package require XOTcl; namespace import -force xotcl::* -set pkgdir [file dir [info script]]/.. -lappend auto_path $pkgdir - -package require xotcl::test - -set tclsh [info nameofexecutable] -set dir [file dir [info script]] -set univApps $dir/../apps/actiweb/univ - -set startCmd "$tclsh $univApps/UNIVERSAL.xotcl \ - -instanceFile $univApps/UNIVERSAL.rdf \ - -cssFile UNIVERSAL.css \ - -root $dir/../apps/actiweb/univ \ - -pkgdir $pkgdir" -puts stderr "starting $startCmd" -set PIPE [open "|$startCmd"] - -package require xotcl::comm::httpAccess -proc printError msg {puts stderr !!!$msg!!!} - -Class T -superclass Test -parameter { - {count 1} - {errorReport { - puts "\tcontent-length: \[r0::sink set contentLength\]\n\ - \tstatus-code: \[\[r0 set token\] set responseCode\]\n\[r0 getContent]" - }}} - -T new -msg "Load homepage frame von univ ... " \ - -setResult {expr [r0::sink set contentLength] == 358} \ - -cmd [list SimpleRequest r0 -url http://localhost:8095/ ] -T new -msg "Load Catalog ... " \ - -setResult {expr [r0::sink set contentLength] == 1744} \ - -cmd [list SimpleRequest r0 -url http://localhost:8095/univ+catalog ] -T new -msg "Detail Page ... " \ - -setResult {expr [r0::sink set contentLength] == 2327} \ - -cmd [list SimpleRequest r0 -url http://localhost:8095/univ+details+http://nm.wu-wien.ac.at/Lehre/oo1/] -T new -msg "terminate" -cmd [list SimpleRequest r0 -url http://localhost:8095/receiver::exit] \ - -setResult {set x 1} \ - -post {catch {close $::PIPE}; exit} - -after 1000 {Test run} -vwait forever - - Index: xotcl/tests/actiweb.test =================================================================== diff -u -N --- xotcl/tests/actiweb.test (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/tests/actiweb.test (revision 0) @@ -1,84 +0,0 @@ -# -*- Mode: tcl -*- -# $Id: actiweb.test,v 1.9 2006/09/27 08:12:40 neumann Exp $ -# regression test for actiweb examples -#if {[set ::tcl_platform(platform)] == "windows"} { -# lappend auto_path . -#} -package require XOTcl; namespace import -force ::xotcl::* -set pkgDir [file dirname [info script]]/.. -lappend auto_path $pkgDir -package require xotcl::test -#package require xotcl::package; package verbose 1 -package require xotcl::comm::httpAccess -#package require xotcl::trace - -set tclsh [info nameofexecutable] -set dir [file dir [info script]] -set actiwebApps $dir/../apps/actiweb - -# remove persitent vars to get reproducible behavior -catch [file delete -force receiver] -proc terminate {} { - catch [file delete -force receiver] - exit -} - -puts "$tclsh ${actiwebApps}/Counter.xotcl" -puts "------------------------------------ $tclsh ${actiwebApps}/Counter.xotcl -pkgdir $pkgDir" -set PIPE1 [open "| $tclsh ${actiwebApps}/Counter.xotcl -pkgdir $pkgDir"] -set PIPE2 [open "| $tclsh ${actiwebApps}/Counter2.xotcl -pkgdir $pkgDir"] -set PIPE3 [open "| $tclsh ${actiwebApps}/Counter3.xotcl -pkgdir $pkgDir"] -set PIPE4 [open "| $tclsh ${actiwebApps}/Counter4.xotcl -pkgdir $pkgDir"] -set PIPE5 [open "| $tclsh ${actiwebApps}/MC.xotcl -pkgdir $pkgDir"] - -proc printError msg {puts stderr !!!$msg!!!} - -Class T -superclass Test -parameter { - {count 1} - {errorReport { - puts "\tcontent-length: \[r0::sink set contentLength\]\n\ - \tstatus-code: \[\[r0 set token\] set responseCode\]" - }}} - - -T new -msg "Trying Counter.xotcl ... " \ - -setResult {regexp {^The value in counter-1.html is now: 0} [r0::sink set d]} \ - -cmd [list SimpleRequest r0 -url http://localhost:8090/counter-1.html] -T new -msg "terminate Counter" -setResult {set x 1} \ - -cmd [list SimpleRequest r0 -url http://localhost:8090/receiver::exit] \ - -post {catch {close $::PIPE1}} - -T new -msg "Trying Counter2.xotcl ... " \ - -setResult {r0 getContentLength} \ - -expected 238 \ - -cmd [list SimpleRequest r0 -url http://localhost:8091/web-c1] -T new -msg "terminate Counter1" -setResult {set x 1} \ - -cmd [list SimpleRequest r0 -url http://localhost:8091/receiver::exit] \ - -post {catch {close $::PIPE2}} - -T new -msg "Trying Counter3.xotcl ... " \ - -setResult {r0 getContentLength} \ - -expected 122 \ - -cmd [list SimpleRequest r0 -url http://localhost:8093/c1] -T new -msg "terminate Counter3" -setResult {set x 1} \ - -cmd [list SimpleRequest r0 -url http://localhost:8093/receiver::exit] \ - -post {catch {close $::PIPE3}} - -T new -msg "Trying Counter4.xotcl (a) ... " \ - -setResult {r0 getContentLength} \ - -expected 126 \ - -cmd [list SimpleRequest r0 -url http://localhost:8094/wc1] -T new -msg "terminate Counter4" -setResult {set x 1} \ - -cmd [list SimpleRequest r0 -url http://localhost:8094/receiver::exit] \ - -post {catch {close $::PIPE4}} - -T new -msg "Trying MC.xotcl ... " \ - -setResult {r0 getContentLength} \ - -expected 1767 \ - -cmd [list SimpleRequest r0 -url http://localhost:8092/Gustaf.html ] -T new -msg "terminate MC" -setResult {set x 1} \ - -cmd [list SimpleRequest r0 -url http://localhost:8092/receiver::exit] \ - -post {catch {close $::PIPE5}; exit} - -after 4000 {Test run} -catch {vwait forever} Index: xotcl/tests/forwardtest.xotcl =================================================================== diff -u -N --- xotcl/tests/forwardtest.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/tests/forwardtest.xotcl (revision 0) @@ -1,323 +0,0 @@ -# $Id: forwardtest.xotcl,v 1.12 2007/08/14 16:38:27 neumann Exp $ -package require XOTcl -namespace import -force xotcl::* -package require xotcl::test - -proc ? {cmd expected} { - set t [Test new -cmd $cmd] - $t expected $expected - $t run -} - -########################################### -# trivial object delegation -########################################### -Object dog -Object tail -tail proc wag args { return $args } -dog forward wag tail %proc - -? {dog wag 100} 100 - - -########################################### -# evaluating in scope -########################################### -Class X -parameter {{x 1}} -X instforward Incr -objscope incr - -X x1 -x 100 -x1 Incr x -x1 Incr x -x1 Incr x -? {x1 x} 103 -#puts "======" - -########################################### -# adding -########################################### -Object obj -obj forward addOne expr 1 + - -? {obj addOne 5} 6 -#puts "======" - -########################################### -# more arguments -########################################### -Object target -target proc foo args {return $args} -obj forward foo target %proc %self a1 a2 - -? {obj foo x1 x2} [list ::obj a1 a2 x1 x2] - -obj forward foo target %proc %self %%self %%p -? {obj foo x1 x2} [list ::obj %self %p x1 x2] - -#puts "======" - - -########################################### -# mixin example -########################################### -Object create mixin -mixin proc unknown {m args} {return [concat [self] $m $args]} - -obj forward Mixin mixin %1 %self -? {obj Mixin add M1} [list ::mixin add ::obj M1] -? {catch {obj Mixin}} 1 - - -obj forward Mixin -default {getter setter} mixin %1 %self -? {obj Mixin add M1} [list ::mixin add ::obj M1] -? {obj Mixin M1} [list ::mixin setter ::obj M1] -? {obj Mixin} [list ::mixin getter ::obj] -#puts "======" - - -########################################### -# sketching extensibe info -########################################### -Object Info -Info proc @mixin {o} { - $o info mixin -} -Info proc @class {o} { ;# without prefix, doing here a [Info class] wod be wrong - $o info class -} -Info proc @help {o} { ;# define a new subcommand for info - foreach c [my info procs] {lappend result [string range $c 1 end]} - return $result -} -Object instforward Info -methodprefix @ Info %1 %self - -? {x1 Info class} ::X -? {x1 Info help} [list help mixin class] - -########################################### -# variations of placement of options -########################################### -obj set x 1 -obj forward i1 -objscope incr x - -? {obj i1} 2 -#puts "======" - -########################################### -# introspeciton options -########################################### -Class C -C instforward Info -methodprefix @ Info %1 %self - -? {C info instforward} Info -C instforward XXXo x -? {lsort [C info instforward]} [list Info XXXo] - -? {C info instforward X*} [list XXXo] -? {lsort [C info instforward *o]} [list Info XXXo] - -# delete the forwarder -C instproc XXXo {} {} -? {C info instforward} [list Info] -# get the definition of a instforwarder -? {C info instforward -definition Info} [list -methodprefix @ Info %1 %self] - -# chek introspection for objects -? {lsort [obj info forward]} "Mixin addOne foo i1" -? {obj info forward -definition Mixin} "-default {getter setter} mixin %1 %self" -? {obj info forward -definition addOne} "expr 1 +" -? {obj info forward -definition foo} "target %proc %self %%self %%p" -? {obj info forward -definition i1} "-objscope ::incr x" -#puts "======" - -########################################### -# test serializer -########################################### -package require xotcl::serializer -obj proc test {} {puts "i am [self proc]"} -set a [Serializer deepSerialize obj] -#puts <<$a>> -eval $a -? {set ::a} [Serializer deepSerialize obj] - -########################################### -# test optional target cmd -########################################### -obj set x 2 -obj forward append -objscope -? {obj append x y z} 2yz - -Object n; Object n::x; Object o; -o forward ::n::x -? {o x self} ::n::x - -########################################### -# arg including instvar -########################################### -obj set x 10 -obj forward x* expr {%my set x} * -? {obj x* 10} "100" - -########################################### -# positional arguments -########################################### - -obj forward @end-13 list {%@end 13} -? {obj @end-13 1 2 3 } [list 1 2 3 13] - -obj forward @-1-13 list {%@-1 13} -? {obj @-1-13 1 2 3 } [list 1 2 13 3] - -obj forward @1-13 list {%@1 13} -? {obj @1-13 1 2 3 } [list 13 1 2 3] -? {obj @1-13} [list 13] - -obj forward @2-13 list {%@2 13} -? {obj @2-13 1 2 3 } [list 1 13 2 3] - -obj forward @list 10 {%@0 list} {%@end 99} -? {obj @list} [list 10 99] -? {obj @list a b c} [list 10 a b c 99] - -obj forward @list {%@end 99} {%@0 list} 10 -? {obj @list} [list 10 99] -? {obj @list a b c} [list 10 a b c 99] - -obj forward @list {%@2 2} {%@1 1} {%@0 list} -? {obj @list} [list 1 2] -? {obj @list a b c} [list 1 2 a b c] - -obj forward @list x y z {%@0 list} {%@1 1} {%@2 2} -? {obj @list} [list 1 2 x y z] -? {obj @list a b c} [list 1 2 x y z a b c] - -obj forward @list x y z {%@2 2} {%@1 1} {%@0 list} -? {obj @list} [list x 1 y 2 z] -? {obj @list a b c} [list x 1 y 2 z a b c] - -############################################### -# substitution depending on number of arguments -############################################### - -obj forward f %self [list %argclindex [list a b c]] -obj proc a args {return [list [self proc] $args]} -obj proc b args {return [list [self proc] $args]} -obj proc c args {return [list [self proc] $args]} -? {obj f} [list a {}] -? {obj f 1 } [list b 1] -? {obj f 1 2} [list c {1 2}] -? {catch {obj f 1 2 3}} 1 - -############################################### -# option earlybinding -############################################### -obj forward s -earlybinding ::set %proc -? {obj s 100} 100 -? {obj s} 100 - -Object instproc f args { next } - -Class NS -Class NS::Main - -NS::Main proc m1 {} { my m2 } - -NS::Main proc m2 {} { - ? {namespace eval :: {Object toplevelObj1}} ::toplevelObj1 - - ? [list set _ [namespace current]] ::NS - ? [list set _ [NS create m1]] ::NS::m1 - NS filter f - ? [list set _ [NS create m2]] ::NS::m2 - NS filter "" - - namespace eval ::test { - ? [list set _ [NS create m3]] ::test::m3 - NS filter f - ? [list set _ [NS create m4]] ::test::m4 - NS filter "" - } - - namespace eval test { - ? [list set _ [NS create m5]] ::NS::test::m5 - NS filter f - ? [list set _ [NS create m6]] ::NS::test::m6 - NS filter "" - } - -} - -NS::Main instproc i1 {} { my i2 } - -NS::Main instproc i2 {} { - ? {namespace eval :: {Object toplevelObj2}} ::toplevelObj2 - - ? [list set _ [namespace current]] ::NS - ? [list set _ [NS create i1]] ::NS::i1 - NS filter f - ? [list set _ [NS create i2]] ::NS::i2 - NS filter "" - - namespace eval ::test { - ? [list set _ [NS create i3]] ::test::i3 - NS filter f - ? [list set _ [NS create i4]] ::test::i4 - NS filter "" - } - - namespace eval test { - ? [list set _ [NS create i5]] ::NS::test::i5 - NS filter f - ? [list set _ [NS create i6]] ::NS::test::i6 - NS filter "" - } - -} - -#puts ==== -NS::Main m1 -NS::Main create m -m i1 - -#puts ==== -? [list set _ [NS create n1]] ::n1 -NS filter f -? [list set _ [NS create n2]] ::n2 -NS filter "" - -#puts ==== -namespace eval test { - ? [list set _ [NS create n1]] ::test::n1 - ? [list set _ [NS create n3]] ::test::n3 - NS filter f - ? [list set _ [NS create n4]] ::test::n4 - NS filter "" -} - -########################################### -# forward to expr + callstack -########################################### - -Object instforward expr -objscope - -Class C -C instproc xx {} {self} -C proc t {o expr} { - return [$o expr $expr] -} -C create c1 - -#puts ==== -? {c1 expr {[self]}} ::c1 -? {c1 expr {[self] == "::c1"}} 1 -? {c1 expr {[my xx]}} ::c1 -? {c1 expr {[my info class]}} ::C -? {c1 expr {[my istype C]}} 1 -? {c1 expr {[my istype ::C]}} 1 - -? {C t ::c1 {[self]}} ::c1 -? {C t ::c1 {[self] == "::c1"}} 1 -? {C t ::c1 {[my xx]}} ::c1 -? {C t ::c1 {[my info class]}} ::C -? {C t ::c1 {[my istype C]}} 1 -? {C t ::c1 {[my istype ::C]}} 1 \ No newline at end of file Index: xotcl/tests/persistence.test =================================================================== diff -u -N --- xotcl/tests/persistence.test (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/tests/persistence.test (revision 0) @@ -1,401 +0,0 @@ -#!../../src/xotclsh -# -*- Tcl -*- $Id: persistence.test,v 1.1 2004/05/23 22:50:39 neumann Exp $ -package require XOTcl; namespace import -force xotcl::* - -@ @File { - description { - Several tests for persistent stores and performance comparison. - The "-bigdb" command line option additionally starts a (longer) - big database test. The test automatically detects which storages - are avaiable. - } -} -array set opt {-bigdb 0 -bench 0} -array set opt $argv - -lappend auto_path [file dir [info script]]/.. - -#set auto_path ".. ../../src $auto_path" -#package require xotcl::package;package verbose 1 - -set storageCandidates {Sdbm Jufgdbm Mem Gdbm TextFile} -set storageCandidates {Sdbm Mem Gdbm TextFile} -#set storageCandidates {Gdbm} -set stores "" - -foreach store $storageCandidates { - if {![catch {package require xotcl::store::[string tolower $store]}]} { - lappend stores $store - } else { - puts "FAILED: package require xotcl::store::[string tolower $store]" - } -} - -puts "\nPersistence Test\n\nUsing the following Storages: \n $stores\n" - -set ::tests { - testStorageFeatures - Stores - Traverse - Store_Fetch_List - Store_Fetch_List_Same_Key - SimplePersistentObjects - LotsOfObjects -} - -if {$opt(-bigdb)} { - lappend ::tests bigdb - puts " ... bigdb test enabled.\n" -} else { - puts " ... bigdb test disabled.\n" -} -if {$opt(-bench)} { - set ::runs 10 - # don't use number >= 1000 because of SDBMs's char key length with the - # test SimplePersistentObjects - # don't use number > 272 because of SDBMs's key pairs max length of 1024 - # FIX THIS in FUTURE RELEASES!! - set ::iterations 272 -} else { - set ::runs 1 - set ::iterations 10 -} - -#package require xotcl::store::trace -#Storage=Gdbm instmixin TraceStorage - - -package require xotcl::store::persistence - -proc ::errorCheck {got expected msg} { - if {$got != $expected} { - puts stderr "FAILED: $msg\nGot: $got\nExpected: $expected" - exit -1 - } -} -proc ::errorCheckList {got expected msg} { - if {[lsort $got] != [lsort $expected]} { - puts stderr "FAILED: $msg\nGot: $got\nExpected: $expected" - exit -1 - } -} - -Class PersistenceTest - -@ Class PersistenceTest - -PersistenceTest instproc init args { - next -} - -PersistenceTest instproc testStorageFeatures {store} { - Storage=$store s - s open testDB - s set "{::a::s x} {x}" {a b c d} - s set "::a::s x" {{r t} a b c r} - s set ::a::t 7 - set result [s set ::a::t] - errorCheck $result 7 "Failed fetch ::a::t" - set result [s set "{::a::s x} {x}"] - errorCheck $result "a b c d" "Failed fetch {::a::s x} {x}" - set result [s set "::a::s x"] - errorCheck $result "{r t} a b c r" "Failed fetch ::a::s x" - - errorCheckList [s names] "{::a::s x} {{::a::s x} {x}} ::a::t" "Failed list -- all" - - set keys [list [s firstkey]] - while {[set nk [s nextkey]] != ""} {lappend keys $nk} - set keys [lappend keys [s firstkey]] - while {[set nk [s nextkey]] != ""} {lappend keys $nk} - - errorCheckList $keys "{{::a::s x} {x}} {::a::s x} ::a::t {{::a::s x} {x}} {::a::s x} ::a::t" "First/next key traversal failed." - - s unset "{::a::s x} {x}" - errorCheckList [s names] "{::a::s x} ::a::t" "Failed delete {::a::s x} {x}" - s unset "::a::s x" - errorCheckList [s names] "::a::t" "Failed delete ::a::s x" - - s close - s destroy - return " PASSED with $store" -} - -PersistenceTest instproc Traverse { store} { - Storage=$store s - s open testDB - for {set i 0} {$i < $::iterations} {incr i} { - set key "::a${i}" - set value "An value for the test $i $i $i\0" - s set $key $value - lappend resultKeys $key - lappend resultValues $value - } - - set keys [list [s firstkey]] - set values [list [s set $keys]] - while {[set nk [s nextkey]] != ""} { - lappend keys $nk - lappend values [s set $nk] - } - errorCheckList $keys $resultKeys "Failed Traverse keys" - errorCheckList $values $resultValues "Failed Traverse values" - s close - s destroy - return " PASSED with $store" -} - -PersistenceTest instproc Stores {store} { - Storage=$store s - s open testDB - for {set i 0} {$i < $::iterations} {incr i} { - s set "::a${i}" "An value for the test $i $i $i" - } - set list [s names] - errorCheck [llength $list] $::iterations "Failed Stores $::iterations -- Wrong \# of stored elements" - s close - s destroy - return " PASSED with $store" -} - -PersistenceTest instproc Store_Fetch_List {store} { - Storage=$store s - s open testDB - for {set i 0} {$i < $::iterations} {incr i} { - set key "::a${i}" - set value "An value for the test $i $i $i" - s set $key $value - set list [s names] - errorCheck [llength $list] [expr $i +1] "Failed Store_Fetch_List $::iterations -- Wrong \# of stored elements" - set result [s set $key] - errorCheck $result $value "Failed fetch Store_Fetch_List current key" - set result [s set "::a0"] - errorCheck $result "An value for the test 0 0 0" "Failed fetch Store_Fetch_List first key" - } - s close - s destroy - return " PASSED with $store" -} - -PersistenceTest instproc Store_Fetch_List_Same_Key {store} { - Storage=$store s - s open testDB - set key "Always the same key" - for {set i 0} {$i < $::iterations} {incr i} { - set value "An value for the test $i $i $i" - s set $key $value - set list [s names] - errorCheck [llength $list] 1 "Failed Store_Fetch_List_Same_Key $::iterations -- Wrong \# of stored elements" - set result [s set $key] - errorCheck $result $value "Failed fetch Store_Fetch_List_Same_Key current key" - } - - s close - s destroy - return " PASSED with $store" -} - -# -# tests dependent on the Persistence package -# - -PersistenceTest instproc SimplePersistentObjects {store} { - set ox 1; set oy 1; set py 1; set px 1; - set oza 1; set ozb 1; set onames [list a b] - set pza 1; set pzb 1; set pnames [list a b] - - - - #puts stderr mixin=[pmgr info mixin] - #pmgr mixin [concat TraceStorage [pmgr info mixin]] - - for {set i 0} {$i < $::iterations} {incr i} { - PersistenceMgr pmgr -dirName . \ - -fileName testDB -dbPackage $store - # Two example objects with variables set to default values - Object o - o set x 1 - o set y 1 - o set threeLines "a -b -c" - - o array set z {a 1 b 1} - Object p - p set x 1 - p set y 1 - p array set z {a 1 b 1} - - o mixin Persistent=Eager - p mixin Persistent=Lazy - # for the mem storage Lazy Persistence makes not much sense - if {$store == "Mem"} {p mixin Persistent=Eager} - - o persistenceMgr pmgr - p persistenceMgr pmgr - o persistent {x y z threeLines} - p persistent {x y z} - - o incr x 2 - incr ox 2 - o append y 1 - append oy 1 - p incr x 3 - incr px 3 - p append y 2 - append py 2 - - o incr z(a) 2 - incr oza 2 - o append z(b) 1 - append ozb 1 - o set z($i) 5 - lappend onames $i - - p incr z(a) 2 - incr pza 2 - p append z(b) 1 - append pzb 1 - p set z($i) 5 - lappend pnames $i - - errorCheck [o set x] $ox "Persistence: o->x Failed" - errorCheck [o set y] $oy "Persistence: o->y Failed" - errorCheck [o set z(a)] $oza "Persistence: o->z(a) Failed" - errorCheck [o set z(b)] $ozb "Persistence: o->z(b) Failed" - errorCheckList [o array names z] $onames "Array indizes got lost - o -" - errorCheck [p set x] $px "Persistence: p->x Failed" - errorCheck [p set y] $py "Persistence: p->y Failed" - errorCheckList [o array names z] $onames "Array indizes got lost" - errorCheck [p set z(a)] $pza "Persistence: p->z(a) Failed" - errorCheck [p set z(b)] $pzb "Persistence: p->z(b) Failed" - errorCheckList [p array names z] $pnames "Array indizes got lost - p -" - - errorCheck [o set threeLines] {a -b -c} "Three Lines Failed" - - o destroy - p destroy - pmgr destroy - } - - #errorCheck $ox 21 "Persistence: o->x End Result Failed" - #errorCheck $oy 11111111111 "Persistence: o->y End Result Failed" - #errorCheck $px 31 "Persistence: p->x End Result Failed" - #errorCheck $py 12222222222 "Persistence: p->y End Result Failed" - - return " PASSED with $store" -} - -PersistenceTest instproc LotsOfObjects {store} { - set secondLoopMax 1 - PersistenceMgr pmgr -dirName . \ - -fileName testDB -dbPackage $store - for {set i 0} {$i < $::iterations} {incr i} { - # we create 10 objects per iteration - for {set j 0} {$j < $secondLoopMax} {incr j} { - Object iHaveaVeryLongName${i}${j} - Object iHaveaVeryLongName${i}${j}::meToo${i}${j} - iHaveaVeryLongName${i}${j} mixin Persistent=Eager - iHaveaVeryLongName${i}${j} persistenceMgr pmgr - iHaveaVeryLongName${i}${j}::meToo${i}${j} mixin Persistent=Eager - iHaveaVeryLongName${i}${j}::meToo${i}${j} persistenceMgr pmgr - foreach var {a b c d e f g h i j k l m n o p} { - iHaveaVeryLongName${i}${j} set $var " some useless test ...... - with spaces and lines breaks iHaveaVeryLongName$i $var $i - " - iHaveaVeryLongName${i}${j} persistent $var - iHaveaVeryLongName${i}${j}::meToo${i}${j} set $var " some useless test ...... - with spaces and lines breaks iHaveaVeryLongName$i $var $i - " - iHaveaVeryLongName${i}${j}::meToo${i}${j} persistent $var - } - } - } - pmgr destroy - return " PASSED with $store" -} - -PersistenceTest instproc random modulo { ;### random number generator - [self] instvar seed - set seed [expr {($seed*12731+34197) % 21473}] - return [expr {$seed % $modulo}] -} - -PersistenceTest instproc bigdb {store} { - Storage=$store s - s open testDB - set max 100000 - [self] set seed 4711 - for {set i 0} {$i < $max} {incr i} { - s set $i $i - } - [self] set seed 4711 - for {set i 0} {$i < $max} {incr i} { - set key [[self] random $max] - set r [s set $key] - errorCheck $r $key "Failed bigdb $::iterations -- Wrong result $r instead of $key" - } - s close - s destroy - return " PASSED with $store" -} - - - -PersistenceTest instproc runOnce {} { - eval file delete -force testDB [glob -nocomplain testDB*] - catch {xotcl::memStoragePool remove testDB} - foreach test $::tests { - puts "[[self] set run]: $test $::iterations" - foreach s $::stores { - set t [time {set result [[self] $test $s]}] - [self] report $test $s $t $result - eval file delete -force testDB [glob -nocomplain testDB*] - catch {xotcl::memStoragePool remove testDB} - } - } -} -PersistenceTest instproc run {runs} { - [self] instvar run - for {set run 1} {$run<=$runs} {incr run} { - pt runOnce - } -} - -PersistenceTest instproc report {test store time result} { - if {![regexp {^(-?[0-9]+) +(.*)$} $time _ ms string]} { - puts stderr "time <$time> could not be parsed" - return - } - set key bench($test,$store) - set better " " - if {[[self] exists $key]} { - if {[[self] set $key] > $ms} { - [self] set $key $ms - set better "+" - } - } else { - [self] set $key $ms - } - puts "[[self] set run]: [format %-22s $result]\ - $better[format %10d $ms] $string" -} - -PersistenceTest instproc table {} { - set f [open "persistent.cvs" w] - foreach test $::tests { - set values "" - foreach store $::stores { - lappend values [[self] set bench($test,$store)] - } - puts "[format %-30s $test];[join $values {;}]" - puts $f "[format %-30s $test];[join $values {;}]" - } - close $f -} - -PersistenceTest pt -run $::runs -if {$opt(-bench)} { - pt table -} Index: xotcl/tests/slottest.xotcl =================================================================== diff -u -N --- xotcl/tests/slottest.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/tests/slottest.xotcl (revision 0) @@ -1,618 +0,0 @@ -# $Id: slottest.xotcl,v 1.5 2007/08/14 16:38:27 neumann Exp $ -package require XOTcl -namespace import -force xotcl::* -package require xotcl::test - -proc ? {cmd expected} { - set t [Test new -cmd $cmd -count 100] - $t expected $expected - $t run -} - -proc t {cmd expected {txt ""}} { - set t [Test new -cmd $cmd -msg $txt] - $t expected $expected - $t run -} - -# what's new: -# - slots instances are manager objects for slot values -# - generalization of slots to have different kind of domains and managers -# - slots for objects and classes (slot parameter 'per-object' true|false, -# when to used on a class object) -# - works for mixins/filters/class/superclass (e.g ... superclass add ::M) -# - initcmd and valuecmd -# initcmd: is executed when the instance variable is read the first time -# valuecmd: is executed whenever the instance variable is read -# (implemented via trace; alternate approach for similar behavior -# is to define per-object procs for get/assign, see e.g. slots for -# class and superclass; slots require methods to be invoked, -# not var references; -# otoh, trace are somewhat more fragile and harder to debug) -# default, initcmd and valuecmd are to be used mutually exclusively -# - valuechangedcmd: executed after the change of an instance variable, -# can be used e.g. for validation -# -# -gustaf neumann 21.Jan. 2006 - -package require xotcl::serializer - -#proc ? {cmd expected} { -# set r [eval $cmd] -# if {$r ne $expected} {error "$cmd returned '$r' ne '$expected'"} -#} - -# proc t {cmd {txt ""}} { -# set n 1000 -# #set ms [lindex [time [list time $cmd $n] 10] 0] -# set ms [lindex [time [list time $cmd $n] 5] 0] -# puts "[format %7.4f [expr {$ms*1.0/$n}]]ms for [format %-30s $cmd] ($txt)" -# } -####################################################### -# testing __initcmds -set ::hu 0 -proc T1 {var sub op} {c1 set $var t1} -proc T2 {var sub op} {c1 set $var t2} -Class C -array set __initcmds { - x {set x 1} - y {incr ::hu} - z {my trace add variable z read T1}} -C create c1 -? {c1 info vars x} x -? {c1 info vars y} "" -? {c1 set x} 1 -? {set ::hu} 1 - -Class D -array set __initcmds { - x {set x 2} - z {my trace add variable z read T2}} -superclass C -D create c1 -? {c1 set x} 2 -? {c1 set z} t2 -? {set ::hu} 2 - -####################################################### -# -# a small helper -Object instproc slots cmds { - if {![my isobject [self]::slot]} {Object create [self]::slot} - namespace eval [self]::slot $cmds -} - -###################### -# system slots -###################### - -Class M -Class O -mixin M -? {catch {Object o -mixin check1 M}} 1 -? {O mixin} ::M -Class M2 -O mixin add M2 -? {O mixin} {::M2 ::M} -O mixin M2 -? {O mixin} ::M2 -O mixin "" -? {O mixin} "" -O mixin set M ;# not sure, whether we should keep set here, or use assign or some better term -? {O mixin} ::M -? {O mixin ""} "" - -# with slots like class etc. we have to option to -# a) rename the original command like in the following -# b) provide a no-op value, such that we define only meta-data in the slot -# c) define a low-level tcl command like setrelation (or extend it) to handle the setter - -# "class" is not multivalued, therefore we should not add (or remove) add/delete -# from the set of subcommands... -? {::xotcl::InfoSlot class} "::xotcl::MetaSlot" -O o1 -? {o1 class} "::O" -o1 class Object -? {o1 class} "::xotcl::Object" -? {catch {o1 class add M}} 1 - - -? {O superclass} "::xotcl::Object" -Class O2 -superclass O - -#t {O2 superclass O} "superclass 1" -? {O superclass} "::xotcl::Object" - -::xotcl::Slot instproc slot {object name property} { - switch $property { - self {return [self]} - domain {return [my domain]} - } -} - -? {O superclass slot self} "::xotcl::Class::slot::superclass" -? {O superclass slot domain} "::xotcl::Class" - - -? {O2 superclass} "::O" -O2 superclass add M -? {O2 superclass} "::M ::O" -O2 superclass delete ::O -? {O2 superclass} "::M" - - -# the main difference between an Attribute and a Role is that -# it references some other objects -#Class Attribute -superclass ::xotcl::Slot -Class Role -superclass Attribute -parameter {references} - -###################### -# application classes -###################### -Class Person -slots { - Attribute name - Attribute age -default 0 -} - -Class Article -slots { - Attribute title - Attribute date -} - -Class publishes -slots { - Role written_by -references Person -multivalued true - Role has_published -references Paper -multivalued true -} - -Class Project -slots { - Attribute name - Role manager -references Person - Role member -references Person -multivalued true -} - -puts [Person serialize] -Person slot name default "gustaf" -? {Person slot name default} gustaf -Person p1 -name neophytos -? {p1 name} neophytos -? {p1 age} 0 -p1 age 123 -? {p1 age} 123 - - -Object o1 -o1 set i 0 -::xotcl::alias o1 Incr -objscope ::incr -t {o1 incr i} 1 "method incr" -t {o1 Incr i} 1002 "aliased tcl incr" -t {o1 incr i} 2003 "method incr" -t {o1 Incr i} 3004 "aliased tcl incr" - -::xotcl::alias ::xotcl::Object Set -objscope ::set -t {o1 set i 1} 1 "method set" -t {o1 set i} 1 "method set" -t {o1 Set i 1} 1 "aliased tcl set" -t {o1 Set i} 1 "aliased tcl set" -::xotcl::alias o1 Set -objscope ::set -t {o1 Set i 1} 1 "aliased object tcl set" -t {o1 Set i} 1 "aliased object tcl set" -::xotcl::Object instforward SSet -earlybinding -objscope ::set -t {o1 SSet i 1} 1 "forward earlybinding tcl set" -t {o1 SSet i} 1 "forward earlybinding tcl set" -#exit - -o1 set z 100 -#o1 forward z o1 [list %argclindex [list set set]] %proc -#o1 proc get name {my set $name} -o1 forward get -earlybinding ::xotcl::setinstvar %self %1 -? {o1 get z 101} 101 -? {o1 get z} "101" - -t {o1 get z} 101 "get value via new parametercmd get" -t {o1 get z 124} 124 "set value via new parametercmd get" - - -o1 forward zz -earlybinding ::xotcl::setinstvar %self %proc -? {o1 zz 123} 123 -? {o1 zz} 123 - -t {o1 zz} 123 "parametercmd forward earlybinding setinstvar" -t {o1 zz 124} 124 "parametercmd forward earlybinding setinstvar" - -o1 forward z2 -earlybinding -objscope ::set %proc -t {o1 z2 111} 111 "parametercmd forward earlybinding tcl set" -t {o1 z2} 111 "parametercmd forward earlybinding tcl set" - -o1 forward z3 -objscope ::set %proc -t {o1 z3 111} 111 "parametercmd forward tcl set" -t {o1 z3} 111 "parametercmd forward tcl set" - -o1 set y 11 -o1 parametercmd y -t {o1 y} 11 "parametercmd" -t {o1 y 1} 1 "parametercmd" - -#Class C -parameter {a {b 10} {c "Hello World"}} -#C copy V - -#puts [C serialize] -#puts [V serialize] - -#C destroy -#V v1 -#puts [v1 b] - -# ::xotcl::Object instproc param arglist { -# foreach arg $arglist { -# puts "arg=$arg" -# set l [llength $arg] -# set name [lindex $arg 0] -# if {![my isobject [self]::slot]} {::xotcl::Object create [self]::slot} -# if {$l == 1} { -# Attribute create [self]::slot::$name -# } elseif {$l == 2} { -# Attribute create [self]::slot::$name -default [lindex $arg 1] -# } else { -# set paramstring [string range $arg [expr {[string length $name]+1}] end] -# #puts stderr "remaining arg = '$paramstring'" -# if {[string match {[$\[]*} $paramstring]} { -# #puts stderr "match, $cl set __defaults($name) $paramstring" -# Attribute create [self]::slot::$name -default $paramstring -# continue -# } -# } -# } -# } - - -::xotcl::Slot instmixin delete ::xotcl::Slot::Optimizer - -Class C1 -parameter {a {b 10} {c "Hello World"}} -C1 c1 -a 1 -? {c1 a} 1 -? {c1 b} 10 -? {c1 c} "Hello World" - -##### is short form of - - -Class C2 -slots { - Attribute a - Attribute b -default 10 - Attribute c -default "Hello World" -} -C2 c2 -a 1 -? {c2 procsearch a} "::C2 instforward a" -? {c2 a} 1 -? {c2 b} 10 -? {c2 c} "Hello World" - - -t {c2 a} 1 "new indirect parametercmd" -t {c2 a 1} 1 "new indirect parametercmd" - -::xotcl::Slot instmixin add ::xotcl::Slot::Optimizer -Class C3 -slots { - Attribute a - Attribute b -default 10 - Attribute c -default "Hello World" -} -C3 c3 -a 1 -? {c3 procsearch a} "::C3 instparametercmd a" -? {c3 a} 1 -? {c3 b} 10 -? {c3 c} "Hello World" - -t {c3 a} 1 "new indirect parametercmd optimized" -t {c3 a 1} 1 "new indirect parametercmd optimized" - -####### nasty names -Class create D -slots { - Attribute create create -default 1 -} -D d1 - -####### gargash 2 -Class create A -parameter {{foo 1}} -# or -Class create A -slots { - Attribute foo -default 1 -} - -A create a1 -foo 234 ;# calls default foo setter - -A instproc f1 {} {puts hu} -A instforward f2 puts hu -A create a0 -#a0 f1 -a0 proc f3 {} {puts hu} -a0 forward f4 puts hu -? {a0 procsearch f1} "::A instproc f1" -? {a0 procsearch f2} "::A instforward f2" -? {a0 procsearch f3} "::a0 proc f3" -? {a0 procsearch f4} "::a0 forward f4" -? {a0 procsearch set} "::xotcl::Object instcmd set" -? {A slot foo procsearch assign} "::xotcl::Slot instcmd assign" - -# redefine setter for foo of class A -A slot foo proc assign {domain var val} { - # Do something with [self] that isn't valid pre-init - puts setter-[self proc] - $domain set $var $val -} - -a1 foo ;# calls default foo getter -a1 foo 123 ;# calls overridden foosetter -? {a1 foo} 123 - - -#puts [A serialize] - -################### -# Application Slots -# - -Class Person -slots { - Attribute name - Attribute age -default 0 - Attribute projects -default {} -multivalued true -} - -Person p1 -name "Gustaf" -? {p1 name} Gustaf -? {p1 age} 0 -? {p1 projects} {} - -Class Project -slots { - Attribute name - Attribute description -} - -Project project1 -name XOTcl -description "A highly flexible OO scripting language" - -p1 projects add ::project1 -? {p1 projects} ::project1 -#p1 projects add some-other-value -#? {p1 projects} "some-other-value ::project1" - -::xotcl::Slot instproc check { - {-keep_old_value:boolean true} - value predicate type obj var -} { - puts "+++ checking $value with $predicate ==> [expr $predicate]" - if {![expr $predicate]} { - if {[$obj exists __oldvalue($var)]} { - $obj set $var [$obj set __oldvalue($var)] - } else { - $obj unset $var - } - error "$value is not of type $type" - } - if {$keep_old_value} {$obj set __oldvalue($var) $value} -} - -::xotcl::Slot instproc checkall {values predicate type obj var} { - foreach value $values { - my check -keep_old_value false $value $predicate $type $obj $var - } - $obj set __oldvalue($var) $value -} - -Person slots { - Attribute projects -default "" -multivalued true -type ::Project - Attribute salary -type integer -} - -Person p2 -name "Gustaf" -p2 projects add ::project1 -? {catch {p2 projects add ::o1}} 1 -p2 salary 100 -? {catch {p2 salary 100.9}} 1 -? {p2 salary} 100 -p2 append salary 9 -? {p2 salary} 1009 -? {catch {p2 append salary b}} 1 -? {p2 salary} 1009 - -Person slots { - Attribute sex -type "my sex" -proc sex {value} { - switch -glob $value { - m* {my uplevel {$obj set $var m}; return 1} - f* {my uplevel {$obj set $var f}; return 1} - default {return 0} - } - } -} -Person p3 -sex male -? {p3 sex} m - -set ::hu 0 -Class C -slots { - Attribute x -initcmd {incr ::hu; set x 101} -} -C c1 -? {c1 info vars} "" -? {c1 set x} 101 -? {c1 info vars} "x" -? {set ::hu 1} 1 - - -Class Point -parameter {{x 100} {y 300}} -Class Rectangle -parameter {color} - -Rectangle r0 -color pink -contains { - Rectangle r1 -color red -contains { - Point x1 -x 1 -y 2 - Point x2 -x 1 -y 2 - } - Rectangle r2 -color green -contains { - Point x1 - Point x2 - } -} - -? {r0 color} pink -? {r0 r1 color} red -? {r0 r1 x1 x} 1 -? {r0 r1 x2 y} 2 -? {r0 r2 color} green -#puts [r0 serialize] - - -##### -Class create A -slots { - Attribute foo -default 1 -proc assign { domain var value} { - if {$value < 0 || $value > 99} { - error "$value is not in the range of 0 .. 99" - } - $domain set $var $value - } -} - -A create a1 -? {a1 foo 10} 10 -? {a1 foo 20} 20 -? {a1 foo} 20 -? {catch {a1 foo -1}} 1 -? {catch {a1 foo 100}} 1 -? {catch {a1 foo 99}} 0 - -set x [Object new -set x 1 -contains { - Object new -set x 1.1 - Object new -set x 1.2 -contains { - Object new -set x 1.2.1 - Object new -set x 1.2.2 -contains { - Object new -set x 1.2.2.1 - } - Object new -set x 1.2.3 - } - Object new -set x 1.3 -}] - -? {llength [$x info children]} 3 -? {llength [[lindex [lsort [$x info children]] 0] info children]} 0 -? {llength [[lindex [lsort [$x info children]] 1] info children]} 3 -? {llength [[lindex [lsort [$x info children]] 2] info children]} 0 - -exit - -#puts [Person array get __defaults] -#puts [Person serialize] -puts [Serializer all] -eval [Serializer all] - -? {p2 salary} 1009 -? {catch {p2 append salary b}} 1 -? {p2 salary} 1009 -#p2 projects add ::o1 -exit -p1 set x 0 -t {p1 set x} "get instvar value via set" -t {p1 set x 1} "set instvar value via set" - - - -Object o1 -proc f {x} {return $x} -o1 forward myf -earlybinding f -? {o1 myf abc} abc - -rename f "" -proc f {x} {return 11} -? {o1 myf abc} 11 - -Object o2 -o2 proc f {x} {expr {$x*2}} -o1 forward myf -earlybinding o2 f - -? {o1 myf 100} 200 - -o1 set x 42 -o1 forward x -earlybinding ::xotcl::setinstvar %self %proc -? [list o1 x] 42 -? [list o1 x 41] 41 -t {o1 x} "get parametercmd via forward (earlybinding)" -t {o1 x 41} "set parametercmd via forward (earlybinding)" - -#obj forward Mixin -default {getter setter} mixin %1 %self -o1 forward z -default {getter setter} %self - -o1 forward myfset -objscope set -o1 myfset y 102 -? {o1 myfset y} 102 - -t {o1 myfset y} "get instvar value via forward" -t {o1 myfset y 122} "set instvar value via forward" - -o1 forward myfdset -earlybinding -objscope set -o1 myfdset y 103 -? {o1 myfdset y} 103 - -t {o1 myfdset y} "get instvar value via forward -earlybinding" -t {o1 myfdset y 123} "set instvar value via forward -earlybinding" - -::xotcl::alias o1 myset -objscope ::set -o1 myset x 101 -? {o1 myset x} 101 - -t {o1 myset x} "get instvar value via set alias" -t {o1 myset x 123} "set instvar value via set alias" - - -t {p1 age} "slot read" -Class P -parameter {age {s -setter sets}} -P instproc sets {var value} { - my set $var $value -} -P create p2 -age 345 -s 567 - -t {p2 age} "parametercmd read" -t {::xotcl::setinstvar p2 age} "via setinstvar" -t {p2 s} "parameter read with setter" - - - - -Slot create Project::fullbudget \ - -initcmd {$obj set __x 100} \ - -valuechangedcmd { - puts "budget is now [$obj set fullbudget]" - $obj set __x [$obj set fullbudget] - } - -Slot create Project::currentbudget -valuecmd {$obj incr __x -1} - -Person p2 -name gustaf -Person p3 -name frido -Article a1 -title "My life as a saint" -date "1.1.2006" -publishes new -written_by p1 -has_published a1 -set p [Project new -name icamp -manager p2 -member add p1 -member add p3] -$p member add X end -puts [$p member] - -? [list $p fullbudget] 100 -? [list $p fullbudget] 100 -? [list $p currentbudget] 99 -? [list $p currentbudget] 98 -? [list $p fullbudget 200] 200 -? [list $p currentbudget] 199 -exit - -foreach o [Object allinstances] { - if {[$o isclass]} continue - if {[$o istype Slot]} continue - if {$o eq "::xotcl::relmgr"} continue - set string "$o\n" - foreach v [$o info vars] { - append string " $v = [$o set $v]\n" - } - puts $string -} - -puts stderr DONE-[p1 name]-[p1 age] - -p3 age 77 -exit - -puts [XoXML asXML] - -puts ==== -foreach n [XoXML selectNodes {//object[age > 1]}] {puts [$n asXML]} - -exit Index: xotcl/tests/speedtest.xotcl =================================================================== diff -u -N --- xotcl/tests/speedtest.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/tests/speedtest.xotcl (revision 0) @@ -1,406 +0,0 @@ -#memory trace on -# $Id: speedtest.xotcl,v 1.10 2007/08/14 16:38:27 neumann Exp $ -package require XOTcl -namespace import -force xotcl::* -lappend auto_path [file dirname [info script]]/.. -package require xotcl::test - -@ @File {description { - Regression and speed test for various ways to achieve a similar - behaviour. - } -} -Class M1; Class M2 -Class C -parameter {{p 99} {q 98} r} -C instproc f args {next} -C instproc init args { - my instvar n v - for {set i 1} {$i<1000} {incr i} {set n($i) 1} - for {set i 1} {$i<1000} {incr i} {Object [self]::$i} - set v 1 -} - -C instproc mixinappend m { - my mixin [concat [my info mixin] $m] - my info mixin -} -C instproc ma m { - set mix [my info mixin] - my mixin [lappend mix $m] - my info mixin -} - -C instproc existsViaInstvar {} { - my instvar v - info exists v -} -C instproc existsViaMyInstvar {} { - my instvar v - info exists v -} -C instproc existsViaExistsMethod {} { - my exists v -} -C instproc existsViaMyExistsMethod {} { - my exists v -} -C instproc notExistsViaInstvar {} { - my instvar xxx - info exists xxx -} -C instproc notExistsViaExistsMethod {} { - my exists xxx -} - -C instproc existsAndReturnValue1 {} { - if {[my exists v]} { - my set v - } -} -C instproc existsAndReturnValue3 {} { - if {[my exists v]} { - set x [my set v] - } -} - -C instproc setViaInstvar x { - my instvar v - set v $x -} -C instproc setViaSetMethod x { - my set v $x -} -C instproc setViaParameter x { - my r $x -} -C instproc testAndSetViaInstvar x { - my instvar v - if {[info exists v]} {set v $x} -} -C instproc testAndSetViaSetMethod x { - if {[my info vars v] ne ""} {my set v $x} -} - -C instproc readViaInstvar {} { - my instvar p - set p -} -C instproc readViaSetMethod {} { - my set p -} -C instproc readViaSetMethodNoSelf {} { - ::c set p -} -C instproc readViaParameter {} { - my p -} - -C instproc readTwiceViaInstvar {} { - my instvar p - set p - set p -} -C instproc readTwiceViaSetMethod {} { - my set p - my set p -} -C instproc readTwiceViaSetMethodNoSelf {} { - ::c set p - ::c set p -} -C instproc readTwiceViaParameter {} { - my p - my p -} -C instproc readTwovarsViaInstvar {} { - my instvar p q - set p - set q -} -C instproc readTwovarsViaSetMethod {} { - my set p - my set q -} -C instproc readTwovarsViaSetMethodNoSelf {} { - ::c set p - ::c set q -} -C instproc readTwovarsViaParameter {} { - my p - my q -} - -C instproc instvarAlias {} { - my instvar {a b} - set b 1 - my exists a -} - - -C instproc explicitReturn {} { - return [set i 1] -} -C instproc implicitReturn {} { - set i 1 -} -C instproc explicitReturnFromVar {} { - set i 1 - return $i -} -C instproc implicitReturnFromVar {} { - set i 1 - set i -} - -C instproc childNodeNamespace {} { - Object [self]::13 -} -C instproc childNodeNamespaceCreate {} { - Object create [self]::13 -} -C instproc createVolatileRc {} { - Object new -volatile - return 2 -} - - -C c -Class D -superclass C -D instproc init args {} -D d - - - - - -Test new -cmd {d istype D} -expected 1 - -Test new -cmd {c setViaInstvar 100} -expected 100 -Test new -cmd {c setViaSetMethod 100} -expected 100 -Test new -cmd {c setViaParameter 100} -expected 100 - -Test new -cmd {c existsViaInstvar} -Test new -cmd {c existsViaMyInstvar} -Test new -cmd {c existsViaExistsMethod} -Test new -cmd {c existsViaMyExistsMethod} -Test new -cmd {c exists v} -Test new -cmd {c notExistsViaInstvar} -expected 0 -Test new -cmd {c notExistsViaExistsMethod} -expected 0 -Test new -cmd {c exists xxx} -expected 0 - -Test new -cmd {c existsAndReturnValue1} -expected 100 -Test new -cmd {c existsAndReturnValue3} -expected 100 - -Test new -cmd {c testAndSetViaInstvar 100} -expected 100 -Test new -cmd {c testAndSetViaSetMethod 100} -expected 100 - -Test new -cmd {c readViaInstvar} -expected 99 -Test new -cmd {c readViaSetMethod} -expected 99 -Test new -cmd {c readViaParameter} -expected 99 -Test new -cmd {c readViaSetMethodNoSelf} -expected 99 - -Test new -cmd {c readTwiceViaInstvar} -expected 99 -Test new -cmd {c readTwiceViaSetMethod} -expected 99 -Test new -cmd {c readTwiceViaParameter} -expected 99 -Test new -cmd {c readTwiceViaSetMethodNoSelf} -expected 99 - -Test new -cmd {c readTwovarsViaInstvar} -expected 98 -Test new -cmd {c readTwovarsViaSetMethod} -expected 98 -Test new -cmd {c readTwovarsViaParameter} -expected 98 -Test new -cmd {c readTwovarsViaSetMethodNoSelf} -expected 98 - -Test new -cmd {c instvarAlias} - -Test new -cmd {c incr v} -post {c set v 1} -expected 101 -Test new -cmd {c unset v; set r [c exists v]; c set v 1; set r} -expected 0 - -Test new -cmd {c explicitReturn} -Test new -cmd {c implicitReturn} -Test new -cmd {c explicitReturnFromVar} -Test new -cmd {c implicitReturnFromVar} - -Test new -cmd {c childNodeNamespace} -expected ::c::13 -Test new -cmd {c childNodeNamespaceCreate} -expected ::c::13 -Test new -cmd {c createVolatileRc} -expected 2 - -Test new -cmd {Object new -volatile} -expected ::xotcl::__\#F9 -count 2000 \ - -post {foreach o [Object info instances ::xotcl::__*] {$o destroy}} -Test new -cmd {Object new} -expected ::xotcl::__\#lQ -count 2000 \ - -post {foreach o [Object info instances ::xotcl::__*] {$o destroy}} -Test new -cmd {Object new -childof o} -expected ::o::__\#0Hh \ - -pre {Object o} -post {o destroy} - -Test new -count 1000 -pre {::set ::count 0} \ - -cmd {Object create [incr ::count]} \ - -expected ::1 \ - -post {::unset ::count} -Test new -count 1000 -pre {::set ::count 0} \ - -cmd {[incr ::count] destroy} \ - -post {::unset ::count} \ - -expected "" -Test new -cmd {Object create x} -expected ::x -Test new -cmd {Object create x -set a -1 -set b ,, -set c a--} \ - -expected ::x -Test new -cmd {expr {[c array names n 500] ne ""}} -Test new -cmd {info exists c::n(500)} -Test new -cmd {c exists n(500)} - -Test new -cmd {llength [c info children]} -expected 999 -Test new -cmd {c info children ::c::500} -expected ::c::500 -if {[info exists xotcl_version]} { - Test new -cmd {llength [Object info instances]} -expected 1001 -} else { - Test new -cmd {llength [Object info instances]} -expected 1007 -} - -Test new -cmd {Object info instances ::c::500} -expected ::c::500 - -Test new -count 100 -pre {set ::c::l ""} \ - -cmd {lappend ::c::l 1} \ - -post {c unset l} - -Test new \ - -count 100 \ - -cmd {c mixinappend M1} \ - -expected ::M1 \ - -post {c mixin ""} - -Test new \ - -count 100 \ - -cmd {c ma M1} \ - -expected ::M1 \ - -post {c mixin ""} - -Test new \ - -count 100 \ - -cmd {c mixinappend M1; c mixinappend M2} \ - -expected {::M1 ::M2} \ - -post {c mixin ""} - -Test new \ - -count 100 \ - -cmd {c ma M1; c ma M2} \ - -expected {::M1 ::M2} \ - -post {c mixin ""} - -Test new \ - -cmd {C instfilter f; C info instfilter} \ - -expected f \ - -post {C instfilter ""} - -Test new -pre {set s \#hallo} -cmd {string match "\#*" $s} -Test new -pre {set s \#hallo} -cmd {regexp {^\#} $s} -Test new -pre {set s \#hallo} -cmd {expr {[string first "\#" $s] == 0}} -Test new -pre {set s \#hallo} -cmd {expr {[string range $s 0 0] == "\#"}} - -Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a} $s} -Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a.*o} $s} -Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s} -Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s _} -Test new -pre {set s \#hallo} -cmd {regexp {^\#.*a(.*)o} $s _ out} - -Test new -msg {call proc of subobject directly} \ - -pre {C c2; C c2::o; c2::o proc f a {incr a}} \ - -cmd {c2::o::f 10} -expected 11 -count 5000 \ - -post {c2 destroy} -Test new -msg {call proc of subobject via dispatch} \ - -pre {C c2; C c2::o; c2::o proc f a {incr a}} \ - -cmd {c2::o f 10} -expected 11 -count 5000 \ - -post {c2 destroy} -Test new -msg {call proc of object and subobject via dispatch} \ - -pre {C c2; C c2::o; c2::o proc f a {incr a}} \ - -cmd {c2 o f 10} -expected 11 -count 5000 \ - -post {c2 destroy} - -Test new -msg {dispatch subobject directy via [self]} \ - -pre {C c2; C c2::o; c2::o proc f a {incr a}; c2 proc t a {[self]::o f $a}} \ - -cmd {c2 t 12} -expected 13 -count 5000 \ - -post {c2 destroy} -Test new -msg {dispatch subobject via my} \ - -pre {C c2; C c2::o; c2::o proc f a {incr a}; c2 proc t a {my o f $a}} \ - -cmd {c2 t 12} -expected 13 -count 5000 \ - -post {c2 destroy} - - -###### insttclcmd tests -set cnt 10000 -#Test new -msg {call insttclcmd (append) and check created variable} \ - -pre {Object o} \ - -cmd {o append X 1; o exists X} -expected 1 \ - -post {o destroy} -#Test new -msg {call tclcmd (regexep) and check created variable} \ - -pre {Object o; o tclcmd regexp} \ - -cmd {o regexp (a) a _ x; o exists x} -expected 1 -count $cnt \ - -post {o destroy} -Test new -msg {call forwarder for (append) and check created variable} \ - -pre {Object o; o forward append -objscope} \ - -cmd {o append X 1; o exists X} -expected 1 \ - -post {o destroy} -Test new -msg {call forwarder (regexep) and check created variable} \ - -pre {Object o; o forward regexp -objscope} \ - -cmd {o regexp (a) a _ x; o exists x} -expected 1 -count $cnt \ - -post {o destroy} -Test new -msg {call forwarder to another obj} \ - -pre {Object o; Object t; o forward set t set; t set x 100} \ - -cmd {o set x} -expected 100 -count $cnt \ - -post {o destroy} - -set cnt 100000 -Test new -msg {call handcoded incr} \ - -pre {Class C; C create o; o set x 1} \ - -cmd {o incr x 77} -expected 78 -count $cnt \ - -post {o destroy} -Test new -msg {call incr via instforward} \ - -pre {Class C; C instforward ::incr -objscope; C create o; o set x 1} \ - -cmd {o incr x 77} -expected 78 -count $cnt \ - -post {o destroy} -Test new -msg {call incr via forward} \ - -pre {Class C; C create o; o forward ::incr -objscope; o set x 1} \ - -cmd {o incr x 77} -expected 78 -count $cnt \ - -post {o destroy} -set cnt 10000 -Test new -msg {call obj with namespace via forward} \ - -pre {Object n; Object n::x; Object o -forward ::n::x} \ - -cmd {o x self} -expected ::n::x -count $cnt \ - -post {o destroy} -Test new -msg {call obj with namespace via instforward} \ - -pre {Object n; Object n::x; Class C; C create o; C instforward ::n::x} \ - -cmd {o x self} -expected ::n::x -count $cnt \ - -post {o destroy} -Test new -msg {call obj with namespace via instforward and mixinclass} \ - -pre {Object n; Object n::x; Class M -instforward ::n::x; - Class C -instmixin M; C create o } \ - -cmd {o x self} -expected ::n::x -count $cnt \ - -post {o destroy} -Test new -msg {call obj with namespace via instforward and next from proc} \ - -pre { - Object n; Object n::x; - Class C -instforward ::n::x; - C create o -proc x args {next} } \ - -cmd {o x self} -expected ::n::x -count $cnt \ - -post {o destroy} -Test new -msg {call obj with namespace via instforward and next from instproc} \ - -pre { - Object n; Object n::x; - Class C -instforward ::n::x; - Class D -superclass C -instproc x args {next}; - D create o } \ - -cmd {o x self} -expected ::n::x -count $cnt \ - -post {o destroy} -Test new -msg {call obj with namespace via mixin and instforward and next} \ - -pre {Object n; Object n::x; - Class M -instforward ::n::x; - Class N -superclass M -instproc x args {next}; - Class C -instmixin N; C create o} \ - -cmd {o x self} -expected ::n::x -count $cnt \ - -post {o destroy} -Test new -msg {return -code break} \ - -pre {Class A -instproc br {} {return -code break}; A create a1} \ - -cmd {catch {a1 br}} -expected 3 -count 2 \ - -post {A destroy; a1 destroy} - - -Test run; exit - - - Index: xotcl/tests/testo.xotcl =================================================================== diff -u -N --- xotcl/tests/testo.xotcl (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/tests/testo.xotcl (revision 0) @@ -1,609 +0,0 @@ -# $Id: testo.xotcl,v 1.9 2007/08/14 16:38:27 neumann Exp $ -# -# Copyright 1993 Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -package require XOTcl -namespace import -force xotcl::* - -@ @File {description { - This is a class which provides regression test objects - for the OTcl derived features of the XOTcl - Language. - This script is based upon the test.tcl script of the OTcl distribution - and adopted for XOTcl. - } -} -# -# a meta-class for test objects, and a class for test suites -# - -Class TestSuite -@ Class TestSuite - -Class TestClass -superclass Class -@ Class TestClass { - description { - A meta-class for test objects. - } -} - -# -# check basic argument dispatch and unknown -# - -TestSuite objectdispatch - -objectdispatch proc run {{n 50}} { - Object adispatch - - adispatch proc unknown {m args} {eval list [list $m] $args} - adispatch proc cycle {l n args} { - if {$l>=$n} then {return ok} - set i [llength $args] - foreach a $args { - if {$a != $i} then { - error "wrong order in arguments: $l $n $args" - } - incr i -1 - } - incr l - - set ukn [eval [list [self]] $args] - if {$ukn != $args} then { - error "wrong order in unknown: $ukns" - } - eval [list [self]] [list [self proc]] [list $l] [list $n] [list $l] $args - } - - if {[catch {adispatch cycle 1 $n 1} msg]} then { - error "FAILED [self]: cycle: $msg" - } - - return "PASSED [self]" -} - -# -# examples from the workshop paper -# - -TestSuite paperexamples - -paperexamples proc example1 {} { - Object astack - - astack set things {} - - astack proc put {thing} { - my instvar things - set things [concat [list $thing] $things] - return $thing - } - - astack proc get {} { - my instvar things - set top [lindex $things 0] - set things [lrange $things 1 end] - return $top - } - - astack put bagel - astack get - astack destroy -} - -paperexamples proc example2 {} { - Class Safety - - Safety instproc init {} { - next - my set count 0 - } - - Safety instproc put {thing} { - my instvar count - incr count - next - } - - Safety instproc get {} { - my instvar count - if {$count == 0} then { return {empty!} } - incr count -1 - next - } - - Class Stack - - Stack instproc init {} { - next - my set things {} - } - - Stack instproc put {thing} { - my instvar things - set things [concat [list $thing] $things] - return $thing - } - - Stack instproc get {} { - my instvar things - set top [lindex $things 0] - set things [lrange $things 1 end] - return $top - } - - Class SafeStack -superclass {Safety Stack} - - SafeStack s - s put bagel - s get - s get - s destroy - - SafeStack destroy - Stack destroy - Safety destroy -} - -paperexamples proc run {} { - set msg {} - - if {[catch {my example1; my example2} msg] == "0"} then { - return "PASSED [self]" - } else { - error "FAILED [self]: $msg" - } -} - - -# -# create a graph of classes -# - -TestSuite classcreate - -classcreate proc factorgraph {{n 3600}} { - TestClass $n - - - for {set i [expr {$n/2}]} {$i>1} {incr i -1} { - if {($n % $i) == 0} then { - - # - # factors become subclasses, direct or indirect - # - - - if {[TestClass info instances $i] eq ""} then { - my factorgraph $i - $i superclass $n - } elseif {[$i info superclass $n] == 0} then { - - $i superclass [concat [$i info superclass] $n] - } - } - } -} - -classcreate proc run {} { - set msg {} - if {[catch {my factorgraph} msg] == "0"} then { - return "PASSED [self]" - } else { - error "FAILED [self]: $msg" - } -} - - -# -# lookup superclasses and combine inherited methods -# - -TestSuite inheritance - -inheritance proc meshes {s l} { - set p -1 - foreach j $s { - set n [lsearch -exact $l $j] - if {$n == -1} then { - error "FAILED [self] - missing superclass" - } - if {$n <= $p} then { - error "FAILED [self] - misordered heritage: $s : $l" - } - set p $n - } -} - -inheritance proc superclass {} { - foreach i [TestClass info instances] { - set s [$i info superclass] - set h [$i info heritage] - - # - # superclasses should mesh with heritage - # - - my meshes $s $h - } -} - -inheritance proc combination {} { - foreach i [lsort [TestClass info instances]] { - # - # combination should mesh with heritage - # - - $i anumber - set obj [lrange [anumber combineforobj] 1 end] - set h [$i info heritage] - my meshes $obj $h - anumber destroy - - if {[$i info procs combineforclass] ne ""} then { - set cls [lrange [$i combineforclass] 1 end] - my meshes $cls $h - } - } -} - -inheritance proc run {} { - - # - # add combine methods to "random" half of the graph - # - - set t [TestClass info instances] - for {set i 0} {$i < [llength $t]} {incr i 2} { - set o [lindex $t $i] - $o instproc combineforobj {} { - return [concat [list [self class]] [next]] - } - $o proc combineforclass {} { - return [concat [list [self class]] [next]] - } - } - - # - # and to Object as a fallback - # - - Object instproc combineforobj {} { - return [concat [list [self class]] [next]] - } - Object proc combineforclass {} { - return [concat [list [self class]] [next]] - } - - my superclass - my combination - - return "PASSED [self]" -} - - -# -# destroy graph of classes -# - -TestSuite classdestroy - -classdestroy proc run {} { - - # - # remove half of the graph at a time - # - - TestClass instproc destroy {} { - global TCdestroy - set TCdestroy [self] - next - } - while {[TestClass info instances] ne ""} { - set t [TestClass info instances] - for {set i 0} {$i < [llength $t]} {incr i} { - set o [lindex $t $i] - # - # quarter dies directly, quarter indirectly, quarter renamed - # - - if {($i % 2) == 0} then { - global TCdestroy - set sb [$o info subclass] - - if {[info tclversion] >= 7.4 && ($i % 4) == 0} then { - $o move "" - } else { - $o destroy - } - if {[catch {set TCdestroy}] || $TCdestroy != $o} then { - error "FAILED [self] - destroy instproc not run for $o" - } - if {[info commands $o] ne ""} then { - error "FAILED [self] - $o not removed from interpreter" - } - unset TCdestroy - - # - # but everyone must still have a superclass - # - foreach j $sb { - if {[$j info superclass] eq ""} then { - $j superclass Object - } - } - } elseif {[info tclversion] >= 7.4 && ($i % 3) == 0} then { - $o move $o.$i - } - - } - - inheritance superclass - inheritance combination - } - - return "PASSED [self]" -} - - -TestSuite objectinits - -objectinits proc prepare {n} { - - # - # head of a chain of classes that do add inits - # - - TestClass 0 - 0 instproc init {args} { - next - my set order {} - } - - # - # and the rest - # - - for {set i 1} {$i < $n} {incr i} { - TestClass $i -superclass [expr {$i-1}] - - # - # record the reverse order of inits - # - - $i instproc init {args} { - eval next $args - my instvar order - lappend order [namespace tail [self class]] - } - - # - # add instproc for init options - # - - $i instproc m$i.set {val} { - my instvar [namespace tail [self class]] - set [namespace tail [self class]] [self proc].$val - } - } -} - -objectinits proc run {{n 15}} { - my prepare $n - - set il {} - for {set i 1} {$i < $n} {incr i} { - lappend il $i - set al {} - set args {} - for {set j $i} {$j > 0} {incr j -1} { - lappend al $j - lappend args -m$j.set $j - - # - # create obj of increasing class with increasing options - # - if {[catch {eval $i m$i.$j $args} msg] != 0} then { - error "FAILED [self] - $msg" - } - if {[m$i.$j set order] != $il} then { - error "FAILED [self] - inited order was wrong" - } - set vl [lsort -decreasing -integer [m$i.$j info vars {[0-9]*}]] - - if {$vl != $al} then { - error "FAILED [self] - wrong instvar names: $vl : $al" - } - foreach k $vl { - if {[m$i.$j set $k] != "m$k.set.$k"} then { - error "FAILED [self] - wrong instvar values" - } - } - } - } - - return "PASSED [self]" -} - - -TestSuite objectvariables - -objectvariables proc run {{n 100}} { - TestClass Variables - Variables avar - - foreach obj {avar Variables TestClass xotcl::Class xotcl::Object} { - - # - # set up some variables - # - $obj set scalar 0 - $obj set array() {} - $obj unset array() - $obj set unset.$n {} - - # - # mess with them recursively - # - - $obj proc recurse {n} { - my instvar scalar array - incr scalar - set array($n) $n - my instvar unset.$n - unset unset.$n - incr n -1 - my instvar unset.$n - set unset.$n [array names array] - if {$n > 0} then { - my recurse $n - } - } - - $obj recurse $n - - # - # check the result and clean up - # - - if {[$obj set scalar] != $n} then { - error "FAILED [self] - scalar" - } - - $obj unset scalar - - for {set i $n} {$i > 0} {incr i -1} { - if {[$obj set array($i)] != $i} then { - error "FAILED [self] - array" - } - } - $obj unset array - if {[$obj info vars "unset.0"] eq ""} then { - error "FAILED [self] - unset: [$obj info vars]" - } - } - - # - # trace variables - # - Variables avar2 - - avar2 proc trace {var ops} { - my instvar $var - ::trace variable $var $ops "avar2 traceproc" - } - - avar2 proc traceproc {maj min op} { - set majTmp [namespace tail "$maj"] - global trail; lappend trail [list $majTmp $min $op] - } - - avar2 proc killSelf {} { - my destroy - } - - global guide trail - set trail {} - set guide {} - avar2 trace array wu - - for {set i 0} {$i < $n} {incr i} { - - avar2 trace scalar$i wu - avar2 set scalar$i $i - lappend guide [list scalar$i {} w] - avar2 set array($i) [avar2 set scalar$i] - lappend guide [list array $i w] - } - - - if {$guide != $trail} then { - error "FAILED [self] - trace: expected $guide, got $trail" - } - - # - # destroy must trigger unset traces - # - set trail {} - set guide {} - lappend guide [list array {} u] - for {set i 0} {$i < $n} {incr i} { - lappend guide [list scalar$i {} u] - } - - avar2 killSelf - - if {[lsort $guide] != [lsort $trail]} then { - error "FAILED [self] - trace: expected $guide, got $trail" - } - - Variables destroy - - return "PASSED [self]" -} - - -# -# c api, if compiled with -DTESTCAPI -# - -TestSuite capi - -capi proc run {{n 50}} { - set start [dawnoftime read] - for {set i 0} {$i < $n} {incr i} { - Timer atime$i - if {$i % 3} {atime$i stop} - if {$i % 7} {atime$i read} - if {$i % 2} {atime$i start} - if {$i % 5} {atime$i stop} - } - set end [dawnoftime read] - if {$end < $start} { - error "FAILED [self]: timer doesn't work" - } - - foreach i [Timer info instances] {$i destroy} - Timer destroy - - return "PASSED [self]" -} - - - -TestSuite proc run {} { - # - # run individual tests in needed order - # - puts [objectdispatch run] - puts [paperexamples run] - puts [classcreate run] - puts [inheritance run] - puts [classdestroy run] - puts [objectinits run] - puts [objectvariables run] - if {[info commands Timer] ne ""} then { - puts [capi run] - } -# puts [autoload run] - -} - -puts [time {TestSuite run} 1] - -#exit - -# Local Variables: -# mode: tcl -# tcl-indent-level: 2 -# End: - Index: xotcl/tests/testx.xotcl =================================================================== diff -u -N --- xotcl/tests/testx.xotcl (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/tests/testx.xotcl (revision 0) @@ -1,3988 +0,0 @@ -#$Id: testx.xotcl,v 1.36 2007/10/12 19:53:32 neumann Exp $ -package require XOTcl -namespace import -force xotcl::* - -proc ::errorCheck {got expected msg} { - if {$got != $expected} { - puts stderr "[self] FAILED: $msg\nGot: $got\nExpected: $expected" - foreach g $got e $expected { - set result [expr {$g == $e}] - if {[string length $g]>60} { - puts "$result g='$g'\n e='$e'" - } else { - puts "$result g='$g' e='$e'" - } - } - exit -1 - } -} - -proc ::cutSpaces {string} { - regsub -all " " $string "" result - regsub -all "\n" $result " " result - return $result -} - - -Class TestX \ - -instmixin [Class TestXM -instproc run args {next; puts "[self] PASSED"}] - -@ @File {description { - This is a file which provides a regression test - for the features of the XOTcl - Language. - } -} -@ Class TestX - -@ TestX nestingClasses { - description {Regression test object testing the class nesting feature.} -} -TestX nestingClasses -proc run {{n 20}} { - for {set i 0} {$i < $n} {incr i} { - Class x($i) - - Class x($i)::y - ::errorCheck [x($i) info commands y] "y" " -- creating Nested Class " - Class x($i)::z - Class x($i)::z::t - Class x($i)::t - ::errorCheck [x($i) info classchildren] "::x($i)::t ::x($i)::y ::x($i)::z" \ - "info classchildren" - ::errorCheck [x($i)::z info classparent] "::x($i)" \ - "info classparent" - - - ::errorCheck [x($i) info commands t] "t" \ - "-- MakeClass " - - x($i) a - x($i)::z a - x($i)::z::t a - x($i)::z::t move x($i)::z::rt - x($i)::z::rt a - ::errorCheck [x($i)::z info commands rt] "rt" \ - "renaming leaf " - - x($i)::z move x($i)::rz - - ::errorCheck [x($i) info commands rz] "rz" \ - "renaming node (node itself)" - - ::errorCheck [x($i)::rz info commands rt] "rt" \ - "renaming node (leaf in node)" - - ::errorCheck [x($i)::rz info classchildren] "::x($i)::rz::rt" \ - "info classchildren (2)" - ::errorCheck [x($i)::rz::rt info classparent] "::x($i)::rz" \ - "info classparent (2)" - - x($i) move rx - ::errorCheck [rx info commands rz] "rz" \ - "renaming root " - ::errorCheck [info commands rx] "rx" \ - "renaming root " - rx destroy - } -} - -@ TestX nestingObjects { - description {Regression test object testing the object nesting feature.} -} -TestX nestingObjects -proc run {{n 20}} { - for {set i 0} {$i < $n} {incr i} { - Class C($i) - - C($i) instproc testinstproc {} { - return - } - C($i) o - o proc testproc {} { - return - } - o testproc; o testinstproc - C($i) o::y - ::errorCheck [o info commands y] y "creating Nested Object " - C($i) o::z - C($i) o::z::t - C($i) o::t - - ::errorCheck [o info children] "::o::t ::o::y ::o::z" "info children" - ::errorCheck [o::t info parent] "::o" "info parent" - - ::errorCheck [o info commands t] t "MakeObject" - o::z::t move o::z::rt - ::errorCheck [o::z info commands rt] rt "renaming leaf" - o::z move o::rz - ::errorCheck [o::rz info commands rt] rt "renaming node" - ::errorCheck [o info commands rz] rz "renaming node" - o move rx - ::errorCheck [rx info commands rz] rz "renaming root " - ::errorCheck [info commands rx] rx "renaming root" - rx destroy - C($i) destroy - - Class A - A instproc x {a1 args} { - my set var $a1 - } - A a - A a::n -x "1 2 3" - ::errorCheck [::a::n set var] "1 2 3" "arg passing - init dash" - } -} - -@ TestX assertions { - description {Regression test object testing the assertions.} - } -TestX assertions -proc run {{n 20}} { - for {set i 0} {$i < $n} {incr i} { - Class C($i) - C($i) invar { - {$a > 2} {$c < 3} {$d > 5} - {#a} {#b} - } - C($i) instinvar { - {$a > 2} {$c < 3} {$d > 5} - {#a} {#b} - } - - ::errorCheck [C($i) info invar] {{$a > 2} {$c < 3} {$d > 5} {#a} {#b}} \ - "Class invar " - - ::errorCheck [C($i) info invar] {{$a > 2} {$c < 3} {$d > 5} {#a} {#b}} \ - "Class instinvar " - - Object b($i) - - b($i) invar { - {$a > 2} {$c < 3} {$d > 5} - {#a} {#b} - } - ::errorCheck [C($i) info invar] {{$a > 2} {$c < 3} {$d > 5} {#a} {#b}} \ - "Object invar " - - b($i) proc p {a b c} { - return p - } {pre1 pre2 pre3} {post1 post2 post3} - - ::errorCheck [b($i) info pre p] {{pre1} {pre2} {pre3}} \ - "Obj proc pre assertion " - ::errorCheck [b($i) info post p] {{post1} {post2} {post3}} \ - "Obj proc post assertion " - C($i) instproc p {a b c} { - return p - } {} {post1 post2 post3} - - ::errorCheck [C($i) info instpre p] "" \ - "CL proc pre assertion " - ::errorCheck [C($i) info instpost p] {{post1} {post2} {post3}} \ - "CL proc post assertion " - - C(0) set a 3; C(0) set c 2; C(0) set d 7; C(0) set f 50; - C(0) check all - C(0) proc checkit {} { - C(0) instvar a c d f - ::errorCheck [my info check] {invar instinvar pre post} \ - "check options != all" - # turn obj-invar off - C(0) check {pre post instinvar} - C(0) set c 10 - ::errorCheck [my info check] {instinvar pre post} \ - "check options != instinvar pre post" - } {{$f > 10}} {{$f < 100}} - C(0) checkit - } - for {set i 0} {$i < $n} {incr i} { - b($i) destroy - C($i) destroy - } - - Object b - b proc p {a b c} { - return p - } {pre1 pre2 pre3} {post1 post2 post3} - ::rename b a - ::errorCheck [a info pre p] {{pre1} {pre2} {pre3}} \ - "Obj proc pre assertion " - ::errorCheck [a info post p] {{post1} {post2} {post3}} \ - "Obj proc post assertion " - - - Class Sensor -parameter {{value 1}} - Sensor instinvar { - {[regexp {^[0-9]$} [my value]] == 1} - } - Sensor s - s check all - - Sensor instproc x {} { - s value - } { - {[regexp {^[0-9]$} [my value]] == 1} - } {} - s x - s value - - # inheritance - - Class A -parameter {{x 1} {y 1}} - - A instinvar {{$x == 1}} - - A instproc xTo2 args { - my set x 2 - } - A instproc yTo2 args { - my set y 2 - } {} {{$y == 1}} - A a -check all - - if {![catch {a xTo2} err]} { - set err "ok" - } else { - a check {} - a set x 1 - a check all - } - ::errorCheck $err {Assertion failed check: {$x == 1} in proc 'xTo2'} \ - "inheritance a xTo2" - - if {![catch {a yTo2} err]} { - set err "ok" - } - ::errorCheck $err {Assertion failed check: {$y == 1} in proc 'yTo2'} \ - "inheritance a yTo2" - - Class B -superclass A - B b -check all - - if {![catch {b xTo2} err]} { - set err "ok" - } else { - b check {} - b set x 1 - b check all - } - ::errorCheck $err {Assertion failed check: {$x == 1} in proc 'xTo2'} \ - "inheritance b xTo2" - - if {![catch {b yTo2} err]} { - set err "ok" - } - ::errorCheck $err {Assertion failed check: {$y == 1} in proc 'yTo2'} \ - "inheritance b yTo2" -} - -@ TestX filterAddRemove { - description {Regression test object testing adding/removing of filters.} -} -TestX filterAddRemove -proc run {{n 20}} { - set ::filterCount 0 - for {set i 0} {$i < $n} {incr i} { - Class SA($i) - Class SB($i) - Class SC($i) -superclass [list SB($i) SA($i)] - SA($i) instproc fa args { - incr ::filterCount - my set x 150 - return "[next]-[self class]::[self proc]" - } - SA($i) instproc f2 args { - incr ::filterCount - my set x 150 - return "[next]-[self class]::[self proc]" - } - SB($i) instproc f2 args { - incr ::filterCount - my set x 150 - return "[next]-[self class]::[self proc]" - } - SB($i) instproc fb args { - incr ::filterCount - my set x 150 - return "[next]-[self class]::[self proc]" - } - SC($i) instproc fc args { - incr ::filterCount - my set x 150 - return "[next]-[self class]::[self proc]" - } - SC($i) instfilter fc - SB($i) instfilter {fb f2} - SA($i) instfilter {fa f2} - Class T - T proc s {} { return } - Class Filtered${i} -superclass SC($i) - Filtered${i} instproc testfilter args { - incr ::filterCount - T s - return "[next]-[self class]::[self proc]" - } - Filtered${i} instfilter testfilter - Filtered${i} instproc a args { - return "in a" - } - Filtered${i} f${i} - set erg [f${i} a] - ::errorCheck $erg \ - "in a-::SA(${i})::f2-::SA(${i})::fa-::SB(${i})::f2-::SB(${i})::fb-::SC(${i})::fc-::Filtered${i}::testfilter" \ - "Filter Test - add" - SC($i) instfilter {} - SB($i) instfilter fb - SA($i) instfilter {} - set erg [f${i} a] - ::errorCheck $erg "in a-::SB(${i})::fb-::Filtered${i}::testfilter" \ - "Filter Test - remove" - - f${i} proc procFilter args { - return "[next]-[self class]::[self proc]" - } - f${i} filter {fa f2 procFilter} - - - set erg [f${i} a] - ::errorCheck $erg "in a-::SB(${i})::fb-::Filtered${i}::testfilter-::procFilter-::SB(${i})::f2-::SA(${i})::fa" \ - "Obj Filter Test call three filter + instfilter" - - ::errorCheck "[f${i} info filter]-[SB($i) info instfilter]-[SC($i) info instfilter]" \ - "fa f2 procFilter-::SB(${i})::fb-::Filtered${i}::testfilter-::procFilter-::SB(${i})::f2-::SA(${i})::fa-fb-"\ - "filter infos" - - ::errorCheck [f${i} filtersearch fa]-[f${i} filtersearch fb]-[f${i} filtersearch procFilter] "::SA(${i}) instproc fa-::SB(${i})::fb-::Filtered${i}::testfilter-::procFilter-::SB(${i})::f2-::SA(${i})::fa-::SB(${i}) instproc fb-::SB(${i})::fb-::Filtered${i}::testfilter-::procFilter-::SB(${i})::f2-::SA(${i})::fa-::f${i} proc procFilter-::SB(${i})::fb-::Filtered${i}::testfilter-::procFilter-::SB(${i})::f2-::SA(${i})::fa" "filtersearch" - - Filtered${i} instfilter {} - SB($i) instfilter {} - set erg [f${i} a] - - ::errorCheck $erg "in a-::procFilter-::SB(${i})::f2-::SA(${i})::fa" \ - "only obj filter" - - f${i} filter {} - set erg [f${i} a] - ::errorCheck $erg "in a" \ - "obj filter remove" - } - for {set i 0} {$i < $n} {incr i} { - SA($i) destroy - SB($i) destroy - SC($i) destroy - } - - ::errorCheck $::filterCount 960 \ - "Filter Test - Filter Count -- Got: $::filterCount" - - # - # instvar test - # - - Object o - o set x 1 - Object o1 - o1 set x 11 - Object o2 - o2 proc t {} { - # multiple imports for existing (x) and not existing vars (y) - o instvar x y - append result "x: $x " - append result "y: ie [info exists y] me [my exists y] " \ - "iv '[info vars y]' oe [o exists y] oiv '[o info vars y]' // " - set y 100 - append result "y: ie [info exists y] me [my exists y] " \ - "iv '[info vars y]' oe [o exists y] oiv '[o info vars y]'" - ::errorCheck $result \ - "x: 1 y: ie 0 me 0 iv 'y' oe 0 oiv '' // y: ie 1 me 0 iv 'y' oe 1 oiv 'y'" \ - "instvar test 1 failed" - set result "" - o1 instvar x y - append result "x: $x " - append result "y: ie [info exists y] me [my exists y] " \ - "iv '[info vars y]' oe [o1 exists y] oiv '[o1 info vars y]' // " - set y 101 - append result "y: ie [info exists y] me [my exists y] " \ - "iv '[info vars y]' oe [o1 exists y] oiv '[o1 info vars y]'" - ::errorCheck $result \ - "x: 11 y: ie 0 me 0 iv 'y' oe 0 oiv '' // y: ie 1 me 0 iv 'y' oe 1 oiv 'y'" \ - "instvar test 2 failed" - } - o2 t - - o destroy - o1 destroy - o2 destroy - - global filterResult - set filterResult "" - Object a - a set o 12 - a set p 13 - Class A - A set m 14 - - Object instproc f args { - global filterResult - a instvar o p - A instvar m - ::append filterResult " [self] [self calledproc] [self callingproc]" - ::append filterResult " $o $p $m" - next - } - - proc x {} { - set ::a::e xxx - } - - Object instfilter f - - x - ::errorCheck $::a::e xxx \ - "filterAddRemove: instvar test -- proc set failed" - a set e yyy - - ::errorCheck $::a::e yyy \ - "filterAddRemove: instvar test -- obj set failed" - - ::errorCheck $filterResult " ::A instvar f 12 13 14 ::a set run 12 13 14" \ - "filterAddRemove: instvar test -- instvar filter failed" - - Object instfilter "" - - Object instproc f args { - next - } - Object instfilter f - - ::errorCheck [Object o] "::o" \ - "filterAddRemove: Object creation with filter" - - # This produces a bug, if not - # RUNTIME_STATE(in)->returnCode = TCL_OK; - # in ObjDispatch -> UNKNOWN handling */ - # abrupt stop of program because result is set to XOTCL_UNKNOWN - # instead of TCL_ERROR, as it should be - catch {puts ${ZZZZZZZZZZZZZZZ::ZZZZZ}} - - o set r 43 - - ::errorCheck [o set r] "43" \ - "filterAddRemove: Object creation with filter: setting var" - - Object instfilter "" - - # test for CmdListReplaceCmd - set ::r "" - Class A - A instproc f2 args {lappend ::r [self class]-[self proc]; next} - Class C -superclass A - Class D -superclass C - D instfilter {f2} - D d - d filter {f2} - C instproc f2 args {lappend ::r [self class]-[self proc]; next} - set ::r "" - d set r 1 - - ::errorCheck $::r "::C-f2 ::A-f2" \ - "filter method addition" - - o proc m {} { - } - o proc f args { - my incr count - next - } - o set count 0 - o filter f - o m - ::errorCheck [o set count] 2 "filter count" - o filter "" - set filterstate [::xotcl::configure filter off] - o set count 0 - o m - ::errorCheck [o set count]-$filterstate 0-1 "filter off + old state" - o filter "" - ::xotcl::configure filter on - - set ::r "" - Object instproc f args { - set r [next] - lappend ::r [self]-[self calledproc] - return $r - } - - Class D - D filter f - D d1 - ::errorCheck $::r "::D-d1 ::D-alloc ::D-create ::D-unknown" "filter state after next" - -} - -@ TestX filterClassChange { - description {Regression test object testing class changes of filters.} -} -TestX filterClassChange -proc run {{n 20}} { - for {set i 0} {$i < $n} {incr i} { - Class A($i) - Class B - - A($i) instproc f args { - set result pre*[self]*[self proc]*$args - lappend result [next] post*[self]*[self proc] - return $result - } - - A($i) o($i) - o($i) proc change {} { - my class B - } - o($i) proc call {} { - return in-call - } - - A($i) instfilter f - - set erg [o($i) call] - ::errorCheck $erg "pre*::o($i)*f* in-call post*::o($i)*f" \ - "Filter Class Change -- Call before change" - o($i) change - - set erg [o($i) call] - ::errorCheck $erg "in-call" \ - "Filter Class Change -- Call after change" - # testing deleting a filter proc - Class F - F instproc testf args {return filtered} - F instfilter testf - F f1 - ::errorCheck [f1 set r 45] "filtered" "Deleting a filter proc ... before" - F instproc testf {} {} - ::errorCheck [f1 set r 45] "45" "Deleting a filter proc ... after" - - # testing remove a superclass - Class F1 - Class F2 -superclass F1 - Class F3 -superclass F2 - - F1 instproc testf args {return [next]-filtered} - F2 instproc testf2 args {return [next]-filtered} - F3 instfilter {testf testf2} - F3 f2 - - ::errorCheck [f2 filtersearch testf2] "::F2 instproc testf2-filtered-filtered" "filtersearch 2" - - ::errorCheck [f2 set r 45] "45-filtered-filtered" \ - "Removing a superclass ... before" - F3 superclass [F1 info superclass] - ::errorCheck [f2 filtersearch testf2] "" "filtersearch 2 after" - ::errorCheck [f2 set r 45] "45" "Class F2 removed from classtree ... after" - } - B destroy - for {set i 0} {$i < $n} {incr i} {A($i) destroy} -} - -@ TestX filterGuards { - description {Regression test object testing filter guards.} -} -TestX filterGuards -proc run {{n 20}} { - global filterResult - - for {set i 0} {$i < $n} {incr i} { - set ::filterResult "" - Class A - A instproc f2 args { - global filterResult - append filterResult "-[self]-[self proc]-[self class]-[self calledproc]" - next - } - Class B -superclass A - B instproc f1 args { - global filterResult - append filterResult "-[self]-[self proc]-[self class]-[self calledproc]" - next - } - B instproc f3 args { - global filterResult - append filterResult "-[self]-[self proc]-[self class]-[self calledproc]" - next - } - - B instfilter {{f1 -guard "1<0"}} - B b - ::errorCheck $filterResult "" "Filter guard: Filter never to be applied" - - b destroy - - A instproc f1 args { - global filterResult - append filterResult "-[self]-[self proc]-[self class]-[self calledproc]" - next - } - set filterResult "" - B b - ::errorCheck $filterResult "" \ - "Filter guard: Filter never to be applied + filter inheritance on this filter" - # filter w/o guard -> has to be applied - A instfilter f1 - b destroy - set filterResult "" - B b - ::errorCheck $filterResult "-::b-f1-::A-configure-::b-f1-::A-init" \ - "Filter guard: two different filters, same name + different class, one guarded, one not" - - # two filter w/o guard -> both have to be applied - B instfilter f1 - b destroy - set filterResult "" - B b - ::errorCheck $filterResult "-::b-f1-::B-configure-::b-f1-::A-configure-::b-f1-::B-init-::b-f1-::A-init" \ - "Filter guard: two different filters, both not guarded anymore" - - # three filters with guards, not to be applied, in one chain - b destroy - A instfilter {} - B instfilter {{f1 -guard {0}} {f3 -guard {0}} {f2 -guard {0}}} - set filterResult "" - B b - ::errorCheck $filterResult "" "Filter guard: three filters in one chain" - - # three times the same filter --> guards are and-combined - set filterResult "" - B instfilter {{f2 -guard {[self calledproc] eq "set" || [self] == "::b2"}}} - A instfilter {{f2 -guard {[self] == "::b2"}}} - B b1 - - B b2 - if {$i == 0} { - ::errorCheck $filterResult "-::b2-f2-::A-configure-::b2-f2-::A-init" \ - "Filter guard: creation with less restrictive guards" - } else { - ::errorCheck $filterResult "-::b2-f2-::A-cleanup-::b2-f2-::A-configure-::b2-f2-::A-init" \ - "Filter guard: creation with less restrictive guards (b)" - } - set filterResult "" - b1 set x 45 - ::errorCheck $filterResult "-::b1-f2-::A-set" \ - "Filter guard: setting restricted object" - - set filterResult "" - b1 info class - ::errorCheck $filterResult "" \ - "Filter guard: info restricted object (no guard applies)" - - set filterResult "" - b2 info class - ::errorCheck $filterResult "-::b2-f2-::A-info" \ - "Filter guard: setting restricted object (2nd guard applies)" - - b1 filter {{f2 -guard {[self calledproc] eq "info"}}} - - set filterResult "" - b1 proc a {} { - # - } - ::errorCheck $filterResult "" \ - "Filter guard: proc on restricted object (no guard applies)" - - set filterResult "" - b1 info class - ::errorCheck $filterResult "-::b1-f2-::A-info" \ - "Filter guard: info filtered by object filter guard" - - - # checking infos - ::errorCheck [b1 info filterguard f2]-[B info instfilterguard f2]-[A info instfilterguard f2] \ - {[self calledproc] eq "info"-[self calledproc] eq "set" || [self] == "::b2"-[self] == "::b2"} \ - "Filter guard: info filtered by object filter guard" - - # checking info -guards option - Class A - A instproc f1 args {next} - A instproc fx args {next} - Class B -superclass A - B instproc f1 args {next} - B instproc f2 args {next} - B b - B instfilter {{f1 -guard {[self] eq "::b"}} {f2 -guard 0} f1} - b filter {{f1 -guard {[self] eq "::b"}} {f2 -guard 0}} - - ::errorCheck [B info instfilter]-[B info instfilter -guards]-[b info filter]-[b info filter -guards] \ - {f1 f2-f1 {f2 -guard 0}-f1 f2-{f1 -guard {[self] eq "::b"}} {f2 -guard 0}}\ - {[self] -- Filter guard: -guards option} - - A instfilter {f1 fx} - A a - a proc x args {next} - a filter x - - ::errorCheck [b info filter -order]-[a info filter -order] "{::B instproc f1} {::B instproc f2} {::A instproc f1} {::A instproc fx}-{::a proc x} {::A instproc f1} {::A instproc fx}" \ - {[self] -- Filter guard: -order option} - - ::errorCheck [b info filter -order -guards]-[a info filter -order -guards] {{f1 -guard {[self] eq "::b"}} {f2 -guard 0} f1 fx-x f1 fx} \ - {[self] -- Filter guard: -order -guards options} - - - Class Foo - Foo instproc init {args} {my set bar hello} - Foo instproc baz {args} { - my instvar bar - return $bar - } - Foo instproc myFilter {args} { - lappend ::r myFilter->[self calledproc] - my set r 4 - next - } - Foo instfilter myFilter - Foo instfilterguard myFilter { ([self calledproc] eq "baz") } - Foo instfilterguard myFilter { ([self calledproc] eq "baz") } - set f [Foo new] - $f baz - ::errorCheck [$f baz] "hello" {Filter guard from method call} - Foo instfilterguard myFilter {} - - set ::r "" - Foo create f - f filter myFilter - f filterguard myFilter { ([self calledproc] eq "baz") } - lappend ::r [f baz] [f set r 1] - f filterguard myFilter {} - lappend ::r [f baz] [f set r 1] - ::errorCheck $::r [list myFilter->configure myFilter->init \ - myFilter->set myFilter->filter \ - myFilter->filterguard myFilter->baz \ - hello 1 myFilter->baz \ - myFilter->instvar myFilter->set hello 1] \ - {Filter guard from method call} - f destroy - - Class Room - Room instproc open {} {lappend ::r [self proc]} - Room instproc x {} {lappend ::r [self proc]} - Room instproc loggingFilter args { - lappend ::r [self proc]-[self calledproc] - next - } - Room instproc callsMethod {method calledproc} { - return [string match $calledproc $method] - } - Room instproc callsLevel2 {} { - set level [self guardedlevel] - lappend ::r $level - set calledproc [uplevel $level self calledproc] - lappend ::r $calledproc - } - Room instfilter loggingFilter - Room instfilterguard loggingFilter {[my callsMethod open [self calledproc]]} - - Room r - - set ::r "" - - r open - r x - - ::errorCheck $::r "loggingFilter-open open x" {info guarded scope} - } -} - - -@ TestX mixinGuards { - description {Regression test object testing mixin guards.} -} -TestX mixinGuards -proc run {{n 20}} { - set ::r "" - Class Fly - Fly instproc fly {} {lappend ::r "[my signature]: yippee, fly like an eagle!"} - - Class Sing - Sing instproc sing {} {lappend ::r "[my signature]: what a difference a day make"} - - Class Animal -parameter age - Animal instproc unknown args { lappend ::r "[my signature]: how should i $args?"} - Animal instproc signature {} { - return "[self] [my info class] ([my age] years)" - } - - Class Bird -superclass Animal - Class Penguine -superclass Bird - Class Parrot -superclass Bird - Class Duck -superclass Bird - - Parrot tweedy -age 1 - Penguine pingo -age 5 - Duck donald -age 4 - Parrot lora -age 6 - - Bird instmixin {{Fly -guard {[my age]>2 && ![my istype Penguine]}} Sing} - - foreach bird {tweedy pingo donald lora} { $bird fly } - - ::errorCheck [set ::r] [list \ - {::tweedy ::Parrot (1 years): how should i fly?} \ - {::pingo ::Penguine (5 years): how should i fly?} \ - {::donald ::Duck (4 years): yippee, fly like an eagle!} \ - {::lora ::Parrot (6 years): yippee, fly like an eagle!}] \ - {Simple Instmixin Guard} - - set ::r "" - tweedy age 3 - pingo class Duck - lora class Penguine - foreach bird {tweedy pingo donald lora} { $bird fly } - - ::errorCheck [set ::r] [list \ - {::tweedy ::Parrot (3 years): yippee, fly like an eagle!} \ - {::pingo ::Duck (5 years): yippee, fly like an eagle!} \ - {::donald ::Duck (4 years): yippee, fly like an eagle!} \ - {::lora ::Penguine (6 years): how should i fly?}] \ - {Simple Instmixin Guard ... Class Change} - - set ::r "" - pingo mixin {{Fly -guard {[my age]>2}} Sing} - foreach i { - {Bird info instmixin -guards} - {pingo info mixin -guards} - {pingo info mixin -order -guards}} { - lappend ::r "$i [eval $i]" - } - - ::errorCheck [set ::r] [list \ - {Bird info instmixin -guards {::Fly -guard {[my age]>2 && ![my istype Penguine]}} ::Sing} \ - {pingo info mixin -guards {::Fly -guard {[my age]>2}} ::Sing} \ - {pingo info mixin -order -guards {::Fly -guard {[my age]>2}} ::Sing}] \ - {Simple Instmixin Guard ... Info} - - set ::r "" - Class POM-start - Class POM-end - Class PCM-start - Class PCM-end - pingo mixin {POM-start {Fly -guard {[my age]>2}} Sing POM-end} - Bird instmixin {PCM-start {Fly -guard {[my age]>2 && ![my istype Penguine]}} Sing PCM-end} - - pingo class Penguine - foreach i { - {Bird info instmixin -guards} - {pingo info mixin -guards} - {pingo info mixin -order -guards}} { - lappend ::r "$i [eval $i]" - } - - - ::errorCheck [set ::r] [list \ - {Bird info instmixin -guards ::PCM-start {::Fly -guard {[my age]>2 && ![my istype Penguine]}} ::Sing ::PCM-end} \ - {pingo info mixin -guards ::POM-start {::Fly -guard {[my age]>2}} ::Sing ::POM-end} \ - {pingo info mixin -order -guards ::POM-start ::POM-end ::PCM-start {::Fly -guard {[my age]>2}} ::Sing ::PCM-end}] \ - {Same Mixin Guard ... Info} - - set ::r "" - pingo fly - ::errorCheck [set ::r] [list \ - {::pingo ::Penguine (5 years): yippee, fly like an eagle!}] \ - {Same Mixin Guard ... most specific counts} - - - set ::r "" - Animal a -set age 20 - a mixin Fly - a mixinguard ::Fly {[my age] > 3} - a fly - lappend ::r [a info mixin -guards] - lappend ::r [a info mixin -order -guards] - a set age 2 - a fly - a mixinguard ::Fly {[my age] > 4} - a fly - set info "" - lappend info [a info mixinguard Fly] - lappend ::r [a info mixin -guards] - lappend ::r [a info mixin -order -guards] - a mixinguard ::Fly {} - a fly - lappend ::r [a info mixin -guards] - lappend info [a info mixinguard Fly] - lappend ::r [a info mixin -order -guards] - ::errorCheck [set ::r] [list \ - {::a ::Animal (20 years): yippee, fly like an eagle!} \ - {{::Fly -guard {[my age] > 3}}} {{::Fly -guard {[my age] > 3}}} \ - {::a ::Animal (2 years): how should i fly?} \ - {::a ::Animal (2 years): how should i fly?} \ - {{::Fly -guard {[my age] > 4}}} {{::Fly -guard {[my age] > 4}}} \ - {::a ::Animal (2 years): yippee, fly like an eagle!} \ - ::Fly ::Fly] \ - {mixinguard method} - - set ::r "" - Class A -superclass Animal - A a -set age 20 - A instmixin Fly - A instmixinguard ::Fly {[my age] > 3} - lappend info [A info instmixinguard ::Fly] - a fly - lappend ::r [A info instmixin -guards] - lappend ::r [a info mixin -order -guards] - a set age 2 - a fly - A instmixinguard ::Fly {[my age] > 4} - lappend info [A info instmixinguard ::Fly] - a fly - lappend ::r [A info instmixin -guards] - lappend ::r [a info mixin -order -guards] - A instmixinguard ::Fly {} - lappend info [A info instmixinguard ::Fly] - a fly - lappend ::r [A info instmixin -guards] - lappend ::r [a info mixin -order -guards] - ::errorCheck [set ::r] [list \ - {::a ::A (20 years): yippee, fly like an eagle!} \ - {{::Fly -guard {[my age] > 3}}} {{::Fly -guard {[my age] > 3}}} \ - {::a ::A (2 years): how should i fly?} \ - {::a ::A (2 years): how should i fly?} \ - {{::Fly -guard {[my age] > 4}}} {{::Fly -guard {[my age] > 4}}} \ - {::a ::A (2 years): yippee, fly like an eagle!} \ - ::Fly ::Fly] \ - {instmixinguard method} - - ::errorCheck [set info] [list {[my age] > 4} {} {[my age] > 3} \ - {[my age] > 4} {} ] {info (inst)mixinguard} - -} - -@ TestX filterSimpleObserver { - description {Regression test object testing a simple observer using filters. - } -} -TestX filterSimpleObserver -proc run {{n 20}} { - set ::filterCount 0 - for {set i 0} {$i < $n} {incr i} { - Class NetAccess$i - Class Http$i -superclass NetAccess$i - Class TransferDialog$i - - TransferDialog$i proc addObserver cl { - $cl instproc observerFilter args { - set calledMethod [self calledproc] - set callingClass [my info class] - incr ::filterCount - set result [next] - - my set r 34 - - foreach var {args calledMethod callingClass result} { - if {[info vars $var] != $var} { - puts stderr "[self] -- Simple Observer - info vars in filter" - exit - } - } - - - return [self]-[self class]-[my info class]-$args-[self calledproc]-[self callingproc]-$result - } - $cl instfilter observerFilter - } - - TransferDialog$i instproc show {i} { - next - TransferDialog${i} addObserver NetAccess$i - [self class] instvar observingObjects - lappend observingObjects(::NetAccess$i) [self] - } - - Http$i parameter {a be bu} - Http$i instproc path x { my set path $x } - - Http$i instproc query x { - my set [self proc] $x - } - Http$i instproc init {args} { - my set url abc - next - my instvar query path bu - if {![info exists query] || - ![info exists path] || - ![info exists bu] || - $query ne "q"} { - puts stderr "FAILED - [self] -- Simple Observer - Variable Init"; exit - } - } - - Http$i instproc GET {x} { - my instvar query url path - if {[info exists query]} { - append url ?$query - append path ?$query - } - set ::baseLevel [info level] - - - if {0 != [expr {[info level] - $::baseLevel}]} { - puts stderr "FAILED - [self] -- Simple Observer - info level in filtered proc\n\ - expected 0, got [expr {[info level] - $::baseLevel}]" - exit - } - foreach var {x path query url} { - if {[info vars $var] != $var} { - puts stderr "FAILED - [self] -- Simple Observer - info vars in filtered proc"; - exit - } - } - return $url - } - - TransferDialog$i t($i) - t($i) show $i - - Http$i h($i) -query q -path p -bu b - - set erg [h($i) GET 1] - ::errorCheck $erg "::h($i)-::NetAccess$i-::Http$i-1-GET-run-abc?q" \ - "Simple Observer - Filter Return" - - } - for {set i 0} {$i < $n} {incr i} { - NetAccess$i instfilter {} - - h($i) destroy - t($i) destroy - - Http$i destroy - NetAccess$i destroy - TransferDialog$i destroy - } - - ::errorCheck $::filterCount 220 \ - "Simple Observer - Filter Count" -} - - - -@ TestX stdargs { - description { - Regression test object testing the ability of the next primitive to pass - arguments without naming them. - } -} -TestX stdargs -proc run {{n 20}} { - for {set i 0} {$i < $n} {incr i} { - Class C - Class D - Class A -superclass {C D} - Class B -superclass A - - C instproc t {} { - next - return - } - D instproc t args { - ::errorCheck $args "" --noArgs - next - return - } - - A instproc t {a b args} { - if {$a != 1 || $b != 2 || $args != {3 4 5 6 7 8 9}} { - puts stderr "FAILED - [self] -- StdArgs not computed"; exit - } - next --noArgs - return - } - - B instproc t {a b args} { - if {$a != 1 || $b != 2 || $args != {3 4 5 6 7 8 9}} { - puts stderr "FAILED -[self] -- StdArgs not computed"; exit - } - next - return - } - - B x - x t 1 2 3 4 5 6 7 8 9 - } - foreach o {x A B C D} {$o destroy} - -} - - -@ TestX filterInfo { - description{ - Regression test object testing introspection of filters. - } -} - -TestX filterInfo -# Helper Procs -proc ::showStack {{m 100}} { - set r "" - set max [info level] - if {$m<$max} {set max $m} - for {set i 0} {$i < $max} {incr i} { - set r ${r}-$i=[info level [expr -$i]] - } - return $r -} -proc ::showCall {} { - set n "" - for {set level -1} {1} {incr level -1} { - set p [info level $level] - if {[lindex $p 0] eq "next"} {set n "next:"} break - } - return [showStack] -} - -filterInfo proc run {{n 20}} { - for {set i 0} {$i < $n} {incr i} { - global FInfo - set FInfo "" - - Class FI - - FI proc addFilter {classname} { - $classname instproc infoFilter args { - global FInfo - lappend FInfo \ - [list callingclass [self callingclass] \ - filterreg [self filterreg] \ - callingobject [self callingobject] \ - callingproc [self callingproc] \ - calledproc [self calledproc]] - set r [next] - lappend FInfo \ - [list self [self] proc [self proc] class [self class] \ - infoclass [my info class] r $r] - return $r - } - $classname instfilter infoFilter - } - - Class C0 - FI addFilter C0 - C0 instproc m1 {} { - my instvar aa bb cc - set cc 1 - } - - Class C1 -superclass C0 - C1 instproc init args { - my set a 1 - my set c 22 - next - } - C1 instproc m1 args { - set r [next] - my instvar a b cc - return $r--${a}--[set cc] - } - - set safedObjFilters [Object info filter] - Object instfilter "" - C1 c1 - Object instfilter $safedObjFilters - - if {$i == 0} { - ::errorCheck "$FInfo" \ - "{callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc configure} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 0} {callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc init} {callingclass ::C1 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc init calledproc set} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 1} {callingclass ::C1 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc init calledproc set} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 22} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r {}}" \ - "Wrong filtering of instproc creation C/C1" - } else { - ::errorCheck "$FInfo" \ - "{callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc cleanup} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r {}} {callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc configure} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 0} {callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc init} {callingclass ::C1 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc init calledproc set} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 1} {callingclass ::C1 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc init calledproc set} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 22} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r {}}" \ - "Wrong filtering of instproc creation C/C1 (b)" - } - - set FInfo "" - set result [c1 m1] - - ::errorCheck $FInfo \ - "{callingclass {} filterreg {::C0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc m1} {callingclass ::C0 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc m1 calledproc instvar} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r {}} {callingclass ::C1 filterreg {::C0 instfilter infoFilter} callingobject ::c1 callingproc m1 calledproc instvar} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r {}} {self ::c1 proc infoFilter class ::C0 infoclass ::C1 r 1--1--1}" \ - "Wrong filtering of c1 m1" - - set FInfo "" - - ::errorCheck $result \ - "1--1--1" "Wrong return result of Filter Example 2 'c1 m1' " - - - Class T0 - FI addFilter T0 - T0 instproc m {} { - set e -0=showStack-1=showCall-2=m-3=m-4=m-5=run-6=run - if {[string first $e [showCall]] == -1} { - puts stderr "FAILED - Wrong calling stack in T0 m: [showCall]" - puts stderr "expected = '$e'" - puts stderr "got = '[showCall]'" - exit - } - return [self]-[self proc]-[self class]-[my info class] - } - Class T1 -superclass T0 - T1 instproc m {} { - set e 0=showStack-1=showCall-2=m-3=m-4=run-5=run - if {[string first $e [showCall]] == -1} { - puts stderr "FAILED - Wrong calling stack in T1 m: [showCall]" - puts stderr "expected = '$e'" - puts stderr "got = '[showCall]'" - exit - } - - set r1 before-[self]-[self proc]-[self class]-[my info class] - set r2 [next] - set r after-[self]-[self proc]-[self class]-[my info class]-${r1}-$r2 - } - - T1 t - - set FInfo "" - set result [t m] - ::errorCheck $FInfo \ - "{callingclass {} filterreg {::T0 instfilter infoFilter} callingobject ::filterInfo callingproc run calledproc m} {callingclass ::T1 filterreg {::T0 instfilter infoFilter} callingobject ::t callingproc m calledproc info} {self ::t proc infoFilter class ::T0 infoclass ::T1 r ::T1} {callingclass ::T0 filterreg {::T0 instfilter infoFilter} callingobject ::t callingproc m calledproc info} {self ::t proc infoFilter class ::T0 infoclass ::T1 r ::T1} {callingclass ::T1 filterreg {::T0 instfilter infoFilter} callingobject ::t callingproc m calledproc info} {self ::t proc infoFilter class ::T0 infoclass ::T1 r ::T1} {self ::t proc infoFilter class ::T0 infoclass ::T1 r after-::t-m-::T1-::T1-before-::t-m-::T1-::T1-::t-m-::T0-::T1}" \ - "Wrong filtering of t m" - - set FInfo "" - ::errorCheck $result \ - "after-::t-m-::T1-::T1-before-::t-m-::T1-::T1-::t-m-::T0-::T1" \ - "Wrong return result of Filter Example 2 \"t m\" " - } - c1 destroy - - for {set i 0} {$i < $n} {incr i} { - global InfoTraceResult - - Object instfilter "" - Object InfoTrace - - InfoTrace proc createInfoTrace cl { - $cl instproc infoTraceFilter args { - global InfoTraceResult - ::set r [next] - ::lappend InfoTraceResult [list \ - $r-[self]-[self proc]-[self class] \ - [my info class]-[self calledproc] \ - [self callingproc]-[self callingobject] \ - [self callingclass]-[self filterreg]] - return $r - } - $cl instfilter infoTraceFilter - } - Class ObjectsClass - ObjectsClass anObject - Class aClass - ObjectsClass instproc aProc {} {aClass create anotherObject} - InfoTrace createInfoTrace Object - set InfoTraceResult "" - set r [anObject aProc] - if {$i > 0} { - ::errorCheck $InfoTraceResult \ - "{-::anotherObject-infoTraceFilter-::xotcl::Object ::aClass-cleanup aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {-::xotcl::Class::Parameter-infoTraceFilter-::xotcl::Object ::xotcl::Class-searchDefaults aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {0-::anotherObject-infoTraceFilter-::xotcl::Object ::aClass-configure aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {-::anotherObject-infoTraceFilter-::xotcl::Object ::aClass-init aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {::anotherObject-::aClass-infoTraceFilter-::xotcl::Object ::xotcl::Class-recreate aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {::anotherObject-::aClass-infoTraceFilter-::xotcl::Object ::xotcl::Class-create aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {::anotherObject-::anObject-infoTraceFilter-::xotcl::Object ::ObjectsClass-aProc run-::filterInfo {-::xotcl::Object instfilter infoTraceFilter}}" \ - "FilterInfo InfoTrace: Filter information wrong (b)" - } else { - ::errorCheck $InfoTraceResult \ - "{::anotherObject-::aClass-infoTraceFilter-::xotcl::Object ::xotcl::Class-alloc aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {-::xotcl::Class::Parameter-infoTraceFilter-::xotcl::Object ::xotcl::Class-searchDefaults aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {0-::anotherObject-infoTraceFilter-::xotcl::Object ::aClass-configure aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {-::anotherObject-infoTraceFilter-::xotcl::Object ::aClass-init aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {::anotherObject-::aClass-infoTraceFilter-::xotcl::Object ::xotcl::Class-create aProc-::anObject {::ObjectsClass-::xotcl::Object instfilter infoTraceFilter}} {::anotherObject-::anObject-infoTraceFilter-::xotcl::Object ::ObjectsClass-aProc run-::filterInfo {-::xotcl::Object instfilter infoTraceFilter}}" \ - "FilterInfo InfoTrace: Filter information wrong" - } - } - - Object instfilter {} - global fUplevelResult - set fUplevelResult "" - - Class FilterMix - FilterMix instproc calls args { - global fUplevelResult - set calledproc [uplevel 1 {self calledproc}] - set calledclass [uplevel 1 {self calledclass}] - append fUplevelResult "-[self class]-[self proc]-$calledproc-$calledclass" - } - Class FilterCL -instmixin FilterMix - FilterCL instproc filterA args { - global fUplevelResult - append fUplevelResult -[self class]-[self proc]-[self calledproc]-[self calledclass] - my calls - next - } - FilterCL instproc fclproc args {} - - FilterCL instfilter filterA - - FilterCL fcl - fcl fclproc - -# ::errorCheck $fUplevelResult "-::FilterCL-filterA-configure-::xotcl::Object-::FilterMix-calls-configure-::xotcl::Object-::FilterCL-filterA-init-::xotcl::Object-::FilterMix-calls-init-::xotcl::Object-::FilterCL-filterA-fclproc-::FilterCL-::FilterMix-calls-fclproc-::FilterCL" "Filter/Mixin Info Uplevel Test" -} - - - -@ TestX nextTest { - description {Regression test object testing the next primitive.} -} -TestX nextTest -proc run {{n 20}} { - for {set i 0} {$i < $n} {incr i} { - - global result infoNext - set result "" - set infoNext "" - - Class X - X instproc n {} { - append ::infoNext " [self]+[self class]->[self proc]*<[self next]>" - next - } - Class Y -superclass X - Y instproc m {} { - append ::infoNext " [self]+[self class]->[self proc]*<[self next]>" - next - } - Y instproc n {} { - append ::infoNext " [self]+[self class]->[self proc]*<[self next]>" - next - } - Y y - - y m - y n - y proc n {} { - append ::infoNext " [self]+[self class]->[self proc]*<[self next]>" - next - } - y n - ::errorCheck $infoNext " ::y+::Y->m*<> ::y+::Y->n*<::X instproc n> ::y+::X->n*<> ::y+->n*<::Y instproc n> ::y+::Y->n*<::X instproc n> ::y+::X->n*<>" \ - "simple self next test" - set infoNext "" - set result "" - - Class A - A instproc m arg { - global result infoNext - set result ${result}-[self]-$arg - } - Class B -superclass A - B instproc m arg { - global result infoNext - set result ${result}-[self]-$arg - append infoNext " 2[self]+[self class]->[self proc]*<[self next]>" - next - } - B b0 -m 1 - B b -m "" - - ::errorCheck $result "-::b0-1-::b0-1-::b--::b-" \ - "Next Test A/B -- Wrong result" - - set result "" - - Class X - X instproc init args { - global result infoNext - set result ${result}-[self]-$args - append infoNext " 1[self]+[self class]->[self proc]*<[self next]>" - next - } - X instproc test {} { - global result - set result ${result}-[self] - } - - X x -test - ::errorCheck $result "-::x-::x-" \ - "Next Test X -- Wrong result" - ::errorCheck $infoNext " 2::b0+::B->m*<::A instproc m> 2::b+::B->m*<::A instproc m> 1::x+::X->init*<::xotcl::Object instproc init>" \ - "self next test 2" - X destroy - x destroy - A destroy - B destroy - b0 destroy - b destroy - - Class MIX - MIX instproc mProc args { - global result - append result "[self]-[self class]-[self next]" - next - } - Object o -mixin MIX - o proc mProc args { - global result - append result "[self]-[self class]-[self next]" - } - set result "" - o mProc - ::errorCheck $result "::o-::MIX-::o proc mProc::o--" \ - "Next Test Proc & Mixin" - - o destroy; MIX destroy - } - } - -@ TestX init_params { - description { - Regression test object testing the parameter instance method, - the init dash '-' and constructor calling. - } -} - -TestX init_params -proc run {{n 20}} { - for {set i 0} {$i < $n} {incr i} { - global dashResult - set dashResult "" - set dashResultEnd "" - Class A - A instproc t0 {} { - global dashResult - set dashResult ${dashResult}*[self proc] - } - A instproc t1 {a} { - global dashResult - set dashResult ${dashResult}*[self proc]-$a - } - A instproc t2 {a b} { - global dashResult - set dashResult ${dashResult}*[self proc]-${a}-$b - } - A instproc t3 {a b c} { - global dashResult - set dashResult ${dashResult}*[self proc]-${a}-${b}-$c - } - A a - set dashResultEnd "[A a -t0] $dashResultEnd" - - A a - set dashResultEnd "[A a -t1 1] $dashResultEnd" - A a - set dashResultEnd "[A a -t2 1 2] $dashResultEnd" - A a - set dashResultEnd "[A a -t3 1 2 3] $dashResultEnd" - A a - set dashResultEnd "[A a -t0 -t0 -t3 1 2 3 -t0 -t1 1 -t1 1 -t0] $dashResultEnd" - - - catch {A a t} - - ::errorCheck $dashResult \ - "*t0*t1-1*t2-1-2*t3-1-2-3*t0*t0*t3-1-2-3*t0*t1-1*t1-1*t0" \ - "Init Dash Test fails" - ::errorCheck $dashResultEnd \ - "::a ::a ::a ::a ::a " \ - "Init Dash Test fails -- result" - - Class Foo -parameter {{match -exact}} - Foo ff - ::errorCheck [ff match] "-exact" "default with dash" - } - - # parameter/defaults test - - proc ::cmd {a b} { - return in-cmd-${a}-${b} - } - - global parameterResult - global initResult - - for {set i 0} {$i < $n} {incr i} { - Class O -parameter { - {a -default 0} - {b -default {[cmd 3 4]}} c d - {e -default 3} - {Self -default [self]} - } - O instproc init args { - global initResult - set initResult ${initResult}-[self]-[self class]-[self proc]--$args - next - } - O instproc show {} { - global parameterResult - set parameterResult [self] - foreach v [lsort [my info vars]] { - set parameterResult ${parameterResult}-${v}=<[my set ${v}]> - } - } - Class Meta -superclass Class - Meta instproc create args {next; return Meta-create} - Meta C -superclass O -parameter {a {b -default ""} {c -default 1}} - Class D -parameter {a {c -default 1}} -superclass O - # create on class should not be called - D instproc create args {next; return D-create} - D instproc init args { - global initResult - set initResult ${initResult}-[self]-[self class]-[self proc]--$args - next - } - D instproc test i { - ::errorCheck [my set c]-[my set a] "2-0" "Wrong order of init call" - } - - set parameterResult "" - set initResult "" - C c0 -show - ::errorCheck $parameterResult "::c0-Self=<::c0>-a=<0>-b=<>-c=<1>-e=<3>" \ - "C c0 parameter Test failed" - if {$i == 0} { - ::errorCheck $initResult "-::c0-::O-init--" \ - "C c0 parameter init Test failed" - } else { - ::errorCheck $initResult "-::c0-::O-init--" \ - "C c0 parameter init Test failed (b)" - } - - set parameterResult "" - set initResult "" - set r [C c1 -c 2 -init a b c -a 1 -show] - - ::errorCheck $parameterResult "::c1-Self=<::c1>-a=<1>-b=<>-c=<2>-e=<3>" \ - "C c1 parameter Test failed (b)" - - ::errorCheck $initResult "-::c1-::O-init--a b c" \ - "C c1 parameter init Test failed" - - set parameterResult "" - set initResult "" - set r $r-[D d1 -c 2 -init a b c -test $i -a 1 -show] - ::errorCheck $parameterResult "::d1-Self=<::d1>-a=<1>-b=-c=<2>-e=<3>" \ - "D d1 parameter Test failed" - if {$i == 0} { - ::errorCheck $initResult "-::d1-::D-init--a b c-::d1-::O-init--a b c" \ - "D d1 parameter init Test failed" - } else { - ::errorCheck $initResult "-::d1-::D-init--a b c-::d1-::O-init--a b c" \ - "D d1 parameter init Test failed (b)" - } - - - ::errorCheck $r "Meta-create-::d1" "User defined object creation failed" - } -} - -@ TestX mixinTest { - description { - Regression test object testing per-object mixins. - } -} - -TestX mixinTest -proc run {{n 10}} { - - global mixinResult - set mixinResult "" - Class Agent - Agent instproc moveAgent {x y} { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - next - } - Agent instproc otherProc {} { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - next - } - Class InteractiveAgent -superclass Agent - InteractiveAgent instproc moveAgent {x y} { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - next - } - Class InteractiveAgent2 -superclass Agent - InteractiveAgent2 instproc moveAgent {x y} { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - next - } - Class InteractiveAgent3 -superclass Agent - InteractiveAgent3 instproc moveAgent {x y} { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - next - } - - # Addition-Classes - Class MovementLog - MovementLog instproc moveAgent {x y} { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - my otherProc - next - } - MovementLog instproc otherProc {} { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - next - } - Class MovementTest - MovementTest instproc moveAgent {x y} { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - next - } - InteractiveAgent i1; InteractiveAgent i2 - i1 mixin MovementLog - i2 mixin MovementTest - - InteractiveAgent2 instmixin {MovementLog MovementTest} - InteractiveAgent3 instmixin MovementTest - InteractiveAgent2 i3; InteractiveAgent3 i4; - - ::errorCheck [InteractiveAgent2 info instmixin] "::MovementLog ::MovementTest" "Mixin: info instmixin" - - - i2 moveAgent 1 2 - ::errorCheck $mixinResult \ - "-::i2-moveAgent-::MovementTest-::i2-moveAgent-::InteractiveAgent-::i2-moveAgent-::Agent" \ - "Mixin: 'i2 moveAgent 1 2' failed" - - set mixinResult "" - i1 moveAgent 3 4 - ::errorCheck $mixinResult \ - "-::i1-moveAgent-::MovementLog-::i1-otherProc-::MovementLog-::i1-otherProc-::Agent-::i1-moveAgent-::InteractiveAgent-::i1-moveAgent-::Agent" \ - "Mixin: 'i1 moveAgent 3 4' failed" - - set mixinResult "" - i3 moveAgent 3 4 - ::errorCheck $mixinResult \ - "-::i3-moveAgent-::MovementLog-::i3-otherProc-::MovementLog-::i3-otherProc-::Agent-::i3-moveAgent-::MovementTest-::i3-moveAgent-::InteractiveAgent2-::i3-moveAgent-::Agent" \ - "Instmixin: 'i3 moveAgent 3 4' failed" - - set mixinResult "" - i4 moveAgent 3 4 - - ::errorCheck $mixinResult \ - "-::i4-moveAgent-::MovementTest-::i4-moveAgent-::InteractiveAgent3-::i4-moveAgent-::Agent" \ - "Instmixin: 'i4 moveAgent 3 4' failed" - - i4 mixin {MovementTest MovementLog} - - i4 proc aaa args {puts TEST} - ::errorCheck [i4 procsearch moveAgent]-[i4 procsearch aaa]-[i4 procsearch set] "::MovementLog instproc moveAgent-::i4 proc aaa-::xotcl::Object instcmd set" "procsearch" - - Class create A - A instproc f1 {} {puts hu} - A instforward f2 puts hu - A instparametercmd f5 - A create a0 - a0 proc f3 {} {puts hu} - a0 forward f4 puts hu - a0 parametercmd f6 puts hu - ::errorCheck [a0 procsearch f1] "::A instproc f1" procsearch-1 - ::errorCheck [a0 procsearch f2] "::A instforward f2" procsearch-2 - ::errorCheck [a0 procsearch f3] "::a0 proc f3" procsearch-3 - ::errorCheck [a0 procsearch f4] "::a0 forward f4" procsearch-4 - ::errorCheck [a0 procsearch f5] "::A instparametercmd f5" procsearch-4 - ::errorCheck [a0 procsearch f6] "::a0 parametercmd f6" procsearch-6 - ::errorCheck [a0 procsearch set] "::xotcl::Object instcmd set" procsearch-6 - - set mixinResult "" - i4 moveAgent 5 6 - ::errorCheck $mixinResult \ - -::i4-moveAgent-::MovementLog-::i4-otherProc-::MovementLog-::i4-otherProc-::Agent-::i4-moveAgent-::MovementTest-::i4-moveAgent-::InteractiveAgent3-::i4-moveAgent-::Agent \ - "Instmixin: 'i4 moveAgent 5 6' failed" - - Class A - A instproc test {} { - global mixinResult - set mixinResult "test" - i1 moveAgent 3 4 - } - A a - a test - ::errorCheck $mixinResult \ - "test-::i1-moveAgent-::MovementLog-::i1-otherProc-::MovementLog-::i1-otherProc-::Agent-::i1-moveAgent-::InteractiveAgent-::i1-moveAgent-::Agent" \ - "Mixin: 'a test' failed" - - i2 mixin {MovementLog MovementTest} - - set mixinResult "" - - i2 moveAgent a b - ::errorCheck $mixinResult \ - "-::i2-moveAgent-::MovementLog-::i2-otherProc-::MovementLog-::i2-otherProc-::Agent-::i2-moveAgent-::MovementTest-::i2-moveAgent-::InteractiveAgent-::i2-moveAgent-::Agent" \ - "Mixin: 'i2 moveAgent a b' failed" - - ::errorCheck "[i2 info mixin]-[i1 info mixin]-[a info mixin]" \ - "::MovementLog ::MovementTest-::MovementLog-" \ - "Mixin: Info failed" - - - ::errorCheck "[i2 ismixin MovementTest]-[i4 ismixin MovementTest]-[a ismixin MovementTest]-[i3 ismixin MovementTest]-[i4 ismixin MovementTest]-[i4 ismixin MovementLog]-[i3 ismixin YXZ]-[i3 ismixin InteractiveAgent]" \ - "1-1-0-1-1-1-0-0" \ - "'ismixin test' failed" - - ::errorCheck "[i2 hasclass MovementTest]-[i4 hasclass MovementTest]-[a hasclass MovementTest]-[i3 hasclass MovementTest]-[i4 hasclass MovementTest]-[i4 hasclass MovementLog]-[i3 hasclass YXZ]-[i3 hasclass InteractiveAgent]-[a hasclass A]-[i3 hasclass Agent]" \ - "1-1-0-1-1-1-0-0-1-1" \ - "'hasclass test' failed" - - set mixinResult "" - i2 mixin "" - i2 moveAgent a b - - ::errorCheck $mixinResult \ - "-::i2-moveAgent-::InteractiveAgent-::i2-moveAgent-::Agent" \ - "Mixin: remove failed" - - - set mixinResult "" - Class A - A instproc destroy args { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - next - } - A instproc y args { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - next - } - Class B - B instproc destroy args { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - next - } - B instproc y args { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - my mixin "" - next - } - B instproc x args { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - my destroy - } - - A a -mixin B - a destroy - - A a -mixin B - a x - - A a -mixin B - a y - - ::errorCheck $mixinResult \ - "-::a-destroy-::B-::a-destroy-::A-::a-x-::B-::a-destroy-::B-::a-destroy-::A-::a-y-::B-::a-y-::A" \ - "Mixin: destroy failed" - - A instmixin B - set mixinResult "" - A a2 - a2 destroy - A a2 - a2 x - A a2 - a2 y - - ::errorCheck $mixinResult \ - "-::a2-destroy-::B-::a2-destroy-::A-::a2-x-::B-::a2-destroy-::B-::a2-destroy-::A-::a2-y-::B-::a2-y-::A" \ - "Instmixin: destroy failed" - - # mixin Test: calls the mixins and a proc of the object - set ::mixinResult "" - Class A - Class B - A instproc a {} {set ::mixinResult ${::mixinResult}-[self]-[self class]-[self proc];next} - B instproc a {} {set ::mixinResult ${::mixinResult}-[self]-[self class]-[self proc]; next} - A d -mixin B - d proc a {} {set ::mixinResult ${::mixinResult}-[self]-[self class]-[self proc]; next} - d a - ::errorCheck $::mixinResult \ - "-::d-::B-a-::d--a-::d-::A-a" \ - "Mixin: calling of object's proc" - - set mixinResult "" - - d mixin {} - A instmixin B - d a - - ::errorCheck $::mixinResult \ - "-::d-::B-a-::d--a-::d-::A-a" \ - "Instmixin: calling of object's proc" - - # - # combining filters with mixins - # - set ::traceResults "" - - Class M1 - M1 instproc test args { - global traceResults - lappend traceResults "[self] [self proc] [self class]" - next - } - Class M2 - M2 instproc test args { - global traceResults - lappend traceResults "[self] [self proc] [self class]" - next - } - Class A - A instproc test args { - global traceResults - lappend traceResults "[self] [self proc] [self class]" - next - } - A instproc f1 args { - global traceResults - lappend traceResults "[self] [self proc] [self class]" - next - } - A instproc f2 args { - global traceResults - lappend traceResults "[self] [self proc] [self class]" - next - } - - A a - A instmixin {M1 M2} - A instfilter {f1 f2} - a test - - ::errorCheck $::traceResults \ - "{::a f1 ::A} {::a f2 ::A} {::a test ::M1} {::a test ::M2} {::a test ::A}" \ - "Combining mixins and filters" - - # mixin recursion test - set mixinResult "" - - Class Computation - Computation instproc compute args { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - # abstract interface for computations - } - Class ComputationOutput -superclass Computation - Computation instproc compute args { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - return $args - } - - Class RecFacultyMixin - RecFacultyMixin instproc compute args { - global mixinResult - set mixinResult ${mixinResult}-[self]-[self proc]-[self class] - set n [lindex $args 0] - set callingClass - - #puts stderr [self class]=[uplevel 1 self class]-[self callingclass] - #catch {set callingClass [uplevel 1 self class]} - set callingClass [self callingclass] - if {$n == 0} { - set result 1 - } else { - set f [my compute [expr {$n - 1}] x] - set result [expr {$n * $f}] - } - - if {$callingClass != [self class]} { - next $result - return $result - } else { - return $result - } - } - - ComputationOutput faculty - faculty mixin RecFacultyMixin - - ::errorCheck [faculty compute 3] 6 \ - "Mixin: faculty wrong result" - - ::errorCheck $mixinResult \ - "-::faculty-compute-::RecFacultyMixin-::faculty-compute-::RecFacultyMixin-::faculty-compute-::RecFacultyMixin-::faculty-compute-::RecFacultyMixin-::faculty-compute-::Computation" \ - "Mixin: faculty failed" - set mixinResult "" - - ComputationOutput faculty - ComputationOutput instmixin RecFacultyMixin - ::errorCheck [faculty compute 3] 6 "Mixin: faculty wrong result" - - ::errorCheck $mixinResult \ - "-::faculty-compute-::RecFacultyMixin-::faculty-compute-::RecFacultyMixin-::faculty-compute-::RecFacultyMixin-::faculty-compute-::RecFacultyMixin-::faculty-compute-::Computation" \ - "Mixin: faculty failed" - - - set ::mixinResult "" - set ::calling "" - - Class GrObject - GrObject instproc draw args { - lappend ::mixinResult [list grObject [self] [self proc] [self class]] - lappend ::calling [list grObject [self proc]: [self callingobject] [self callingclass] [self callingproc] [self next]] - } - - Class Image -superclass GrObject - Image instproc draw args { - lappend ::mixinResult [list image [self] [self proc] [self class]] - lappend ::calling [list image [self proc]: [self callingobject] [self callingclass] [self callingproc] [self next]] - next - } - - Class MenuDecorator - MenuDecorator instproc draw args { - lappend ::mixinResult [list m1 [self] [self proc] [self class]] - lappend ::calling [list m1 [self proc]: [self callingobject] [self callingclass] [self callingproc] [self next]] - next - } - - Class ScrollBarDecorator - ScrollBarDecorator instproc draw args { - lappend ::mixinResult [list m2 [self] [self proc] [self class]] - lappend ::calling [list m2 [self proc]: [self callingobject] [self callingclass] [self callingproc] [self next]] - next - } - - Image mainImage -mixin {MenuDecorator ScrollBarDecorator} - Image zoom -mixin {ScrollBarDecorator} - - Object instproc f args { - if {[self calledproc] ne "filter"} { - lappend ::mixinResult [list filter [self] [self proc] [self class]] - lappend ::calling [list filter [self proc]: [self callingobject] [self callingclass] [self callingproc] [self calledproc] [self next]] - } - return [next] - } - Object instfilter f - mainImage draw - zoom draw - - Object instfilter "" - - ::errorCheck $::calling \ - "{filter f: ::mixinTest {} run draw {::MenuDecorator instproc draw}} {m1 draw: ::mixinTest {} run {::ScrollBarDecorator instproc draw}} {m2 draw: ::mixinTest {} run {::Image instproc draw}} {image draw: ::mixinTest {} run {::GrObject instproc draw}} {grObject draw: ::mixinTest {} run {}} {filter f: ::mixinTest {} run draw {::ScrollBarDecorator instproc draw}} {m2 draw: ::mixinTest {} run {::Image instproc draw}} {image draw: ::mixinTest {} run {::GrObject instproc draw}} {grObject draw: ::mixinTest {} run {}} {filter f: ::mixinTest {} run instfilter {::xotcl::Class instforward instfilter}} {filter f: ::xotcl::Object ::xotcl::Class instfilter assign {::xotcl::InterceptorSlot instcmd assign}}" \ - "Mixin: Calling-Obj/Cl/Proc failed" - - ::errorCheck $::mixinResult \ - "{filter ::mainImage f ::xotcl::Object} {m1 ::mainImage draw ::MenuDecorator} {m2 ::mainImage draw ::ScrollBarDecorator} {image ::mainImage draw ::Image} {grObject ::mainImage draw ::GrObject} {filter ::zoom f ::xotcl::Object} {m2 ::zoom draw ::ScrollBarDecorator} {image ::zoom draw ::Image} {grObject ::zoom draw ::GrObject} {filter ::xotcl::Object f ::xotcl::Object} {filter ::xotcl::Class::slot::instfilter f ::xotcl::Object}" \ - "Mixin: Filter failed" - - set ::mixinResult "" - set ::calling "" - - Class InfoTrace2 - InfoTrace2 instproc infoTraceFilter2 args { - lappend ::calling \ - self [self] \ - "self proc" [self proc] \ - "self class" [self class] \ - "self calledproc" [self calledproc] \ - "self callingproc" [self callingproc] \ - "self callingobject" [self callingobject] \ - "self callingclass" [self callingclass] \ - "self filterreg" [self filterreg] \ - "self next" [self next] - next - } - - Class CallingObjectsClass - CallingObjectsClass create callingObject - - Class FilterRegClass -superclass InfoTrace2 - Class FilteredObjectsClass -superclass FilterRegClass - FilteredObjectsClass filteredObject - - CallingObjectsClass instproc callingProc args { - filteredObject set someVar 0 - } - FilterRegClass instfilter infoTraceFilter2 - - callingObject callingProc - - ::errorCheck $::calling \ - {self ::filteredObject {self proc} infoTraceFilter2 {self class} ::InfoTrace2 {self calledproc} set {self callingproc} callingProc {self callingobject} ::callingObject {self callingclass} ::CallingObjectsClass {self filterreg} {::FilterRegClass instfilter infoTraceFilter2} {self next} {::xotcl::Object instcmd set}} \ - "call stack info" - - Class M1; Class M2; Class M3; Class M4 - Class A; Class B -superclass A; B b - A instmixin {M1 M2} - B instmixin {M3 M1 M1 M4} - b mixin {M1 M1 M4} - - ::errorCheck [b info mixin -order] "::M3 ::M4 ::M1 ::M2" "Mixin Info: -order option" - ::errorCheck [B info instmixin]-[b info mixin] "::M3 ::M1 ::M4-::M1 ::M4" "Mixin Info: no duplicates" - B instmixin {} - ::errorCheck [b info mixin -order] "::M4 ::M1 ::M2" "Mixin Info: -order option" - - set ::r "" - Class X11 -instproc test {args} { - lappend ::r [self class] - next - } - Class X12 -instproc test {args} { - lappend ::r [self class] - next - } - Class X -instmixin {X11 X12} -instproc test {args} { - lappend ::r [self class] - next - } - - Class Y -instmixin X - Y create y -test - - X create x -test - - ::errorCheck $::r [list ::X11 ::X12 ::X ::X11 ::X12 ::X] \ - {transitive mixin} - - unset ::r - - # test for MixinRemoveFromMixinStack, MixinRemoveFromCmdPtr, - # MixinRemoveOnObjFromCmdPtr - Class A - A instproc x {} {B destroy; next} - Class B - B instproc x {} {next} - Class C - C instproc x {} {next} - - Object o -mixin {A B C} - o proc x {} {return x} - ::errorCheck [o x] {x} {mixin destroy on stack} - o destroy - - # testing transitive mixins; should be in both cases the same - Class IM - Class M - Object o -mixin M - M instmixin IM - ::errorCheck [o info precedence] {::IM ::M ::xotcl::Object} \ - {trans. mixin precedence 1} - - Object o -mixin M - ::errorCheck [o info precedence] {::IM ::M ::xotcl::Object} \ - {trans. mixin precedence 2} - o destroy -} - - -@ TestX mixinInheritanceTest { - description { - Regression test object testing per-object mixin inheritance. - } -} - -TestX mixinInheritanceTest -proc run {{n 10}} { - for {set i 0} {$i < $n} {incr i} { - global mixinResult - set mixinResult "" - - Class A - Class B - Class C -superclass {A B} - - Class GeneralMixin - Class RefinedMixin1 -superclass GeneralMixin - Class RefinedMixin2 -superclass GeneralMixin - Class AppMixin1 -superclass {RefinedMixin1 RefinedMixin2} - Class AppMixin2 -superclass {RefinedMixin2 RefinedMixin1} - Class AppMixin3 -superclass {RefinedMixin1} - - A instproc aProc args { - global mixinResult; - ::set mixinResult "$mixinResult [self class]" - return $args - } - B instproc aProc args { - global mixinResult; - ::set mixinResult "$mixinResult [self class]" - return $args - } - C instproc aProc args { - global mixinResult; - ::set mixinResult "$mixinResult [self class]" - return [next "$args [self class]"] - } - GeneralMixin instproc aProc args { - global mixinResult; - ::set mixinResult "$mixinResult [self class]" - return [next "$args [self class]"] - } - RefinedMixin1 instproc aProc args { - global mixinResult; - ::set mixinResult "$mixinResult [self class]" - return [next "$args [self class]"] - } - RefinedMixin2 instproc aProc args { - global mixinResult; - ::set mixinResult "$mixinResult [self class]" - return [next "$args [self class]"] - } - AppMixin1 instproc aProc args { - global mixinResult; - ::set mixinResult "$mixinResult [self class]" - return [next "$args [self class]"] - } - - AppMixin1 mixinInstance - set r [mixinInstance aProc ARGS1 ARGS2] - ::errorCheck $mixinResult \ - " ::AppMixin1 ::RefinedMixin1 ::RefinedMixin2 ::GeneralMixin" \ - "Mixin inheritance: mixinInstance aProc" - set mixinResult "" - - AppMixin3 mixinInstance2 - set r [mixinInstance2 aProc ARGS1 ARGS2] - ::errorCheck $mixinResult \ - " ::RefinedMixin1 ::GeneralMixin" \ - "Mixin inheritance: mixinInstance2 aProc" - set mixinResult "" - - A a - a mixin AppMixin1 - set r [a aProc ARGS1 ARGS2] - ::errorCheck $mixinResult \ - " ::AppMixin1 ::RefinedMixin1 ::RefinedMixin2 ::GeneralMixin ::A" \ - "Mixin inheritance: a aProc" - - - ::errorCheck $r \ - "{{{{ARGS1 ARGS2 ::AppMixin1} ::RefinedMixin1} ::RefinedMixin2} ::GeneralMixin}" \ - "Mixin inheritance result: a aProc" - - A a - A instmixin AppMixin1 - - set mixinResult "" - - set r [a aProc ARGS1 ARGS2] - ::errorCheck $mixinResult \ - " ::AppMixin1 ::RefinedMixin1 ::RefinedMixin2 ::GeneralMixin ::A" \ - "Instmixin inheritance: a aProc" - ::errorCheck $r \ - "{{{{ARGS1 ARGS2 ::AppMixin1} ::RefinedMixin1} ::RefinedMixin2} ::GeneralMixin}" \ - "Instmixin inheritance: a aProc" - set mixinResult "" - - C c - c mixin {AppMixin3 AppMixin2} - - set r [c aProc ARGS1 ARGS2] - ::errorCheck $mixinResult \ - " ::AppMixin1 ::RefinedMixin1 ::RefinedMixin2 ::GeneralMixin ::C ::A" \ - "Mixin/Instmixin inheritance: c aProc" - set mixinResult "" - A instmixin {} - - set r [c aProc ARGS1 ARGS2] - ::errorCheck $mixinResult \ - " ::RefinedMixin2 ::RefinedMixin1 ::GeneralMixin ::C ::A" \ - "Mixin/Instmixin inheritance: c aProc" - - GeneralMixin instproc set args { - global mixinResult; - ::set mixinResult "$mixinResult [self class]" - return [next] - } - RefinedMixin1 instproc set args { - global mixinResult; - ::set mixinResult "$mixinResult [self class]" - return [next] - } - AppMixin1 instproc set args { - global mixinResult; - ::set mixinResult "$mixinResult [self class]" - return [next] - } - - global setFilterResult - set setFilterResult "" - Object instproc setFilter args { - global setFilterResult - ::append setFilterResult \ - -[self]-[self calledproc]-[self calledclass] - next - } - - Object instfilter setFilter - - set mixinResult "" - set r [c set setVar 111] - - ::errorCheck $mixinResult \ - " ::RefinedMixin1 ::GeneralMixin" \ - "Mixin inheritance: c set" - # UNKNOWN PROBLEM 2 - # ::errorCheck [c setsetVar] 111 "Mixin inheritance: c set - value" - - ::errorCheck [c set setVar] 111 "Mixin inheritance: c set - value" - set mixinResult "" - mixinInstance set setVar 222 - - ::errorCheck $mixinResult \ - " ::AppMixin1 ::RefinedMixin1 ::GeneralMixin" \ - "Mixin inheritance: mixinInstance set" - ::errorCheck [mixinInstance set setVar] 222\ - "Mixin inheritance: mixinInstance set - value" - - ::errorCheck $setFilterResult \ - "-::c-set-::xotcl::Object-::c-set-::xotcl::Object-::mixinInstance-set-::AppMixin1-::mixinInstance-set-::AppMixin1" \ - "Mixin inheritance: Wrong classes in mixin set test" - - Object instfilter "" - } - - # Mixin init test - global initResult - set initResult "" - Class A - A instproc init args { - my mixin B - global initResult - append initResult [self class]- - next - } - - Class C - C instproc init args { - global initResult - append initResult [self class]- - next - } - - Class B -superclass C - B instproc init args { - global initResult - append initResult [self class]- - next - } - - Class D - D instproc init args { - global initResult - append initResult [self class]- - next - } - - A a - ::errorCheck $initResult "::A-" "Mixin init 1 failed" - set initResult "" - # in A mixin changes to B - before D's constructor must - # be called - A b -mixin D - ::errorCheck $initResult "::D-::A-" "Mixin init 2 failed" - - Class Mix - Mix instproc init args { - global initResult - append initResult [self class]- - next - } - Class Mix1 - Mix1 instproc init args { - global initResult - append initResult [self class]- - next - } - Class Mix2 - Mix2 instproc init args { - global initResult - append initResult [self class]- - next - } - Class A - A instproc init args { - global initResult - append initResult [self class]- - next - } - Class B - B instproc init args { - my mixin {Mix Mix1} - global initResult - append initResult [self class]- - next - } - - set initResult "" - A a - a mixin {Mix Mix1} - ::errorCheck $initResult ::A- "Mixin init 3 failed" - - set initResult "" - B b - ::errorCheck $initResult ::B- "Mixin init 4 failed" - - set initResult "" - B mixin add Mix2 - ::errorCheck $initResult "" "Mixin init 5 failed" - - set initResult "" - A mixin {}; A mixin {Mix Mix1} - ::errorCheck $initResult "" "Mixin init 6 failed" - - set initResult "" - A a -mixin {Mix} - ::errorCheck $initResult "::Mix-::A-" "Mixin init 7 failed" - - Class Strategy - Strategy instproc init args { - global initResult - append initResult [self class]- - next - } - Class A - A instproc strategy {n} { - set a [my info mixin] - my mixin [concat $n $a] - } - A instproc init args { - global initResult - append initResult [self class]- - next - } - Class Mix1 - Mix1 instproc init args { - global initResult - append initResult [self class]- - my strategy Strategy - next - } - set initResult "" - A a -mixin Mix1 - ::errorCheck $initResult ::Mix1-::A- "Mixin init 8 failed" - - set initResult "" - Class X - X instproc init args { - append ::initResult " [self]: [self class]->[self proc]" - next - } - Class Y -superclass X - Y instproc init args { - append ::initResult " [self]: [self class]->[self proc]" - next - } - - Class U -superclass X - U instproc init args { - append ::initResult " [self]: [self class]->[self proc]" - next - } - Class V - V instproc init args { - append ::initResult " [self]: [self class]->[self proc]" - next - } - - Class A - A instproc init args { - append ::initResult " [self]: [self class]->[self proc]" - next - } - Class B -superclass A - B instproc init args { - append ::initResult " [self]: [self class]->[self proc]" - next - } - A a - a mixin X - B b - b mixin Y - A a2 -mixin Y - B b2 -mixin X - A a3 -mixin {U V} - B b3 - b3 mixin {U V} - A a3 - A instmixin X - A instmixin {} - B instmixin Y - B b3 - b3 mixin Y - - ::errorCheck $initResult \ - " ::a: ::A->init ::b: ::B->init ::b: ::A->init ::a2: ::Y->init ::a2: ::X->init ::a2: ::A->init ::b2: ::X->init ::b2: ::B->init ::b2: ::A->init ::a3: ::U->init ::a3: ::X->init ::a3: ::V->init ::a3: ::A->init ::b3: ::B->init ::b3: ::A->init ::a3: ::A->init ::b3: ::Y->init ::b3: ::X->init ::b3: ::B->init ::b3: ::A->init" \ - "Mixin init 9 failed" - -} - - -@ TestX copymove { - description {Regression test for copy/move methods} -} - -TestX copymove -proc run {{n 10}} { - # Composite - Class Composite -superclass Class - Composite instproc addop {op} { - my instvar ops - set ops($op) $op - } - Composite instproc compositeFilter args { - set m [self calledproc] - set c [lindex [self filterreg] 0] - set r [next] - - if {[$c exists ops($m)]} { - foreach child [my info children] { - eval [self]::$child $m $args - } - } - return $r - } - - Composite AbstractNode - AbstractNode abstract instproc iterate v - AbstractNode addop iterate - for {set i 0} {$i < $n} {incr i} { - # - # class copy - # - Class X - Class X::Y - Class X::Y::Z -parameter { - {param1 1} - {param2 2} - } - #X::Y::Z metadata add {Version Author Nothing} - #X::Y::Z metadata Version {0.0.9} - #X::Y::Z metadata Author {Uwe} - X::Y::Z instproc defaultValueIP {{a defA} {b defB} v} { - return - } - X::Y::Z proc defaultValueP {{c defC} {d defD} v} { - return - } - - X::Y::Z instinvar {{7 > 6} { - #a comment - } - } - X::Y::Z instproc assProc {} {puts x} {{5 > 4} { - #pre - }} {{5 > 4} { - #post - } - } - - X::Y::Z check {pre post instinvar} - - foreach C {X X::Y X::Y::Z} { - $C instproc q {a b c} { - return [self]--[self class]--[self proc]--[next]-- - } - } - X::Y::Z z - X::Y::Z copy V - V v - ::errorCheck "[z q 1 2 3]--[X::Y::Z info class]--[X::Y::Z info classparent]" \ - "::z--::X::Y::Z--q------::xotcl::Class--::X::Y"\ - "class copy z" - ::errorCheck "[v q 1 2 3]--[V info class]--[V info classparent]" "::v--::V--q------::xotcl::Class--::"\ - "class copy v" - ::errorCheck "[::cutSpaces [V info parameter]--[v set param1]--[v set param2]]" \ - " {param1 1} {param2 2} --1--2" \ - "parameter test" - ::errorCheck "[::cutSpaces [V info instinvar]--[V info instpre assProc]--[V info instpost assProc]]"\ - "{7 > 6} { #a comment }--{5 > 4} { #pre }--{5 > 4} { #post }"\ - "Copy Class Assertions" - #::errorCheck "[V info metadata]--[V metadata Author]--[V metadata Version]--[V metadata Nothing]"\ - "Version Author Nothing--Uwe--0.0.9--"\ - "Copy Metadata" - - set df1 [V info default defaultValueP v dfv1] - set df2 [V info default defaultValueP c dfv2] - set df3 [V info instdefault defaultValueIP v dfv3] - set df4 [V info instdefault defaultValueIP a dfv4] - ::errorCheck "$df1 $dfv1 $df2 $dfv2 $df3 $dfv3 $df4 $dfv4"\ - "0 1 defC 0 1 defA"\ - "Copy Default Values" - - # class hierarchy copy - Class O - X copy O::X - O::X x1; O::X::Y y1; O::X::Y::Z z1 - ::errorCheck "[x1 q 1 2 3]--[y1 q 1 2 3]--[z1 q 1 2 3]" \ - "::x1--::O::X--q------::y1--::O::X::Y--q------::z1--::O::X::Y::Z--q----"\ - "class hierarchy copy" - # - # object copy - # - X x -set var1 12 -requireNamespace - proc ::x::tclProc args {return tclProc} - x proc q {a b c} {return [self]--[self class]--[self proc]--[next]--} - x copy y - ::errorCheck "[::y::tclProc]--[x q 1 2 3]--[y q 1 2 3]" \ - "tclProc--::x----q--::x--::X--q--------::y----q--::y--::X--q------"\ - "object copy" - # object hierarchy copy - x copy x::a - - x copy x::a::z - - ::errorCheck "[::x::a::tclProc]--[::x::a::z::a::tclProc]" \ - "tclProc--tclProc"\ - "object hierarchy copy" - - Class O - O x - x invar {{7 > 5} { - #a comment - }} - x proc assProc {} {return} {{5 > 3} { - #pre - }} {{5 > 4} {#post - }} - x set var1 12 - x proc p1 {} {return [self]-p1} - x copy y - ::errorCheck "[x p1]--[x set var1]--[::x info class]" "::x-p1--12--::O"\ - "Simple Copy - Origin" - ::errorCheck "[y p1]--[y set var1]--[::y info class]" "::y-p1--12--::O"\ - "Simple Copy - Duplicate" - ::errorCheck "[::cutSpaces [y info invar]--[y info pre assProc]--[y info post assProc]]"\ - "{7 > 5} { #a comment }--{5 > 3} { #pre }--{5 > 4} {#post }"\ - "Copy Obj Assertions" - - # - # move test - # - V destroy - X::Y::Z move V - V v - - ::errorCheck "[v q 1 2 3]--[V info class]--[V info classparent]" "::v--::V--q------::xotcl::Class--::"\ - "class move v" - ::errorCheck "[::cutSpaces [V info parameter]--[v set param1]--[v set param2]]" \ - " {param1 1} {param2 2} --1--2" \ - "parameter move test" - ::errorCheck "[::cutSpaces [V info instinvar]--[V info instpre assProc]--[V info instpost assProc]]"\ - "{7 > 6} { #a comment }--{5 > 4} { #pre }--{5 > 4} { #post }"\ - "Move Class Assertions" - #::errorCheck "[V info metadata]--[V metadata Author]--[V metadata Version]--[V metadata Nothing]"\ - "Version Author Nothing--Uwe--0.0.9--"\ - "Move Metadata" - - set df1 [V info default defaultValueP v dfv1] - set df2 [V info default defaultValueP c dfv2] - set df3 [V info instdefault defaultValueIP v dfv3] - set df4 [V info instdefault defaultValueIP a dfv4] - ::errorCheck "$df1 $dfv1 $df2 $dfv2 $df3 $dfv3 $df4 $dfv4"\ - "0 1 defC 0 1 defA"\ - "Move Default Values" - - ::errorCheck [::info commands X::Y::Z] "" "Moved command still exists" - - # - # copy with filters test - # - foreach filters {{} compositeFilter} { - Composite instfilter $filters - AbstractNode instfilter $filters - Object commands - Class Commands -superclass AbstractNode - Class Command -superclass Commands - Command instproc init args { - my instvar label - set label [self] - next - } - Command instproc setlabel {{arg ""}} { - my instvar label - if {$arg eq ""} { - set label - } else { - set label $arg - } - } - Command instproc setproc {value} { - my instvar src - set src $value - } - # prototypes - Command commands::cellcmd - commands::cellcmd setlabel cell - commands::cellcmd setproc {return "coucou" } - commands::cellcmd proc x args {return xxx} - commands::cellcmd copy toto - ::errorCheck [::toto info class] ::Command "Copy with Filter: info class" - ::errorCheck [toto set label] cell "Copy with Filter: set var" - ::errorCheck [toto x] xxx "Copy with Filter: call proc" - ::errorCheck [commands::cellcmd set label] cell \ - "Copy with Filter: set var" - } - Class A - Class V - Class Z - Class B -superclass A - Class B1 -superclass {V A Z} - A move X - ::errorCheck [B info superclass]-[B1 info superclass]-[X info subclass] \ - "::X-::V ::X ::Z-::B ::B1" \ - "Move of subclass relationship" - } -} - - -@ TestX recreation { - description { Regression test for object recreation/cleanup. } -} - -TestX recreation -proc run {{n 10}} { - for {set i 0} {$i < $n} {incr i} { - set ::recreateResult "" - Class R - R instproc recreate args { - global recreateResult - append recreateResult "*recreate [self] $args* " - set r [next] - append recreateResult "*recreate [self] <[lindex $args 0]> $r * " - return $r - } - Object instmixin R - - catch { - C destroy - c1 destroy - } - Class C -parameter {a b} - C instproc cProc {} {return cProc} - C set r 4 - C set v 5 - - C c1 -a 1 - c1 proc x {} {return p} - c1 set x 3 - C c1 -b 2 - append ::recreateResult "+[c1 info vars]," - append ::recreateResult "[c1 info procs] +" - - Class C - C set w 3 - append ::recreateResult "+[C info vars]," - append ::recreateResult "[C info instprocs] +" - if {$i > 0} { - errorCheck [set ::recreateResult] \ - "*recreate ::xotcl::Class ::R* *recreate ::xotcl::Class <::R> ::R * *recreate ::C ::c1 -b 2* *recreate ::C <::c1> ::c1 * +b, +*recreate ::xotcl::Class ::C* *recreate ::xotcl::Class <::C> ::C * +w, +" \ - "Var/proc recreate delete failed (n)" - } else { - errorCheck [set ::recreateResult] \ - "*recreate ::C ::c1 -b 2* *recreate ::C <::c1> ::c1 * +b, +*recreate ::xotcl::Class ::C* *recreate ::xotcl::Class <::C> ::C * +w, +" \ - "Var/proc recreate delete failed (0)" - } - global recreateMixinResult - global recreateFilterResult - set recreateMixinResult "" - set recreateFilterResult "" - Class RecreateObserve - foreach ip {create destroy instdestroy init configure - recreate cleanup alloc class} { - RecreateObserve instproc $ip args { - append ::recreateMixinResult " [self]+[self class]->[self proc]" - next - } - } - - Class Recreated - Recreated instproc recreationFilter args { - append ::recreateFilterResult " [self]+[self calledclass]->[self calledproc]" - next - } - Recreated instfilter recreationFilter - Recreated mixin RecreateObserve - Recreated instmixin RecreateObserve - - Recreated recreateObj - Recreated recreateObj - recreateObj destroy - errorCheck [set ::recreateFilterResult] \ - " ::recreateObj+::xotcl::Object->configure ::recreateObj+::xotcl::Object->init ::recreateObj+::xotcl::Object->cleanup ::recreateObj+::xotcl::Object->configure ::recreateObj+::xotcl::Object->init ::recreateObj+::xotcl::Object->destroy" \ - "recreateObj - recreateFilterResult" - if {$i == 0} { - errorCheck [set ::recreateMixinResult] \ - " ::Recreated+::RecreateObserve->create ::Recreated+::RecreateObserve->alloc ::recreateObj+::RecreateObserve->configure ::recreateObj+::RecreateObserve->init ::Recreated+::RecreateObserve->create ::Recreated+::RecreateObserve->recreate ::recreateObj+::RecreateObserve->cleanup ::recreateObj+::RecreateObserve->configure ::recreateObj+::RecreateObserve->init ::recreateObj+::RecreateObserve->destroy ::Recreated+::RecreateObserve->instdestroy" \ - "recreateObj - recreateMixinResult (0)" - } else { - errorCheck [set ::recreateMixinResult] \ - " ::Recreated+::RecreateObserve->cleanup ::Recreated+::RecreateObserve->create ::Recreated+::RecreateObserve->alloc ::recreateObj+::RecreateObserve->configure ::recreateObj+::RecreateObserve->init ::Recreated+::RecreateObserve->create ::Recreated+::RecreateObserve->recreate ::recreateObj+::RecreateObserve->cleanup ::recreateObj+::RecreateObserve->configure ::recreateObj+::RecreateObserve->init ::recreateObj+::RecreateObserve->destroy ::Recreated+::RecreateObserve->instdestroy" \ - "recreateObj - recreateMixinResult (n)" - } - } - - set ::cleanupResult "" - - catch {a destroy} - catch {A destroy} - catch {X destroy} - catch {META destroy} - - Class A - A proc instdestroy args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} - A proc recreate args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} - A instproc destroy args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} - A instproc cleanup args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} - - A a - A a::b - errorCheck [set ::cleanupResult] "" "Cleanup Create Failed" - A a - errorCheck [a info children] "" "Cleanup Object Children Destroy Failed" - A a::b - - errorCheck [set ::cleanupResult] \ - " ::A+->recreate ::a+::A->cleanup ::a::b+::A->destroy ::A+->instdestroy" \ - "Cleanup a/a::b Failed (n)" - a destroy; - set ::cleanupResult "" - A instproc cleanup args {append ::cleanupResult " [self]+[self class]->[self proc]"} - - A a - A a::b - errorCheck [set ::cleanupResult] "" "Cleanup Redefine Create Failed" - A a - errorCheck [a info children] ::a::b \ - "Cleanup Redefine Object Children Survive Failed" - A a::b - errorCheck [set ::cleanupResult] \ - " ::A+->recreate ::a+::A->cleanup ::A+->recreate ::a::b+::A->cleanup" \ - "Cleanup Redefine a/a::b Failed" - - a destroy - set ::cleanupResult "" - - - Class META -superclass Class - META proc instdestroy args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} - META proc recreate args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} - META instproc destroy args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} - META instproc cleanup args {append ::cleanupResult " [self]+[self class]->[self proc]"; next} - - META X - META X::Y - errorCheck [set ::cleanupResult] "" "Class Cleanup Create Failed" - META X - errorCheck [X info classchildren] "" "Class Cleanup Class Children Destroy Failed" - META X::Y - errorCheck [set ::cleanupResult] \ - " ::META+->recreate ::X+::META->cleanup ::X::Y+::META->destroy ::META+->instdestroy" \ - "Class Cleanup X/X::Y Failed" - - X destroy - set ::cleanupResult "" - META instproc cleanup args {append ::cleanupResult " [self]+[self class]->[self proc]"} - - META X - META X::Y - errorCheck [set ::cleanupResult] "" "Class Cleanup Redefine Create Failed" - META X - errorCheck [X info classchildren] ::X::Y \ - "Class Cleanup Redefine Class Children Survive Failed" - META X::Y - errorCheck [set ::cleanupResult] \ - " ::META+->recreate ::X+::META->cleanup ::META+->recreate ::X::Y+::META->cleanup" \ - "Class Cleanup Redefine X/X::Y Failed" - - X destroy - A destroy - META destroy - unset ::cleanupResult - - Object instmixin "" -} - - -@ TestX smallScripts { - description { - Regression test object testing arbitrary features. - } -} -TestX smallScripts -proc ::up1 {} { - return [uplevel 1 self] -} -proc ::up3 {} { - return [uplevel 3 self] -} -proc ::up2 {} { - return [up3] -} -smallScripts proc run {{n 20}} { - catch {Object o; o r} errMsg - ::errorCheck $errMsg "::o: unable to dispatch method 'r'" "Unknown Test" - - # uplevel test - for {set i 0} {$i < $n} {incr i} { - Object o - o proc u2 {} {return [::up2]} - o proc u1 {} {return [::up1]} - - Class SM - SM instproc init args { - ::errorCheck [o u1] "::o" "FAILED - UpLevel Test 1" - ::errorCheck [o u2] "::s" "FAILED - UpLevel Test 2" - } - SM s - } - - for {set i 1} {$i < $n} {incr i} { - Class A - A a - set oname1 [Object autoname ooo] - set oname2 [Object autoname -instance OOO] - A autoname -reset AAA - set names [A autoname AAA] - a autoname -reset aaa - lappend names [a autoname aaa] - lappend names [a autoname aaa] - ::errorCheck $names "AAA1 aaa1 aaa2" "Autoname creation" - ::errorCheck $oname1 "ooo$i" "Autoname Object 1" - ::errorCheck $oname2 "oOO$i" "Autoname Object 2" - ::errorCheck [xotcl::Object set __autonames(ooo)] $i \ - "Autoname Object Count" - } - - Class P; P p - P instproc x {} { - my instvar "x(1) t" - return $t - } - p set x(1) rrr - ::errorCheck [p x] rrr "Array member alias, no ns" - - Object o - o proc x {} { - my instvar "x(1) t" - return $t - } - o set x(1) rrr - ::errorCheck [o x] rrr "Array member alias, with ns" - - Object o - o proc x args {puts r} - ::errorCheck [o info body x] "puts r" "Info Body" - ::errorCheck [info body o::x] "puts r" "Info Body" - - Object o - o proc a {} { - my lappend table(i) xxx - } - ::errorCheck [o a]-[o set table(i)] "xxx-xxx" "Array instvar create" - - Class A - A instproc myProc args {} - Class Mix1 - Mix1 instproc myProcMix1 args {} - Class Mix2 - Mix2 instproc myProcMix2 args {} - Class B -superclass A -instmixin Mix1 - B instproc myProc2 args {} - B b -mixin Mix2 - b proc objproc args {} - - ::errorCheck [b info procs] objproc "info procs" - ::errorCheck [B info instprocs] myProc2 "info instprocs" - - ::errorCheck [lsort [b info methods]] "__next abstract append array autoname check class cleanup configure contains copy defaultmethod destroy eval exists extractConfigureArg f filter filterguard filtersearch forward hasclass incr info infoTraceFilter init instvar invar isclass ismetaclass ismixin isobject istype lappend method mixin mixinguard move myProc myProc2 myProcMix1 myProcMix2 noinit objproc parametercmd proc procsearch requireNamespace self set setFilter signature subst trace unset uplevel upvar volatile vwait" "b info methods" - - ::errorCheck [lsort [b info methods -nocmds]] "abstract contains copy defaultmethod extractConfigureArg f hasclass infoTraceFilter init method move myProc myProc2 myProcMix1 myProcMix2 objproc self setFilter signature" "b info methods -nocmds" - - ::errorCheck [lsort [b info methods -noprocs]] "__next append array autoname check class cleanup configure destroy eval exists filter filterguard filtersearch forward incr info instvar invar isclass ismetaclass ismixin isobject istype lappend mixin mixinguard noinit parametercmd proc procsearch requireNamespace set subst trace unset uplevel upvar volatile vwait" "b info methods -noprocs" - ::errorCheck [lsort [b info methods -nocmds -nomixins]] "abstract contains copy defaultmethod extractConfigureArg f hasclass infoTraceFilter init method move myProc myProc2 objproc self setFilter signature" "b info methods -nocmds -nomixins" - - ::errorCheck [b info methods -nocmds -noprocs] "" "b info methods -nocmds -noprocs" - - ::errorCheck [lsort [B info methods -nocmds]] "abstract allinstances contains copy defaultmethod extractConfigureArg f hasclass infoTraceFilter init method move parameter self setFilter signature uses" "B info methods -nocmds" - - namespace eval a { - proc o args {return o} - } - namespace eval a::b { - proc b args {return b} - } - - Object a - a requireNamespace - - set r [a::b::b] - - Object a::b - a::b proc x args { - return x - } - set r "$r-[a::b x]-[a o]" - ::errorCheck $r b-x-o "Tcl Namespace should survive requireNamespace" - - xotcl::interp create in - set ::r [in eval { - namespace import -force xotcl::* - Object o}] - xotcl::interp delete in - ::errorCheck $::r ::o "XOTcl slave interpreter " - - Object o -requireNamespace - o set r 1 - after 100 {o set r 3} - o vwait r - ::errorCheck [o set r] 3 "Vwait test" - - Class NS - Class NS::Main - - NS::Main proc m1 {} { - my m2 - } - - NS::Main proc m2 {} { - namespace eval :: Object toplevelObj - } - - NS::Main m1 - ::errorCheck [::toplevelObj set a 1] 1 "toplevel object allocated in ns" - - - namespace eval foo { - Class Foo - Foo instproc blah {} {puts jou} - Foo proc bar {} {puts bar} - } - namespace delete foo - ::errorCheck [Object isobject ::foo::Foo] 0 "Namespace delete under object" - - # destroy test - set x [Object create x] - x destroy - ::errorCheck [catch {$x set a 1}] 1 "Reference to destroyed object still valid" - - Object create x -volatile - unset x - ::errorCheck [catch {x destroy}] 1 "Object should not exist anymore" - - Object create x -volatile - x destroy - ::errorCheck [catch {unset x}] 1 "Variable should not exist anymore" -} - - -@ TestX objectReferences { - description { - Regression test for object and class references in tcl_objs - } -} - -TestX objectReferences -proc run {{n 20}} { - my proc ok01 {} { - Class AAA - AAA destroy - Class AAA - } - my proc ok02 {} { - Class ::AAA - AAA destroy - Class AAA - } - my proc ok03 {} { - Class ::AAA - ::AAA destroy - Class AAA - } - my proc ok04 {} { - Class ::AAA - ::AAA destroy - Class ::AAA - } - my proc ok05 {} { - set c [Class AAA] - $c destroy - Class AAA - } - my proc ok06 {} { - set c [Class ::AAA] - $c destroy - Class AAA - } - my proc ok07 {} { - set c [Class ::AAA] - $c destroy - Class ::AAA - } - my proc ok08 {} { - set c [Class ::AAA] - $c destroy - Class $c - } - my proc ok09 {} { - [Class AAA] destroy - Class AAA - } - my proc ok10 {} { - [Class ::AAA] destroy - Class AAA - } - my proc ok11 {} { - [Class ::AAA] destroy - Class ::AAA - } - - - for {set i 1} {$i < 20} {incr i} { - # "reference to xotcl object in instvar" - Class LexxTreeMounter - Class LexxTree - LexxTreeMounter proc new {args} { - if {[LexxTree exists LexxTreeMounter]} { - set o [LexxTree set LexxTreeMounter] - } else { - set o [my create [my autoname [self]]] - } - $o incr C(refcnt) - return $o - } - LexxTreeMounter instproc init {args} { - my instvar C - set C(refcnt) 0 - if {[LexxTree exists LexxTreeMounter] == 0} { - LexxTree set LexxTreeMounter [self] - } - next - } - set x [LexxTreeMounter new] - set x [LexxTreeMounter new] - - ::errorCheck [llength [LexxTreeMounter info instances]] 1 singleton - - # "Global reference to xotcl object" - set ::v [Object ::a] - set ::w [Object ::b] - set ::z(1) [Object ::c] - unset ::v - - # "Class creation and Class destroys, after 2nd round procs contain xotcl-object references" - foreach m [lsort [my info procs ok*]] {my $m} - ::errorCheck [my isobject AAA] 1 classdestroys - } - - catch {UnknownClass destroy} - set ::utest "" - Class proc __unknown args { - lappend ::utest $args - set x [Class $args] - set r [$x] - #puts r=$r - return $r - } - Class O -superclass UnknownClass - ::errorCheck $::utest ::UnknownClass "__unknown 1" - - Object o - ::errorCheck [o mixin XX1] ::XX1 "__unknown XX1" - - namespace eval "" { - Object o - ::errorCheck [o mixin XX2] ::XX2 "__unknown XX2" - } - - namespace eval "::" { - Object o - ::errorCheck [o mixin XX3] ::XX3 "__unknown XX3" - } - - - # this version of unknown creates gobal objects - Class proc __unknown {name} { - #puts "unkown called with $name" - set name ::[namespace tail $name] - set x [Class $name] - set r [$x] - #puts "... created $r" - return $r - } - - Object o - ::errorCheck [o mixin XY1] ::XY1 " __unknown XY1" - - namespace eval "" { - Object o - ::errorCheck [o mixin XY2] ::XY2 " __unknown XY2" - } - - namespace eval :: { - Object o - ::errorCheck [o mixin XY3] ::XY3 " __unknown XY3" - } - - Class C - namespace eval ::tmp { - Object o -mixin C - ::errorCheck [o mixin XY4] ::XY4 " __unknown XY4" - } - - - - ::errorCheck [lsort [UnknownClass info info]] {args body children class classchildren classparent commands default filter filterguard forward heritage info instances instbody instcommands instdefault instfilter instfilterguard instforward instinvar instmixin instpost instpre instprocs invar methods mixin parameter parent post pre precedence procs subclass superclass vars} "info info" - - ::errorCheck [Class info instances *Unk*] ::UnknownClass "match in info instances" - ::errorCheck [Class info instances Unk*] "" "no match in info instances" - ::errorCheck [Class info instances Unk] "" "no match in info instances (no metachars)" - ::errorCheck [Class info class] ::xotcl::Class "info class of Class" - ::errorCheck [Class info class Object] 1 "info class of Class Object" - Class C - Class D -superclass C - Class E -superclass D -parameter {{x 1}} - E instproc t {a b {c 1}} {return ok} - E proc p {a b {c 1}} {return ok} - E instproc q {} {return [self proc]} - ::errorCheck [C info subclass E] 1 "transitive subclass 1" - ::errorCheck [Object info subclass E] 1 "transitive subclass 2" - ::errorCheck [D info subclass C] 0 "transitive subclass 3" - ::errorCheck [E info heritage] "::D ::C ::xotcl::Object" "heritage" - ::errorCheck [E info instargs t] "a b c" "instargs" - ::errorCheck [E info instdefault t c x] 1 "instdefault" - ::errorCheck [E info args p] "a b c" "args" - ::errorCheck [E info default p c x] 1 "default" - ::errorCheck [E configure [list -p -x -y]] 0 "list params 1" - ::errorCheck [E e1 [list -t -1 -e -3]] ::e1 "list params 2" - ::errorCheck [e1 x] 1 "instparameter cmd 1" - ::errorCheck [e1 x 2] 2 "instparameter cmd 2" - ::errorCheck [e1 x] 2 "instparameter cmd 3" - ::errorCheck [e1 parametercmd y] "" "parametercmd 1" - ::errorCheck [e1 y 3] 3 "parametercmd 2" - ::errorCheck [e1 y] 3 "parametercmd 3" - ::errorCheck [e1 forward regexp -objscope] "" "forward 1" - ::errorCheck [e1 regexp (y) xyz _ X] "1" "forward 2" - ::errorCheck [e1 exists X] "1" "forward 3" - ::errorCheck [e1 q] q "self proc" - - ::errorCheck [E info commands] {p slot} "class commands" - ::errorCheck [E info instcommands] "t x q" "class instcommands" - ::errorCheck [E info instbody t] "return ok" "class info instbody" - - Object o - Object o::abc - Object o::bcd - Object o::cde - namespace eval ns1 {Class C; namespace export C} - o eval {namespace import ::ns1::*} - - ::errorCheck [o info children] "::o::cde ::o::bcd ::o::abc" "info children 1" - ::errorCheck [o info children *cd*] "::o::cde ::o::bcd" "info children 2" - ::errorCheck [o info children ::o::cde] ::o::cde "info children 3" - ::errorCheck [o info children ::o::def] "" "info children 4" - Object new -childof o - ::errorCheck [llength [o info children]] 4 "info children 5" - - ::errorCheck [Object isobject o] 1 "is object 1" - ::errorCheck [Object isobject ox] 0 "is object 2" - - Class M -superclass Class - ::errorCheck [Object ismetaclass M] 1 "is metaclass 1" - ::errorCheck [Object ismetaclass C] 0 "is metaclass 0" - - Class C -parameter {number name} - C instproc test {} { - my instvar {number x} name - return [list $name $x] - } - C c -name koen -number 25 - ::errorCheck [c test] "koen 25" "instvar with alias" -} - - -@ TestX condMixins { - description { - Regression test for conditional mixins - } -} - -TestX create condMixins -proc show {c obj} { - set ::context $c - set r [list] - foreach x [list \ - [list $obj info methods salary] \ - [list $obj info methods -incontext salary] \ - [list $obj info methods driv*] \ - [list $obj info methods -incontext driv*] \ - ] { - lappend r "$::context: $x => [lsort [eval $x]]" - } - return $r -} -condMixins proc run {{n 20}} { - Object instproc signature {} {return "[self] [my info class] ([my age] years)"} - Class Person -parameter {id name age} - - Class Payroll-aspect -parameter salary - Payroll-aspect instproc print {} {puts "[my signature]: [my salary]"} - Class Driver-aspect -parameter driving-license - Payroll-aspect instproc print {} {puts "[my signature]: [my driving-license]"} - - Person instmixin {{Payroll-aspect -guard {[string equal $::context "payrollApp"]}}} - Person jim -mixin {{Driver-aspect -guard {[string equal $::context "shipmentApp"]}}} - - set ::context payrollApp - - ::errorCheck [lsort [jim info methods]] "__next abstract age append array autoname check class cleanup configure contains copy defaultmethod destroy driving-license eval exists extractConfigureArg filter filterguard filtersearch forward hasclass id incr info init instvar invar isclass ismetaclass ismixin isobject istype lappend method mixin mixinguard move name noinit parametercmd print proc procsearch requireNamespace salary self set signature subst trace unset uplevel upvar volatile vwait" "condmixin all methods" - - ::errorCheck "[lsort [jim info methods -incontext]]" "__next abstract age append array autoname check class cleanup configure contains copy defaultmethod destroy eval exists extractConfigureArg filter filterguard filtersearch forward hasclass id incr info init instvar invar isclass ismetaclass ismixin isobject istype lappend method mixin mixinguard move name noinit parametercmd print proc procsearch requireNamespace salary self set signature subst trace unset uplevel upvar volatile vwait" "all methods in context" - - ::errorCheck [my show payrollApp jim] "{payrollApp: jim info methods salary => salary} {payrollApp: jim info methods -incontext salary => salary} {payrollApp: jim info methods driv* => driving-license} {payrollApp: jim info methods -incontext driv* => }" "payrollApp jim" - ::errorCheck [my show shipmentApp jim] "{shipmentApp: jim info methods salary => salary} {shipmentApp: jim info methods -incontext salary => } {shipmentApp: jim info methods driv* => driving-license} {shipmentApp: jim info methods -incontext driv* => driving-license}" "shipmentApp jim" - -} - - -@ TestX volatileObjects { - description { - Regression test for volatile objects - } -} - -TestX create volatileObjects -volatileObjects proc inscope {} { - set r 0 - set y 0 - set z 0 - set c [C new -volatile] - catch {incr r [$c test]} - catch {set y [$c y]} - catch {set z [$c z]} - if {[catch {set u [$c u]} err]} {puts stderr $err} - return $r-[llength [C info instances]]-$y-$z-$u -} -volatileObjects proc run {{n 20}} { - Class create ::xotcl::_creator -instproc create {args} { - set result [next] - return $result - } - Class instproc f args { - #puts stderr "*****F [self calledproc]" - return [next] - } - - Class C -parameter {{x 0}} - C instproc f args { - #puts stderr "*****C [self calledproc]" - return [next] - } - C instproc test {} { my incr x } - C instproc y {} { my instvar x; incr x } - C instproc z {} { my set x 10 } - C instproc u {} { upvar [self callinglevel] z b; info exists b } - - Class create ::xotcl::I -instproc instvar args { - #puts [self proc] - next - } -instproc set args { - #puts [self proc] - next - } -instproc u args { - #puts [self proc] - next - } - - ::errorCheck [llength [C info instances]] 0 "foreign instances" - ::errorCheck [my inscope] 1-1-2-10-1 "volatile objects in scope" - ::errorCheck [llength [C info instances]] 0 "instances survived scope" - - Class instmixin ::xotcl::_creator - ::errorCheck [my inscope] 1-1-2-10-1 "volatile objects in scope through mixin" - ::errorCheck [llength [C info instances]] 0 \ - "instances survived scope through mixin" - - Class instfilter f - ::errorCheck [my inscope] 1-1-2-10-1 \ - "volatile objects in scope through mixin + filter" - ::errorCheck [llength [C info instances]] 0 \ - "instances survived scope through mixin + filter" - - Class instmixin {} - - Class instfilter f - ::errorCheck [my inscope] 1-1-2-10-1 \ - "volatile objects in scope through filter" - ::errorCheck [llength [C info instances]] 0 \ - "instances survived scope through filter" - - Class instfilter {} - C instmixin ::xotcl::I - ::errorCheck [my inscope] 1-1-2-10-1 \ - "instvar overload in scope through mixin" - - C instfilter f - ::errorCheck [my inscope] 1-1-2-10-1 \ - "instvar overload in scope through mixin and filter" - - C instfilter {} - Class instproc f {} {} -} - - - -TestX create uplevelCmds -uplevelCmds proc upproc {} { - lappend ::result [list \ - self=[self] \ - up1=[uplevel 1 self] \ - up2=[uplevel 2 self] \ - up3=[uplevel 3 self] ] -} -uplevelCmds proc run {{n 20}} { - Object o1 -proc m {} { - set ::result [list] - lappend ::result [list \ - self=[self] \ - up1=[uplevel 1 self] \ - up2=[uplevel 2 self] \ - up3=[uplevel 3 self] ] - uplevelCmds::upproc - return $::result - } - Object o2 -proc m {} { - o1 m - } - Object o3 -proc m {} { - o2 m - } - Object o4 -proc m {} { - o3 m - } - ::errorCheck [o4 m] \ - "{self=::o1 up1=::o2 up2=::o3 up3=::o4} {self=::o1 up1=::o1 up2=::o2 up3=::o3}" \ - "uplevel self" - o4 m - - proc showstack {} { - set l [info level] - for {set i $l} {$i>0} {incr i -1} { - set vars [uplevel \#$i info vars] - upvar \#$i what w - if {![info exists w]} {set w ""} - puts "$i: $w[info level $i] vars=$vars" - } - } - - Class C - C instproc u0 {} { - upvar [self callinglevel] x y; incr y - return [uplevel [self callinglevel] {incr x 1}] - } - C instproc u1 {} { - upvar [self callinglevel] x y; incr y - set r [uplevel [self callinglevel] {incr x 1}] - set z [uplevel [self activelevel] incr z] - return $z-$r - } - C instproc p0 {y} { - set x $y - set r [my u0] - return $r-$x - } - C instproc p1 {y} { - set z 0 - set x $y - set r [my u1] - return $r-$x - } - Class D -superclass C - D instproc u0 {} { - upvar [self callinglevel] x y; incr y - return [uplevel [self callinglevel] {incr x 1}] - } - D instproc u1 {} { - set z [uplevel [self activelevel] incr z] - set r [next] - return $z-$r - } - Class M - M instproc u1 {} { - set z [uplevel [self activelevel] incr z] - set r [next] - return $z-$r - } - Object instproc f args { - next - } - - D create d1 - errorCheck [d1 p0 1] 3-3 "simple uplevel" - errorCheck [d1 p1 1] 2-2-3-3 "uplevel through next in class hierarchy + activelevel" - D instmixin M - errorCheck [d1 p1 1] 1-3-3-3-3 "uplevel through mixin and class hierarchy + activelevel" - Object instfilter f - errorCheck [d1 p1 1] 1-3-3-3-3 "uplevel through filter, mixin and class hierarchy + activelevel" - Object instfilter "" - D instmixin {} - - # now again the same tests with upvar and uplevel methods - - C instproc u0 {} { - my upvar [self callinglevel] x y; incr y - return [my uplevel {incr x 1}] - } - C instproc u1 {} { - my upvar [self callinglevel] x y; incr y - set r [my uplevel {incr x 1}] - set z [my uplevel [self activelevel] incr z] - return $z-$r - } - D instproc u0 {} { - my upvar [self callinglevel] x y; incr y - return [my uplevel {incr x 1}] - } - Class M - M instproc u1 {} { - set z [my uplevel [self activelevel] incr z] - set r [next] - return $z-$r - } - errorCheck [d1 p0 1] 3-3 "upvar method: simple uplevel" - errorCheck [d1 p1 1] 2-2-3-3 \ - "upvar method: uplevel through next in class hierarchy + activelevel" - D instmixin M - errorCheck [d1 p1 1] 1-3-3-3-3 \ - "upvar method: uplevel through mixin and class hierarchy + activelevel" - Object instfilter f - errorCheck [d1 p1 1] 1-3-3-3-3 \ - "upvar method: uplevel through filter, mixin and class hierarchy + activelevel" - Object instfilter "" - D instmixin {} - - # now again the same tests with upvar and uplevel methods with default levels - - C instproc u0 {} { - my upvar x y; incr y - return [my uplevel {incr x 1}] - } - C instproc u1 {} { - my upvar x y; incr y - set r [my uplevel {incr x 1}] - set z [my uplevel [self activelevel] incr z] - return $z-$r - } - D instproc u0 {} { - my upvar x y; incr y - return [my uplevel {incr x 1}] - } - Class M - M instproc u1 {} { - set z [my uplevel [self activelevel] incr z] - set r [next] - return $z-$r - } - errorCheck [d1 p0 1] 3-3 "upvar method: simple uplevel (dl)" - errorCheck [d1 p1 1] 2-2-3-3 \ - "upvar method: uplevel through next in class hierarchy + activelevel (dl)" - D instmixin M - errorCheck [d1 p1 1] 1-3-3-3-3 \ - "upvar method: uplevel through mixin and class hierarchy + activelevel (dl)" - Object instfilter f - errorCheck [d1 p1 1] 1-3-3-3-3 \ - "upvar method: uplevel through filter, mixin and class hierarchy + activelevel (dl)" - Object instfilter "" - D instmixin {} - - C instproc selftest args { - return [self class]/[self isnextcall]-[next] - } - D instproc selftest args { - return [self class]/[self isnextcall]-[next] - } - errorCheck [d1 selftest] "::D/0-::C/1-" \ - "self isnextcall" - - Object instproc each {objName body} { - #puts " *** level = [info level] self callinglevel = [self callinglevel]" - uplevel [self callinglevel] [list foreach $objName [lsort [[self] info children]] $body] - } - - Class TestB - Class TestA - TestA instproc init {args} { - next - TestB [self]::b1 - TestB [self]::b2 - TestB [self]::b3 - } - - Class Test - Test instproc init {args} { - next - TestA [self]::a1 - TestA [self]::a2 - TestA [self]::a3 - } - Test instproc loop1 {} { - set i 0 - [self] each a { - incr i - #puts "$a" - } - #puts "Total = $i" - return $i - } - Test instproc loop2 {} { - set i 0 - [self] each a { - incr i - #puts "$a" - $a each b { - incr i - #puts " $b" - } - } - #puts "Total = $i" - return $i - } - Object instproc f args {next} - - Test t - - errorCheck [t loop1] 3 "uplevel eval loop" - errorCheck [t loop2] 12 "nested uplevel eval loop" - t filter f - errorCheck [t loop1] 3 "uplevel eval loop" - errorCheck [t loop2] 12 "nested uplevel eval loop" - t destroy - -} - - -TestX create namespaceCommands -proc run {{n 20}} { - errorCheck [catch { - namespace eval foo { - Class m - Object o -mixin m - } - }] 0 "mixin resolved from namespace" - - Class create ::xotcl::_creator -instproc create {args} { - set result [next] - return $result - } - - errorCheck [catch { - namespace eval bar { - Class A - namespace export A - } - - namespace eval foo { - Class M -superclass Class - - namespace import ::bar::* - Class B -superclass A -instmixin M - - Class instmixin ::xotcl::_creator - Class C -superclass A -instmixin B - Class instmixin "" - } - } error] 0 "mixin and Class resolve and import into namespace\n$error" - -} - -TestX create metaClassAsMixin -proc run {{n 20}} { - Class create A -instmixin Class - Class create B -superclass A - B create b1 - errorCheck [A ismetaclass]-[B ismetaclass]-[b1 ismetaclass]-[b1 isclass] \ - "1-1-0-1" "metaclass through mixin" -} - -TestX create nonposargs -proc run {{n 20}} { - Object o - o set result "" - o proc test1 {-x:switch y} { - my append result "x=$x y=$y, " - } - o test1 1 - o test1 -x 1 - - o proc test2 {{-x:switch true} y} { - my append result "x=$x y=$y, " - } - o test2 2 - o test2 -x 2 - - o proc test3 {{-x:switch false} y} { - my append result "x=$x y=$y, " - } - o test3 3 - o test3 -x 3 - errorCheck [o set result] \ - "x=0 y=1, x=1 y=1, x=true y=2, x=0 y=2, x=false y=3, x=1 y=3, " \ - "nonpos args switch" - - Object o - o proc x {a b} { - return "$a $b" - } - o proc x {} {a b} { - return "$a $b" - } - o proc y {-x {-a {1 2 3}}} {a b} { - return "$args" - } - o proc z1 {-x:required {-a {1 2 3}}} {a args} { - return "$x -- $args" - } - o proc z2 {-x:required {-a {1 }} {-b {1 2}}} {args} {return "$x -- $args -- $a -- $b"} - o proc z3 {-b:boolean} {arg} { - return "$b $arg" - } - Object colorchecker - colorchecker proc color {var value} { - lappend ::r "color <$var> <$value>" - } - colorchecker proc reddish {var value} { - lappend ::r "reddish <$var> <$value>" - } - - o proc z4 {{{-b: required, checkobj colorchecker,color, reddish, - checkobj xotcl::nonposArgs,required} red} - {{-c: required }}} {arg} { - lappend ::r "$b $arg" - return "$b $arg" - } - o proc z5 {-pos args} { - return [list $pos $args] - } - - Class P - P instproc x {a b} { - return "$a $b" - } - P instproc z2 {-x:required {-a 1} {-b {1 2}}} {args} {return "$x -- $args -- $a -- $b"} - - P instproc z3 {-x:required {-a 1} {-b {1 2}}} {a b c} { - return "$x -- $args -- $a -- $b" - } - P p - - errorCheck [o x 1 2] "1 2" "Ordinary Method" - errorCheck [p x 3 4] "3 4" "Ordinary Method (2)" - catch { - o y 4 56 5 - } m - errorCheck $m {unknown argument '5' for method 'y': valid arguments -x {-a {1 2 3}} a b} "wrong \# check 1" - catch { - o y - } m - errorCheck $m "wrong # args for method 'y': valid arguments -x {-a {1 2 3}} a b" "wrong \# check 2" - catch { - o y -x 1 - } m - errorCheck $m "wrong # args for method 'y': valid arguments -x {-a {1 2 3}} a b" "wrong \# check 3" - catch { - o z1 a 1 2 3 - } m - errorCheck $m "required arg: 'x' missing" "required missing" - errorCheck [o z1 -x 1 a 1 2 3] "1 -- 1 2 3" "invocation 1" - errorCheck [o z2 -x 2 a 1 2 3] "2 -- a 1 2 3 -- 1 -- 1 2" "invocation 2" - catch { - o y -x 1 -a 2 2 3 - } m - errorCheck $m "can't read \"args\": no such variable" "args unset?" - errorCheck [o z2 -a 2 -x 1 -b 3 a b c] \ - "1 -- a b c -- 2 -- 3" "invocation 3" - errorCheck [p z2 -x 1 -a 2 -b 3 a b c] \ - "1 -- a b c -- 2 -- 3" "invocation 4" - - errorCheck [o z3 -b true -- -b] "true -b" "dash dash" - - errorCheck [o z5 -pos 1 a b] "1 {a b}" "nonpos with given args" - errorCheck [o z5 -pos 1 a] "1 a" "nonpos with given args" - errorCheck [o z5 -pos 1] "1 {}" "nonpos without given args" - - catch { - o z3 -b abc -- -b - } m - errorCheck $m "non-positional argument: 'b' with value 'abc' is not of type boolean" "not boolean" - - set ::r "" - o z4 -c 1 1 - errorCheck $::r "{color } {reddish } {red 1}" \ - "multiple check options + checkobject" - - errorCheck [o info body z2] {return "$x -- $args -- $a -- $b"} "info body 1" - errorCheck [P info instbody z2] {return "$x -- $args -- $a -- $b"} "info instbody z2" - errorCheck [o info args z4] {arg} "info args" - errorCheck [o info nonposargs z4] "{{-b:required,checkobj colorchecker,color,reddish,checkobj xotcl::nonposArgs,required} red} -c:required" "info nonposargs 1" - errorCheck [o info nonposargs x] {} "info nonposargs 2" - errorCheck [P info instargs z3] {a b c} "info instargs" - errorCheck [P info instnonposargs z3] {-x:required {-a 1} {-b {1 2}}} "info instnonposargs 1" - errorCheck [P info instnonposargs x] {} "info instnonposargs 2" - - - Object o - o proc foo {{-a apple}} {{b banana}} { - return [list [info locals] a: $a b: $b] - } - o proc foo2 {{-a apple}} {{b banana} {c apple}} { - return [list [info locals] a: $a b: $b c: $c] - } - o proc foo3 {{-a apple}} {x y {b banana} {c apple}} { - return [list [info locals] x: $x y: $y a: $a b: $b c: $c] - } - - errorCheck [o foo] [list {a b} a: apple b: banana] \ - "non pos + default values 1" - errorCheck [o foo -a ack] [list {a b} a: ack b: banana] \ - "non pos + default values 2" - errorCheck [o foo bar] [list {a b} a: apple b: bar] \ - "non pos + default values 3" - errorCheck [o foo -a ack bar] [list {a b} a: ack b: bar] \ - "non pos + default values 4" - errorCheck [o foo2 -a ack] [list {a b c} a: ack b: banana c: apple] \ - "non pos + default values 5" - errorCheck [ o foo3 -a ack 1 2] [list {x y a b c} x: 1 y: 2 \ - a: ack b: banana c: apple] \ - "non pos + default values 6" - - Object o - o proc foo {{-foo 1}} {} { - #puts "foo: $foo" - } - o foo - o foo -foo 0 - catch {o foo -foo} msg - errorCheck $msg "Non positional arg '-foo': value missing" "Empty non-pos arg" - - Object oa - oa proc foo {{-a A}} {b} { - #puts "$a $b" - } - oa foo "B" - oa foo "-" - oa foo "---" - catch {oa foo "--"} msg - - errorCheck $msg "wrong # args for method 'foo': valid arguments {-a A} b" "Non-pos arg: double dash alone" - - Class C - C create c1 - C instproc m2 { - {-flag:boolean false} - } {x y {z 15}} { - return $flag-$z - } - c1 proc m14 { - {-flag:boolean false} - } {x y {z 15}} { - return $flag-$z - } - - errorCheck [list [c1 m14 1 2 3] [c1 info args m14] \ - [c1 info default m14 z e] [set e]] \ - "false-3 {x y z} 1 15" \ - "Defaults proc" - - - errorCheck [list [c1 m2 1 2 3] [C info instargs m2]] \ - "false-3 {x y z}" \ - "info instargs" - - errorCheck [list [C info instdefault m2 x d] [C info instdefault m2 z d] [set d]] \ - "0 1 15" \ - "Defaults for instproc" - - catch {C info instdefault m2 xxx e} msg - errorCheck $msg "method 'm2' doesn't have an argument 'xxx'" \ - "Defaults instproc error" - - C instproc m3 { - {-flag:boolean} - } {x y z} { - return hu3 - } - - errorCheck [c1 m3 1 2 3] "hu3" "Defaults instproc no flag" - - Object o - o proc f1 {{-x:boolean true} a } { - if {![info exists a]} {error "pos arg a does not exist"} - if {$x ne "true"} {error "x $x ne true"} - if {$a ne "x"} {error "a $a ne x"} - if {[info exists args]} {error "args still exists"} - } - o proc f2 {{-x:boolean true} {a x}} { - if {![info exists a]} {error "pos arg a does not exist"} - if {$x ne "false"} {error "x $x ne false"} - if {$a ne "x"} {error "a $a ne x"} - if {[info exists args]} {error "args still exists"} - } - o proc f3 {{-x:boolean true} } { - if {$x ne "true"} {error "x $x ne true"} - if {[info exists args]} {error "args still exists"} - } - o proc p0 {{-x 1} a} { - #puts "--- [self proc] x=$x [info exists a]" - if {![info exists a]} {error "pos arg a does not exist"} - if {$a != 1} {error "a $a != 1"} - if {$x != 1} {error "x $x != 1"} - if {[info exists args]} {error "args still exists"} - } - o proc p1 {{-x 1} a args} { - #puts "--- [self proc] x=$x [info exists a] args=$args" - if {![info exists a]} {error "pos arg a does not exist"} - if {$a != 1} {error "a $a != 1"} - if {$x != 1} {error "x $x != 1"} - if {$args ne ""} {error "args $args ne {}"} - } - o proc p2 {{-x 1} args} { - if {$x != 1} {error "x $x != 1"} - if {$args ne ""} {error "args $args ne {}"} - } - o proc p3 {{-x 1} args} { - if {$x != 1} {error "x $x != 1"} - if {$args ne "a b c"} {error "args $args ne {}"} - } - o proc p4 {{-x 1} args} { - if {$x != 2} {error "x $x != 2"} - if {$args ne "a b c"} {error "args $args ne {a b c}"} - } - o proc p5 {{-x 1} a args} { - #puts "--- [self proc] x=$x [info exists a] args=$args" - if {![info exists a]} {error "pos arg a does not exist"} - if {$a != 1} {error "a $a != 1"} - if {$x != 1} {error "x $x != 1"} - if {$args ne "a b c"} {error "args $args ne {a b c}"} - } - o proc p6 {{-x 1} a args} { - #puts "--- [self proc] x=$x [info exists a] args=$args" - if {![info exists a]} {error "pos arg a does not exist"} - if {$a != 1} {error "a $a != 1"} - if {$x != 2} {error "x $x != 2"} - if {$args ne "a b c"} {error "args $args ne {a b c}"} - } - o proc p7 {{-x 1} a args} { - #puts "--- [self proc] x=$x [info exists a] args=$args" - if {![info exists a]} {error "pos arg a does not exist"} - if {$a != 1} {error "a $a != 1"} - if {$x != 2} {error "x $x != 2"} - if {$args ne ""} {error "args $args ne {}"} - } - o proc p8 {{-x 1} {a 1} args} { - #puts "--- [self proc] x=$x [info exists a] args=$args" - if {![info exists a]} {error "pos arg a does not exist"} - if {$a != 1} {error "a $a != 1"} - if {$x != 2} {error "x $x != 2"} - if {$args ne ""} {error "args $args ne {}"} - } - errorCheck [catch {o f1 x}] 0 nonpos-1 - errorCheck [catch {o f1 -y 1}] 1 nonpos-2 - errorCheck [catch {o f1 -x false}] 1 nonpos-3 - errorCheck [catch {o f2 -x false}] 0 nonpos-4 - errorCheck [catch {o f3}] 0 nonpos-5 - errorCheck [catch {o f3 -x true -y 1}] 1 nonpos-6 - errorCheck [catch {o f3-y 1}] 1 nonpos-7 - errorCheck [catch {o p0 1}] 0 nonpos-8 - errorCheck [catch {o p1 1}] 0 nonpos-9 - errorCheck [catch {o p1 }] 1 nonpos-10 - errorCheck [catch {o p2 }] 0 nonpos-11 - errorCheck [catch {o p3 a b c}] 0 nonpos-12 - errorCheck [catch {o p4 -x 2 a b c}] 0 nonpos-13 - errorCheck [catch {o p5 1 a b c}] 0 nonpos-14 - errorCheck [catch {o p7 -x 2 1}] 0 nonpos-15 - errorCheck [catch {o p7 -x 2 }] 1 nonpos-16 - errorCheck [catch {o p8 -x 2 }] 0 nonpos-17 - o destroy -} - - -TestX copymove2 -proc run {{n 10}} { - # Composite - Class Composite -superclass Class - Composite instproc addop {op} { - my instvar ops - set ops($op) $op - } - Composite instproc compositeFilter args { - set m [self calledproc] - set c [lindex [self filterreg] 0] - set r [next] - - if {[$c exists ops($m)]} { - foreach child [my info children] { - eval [self]::$child $m $args - } - } - return $r - } - - Composite AbstractNode - AbstractNode abstract instproc iterate v - AbstractNode addop iterate - for {set i 0} {$i < $n} {incr i} { - # - # class copy - # - foreach filters {{} compositeFilter} { - Composite instfilter $filters - AbstractNode instfilter $filters - Object commands - Class Commands -superclass AbstractNode - Class Command -superclass Commands - Command instproc init args { - my instvar label - set label [self] - next - } - Command instproc setlabel {{arg ""}} { - my instvar label - if {$arg eq ""} { - set label - } else { - set label $arg - } - } - Command instproc setproc {value} { - my instvar src - set src $value - } - # prototypes - Command commands::cellcmd - commands::cellcmd copy toto - } - } -} - -TestX proc run {} { - foreach test [lsort [TestX info instances]] { - $test run - } -} - -puts "XOTcl - Test" - -puts "Time used: [time {TestX run} 1]" - -# toplevel tests ################################################# -Class instmixin {} -C instmixin {} -set o [C new -volatile];errorCheck [Object isobject $o] 1 "topLevel, check object 1 - $o" -Class instmixin ::xotcl::_creator -set o [C new -volatile];errorCheck [Object isobject $o] 1 "topLevel, check object 2 - $o" -C instmixin ::xotcl::I -set o [C new -volatile];errorCheck [Object isobject $o] 1 "topLevel, check object 3 - $o" -foreach i [C info instances] {$i destroy} - -proc x {} { - Class instmixin {} - C instmixin {} - set c0 [llength [C info instances]] - set o [C new -volatile]; errorCheck [Object isobject $o] 1 "x, check object" - Class instmixin ::xotcl::_creator - set o [C new -volatile]; errorCheck [Object isobject $o] 1 "x, check object" - C instmixin ::xotcl::I - set o [C new -volatile]; errorCheck [Object isobject $o] 1 "x, check object" - set c1 [llength [C info instances]] - errorCheck [expr {$c1 - $c0 != 3}] 0 "exit x, three more objects" -} - -x -errorCheck [expr {[llength [C info instances]] > 0}] 0 "top, all volatile object gone" - -proc x1 {} { - set c0 [llength [C info instances]] - set o [C new -volatile]; errorCheck [Object isobject $o] 1 "x1, check object" - x - set o [C new -volatile]; errorCheck [Object isobject $o] 1 "x1, check object" - set c1 [llength [C info instances]] - errorCheck [expr {$c1 - $c0 != 2}] 0 "exit x1, two more objects" -} - -x1 -errorCheck [expr {[llength [C info instances]] > 0}] 0 "top, volatile objects gone" - -Object o -o proc test {} { - x1; errorCheck [expr {[llength [C info instances]] > 0}] 0 "x1 from o" -} -o test - -puts "PASSED ::topLevelCommands" Index: xotcl/tests/xoRDF.test =================================================================== diff -u -N --- xotcl/tests/xoRDF.test (revision e525b7364d9b1fbc7b06e81becf4fe0df06c4209) +++ xotcl/tests/xoRDF.test (revision 0) @@ -1,1663 +0,0 @@ -#!../../src/xotclsh -# $Id: xoRDF.test,v 1.5 2007/08/14 16:38:27 neumann Exp $ -# -package require XOTcl; namespace import -force xotcl::* - -lappend auto_path [file dir [info script]]/.. -#package require xotcl::test -#package require package;package verbose 1 -package require xotcl::rdf::parser -package require xotcl::rdf::recreatorVisitor -package require xotcl::rdf::triple - -proc errorCheck {expected result msg} { - set expected [string trim $expected \n] - set result [string trim $result \n] - foreach e [split $expected \n] r [split $result \n] { - set e [string trim $e] - set r [string trim $r] - if {$e != $r} { - puts stderr "FAILED: $msg\nGot: '$r'\nExpected: '$e'" - puts stderr "Full Result:\n$result" - puts stderr "RAW Triples:" - foreach t [lsort [tripleVisitor::db getTriples]] { - puts -nonewline stderr [$t dump] - } - exit -1 - return - } - } -} - -Class TestVisitor -superclass NodeTreeVisitor -TestVisitor instproc visit objName { - my append result [string trim [$objName print]] \n -} -TestVisitor instproc interpretNodeTree {node} { - my set result "" - $node accept [self] - return [my set result] -} - -TestVisitor testVisitor -RDFRecreatorVisitor reVisitor -TripleVisitor tripleVisitor -tripleVisitor proc interpret {parser topNode {asBag 1}} { - set result "" - my descriptionAsBag $asBag - my reset - my interpretNodeTree $topNode - return [[self]::db prettyTriples] - # foreach t [lsort [[self]::db getTriples]] { - # append result [string trim [$t dump]]\n - # } - # return $result -} - -RDFParser rp -rp proc time {cmd time} { - upvar $time ms - regexp {^(-?[0-9]+) } [::time {set r [eval $cmd]}] _ ms - return $r -} - -rp proc test {name text nodeResult tripleResult {descriptionAsBagResult ""}} { - my reset - foreach time {nodeTime recreateTime tripleTime} { - if {![my exists $time]} {my set $time 0} - } - my parse $text - set r [rp time [list testVisitor interpretNodeTree [self]::topNode1] ct] - regsub -all "[self]::topNode1" $r "" r - ::errorCheck $nodeResult $r "RDF Node Creation: $name" - - #set r [time [list reVisitor interpretNodeTree [self]::topNode1] rt] - #::errorCheck $recreateResult $r "RDF Recreation: $name" - set r [rp time [list tripleVisitor interpret rp [self]::topNode1 0] tt] - ::errorCheck $tripleResult $r "RDF Triples: $name" - if {$descriptionAsBagResult != ""} { - set r [tripleVisitor interpret rp [self]::topNode1 1] - ::errorCheck $descriptionAsBagResult $r "RDF Triples -- Description as Bag: $name" - } - - # test recreation by recreating XML text and by parsing - # and testing it again - set recreatedText [rp time [list reVisitor interpretNodeTree [self]::topNode1] rt] - [self]::topNode1 destroy - - my reset - my parse $recreatedText - - #puts "RECREATED: \n$recreatedText" - - # test recreated node tree - set r [testVisitor interpretNodeTree [self]::topNode1] - regsub -all "[self]::topNode1" $r "" r - ::errorCheck $nodeResult $r "RDF Node Recreation: $name" - set r [tripleVisitor interpret rp [self]::topNode1 0] - - ::errorCheck $tripleResult $r "RDF Triple Recreation: $name" - - my incr nodeTime $ct - my incr recreateTime $rt - my incr tripleTime $tt - puts "PASSED: $name ($ct + $rt + $tt)" -} - -############################################################################## -rp test "Namespace" { - - - - - xyz - dfg - - - - -} { -::xotcl::rdf::parser::RDFTag- --- RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- Description -ATTR: ID = nsd -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:ABC -PCDATA: -xyz -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- fromXYZ -PCDATA: -dfg -} { - http://www.w3.org/Home/Lassila http://description.org/schema/Creator nsd - nsd http://description.org/schema/ABC xyz - nsd http://xyz.com/fromXYZ dfg -} - -############################################################################## -rp test descriptionNestedNS { - - - Ora Lassila - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -PCDATA: -Ora Lassila -} { - http://www.w3.org/Home/Lassila http://description.org/schema/Creator Ora Lassila -} { - http://www.w3.org/Home/Lassila http://description.org/schema/Creator Ora Lassila - -=================== unreferenced: - rdfdoc#id1 #type #Bag - rdfdoc#id1 #_1 rdfdoc#id2 - rdfdoc#id2 #predicate http://description.org/schema/Creator - rdfdoc#id2 #subject http://www.w3.org/Home/Lassila - rdfdoc#id2 #object Ora Lassila - rdfdoc#id2 #type #Statement -} - -############################################################################## -rp test NSDescription { - - - Ora Lassila - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -PCDATA: -Ora Lassila -} { - http://www.w3.org/Home/Lassila http://description.org/schema/Creator Ora Lassila -} - -############################################################################## -rp test PropertyAttr { - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -PCDATA: -Ora Lassila -} { - http://www.w3.org/Home/Lassila s:Creator Ora Lassila -} - -############################################################################## -rp test properties { - - - World Wide Web Consortium - W3C Home Page - 1998-10-03T02:27 - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Publisher -PCDATA: -World Wide Web Consortium -::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- s:Title -PCDATA: -W3C Home Page -::xotcl::rdf::parser::RDFProperty-::res1::prop3 --- s:Date -PCDATA: -1998-10-03T02:27 -} { - http://www.w3.org s:Publisher World Wide Web Consortium - http://www.w3.org s:Title W3C Home Page - http://www.w3.org s:Date 1998-10-03T02:27 -} - -############################################################################## -rp test propertyAttr2 { - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Publisher -PCDATA: -World Wide Web Consortium -::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- s:Title -PCDATA: -W3C Home Page -::xotcl::rdf::parser::RDFProperty-::res1::prop3 --- s:Date -PCDATA: -1998-10-03T02:27 -} { - http://www.w3.org s:Publisher World Wide Web Consortium - http://www.w3.org s:Title W3C Home Page - http://www.w3.org s:Date 1998-10-03T02:27 -} - -############################################################################## -rp test bag1 { - - - - - - - - - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://mycollege.edu/courses/6.001 -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students -::xotcl::rdf::parser::RDFBag-::res1::prop1::res1 --- rdf:Bag -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Amy -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Tim -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li -ATTR: resource = http://mycollege.edu/students/John -MEMBER-INDEX: rdf:_3 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop4 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Mary -MEMBER-INDEX: rdf:_4 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop5 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Sue -MEMBER-INDEX: rdf:_5 -} { - http://mycollege.edu/courses/6.001 s:students rdfdoc#id2 - rdfdoc#id2 #type #Bag - rdfdoc#id2 #_1 http://mycollege.edu/students/Amy - rdfdoc#id2 #_2 http://mycollege.edu/students/Tim - rdfdoc#id2 #_3 http://mycollege.edu/students/John - rdfdoc#id2 #_4 http://mycollege.edu/students/Mary - rdfdoc#id2 #_5 http://mycollege.edu/students/Sue -} - - -############################################################################## -rp test bagGivenAsType1 { - - - - - - - - - - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://mycollege.edu/courses/6.001 -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students -::xotcl::rdf::parser::RDFBag-::res1::prop1::res1 --- rdf:Bag -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Amy -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Tim -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li -ATTR: resource = http://mycollege.edu/students/John -MEMBER-INDEX: rdf:_3 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop4 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Mary -MEMBER-INDEX: rdf:_4 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop5 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Sue -MEMBER-INDEX: rdf:_5 -} { - http://mycollege.edu/courses/6.001 s:students rdfdoc#id2 - rdfdoc#id2 #type #Bag - rdfdoc#id2 #_1 http://mycollege.edu/students/Amy - rdfdoc#id2 #_2 http://mycollege.edu/students/Tim - rdfdoc#id2 #_3 http://mycollege.edu/students/John - rdfdoc#id2 #_4 http://mycollege.edu/students/Mary - rdfdoc#id2 #_5 http://mycollege.edu/students/Sue -} - -############################################################################## -rp test bagGivenAsType2 { - - - - - - - - - - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://mycollege.edu/courses/6.001 -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students -::xotcl::rdf::parser::RDFBag-::res1::prop1::res1 --- rdf:Bag -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Amy -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Tim -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li -ATTR: resource = http://mycollege.edu/students/John -MEMBER-INDEX: rdf:_3 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop4 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Mary -MEMBER-INDEX: rdf:_4 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop5 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Sue -MEMBER-INDEX: rdf:_5 -} { - http://mycollege.edu/courses/6.001 s:students rdfdoc#id2 - rdfdoc#id2 #type #Bag - rdfdoc#id2 #_1 http://mycollege.edu/students/Amy - rdfdoc#id2 #_2 http://mycollege.edu/students/Tim - rdfdoc#id2 #_3 http://mycollege.edu/students/John - rdfdoc#id2 #_4 http://mycollege.edu/students/Mary - rdfdoc#id2 #_5 http://mycollege.edu/students/Sue -} - - -############################################################################## -rp test bagAndAltGivenAsType { - - - - - - - - - - - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://mycollege.edu/courses/6.001 -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students -::xotcl::rdf::parser::RDFAlt-::res1::prop1::res1 --- rdf:Alt -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Amy -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Tim -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li -ATTR: resource = http://mycollege.edu/students/John -MEMBER-INDEX: rdf:_3 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop4 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Mary -MEMBER-INDEX: rdf:_4 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop5 --- rdf:li -ATTR: resource = http://mycollege.edu/students/Sue -MEMBER-INDEX: rdf:_5 -} { - http://mycollege.edu/courses/6.001 s:students rdfdoc#id2 - rdfdoc#id2 #type #Alt - rdfdoc#id2 #type #Bag - rdfdoc#id2 #_1 http://mycollege.edu/students/Amy - rdfdoc#id2 #_2 http://mycollege.edu/students/Tim - rdfdoc#id2 #_3 http://mycollege.edu/students/John - rdfdoc#id2 #_4 http://mycollege.edu/students/Mary - rdfdoc#id2 #_5 http://mycollege.edu/students/Sue -} - -############################################################################## -rp test alt1 { - - - - - - - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://x.org/packages/X11 -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:DistributionSite -::xotcl::rdf::parser::RDFAlt-::res1::prop1::res1 --- rdf:Alt -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li -ATTR: resource = ftp://ftp.x.org -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li -ATTR: resource = ftp://ftp.cs.purdue.edu -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop3 --- rdf:li -ATTR: resource = ftp://ftp.eu.net -MEMBER-INDEX: rdf:_3 -} { - http://x.org/packages/X11 s:DistributionSite rdfdoc#id2 - rdfdoc#id2 #type #Alt - rdfdoc#id2 #_1 ftp://ftp.x.org - rdfdoc#id2 #_2 ftp://ftp.cs.purdue.edu - rdfdoc#id2 #_3 ftp://ftp.eu.net -} - -############################################################################## -rp test bag2 { - - - - - - - - Ora Lassila - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFBag-::res1 --- rdf:Bag -ATTR: ID = pages -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag -::xotcl::rdf::parser::RDFMember-::res1::prop1 --- rdf:li -ATTR: resource = http://foo.org/foo.html -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res1::prop2 --- rdf:li -ATTR: resource = http://bar.org/bar.html -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFDescription-::res2 --- rdf:Description -ATTR: about = #pages -::xotcl::rdf::parser::RDFProperty-::res2::prop1 --- s:Creator -PCDATA: -Ora Lassila -} { -=================== unreferenced: - rdfdoc#pages #type #Bag - rdfdoc#pages #_1 http://foo.org/foo.html - rdfdoc#pages #_2 http://bar.org/bar.html - rdfdoc#pages s:Creator Ora Lassila -} - -############################################################################## -rp test aboutEach { - - - (c) 1998, The Foo Organization - - - (c) 1998, The Foo Organization - - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: aboutEachPrefix = http://foo.org/doc -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Copyright -PCDATA: -(c) 1998, The Foo Organization -::xotcl::rdf::parser::RDFDescription-::res2 --- rdf:Description -ATTR: aboutEach = #docpages -::xotcl::rdf::parser::RDFProperty-::res2::prop1 --- s:Copyright -PCDATA: -(c) 1998, The Foo Organization -::xotcl::rdf::parser::RDFBag-::res3 --- rdf:Bag -ATTR: ID = docpages -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag -::xotcl::rdf::parser::RDFMember-::res3::prop1 --- rdf:li -ATTR: resource = http://foo.org/doc/page1 -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res3::prop2 --- rdf:li -ATTR: resource = http://foo.org/doc/page2 -MEMBER-INDEX: rdf:_2 -} { - http://foo.org/doc/page1 http://description.org/schema/Copyright (c) 1998, The Foo Organization - http://foo.org/doc/page2 http://description.org/schema/Copyright (c) 1998, The Foo Organization - -=================== unreferenced: - rdfdoc#docpages #type #Bag - rdfdoc#docpages #_1 http://foo.org/doc/page1 - rdfdoc#docpages #_2 http://foo.org/doc/page2 -} - -############################################################################## -rp test "BagID on List" { - - - - - - - - - Me - - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: aboutEach = #docpages -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:somebag -::xotcl::rdf::parser::RDFBag-::res1::prop1::res1 --- rdf:Bag -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li -ATTR: resource = http://foo.org/foo.html -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li -ATTR: resource = http://bar.org/bar.html -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- s:Creator -PCDATA: -Me -::xotcl::rdf::parser::RDFBag-::res2 --- rdf:Bag -ATTR: ID = docpages -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag -::xotcl::rdf::parser::RDFMember-::res2::prop1 --- rdf:li -ATTR: resource = http://foo.org/doc/page1 -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res2::prop2 --- rdf:li -ATTR: resource = http://foo.org/doc/page2 -MEMBER-INDEX: rdf:_2 -} { - http://foo.org/doc/page1 http://description.org/schema/somebag rdfdoc#id2 - rdfdoc#id2 #type #Bag - rdfdoc#id2 #_1 http://foo.org/foo.html - rdfdoc#id2 #_2 http://bar.org/bar.html - http://foo.org/doc/page1 http://description.org/schema/Creator Me - http://foo.org/doc/page2 http://description.org/schema/somebag rdfdoc#id2 - http://foo.org/doc/page2 http://description.org/schema/Creator Me - -=================== unreferenced: - rdfdoc#docpages #type #Bag - rdfdoc#docpages #_1 http://foo.org/doc/page1 - rdfdoc#docpages #_2 http://foo.org/doc/page2 -} - -############################################################################## -rp test "Sharing Values" { - - - - - - - - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFSeq-::res1 --- rdf:Seq -ATTR: ID = JSPapersByDate -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq -::xotcl::rdf::parser::RDFMember-::res1::prop1 --- rdf:li -ATTR: resource = http://www.dogworld.com/Aug96.doc -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res1::prop2 --- rdf:li -ATTR: resource = http://www.webnuts.net/Jan97.html -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFMember-::res1::prop3 --- rdf:li -ATTR: resource = http://www.carchat.com/Sept97.html -MEMBER-INDEX: rdf:_3 -::xotcl::rdf::parser::RDFSeq-::res2 --- rdf:Seq -ATTR: ID = JSPapersBySubj -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq -::xotcl::rdf::parser::RDFMember-::res2::prop1 --- rdf:li -ATTR: resource = http://www.carchat.com/Sept97.html -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res2::prop2 --- rdf:li -ATTR: resource = http://www.dogworld.com/Aug96.doc -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFMember-::res2::prop3 --- rdf:li -ATTR: resource = http://www.webnuts.net/Jan97.html -MEMBER-INDEX: rdf:_3 -} { -=================== unreferenced: - rdfdoc#JSPapersByDate #type #Seq - rdfdoc#JSPapersByDate #_1 http://www.dogworld.com/Aug96.doc - rdfdoc#JSPapersByDate #_2 http://www.webnuts.net/Jan97.html - rdfdoc#JSPapersByDate #_3 http://www.carchat.com/Sept97.html - rdfdoc#JSPapersBySubj #type #Seq - rdfdoc#JSPapersBySubj #_1 http://www.carchat.com/Sept97.html - rdfdoc#JSPapersBySubj #_2 http://www.dogworld.com/Aug96.doc - rdfdoc#JSPapersBySubj #_3 http://www.webnuts.net/Jan97.html -} - -############################################################################## - -rp test "aggregates" { - - - - - Mary Andrew - Jacky Crystal - - - - - - - - - - - - - The Coolest Web Page - Il Pagio di Web Fuba - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.foo.com/cool.html -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Creator -::xotcl::rdf::parser::RDFSeq-::res1::prop1::res1 --- rdf:Seq -ATTR: ID = CreatorsAlphabeticalBySurname -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop1 --- rdf:li -PCDATA: -Mary Andrew -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res1::prop1::res1::prop2 --- rdf:li -PCDATA: -Jacky Crystal -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- dc:Identifier -::xotcl::rdf::parser::RDFBag-::res1::prop2::res1 --- rdf:Bag -ATTR: ID = MirroredSites -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag -::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop1 --- rdf:li -ATTR: rdf:resource = http://www.foo.com.au/cool.html -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop2 --- rdf:li -ATTR: rdf:resource = http://www.foo.com.it/cool.html -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFProperty-::res1::prop3 --- dc:Title -::xotcl::rdf::parser::RDFAlt-::res1::prop3::res1 --- rdf:Alt -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt -::xotcl::rdf::parser::RDFMember-::res1::prop3::res1::prop1 --- rdf:li -ATTR: xml:lang = en -PCDATA: -The Coolest Web Page -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res1::prop3::res1::prop2 --- rdf:li -ATTR: xml:lang = it -PCDATA: -Il Pagio di Web Fuba -MEMBER-INDEX: rdf:_2 -} { - http://www.foo.com/cool.html http://purl.org/metadata/dublin_core#Creator rdfdoc#CreatorsAlphabeticalBySurname - rdfdoc#CreatorsAlphabeticalBySurname #type #Seq - rdfdoc#CreatorsAlphabeticalBySurname #_1 Mary Andrew - rdfdoc#CreatorsAlphabeticalBySurname #_2 Jacky Crystal - http://www.foo.com/cool.html http://purl.org/metadata/dublin_core#Identifier rdfdoc#MirroredSites - rdfdoc#MirroredSites #type #Bag - rdfdoc#MirroredSites #_1 http://www.foo.com.au/cool.html - rdfdoc#MirroredSites #_2 http://www.foo.com.it/cool.html - http://www.foo.com/cool.html http://purl.org/metadata/dublin_core#Title rdfdoc#id4 - rdfdoc#id4 #type #Alt - rdfdoc#id4 #_1 The Coolest Web Page - rdfdoc#id4 #_2 Il Pagio di Web Fuba -} - -############################################################################## -rp test "bagReification" { - - - - literal, well-formed tag - - - xyz - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFBag-::res1 --- rdf:Bag -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag -::xotcl::rdf::parser::RDFMember-::res1::prop1 --- rdf:li -ATTR: parseType = Literal -PCDATA: - - literal, well-formed tag - -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res1::prop2 --- rdf:li -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1 --- s:x -PCDATA: -xyz -} { -=================== unreferenced: - rdfdoc#id1 #type #Bag - rdfdoc#id1 #_1 - literal, well-formed tag - - rdfdoc#id1 #_2 rdfdoc#id2 - rdfdoc#id2 http://description.org/schema/x xyz -} - -# the following reification is done by SirPac, but it does not seem necessary -# (uncomment reify property in RDFTriple, if needed -#{ -#=================== unreferenced: -# rdfdoc#id1 #type #Bag -# rdfdoc#id1 #_1 -# literal, well-formed tag -# -# rdfdoc#id1 #_2 rdfdoc#id2 -# rdfdoc#id2 http://description.org/schema/x xyz -# rdfdoc#id3 #predicate http://description.org/schema/x -# rdfdoc#id3 #subject rdfdoc#id2 -# rdfdoc#id3 #object xyz -# rdfdoc#id3 #type #Statement -#} - -############################################################################## -rp test "parseLiteral" { - - - - xyz - - - - - - - xyz - - - - - - - - - - - - - - literal, well-formed tag - - - literal, well-formed tag - - - xyz - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://mycollege.edu/ -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:students -ATTR: parseType = Literal -PCDATA: - - xyz -::xotcl::rdf::parser::RDFDescription-::res2 --- rdf:Description -ATTR: about = http://mycollege.edu/ -::xotcl::rdf::parser::RDFProperty-::res2::prop1 --- s:students -ATTR: parseType = Literal -PCDATA: - - - xyz - - - - - - - - -::xotcl::rdf::parser::RDFBag-::res3 --- rdf:Bag -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag -::xotcl::rdf::parser::RDFMember-::res3::prop1 --- rdf:li -ATTR: parseType = Literal -PCDATA: - - literal, well-formed tag - -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFMember-::res3::prop2 --- rdf:li -ATTR: parseType = AllOtherMustbeLiteral -PCDATA: - - literal, well-formed tag - -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFMember-::res3::prop3 --- rdf:li -MEMBER-INDEX: rdf:_3 -::xotcl::rdf::parser::RDFDescription-::res3::prop3::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res3::prop3::res1::prop1 --- s:x -PCDATA: -xyz -} { - http://mycollege.edu/ http://description.org/schema/students - xyz - - http://mycollege.edu/ http://description.org/schema/students - - xyz - - - - - - - - - - -=================== unreferenced: - rdfdoc#id3 #type #Bag - rdfdoc#id3 #_1 - literal, well-formed tag - - rdfdoc#id3 #_2 - literal, well-formed tag - - rdfdoc#id3 #_3 rdfdoc#id4 - rdfdoc#id4 http://description.org/schema/x xyz -} - -############################################################################## -rp test typedNode1 { - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.xyz.com -TYPES: http://purl.org/dc/elements/1.0/typed -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- DC:Creator -ATTR: rdf:resource = http://www.xyz.com/homepage/ -} { - http://www.xyz.com http://purl.org/dc/elements/1.0/Creator http://www.xyz.com/homepage/ - http://www.xyz.com #type http://purl.org/dc/elements/1.0/typed -} - -################################################################### -## UWE: im wiedererzeugten XML/RDF fehlt m.M. das parseType="Resosurce" - -rp test nestedProperty { - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- Description -ATTR: about = http://www.webnuts.net/Jan97.html -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Subject -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- value -PCDATA: -020 - Library Science -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- l:Classification -PCDATA: -Dewey Decimal Code -} { - http://www.webnuts.net/Jan97.html http://purl.org/metadata/dublin_core#Subject rdfdoc#id2 - rdfdoc#id2 #value 020 - Library Science - rdfdoc#id2 http://mycorp.com/schemas/my-schema#Classification Dewey Decimal Code -} - - -rp test nestedProperty2 { - - - - 020 - Library Science - Dewey Decimal Code - - - -} { -::xotcl::rdf::parser::RDFTag- --- RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- Description -ATTR: about = http://www.webnuts.net/Jan97.html -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Subject -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- value -PCDATA: -020 - Library Science -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- l:Classification -PCDATA: -Dewey Decimal Code -} { - http://www.webnuts.net/Jan97.html http://purl.org/metadata/dublin_core#Subject rdfdoc#id2 - rdfdoc#id2 #value 020 - Library Science - rdfdoc#id2 http://mycorp.com/schemas/my-schema#Classification Dewey Decimal Code - -} - -rp test nestedProperty3 { - - - - - 020 - Library Science - Dewey Decimal Code - - - - -} { -::xotcl::rdf::parser::RDFTag- --- RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- Description -ATTR: about = http://www.webnuts.net/Jan97.html -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Subject -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- Description -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- value -PCDATA: -020 - Library Science -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- l:Classification -PCDATA: -Dewey Decimal Code -} { - http://www.webnuts.net/Jan97.html http://purl.org/metadata/dublin_core#Subject rdfdoc#id2 - rdfdoc#id2 #value 020 - Library Science - rdfdoc#id2 http://mycorp.com/schemas/my-schema#Classification Dewey Decimal Code - -} - -rp test nestedProperty4 { - - - - 020 - Library Science - - en - Dewey Decimal Code - - - - -} { -::xotcl::rdf::parser::RDFTag- --- RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- Description -ATTR: about = http://www.webnuts.net/Jan97.html -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- dc:Subject -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- value -PCDATA: -020 - Library Science -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- l:Classification -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1::prop2::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2::res1::prop1 --- l:lang -PCDATA: -en -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2::res1::prop2 --- l:string -PCDATA: -Dewey Decimal Code -} { - http://www.webnuts.net/Jan97.html http://purl.org/metadata/dublin_core#Subject rdfdoc#id2 - rdfdoc#id2 #value 020 - Library Science - rdfdoc#id2 http://mycorp.com/schemas/my-schema#Classification rdfdoc#id3 - rdfdoc#id3 http://mycorp.com/schemas/my-schema#lang en - rdfdoc#id3 http://mycorp.com/schemas/my-schema#string Dewey Decimal Code -} - -rp test thirdAbbrev1 { - - - - - - Ora Lassila - lassila@w3.org - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -ATTR: about = http://www.w3.org/staffId/85740 -TYPES: http://description.org/schema/Person -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name -PCDATA: -Ora Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email -PCDATA: -lassila@w3.org -} { - http://www.w3.org/Home/Lassila http://description.org/schema/Creator http://www.w3.org/staffId/85740 - http://www.w3.org/staffId/85740 http://description.org/schema/Name Ora Lassila - http://www.w3.org/staffId/85740 http://description.org/schema/Email lassila@w3.org - http://www.w3.org/staffId/85740 #type http://description.org/schema/Person -} - -rp test thirdAbbrev2 { - - - - - - Ora Lassila - lassila@w3.org - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -TYPES: http://description.org/schema/Person -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name -PCDATA: -Ora Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email -PCDATA: -lassila@w3.org -} { - http://www.w3.org/Home/Lassila http://description.org/schema/Creator rdfdoc#id2 - rdfdoc#id2 http://description.org/schema/Name Ora Lassila - rdfdoc#id2 http://description.org/schema/Email lassila@w3.org - rdfdoc#id2 #type http://description.org/schema/Person -} - -rp test thirdAbbrev3 { - - - - - Ora Lassila - lassila@w3.org - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -ATTR: about = http://www.w3.org/staffId/85740 -TYPES: http://description.org/schema/Person -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name -PCDATA: -Ora Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email -PCDATA: -lassila@w3.org -} { - http://www.w3.org/Home/Lassila http://description.org/schema/Creator http://www.w3.org/staffId/85740 - http://www.w3.org/staffId/85740 http://description.org/schema/Name Ora Lassila - http://www.w3.org/staffId/85740 http://description.org/schema/Email lassila@w3.org - http://www.w3.org/staffId/85740 #type http://description.org/schema/Person -} - -rp test thirdAbbrev4 { - - - - - Ora Lassila - lassila@w3.org - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -TYPES: http://description.org/schema/Person -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name -PCDATA: -Ora Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email -PCDATA: -lassila@w3.org -} { - http://www.w3.org/Home/Lassila http://description.org/schema/Creator rdfdoc#id2 - rdfdoc#id2 http://description.org/schema/Name Ora Lassila - rdfdoc#id2 http://description.org/schema/Email lassila@w3.org - rdfdoc#id2 #type http://description.org/schema/Person -} - - -rp test secondAbbrev1 { - - - - - Ora Lassila - lassila@w3.org - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -ATTR: about = http://www.w3.org/staffId/85740 -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name -PCDATA: -Ora Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email -PCDATA: -lassila@w3.org -} { - http://www.w3.org/Home/Lassila http://description.org/schema/Creator http://www.w3.org/staffId/85740 - http://www.w3.org/staffId/85740 http://description.org/schema/Name Ora Lassila - http://www.w3.org/staffId/85740 http://description.org/schema/Email lassila@w3.org -} - -rp test secondAbbrev2 { - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -ATTR: about = http://www.w3.org/staffId/85740 -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name -PCDATA: -Ora Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email -PCDATA: -lassila@w3.org -} { - http://www.w3.org/Home/Lassila http://description.org/schema/Creator http://www.w3.org/staffId/85740 - http://www.w3.org/staffId/85740 http://description.org/schema/Name Ora Lassila - http://www.w3.org/staffId/85740 http://description.org/schema/Email lassila@w3.org -} - -rp test secondAbbrev3 { - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- s:Name -PCDATA: -Ora Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- s:Email -PCDATA: -lassila@w3.org -} { - http://www.w3.org/Home/Lassila http://description.org/schema/Creator rdfdoc#id2 - rdfdoc#id2 http://description.org/schema/Name Ora Lassila - rdfdoc#id2 http://description.org/schema/Email lassila@w3.org -} - - -################################################################### -rp test resource1 { - - - - - - - Ora Lassila - lassila@w3.org - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -ATTR: rdf:resource = http://www.w3.org/staffId/85740 -::xotcl::rdf::parser::RDFDescription-::res2 --- rdf:Description -ATTR: about = http://www.w3.org/staffId/85740 -::xotcl::rdf::parser::RDFProperty-::res2::prop1 --- v:Name -PCDATA: -Ora Lassila -::xotcl::rdf::parser::RDFProperty-::res2::prop2 --- v:Email -PCDATA: -lassila@w3.org -} { - http://www.w3.org/Home/Lassila http://schema.org/Creator http://www.w3.org/staffId/85740 - http://www.w3.org/staffId/85740 v:Name Ora Lassila - http://www.w3.org/staffId/85740 v:Email lassila@w3.org -} - -################################################################### -rp test resource2 { - - - - - Ora Lassila - lassila@w3.org - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.w3.org/Home/Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Creator -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -ATTR: about = http://www.w3.org/staffId/85740 -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- v:Name -PCDATA: -Ora Lassila -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- v:Email -PCDATA: -lassila@w3.org -} { - http://www.w3.org/Home/Lassila http://schema.org/Creator http://www.w3.org/staffId/85740 - http://www.w3.org/staffId/85740 v:Name Ora Lassila - http://www.w3.org/staffId/85740 v:Email lassila@w3.org -} - - - -################################################################### -rp test typedNode1 { - - - Uwe Zdun - uwe@xotcl.org - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://www.xotcl.org/uwe -TYPES: http://description.org/schema/Person -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- s:Name -PCDATA: -Uwe Zdun -::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- s:Email -PCDATA: -uwe@xotcl.org -} { - http://www.xotcl.org/uwe http://description.org/schema/Name Uwe Zdun - http://www.xotcl.org/uwe http://description.org/schema/Email uwe@xotcl.org - http://www.xotcl.org/uwe #type http://description.org/schema/Person -} - -rp test typedNode2 { - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: rdf:about = http://www.xotcl.org/uwe -TYPES: http://description.org/schema/Person -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- Name -PCDATA: -Uwe Zdun -::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- Email -PCDATA: -uwe@xotcl.org -} { - http://www.xotcl.org/uwe http://description.org/schema/Name Uwe Zdun - http://www.xotcl.org/uwe http://description.org/schema/Email uwe@xotcl.org - http://www.xotcl.org/uwe #type http://description.org/schema/Person -} - -################################################################### -rp test complexListItems { - - - - - en - Object Oriented Design and System Development - - - - - en - Introduction to the concepts of object-oriented programing - - - de - Einf�hrung in die Konzepte objekt-orientierter Programmierung - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://nm.wu-wien.ac.at/Lehre/oo1/ -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- gen:Title -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- xml:lang -PCDATA: -en -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- gen:String -PCDATA: -Object Oriented Design and System Development -::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- gen:Description -::xotcl::rdf::parser::RDFBag-::res1::prop2::res1 --- rdf:Bag -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag -::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop1 --- rdf:li -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop1::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop1 --- xml:lang -PCDATA: -en -::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop2 --- gen:String -PCDATA: -Introduction to the concepts of object-oriented programing -::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop2 --- rdf:li -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop2::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop2::res1::prop1 --- xml:lang -PCDATA: -de -::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop2::res1::prop2 --- gen:String -PCDATA: -Einf�hrung in die Konzepte objekt-orientierter Programmierung -} { - http://nm.wu-wien.ac.at/Lehre/oo1/ http://universal.org/metadata/ims#Title rdfdoc#id2 - rdfdoc#id2 xml:lang en - rdfdoc#id2 http://universal.org/metadata/ims#String Object Oriented Design and System Development - http://nm.wu-wien.ac.at/Lehre/oo1/ http://universal.org/metadata/ims#Description rdfdoc#id3 - rdfdoc#id3 #type #Bag - rdfdoc#id3 #_1 rdfdoc#id4 - rdfdoc#id4 xml:lang en - rdfdoc#id4 http://universal.org/metadata/ims#String Introduction to the concepts of object-oriented programing - rdfdoc#id3 #_2 rdfdoc#id5 - rdfdoc#id5 xml:lang de - rdfdoc#id5 http://universal.org/metadata/ims#String Einf�hrung in die Konzepte objekt-orientierter Programmierung -} - -################################################################### -rp test complexListItems2 { - - - - - en - Object Oriented Design and System Development - - - - - - en - Introduction to the concepts of object-oriented programing - - - - de - Einf�hrung in die Konzepte objekt-orientierter Programmierung - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = http://nm.wu-wien.ac.at/Lehre/oo1/ -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- gen:Title -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- xml:lang -PCDATA: -en -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- gen:String -PCDATA: -Object Oriented Design and System Development -::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- gen:Description -::xotcl::rdf::parser::RDFSeq-::res1::prop2::res1 --- rdf:Seq -TYPES: http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq -::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop1 --- rdf:li -MEMBER-INDEX: rdf:_1 -::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop1::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop1 --- cls:entry -::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop1::res1::prop1::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop1::res1::prop1 --- gen:language -PCDATA: -en -::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop1::res1::prop1::res1::prop2 --- gen:String -PCDATA: -Introduction to the concepts of object-oriented programing -::xotcl::rdf::parser::RDFMember-::res1::prop2::res1::prop2 --- rdf:li -MEMBER-INDEX: rdf:_2 -::xotcl::rdf::parser::RDFDescription-::res1::prop2::res1::prop2::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop2::res1::prop1 --- xml:lang -PCDATA: -de -::xotcl::rdf::parser::RDFProperty-::res1::prop2::res1::prop2::res1::prop2 --- gen:String -PCDATA: -Einf�hrung in die Konzepte objekt-orientierter Programmierung -} { - http://nm.wu-wien.ac.at/Lehre/oo1/ http://universal.org/metadata/ims#Title rdfdoc#id2 - rdfdoc#id2 xml:lang en - rdfdoc#id2 http://universal.org/metadata/ims#String Object Oriented Design and System Development - http://nm.wu-wien.ac.at/Lehre/oo1/ http://universal.org/metadata/ims#Description rdfdoc#id3 - rdfdoc#id3 #type #Seq - rdfdoc#id3 #_1 rdfdoc#id4 - rdfdoc#id4 cls:entry rdfdoc#id5 - rdfdoc#id5 http://universal.org/metadata/ims#language en - rdfdoc#id5 http://universal.org/metadata/ims#String Introduction to the concepts of object-oriented programing - rdfdoc#id3 #_2 rdfdoc#id6 - rdfdoc#id6 xml:lang de - rdfdoc#id6 http://universal.org/metadata/ims#String Einf�hrung in die Konzepte objekt-orientierter Programmierung -} - -################################################################### -rp test dmoz { - - - - Computers - - - - -} { -::xotcl::rdf::parser::RDFTag- --- r:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- r:Description -ATTR: r:ID = Top/Computers -TYPES: http://dmoz.org/rdf/Topic -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- tag -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- r:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- catid -PCDATA: -4 -::xotcl::rdf::parser::RDFProperty-::res1::prop2 --- d:Title -PCDATA: -Computers -::xotcl::rdf::parser::RDFProperty-::res1::prop3 --- link -ATTR: r:resource = http://www.cs.tcd.ie/FME/ -::xotcl::rdf::parser::RDFProperty-::res1::prop4 --- link -ATTR: r:resource = http://pages.whowhere.com/computers/pnyhlen/Timeline.html -} { - Top/Computers http://dmoz.org/rdf/tag rdfdoc#id2 - rdfdoc#id2 http://dmoz.org/rdf/catid 4 - Top/Computers http://purl.org/dc/elements/1.0/Title Computers - Top/Computers http://dmoz.org/rdf/link http://www.cs.tcd.ie/FME/ - Top/Computers http://dmoz.org/rdf/link http://pages.whowhere.com/computers/pnyhlen/Timeline.html - Top/Computers #type http://dmoz.org/rdf/Topic -} - -############################################################################## -rp test "IDforNestedDescription" { - - - - - -} { -::xotcl::rdf::parser::RDFTag- --- rdf:RDF -::xotcl::rdf::parser::RDFDescription-::res1 --- rdf:Description -ATTR: about = page -::xotcl::rdf::parser::RDFProperty-::res1::prop1 --- g2k:area -ATTR: rdf:ID = b14711 -::xotcl::rdf::parser::RDFDescription-::res1::prop1::res1 --- rdf:Description -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop1 --- g2k:term -PCDATA: -Hessen -::xotcl::rdf::parser::RDFProperty-::res1::prop1::res1::prop2 --- g2k:type -PCDATA: -Land -} { - b14711 http://g2k-schema#term Hessen - b14711 http://g2k-schema#type Land - page http://g2k-schema#area b14711 -} - -puts "FINISHED TEST! ([rp set nodeTime] + [rp set recreateTime] + [rp set tripleTime] = [expr {[rp set nodeTime] + [rp set recreateTime] + [rp set tripleTime]}])" - Index: xotcl/tests/xocomm.test =================================================================== diff -u -N --- xotcl/tests/xocomm.test (revision ad8a63234e44a8788efede276e811051ab891fbe) +++ xotcl/tests/xocomm.test (revision 0) @@ -1,108 +0,0 @@ -#!../../xotcl-0.9.4/xotclsh -# $Id: xocomm.test,v 1.4 2005/09/09 21:09:01 neumann Exp $ -package require XOTcl; namespace import -force xotcl::* -lappend auto_path [file dirname [info script]]/.. -package require xotcl::test - -@ @File { - description { - This is a webclient used as a regression test. - When it is started it launches an xotcl-Web server as partner process. - It tests currently the basic functionality of: -

      -
    • GET and PUT requests -
    • Basic Access Control -
    - } -} -array set opt {-startServer 1} -array set opt $argv - -set xotclsh [info nameofexecutable] -set dir [file dir [info script]] -set serverScript $dir/../apps/comm/webserver.xotcl -set startCmd "$xotclsh $serverScript -root $dir/../doc -pkgdir $dir/.." -puts $startCmd -if {$opt(-startServer)} { - set PIPE [open "| $startCmd"] -} else { - puts $startCmd -} - -package require xotcl::comm::httpAccess -package require xotcl::comm::ftp -package require xotcl::trace - -#::xotcl::package verbose 1 -#::xotcl::package require xotcl::comm::httpAccess -#::xotcl::package require xotcl::comm::ftp -#::xotcl::package require xotcl::trace - -set hostport localhost:8086 -set protectedhostport localhost:9096 - -set slowURL "http://quote.yahoo.com/q?s=^DJI&d=1d" -set ftpURL "ftp://mohegan.wi-inf.uni-essen.de/welcome.msg" - - -proc printError msg {puts stderr !!!$msg!!!} - -Object userPwd -userPwd proc user {u} { - my set user $u - if {[set ::tcl_platform(platform)] == "windows"} { - my set user unknown - } -} -userPwd proc show {realm userVar pwVar} { - upvar $userVar u $pwVar pw - set u [my set user] - set pw test - return 1 -} - -Test parameter {{errorReport { - puts "\tcontent-length: \[r0::sink set contentLength\]\n\ - \tstatus-code: \[\[r0 set token\] set responseCode\]" -}}} - -Test new -msg "Trying to load image logo-100.jpg ... " -count 1 \ - -verbose 1 \ - -pre "puts starting..." \ - -setResult {expr {[r0::sink set contentLength] == 1706}} \ - -cmd [list SimpleRequest r0 -url http://$hostport/logo-100.jpg] \ - -Test new -msg "Trying to PUT a file on web-server ... " -count 1 \ - -setResult {expr [[r0 set token] set responseCode] == 201} \ - -pre [list file delete -force $dir/../doc/junk.junk] \ - -cmd [list SimpleRequest r0 \ - -url http://$hostport/junk.junk \ - -method PUT \ - -data "this is a test\n" \ - -contentType plain/text] - -Test new -msg "And download it again ... " -count 1 \ - -setResult {expr [r0 getContentLength] == 15} \ - -post {file delete -force ../doc/junk.junk} \ - -cmd [list SimpleRequest r0 -url http://$hostport/junk.junk] - -Test new -msg "Get protected resource ... " -count 1 \ - -setResult {expr [r0 getContentLength] > 500} \ - -cmd [list SimpleRequest r0 -url http://$protectedhostport/ ] - -#Test new -msg "Try an FTP request $ftpURL ... " -count 1 \ - -setResult {expr [r0 getContentLength] > 100} \ - -cmd [list SimpleRequest r0 -url $ftpURL] - -#Test new -msg "Try timeout with slow URL $slowURL ... " -count 1 \ - -setResult {expr {[[r0 set token] set errormsg] == {timeout exceeded}}} \ - -cmd [list SimpleRequest r0 -url $slowURL -timeout 100] - -Test new -msg terminate -count 1 \ - -setResult {set x 1} \ - -cmd [list SimpleRequest r0 -url http://$protectedhostport/exit] \ - -post exit - -after 1000 {Test run} -catch {vwait forever} - Index: xotcl/unix/pkgIndex.unix =================================================================== diff -u -N --- xotcl/unix/pkgIndex.unix (revision caee4f272cfc744a06a7df61e2f3c73da1b6be64) +++ xotcl/unix/pkgIndex.unix (revision 0) @@ -1,4 +0,0 @@ - package ifneeded XOTcl 1.5.6 [list load \ - [file join $dir libxotcl1.5.6.dylib] XOTcl] - - Index: xotcl/unix/pkgIndex.unix.in =================================================================== diff -u -N --- xotcl/unix/pkgIndex.unix.in (revision 9722a51911e1502444c173306c8c88f7f3888989) +++ xotcl/unix/pkgIndex.unix.in (revision 0) @@ -1,4 +0,0 @@ - package ifneeded XOTcl @PACKAGE_VERSION@ [list load \ - [file join $dir @PKG_LIB_FILE@] XOTcl] - - Index: xotcl/unix/tclAppInit.c =================================================================== diff -u -N --- xotcl/unix/tclAppInit.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/unix/tclAppInit.c (revision 0) @@ -1,186 +0,0 @@ -/* - * tclAppInit.c -- - * - * Provides a default version of the main program and Tcl_AppInit - * procedure for Tcl applications (without Tk). - * - * Copyright (c) 1993 The Regents of the University of California. - * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclAppInit.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ - */ - -#include "tcl.h" - -#ifdef TCL_TEST - -#include "tclInt.h" - -extern int Procbodytest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -extern int Procbodytest_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)); -extern int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -#ifdef TCL_THREADS -extern int TclThread_Init _ANSI_ARGS_((Tcl_Interp *interp)); -#endif - -#endif /* TCL_TEST */ - -#ifdef TCL_XT_TEST -extern void XtToolkitInitialize _ANSI_ARGS_((void)); -extern int Tclxttest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -#endif - -/* - *---------------------------------------------------------------------- - * - * main -- - * - * This is the main program for the application. - * - * Results: - * None: Tcl_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. */ -{ - /* - * The following #if block allows you to change the AppInit - * function by using a #define of TCL_LOCAL_APPINIT instead - * of rewriting this entire file. The #if checks for that - * #define and uses Tcl_AppInit if it doesn't exist. - */ - -#ifndef TCL_LOCAL_APPINIT -#define TCL_LOCAL_APPINIT Tcl_AppInit -#endif - extern int TCL_LOCAL_APPINIT _ANSI_ARGS_((Tcl_Interp *interp)); - - /* - * The following #if block allows you to change how Tcl finds the startup - * script, prime the library or encoding paths, fiddle with the argv, - * etc., without needing to rewrite Tcl_Main() - */ - -#ifdef TCL_LOCAL_MAIN_HOOK - extern int TCL_LOCAL_MAIN_HOOK _ANSI_ARGS_((int *argc, char ***argv)); -#endif - -#ifdef TCL_XT_TEST - XtToolkitInitialize(); -#endif - -#ifdef TCL_LOCAL_MAIN_HOOK - TCL_LOCAL_MAIN_HOOK(&argc, &argv); -#endif - - Tcl_Main(argc, argv, TCL_LOCAL_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 the interp's 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; - } - -#ifdef TCL_TEST -#ifdef TCL_XT_TEST - if (Tclxttest_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } -#endif - 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; - } -#ifdef TCL_THREADS - if (TclThread_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } -#endif - if (Procbodytest_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - Tcl_StaticPackage(interp, "procbodytest", Procbodytest_Init, - Procbodytest_SafeInit); -#endif /* TCL_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 (Xotcl_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - - Tcl_StaticPackage(interp, "XOTcl", Xotcl_Init, 0); - if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), - "::xotcl::*", /* allowOverwrite */ 1) != 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. - */ - -#ifdef DJGPP - Tcl_SetVar(interp, "tcl_rcFileName", "~/tclsh.rc", TCL_GLOBAL_ONLY); -#else - Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY); -#endif - return TCL_OK; -} Index: xotcl/unix/tkAppInit.c =================================================================== diff -u -N --- xotcl/unix/tkAppInit.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/unix/tkAppInit.c (revision 0) @@ -1,91 +0,0 @@ -/* - * tkAppInit.c -- - * $Id: tkAppInit.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ - * - * 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. - */ - -#ifndef lint -/* static char sccsid[] = "@(#) tkAppInit.c 1.12 94/12/17 16:30:56"; */ -#endif /* not lint */ - -#include "tk.h" -#include "locale.h" -#include - -/* - *---------------------------------------------------------------------- - * - * 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; - } - if (Xotcl_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit); - Tcl_StaticPackage(interp, "XOTcl", Xotcl_Init, 0); - - if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), - "::xotcl::*", /* allowOverwrite */ 1) != TCL_OK) { - return TCL_ERROR; - } - Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY); - - return TCL_OK; -} Index: xotcl/unix/xotcl.spec =================================================================== diff -u -N --- xotcl/unix/xotcl.spec (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/unix/xotcl.spec (revision 0) @@ -1,56 +0,0 @@ -Summary: Object Oriented Extension for Tcl -Name: xotcl -Version: 1.5.6 -Release: 0 -License: bsd style open source -Group: Development/Languages -Source: http://www.xotcl.org/xotcl-1.5.6.tar.gz -URL: http://www.xotcl.org -Packager: Gustaf.Neumann@wu-wien.ac.at -Distribution: Fedorea Core 7 -Requires: tcl -Prefix: /usr -BuildRoot: %{_tmppath}/%{name}-root -BuildRequires: autoconf - -%description -XOTcl is an object-oriented scripting language based on MIT's OTcl. -This packages provides a pre-packaged tcl-shell (xotclsh) and tk-shell -(xowish) together with the Tcl-extension (libxotcl.so) which can be -loaded to any Tcl-application. Furthermore it includes several -xotcl-based packages for e.g. HTTP client and server, XML, RDF, -persistent object store, mobile code system, etc. For more details -consult http://www.xotcl.org - -%prep -%setup -q -n xotcl-1.5.6 - - -%build -autoconf -# ./configure --with-tcl=/usr/lib --with-all --prefix=/usr/local --exec-prefix=/usr/local -./configure --with-tcl=/usr/lib --with-all --prefix=/usr --exec-prefix=/usr -# make CFLAGS_DEFAULT='-O3 -mcpu=i686 -Wall -fomit-frame-pointer' -make CFLAGS_DEFAULT='-O3 -Wall -fomit-frame-pointer' - -%install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install -rm -f $RPM_BUILD_ROOT/usr/lib/libxotcl1.5.6.so -ln -s xotcl1.5.6/libxotcl1.5.6.so $RPM_BUILD_ROOT/usr/lib - -%files -%defattr(-, root, root) -%doc doc -%_bindir/xotclsh -%_bindir/xowish -%_prefix/lib/xotcl1.5.6 -%_prefix/lib/libxotcl1.5.6.so -%_prefix/lib/xotclexpat* -%_prefix/lib/xotclgdbm* -%_prefix/lib/xotclsdbm* -%_prefix/lib/xotclConfig.sh -%_includedir/xotcl.h -%_includedir/xotclInt.h -%_includedir/xotclDecls.h -%_includedir/xotclIntDecls.h Index: xotcl/unix/xotcl.spec.in =================================================================== diff -u -N --- xotcl/unix/xotcl.spec.in (revision e44f69435e8db4aa6ed2ffffe8caaa6586c2fc5f) +++ xotcl/unix/xotcl.spec.in (revision 0) @@ -1,56 +0,0 @@ -Summary: Object Oriented Extension for Tcl -Name: xotcl -Version: @PACKAGE_VERSION@ -Release: 0 -License: bsd style open source -Group: Development/Languages -Source: http://www.xotcl.org/xotcl-@PACKAGE_VERSION@.tar.gz -URL: http://www.xotcl.org -Packager: Gustaf.Neumann@wu-wien.ac.at -Distribution: Fedorea Core 7 -Requires: tcl -Prefix: /usr -BuildRoot: %{_tmppath}/%{name}-root -BuildRequires: autoconf - -%description -XOTcl is an object-oriented scripting language based on MIT's OTcl. -This packages provides a pre-packaged tcl-shell (xotclsh) and tk-shell -(xowish) together with the Tcl-extension (libxotcl.so) which can be -loaded to any Tcl-application. Furthermore it includes several -xotcl-based packages for e.g. HTTP client and server, XML, RDF, -persistent object store, mobile code system, etc. For more details -consult http://www.xotcl.org - -%prep -%setup -q -n xotcl-@PACKAGE_VERSION@ - - -%build -autoconf -# ./configure --with-tcl=/usr/lib --with-all --prefix=@prefix@ --exec-prefix=@prefix@ -./configure --with-tcl=/usr/lib --with-all --prefix=/usr --exec-prefix=/usr -# make CFLAGS_DEFAULT='-O3 -mcpu=i686 -Wall -fomit-frame-pointer' -make CFLAGS_DEFAULT='-O3 -Wall -fomit-frame-pointer' - -%install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install -rm -f $RPM_BUILD_ROOT/usr/lib/libxotcl@PACKAGE_VERSION@.so -ln -s xotcl@PACKAGE_VERSION@/libxotcl@PACKAGE_VERSION@.so $RPM_BUILD_ROOT/usr/lib - -%files -%defattr(-, root, root) -%doc doc -%_bindir/xotclsh -%_bindir/xowish -%_prefix/lib/xotcl@PACKAGE_VERSION@ -%_prefix/lib/libxotcl@PACKAGE_VERSION@.so -%_prefix/lib/xotclexpat* -%_prefix/lib/xotclgdbm* -%_prefix/lib/xotclsdbm* -%_prefix/lib/xotclConfig.sh -%_includedir/xotcl.h -%_includedir/xotclInt.h -%_includedir/xotclDecls.h -%_includedir/xotclIntDecls.h \ No newline at end of file Index: xotcl/win/Makefile.vc =================================================================== diff -u -N --- xotcl/win/Makefile.vc (revision 78e82b3563a644f2df47320eacc693f1b788b03c) +++ xotcl/win/Makefile.vc (revision 0) @@ -1,442 +0,0 @@ -###################################################################### -# -# Microsoft Visual C++ makefile for XOTcl -# -# do not edit in this file, edit "configs.vc" -# -###################################################################### - -!include "configs.vc" - -BINROOT = . -ROOT = .. -NAMEPREFIX = lib -NAME = xotcl -STUBSUFFIX = stub - -XOTCL_DIR = .. -XOTCL_BUILD_DIR = ..\win -SDBM_DIR = ..\library\store\XOTclSdbm -EXPAT_DIR = ..\library\xml\TclExpat-1.1 -MAKE_XOTCL = .\library\lib\make.xotcl - -MAKECMD = nmake.exe -nologo /$(MAKEFLAGS) -f makefile.vc - -######################################################################## - -lflags = /NODEFAULTLIB /NOLOGO /MACHINE:$(MACHINE) $(libpath32) -conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup -guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup - -!IF "$(MACHINE)" == "PPC" -libc = libc$(DBGX).lib -libcdll = crtdll$(DBGX).lib -!ELSE -libc = libc$(DBGX).lib oldnames.lib -libcdll = msvcrt$(DBGX).lib oldnames.lib -!ENDIF - -baselibs = kernel32.lib $(optlibs) advapi32.lib user32.lib -winlibs = $(baselibs) gdi32.lib comdlg32.lib winspool.lib - -guilibs = $(libc) $(winlibs) -conlibs = $(libc) $(baselibs) -guilibsdll = $(libcdll) $(winlibs) -conlibsdll = $(libcdll) $(baselibs) - -######################################################################## - -!if $(DEBUG) -TMPNAME = Debug -DBGX = d -!else -TMPNAME = Release -DBGX = -!endif - -TMP_DIR = $(BINROOT)\$(TMPNAME) - -!ifndef OUT_DIR -OUT_DIR = $(TMP_DIR) -!endif - -!if $(STATIC_BUILD) -XOTCLOUTNAME = $(NAMEPREFIX)$(NAME)$(XOTCL_VERSION)$(DBGX) -XOTCLTARGET = "$(OUT_DIR)\$(XOTCLOUTNAME).lib" -!else -XOTCLOUTNAME = $(NAMEPREFIX)$(NAME)$(XOTCL_VERSION)$(DBGX) -XOTCLIMPLIB = "$(OUT_DIR)\$(XOTCLOUTNAME).lib" -XOTCLTARGET = "$(OUT_DIR)\$(XOTCLOUTNAME).dll" -!endif - -TCLSTUBLIB = "$(TCLROOT)\win\Release\tclstub$(TCL_VERSION).lib" -TCLIMPLIB = "$(TCLROOT)\win\$(OUT_DIR)\tcl$(TCL_VERSION)$(DBGX).lib" -TKIMPLIB = "$(TKROOT)\win\$(OUT_DIR)\tk$(TCL_VERSION)$(DBGX).lib" -TCLSH = "$(TCLROOT)\win\$(OUT_DIR)\tclsh$(TCL_VERSION)$(DBGX).exe" - -XOTCLSTUBLIBNAME = $(NAMEPREFIX)$(NAME)$(STUBSUFFIX)$(XOTCL_VERSION)$(DBGX).lib -XOTCLSTUBLIB = "$(OUT_DIR)\$(XOTCLSTUBLIBNAME)" - -LIB_INSTALL_DIR = $(INSTALLDIR)\lib -BIN_INSTALL_DIR = $(INSTALLDIR)\bin -SCRIPT_INSTALL_DIR = $(INSTALLDIR)\lib\xotcl$(XOTCL_DOTVERSION) -INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include - -XOTCLOBJS_STUB = $(TMP_DIR)\xotclStubInit.obj -COMPILE_XOTCL_STUBS = -DCOMPILE_XOTCL_STUBS=1 - -!if $(TCLMAJOR) == 8 -!if $(TCLMINOR) == 0 -XOTCLOBJS_STUB = "" -COMPILE_XOTCL_STUBS="" -!endif -!endif - -XOTCLOBJS = $(XOTCLOBJS_STUB) \ - $(TMP_DIR)\xotcl.obj \ - $(TMP_DIR)\xotclError.obj \ - $(TMP_DIR)\xotclMetaData.obj \ - $(TMP_DIR)\xotclObjectData.obj \ - $(TMP_DIR)\xotclProfile.obj \ - $(TMP_DIR)\xotclTrace.obj \ - $(TMP_DIR)\xotclShadow.obj \ - $(TMP_DIR)\xotclUtil.obj \ - $(TMP_DIR)\aolstub.obj \ -!if $(STATIC_BUILD) == 0 - $(TMP_DIR)\dllEntryPoint.obj \ - $(TMP_DIR)\dllResource.obj \ -!endif - -XOTCLSHOBJS = $(TMP_DIR)\xotclAppInit.obj -XOWISHOBJS = $(TMP_DIR)\winMain.obj - -XOTCLSTUBOBJS = \ - $(TMP_DIR)\xotclStubLib.obj - -WINDIR = $(ROOT)\win -GENERICDIR = $(ROOT)\generic -RCDIR = $(ROOT)\win\rc - -###################################################################### -# Link flags -###################################################################### - -!if $(DEBUG) -ldebug = -debug:full -debugtype:cv -!else -ldebug = -release -!endif - -# declarations common to all linker options -lcommon = -nologo -link50compat -machine:$(MACHINE) - -XOTCL_LFLAGS = $(lcommon) $(ldebug) -subsystem:windows -dll - -!if $(USE_TCL_STUBS) == 0 -XOTCL_LLIBS = $(TCLIMPLIB) -!else -XOTCL_LLIBS = $(TCLSTUBLIB) -!endif - -###################################################################### -# Compile flags -###################################################################### - -!if !$(DEBUG) -# This cranks the optimization level to maximize speed -cdebug = -O2 -Gs -!else if "$(MACHINE)" == "IA64" -cdebug = -Od -Zi -!else -cdebug = -Z7 -Od -WX -DBGX = d -!endif - -!if $(STATIC_BUILD) -cdll = -!else -cdll = -GD -!endif - -# declarations common to all compiler options -ccommon = -nologo -c -W3 -YX \ - - -!if $(STATIC_BUILD) && $(NOMSVCRT) -crt = -MT$(DBGX) -!else -crt = -MD$(DBGX) -!endif - -TCL_INCLUDES = -I"$(TCLROOT)\generic" -TK_INCLUDES = -I"$(TKROOT)\generic" -I$(TKROOT)\win -I$(TKROOT)\xlib - -XOTCL_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) -XOTCL_DEFINES = -DBUILD_$(NAME) -DTCL_THREADS=1 \ - -DXOLIBPKG=$(INST_XOLIBPKG) \ - -DXOTCLVERSION=$(XOTCLVERSION) \ - -DPACKAGE_VERSION=$(PACKAGE_VERSION) \ - -DXOTCLPATCHLEVEL=$(XOTCLPATCHLEVEL) \ - -D__WIN32__ -DVISUAL_CC $(COMPILE_XOTCL_STUBS) - -XOTCL_EXE_CFLAGS = $(ccommon) $(cdebug) $(crt) $(cdll) $(XOTCL_INCLUDES) \ - $(XOTCL_DEFINES) $(TCL_INCLUDES) $(TK_INCLUDES) - -!if $(USE_TCL_STUBS) -XOTCL_CFLAGS = $(XOTCL_EXE_CFLAGS) -DUSE_TCL_STUBS -!else -XOTCL_CFLAGS = $(XOTCL_EXE_CFLAGS) -!endif - -###################################################################### -# Project specific targets -###################################################################### - -all : libs packages end - -#xotcl : xotclsh xowish - -libs : setup $(XOTCLTARGET) $(XOTCLSTUBLIB) ./pkgIndex.tcl - cd $(SDBM_DIR) - $(MAKECMD) - cd ..\.. - cd $(EXPAT_DIR) - $(MAKECMD) - cd ..\..\..\win - -end: - @echo ************************************************************ - @echo * - @echo * Make completed. - @echo * - @echo * In order to test XOTcl, invoke: - @echo * - @echo * nmake -fmakefile.vc test - @echo * - @echo * In order install XOTcl, invoke the installWin.tcl - @echo * installation script, like: - @echo * - @echo * tclsh83 installWin.tcl c:\Progra~1 - @echo * - @echo * or: - @echo * - @echo * nmake -fmakefile.vc install - @echo * - @echo * To run XOTcl from the local directory, set the environment - @echo * variable TCLLIBPATH to the toplevel directory of xotcl and - @echo * execute tclsh: - @echo * - @echo * set TCLLIBPATH=$(ROOT) - @echo * tclsh83 - @echo * package require XOTcl; namespace import -force xotcl::* - @echo * - @echo ************************************************************ - -packages : libs - cd ..\library - set TCLLIBPATH=$(ROOT) - $(TCLSH) ..\$(MAKE_XOTCL) -target $(INST_XOLIBPKG) -all - cd ..\win - -install : all - set TCLLIBPATH=$(ROOT) - $(TCLSH) .\installWin.tcl - -test : $(TCLSH) - set TCLLIBPATH=$(ROOT) - $(TCLSH) $(ROOT)\tests\speedtest.xotcl - $(TCLSH) $(ROOT)\tests\testx.xotcl - $(TCLSH) $(ROOT)\tests\testo.xotcl - $(TCLSH) $(ROOT)\tests\forwardtest.xotcl - $(TCLSH) $(ROOT)\tests\actiweb.test - $(TCLSH) $(ROOT)\tests\persistence.test - $(TCLSH) $(ROOT)\tests\xoRDF.test - $(TCLSH) $(ROOT)\tests\xocomm.test - -tar : distclean - cd .. - tar cvfz xotcl-$(FULLVERSION).tar.gz xotcl-$(FULLVERSION)/* - cd xotcl-$(FULLVERSION) - - -./pkgIndex.tcl : $(XOTCLTARGET) - echo package ifneeded XOTcl $(XOTCL_VERSION) [list load [file join $$dir $(TMPNAME)/$(XOTCLOUTNAME).dll] XOTcl] > \ - ".\pkgIndex.tcl" - -setup : - @$(vcvars) > nul - @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) &\ - echo Created directory '$(TMP_DIR)' - @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) &\ - echo Created directory '$(OUT_DIR)' - -$(XOTCLTARGET) : $(XOTCLOBJS) -!if $(STATIC_BUILD) - $(lib32) -nologo -machine:$(MACHINE) -out:$@ @<< -!else - $(link32) $(XOTCL_LFLAGS) -base:@$(XOTCL_DIR)\win\dllBase.txt,$@ -out:$@ $(XOTCL_LLIBS) @<< -!endif - $(XOTCLOBJS) -<< - -#!if $(DEBUG) == 0 -$(XOTCLSTUBLIB) : $(XOTCLSTUBOBJS) - $(lib32) -nologo -out:$@ $(XOTCLSTUBOBJS) -#!else -#$(XOTCLSTUBLIB) : -#!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 $(XOTCLTARGET) "$(SCRIPT_INSTALL_DIR)" -# -copy $(XOTCLSTUBLIB) "$(LIB_INSTALL_DIR)" -# copy $(ROOT)\generic\xotcl.h "$(INCLUDE_INSTALL_DIR)" -# copy $(ROOT)\generic\xotclDecls.h "$(INCLUDE_INSTALL_DIR)" -# copy $(ROOT)\library\*.* "$(SCRIPT_INSTALL_DIR)" -# echo package ifneeded XOTcl $(XOTCL_DOTVERSION) [list load [file join $$dir ../../bin $(XOTCLOUTNAME).dll] XOTcl] > \ -# "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl" - -###################################################################### -# Regenerate the stubs files. -###################################################################### - -genstubs: - $(TCLSH) $(TCLROOT)\tools\genStubs.tcl $(GENERICDIR) \ - $(GENERICDIR)\xotcl.decls $(GENERICDIR)\xotclInt.decls - -###################################################################### -# Special case object file targets -###################################################################### - -# 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)\xotclStubLib.obj : $(GENERICDIR)\xotclStubLib.c - $(cc32) -DSTATIC_BUILD $(XOTCL_EXE_CFLAGS) -Zl -Fo$@ $? - -$(TMP_DIR)\dllResource.obj : $(TMP_DIR)\xotcl.res - $(cvtres32) -nologo -machine:$(MACHINE) -out:$@ $? - -predefined : $(GENERICDIR)\predefined.xotcl - cd $(GENERICDIR) - $(TCLSH) mk_predefined.xotcl > predefined.h - cd ..\win - -###################################################################### -# Inference rules. Use batch-mode when supported. -###################################################################### - -$(TMP_DIR)\xotclAppInit.obj : $(GENERICDIR)\xotclAppInit.c - $(cc32) $(XOTCL_EXE_CFLAGS) -Fo$@ $? - -$(TMP_DIR)\findXOTcl.obj : $(GENERICDIR)\findXOTcl.c - $(cc32) $(XOTCL_EXE_CFLAGS) -Fo$@ $? - -$(TMP_DIR)\winMain.obj : $(WINDIR)\winMain.c - $(cc32) $(XOTCL_EXE_CFLAGS) -Fo$@ $? - - - -!if $(_NMAKE_VER) < 162 -{$(WINDIR)}.c{$(TMP_DIR)}.obj : -!else -{$(WINDIR)}.c{$(TMP_DIR)}.obj :: -!endif - $(cc32) -DDLL_BUILD $(XOTCL_CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -!if $(_NMAKE_VER) < 162 -{$(GENERICDIR)}.c{$(TMP_DIR)}.obj : -!else -{$(GENERICDIR)}.c{$(TMP_DIR)}.obj :: -!endif - $(cc32) -DDLL_BUILD $(XOTCL_CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -XOTCL_VERSION_DEFINES = \ - -DXOTCL_MAJOR_VERSION=$(XOTCL_MAJOR_VERSION) \ - -DXOTCL_MINOR_VERSION=$(XOTCL_MINOR_VERSION) \ - -DXOTCL_VERSION=\"$(XOTCL_VERSION)\" - - -{$(RCDIR)}.rc{$(TMP_DIR)}.res : - $(rc32) -fo $@ -DDEBUG=$(DEBUG) $(XOTCL_VERSION_DEFINES) $(XOTCL_INCLUDES) $(TCL_INCLUDES) $(XOTCL_DEFINES) $< - -###################################################################### -# Clean up -###################################################################### - -tidy : - -del $(TMP_DIR)\*.pch - -del $(TMP_DIR)\*.obj - -del $(TMP_DIR)\*.res - -del .\*.pdb - -del .\*.pch - cd $(SDBM_DIR) - $(MAKECMD) tidy - cd ..\.. - cd $(EXPAT_DIR) - $(MAKECMD) tidy - cd ..\..\..\win - -clean : - -del $(TMP_DIR)\*.pch - -del $(TMP_DIR)\*.obj - -del $(TMP_DIR)\*.res - -del .\*.pdb - -del .\*.pch - -del $(OUT_DIR)\*.exp - -del $(OUT_DIR)\*.lib - -del $(OUT_DIR)\*.dll - -del ..\*.exp - -del ..\*.lib - -del ..\xotclsh.exe - -del ..\xowish.exe - cd $(SDBM_DIR) - $(MAKECMD) clean - cd ..\.. - cd $(EXPAT_DIR) - $(MAKECMD) clean - cd ..\..\..\win - -distclean : clean - -rmdir $(OUT_DIR) - -rmdir $(TMP_DIR) - cd $(SDBM_DIR) - $(MAKECMD) distclean - cd ..\.. - cd $(EXPAT_DIR) - $(MAKECMD) distclean - cd ..\..\..\win - -# -# tar -# - -tar : distclean - cd ..\.. - tar cvfz xotcl-$(FULLVERSION).tar.gz xotcl-$(FULLVERSION)/* - cd xotcl-$(FULLVERSION)\win - -# -# XOTcl Shells -# -../xotclsh.exe: $(XOTCLSHOBJS) $(TCLIMPLIB) $(TMP_DIR)\xotcl.res - $(link32) $(ldebug) $(conlflags) $(TMP_DIR)\xotcl.res -stack:2300000 \ - -out:$@ $(conlibsdll) $(TCLIMPLIB) $(XOTCLSHOBJS) - -../xowish.exe: $(XOWISHOBJS) $(TCLIMPLIB) $(TKIMPLIB) $(TMP_DIR)\xotcl.res - $(link32) $(ldebug) $(guilflags) $(TMP_DIR)\xotcl.res -out:$@ \ - $(guilibsdll) $(TCLIMPLIB) $(TKIMPLIB) $(XOTCLLIB) $(XOWISHOBJS) - - -xotclsh: ../xotclsh.exe -xowish: ../xowish.exe - -xotclshells: xotclsh xowish Index: xotcl/win/configs.vc =================================================================== diff -u -N --- xotcl/win/configs.vc (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/win/configs.vc (revision 0) @@ -1,135 +0,0 @@ -# -# Config file for MS Visual CC compile with nmake; only edit in this file -# - -# are we using MSVC++ version 5 or 6 ? -MSDEV_VER = 6 - -# Where is MSVC++ located? -MSDEVROOT = c:\progra~1\Micros~3\ - -# Where is Tcl and Tk? Which Version? -#TCLMAJOR = 8 -#TCLMINOR = 3 -#TCLPATCHLEVEL = .5 -TCLMAJOR = 8 -TCLMINOR = 4 -TCLPATCHLEVEL = .13 - -TCLROOT = c:\work\tcl\tcl$(TCLMAJOR).$(TCLMINOR)$(TCLPATCHLEVEL) -TKROOT = c:\tk$(TCLMAJOR).$(TCLMINOR)$(TCLPATCHLEVEL) - -TCL_VERSION = $(TCLMAJOR)$(TCLMINOR) -TCL_DOTVERSION = $(TCLMAJOR).$(TCLMINOR) - -# Where will we install XOTcl? Usually use the installWin.tcl script -INSTALLDIR = c:/progra~1/tcl - -# machine setting, pick from: -# ALPHA|ARM|IX86|MIPS|MIPS16|MIPSR41XX|PPC|SH3|SH4 -# Or set to IA64 to rearrange everything to use the Intel IA64 SDK. -# -MACHINE = IX86 - -!if "$(MACHINE)" == "IA64" -vcvars = "c:\ia64sdk17\vcvars32.bat" -!elseif $(MSDEV_VER) == 5 -vcvars = "$(MSDEVROOT)\vc\bin\vcvars32.bat" -!elseif $(MSDEV_VER) == 6 -vcvars = "$(MSDEVROOT)\vc98\bin\vcvars32.bat" -!endif - -# the VCC tools names -rc32 = rc -cc32 = cl -link32 = link -lib32 = lib -cvtres32 = cvtres - -# -# XOTCL VERSION SETTINGS (do not edit) -# -XOTCL_MAJOR_VERSION=1 -XOTCL_MINOR_VERSION=5 -XOTCL_RELEASE_LEVEL=.0 - -MAJOR_VERSION=$(XOTCL_MAJOR_VERSION) -MINOR_VERSION=$(XOTCL_MINOR_VERSION) -PATCHLEVEL=$(XOTCL_RELEASE_LEVEL) - -XOTCL_VERSION= $(MAJOR_VERSION).$(MINOR_VERSION) -FULLVERSION= $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCHLEVEL) -NODOT_VERSION= $(MAJOR_VERSION)$(MINOR_VERSION) -INST_XOLIBPKG = \"$(INSTALLDIR)/lib/xotcl$(MAJOR_VERSION).$(MINOR_VERSION)\" -XOTCLVERSION = \"$(XOTCL_VERSION)\" -PACKAGE_VERSION = \"$(FULLVERSION)\" -XOTCLPATCHLEVEL= \"$(PATCHLEVEL)\" - -## command line rules - -!ifndef HAVE_RULES -HAVE_RULES = 1 - -# Set DEBUG to 1 to compile with symbols. -!ifndef DEBUG -DEBUG = 0 -!endif - -# Set STATIC_BUILD to 1 to make a static library rather -# than a dll. -!ifndef STATIC_BUILD -STATIC_BUILD = 0 -!endif - -# Set USE_TCL_STUBS to 0 to disable Stubs support. Stubs -# will work fine even with static libraries, but you may -# disable it if you want to. -# -!ifndef USE_TCL_STUBS -!if $(STATIC_BUILD) == 0 -USE_TCL_STUBS = 1 -!else -USE_TCL_STUBS = 0 -!endif -!endif - -# no stubs support in Tcl 8.0 -!if $(TCLMAJOR) == 8 -!if $(TCLMINOR) == 0 -USE_TCL_STUBS = 0 -!endif -!endif - -# Set NOMSVCRT to 1 to use libcmt(d).lib instead of the -# dynamic run-time. -# -!ifndef NOMSVCRT -!if $(STATIC_BUILD) -NOMSVCRT = 1 -!else -NOMSVCRT = 0 -!endif -!endif - -!if $(STATIC_BUILD) == 0 && $(NOMSVCRT) == 1 -!error "The static runtime in a loadable (dll) extension is a useless configuration that will cause abnormal and unnecessary code bloat." -!endif - -!endif #!ifndef HAVE_RULES - -_NMAKE_VER = $(_NMAKE_VER:6.00.8168.0=600) - -!IF "$(MACHINE)" == "IA64" -TOOLS32 = c:\ia64sdk17 -TOOLS32_rc = c:\ia64sdk17 -!ELSE -TOOLS32 = $(MSDEVROOT)\Vc98 -TOOLS32_rc = $(MSDEVROOT)\Common\MsDev98 -!ENDIF - -cc32 = "$(TOOLS32)\bin\cl.exe" -link32 = "$(TOOLS32)\bin\link.exe" -rc32 = "$(TOOLS32_rc)\bin\rc.exe" -include32 = -I"$(TOOLS32)\include" -libpath32 = /LIBPATH:"$(TOOLS32)\lib" -lib32 = "$(TOOLS32)\bin\lib.exe" Index: xotcl/win/dllBase.txt =================================================================== diff -u -N --- xotcl/win/dllBase.txt (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/win/dllBase.txt (revision 0) @@ -1,19 +0,0 @@ -; -; This file defines the virtual base addresses for the Dynamic Link Libraries -; that are part of the XOTcl system. The first token on a line is the key (or -; name of the DLL) and the second token is the virtual base address, in hexidecimal. -; The third token is the maximum size of the DLL image file, including symbols. -; -; Using a specified "prefered load address" should speed loading time by avoiding -; relocations (NT supported only). It is assumed extension authors will contribute -; their modules to this grand-master list. You can use the dumpbin utility with -; the /headers option to get the "size of image" data (already in hex). If the -; maximum size is too small a linker warning will occur. Modules can overlap when -; they're mutually exclusive. This info is placed in the DLL's PE header by the -; linker with the `-base:@$(XOTCL_DIR)\win\dllBase.txt,` option. -; -; RCS: @(#) $$ - -.\Release\libxotcl1.1.dll 0x67000000 0x00020000 -.\Release\libxotclsdbm1.1.dll 0x67020000 0x00010000 -.\Release\libxotclexpat1.1.dll 0x67030000 0x00020000 Index: xotcl/win/dllEntryPoint.c =================================================================== diff -u -N --- xotcl/win/dllEntryPoint.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/win/dllEntryPoint.c (revision 0) @@ -1,52 +0,0 @@ -/* - * dllEntryPoint.c -- - * - * This file implements the Dll entry point as needed by Windows. - */ - -#define WIN32_LEAN_AND_MEAN -#include - -#ifdef _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 - -/* - *---------------------------------------------------------------------- - * - * DllEntryPoint -- - * - * This wrapper function is used by Windows to invoke the - * initialization code for the DLL. If we are compiling - * with Visual C++, this routine will be renamed to DllMain. - * - * Results: - * Returns TRUE; - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -#ifndef STATIC_BUILD - -BOOL APIENTRY -DllEntryPoint(hInst, reason, reserved) - HINSTANCE hInst; /* Library instance handle. */ - DWORD reason; /* Reason this function is being called. */ - LPVOID reserved; /* Not used. */ -{ - return TRUE; -} - -#endif \ No newline at end of file Index: xotcl/win/installWin.tcl =================================================================== diff -u -N --- xotcl/win/installWin.tcl (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/win/installWin.tcl (revision 0) @@ -1,136 +0,0 @@ -# $Id: installWin.tcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ -if {$::argc > 0} { - set DESTINATION [lindex $argv 0] -} else { - # if now argument is given -> set to default - set DESTINATION "/Progra~1/Tcl" -} - -puts "Installing to Directory: $DESTINATION" - -#rename file tcl_file -#proc file args { -# puts stderr "...$args" -# eval ::tcl_file $args -#} - -# -# find out the XOTcl version -# -cd .. -set xotclDir . -set buildDir $xotclDir/win/Release -cd $buildDir -set xotcllib [lindex [glob -nocomplain libxotcl*.dll] 0] -cd ../.. -regexp {^libxotcl([0-9]\.[0-9]).dll$} $xotcllib _ xotclVersion -puts "XOTcl Version is $xotclVersion" -set MAKEXOTCL $xotclDir/library/lib/make.xotcl - -# -# copy binaries -# -file mkdir $DESTINATION/bin -set bin "xotclsh.exe xowish.exe" -foreach b $bin { - if {[file exists $buildDir/$b]} { - puts "Copying $b" - file copy -force $buildDir/$b $DESTINATION/bin - } elseif {[file exists $xotclDir/$b]} { - puts "Copying $b" - file copy -force $xotclDir/$b $DESTINATION/bin - } -} - -# -# copy libraries -# -file mkdir $DESTINATION/include -set includes "xotcl.h xotclInt.h xotclDecls.h xotclIntDecls.h" -foreach i $includes { - puts "Copying $i" - file copy -force $xotclDir/generic/$i $DESTINATION/include -} - -# -# create the XOTcl library directory -# -puts "Creating XOTcl Lib Dir" -file mkdir $DESTINATION/lib -file mkdir $DESTINATION/lib/xotcl$xotclVersion - -# -# copy the dll -# -set b libxotcl${xotclVersion}.dll -if {[file exists $buildDir/$b]} { - puts "Copying $b" - file copy -force $buildDir/$b $DESTINATION/lib -} elseif {[file exists $xotclDir/$b]} { - puts "Copying $b" - file copy -force $xotclDir/$b $DESTINATION/lib -} - -# -# create a pkgindex file for xotcl in the library directoy -# -#file mkdir $DESTINATION/lib/xotcl$xotclVersion/libxotcl -puts "Creating pkgindex files for xotcl in the library directory" -#set pkgIndex "package ifneeded XOTcl $xotclVersion \[list load \[file join \$dir ../../../bin \"libxotcl${xotclVersion}.dll\"\] XOTcl\]" -#set F [open $DESTINATION/lib/xotcl$xotclVersion/libxotcl/pkgIndex.tcl w] -#puts $F $pkgIndex -#puts $F "\n" -#close $F -## and one in the xotcl- directory -set pkgIndex "package ifneeded XOTcl $xotclVersion \[list load \[file join \$dir ../../ \"libxotcl${xotclVersion}.dll\"\] XOTcl\]" -file mkdir $DESTINATION/lib/xotcl$xotclVersion/xotcl -set F [open $DESTINATION/lib/xotcl$xotclVersion/xotcl/pkgIndex.tcl w] -puts $F $pkgIndex -puts $F "\n" -close $F - -proc copyDir {dir dest} { - puts "Copying directory: $dir" - set files [glob -nocomplain $dir/*] - foreach f $files { - doDir $f $dest - } -} - -proc doDir {f dest} { - if {[file isdirectory $f]} { - file mkdir $dest/$f - copyDir $f $dest - } else { - file copy -force $f $dest/$f - } -} - -cd library - -foreach f [glob -nocomplain *] { - doDir $f $DESTINATION/lib/xotcl$xotclVersion -} - -cd .. -set pwd [pwd] - -puts "Indexing the packages" -set shell [info nameofexecutable] -#puts "SHELL=$shell" -cd $DESTINATION/lib/xotcl$xotclVersion -if {[catch {exec $shell $pwd/$MAKEXOTCL -target $DESTINATION/lib/xotcl$xotclVersion -all} errMsg]} { - puts " ... resulting message: $errMsg\n" -} else { - puts " ... Package Indexing SUCCEEDED\n" -} - -puts stderr "***************************************************" -puts stderr "INSTALLATION COMPLETE." -puts stderr "\nIn order to use XOTcl set PATH to " -puts stderr " '$DESTINATION/bin' and" -puts stderr "set TCLLIBPATH to " -puts stderr " '$DESTINATION/lib/xotcl$xotclVersion'" -puts stderr "***************************************************" - - Index: xotcl/win/pkgIndex.win =================================================================== diff -u -N --- xotcl/win/pkgIndex.win (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/win/pkgIndex.win (revision 0) @@ -1,3 +0,0 @@ - package ifneeded XOTcl 1.1 [list load \ - [file join $dir ../../bin xotcl1.1.dll] XOTcl] - Index: xotcl/win/pkgIndex.win.in =================================================================== diff -u -N --- xotcl/win/pkgIndex.win.in (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/win/pkgIndex.win.in (revision 0) @@ -1,3 +0,0 @@ - package ifneeded XOTcl @VERSION@ [list load \ - [file join $dir ../../bin xotcl@VERSION@.dll] XOTcl] - Index: xotcl/win/rc/xotcl.rc =================================================================== diff -u -N --- xotcl/win/rc/xotcl.rc (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/win/rc/xotcl.rc (revision 0) @@ -1,59 +0,0 @@ -// -// Version resource script. -// - -#include - -#define RESOURCE_INCLUDED -#include - - -// -// build-up the name suffix that defines the type of build this is. -// -#if DEBUG == 1 -#define SUFFIX_DEBUG "d" -#else -#define SUFFIX_DEBUG "" -#endif - -#define SUFFIX SUFFIX_DEBUG - - -VS_VERSION_INFO VERSIONINFO - FILEVERSION XOTCL_MAJOR_VERSION ,XOTCL_MINOR_VERSION ,0 , 0 - PRODUCTVERSION XOTCL_MAJOR_VERSION ,XOTCL_MINOR_VERSION ,0 , 0 - FILEFLAGSMASK 0x3fL -#if DEBUG == 1 - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "FileDescription", "XOTcl language extension for Tcl\0" - VALUE "Authors", "Gustaf Neumann and Uwe Zdun\0" - VALUE "OriginalFilename", "xotcl" STRINGIFY(JOIN(XOTCL_MAJOR_VERSION,XOTCL_MINOR_VERSION)) SUFFIX ".dll\0" - VALUE "CompanyName", "Vienna University of Economics and Business Administration, University of Essen\0" - VALUE "FileVersion", XOTCL_VERSION - VALUE "LegalCopyright", "Copyright \251 1999-2001\0" - VALUE "ProductName", "XOTcl " XOTCL_VERSION " for Windows\0" - VALUE "ProductVersion", XOTCL_VERSION - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - - - - Index: xotcl/win/winMain.c =================================================================== diff -u -N --- xotcl/win/winMain.c (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/win/winMain.c (revision 0) @@ -1,430 +0,0 @@ -/* - * winMain.c -- - * - * Main entry point for wish and other Tk-based applications. - * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: winMain.c,v 1.1 2004/05/23 22:50:39 neumann Exp $ - */ - -#include -#define WIN32_LEAN_AND_MEAN -#include -#undef WIN32_LEAN_AND_MEAN -#include -#include -#if defined(VISUAL_CC) -# include "xotcl.h" -#else -# include -#endif - -#include "tkInt.h" - -/* - * The following declarations refer to internal Tk routines. These - * interfaces are available for use, but are not supported. - */ -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<2 -EXTERN void TkConsoleCreate(void); -EXTERN int TkConsoleInit(Tcl_Interp *interp); -#endif -/* - * Forward declarations for procedures defined later in this file: - */ - -static void setargv _ANSI_ARGS_((int *argcPtr, char ***argvPtr)); -static void WishPanic _ANSI_ARGS_(TCL_VARARGS(CONST char *,format)); - -#ifdef TK_TEST -extern int Tktest_Init(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 */ - -static BOOL consoleRequired = TRUE; - - -/* - *---------------------------------------------------------------------- - * - * WinMain -- - * - * Main entry point from Windows. - * - * Results: - * Returns false if initialization fails, otherwise it never - * returns. - * - * Side effects: - * Just about anything, since from here we call arbitrary Tcl code. - * - *---------------------------------------------------------------------- - */ - -int APIENTRY -WinMain(hInstance, hPrevInstance, lpszCmdLine, nCmdShow) - HINSTANCE hInstance; - HINSTANCE hPrevInstance; - LPSTR lpszCmdLine; - int nCmdShow; -{ - char **argv; - int argc; -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<2 - char buffer[MAX_PATH+1]; - char *p; -#endif - Tcl_SetPanicProc(WishPanic); - - /* - * Set up the default locale to be standard "C" locale so parsing - * is performed correctly. - */ - - setlocale(LC_ALL, "C"); -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION>1 - setargv(&argc, &argv); -#endif - /* - * Increase the application queue size from default value of 8. - * At the default value, cross application SendMessage of WM_KILLFOCUS - * will fail because the handler will not be able to do a PostMessage! - * This is only needed for Windows 3.x, since NT dynamically expands - * the queue. - */ - - SetMessageQueue(64); - - /* - * Create the console channels and install them as the standard - * channels. All I/O will be discarded until Tk_CreateConsoleWindow is - * called to attach the console to a text widget. - */ -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<2 - TkConsoleCreate(); - - setargv(&argc, &argv); - - /* - * Replace argv[0] with full pathname of executable, and forward - * slashes substituted for backslashes. - */ - - GetModuleFileName(NULL, buffer, sizeof(buffer)); - argv[0] = buffer; - for (p = buffer; *p != '\0'; p++) { - if (*p == '\\') { - *p = '/'; - } - } -#endif - consoleRequired = TRUE; - - Tk_Main(argc, argv, Tcl_AppInit); - return 1; -} - - -/* - *---------------------------------------------------------------------- - * - * 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 the interp's 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) { - goto error; - } - if (Tk_Init(interp) == TCL_ERROR) { - goto error; - } - Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit); - - /* - if (Xotcl_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - Tcl_StaticPackage(interp, "XOTcl", Xotcl_Init, 0); - */ - if (Tcl_PkgRequire(interp, "XOTcl", XOTCLVERSION, 1) == NULL) { - return TCL_ERROR; - } - - /* - * This is xotclsh, so import all xotcl commands by - * default into the global namespace. - */ - if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), - "::xotcl::*", /* allowOverwrite */ 1) != TCL_OK) { - return TCL_ERROR; - } - - /* - * Initialize the console only if we are running as an interactive - * application. - */ -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<2 - if (TkConsoleInit(interp) == TCL_ERROR) { - goto error; - } -#else - if (consoleRequired) { - if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) { - goto error; - } - } -#endif - -#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) { - goto error; - } - Tcl_StaticPackage(interp, "Tktest", Tktest_Init, - (Tcl_PackageInitProc *) NULL); -#endif /* TK_TEST */ - - Tcl_SetVar(interp, "tcl_rcFileName", "~/wishrc.tcl", TCL_GLOBAL_ONLY); - return TCL_OK; - -error: - WishPanic(Tcl_GetStringResult(interp)); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * WishPanic -- - * - * Display a message and exit. - * - * Results: - * None. - * - * Side effects: - * Exits the program. - * - *---------------------------------------------------------------------- - */ - -void -WishPanic TCL_VARARGS_DEF(CONST char *,arg1) -{ - va_list argList; - char buf[1024]; - CONST char *format; - - format = TCL_VARARGS_START(CONST char *,arg1,argList); - vsprintf(buf, format, argList); - - MessageBeep(MB_ICONEXCLAMATION); - MessageBox(NULL, buf, "Fatal Error in Wish", - MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND); -#ifdef _MSC_VER - DebugBreak(); -#endif - ExitProcess(1); -} -/* - *------------------------------------------------------------------------- - * - * setargv -- - * - * Parse the Windows command line string into argc/argv. Done here - * because we don't trust the builtin argument parser in crt0. - * Windows applications are responsible for breaking their command - * line into arguments. - * - * 2N backslashes + quote -> N backslashes + begin quoted string - * 2N + 1 backslashes + quote -> literal - * N backslashes + non-quote -> literal - * quote + quote in a quoted string -> single quote - * quote + quote not in quoted string -> empty string - * quote -> begin quoted string - * - * Results: - * Fills argcPtr with the number of arguments and argvPtr with the - * array of arguments. - * - * Side effects: - * Memory allocated. - * - *-------------------------------------------------------------------------- - */ - -static void -setargv(argcPtr, argvPtr) - int *argcPtr; /* Filled with number of argument strings. */ - char ***argvPtr; /* Filled with argument strings (malloc'd). */ -{ - char *cmdLine, *p, *arg, *argSpace; - char **argv; - int argc, size, inquote, copy, slashes; - - cmdLine = GetCommandLine(); /* INTL: BUG */ - - /* - * Precompute an overly pessimistic guess at the number of arguments - * in the command line by counting non-space spans. - */ - - size = 2; - for (p = cmdLine; *p != '\0'; p++) { - if ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */ - size++; - while ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */ - p++; - } - if (*p == '\0') { - break; - } - } - } - argSpace = (char *) Tcl_Alloc( - (unsigned) (size * sizeof(char *) + strlen(cmdLine) + 1)); - argv = (char **) argSpace; - argSpace += size * sizeof(char *); - size--; - - p = cmdLine; - for (argc = 0; argc < size; argc++) { - argv[argc] = arg = argSpace; - while ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */ - p++; - } - if (*p == '\0') { - break; - } - - inquote = 0; - slashes = 0; - while (1) { - copy = 1; - while (*p == '\\') { - slashes++; - p++; - } - if (*p == '"') { - if ((slashes & 1) == 0) { - copy = 0; - if ((inquote) && (p[1] == '"')) { - p++; - copy = 1; - } else { - inquote = !inquote; - } - } - slashes >>= 1; - } - - while (slashes) { - *arg = '\\'; - arg++; - slashes--; - } - - if ((*p == '\0') - || (!inquote && ((*p == ' ') || (*p == '\t')))) { /* INTL: ISO space. */ - break; - } - if (copy != 0) { - *arg = *p; - arg++; - } - p++; - } - *arg = '\0'; - argSpace = arg + 1; - } - argv[argc] = NULL; - - *argcPtr = argc; - *argvPtr = argv; -} - - -/* - *---------------------------------------------------------------------- - * - * main -- - * - * Main entry point from the console. - * - * Results: - * None: Tk_Main never returns here, so this procedure never - * returns either. - * - * Side effects: - * Whatever the applications does. - * - *---------------------------------------------------------------------- - */ - -int main(int argc, char **argv) -{ - Tcl_SetPanicProc(WishPanic); - - /* - * Set up the default locale to be standard "C" locale so parsing - * is performed correctly. - */ - - setlocale(LC_ALL, "C"); - /* - * Increase the application queue size from default value of 8. - * At the default value, cross application SendMessage of WM_KILLFOCUS - * will fail because the handler will not be able to do a PostMessage! - * This is only needed for Windows 3.x, since NT dynamically expands - * the queue. - */ - - SetMessageQueue(64); - - /* - * Create the console channels and install them as the standard - * channels. All I/O will be discarded until Tk_CreateConsoleWindow is - * called to attach the console to a text widget. - */ - - consoleRequired = FALSE; - - Tk_Main(argc, argv, Tcl_AppInit); - return 0; -} - Index: xotcl/xotcl.m4 =================================================================== diff -u -N --- xotcl/xotcl.m4 (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/xotcl.m4 (revision 0) @@ -1,139 +0,0 @@ -# xotcl.m4 -- -# -# This file provides a set of autoconf macros to help TEA-enable -# a Tcl extension. -# -# Copyright (c) 1999 Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. - -#------------------------------------------------------------------------ -# SC_PATH_XOTCLCONFIG -- -# -# Locate the xotclConfig.sh file and perform a sanity check on -# the Tcl compile flags -# -# Arguments: -# none -# -# Results: -# -# Adds the following arguments to configure: -# --with-xotcl=... -# -# Defines the following vars: -# XOTCL_BIN_DIR Full path to the directory containing -# the xotclConfig.sh file -#------------------------------------------------------------------------ - -AC_DEFUN(SC_PATH_XOTCLCONFIG, [ - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - if test x"${no_xotcl}" = x ; then - # we reset no_xotcl in case something fails here - no_xotcl=true - AC_ARG_WITH(xotcl, [ --with-xotcl directory containing xotcl configuration (xotclConfig.sh)], with_xotclconfig=${withval}) - AC_MSG_CHECKING([for XOTcl configuration]) - AC_CACHE_VAL(ac_cv_c_xotclconfig,[ - - # First check to see if --with-xotcl was specified. - if test x"${with_xotclconfig}" != x ; then - if test -f "${with_xotclconfig}/xotclConfig.sh" ; then - ac_cv_c_xotclconfig=`(cd ${with_xotclconfig}; pwd)` - else - AC_MSG_ERROR([${with_xotclconfig} directory doesn't contain xotclConfig.sh]) - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_xotclconfig}" = x ; then - for i in \ - ${srcdir}/../xotcl \ - `ls -dr ${srcdir}/../xotcl-* 2>/dev/null` \ - ${srcdir}/../../xotcl \ - `ls -dr ${srcdir}/../../xotcl-* 2>/dev/null` \ - ${srcdir}/../../../xotcl \ - `ls -dr ${srcdir}/../../../xotcl-* 2>/dev/null` \ - ${srcdir}/../../../../xotcl \ - `ls -dr ${srcdir}/../../../../xotcl-* 2>/dev/null` \ - ${srcdir}/../../../../../xotcl \ - `ls -dr ${srcdir}/../../../../../xotcl-* 2>/dev/null` ; do - if test -f "$i/xotclConfig.sh" ; then - ac_cv_c_xotclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_xotclconfig}" = x ; then - for i in `ls -d ${prefix}/lib 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` ; do - if test -f "$i/xotclConfig.sh" ; then - ac_cv_c_xotclconfig=`(cd $i; pwd)` - break - fi - done - fi - - ]) - - if test x"${ac_cv_c_xotclconfig}" = x ; then - XOTCL_BIN_DIR="# no XOTcl configs found" - AC_MSG_WARN(Can't find XOTcl configuration definitions) - exit 0 - else - no_xotcl= - XOTCL_BIN_DIR=${ac_cv_c_xotclconfig} - AC_MSG_RESULT(found $XOTCL_BIN_DIR/xotclConfig.sh) - fi - fi -]) - -#------------------------------------------------------------------------ -# SC_LOAD_XOTCLCONFIG -- -# -# Load the tclConfig.sh file -# -# Arguments: -# -# Requires the following vars to be set: -# XOTCL_BIN_DIR -# -# Results: -# -# Subst the vars: -# -#------------------------------------------------------------------------ - -AC_DEFUN(SC_LOAD_XOTCLCONFIG, [ - AC_MSG_CHECKING([for existence of $XOTCL_BIN_DIR/xotclConfig.sh]) - - if test -f "$XOTCL_BIN_DIR/xotclConfig.sh" ; then - AC_MSG_RESULT([loading]) - . $XOTCL_BIN_DIR/xotclConfig.sh - else - AC_MSG_RESULT([file not found]) - fi - - # - # The eval is required to do the TCL_DBGX substitution in the - # TCL_LIB_FILE variable - # - AC_SUBST(XOTCL_VERSION) - AC_SUBST(XOTCL_MAJOR_VERSION) - AC_SUBST(XOTCL_MINOR_VERSION) - AC_SUBST(XOTCL_RELEASE_LEVEL) - AC_SUBST(XOTCL_LIB_FILE) - AC_SUBST(XOTCL_BUILD_LIB_SPEC) - AC_SUBST(XOTCL_LIB_SPEC) - AC_SUBST(XOTCL_STUB_LIB_FILE) - AC_SUBST(XOTCL_BUILD_STUB_LIB_SPEC) - AC_SUBST(XOTCL_STUB_LIB_SPEC) - AC_SUBST(XOTCL_SRC_DIR) -]) - Index: xotcl/xotclConfig.sh =================================================================== diff -u -N --- xotcl/xotclConfig.sh (revision aabbb5f35122b456414873fb6acb13564cc37c1f) +++ xotcl/xotclConfig.sh (revision 0) @@ -1,69 +0,0 @@ -# xotclConfig.sh -- -# -# This shell script (for sh) is generated automatically by XOTcl'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 XOTcl 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, so you may need to use that -# file in addition to this one. -# -# The information in this file is specific to a single platform. - -# XOTcl's version number. -XOTCL_VERSION='1.5' -XOTCL_MAJOR_VERSION='1' -XOTCL_MINOR_VERSION='5' -XOTCL_RELEASE_LEVEL='.6' - -# String to pass to compiles to pick up includes during build -# (i.e., assuming nothing has been installed) -XOTCL_BUILD_INCLUDE_DIR='./generic' -XOTCL_BUILD_INCLUDE_SPEC="-I${XOTCL_BUILD_INCLUDE_DIR}" - -# String to pass to compiles to pick up the XOTcl includes from their -# installed directory. -XOTCL_INCLUDE_DIR="/usr/local/include/xotcl1.5.6" -XOTCL_INCLUDE_SPEC="-I$XOTCL_INCLUDE_DIR" - -# The name of the XOTcl library (may be either a .a file or a shared library): -XOTCL_LIB_FILE=libxotcl1.5.6.dylib - -# String to pass to linker to pick up the XOTcl library from its -# build directory. -XOTCL_BUILD_LIB_SPEC='-L/Users/neumann/src/xotcl-1.5.6 -lxotcl1.5.6' - -# String to pass to linker to pick up the XOTcl library from its -# installed directory. -XOTCL_LIB_SPEC='-L/usr/local/lib/xotcl1.5.6 -lxotcl1.5.6' - -# The name of the XOTcl stub library (a .a file): -# XOTCL_STUB_LIB_FILE=libxotclstub1.5.6.a - -# String to pass to linker to pick up the XOTcl stub library from its -# build directory. -XOTCL_BUILD_STUB_LIB_SPEC='-L/Users/neumann/src/xotcl-1.5.6 -lxotclstub1.5.6' - -# String to pass to linker to pick up the XOTcl stub library from its -# installed directory. -XOTCL_STUB_LIB_SPEC='-L/usr/local/lib/xotcl1.5.6 -lxotclstub1.5.6' - -# Name of the xotcl stub library with full path in build and install directory -XOTCL_BUILD_STUB_LIB_PATH='/Users/neumann/src/xotcl-1.5.6/libxotclstub1.5.6.a' -XOTCL_STUB_LIB_PATH='/usr/local/lib/xotcl1.5.6/libxotclstub1.5.6.a' - -# Location of the top-level source directories from which XOTcl -# was built. This is the directory that contains generic, unix, etc. -# If XOTcl 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 XOTcl was compiled. -XOTCL_SRC_DIR='.' - -# shared and unshared library suffix -XOTCL_SHARED_LIB_SUFFIX=1.5.6.dylib -XOTCL_UNSHARED_LIB_SUFFIX=1.5.6.a - -# the shell in whose installation dirs the xotcl package is installed -XOTCL_COMPATIBLE_TCLSH=/usr/local/bin/tclsh8.5 - Index: xotcl/xotclConfig.sh.in =================================================================== diff -u -N --- xotcl/xotclConfig.sh.in (revision 0fb94b7893b3423b536af13fa081e7190e0ec0a2) +++ xotcl/xotclConfig.sh.in (revision 0) @@ -1,69 +0,0 @@ -# xotclConfig.sh -- -# -# This shell script (for sh) is generated automatically by XOTcl'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 XOTcl 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, so you may need to use that -# file in addition to this one. -# -# The information in this file is specific to a single platform. - -# XOTcl's version number. -XOTCL_VERSION='@XOTCL_VERSION@' -XOTCL_MAJOR_VERSION='@XOTCL_MAJOR_VERSION@' -XOTCL_MINOR_VERSION='@XOTCL_MINOR_VERSION@' -XOTCL_RELEASE_LEVEL='@XOTCL_RELEASE_LEVEL@' - -# String to pass to compiles to pick up includes during build -# (i.e., assuming nothing has been installed) -XOTCL_BUILD_INCLUDE_DIR='@XOTCL_BUILD_INCLUDE_DIR@' -XOTCL_BUILD_INCLUDE_SPEC="-I${XOTCL_BUILD_INCLUDE_DIR}" - -# String to pass to compiles to pick up the XOTcl includes from their -# installed directory. -XOTCL_INCLUDE_DIR="@pkgincludedir@" -XOTCL_INCLUDE_SPEC="-I$XOTCL_INCLUDE_DIR" - -# The name of the XOTcl library (may be either a .a file or a shared library): -XOTCL_LIB_FILE=@PKG_LIB_FILE@ - -# String to pass to linker to pick up the XOTcl library from its -# build directory. -XOTCL_BUILD_LIB_SPEC='@XOTCL_BUILD_LIB_SPEC@' - -# String to pass to linker to pick up the XOTcl library from its -# installed directory. -XOTCL_LIB_SPEC='@XOTCL_LIB_SPEC@' - -# The name of the XOTcl stub library (a .a file): -# XOTCL_STUB_LIB_FILE=@PKG_STUB_LIB_FILE@ - -# String to pass to linker to pick up the XOTcl stub library from its -# build directory. -XOTCL_BUILD_STUB_LIB_SPEC='@XOTCL_BUILD_STUB_LIB_SPEC@' - -# String to pass to linker to pick up the XOTcl stub library from its -# installed directory. -XOTCL_STUB_LIB_SPEC='@XOTCL_STUB_LIB_SPEC@' - -# Name of the xotcl stub library with full path in build and install directory -XOTCL_BUILD_STUB_LIB_PATH='@XOTCL_BUILD_STUB_LIB_PATH@' -XOTCL_STUB_LIB_PATH='@XOTCL_STUB_LIB_PATH@' - -# Location of the top-level source directories from which XOTcl -# was built. This is the directory that contains generic, unix, etc. -# If XOTcl 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 XOTcl was compiled. -XOTCL_SRC_DIR='@XOTCL_SRC_DIR@' - -# shared and unshared library suffix -XOTCL_SHARED_LIB_SUFFIX=@SHARED_LIB_SUFFIX@ -XOTCL_UNSHARED_LIB_SUFFIX=@UNSHARED_LIB_SUFFIX@ - -# the shell in whose installation dirs the xotcl package is installed -XOTCL_COMPATIBLE_TCLSH=@XOTCL_COMPATIBLE_TCLSH@ - Index: xotclConfig.sh =================================================================== diff -u -N --- xotclConfig.sh (revision 0) +++ xotclConfig.sh (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,69 @@ +# xotclConfig.sh -- +# +# This shell script (for sh) is generated automatically by XOTcl'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 XOTcl 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, so you may need to use that +# file in addition to this one. +# +# The information in this file is specific to a single platform. + +# XOTcl's version number. +XOTCL_VERSION='1.5' +XOTCL_MAJOR_VERSION='1' +XOTCL_MINOR_VERSION='5' +XOTCL_RELEASE_LEVEL='.6' + +# String to pass to compiles to pick up includes during build +# (i.e., assuming nothing has been installed) +XOTCL_BUILD_INCLUDE_DIR='./generic' +XOTCL_BUILD_INCLUDE_SPEC="-I${XOTCL_BUILD_INCLUDE_DIR}" + +# String to pass to compiles to pick up the XOTcl includes from their +# installed directory. +XOTCL_INCLUDE_DIR="/usr/local/include/xotcl1.5.6" +XOTCL_INCLUDE_SPEC="-I$XOTCL_INCLUDE_DIR" + +# The name of the XOTcl library (may be either a .a file or a shared library): +XOTCL_LIB_FILE=libxotcl1.5.6.dylib + +# String to pass to linker to pick up the XOTcl library from its +# build directory. +XOTCL_BUILD_LIB_SPEC='-L/Users/neumann/src/xotcl-1.5.6 -lxotcl1.5.6' + +# String to pass to linker to pick up the XOTcl library from its +# installed directory. +XOTCL_LIB_SPEC='-L/usr/local/lib/xotcl1.5.6 -lxotcl1.5.6' + +# The name of the XOTcl stub library (a .a file): +# XOTCL_STUB_LIB_FILE=libxotclstub1.5.6.a + +# String to pass to linker to pick up the XOTcl stub library from its +# build directory. +XOTCL_BUILD_STUB_LIB_SPEC='-L/Users/neumann/src/xotcl-1.5.6 -lxotclstub1.5.6' + +# String to pass to linker to pick up the XOTcl stub library from its +# installed directory. +XOTCL_STUB_LIB_SPEC='-L/usr/local/lib/xotcl1.5.6 -lxotclstub1.5.6' + +# Name of the xotcl stub library with full path in build and install directory +XOTCL_BUILD_STUB_LIB_PATH='/Users/neumann/src/xotcl-1.5.6/libxotclstub1.5.6.a' +XOTCL_STUB_LIB_PATH='/usr/local/lib/xotcl1.5.6/libxotclstub1.5.6.a' + +# Location of the top-level source directories from which XOTcl +# was built. This is the directory that contains generic, unix, etc. +# If XOTcl 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 XOTcl was compiled. +XOTCL_SRC_DIR='.' + +# shared and unshared library suffix +XOTCL_SHARED_LIB_SUFFIX=1.5.6.dylib +XOTCL_UNSHARED_LIB_SUFFIX=1.5.6.a + +# the shell in whose installation dirs the xotcl package is installed +XOTCL_COMPATIBLE_TCLSH=/usr/local/bin/tclsh8.5 + Index: xotclConfig.sh.in =================================================================== diff -u -N --- xotclConfig.sh.in (revision 0) +++ xotclConfig.sh.in (revision c72f9f638677608fab1502cd696c8f2d6b2952f9) @@ -0,0 +1,69 @@ +# xotclConfig.sh -- +# +# This shell script (for sh) is generated automatically by XOTcl'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 XOTcl 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, so you may need to use that +# file in addition to this one. +# +# The information in this file is specific to a single platform. + +# XOTcl's version number. +XOTCL_VERSION='@XOTCL_VERSION@' +XOTCL_MAJOR_VERSION='@XOTCL_MAJOR_VERSION@' +XOTCL_MINOR_VERSION='@XOTCL_MINOR_VERSION@' +XOTCL_RELEASE_LEVEL='@XOTCL_RELEASE_LEVEL@' + +# String to pass to compiles to pick up includes during build +# (i.e., assuming nothing has been installed) +XOTCL_BUILD_INCLUDE_DIR='@XOTCL_BUILD_INCLUDE_DIR@' +XOTCL_BUILD_INCLUDE_SPEC="-I${XOTCL_BUILD_INCLUDE_DIR}" + +# String to pass to compiles to pick up the XOTcl includes from their +# installed directory. +XOTCL_INCLUDE_DIR="@pkgincludedir@" +XOTCL_INCLUDE_SPEC="-I$XOTCL_INCLUDE_DIR" + +# The name of the XOTcl library (may be either a .a file or a shared library): +XOTCL_LIB_FILE=@PKG_LIB_FILE@ + +# String to pass to linker to pick up the XOTcl library from its +# build directory. +XOTCL_BUILD_LIB_SPEC='@XOTCL_BUILD_LIB_SPEC@' + +# String to pass to linker to pick up the XOTcl library from its +# installed directory. +XOTCL_LIB_SPEC='@XOTCL_LIB_SPEC@' + +# The name of the XOTcl stub library (a .a file): +# XOTCL_STUB_LIB_FILE=@PKG_STUB_LIB_FILE@ + +# String to pass to linker to pick up the XOTcl stub library from its +# build directory. +XOTCL_BUILD_STUB_LIB_SPEC='@XOTCL_BUILD_STUB_LIB_SPEC@' + +# String to pass to linker to pick up the XOTcl stub library from its +# installed directory. +XOTCL_STUB_LIB_SPEC='@XOTCL_STUB_LIB_SPEC@' + +# Name of the xotcl stub library with full path in build and install directory +XOTCL_BUILD_STUB_LIB_PATH='@XOTCL_BUILD_STUB_LIB_PATH@' +XOTCL_STUB_LIB_PATH='@XOTCL_STUB_LIB_PATH@' + +# Location of the top-level source directories from which XOTcl +# was built. This is the directory that contains generic, unix, etc. +# If XOTcl 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 XOTcl was compiled. +XOTCL_SRC_DIR='@XOTCL_SRC_DIR@' + +# shared and unshared library suffix +XOTCL_SHARED_LIB_SUFFIX=@SHARED_LIB_SUFFIX@ +XOTCL_UNSHARED_LIB_SUFFIX=@UNSHARED_LIB_SUFFIX@ + +# the shell in whose installation dirs the xotcl package is installed +XOTCL_COMPATIBLE_TCLSH=@XOTCL_COMPATIBLE_TCLSH@ +